Merge pull request #11700 from andreubisquerra/master

If user has not used change control in TakePOS, add total invoice payment
This commit is contained in:
Laurent Destailleur 2019-08-18 01:02:46 +02:00 committed by GitHub
commit 2dbf98283a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,6 +175,9 @@ if ($action == 'valid' && $user->rights->facture->creer)
$payment->datepaye = $now;
$payment->fk_account = $bankaccount;
$payment->amounts[$invoice->id] = $amountofpayment;
// If user has not used change control, add total invoice payment
if ($amountofpayment == 0) $payment->amounts[$invoice->id] = $invoice->total_ttc;
$payment->paiementid=$paiementid;
$payment->num_payment=$invoice->ref;