update for Moadian Plugin

This commit is contained in:
Gloomy 2025-08-03 06:12:05 +00:00
parent 8e8ea18ec9
commit 300d802ee8

View file

@ -1162,6 +1162,22 @@ class TaxSettingsController extends AbstractController
$totalTax += $item['tax']; $totalTax += $item['tax'];
} }
$buyerNationalId = null;
$buyerEconomicCode = null;
$buyerPerson = null;
foreach ($invoice->getHesabdariRows() as $row) {
if ($row->getPerson()) {
$buyerPerson = $row->getPerson();
break;
}
}
if ($buyerPerson) {
$buyerNationalId = $buyerPerson->getShenasemeli();
$buyerEconomicCode = $buyerPerson->getCodeeghtesadi();
}
$dateTime = new DateTime(); $dateTime = new DateTime();
$header = (new \SnappMarketPro\Moadian\Dto\InvoiceHeaderDto()) $header = (new \SnappMarketPro\Moadian\Dto\InvoiceHeaderDto())
->setTaxid($moadian->generateTaxId($dateTime, $internalId)) ->setTaxid($moadian->generateTaxId($dateTime, $internalId))
@ -1174,8 +1190,8 @@ class TaxSettingsController extends AbstractController
->setIns(1) ->setIns(1)
->setTins($taxId) ->setTins($taxId)
->setTob(1) ->setTob(1)
->setBid(null) ->setBid($buyerNationalId)
->setTinb(null) ->setTinb($buyerEconomicCode)
->setSbc(null) ->setSbc(null)
->setBpc(null) ->setBpc(null)
->setBbc(null) ->setBbc(null)