From 6a4a3c9e824dc3ca2596929a9e5391589ea46085 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Mon, 5 Mar 2018 10:58:19 +0100 Subject: [PATCH] NEW: supplier credit notes: remove MAIN_FEATURES_LEVEL --- htdocs/comm/remise.php | 26 ++-- htdocs/comm/remx.php | 35 +++--- htdocs/fourn/card.php | 64 +++++----- htdocs/fourn/commande/card.php | 47 ++++---- htdocs/fourn/facture/card.php | 194 +++++++++++++++--------------- htdocs/supplier_proposal/card.php | 47 ++++---- 6 files changed, 196 insertions(+), 217 deletions(-) diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index c961f6f43a7..8fb75c908d4 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -109,10 +109,6 @@ if ($socid > 0) $isCustomer = $object->client == 1 || $object->client == 3; $isSupplier = $object->fournisseur == 1; - - $displayCustomer = $conf->global->MAIN_FEATURES_LEVEL <= 0 || $isCustomer; - $displaySupplier = $conf->global->MAIN_FEATURES_LEVEL > 0 && $isSupplier; - print '
'; print ''; @@ -127,7 +123,7 @@ if ($socid > 0) print '
'; - if(! $displayCustomer && ! $displaySupplier) { + if(! $isCustomer && ! $isSupplier) { print '

'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'

'; dol_fiche_end(); @@ -141,13 +137,13 @@ if ($socid > 0) print ''; - if($displayCustomer) { + if($isCustomer) { // Customer discount print '"; } - if($displaySupplier) { + if($isSupplier) { // Supplier discount print '"; @@ -160,17 +156,17 @@ if ($socid > 0) print '
'; - if($conf->global->MAIN_FEATURES_LEVEL <= 0 || ($isCustomer && ! $isSupplier)) { + if($isCustomer && ! $isSupplier) { print ''; } - if($conf->global->MAIN_FEATURES_LEVEL > 0 && (! $isCustomer && $isSupplier)) { + if(! $isCustomer && $isSupplier) { print ''; } print '
'; print $langs->trans("CustomerRelativeDiscount").''.price2num($object->remise_percent)."%
'; print $langs->trans("SupplierRelativeDiscount").''.price2num($object->remise_supplier_percent)."%
'; - if($conf->global->MAIN_FEATURES_LEVEL > 0 && $isCustomer && $isSupplier) { + if($isCustomer && $isSupplier) { // Discount type print ''; print '
'.$langs->trans('DiscountType').' '; @@ -205,8 +201,8 @@ if ($socid > 0) print '
'; - if($displayCustomer) { - if($displaySupplier) { + if($isCustomer) { + if($isSupplier) { print '
'; print '
'; print load_fiche_titre($langs->trans("CustomerDiscounts"), '', ''); @@ -263,8 +259,8 @@ if ($socid > 0) } } - if($displaySupplier) { - if($displayCustomer) { + if($isSupplier) { + if($isCustomer) { print '
'; // class="fichehalfleft" print '
'; print '
'; @@ -321,7 +317,7 @@ if ($socid > 0) dol_print_error($db); } - if($displayCustomer) { + if($isCustomer) { print '
'; // class="ficheaddleft" print '
'; // class="fichehalfright" print '
'; // class="fichecenter" diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 92e2f1d5d71..b580684af7e 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -238,9 +238,6 @@ if ($socid > 0) $isCustomer = $object->client == 1 || $object->client == 3; $isSupplier = $object->fournisseur == 1; - $displayCustomer = $conf->global->MAIN_FEATURES_LEVEL <= 0 || $isCustomer; - $displaySupplier = $conf->global->MAIN_FEATURES_LEVEL > 0 && $isSupplier; - /* * Display tabs */ @@ -259,7 +256,7 @@ if ($socid > 0) print '
'; - if(! $displayCustomer && ! $displaySupplier) { + if(! $isCustomer && ! $isSupplier) { print '

'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'

'; dol_fiche_end(); @@ -274,7 +271,7 @@ if ($socid > 0) print ''; - if($displayCustomer) { // Calcul avoirs client en cours + if($isCustomer) { // Calcul avoirs client en cours $remise_all=$remise_user=0; $sql = "SELECT SUM(rc.amount_ht) as amount, rc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; @@ -305,7 +302,7 @@ if ($socid > 0) } } - if($displaySupplier) { + if($isSupplier) { // Calcul avoirs fournisseur en cours $remise_all=$remise_user=0; $sql = "SELECT SUM(rc.amount_ht) as amount, rc.fk_user"; @@ -349,16 +346,16 @@ if ($socid > 0) print '
'; - if($conf->global->MAIN_FEATURES_LEVEL <= 0 || ($isCustomer && ! $isSupplier)) { + if($isCustomer && ! $isSupplier) { print ''; } - if($conf->global->MAIN_FEATURES_LEVEL > 0 && (! $isCustomer && $isSupplier)) { + if(! $isCustomer && $isSupplier) { print ''; } print '
'; - if($conf->global->MAIN_FEATURES_LEVEL > 0 && $isCustomer && $isSupplier) { + if($isCustomer && $isSupplier) { print ''; print '"; print ''; - if($conf->global->MAIN_FEATURES_LEVEL > 0) { - // Relative discounts (Discounts-Drawbacks-Rebates) - print ''; - print ''; - - // Absolute discounts (Discounts-Drawbacks-Rebates) - print ''; - print ''; - print ''; + // Relative discounts (Discounts-Drawbacks-Rebates) + print ''; + print ''; + + // Absolute discounts (Discounts-Drawbacks-Rebates) + print ''; + print ''; + print ''; print ''; print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 0 && $societe->id > 0) + if ($societe->id > 0) { // Discounts for third party print ''; print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 0) { - - // Relative and absolute discounts - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - } else { - $filterabsolutediscount = "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')"; - $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')"; - } - - $absolute_discount = $societe->getAvailableDiscounts('', $filterabsolutediscount, 0, 1); - $absolute_creditnote = $societe->getAvailableDiscounts('', $filtercreditnote, 0, 1); - $absolute_discount = price2num($absolute_discount, 'MT'); - $absolute_creditnote = price2num($absolute_creditnote, 'MT'); - - print ''; + // Relative and absolute discounts + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + } else { + $filterabsolutediscount = "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')"; + $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')"; } + $absolute_discount = $societe->getAvailableDiscounts('', $filterabsolutediscount, 0, 1); + $absolute_creditnote = $societe->getAvailableDiscounts('', $filtercreditnote, 0, 1); + $absolute_discount = price2num($absolute_discount, 'MT'); + $absolute_creditnote = price2num($absolute_creditnote, 'MT'); + + print ''; + // Conditions de reglement par defaut $langs->load('bills'); print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 0 && $societe->id > 0) + if ($societe->id > 0) { // Discounts for third party print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 0) { - // Relative and absolute discounts - print ''; - } + $thirdparty = $societe; + $discount_type = 1; + $backtopage = urlencode($_SERVER["PHP_SELF"] . '?facid=' . $object->id); + include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; + + print ''; // Label print ''; @@ -2782,41 +2778,39 @@ else $creditnoteamount = 0; $depositamount = 0; - if($conf->global->MAIN_FEATURES_LEVEL > 0) { - $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; - $sql .= " re.description, re.fk_invoice_supplier_source"; - $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re"; - $sql .= " WHERE fk_invoice_supplier = " . $object->id; - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - $invoice = new FactureFournisseur($db); - while ($i < $num) { - $obj = $db->fetch_object($resql); - $invoice->fetch($obj->fk_invoice_supplier_source); - print ''; - print ''; - print ''; - $i ++; - if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE) - $creditnoteamount += $obj->amount_ttc; - if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT) - $depositamount += $obj->amount_ttc; - } - } else { - dol_print_error($db); - } - } + $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; + $sql .= " re.description, re.fk_invoice_supplier_source"; + $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re"; + $sql .= " WHERE fk_invoice_supplier = " . $object->id; + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + $invoice = new FactureFournisseur($db); + while ($i < $num) { + $obj = $db->fetch_object($resql); + $invoice->fetch($obj->fk_invoice_supplier_source); + print ''; + print ''; + print ''; + $i ++; + if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE) + $creditnoteamount += $obj->amount_ttc; + if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT) + $depositamount += $obj->amount_ttc; + } + } else { + dol_print_error($db); + } // Paye partiellement 'escompte' if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { @@ -3029,7 +3023,7 @@ else } // Reverse back money or convert to reduction - if ($conf->global->MAIN_FEATURES_LEVEL > 0 && ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT || $object->type == FactureFournisseur::TYPE_STANDARD)) { + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT || $object->type == FactureFournisseur::TYPE_STANDARD) { // For credit note only if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 4e4611d4fd5..e906fea4041 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1050,7 +1050,7 @@ if ($action == 'create') } print '' . "\n"; - if ($conf->global->MAIN_FEATURES_LEVEL > 0 && $soc->id > 0) + if ($soc->id > 0) { // Discounts for third party print '
'.$langs->trans('DiscountType').' '; print ' '; @@ -408,8 +405,8 @@ if ($socid > 0) print load_fiche_titre($langs->trans("DiscountStillRemaining")); - if($displayCustomer) { - if($displaySupplier) { + if($isCustomer) { + if($isSupplier) { print '
'; print '
'; print load_fiche_titre($langs->trans("CustomerDiscounts"), '', ''); @@ -541,8 +538,8 @@ if ($socid > 0) } } - if($displaySupplier) { - if($displayCustomer) { + if($isSupplier) { + if($isCustomer) { print '
'; // class="fichehalfleft" print '
'; print '
'; @@ -677,7 +674,7 @@ if ($socid > 0) dol_print_error($db); } - if($displayCustomer) { + if($isCustomer) { print '
'; // class="ficheaddleft" print '
'; // class="fichehalfright" print '
'; // class="fichecenter" @@ -692,8 +689,8 @@ if ($socid > 0) print load_fiche_titre($langs->trans("DiscountAlreadyCounted")); - if($displayCustomer) { - if($displaySupplier) { + if($isCustomer) { + if($isSupplier) { print '
'; print '
'; print load_fiche_titre($langs->trans("CustomerDiscounts"), '', ''); @@ -843,8 +840,8 @@ if ($socid > 0) } } - if($displaySupplier) { - if($displayCustomer) { + if($isSupplier) { + if($isCustomer) { print '
'; // class="fichehalfleft" print '
'; print '
'; @@ -994,7 +991,7 @@ if ($socid > 0) dol_print_error($db); } - if($displayCustomer) { + if($isCustomer) { print '
'; // class="ficheaddleft" print '
'; // class="fichehalfright" print '
'; // class="fichecenter" diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index a5d5490e660..877ba0f6e14 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -258,40 +258,38 @@ if ($object->id > 0) print "
'; - print '
'; - print $langs->trans("CustomerRelativeDiscountShort"); - print ''; - if ($user->rights->societe->creer && !$user->societe_id > 0) - { - print ''.img_edit($langs->trans("Modify")).''; - } - print '
'; - print '
'.($object->remise_supplier_percent?''.$object->remise_supplier_percent.'%':'').'
'; - print ''; - print '
'; - print $langs->trans("CustomerAbsoluteDiscountShort"); - print ''; - if ($user->rights->societe->creer && !$user->societe_id > 0) - { - print ''.img_edit($langs->trans("Modify")).''; - } - print '
'; - print '
'; - $amount_discount=$object->getAvailableDiscounts('', '', 0, 1); - if ($amount_discount < 0) dol_print_error($db,$object->error); - if ($amount_discount > 0) print ''.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).''; - //else print $langs->trans("DiscountNone"); - print '
'; + print '
'; + print $langs->trans("CustomerRelativeDiscountShort"); + print ''; + if ($user->rights->societe->creer && !$user->societe_id > 0) + { + print ''.img_edit($langs->trans("Modify")).''; } + print '
'; + print '
'.($object->remise_supplier_percent?''.$object->remise_supplier_percent.'%':'').'
'; + print ''; + print '
'; + print $langs->trans("CustomerAbsoluteDiscountShort"); + print ''; + if ($user->rights->societe->creer && !$user->societe_id > 0) + { + print ''.img_edit($langs->trans("Modify")).''; + } + print '
'; + print '
'; + $amount_discount=$object->getAvailableDiscounts('', '', 0, 1); + if ($amount_discount < 0) dol_print_error($db,$object->error); + if ($amount_discount > 0) print ''.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).''; + //else print $langs->trans("DiscountNone"); + print '
'; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index c7487f4cc51..4225646a3af 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1479,7 +1479,7 @@ if ($action=='create') } print '
' . $langs->trans('Discounts') . ''; @@ -1874,32 +1874,29 @@ elseif (! empty($object->id)) print ''.$author->getNomUrl(1, '', 0, 0, 0).'
' . $langs->trans('Discounts') . ''; - - $thirdparty = $societe; - $discount_type = 1; - $backtopage = urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id); - include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; - - print '
' . $langs->trans('Discounts') . ''; + + $thirdparty = $societe; + $discount_type = 1; + $backtopage = urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id); + include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; + + print '
'; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 14909a1fc2e..8069f6cf520 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1848,74 +1848,71 @@ if ($action == 'create') if (empty($origin)) { - if ($conf->global->MAIN_FEATURES_LEVEL > 0) // Need to fix reports of standard accounting module to manage supplier credit note + if ($societe->id > 0) { - if ($societe->id > 0) - { - // Credit note - if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) - { - print '
'; - $tmp=' - jQuery(document).ready(function() { - if (! jQuery("#radio_creditnote").is(":checked")) - { - jQuery("#credit_note_options").hide(); - } - jQuery("#radio_creditnote").click(function() { - jQuery("#credit_note_options").show(); - }); - jQuery("#radio_standard, #radio_replacement, #radio_deposit").click(function() { - jQuery("#credit_note_options").hide(); - }); - }); - '; - $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' '; - // $text.=''; - $text .= ''; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); - print $desc; - - print '
'; - print '    0 ? 'checked':'').' /> "; - print '
    0 ? 'checked':'').' /> "; - print '
