NEW Can use a credit note into a "down payment/deposit".
This commit is contained in:
parent
1748f1d451
commit
0b97ee42cf
@ -3156,7 +3156,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
|
$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
|
||||||
$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $soc->id . '&type=2&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("AddCreditNote") . '</a>';
|
$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture/card.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 '<!-- Discounts --><tr><td>' . $langs->trans('Discounts');
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($soc->remise_percent)
|
if ($soc->remise_percent)
|
||||||
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
|
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
|
||||||
@ -3164,6 +3164,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
print $langs->trans("CompanyHasNoRelativeDiscount");
|
print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||||
// print ' ('.$addrelativediscount.')';
|
// print ' ('.$addrelativediscount.')';
|
||||||
|
|
||||||
|
// Is there commercial discount or down payment available ?
|
||||||
if ($absolute_discount > 0) {
|
if ($absolute_discount > 0) {
|
||||||
print '. ';
|
print '. ';
|
||||||
if ($object->statut > 0 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
|
if ($object->statut > 0 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
|
||||||
@ -3195,21 +3196,21 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
} else
|
} else
|
||||||
print '. ';
|
print '. ';
|
||||||
}
|
}
|
||||||
|
// Is there credit notes availables ?
|
||||||
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"
|
||||||
if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
|
if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||||
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {
|
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {
|
||||||
$text = $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency));
|
$text = $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency));
|
||||||
print $form->textwithpicto($text, $langs->trans("CreditNoteDepositUse"));
|
print $form->textwithpicto($text, $langs->trans("CreditNoteDepositUse"));
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency)) . '.';
|
print $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency)) . '.';
|
||||||
}
|
}
|
||||||
} else {
|
} else { // We can add a credit note on a down payment or standard invoice or situation invoice
|
||||||
// Remise dispo de type avoir
|
// There is credit notes discounts available
|
||||||
if (! $absolute_discount)
|
if (! $absolute_discount) print '<br>';
|
||||||
print '<br>';
|
// $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer);
|
||||||
// $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.')';
|
||||||
$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
|
$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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user