diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index 9964db9ecde..94142b6ec54 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -125,7 +125,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
if ($res > 0 && $newid1 > 0 && $newid2 > 0)
{
$db->commit();
- header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id); // To avoid pb whith back
+ header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id.($backtopage?'&backtopage='.urlencode($backtopage):'')); // To avoid pb whith back
exit;
}
else
@@ -275,13 +275,13 @@ if ($socid > 0)
print '';
print '';
-
+
if ($user->rights->societe->creer)
{
print '
';
-
+
print load_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
-
+
print '
| ' . $langs->trans('Discounts');
print ' | ';
@@ -3184,7 +3201,7 @@ else if ($id > 0 || ! empty($ref))
print $langs->trans("CompanyHasNoRelativeDiscount");
// print ' ('.$addrelativediscount.')';
- // Is there commercial discount or down payment available ?
+ // Is there is commercial discount or down payment available ?
if ($absolute_discount > 0) {
print '. ';
if ($object->statut > 0 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
@@ -3209,7 +3226,7 @@ else if ($id > 0 || ! empty($ref))
} else {
if ($absolute_creditnote > 0) // If not, link will be added later
{
- if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
+ if ($object->statut == Facture::STATUS_DRAFT && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
print ' (' . $addabsolutediscount . ') ';
else
print '. ';
@@ -3220,7 +3237,7 @@ else if ($id > 0 || ! empty($ref))
if ($absolute_creditnote > 0)
{
// If validated, we show link "add credit note to payment"
- if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE) {
+ if ($object->statut != Facture::STATUS_VALIDATED || $object->type == Facture::TYPE_CREDIT_NOTE) {
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {
$text = $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency));
print $form->textwithpicto($text, $langs->trans("CreditNoteDepositUse"));
@@ -3231,13 +3248,13 @@ else if ($id > 0 || ! empty($ref))
// There is credit notes discounts available
if (! $absolute_discount) print ' ';
// $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer);
- $more=' ('.$addcreditnote.')';
+ $more=' ('.$addcreditnote. (($addcreditnote && $viewabsolutediscount) ? ' - ' : '') . $viewabsolutediscount . ')';
$form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0, $more); // We allow credit note even if amount is higher
}
}
if (! $absolute_discount && ! $absolute_creditnote) {
print $langs->trans("CompanyHasNoAbsoluteDiscount");
- if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
+ if ($object->statut == Facture::STATUS_DRAFT && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
print ' (' . $addabsolutediscount . ') ';
else
print '. ';
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index 443534eb1b3..89bb230d34f 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -78,6 +78,7 @@ class DiscountAbsolute
$sql = "SELECT sr.rowid, sr.fk_soc,";
$sql.= " sr.fk_user,";
$sql.= " sr.amount_ht, sr.amount_tva, sr.amount_ttc, sr.tva_tx,";
+ $sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,";
$sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.description,";
$sql.= " sr.datec,";
$sql.= " f.facnumber as ref_facture_source";
@@ -97,9 +98,15 @@ class DiscountAbsolute
$this->id = $obj->rowid;
$this->fk_soc = $obj->fk_soc;
+
$this->amount_ht = $obj->amount_ht;
$this->amount_tva = $obj->amount_tva;
$this->amount_ttc = $obj->amount_ttc;
+
+ $this->multicurrency_amount_ht = $obj->multicurrency_amount_ht;
+ $this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
+ $this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
+
$this->tva_tx = $obj->tva_tx;
$this->fk_user = $obj->fk_user;
$this->fk_facture_line = $obj->fk_facture_line;
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 189ef5c1fe2..df00aec79fe 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -338,6 +338,7 @@ DateIsNotEnough=Date not reached yet
InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s
WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date
WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date
+ViewAvailableGlobalDiscounts=View available discounts
# PaymentConditions
Statut=Status
PaymentConditionShortRECEP=Due Upon Receipt
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 8dfc02c49f1..e42e701bb3a 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -196,7 +196,7 @@ ErrorBadLinkSourceSetButBadValueForRef=The link you use is not valid. A 'source'
ErrorTooManyErrorsProcessStopped=Too many errors. Process was stopped.
ErrorOnlyInvoiceValidatedCanBeSentInMassAction=Only validated invoices can be sent using the "Send by email" mass action.
ErrorChooseBetweenFreeEntryOrPredefinedProduct=You must choose if article is a predefined product or not
-
+ErrorDiscountLargerThanRemainToPaySplitItBefore=The discount you try to apply is larger than remain to pay. Split the discount in 2 smaller discounts before.
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined
|