Debug ENTREPOT_EXTRA_STATUS
This commit is contained in:
parent
e23ce0bb97
commit
2c4fd9e409
@ -167,8 +167,8 @@ MovementTransferStock=Stock transfer of product %s into another warehouse
|
|||||||
InventoryCodeShort=Inv./Mov. code
|
InventoryCodeShort=Inv./Mov. code
|
||||||
NoPendingReceptionOnSupplierOrder=No pending reception due to open purchase order
|
NoPendingReceptionOnSupplierOrder=No pending reception due to open purchase order
|
||||||
ThisSerialAlreadyExistWithDifferentDate=This lot/serial number (<strong>%s</strong>) already exists but with different eatby or sellby date (found <strong>%s</strong> but you enter <strong>%s</strong>).
|
ThisSerialAlreadyExistWithDifferentDate=This lot/serial number (<strong>%s</strong>) already exists but with different eatby or sellby date (found <strong>%s</strong> but you enter <strong>%s</strong>).
|
||||||
OpenAll=Open for all actions
|
OpenAnyMovement=Open (all movement)
|
||||||
OpenInternal=Open only for internal actions
|
OpenInternal=Open (only internal movement)
|
||||||
UseDispatchStatus=Use a dispatch status (approve/refuse) for product lines on purchase order reception
|
UseDispatchStatus=Use a dispatch status (approve/refuse) for product lines on purchase order reception
|
||||||
OptionMULTIPRICESIsOn=Option "several prices per segment" is on. It means a product has several selling price so value for sell can't be calculated
|
OptionMULTIPRICESIsOn=Option "several prices per segment" is on. It means a product has several selling price so value for sell can't be calculated
|
||||||
ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created
|
ProductStockWarehouseCreated=Stock limit for alert and desired optimal stock correctly created
|
||||||
|
|||||||
@ -169,8 +169,8 @@ MovementTransferStock=Transfert de stock du produit %s dans un autre entrepôt
|
|||||||
InventoryCodeShort=Code Inv./Mouv.
|
InventoryCodeShort=Code Inv./Mouv.
|
||||||
NoPendingReceptionOnSupplierOrder=Pas de réception en attente consécutive à des commandes fournisseurs
|
NoPendingReceptionOnSupplierOrder=Pas de réception en attente consécutive à des commandes fournisseurs
|
||||||
ThisSerialAlreadyExistWithDifferentDate=Ce lot/numéro de série (<strong>%s</strong>) existe déjà mais avec des dates de consommation ou péremption différente (trouvé <strong>%s</strong> mais vous avez entré <strong>%s</strong>).
|
ThisSerialAlreadyExistWithDifferentDate=Ce lot/numéro de série (<strong>%s</strong>) existe déjà mais avec des dates de consommation ou péremption différente (trouvé <strong>%s</strong> mais vous avez entré <strong>%s</strong>).
|
||||||
OpenAll=Accepte tous les mouvements
|
OpenAnyMovement=Ouvert (tous les mouvements)
|
||||||
OpenInternal=Limité aux mouvements internes
|
OpenInternal=Ouvert (limité aux mouvements internes)
|
||||||
UseDispatchStatus=Utiliser un statut de contrôle (approuvé / refusé) pour les lignes de produits lors de la réception de la commande
|
UseDispatchStatus=Utiliser un statut de contrôle (approuvé / refusé) pour les lignes de produits lors de la réception de la commande
|
||||||
OptionMULTIPRICESIsOn=L'option "plusieurs prix par tranches" est activée. Cela signifie qu'un produit à plusieurs prix de vente donc sa valeur de vente ne peut être calculée.
|
OptionMULTIPRICESIsOn=L'option "plusieurs prix par tranches" est activée. Cela signifie qu'un produit à plusieurs prix de vente donc sa valeur de vente ne peut être calculée.
|
||||||
ProductStockWarehouseCreated=Alerte de limite de stock et de stock désiré ajoutée
|
ProductStockWarehouseCreated=Alerte de limite de stock et de stock désiré ajoutée
|
||||||
|
|||||||
@ -5154,9 +5154,10 @@ class Product extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products)
|
* Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products)
|
||||||
* This function need a lot of load. If you use it on list, use a cache to execute it once for each product id.
|
* This function need a lot of load. If you use it on list, use a cache to execute it once for each product id.
|
||||||
* If ENTREPOT_EXTRA_STATUS set, filtering on warehouse status possible.
|
* If ENTREPOT_EXTRA_STATUS is set, filtering on warehouse status is possible.
|
||||||
*
|
*
|
||||||
* @param string $option '' = Load all stock info, also from closed and internal warehouses, 'nobatch', 'novirtual'
|
* @param string $option '' = Load all stock info, also from closed and internal warehouses, 'nobatch', 'novirtual'
|
||||||
|
* You can also filter on 'warehouseclosed', 'warehouseopen', 'warehouseinternal'
|
||||||
* @param int $includedraftpoforvirtual Include draft status of PO for virtual stock calculation
|
* @param int $includedraftpoforvirtual Include draft status of PO for virtual stock calculation
|
||||||
* @return int < 0 if KO, > 0 if OK
|
* @return int < 0 if KO, > 0 if OK
|
||||||
* @see load_virtual_stock(), loadBatchInfo()
|
* @see load_virtual_stock(), loadBatchInfo()
|
||||||
@ -5170,16 +5171,20 @@ class Product extends CommonObject
|
|||||||
$this->stock_warehouse = array();
|
$this->stock_warehouse = array();
|
||||||
$this->stock_theorique = 0;
|
$this->stock_theorique = 0;
|
||||||
|
|
||||||
|
// Set filter on warehouse status
|
||||||
$warehouseStatus = array();
|
$warehouseStatus = array();
|
||||||
|
|
||||||
if (preg_match('/warehouseclosed/', $option)) {
|
if (preg_match('/warehouseclosed/', $option)) {
|
||||||
$warehouseStatus[] = Entrepot::STATUS_CLOSED;
|
$warehouseStatus[Entrepot::STATUS_CLOSED] = Entrepot::STATUS_CLOSED;
|
||||||
}
|
}
|
||||||
if (preg_match('/warehouseopen/', $option)) {
|
if (preg_match('/warehouseopen/', $option)) {
|
||||||
$warehouseStatus[] = Entrepot::STATUS_OPEN_ALL;
|
$warehouseStatus[Entrepot::STATUS_OPEN_ALL] = Entrepot::STATUS_OPEN_ALL;
|
||||||
}
|
}
|
||||||
if (preg_match('/warehouseinternal/', $option)) {
|
if (preg_match('/warehouseinternal/', $option)) {
|
||||||
$warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL;
|
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
|
||||||
|
$warehouseStatus[Entrepot::STATUS_OPEN_INTERNAL] = Entrepot::STATUS_OPEN_INTERNAL;
|
||||||
|
} else {
|
||||||
|
$warehouseStatus[Entrepot::STATUS_OPEN_ALL] = Entrepot::STATUS_OPEN_ALL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT ps.rowid, ps.reel, ps.fk_entrepot";
|
$sql = "SELECT ps.rowid, ps.reel, ps.fk_entrepot";
|
||||||
@ -5188,7 +5193,7 @@ class Product extends CommonObject
|
|||||||
$sql .= " WHERE w.entity IN (".getEntity('stock').")";
|
$sql .= " WHERE w.entity IN (".getEntity('stock').")";
|
||||||
$sql .= " AND w.rowid = ps.fk_entrepot";
|
$sql .= " AND w.rowid = ps.fk_entrepot";
|
||||||
$sql .= " AND ps.fk_product = ".$this->id;
|
$sql .= " AND ps.fk_product = ".$this->id;
|
||||||
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS) && count($warehouseStatus)) {
|
if (count($warehouseStatus)) {
|
||||||
$sql .= " AND w.statut IN (".$this->db->sanitize(implode(',', $warehouseStatus)).")";
|
$sql .= " AND w.statut IN (".$this->db->sanitize(implode(',', $warehouseStatus)).")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -332,7 +332,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||||
print '<select name="statut" class="flat">';
|
print '<select id="warehousestatus" name="statut" class="flat">';
|
||||||
foreach ($object->statuts as $key => $value) {
|
foreach ($object->statuts as $key => $value) {
|
||||||
if ($key == 1) {
|
if ($key == 1) {
|
||||||
print '<option value="'.$key.'" selected>'.$langs->trans($value).'</option>';
|
print '<option value="'.$key.'" selected>'.$langs->trans($value).'</option>';
|
||||||
@ -341,6 +341,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</select>';
|
print '</select>';
|
||||||
|
print ajax_combobox('warehousestatus');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
@ -678,13 +679,13 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//print '<td>'.dol_print_date($objp->datem).'</td>';
|
//print '<td>'.dol_print_date($objp->datem).'</td>';
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
$parameters = array('obj'=>$objp);
|
$parameters = array('obj'=>$objp);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
print "<td>";
|
|
||||||
$productstatic->id = $objp->rowid;
|
$productstatic->id = $objp->rowid;
|
||||||
$productstatic->ref = $objp->ref;
|
$productstatic->ref = $objp->ref;
|
||||||
$productstatic->label = $objp->produit;
|
$productstatic->label = $objp->produit;
|
||||||
@ -701,11 +702,13 @@ if ($action == 'create') {
|
|||||||
$productstatic->accountancy_code_buy = $objp->accountancy_code_buy;
|
$productstatic->accountancy_code_buy = $objp->accountancy_code_buy;
|
||||||
$productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra;
|
$productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra;
|
||||||
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
|
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
|
||||||
|
|
||||||
|
print "<td>";
|
||||||
print $productstatic->getNomUrl(1, 'stock', 16);
|
print $productstatic->getNomUrl(1, 'stock', 16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<td>'.$objp->produit.'</td>';
|
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objp->produit).'">'.dol_escape_htmltag($objp->produit).'</td>';
|
||||||
|
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
$valtoshow = price(price2num($objp->value, 'MS'), 0, '', 0, 0); // TODO replace with a qty() function
|
$valtoshow = price(price2num($objp->value, 'MS'), 0, '', 0, 0); // TODO replace with a qty() function
|
||||||
@ -723,10 +726,10 @@ if ($action == 'create') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Price buy PMP
|
// Price buy PMP
|
||||||
print '<td class="right">'.price(price2num($objp->ppmp, 'MU')).'</td>';
|
print '<td class="right nowraponall">'.price(price2num($objp->ppmp, 'MU')).'</td>';
|
||||||
|
|
||||||
// Total PMP
|
// Total PMP
|
||||||
print '<td class="right">'.price(price2num($objp->ppmp * $objp->value, 'MT')).'</td>';
|
print '<td class="right amount nowraponall">'.price(price2num($objp->ppmp * $objp->value, 'MT')).'</td>';
|
||||||
$totalvalue += price2num($objp->ppmp * $objp->value, 'MT');
|
$totalvalue += price2num($objp->ppmp * $objp->value, 'MT');
|
||||||
|
|
||||||
// Price sell min
|
// Price sell min
|
||||||
@ -871,7 +874,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||||
print '<select name="statut" class="flat">';
|
print '<select id="warehousestatus" name="statut" class="flat">';
|
||||||
foreach ($object->statuts as $key => $value) {
|
foreach ($object->statuts as $key => $value) {
|
||||||
if ($key == $object->statut) {
|
if ($key == $object->statut) {
|
||||||
print '<option value="'.$key.'" selected>'.$langs->trans($value).'</option>';
|
print '<option value="'.$key.'" selected>'.$langs->trans($value).'</option>';
|
||||||
@ -880,6 +883,8 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</select>';
|
print '</select>';
|
||||||
|
print ajax_combobox('warehousestatus');
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
|
|||||||
@ -173,7 +173,7 @@ class Entrepot extends CommonObject
|
|||||||
|
|
||||||
$this->statuts[self::STATUS_CLOSED] = 'Closed2';
|
$this->statuts[self::STATUS_CLOSED] = 'Closed2';
|
||||||
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
|
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
|
||||||
$this->statuts[self::STATUS_OPEN_ALL] = 'OpenAll';
|
$this->statuts[self::STATUS_OPEN_ALL] = 'OpenAnyMovement';
|
||||||
$this->statuts[self::STATUS_OPEN_INTERNAL] = 'OpenInternal';
|
$this->statuts[self::STATUS_OPEN_INTERNAL] = 'OpenInternal';
|
||||||
} else {
|
} else {
|
||||||
$this->statuts[self::STATUS_OPEN_ALL] = 'Opened';
|
$this->statuts[self::STATUS_OPEN_ALL] = 'Opened';
|
||||||
|
|||||||
@ -916,6 +916,7 @@ if (!$variants) {
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) {
|
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) {
|
||||||
$colspan = 3;
|
$colspan = 3;
|
||||||
print '<tr class="liste_titre"><td width="14%">';
|
print '<tr class="liste_titre"><td width="14%">';
|
||||||
@ -979,6 +980,8 @@ if (!$variants) {
|
|||||||
|
|
||||||
$stock_real = price2num($obj->reel, 'MS');
|
$stock_real = price2num($obj->reel, 'MS');
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Warehouse
|
||||||
print '<td colspan="4">';
|
print '<td colspan="4">';
|
||||||
print $entrepotstatic->getNomUrl(1);
|
print $entrepotstatic->getNomUrl(1);
|
||||||
if (!empty($conf->use_javascript_ajax) && !empty($conf->productbatch->enabled) && $object->hasbatch()) {
|
if (!empty($conf->use_javascript_ajax) && !empty($conf->productbatch->enabled) && $object->hasbatch()) {
|
||||||
@ -987,25 +990,28 @@ if (!$variants) {
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="right">'.$stock_real.($stock_real < 0 ? ' '.img_warning() : '').'</td>';
|
print '<td class="right">'.$stock_real.($stock_real < 0 ? ' '.img_warning() : '').'</td>';
|
||||||
|
|
||||||
// PMP
|
// PMP
|
||||||
print '<td class="right">'.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').'</td>';
|
print '<td class="right nowraponall">'.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').'</td>';
|
||||||
|
|
||||||
// Value purchase
|
// Value purchase
|
||||||
print '<td class="right">'.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').'</td>';
|
print '<td class="right amount nowraponall">'.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').'</td>';
|
||||||
|
|
||||||
// Sell price
|
// Sell price
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
print price(price2num($object->price, 'MU'), 1);
|
||||||
print price(price2num($object->price, 'MU'), 1);
|
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||||
} else {
|
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||||
print $langs->trans("Variable");
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Value sell
|
// Value sell
|
||||||
print '<td class="right">';
|
print '<td class="right amount nowraponall">';
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
print price(price2num($object->price * $obj->reel, 'MT'), 1);
|
||||||
print price(price2num($object->price * $obj->reel, 'MT'), 1);
|
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||||
} else {
|
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||||
print $langs->trans("Variable");
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
@ -1117,10 +1123,9 @@ if (!$variants) {
|
|||||||
print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' ';
|
print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_total right">';
|
print '<td class="liste_total right">';
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) {
|
print ($total ? price($totalvaluesell / $total, 1) : ' ');
|
||||||
print ($total ? price($totalvaluesell / $total, 1) : ' ');
|
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||||
} else {
|
print $form->textwithpicto('', $langs->trans("Variable"));
|
||||||
print $langs->trans("Variable");
|
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Value to sell
|
// Value to sell
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user