Skip to content

Commit

Permalink
Rename var
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Algoud committed May 14, 2016
1 parent e74e702 commit 8d0e547
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions htdocs/admin/stock.php
Expand Up @@ -53,16 +53,16 @@
if ($action == 'STOCK_CALCULATE_ON_BILL'
|| $action == 'STOCK_CALCULATE_ON_VALIDATE_ORDER'
|| $action == 'STOCK_CALCULATE_ON_SHIPMENT'
|| $action == 'STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED')
|| $action == 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE')
{
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", '','chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", '','chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", '','chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED", '','chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT_CLOSE", '','chaine',0,'',$conf->entity);
if ($action == 'STOCK_CALCULATE_ON_BILL') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_BILL", GETPOST('STOCK_CALCULATE_ON_BILL','alpha'),'chaine',0,'',$conf->entity);
if ($action == 'STOCK_CALCULATE_ON_VALIDATE_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_VALIDATE_ORDER", GETPOST('STOCK_CALCULATE_ON_VALIDATE_ORDER','alpha'),'chaine',0,'',$conf->entity);
if ($action == 'STOCK_CALCULATE_ON_SHIPMENT') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT", GETPOST('STOCK_CALCULATE_ON_SHIPMENT','alpha'),'chaine',0,'',$conf->entity);
if ($action == 'STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED", GETPOST('STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED','alpha'),'chaine',0,'',$conf->entity);
if ($action == 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SHIPMENT_CLOSE", GETPOST('STOCK_CALCULATE_ON_SHIPMENT_CLOSE','alpha'),'chaine',0,'',$conf->entity);
}
// Mode of stock increase
if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_BILL'
Expand Down Expand Up @@ -208,14 +208,14 @@

$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("DeStockOnShipmentClassifyBilled").'</td>';
print '<td width="60%">'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
print '<td width="160" align="right">';
if (! empty($conf->expedition->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED\">";
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED",$conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED,1,$disabled);
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SHIPMENT_CLOSE\">";
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT_CLOSE",$conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE,1,$disabled);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
print "</form>\n";
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/list.php
Expand Up @@ -740,7 +740,7 @@
// stock order and stock order_supplier
$stock_order=0;
$stock_order_supplier=0;
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED)) // What about other options ?
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) // What about other options ?
{
if (! empty($conf->commande->enabled))
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/conf.class.php
Expand Up @@ -403,7 +403,7 @@ function setValues($db)
$this->global->STOCK_CALCULATE_ON_BILL=0;
$this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER=0;
$this->global->STOCK_CALCULATE_ON_SHIPMENT=1;
$this->global->STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED=0;
$this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE=0;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL=0;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER=0;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER=1;
Expand Down
12 changes: 6 additions & 6 deletions htdocs/expedition/class/expedition.class.php
Expand Up @@ -1856,7 +1856,7 @@ function setClosed()
// line without batch detail

// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentClassifyBilledInDolibarr",$numref));
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentClassifyClosedInDolibarr",$numref));
if ($result < 0) {
$error++; break;
}
Expand All @@ -1866,7 +1866,7 @@ function setClosed()
// line with batch detail

// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentClassifyClosedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
if ($result < 0) {
$error++; break;
}
Expand Down Expand Up @@ -1943,8 +1943,8 @@ function reOpen()
$this->billed=0;


// If stock increment is done on sending (recommanded choice)
if (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED))
// If stock increment is done on closing
if (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE))
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';

Expand Down Expand Up @@ -1989,7 +1989,7 @@ function reOpen()
// line without batch detail

// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ShipmentUnClassifyBilledInDolibarr",$numref));
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ShipmentUnClassifyCloseddInDolibarr",$numref));
if ($result < 0) {
$error++; break;
}
Expand All @@ -1999,7 +1999,7 @@ function reOpen()
// line with batch detail

// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ShipmentUnClassifyCloseddInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
if ($result < 0) {
$error++; break;
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/langs/en_US/other.lang
Expand Up @@ -229,8 +229,8 @@ MemberResiliatedInDolibarr=Member %s resiliated
MemberDeletedInDolibarr=Member %s deleted
MemberSubscriptionAddedInDolibarr=Subscription for member %s added
ShipmentValidatedInDolibarr=Shipment %s validated
ShipmentClassifyBilledInDolibarr=Shipment %s classify billed
ShipmentUnClassifyBilledInDolibarr=Shipment %s classify reopened
ShipmentClassifyClosedInDolibarr=Shipment %s classify billed
ShipmentUnClassifyCloseddInDolibarr=Shipment %s classify reopened
ShipmentDeletedInDolibarr=Shipment %s deleted
##### Export #####
Export=Export
Expand Down
2 changes: 1 addition & 1 deletion htdocs/langs/en_US/stocks.lang
Expand Up @@ -59,7 +59,7 @@ RuleForStockManagementIncrease=Rule for automatic stock management increase (man
DeStockOnBill=Decrease real stocks on customers invoices/credit notes validation
DeStockOnValidateOrder=Decrease real stocks on customers orders validation
DeStockOnShipment=Decrease real stocks on shipping validation
DeStockOnShipmentClassifyBilled=Decrease real stocks on shipping classification billed
DeStockOnShipmentOnClosing=Decrease real stocks on shipping classification closed
ReStockOnBill=Increase real stocks on suppliers invoices/credit notes validation
ReStockOnValidateOrder=Increase real stocks on suppliers orders approbation
ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receiving
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/class/product.class.php
Expand Up @@ -3416,7 +3416,7 @@ function load_virtual_stock()
}

// Stock decrease mode
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED)) {
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
$this->stock_theorique=$this->stock_reel-$stock_commande_client+$stock_sending_client;
}
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/product.php
Expand Up @@ -482,7 +482,7 @@

// Real stock
$text_stock_options = '';
$text_stock_options.= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLASSIFY_BILLED)?$langs->trans("DeStockOnShipment").'<br>':'');
$text_stock_options.= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)?$langs->trans("DeStockOnShipment").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'<br>':'');
Expand Down

0 comments on commit 8d0e547

Please sign in to comment.