Fix: Maxi debug of module productbatch.
Conflicts: htdocs/core/class/conf.class.php htdocs/langs/en_US/productbatch.lang
This commit is contained in:
parent
bff65fc6b4
commit
a9338a0f9f
@ -113,35 +113,20 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
|||||||
print_fiche_titre($langs->trans("StockSetup"),$linkback,'setup');
|
print_fiche_titre($langs->trans("StockSetup"),$linkback,'setup');
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
$var=true;
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print " <td>".$langs->trans("Parameters")."</td>\n";
|
|
||||||
print " <td align=\"right\" width=\"160\"> </td>\n";
|
|
||||||
print '</tr>'."\n";
|
|
||||||
|
|
||||||
/*
|
$disabled='';
|
||||||
* Formulaire parametres divers
|
if (! empty($conf->productbatch->enabled))
|
||||||
*/
|
{
|
||||||
|
$langs->load("productbatch");
|
||||||
|
$disabled=' disabled="disabled"';
|
||||||
|
print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced"));
|
||||||
|
}
|
||||||
|
|
||||||
$var=!$var;
|
//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
|
||||||
|
//{
|
||||||
print "<tr ".$bc[$var].">";
|
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
|
||||||
print '<td width="60%">'.$langs->trans("UserWarehouseAutoCreate").'</td>';
|
//}
|
||||||
|
|
||||||
print '<td width="160" align="right">';
|
|
||||||
print "<form method=\"post\" action=\"stock.php\">";
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
|
|
||||||
print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
|
||||||
print '</form>';
|
|
||||||
print "</td>\n";
|
|
||||||
print "</tr>\n";
|
|
||||||
print '<br>';
|
|
||||||
print '</table>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
// Title rule for stock decrease
|
// Title rule for stock decrease
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -160,8 +145,8 @@ if (! empty($conf->facture->enabled))
|
|||||||
print "<form method=\"post\" action=\"stock.php\">";
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_BILL\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_BILL\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1);
|
print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,8 +159,8 @@ if (! empty($conf->commande->enabled))
|
|||||||
print "<form method=\"post\" action=\"stock.php\">";
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_VALIDATE_ORDER\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_VALIDATE_ORDER\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1);
|
print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,16 +173,12 @@ if (! empty($conf->expedition->enabled))
|
|||||||
print "<form method=\"post\" action=\"stock.php\">";
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SHIPMENT\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SHIPMENT\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
|
|
||||||
//{
|
|
||||||
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
|
|
||||||
//}
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Title rule for stock increase
|
// Title rule for stock increase
|
||||||
@ -217,8 +198,8 @@ if (! empty($conf->fournisseur->enabled))
|
|||||||
print "<form method=\"post\" action=\"stock.php\">";
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_BILL\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_BILL\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,8 +212,8 @@ if (! empty($conf->fournisseur->enabled))
|
|||||||
print "<form method=\"post\" action=\"stock.php\">";
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
}
|
}
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
@ -244,8 +225,8 @@ if (! empty($conf->fournisseur->enabled))
|
|||||||
print "<form method=\"post\" action=\"stock.php\">";
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n</td>\n</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,6 +315,34 @@ if ($virtualdiffersfromphysical)
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print " <td>".$langs->trans("Other")."</td>\n";
|
||||||
|
print " <td align=\"right\" width=\"160\"> </td>\n";
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="60%">'.$langs->trans("UserWarehouseAutoCreate").'</td>';
|
||||||
|
|
||||||
|
print '<td width="160" align="right">';
|
||||||
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
|
||||||
|
print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
print '</form>';
|
||||||
|
print "</td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
print '<br>';
|
||||||
|
print '</table>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -366,6 +366,16 @@ class Conf
|
|||||||
unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
|
unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->productbatch->enabled))
|
||||||
|
{
|
||||||
|
$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_SUPPLIER_BILL=0;
|
||||||
|
$this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER=0;
|
||||||
|
$this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER=1;
|
||||||
|
}
|
||||||
|
|
||||||
// conf->currency
|
// conf->currency
|
||||||
if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE='EUR';
|
if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE='EUR';
|
||||||
$this->currency=$this->global->MAIN_MONNAIE;
|
$this->currency=$this->global->MAIN_MONNAIE;
|
||||||
@ -373,6 +383,9 @@ class Conf
|
|||||||
// conf->global->ACCOUNTING_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...)
|
// conf->global->ACCOUNTING_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...)
|
||||||
if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
|
if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
|
||||||
|
|
||||||
|
// By default, suppliers objects can be linked to all projects
|
||||||
|
$conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
|
||||||
|
|
||||||
// conf->liste_limit = constante de taille maximale des listes
|
// conf->liste_limit = constante de taille maximale des listes
|
||||||
if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25;
|
if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25;
|
||||||
$this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT;
|
$this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT;
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class modProductBatch extends DolibarrModules
|
|||||||
$this->config_page_url = array();
|
$this->config_page_url = array();
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
$this->depends = array("modProduct","modStock"); // List of modules id that must be enabled if this module is enabled
|
$this->depends = array("modProduct","modStock","modExpedition","modSupplier"); // List of modules id that must be enabled if this module is enabled. modExpedition is required to manage batch exit (by manual stock decrease on shipment), modSupplier to manage batch entry (after supplier order).
|
||||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||||
$this->phpmin = array(5,0); // Minimum version of PHP required by module
|
$this->phpmin = array(5,0); // Minimum version of PHP required by module
|
||||||
$this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module
|
$this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module
|
||||||
|
|||||||
@ -84,9 +84,24 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('expeditioncard','globalcard'));
|
$hookmanager->initHooks(array('expeditioncard','globalcard'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$warehousecanbeselectedlater=1;
|
||||||
|
if (! empty($conf->productbatch->enabled))
|
||||||
|
{
|
||||||
|
if (! (GETPOST('entrepot_id','int') > 0))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
setEventMessage($langs->trans("WarhouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn"),'errors');
|
||||||
|
header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.$id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
@ -593,7 +608,7 @@ if ($action == 'create')
|
|||||||
print_fiche_titre($langs->trans("CreateASending"));
|
print_fiche_titre($langs->trans("CreateASending"));
|
||||||
if (! $origin)
|
if (! $origin)
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$langs->trans("ErrorBadParameters").'</div>';
|
setEventMessage($langs->trans("ErrorBadParameters"),'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_htmloutput_mesg($mesg);
|
dol_htmloutput_mesg($mesg);
|
||||||
@ -771,10 +786,13 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! empty($conf->stock->enabled))
|
if (! empty($conf->stock->enabled))
|
||||||
{
|
{
|
||||||
if (empty($conf->productbatch->enabled)) {
|
if (empty($conf->productbatch->enabled))
|
||||||
print '<td align="left">'.$langs->trans("Warehouse").' / '.$langs->trans("Stock").'</td>';
|
{
|
||||||
} else {
|
print '<td align="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>';
|
||||||
print '<td align="left">'.$langs->trans("Warehouse").' / '.$langs->trans("Batch").' / '.$langs->trans("Stock").'</td>';
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="left">'.$langs->trans("Warehouse").' / '.$langs->trans("Batch").' ('.$langs->trans("Stock").')</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -861,17 +879,19 @@ if ($action == 'create')
|
|||||||
$quantityAsked = $line->qty;
|
$quantityAsked = $line->qty;
|
||||||
$quantityToBeDelivered = $quantityAsked - $quantityDelivered;
|
$quantityToBeDelivered = $quantityAsked - $quantityDelivered;
|
||||||
|
|
||||||
|
$warehouse_id = GETPOST('entrepot_id','int');
|
||||||
|
|
||||||
$defaultqty=0;
|
$defaultqty=0;
|
||||||
if (GETPOST('entrepot_id','int') > 0)
|
if ($warehouse_id > 0)
|
||||||
{
|
{
|
||||||
//var_dump($product);
|
//var_dump($product);
|
||||||
$stock = $product->stock_warehouse[GETPOST('entrepot_id','int')]->real;
|
$stock = $product->stock_warehouse[$warehouse_id]->real;
|
||||||
$stock+=0; // Convertit en numerique
|
$stock+=0; // Convertit en numerique
|
||||||
$defaultqty=min($quantityToBeDelivered, $stock);
|
$defaultqty=min($quantityToBeDelivered, $stock);
|
||||||
if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0;
|
if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[GETPOST('entrepot_id','int')])))
|
if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[$warehouse_id])))
|
||||||
{
|
{
|
||||||
// Quantity to send
|
// Quantity to send
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
@ -892,14 +912,14 @@ if ($action == 'create')
|
|||||||
// Show warehouse combo list
|
// Show warehouse combo list
|
||||||
$ent = "entl".$indiceAsked;
|
$ent = "entl".$indiceAsked;
|
||||||
$idl = "idl".$indiceAsked;
|
$idl = "idl".$indiceAsked;
|
||||||
$tmpentrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int');
|
$tmpentrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):$warehouse_id;
|
||||||
print $formproduct->selectWarehouses($tmpentrepot_id,'entl'.$indiceAsked,'',1,0,$line->fk_product);
|
print $formproduct->selectWarehouses($tmpentrepot_id,'entl'.$indiceAsked,'',1,0,$line->fk_product);
|
||||||
if ($tmpentrepot_id > 0 && $tmpentrepot_id == GETPOST('entrepot_id','int'))
|
if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id)
|
||||||
{
|
{
|
||||||
//print $stock.' '.$quantityToBeDelivered;
|
//print $stock.' '.$quantityToBeDelivered;
|
||||||
if ($stock < $quantityToBeDelivered)
|
if ($stock < $quantityToBeDelivered)
|
||||||
{
|
{
|
||||||
print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for entrepot_id but we may have change warehouse
|
print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -934,11 +954,14 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
print '<td></td><td></td></tr>';
|
print '<td></td><td></td></tr>';
|
||||||
$subj=0;
|
$subj=0;
|
||||||
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
||||||
foreach ($product->stock_warehouse[GETPOST('entrepot_id','int')]->detail_batch as $dbatch) {
|
foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch)
|
||||||
|
{
|
||||||
//var_dump($dbatch);
|
//var_dump($dbatch);
|
||||||
$substock=$dbatch->qty +0 ;
|
$substock=$dbatch->qty +0 ;
|
||||||
print '<tr><td colspan="3" ></td><td align="center">';
|
print '<tr><td colspan="3" ></td><td align="center">';
|
||||||
@ -946,8 +969,13 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
|
|
||||||
|
$staticwarehouse=new Entrepot($db);
|
||||||
|
$staticwarehouse->fetch($warehouse_id);
|
||||||
|
print $staticwarehouse->getNomUrl(0).' / ';
|
||||||
|
|
||||||
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
|
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
|
||||||
print $langs->trans("DetailBatchFormat", dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->batch, $dbatch->qty);
|
print $langs->trans("DetailBatchFormat", $dbatch->batch, dol_print_date($dbatch->eatby,"day"), dol_print_date($dbatch->sellby,"day"), $dbatch->qty);
|
||||||
if ($defaultqty<=0) {
|
if ($defaultqty<=0) {
|
||||||
$defaultqty=0;
|
$defaultqty=0;
|
||||||
} else {
|
} else {
|
||||||
@ -1451,12 +1479,14 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Batch number managment
|
// Batch number managment
|
||||||
if (! empty($conf->productbatch->enabled)) {
|
if (! empty($conf->productbatch->enabled))
|
||||||
if (isset($lines[$i]->detail_batch) ) {
|
{
|
||||||
print '<td align="center">';
|
if (isset($lines[$i]->detail_batch))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
$detail = '';
|
$detail = '';
|
||||||
foreach ($lines[$i]->detail_batch as $dbatch) {
|
foreach ($lines[$i]->detail_batch as $dbatch) {
|
||||||
$detail.= $langs->trans("DetailBatchFormat",dol_print_date($dbatch->eatby,"day"),dol_print_date($dbatch->sellby,"day"),$dbatch->batch,$dbatch->dluo_qty).'<br/>';
|
$detail.= $langs->trans("DetailBatchFormat",$dbatch->batch,dol_print_date($dbatch->eatby,"day"),dol_print_date($dbatch->sellby,"day"),$dbatch->dluo_qty).'<br/>';
|
||||||
}
|
}
|
||||||
print $form->textwithtooltip($langs->trans("DetailBatchNumber"),$detail);
|
print $form->textwithtooltip($langs->trans("DetailBatchNumber"),$detail);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -114,7 +114,7 @@ if ($resql)
|
|||||||
/*
|
/*
|
||||||
* Commandes a traiter
|
* Commandes a traiter
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
|
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -136,7 +136,7 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="2">'.$langs->trans("OrdersToProcess").'</td></tr>';
|
print '<td colspan="3">'.$langs->trans("OrdersToProcess").'</td></tr>';
|
||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -146,13 +146,19 @@ if ($resql)
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$orderstatic->id=$obj->rowid;
|
$orderstatic->id=$obj->rowid;
|
||||||
$orderstatic->ref=$obj->ref;
|
$orderstatic->ref=$obj->ref;
|
||||||
|
$orderstatic->statut=$obj->fk_statut;
|
||||||
|
$orderstatic->facturee=0;
|
||||||
print $orderstatic->getNomUrl(1);
|
print $orderstatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$companystatic->name=$obj->name;
|
$companystatic->name=$obj->name;
|
||||||
$companystatic->id=$obj->socid;
|
$companystatic->id=$obj->socid;
|
||||||
print $companystatic->getNomUrl(1,'customer',32);
|
print $companystatic->getNomUrl(1,'customer',32);
|
||||||
print '</td></tr>';
|
print '</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
print $orderstatic->getLibStatut(3);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
|
|||||||
@ -643,7 +643,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
if (! empty($conf->stock->enabled))
|
if (! empty($conf->stock->enabled))
|
||||||
{
|
{
|
||||||
print '<td>'.$langs->trans("WarehouseSource").'</td>';
|
$warehousecanbeselectedlater=1;
|
||||||
|
if (! empty($conf->productbatch->enabled)) $warehousecanbeselectedlater=0;
|
||||||
|
|
||||||
|
print '<td'.($warehousecanbeselectedlater?'':' class="fieldrequired"').'>'.$langs->trans("WarehouseSource").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formproduct->selectWarehouses(-1,'entrepot_id','',1);
|
print $formproduct->selectWarehouses(-1,'entrepot_id','',1);
|
||||||
if (count($formproduct->cache_warehouses) <= 0)
|
if (count($formproduct->cache_warehouses) <= 0)
|
||||||
|
|||||||
@ -5,16 +5,17 @@ ProductStatusOnBatch=Managed
|
|||||||
ProductStatusNotOnBatch=Not Managed
|
ProductStatusNotOnBatch=Not Managed
|
||||||
ProductStatusOnBatchShort=Managed
|
ProductStatusOnBatchShort=Managed
|
||||||
ProductStatusNotOnBatchShort=Not Managed
|
ProductStatusNotOnBatchShort=Not Managed
|
||||||
Batch=Batch
|
Batch=Batch/Serial
|
||||||
atleast1batchfield= Eat-by date or Sell-by date or Batch number
|
atleast1batchfield=Eat-by date or Sell-by date or Batch number
|
||||||
batch_number= Batch number
|
batch_number=Batch/Serial number
|
||||||
l_eatby= Eat-by date
|
l_eatby=Eat-by date
|
||||||
l_sellby= Sell-by date
|
l_sellby=Sell-by date
|
||||||
DetailBatchNumber= Batch details
|
DetailBatchNumber=Batch/Serial details
|
||||||
DetailBatchFormat= E:%s S: %s BATCH: %s (Qty : %d)
|
DetailBatchFormat=Batch/Serial: %s - E:%s - S: %s (Qty : %d)
|
||||||
printBatch= Batch: %s
|
printBatch=Batch: %s
|
||||||
printEatby= Eat-by: %s
|
printEatby=Eat-by: %s
|
||||||
printSellby= Sell-by: %s
|
printSellby=Sell-by: %s
|
||||||
printQty= Qty: %d
|
printQty=Qty: %d
|
||||||
AddDispatchBatchLine=Add a line for Shelf Life dispatching
|
AddDispatchBatchLine=Add a line for Shelf Life dispatching
|
||||||
BatchDefaultNumber= Undefined
|
BatchDefaultNumber=Undefined
|
||||||
|
WhenProductBatchModuleOnOptionAreForced=When module Batch/Serial is on, increase/decrease stock mode is forced to last choice and can't be edited. Other options can be defined as you want.
|
||||||
|
|||||||
@ -10,7 +10,7 @@ batch_number= Numéro de lot
|
|||||||
l_eatby= DLC
|
l_eatby= DLC
|
||||||
l_sellby= DLUO
|
l_sellby= DLUO
|
||||||
DetailBatchNumber= Détails des lots
|
DetailBatchNumber= Détails des lots
|
||||||
DetailBatchFormat= C:%s UO: %s LOT: %s (Qté : %d)
|
DetailBatchFormat= Lot/Serie: %s - C:%s - UO: %s (Qté : %d)
|
||||||
printBatch= Lot: %s
|
printBatch= Lot: %s
|
||||||
printEatby= DLC: %s
|
printEatby= DLC: %s
|
||||||
printSellby= DLUO: %s
|
printSellby= DLUO: %s
|
||||||
|
|||||||
@ -1122,7 +1122,7 @@ else
|
|||||||
|
|
||||||
// Batch number managment
|
// Batch number managment
|
||||||
if ($conf->productbatch->enabled) {
|
if ($conf->productbatch->enabled) {
|
||||||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="3">';
|
||||||
$statutarray=array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
|
$statutarray=array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
|
||||||
print $form->selectarray('status_batch',$statutarray,$object->status_batch);
|
print $form->selectarray('status_batch',$statutarray,$object->status_batch);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user