FIXED: #1829 POS not compatible with batch products

This commit is contained in:
KreizIT 2015-02-09 17:19:20 +01:00
parent 24ad1afdd2
commit 2483d96b33
3 changed files with 20 additions and 2 deletions

View File

@ -130,7 +130,16 @@ if (! empty($conf->stock->enabled))
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
print '<td colspan="2">';
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
if (empty($conf->productbatch->enabled)) {
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
}
else
{
if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity);
}
print $langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch');
}
print '</td></tr>';
$disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK;

View File

@ -112,8 +112,16 @@ class modProductBatch extends DolibarrModules
*/
function init($options='')
{
global $db,$conf;
$sql = array();
if(! empty($conf->cashdesk->enabled)) {
if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity);
}
}
return $this->_init($sql, $options);
}

View File

@ -1494,6 +1494,7 @@ CashDeskBankAccountForCB= Default account to use to receive payments by credit c
CashDeskDoNotDecreaseStock=Disable stock decrease when a sell is done from Point of Sale
CashDeskIdWareHouse=Force and restrict warehouse to use for stock decrease
StockDecreaseForPointOfSaleDisabled=Stock decrease from Point Of Sale disabled
StockDecreaseForPointOfSaleDisabledbyBatch=Stock decrease in POS is not compatible with batch management
CashDeskYouDidNotDisableStockDecease=You did not disable stock decrease when making a sell from Point Of Sale. So a warehouse is required.
##### Bookmark #####
BookmarkSetup=Bookmark module setup