Clean code
This commit is contained in:
parent
cb65903537
commit
be1ca6ebab
@ -399,7 +399,7 @@ abstract class CommonDocGenerator
|
|||||||
|
|
||||||
$sumpayed = $sumdeposit = $sumcreditnote = '';
|
$sumpayed = $sumdeposit = $sumcreditnote = '';
|
||||||
$already_payed_all = 0;
|
$already_payed_all = 0;
|
||||||
$remain_to_pay = 0;
|
|
||||||
if ($object->element == 'facture') {
|
if ($object->element == 'facture') {
|
||||||
$invoice_source = new Facture($this->db);
|
$invoice_source = new Facture($this->db);
|
||||||
if ($object->fk_facture_source > 0) {
|
if ($object->fk_facture_source > 0) {
|
||||||
@ -409,7 +409,6 @@ abstract class CommonDocGenerator
|
|||||||
$sumdeposit = $object->getSumDepositsUsed();
|
$sumdeposit = $object->getSumDepositsUsed();
|
||||||
$sumcreditnote = $object->getSumCreditNotesUsed();
|
$sumcreditnote = $object->getSumCreditNotesUsed();
|
||||||
$already_payed_all = $sumpayed + $sumdeposit + $sumcreditnote;
|
$already_payed_all = $sumpayed + $sumdeposit + $sumcreditnote;
|
||||||
$remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote;
|
|
||||||
|
|
||||||
if ($object->fk_account > 0) {
|
if ($object->fk_account > 0) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
@ -488,9 +487,9 @@ abstract class CommonDocGenerator
|
|||||||
$array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
|
$array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
|
||||||
$array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'),
|
$array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'),
|
||||||
|
|
||||||
// Remain to pay with all know information (except open direct debit requests)
|
// Remain to pay with all known information (except open direct debit requests)
|
||||||
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $remain_to_pay, 'MT'), 0, $outputlangs),
|
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $already_payed_all, 'MT'), 0, $outputlangs),
|
||||||
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT')
|
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $already_payed_all, 'MT')
|
||||||
);
|
);
|
||||||
|
|
||||||
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
|
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user