Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-09-07 13:59:12 +02:00
commit 6b7e11dbdd
4 changed files with 19 additions and 8 deletions

View File

@ -2268,6 +2268,7 @@ if (empty($reshook)) {
$desc = $product_desc; $desc = $product_desc;
$type = GETPOST('type'); $type = GETPOST('type');
$fk_unit = GETPOST('units', 'alpha'); $fk_unit = GETPOST('units', 'alpha');
$pu_ht_devise = price2num($price_ht_devise, 'MU'); $pu_ht_devise = price2num($price_ht_devise, 'MU');
$pu_ttc_devise = price2num($price_ttc_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 // Margin
$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); $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 $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value

View File

@ -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/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.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.'/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/accountancycategory.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';

View File

@ -2645,6 +2645,8 @@ if ($action == 'create') {
/* /*
* View card * View card
*/ */
$objectidnext = $object->getIdReplacingInvoice();
$head = facturefourn_prepare_head($object); $head = facturefourn_prepare_head($object);
$titre = $langs->trans('SupplierInvoice'); $titre = $langs->trans('SupplierInvoice');
@ -2937,7 +2939,7 @@ if ($action == 'create') {
} }
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')';
} }
if (isset($facidnext) && $facidnext > 0) { if (isset($objectidnext) && $objectidnext > 0) {
$facthatreplace = new FactureFournisseur($db); $facthatreplace = new FactureFournisseur($db);
$facthatreplace->fetch($facidnext); $facthatreplace->fetch($facidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')'; 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 = '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 .= ' 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 .= ' 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'; $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p';
@ -3306,7 +3308,10 @@ if ($action == 'create') {
$paymentstatic->datepaye = $db->jdate($objp->dp); $paymentstatic->datepaye = $db->jdate($objp->dp);
$paymentstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid); $paymentstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
$paymentstatic->num_payment = $objp->num_payment; $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 '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td>';
@ -3651,7 +3656,7 @@ if ($action == 'create') {
|| ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && empty($discount->id)) || ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && empty($discount->id))
|| ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discount->id))) || ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discount->id)))
&& ($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED)) { // A paid invoice (partially or completely) && ($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED)) { // A paid invoice (partially or completely)
if (!$facidnext && $object->close_code != 'replaced' && $usercancreate) { // Not replaced by another invoice if (!$objectidnext && $object->close_code != 'replaced' && $usercancreate) { // Not replaced by another invoice
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans('ReOpen').'</a>'; print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken().'">'.$langs->trans('ReOpen').'</a>';
} else { } else {
if ($usercancreate) { if ($usercancreate) {

View File

@ -179,11 +179,13 @@ if ($object->id > 0) {
} }
print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')';
} }
/*
if ($facidnext > 0) { if ($facidnext > 0) {
$facthatreplace = new FactureFournisseur($db); $facthatreplace = new FactureFournisseur($db);
$facthatreplace->fetch($facidnext); $facthatreplace->fetch($facidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')'; print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')';
} }
*/
print '</td></tr>'; print '</td></tr>';
// Label // Label
@ -197,13 +199,13 @@ if ($object->id > 0) {
// Amount Local Taxes // Amount Local Taxes
//TODO: Place into a function to control showing by country or study better option //TODO: Place into a function to control showing by country or study better option
if ($societe->localtax1_assuj == "1") { //Localtax1 if ($mysoc->localtax1_assuj == "1") { //Localtax1
print '<tr><td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>'; print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
print '<td>'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>'; print '<td>'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
print '</tr>'; print '</tr>';
} }
if ($societe->localtax2_assuj == "1") { //Localtax2 if ($mysoc->localtax2_assuj == "1") { //Localtax2
print '<tr><td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>'; print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
print '<td>'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>'; print '<td>'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
print '</tr>'; print '</tr>';
} }