2
0
forked from Wavyzz/dolibarr

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

This commit is contained in:
Laurent Destailleur
2023-09-30 11:54:12 +02:00
5 changed files with 34 additions and 9 deletions

View File

@@ -63,8 +63,8 @@ FIX: when adding new times on a survey, all hours would be erased.
For users: For users:
---------- ----------
NEW: PHP 8.2 compatibility (test not yet completed) NEW: PHP 8.2 compatibility (not yet complete).
NEW: Module Workstations Management upgraded to stable status NEW: Module Workstations Management upgraded to stable status.
NEW: Module Webhook upgraded to stable status NEW: Module Webhook upgraded to stable status
NEW: #23436 Group social networks fields NEW: #23436 Group social networks fields
NEW: Accountancy - Add specific page to export accounting data rather than the journals page NEW: Accountancy - Add specific page to export accounting data rather than the journals page

View File

@@ -298,7 +298,7 @@ function getEntity($element, $shared = 1, $currentobject = null)
$out = $mc->getEntity($element, $shared, $currentobject); $out = $mc->getEntity($element, $shared, $currentobject);
} else { } else {
$out = ''; $out = '';
$addzero = array('user', 'usergroup', 'cronjob', 'c_email_templates', 'email_template', 'default_values'); $addzero = array('user', 'usergroup', 'cronjob', 'c_email_templates', 'email_template', 'default_values', 'overwrite_trans');
if (in_array($element, $addzero)) { if (in_array($element, $addzero)) {
$out .= '0,'; $out .= '0,';
} }

View File

@@ -95,6 +95,18 @@ class mod_codeproduct_leopard extends ModeleProductCode
return $langs->trans("LeopardNumRefModelDesc"); return $langs->trans("LeopardNumRefModelDesc");
} }
/**
* Return an example of result returned by getNextValue
*
* @param Translate $langs Object langs
* @param Product $objproduct Object product
* @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return string example
*/
public function getExample($langs, $objproduct = 0, $type = -1)
{
return '';
}
/** /**
* Return an example of result returned by getNextValue * Return an example of result returned by getNextValue
@@ -105,7 +117,6 @@ class mod_codeproduct_leopard extends ModeleProductCode
*/ */
public function getNextValue($objproduct = 0, $type = -1) public function getNextValue($objproduct = 0, $type = -1)
{ {
global $langs;
return ''; return '';
} }

View File

@@ -513,6 +513,7 @@ print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield
print "</tr>\n"; print "</tr>\n";
$totalbuyingprice = 0; $totalbuyingprice = 0;
$totalsellingprice = 0;
$totalcurrentstock = 0; $totalcurrentstock = 0;
$totalvirtualstock = 0; $totalvirtualstock = 0;
@@ -621,12 +622,17 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
// Selling value // Selling value
print '<td class="right">'; print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) { if (empty($conf->global->PRODUIT_MULTIPRICES)) {
print price(price2num($objp->sellvalue, 'MT'), 1); print '<span class="amount">';
if ($stock || (float) $objp->sellvalue) {
print price(price2num($objp->sellvalue, 'MT'), 1);
}
print '</span>';
$totalsellingprice += $stock * $objp->price;
} else { } else {
$htmltext = $langs->trans("OptionMULTIPRICESIsOn"); $htmltext = $langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip('<span class="opacitymedium">'.$langs->trans("Variable").'</span>', $htmltext); print $form->textwithtooltip('<span class="opacitymedium">'.$langs->trans("Variable").'</span>', $htmltext);
} }
print'</td>'; print '</td>';
print '<td class="right">'; print '<td class="right">';
if ($nbofmovement > 0) { if ($nbofmovement > 0) {
@@ -681,7 +687,11 @@ if (empty($date) || !$dateIsValid) {
} else { } else {
print '<td></td>'; print '<td></td>';
print '<td class="right">'.price(price2num($totalbuyingprice, 'MT')).'</td>'; print '<td class="right">'.price(price2num($totalbuyingprice, 'MT')).'</td>';
print '<td></td>'; if (empty($conf->global->PRODUIT_MULTIPRICES)) {
print '<td class="right">'.price(price2num($totalsellingprice, 'MT')).'</td>';
} else {
print '<td></td>';
}
print '<td></td>'; print '<td></td>';
print '<td class="right">'.($productid > 0 ? price(price2num($totalcurrentstock, 'MS')) : '').'</td>'; print '<td class="right">'.($productid > 0 ? price(price2num($totalcurrentstock, 'MS')) : '').'</td>';
} }

View File

@@ -1532,7 +1532,8 @@ class Reception extends CommonObject
$error = 0; $error = 0;
// Protection. This avoid to move stock later when we should not // Protection. This avoid to move stock later when we should not
if ($this->statut == self::STATUS_CLOSED) { if ($this->statut == Reception::STATUS_CLOSED) {
dol_syslog(get_class($this)."::setClosed already in closed status", LOG_WARNING);
return 0; return 0;
} }
@@ -1670,7 +1671,10 @@ class Reception extends CommonObject
$this->db->begin(); $this->db->begin();
$this->setClosed(); if ($this->statut == Reception::STATUS_VALIDATED) {
// do not close if already closed
$this->setClosed();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET billed=1'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET billed=1';
$sql .= " WHERE rowid = ".((int) $this->id).' AND fk_statut > 0'; $sql .= " WHERE rowid = ".((int) $this->id).' AND fk_statut > 0';