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

This commit is contained in:
Laurent Destailleur 2023-03-15 14:24:59 +01:00
commit 9e68d98b4e
3 changed files with 14 additions and 8 deletions

View File

@ -1304,7 +1304,8 @@ if (empty($reshook)) {
$object->date_pointoftax = $date_pointoftax;
$object->note_public = trim(GETPOST('note_public', 'restricthtml'));
$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
$object->ref_client = GETPOST('ref_client');
$object->ref_customer = GETPOST('ref_client');
$object->ref_client = $object->ref_customer;
$object->model_pdf = GETPOST('model');
$object->fk_project = GETPOST('projectid', 'int');
$object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id'));

View File

@ -98,10 +98,15 @@ class FormMargin
}
$pv = $line->total_ht;
$pa_ht = ($pv < 0 ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION)
|| ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) {
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
$pa_ht = (($pv < 0 || ($pv == 0 && $object->type == $object::TYPE_CREDIT_NOTE)) ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { // Special case for old situation mode
if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION)
|| ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) {
// We need a compensation relative to $line->situation_percent
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
} else {
$pa = $line->qty * $pa_ht;
}
} else {
$pa = $line->qty * $pa_ht;
}
@ -213,7 +218,7 @@ class FormMargin
$marginInfo = $this->getMarginInfosArray($object, $force_price);
$parameters=array('marginInfo'=>&$marginInfo);
$parameters=array('marginInfo' => &$marginInfo);
$reshook = $hookmanager->executeHooks('displayMarginInfos', $parameters, $object, $action);
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -233,8 +238,8 @@ class FormMargin
print '});</script>';
}
print '<!-- displayMarginInfos() - Show margin table -->' . "\n";
print '<div class="div-table-responsive-no-min">';
print '<!-- Margin table -->' . "\n";
print '<table class="noborder margintable centpercent" id="margintable">';
print '<tr class="liste_titre">';

View File

@ -124,7 +124,7 @@ if ($nolinesbefore) {
<?php if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { ?>
<td class="linecoluht_currency right"><span id="title_up_ht_currency"><?php echo $langs->trans('PriceUHTCurrency'); ?></span></td>
<?php } ?>
<?php if (!empty($inputalsopricewithtax)) { ?>
<?php if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) { ?>
<td class="linecoluttc right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td>
<?php } ?>
<td class="linecolqty right"><?php echo $langs->trans('Qty'); ?></td>