New: Can add a discount directly when building invoice
This commit is contained in:
parent
e8a49fe288
commit
2cd2f001cf
@ -2065,15 +2065,18 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Relative and absolute discounts
|
// Relative and absolute discounts
|
||||||
print '<tr><td>'.$langs->trans('Discounts');
|
$addabsolutediscount=' <a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddGlobalDiscount").'</a>';
|
||||||
|
$addcreditnote=' <a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$soc->id.'&type=2&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddCreditNote").'</a>';
|
||||||
|
|
||||||
|
print '<tr><td>'.$langs->trans('Discounts');
|
||||||
print '</td><td colspan="5">';
|
print '</td><td colspan="5">';
|
||||||
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
|
||||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||||
print '. ';
|
|
||||||
|
|
||||||
if ($absolute_discount > 0)
|
if ($absolute_discount > 0)
|
||||||
{
|
{
|
||||||
if ($object->statut > 0 || $object->type == 2 || $object->type == 3)
|
print '. ';
|
||||||
|
if ($object->statut > 0 || $object->type == 2 || $object->type == 3)
|
||||||
{
|
{
|
||||||
if ($object->statut == 0)
|
if ($object->statut == 0)
|
||||||
{
|
{
|
||||||
@ -2100,9 +2103,14 @@ else
|
|||||||
// Remise dispo de type remise fixe (not credit note)
|
// Remise dispo de type remise fixe (not credit note)
|
||||||
$filter='fk_facture_source IS NULL';
|
$filter='fk_facture_source IS NULL';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$html->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id',$soc->id, $absolute_discount, $filter, $resteapayer);
|
$html->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id',$soc->id, $absolute_discount, $filter, $resteapayer, ' - '.$addabsolutediscount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' - '.$addabsolutediscount.'<br>';
|
||||||
|
else print '. ';
|
||||||
|
}
|
||||||
if ($absolute_creditnote > 0)
|
if ($absolute_creditnote > 0)
|
||||||
{
|
{
|
||||||
// If validated, we show link "add credit note to payment"
|
// If validated, we show link "add credit note to payment"
|
||||||
@ -2130,13 +2138,13 @@ else
|
|||||||
{
|
{
|
||||||
print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
|
print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
|
||||||
}
|
}
|
||||||
if ($object->statut == 0 && $object->type != 2 && $object->type != 3)
|
/*if ($object->statut == 0 && $object->type != 2 && $object->type != 3)
|
||||||
{
|
{
|
||||||
if (! $absolute_discount && ! $absolute_creditnote) print '<br>';
|
if (! $absolute_discount && ! $absolute_creditnote) print '<br>';
|
||||||
$addabsolutediscount=' <a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddDiscount").'</a>';
|
//print ' - ';
|
||||||
$addcreditnote=' <a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$soc->id.'&type=2&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddCreditNote").'</a>';
|
print $addabsolutediscount;
|
||||||
print $addabsolutediscount.' - '.$addcreditnote;
|
//print ' - '.$addcreditnote; // We disbale link to credit note
|
||||||
}
|
}*/
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date invoice
|
// Date invoice
|
||||||
|
|||||||
@ -233,7 +233,7 @@ Reductions=Reductions
|
|||||||
ReductionsShort=Reduc.
|
ReductionsShort=Reduc.
|
||||||
Discount=Discount
|
Discount=Discount
|
||||||
Discounts=Discounts
|
Discounts=Discounts
|
||||||
AddDiscount=Create discount
|
AddDiscount=Create absolute discount
|
||||||
AddCreditNote=Create credit note
|
AddCreditNote=Create credit note
|
||||||
ShowDiscount=Show discount
|
ShowDiscount=Show discount
|
||||||
RelativeDiscount=Relative discount
|
RelativeDiscount=Relative discount
|
||||||
@ -246,14 +246,14 @@ DiscountFromCreditNote=Discount from credit note %s
|
|||||||
DiscountFromDeposit=Payments from deposit invoice %s
|
DiscountFromDeposit=Payments from deposit invoice %s
|
||||||
AbsoluteDiscountUse=This kind of credit can be used on invoice before its validation
|
AbsoluteDiscountUse=This kind of credit can be used on invoice before its validation
|
||||||
CreditNoteDepositUse=Invoice must be validated to use this king of credits
|
CreditNoteDepositUse=Invoice must be validated to use this king of credits
|
||||||
NewGlobalDiscount=New fix discount
|
NewGlobalDiscount=New absolute discount
|
||||||
NewRelativeDiscount=New relative discount
|
NewRelativeDiscount=New relative discount
|
||||||
NoteReason=Note/Reason
|
NoteReason=Note/Reason
|
||||||
ReasonDiscount=Reason
|
ReasonDiscount=Reason
|
||||||
AddGlobalDiscount=Add discount
|
AddGlobalDiscount=Add discount
|
||||||
DiscountOfferedBy=Granted by
|
DiscountOfferedBy=Granted by
|
||||||
DiscountStillRemaining=Discount still remaining
|
DiscountStillRemaining=Discounts still remaining
|
||||||
DiscountAlreadyCounted=Discount already counted
|
DiscountAlreadyCounted=Discounts already counted
|
||||||
BillAddress=Bill address
|
BillAddress=Bill address
|
||||||
HelpEscompte=This discount is a discount granted to customer because its payment was made before term.
|
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.
|
HelpAbandonBadCustomer=This amount has been abandoned (customer said to be a bad customer) and is considered as an exceptional loose.
|
||||||
|
|||||||
@ -153,7 +153,7 @@ CustomerRelativeDiscount=Relative customer discount
|
|||||||
CustomerAbsoluteDiscount=Absolute customer discount
|
CustomerAbsoluteDiscount=Absolute customer discount
|
||||||
CustomerRelativeDiscountShort=Relative discount
|
CustomerRelativeDiscountShort=Relative discount
|
||||||
CustomerAbsoluteDiscountShort=Absolute discount
|
CustomerAbsoluteDiscountShort=Absolute discount
|
||||||
CompanyHasRelativeDiscount=This customer has a discount of <b>%s%%</b>
|
CompanyHasRelativeDiscount=This customer has a default discount of <b>%s%%</b>
|
||||||
CompanyHasNoRelativeDiscount=This customer has no relative discount by default
|
CompanyHasNoRelativeDiscount=This customer has no relative discount by default
|
||||||
CompanyHasAbsoluteDiscount=This customer still has discount credits for <b>%s %s</b>
|
CompanyHasAbsoluteDiscount=This customer still has discount credits for <b>%s %s</b>
|
||||||
CompanyHasCreditNote=This customer still has credit notes or previous deposits for <b>%s %s</b>
|
CompanyHasCreditNote=This customer still has credit notes or previous deposits for <b>%s %s</b>
|
||||||
|
|||||||
@ -234,7 +234,7 @@ RelativeDiscount=Remise relative
|
|||||||
GlobalDiscount=Remise fixe
|
GlobalDiscount=Remise fixe
|
||||||
CreditNote=Avoir
|
CreditNote=Avoir
|
||||||
CreditNotes=Avoirs
|
CreditNotes=Avoirs
|
||||||
AddDiscount=Créer remise
|
AddDiscount=Créer remise fixe
|
||||||
AddCreditNote=Créer facture avoir
|
AddCreditNote=Créer facture avoir
|
||||||
Deposit=Acompte
|
Deposit=Acompte
|
||||||
Deposits=Acomptes
|
Deposits=Acomptes
|
||||||
@ -248,8 +248,8 @@ NoteReason=Note/Motif
|
|||||||
ReasonDiscount=Motif
|
ReasonDiscount=Motif
|
||||||
AddGlobalDiscount=Ajouter remise fixe
|
AddGlobalDiscount=Ajouter remise fixe
|
||||||
DiscountOfferedBy=Accordé par
|
DiscountOfferedBy=Accordé par
|
||||||
DiscountStillRemaining=Remises fixes restant en cours
|
DiscountStillRemaining=Remises restant en cours
|
||||||
DiscountAlreadyCounted=Remises fixes déjà appliquées
|
DiscountAlreadyCounted=Remises déjà appliquées
|
||||||
BillAddress=Adresse de facturation
|
BillAddress=Adresse de facturation
|
||||||
HelpEscompte=Un <b>escompte</b> est une remise accordée, sur une facture donnée, à un client car ce dernier a réalisé son règlement bien avant l'échéance.
|
HelpEscompte=Un <b>escompte</b> est une remise accordée, sur une facture donnée, à un client car ce dernier a réalisé son règlement bien avant l'échéance.
|
||||||
HelpAbandonBadCustomer=Ce montant a été abandonné (client jugé mauvais payeur) et est considéré comme une perte exceptionnelle.
|
HelpAbandonBadCustomer=Ce montant a été abandonné (client jugé mauvais payeur) et est considéré comme une perte exceptionnelle.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user