';
}
// For credit note
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() == 0) {
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 668090129ff..62386adbe99 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -67,6 +67,7 @@ PaidBack=Paid back
DeletePayment=Delete payment
ConfirmDeletePayment=Are you sure you want to delete this payment?
ConfirmConvertToReduc=Do you want to convert this %s into an absolute discount ? The amount will so be saved among all discounts and could be used as a discount for a current or a future invoice for this customer.
+ConfirmConvertToReducSupplier=Do you want to convert this %s into an absolute discount ? The amount will so be saved among all discounts and could be used as a discount for a current or a future invoice for this supplier.
SupplierPayments=Suppliers payments
ReceivedPayments=Received payments
ReceivedCustomersPayments=Payments received from customers
@@ -91,7 +92,7 @@ PaymentAmount=Payment amount
ValidatePayment=Validate payment
PaymentHigherThanReminderToPay=Payment higher than reminder to pay
HelpPaymentHigherThanReminderToPay=Attention, the payment amount of one or more bills is higher than the rest to pay. Edit your entry, otherwise confirm and think about creating a credit note of the excess received for each overpaid invoices.
-HelpPaymentHigherThanReminderToPaySupplier=Attention, the payment amount of one or more bills is higher than the rest to pay. Edit your entry, otherwise confirm.
+HelpPaymentHigherThanReminderToPaySupplier=Attention, the payment amount of one or more bills is higher than the rest to pay. Edit your entry, otherwise confirm and think about creating a credit note of the excess paid for each overpaid invoice.
ClassifyPaid=Classify 'Paid'
ClassifyPaidPartially=Classify 'Paid partially'
ClassifyCanceled=Classify 'Abandoned'
@@ -110,6 +111,7 @@ DoPayment=Enter payment
DoPaymentBack=Enter refund
ConvertToReduc=Convert into future discount
ConvertExcessReceivedToReduc=Convert excess received into future discount
+ConvertExcessPaidToReduc=Convert excess paid into future discount
EnterPaymentReceivedFromCustomer=Enter payment received from customer
EnterPaymentDueToCustomer=Make payment due to customer
DisabledBecauseRemainderToPayIsZero=Disabled because remaining unpaid is zero
@@ -220,6 +222,7 @@ RemainderToPayBack=Remaining amount to refund
Rest=Pending
AmountExpected=Amount claimed
ExcessReceived=Excess received
+ExcessPaid=Excess paid
EscompteOffered=Discount offered (payment before term)
EscompteOfferedShort=Discount
SendBillRef=Submission of invoice %s
@@ -284,15 +287,19 @@ Deposits=Down payments
DiscountFromCreditNote=Discount from credit note %s
DiscountFromDeposit=Down payments from invoice %s
DiscountFromExcessReceived=Payments from excess received of invoice %s
+DiscountFromExcessPaid=Payments from excess paid of invoice %s
AbsoluteDiscountUse=This kind of credit can be used on invoice before its validation
CreditNoteDepositUse=Invoice must be validated to use this kind of credits
NewGlobalDiscount=New absolute discount
NewRelativeDiscount=New relative discount
+DiscountType=Discount type
NoteReason=Note/Reason
ReasonDiscount=Reason
DiscountOfferedBy=Granted by
DiscountStillRemaining=Discounts available
DiscountAlreadyCounted=Discounts already consumed
+CustomerDiscounts=Customer discounts
+SupplierDiscounts=Supplier discounts
BillAddress=Bill address
HelpEscompte=This discount is a discount granted to customer because its payment was made before term.
HelpAbandonBadCustomer=This amount has been abandoned (customer said to be a bad customer) and is considered as an exceptional loose.
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 7d2b878c5cc..2eb1ba88e57 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -271,8 +271,10 @@ CompanyHasAbsoluteDiscount=This customer has discount available (credits notes o
CompanyHasDownPaymentOrCommercialDiscount=This customer has discount available (commercial, down payments) for %s %s
CompanyHasCreditNote=This customer still has credit notes for %s %s
CompanyHasNoAbsoluteDiscount=This customer has no discount credit available
-CustomerAbsoluteDiscountAllUsers=Absolute discounts (granted by all users)
-CustomerAbsoluteDiscountMy=Absolute discounts (granted by yourself)
+CustomerAbsoluteDiscountAllUsers=Absolute customer discounts (granted by all users)
+CustomerAbsoluteDiscountMy=Absolute customer discounts (granted by yourself)
+SupplierAbsoluteDiscountAllUsers=Absolute supplier discounts (granted by all users)
+SupplierAbsoluteDiscountMy=Absolute supplier discounts (granted by yourself)
DiscountNone=None
Supplier=Supplier
AddContact=Create contact
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 1420562da19..1a6a4be6199 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -490,7 +490,8 @@ if ($sql_select)
$txt='';
print img_object($langs->trans("ShowReduc"),'reduc').' ';
if ($objp->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
- elseif ($objp->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); // TODO handle (EXCESS PAID)
+ elseif ($objp->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived");
+ elseif ($objp->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid");
//else $txt=$langs->trans("Discount");
print $txt;
?>
@@ -510,6 +511,12 @@ if ($sql_select)
$discount->fetch($objp->fk_remise_except);
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0));
}
+ elseif ($objp->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0)
+ {
+ $discount=new DiscountAbsolute($db);
+ $discount->fetch($objp->fk_remise_except);
+ echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0));
+ }
elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0)
{
$discount=new DiscountAbsolute($db);
@@ -517,7 +524,7 @@ if ($sql_select)
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
// Add date of deposit
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')';
- } // TODO handle (EXCESS PAID)
+ }
else
{
echo ($txt?' - ':'').dol_htmlentitiesbr($objp->description);