Merge pull request #18548 from henrynopo/patch-17
Fix error of SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED
This commit is contained in:
commit
f0a68d728a
@ -834,7 +834,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// If some payments were already done, we change the amount to pay using same prorate
|
||||
if (!empty($conf->global->INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED)) {
|
||||
if (!empty($conf->global->INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) && $object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
$alreadypaid = $object->getSommePaiement(); // This can be not 0 if we allow to create credit to reuse from credit notes partially refunded.
|
||||
if ($alreadypaid && abs($alreadypaid) < abs($object->total_ttc)) {
|
||||
$ratio = abs(($object->total_ttc - $alreadypaid) / $object->total_ttc);
|
||||
|
||||
@ -538,7 +538,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// If some payments were already done, we change the amount to pay using same prorate
|
||||
if (!empty($conf->global->SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED)) {
|
||||
if (!empty($conf->global->SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED) && $object->type == FactureFournisseur::TYPE_CREDIT_NOTE) {
|
||||
$alreadypaid = $object->getSommePaiement(); // This can be not 0 if we allow to create credit to reuse from credit notes partially refunded.
|
||||
if ($alreadypaid && abs($alreadypaid) < abs($object->total_ttc)) {
|
||||
$ratio = abs(($object->total_ttc - $alreadypaid) / $object->total_ttc);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user