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'];
}
$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();
$header = (new \SnappMarketPro\Moadian\Dto\InvoiceHeaderDto())
->setTaxid($moadian->generateTaxId($dateTime, $internalId))
@ -1174,8 +1190,8 @@ class TaxSettingsController extends AbstractController
->setIns(1)
->setTins($taxId)
->setTob(1)
->setBid(null)
->setTinb(null)
->setBid($buyerNationalId)
->setTinb($buyerEconomicCode)
->setSbc(null)
->setBpc(null)
->setBbc(null)