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