Merge pull request #8687 from dolibarr95/patch-43

NEW : Allow negative quantity for dispatch (supplier order)
This commit is contained in:
Laurent Destailleur 2018-04-27 11:41:05 +02:00 committed by GitHub
commit 1cbf5f1c5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1704,7 +1704,7 @@ class CommandeFournisseur extends CommonOrder
$this->error='ErrorBadValueForParameterWarehouse'; $this->error='ErrorBadValueForParameterWarehouse';
return -1; return -1;
} }
if ($qty <= 0) if ($qty == 0)
{ {
$this->error='ErrorBadValueForParameterQty'; $this->error='ErrorBadValueForParameterQty';
return -1; return -1;

View File

@ -243,7 +243,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
$fk_commandefourndet = "fk_commandefourndet_" . $reg[1] . '_' . $reg[2]; $fk_commandefourndet = "fk_commandefourndet_" . $reg[1] . '_' . $reg[2];
// We ask to move a qty // We ask to move a qty
if (GETPOST($qty) > 0) { if (GETPOST($qty) != 0) {
if (! (GETPOST($ent, 'int') > 0)) { if (! (GETPOST($ent, 'int') > 0)) {
dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed'); dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed');
$text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline); $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline);