diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 589eb9dfcab..aadaf3895e9 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2268,6 +2268,7 @@ if (empty($reshook)) { $desc = $product_desc; $type = GETPOST('type'); $fk_unit = GETPOST('units', 'alpha'); + $pu_ht_devise = price2num($price_ht_devise, 'MU'); $pu_ttc_devise = price2num($price_ttc_devise, 'MU'); @@ -2276,6 +2277,8 @@ if (empty($reshook)) { } } + $pu_ht_devise = price2num($price_ht_devise, 'MU'); + // Margin $fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index ff834a4d98d..87d548ee94f 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2f8f3f2adae..5ca7ee9f530 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2645,6 +2645,8 @@ if ($action == 'create') { /* * View card */ + $objectidnext = $object->getIdReplacingInvoice(); + $head = facturefourn_prepare_head($object); $titre = $langs->trans('SupplierInvoice'); @@ -2937,7 +2939,7 @@ if ($action == 'create') { } print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; } - if (isset($facidnext) && $facidnext > 0) { + if (isset($objectidnext) && $objectidnext > 0) { $facthatreplace = new FactureFournisseur($db); $facthatreplace->fetch($facidnext); print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')'; @@ -3269,7 +3271,7 @@ if ($action == 'create') { } $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement as num_payment, p.rowid, p.fk_bank,'; - $sql .= ' c.id as paiement_type,'; + $sql .= ' c.id as paiement_type, c.code as payment_code,'; $sql .= ' pf.amount,'; $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; @@ -3306,7 +3308,10 @@ if ($action == 'create') { $paymentstatic->datepaye = $db->jdate($objp->dp); $paymentstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid); $paymentstatic->num_payment = $objp->num_payment; - $paymentstatic->payment_code = $objp->payment_code; + + $paymentstatic->paiementcode = $objp->payment_code; + $paymentstatic->type_code = $objp->payment_code; + $paymentstatic->type_label = $objp->payment_type; print '