Update paiementfourn.class.php
This commit is contained in:
parent
a6ddc90d5b
commit
3c1bdd163f
@ -223,10 +223,10 @@ class PaiementFourn extends Paiement
|
|||||||
// If we want to closed paid invoices
|
// If we want to closed paid invoices
|
||||||
if ($closepaidinvoices) {
|
if ($closepaidinvoices) {
|
||||||
$paiement = $invoice->getSommePaiement();
|
$paiement = $invoice->getSommePaiement();
|
||||||
//$creditnotes=$invoice->getSumCreditNotesUsed();
|
$creditnotes=$invoice->getSumCreditNotesUsed();
|
||||||
$creditnotes = 0;
|
//$creditnotes = 0;
|
||||||
//$deposits=$invoice->getSumDepositsUsed();
|
$deposits=$invoice->getSumDepositsUsed();
|
||||||
$deposits = 0;
|
//$deposits = 0;
|
||||||
$alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
|
$alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
|
||||||
$remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
|
$remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
|
||||||
if ($remaintopay == 0) {
|
if ($remaintopay == 0) {
|
||||||
@ -238,7 +238,7 @@ class PaiementFourn extends Paiement
|
|||||||
// Insert one discount by VAT rate category
|
// Insert one discount by VAT rate category
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch('', $invoice->id);
|
$discount->fetch('', 0, $invoice->id);
|
||||||
if (empty($discount->id)) { // If the invoice was not yet converted into a discount (this may have been done manually before we come here)
|
if (empty($discount->id)) { // If the invoice was not yet converted into a discount (this may have been done manually before we come here)
|
||||||
$discount->discount_type = 1; // Supplier discount
|
$discount->discount_type = 1; // Supplier discount
|
||||||
$discount->description = '(DEPOSIT)';
|
$discount->description = '(DEPOSIT)';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user