update for Moadian plugin
This commit is contained in:
parent
140da029a1
commit
82f872eb10
|
@ -1164,6 +1164,7 @@ class TaxSettingsController extends AbstractController
|
|||
|
||||
$buyerNationalId = null;
|
||||
$buyerEconomicCode = null;
|
||||
$buyerPostalCode = null;
|
||||
|
||||
$buyerPerson = null;
|
||||
foreach ($invoice->getHesabdariRows() as $row) {
|
||||
|
@ -1176,6 +1177,7 @@ class TaxSettingsController extends AbstractController
|
|||
if ($buyerPerson) {
|
||||
$buyerNationalId = $buyerPerson->getShenasemeli();
|
||||
$buyerEconomicCode = $buyerPerson->getCodeeghtesadi();
|
||||
$buyerPostalCode = $buyerPerson->getPostalCode();
|
||||
|
||||
if (empty($buyerNationalId) || trim($buyerNationalId) === '') {
|
||||
$buyerNationalId = null;
|
||||
|
@ -1184,6 +1186,10 @@ class TaxSettingsController extends AbstractController
|
|||
if (empty($buyerEconomicCode) || trim($buyerEconomicCode) === '') {
|
||||
$buyerEconomicCode = null;
|
||||
}
|
||||
|
||||
if (empty($buyerPostalCode) || trim($buyerPostalCode) === '' || count_chars($buyerPostalCode) != 10) {
|
||||
$buyerPostalCode = null;
|
||||
}
|
||||
}
|
||||
|
||||
$personType = 1;
|
||||
|
@ -1207,7 +1213,7 @@ class TaxSettingsController extends AbstractController
|
|||
->setBid($buyerNationalId)
|
||||
->setTinb($buyerEconomicCode)
|
||||
->setSbc(null)
|
||||
->setBpc(null)
|
||||
->setBpc($buyerPostalCode)
|
||||
->setBbc(null)
|
||||
->setFt(null)
|
||||
->setBpn(null)
|
||||
|
|
Loading…
Reference in a new issue