'; - - print '
'; - } - } - else + // Credit note + if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) { print '
'; - $tmp=' '; - $text = $tmp.$langs->trans("InvoiceAvoir") . ' '; - $text.= '('.$langs->trans("YouMustCreateInvoiceFromSupplierThird").') '; + $tmp=' + jQuery(document).ready(function() { + if (! jQuery("#radio_creditnote").is(":checked")) + { + jQuery("#credit_note_options").hide(); + } + jQuery("#radio_creditnote").click(function() { + jQuery("#credit_note_options").show(); + }); + jQuery("#radio_standard, #radio_replacement, #radio_deposit").click(function() { + jQuery("#credit_note_options").hide(); + }); + }); + '; + $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' '; + // $text.=''; + $text .= ''; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); print $desc; - print '
' . "\n"; + + print '
'; + print '    0 ? 'checked':'').' /> "; + print '
    0 ? 'checked':'').' /> "; + print '
'; + + print ''; } } + else + { + print '
'; + $tmp=' '; + $text = $tmp.$langs->trans("InvoiceAvoir") . ' '; + $text.= '('.$langs->trans("YouMustCreateInvoiceFromSupplierThird").') '; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); + print $desc; + print '
' . "\n"; + } } print ''; print '
' . $langs->trans('Discounts') . ''; @@ -2411,18 +2408,17 @@ else } print '
' . $langs->trans('Discounts'); - print ''; - $thirdparty = $societe; - $discount_type = 1; - $backtopage = urlencode($_SERVER["PHP_SELF"] . '?facid=' . $object->id); - include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; + // Relative and absolute discounts + print '
' . $langs->trans('Discounts'); + print ''; - print '
'; - if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE) - print $langs->trans("CreditNote") . ' '; - if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT) - print $langs->trans("Deposit") . ' '; - print $invoice->getNomUrl(0); - print ' :' . price($obj->amount_ttc) . ''; - print 'rowid . '">' . img_delete() . ''; - print '
'; + if ($invoice->type == FactureFournisseur::TYPE_CREDIT_NOTE) + print $langs->trans("CreditNote") . ' '; + if ($invoice->type == FactureFournisseur::TYPE_DEPOSIT) + print $langs->trans("Deposit") . ' '; + print $invoice->getNomUrl(0); + print ' :' . price($obj->amount_ttc) . ''; + print 'rowid . '">' . img_delete() . ''; + print '
' . $langs->trans('Discounts') . ''; @@ -1404,32 +1404,29 @@ if ($action == 'create') print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 0) { - - // Relative and absolute discounts - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice - } else { - $filterabsolutediscount = "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')"; - $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')"; - } - - print ''; + // Relative and absolute discounts + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice + } else { + $filterabsolutediscount = "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')"; + $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS PAID)%')"; } + print ''; + // Payment term print '
' . $langs->trans('Discounts') . ''; - - $absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount, 0, 1); - $absolute_creditnote = $soc->getAvailableDiscounts('', $filtercreditnote, 0, 1); - $absolute_discount = price2num($absolute_discount, 'MT'); - $absolute_creditnote = price2num($absolute_creditnote, 'MT'); - - $thirdparty = $soc; - $discount_type = 1; - $backtopage = urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id); - include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; - - print '
' . $langs->trans('Discounts') . ''; + + $absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount, 0, 1); + $absolute_creditnote = $soc->getAvailableDiscounts('', $filtercreditnote, 0, 1); + $absolute_discount = price2num($absolute_discount, 'MT'); + $absolute_creditnote = price2num($absolute_creditnote, 'MT'); + + $thirdparty = $soc; + $discount_type = 1; + $backtopage = urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id); + include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; + + print '
'; print '
';