Skip to content

Commit

Permalink
експорт за булмар: променени контировки
Browse files Browse the repository at this point in the history
  • Loading branch information
ivelin1012 committed Mar 1, 2023
1 parent 094abf8 commit 78ee8ea
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
21 changes: 19 additions & 2 deletions bulmar/InvoiceExport.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ private function prepareRec($rec, $count)
unset($nRec->amountPaid);
}
}
} elseif($rec->paymentType == 'card'){
$nRec->amountCardPaid = $nRec->amount;
} elseif($rec->paymentType == 'postal'){
$nRec->amountPostalPaid = $nRec->amount;
}

if(round($nRec->productsAmount + $nRec->servicesAmount, 2) != round($nRec->baseAmount, 2)){
Expand Down Expand Up @@ -308,7 +312,15 @@ private function prepareFileContent(&$data)
if ($rec->amountPaid) {
$line .= "{$rec->num}|2|{$static->paymentOp}|{$static->debitPayment}|||{$rec->amountPaid}||{$static->creditPayment}|AN|$|{$rec->amountPaid}||" . "\r\n";
}


if ($rec->amountCardPaid) {
$line .= "{$rec->num}|2|{$static->pptAndCardOperation}|{$static->pptAndCardAccount}|{$static->cardAnal}||{$rec->amountCardPaid}||{$static->creditPayment}|AN|$|{$rec->amountCardPaid}||" . "\r\n";
}

if ($rec->amountPostalPaid) {
$line .= "{$rec->num}|2|{$static->pptAndCardOperation}|{$static->pptAndCardAccount}|{$static->pptAnal}||{$rec->amountPostalPaid}||{$static->creditPayment}|AN|$|{$rec->amountPostalPaid}||" . "\r\n";
}

$content .= $line;
}

Expand Down Expand Up @@ -339,7 +351,12 @@ private function getStaticData()
$staticData->creditPayment = $conf->BULMAR_INV_CREDIT_PAYMENT;
$staticData->advancePayment = $conf->BULMAR_INV_AV_OPERATION;
$staticData->creditAdvance = $conf->BULMAR_INV_CREDIT_AV;


$staticData->pptAnal = $conf->BULMAR_INV_PPT_ANAL;
$staticData->cardAnal = $conf->BULMAR_INV_CARD_PAYMENT_ANAL;
$staticData->pptAndCardAccount = $conf->BULMAR_INV_PPT_AND_CARD_PAYMENT;
$staticData->pptAndCardOperation = $conf->BULMAR_INV_PPT_AND_CARD_OPERATION;

$myCompany = crm_Companies::fetchOwnCompany();
$num = (!empty($myCompany->vatNo)) ? str_replace('BG', '', $myCompany->vatNo) : $myCompany->uicId;
$staticData->OWN_COMPANY_BULSTAT = $num;
Expand Down
14 changes: 14 additions & 0 deletions bulmar/Setup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@
defIfNot('BULMAR_INV_AV_OPERATION', '88');


/**
* Операция за картови и ППП плащания
*/
defIfNot('BULMAR_INV_PPT_AND_CARD_OPERATION', '4');


/**
* Дебитна сметка за картови и ППП плащания
*/
defIfNot('BULMAR_INV_PPT_AND_CARD_PAYMENT', 'D411');


/**
* Кредитна сметка на плащането в Bulmar Office
*/
Expand Down Expand Up @@ -331,6 +343,8 @@ class bulmar_Setup extends core_ProtoSetup
'BULMAR_INV_CREDIT_AV' => array('varchar(10)', 'caption=Експорт на ИЗХОДЯЩИ фактури->Кредитна сметка за авансово плащане'),
'BULMAR_INV_PPT_ANAL' => array('int', 'caption=Експорт на ИЗХОДЯЩИ фактури->Аналитичност за плащане с ППП'),
'BULMAR_INV_CARD_PAYMENT_ANAL' => array('int', 'caption=Експорт на ИЗХОДЯЩИ фактури->Аналитичност за плащане с карта'),
'BULMAR_INV_PPT_AND_CARD_OPERATION' => array('int', 'caption=Експорт на ИЗХОДЯЩИ фактури->Операция за картови и ППП плащания'),
'BULMAR_INV_PPT_AND_CARD_PAYMENT' => array('int', 'caption=Експорт на ИЗХОДЯЩИ фактури->Дебитна сметка за картови и ППП плащания'),

'BULMAR_PURINV_CONTR_FOLDER' => array('double', 'caption=Експорт на ВХОДЯЩИ фактури->Папка'),
'BULMAR_PURINV_PURCHASE_PRODUCTS_OPER' => array('varchar(10)', 'caption=Експорт на ВХОДЯЩИ фактури->Сч. Операция на покупка на стока №'),
Expand Down

0 comments on commit 78ee8ea

Please sign in to comment.