Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
920f8b0b58
@ -883,6 +883,7 @@ if ($object->id > 0) {
|
||||
$sql .= ", c.total_ttc";
|
||||
$sql .= ", c.ref, c.ref_client, c.fk_statut, c.facture";
|
||||
$sql .= ", c.date_commande as dc";
|
||||
$sql .= ", c.facture as billed";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql .= " WHERE c.fk_soc = s.rowid ";
|
||||
$sql .= " AND s.rowid = ".$object->id;
|
||||
|
||||
@ -82,7 +82,7 @@ foreach ($object->fields as $key => $val) {
|
||||
} else {
|
||||
$value = GETPOST($key, 'alphanohtml');
|
||||
}
|
||||
if ($val['noteditable']) {
|
||||
if (!empty($val['noteditable'])) {
|
||||
print $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
} else {
|
||||
print $object->showInputField($val, $key, $value, '', '', '', 0);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (c) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (c) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2016-2020 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -2478,9 +2478,9 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
$now = dol_now();
|
||||
if ($option == 'toapprove') {
|
||||
return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay);
|
||||
return (!empty($this->datevalid) ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay);
|
||||
} else {
|
||||
return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay);
|
||||
return (!empty($this->datevalid) ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -722,6 +722,7 @@ if ($resql) {
|
||||
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
@ -255,3 +255,4 @@ MakeMovementsAndClose=Generate movements and close
|
||||
AutofillWithExpected=Fill real quantity with expected quantity
|
||||
ShowAllBatchByDefault=By default, show batch details on product "stock" tab
|
||||
CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration
|
||||
FieldCannotBeNegative=Field "%s" cannot be negative
|
||||
@ -185,8 +185,11 @@ if ($action =='updateinventorylines' && $permissiontoadd) {
|
||||
|
||||
if (GETPOST("id_".$lineid, 'alpha') != '') { // If a value was set ('0' or something else)
|
||||
$qtytoupdate = price2num(GETPOST("id_".$lineid, 'alpha'), 'MS');
|
||||
|
||||
$result = $inventoryline->fetch($lineid);
|
||||
if ($qtytoupdate < 0) {
|
||||
$result = -1;
|
||||
setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors');
|
||||
}
|
||||
if ($result > 0) {
|
||||
$inventoryline->qty_view = $qtytoupdate;
|
||||
$resultupdate = $inventoryline->update($user);
|
||||
@ -251,7 +254,10 @@ if (empty($reshook)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
|
||||
}
|
||||
|
||||
if (price2num(GETPOST('qtytoadd'), 'MS') < 0) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors');
|
||||
}
|
||||
if (!$error && !empty($conf->productbatch->enabled)) {
|
||||
$tmpproduct = new Product($db);
|
||||
$result = $tmpproduct->fetch($fk_product);
|
||||
@ -654,7 +660,7 @@ if ($object->id > 0) {
|
||||
// Real quantity
|
||||
print '<td class="center">';
|
||||
if ($object->status == $object::STATUS_VALIDATED) {
|
||||
$qty_view = GETPOST("id_".$obj->rowid) ? GETPOST("id_".$obj->rowid) : $obj->qty_view;
|
||||
$qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view;
|
||||
$totalfound += price2num($qty_view, 'MS');
|
||||
print '<input type="text" class="maxwidth75 right realqty" name="id_'.$obj->rowid.'" id="id_'.$obj->rowid.'_input" value="'.$qty_view.'">';
|
||||
print '</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user