The hook "moreFamily" must return payment into var "totalpayment" and no

more "paiement" (english replace french).
This commit is contained in:
Laurent Destailleur 2019-09-03 17:39:19 +02:00
parent bd3971f0bd
commit 481a25cb8f
2 changed files with 10 additions and 10 deletions

View File

@ -18,7 +18,7 @@ Following changes may create regressions for some external modules, but were nec
* The function show_theme() hase been renamed into showSkins() * The function show_theme() hase been renamed into showSkins()
* Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency. * Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency.
* The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead. * The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead.
* The hook "moreFamily" must return payment into var "payment" and no more "paiement". * The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french).

View File

@ -213,9 +213,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$paiement = '';
$ref = ''; $ref = '';
$refcomp = ''; $refcomp = '';
$totalpayment = '';
$obj = array_shift($tab_sqlobj); $obj = array_shift($tab_sqlobj);
@ -236,7 +236,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$societestatic->name = $obj->name; $societestatic->name = $obj->name;
$refcomp=$societestatic->getNomUrl(1, '', 24); $refcomp=$societestatic->getNomUrl(1, '', 24);
$paiement = -1*$facturefournstatic->getSommePaiement(); // Payment already done $totalpayment = -1*$facturefournstatic->getSommePaiement(); // Payment already done
} }
} }
if ($obj->family == 'invoice') if ($obj->family == 'invoice')
@ -250,9 +250,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$societestatic->name = $obj->name; $societestatic->name = $obj->name;
$refcomp=$societestatic->getNomUrl(1, '', 24); $refcomp=$societestatic->getNomUrl(1, '', 24);
$paiement = $facturestatic->getSommePaiement(); // Payment already done $totalpayment = $facturestatic->getSommePaiement(); // Payment already done
$paiement+= $facturestatic->getSumDepositsUsed(); $totalpayment+= $facturestatic->getSumDepositsUsed();
$paiement+= $facturestatic->getSumCreditNotesUsed(); $totalpayment+= $facturestatic->getSumCreditNotesUsed();
} }
if ($obj->family == 'social_contribution') if ($obj->family == 'social_contribution')
{ {
@ -261,19 +261,19 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$socialcontribstatic->lib=$obj->type; $socialcontribstatic->lib=$obj->type;
$ref = $socialcontribstatic->getNomUrl(1, 24); $ref = $socialcontribstatic->getNomUrl(1, 24);
$paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done $totalpayment = -1*$socialcontribstatic->getSommePaiement(); // Payment already done
} }
$parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'payment' => $paiement); $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment);
$reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if(empty($reshook)){ if(empty($reshook)){
$ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref;
$refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp;
$paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : $paiement; $totalpayment = isset($hookmanager->resArray['totalpayment']) ? $hookmanager->resArray['totalpayment'] : $totalpayment;
} }
$total_ttc = $obj->total_ttc; $total_ttc = $obj->total_ttc;
if ($paiement) $total_ttc = $obj->total_ttc - $paiement; if ($totalpayment) $total_ttc = $obj->total_ttc - $totalpayment;
$solde += $total_ttc; $solde += $total_ttc;
// We discard lines with a remainder to pay to 0 // We discard lines with a remainder to pay to 0