Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
124f41f863
60
ChangeLog
60
ChangeLog
@ -2,33 +2,6 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 10.0.5 compared to 10.0.4 *****
|
||||
FIX: 10.0: add URL param "restore_last_search_values=1" to all backlinks pointing to lists
|
||||
FIX: 10.0: do not display single-letter values (indicating duration unit without value) in product list
|
||||
FIX: #12473
|
||||
FIX: #12481 : fix ticket creation from thirdparty, mission $socid var
|
||||
FIX: #12482
|
||||
FIX: #12644
|
||||
FIX: #12665 Mass invoice validation with stock management
|
||||
FIX: #12688
|
||||
FIX: #12745
|
||||
FIX: add and modify category translate form with posted values on errors
|
||||
FIX: add URL param "restore_last_search_values=1" to all backlinks that point to a list
|
||||
FIX: CommandeFournisseurLigne update function must not be able to return other value than 1 if success
|
||||
FIX: contact card state address selected after filling address
|
||||
FIX: dol_string_nohtmltag when there is html with windows EOL "<br>\r\n"
|
||||
FIX: filter language is an array
|
||||
FIX: first col at wrong position in Export 2007 (new)
|
||||
FIX: getrights() request
|
||||
FIX: Invoice Situation integration into Margin
|
||||
FIX: missing nl2br conversion
|
||||
FIX: not fee in payout list
|
||||
FIX: product_fourn_price_id was assigned too late for logPrice() function
|
||||
FIX: Reduce number of request for list of products
|
||||
FIX: set due date in object in create invoice
|
||||
FIX: units traductions for selectUnits() function
|
||||
FIX: when we need to bill several orders, order lines unit is not on bill lines
|
||||
NEW: 9.0: allow users to use the mysqldump '--quick' option
|
||||
|
||||
***** ChangeLog for 12.0.0 compared to 11.0.0 *****
|
||||
For Users:
|
||||
@ -48,9 +21,10 @@ Following changes may create regressions for some external modules, but were nec
|
||||
***** ChangeLog for 11.0.0 compared to 10.0.0 *****
|
||||
For Users:
|
||||
|
||||
NEW: Module BOM is now stable (Module MO - Manufacturing Order is still in development).
|
||||
NEW: Module BOM is now stable.
|
||||
NEW: Module MO - Manufacturing Order available with experimental status.
|
||||
NEW: Can set the Address/Contact by default on third parties.
|
||||
NEW: Add a dictionary for list of Social networks
|
||||
NEW: Add a dictionary to edit list of Social networks.
|
||||
NEW: A nicer dashboard for open elements on Home page.
|
||||
NEW: Add task widget and add task progress bar
|
||||
NEW: Support of deployment of metapackages
|
||||
@ -254,6 +228,34 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* The jquery plugin/dependency multiselect has been removed. It was not used by Dolibarr core.
|
||||
|
||||
|
||||
***** ChangeLog for 10.0.5 compared to 10.0.4 *****
|
||||
FIX: 10.0: add URL param "restore_last_search_values=1" to all backlinks pointing to lists
|
||||
FIX: 10.0: do not display single-letter values (indicating duration unit without value) in product list
|
||||
FIX: #12473
|
||||
FIX: #12481 : fix ticket creation from thirdparty, mission $socid var
|
||||
FIX: #12482
|
||||
FIX: #12644
|
||||
FIX: #12665 Mass invoice validation with stock management
|
||||
FIX: #12688
|
||||
FIX: #12745
|
||||
FIX: add and modify category translate form with posted values on errors
|
||||
FIX: add URL param "restore_last_search_values=1" to all backlinks that point to a list
|
||||
FIX: CommandeFournisseurLigne update function must not be able to return other value than 1 if success
|
||||
FIX: contact card state address selected after filling address
|
||||
FIX: dol_string_nohtmltag when there is html with windows EOL "<br>\r\n"
|
||||
FIX: filter language is an array
|
||||
FIX: first col at wrong position in Export 2007 (new)
|
||||
FIX: getrights() request
|
||||
FIX: Invoice Situation integration into Margin
|
||||
FIX: missing nl2br conversion
|
||||
FIX: not fee in payout list
|
||||
FIX: product_fourn_price_id was assigned too late for logPrice() function
|
||||
FIX: Reduce number of request for list of products
|
||||
FIX: set due date in object in create invoice
|
||||
FIX: units traductions for selectUnits() function
|
||||
FIX: when we need to bill several orders, order lines unit is not on bill lines
|
||||
NEW: 9.0: allow users to use the mysqldump '--quick' option
|
||||
|
||||
***** ChangeLog for 10.0.4 compared to 10.0.3 *****
|
||||
FIX: The pdf templates were using the large logo making PDF too large (and edition of proposal, order, invoice VERY slow)
|
||||
FIX: #12258
|
||||
|
||||
@ -97,11 +97,13 @@ if (empty($reshook))
|
||||
$backurlforlist = DOL_URL_ROOT.'/bom/bom_list.php';
|
||||
|
||||
if (empty($backtopage) || ($cancel && empty($id))) {
|
||||
//var_dump($backurlforlist);exit;
|
||||
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) $backtopage = $backurlforlist;
|
||||
else $backtopage = DOL_URL_ROOT.'/bom/bom_card.php?id='.($id > 0 ? $id : '__ID__');
|
||||
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
|
||||
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) $backtopage = $backurlforlist;
|
||||
else $backtopage = dol_buildpath('/bom/bom_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
|
||||
}
|
||||
}
|
||||
$triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
$triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
// Actions cancel, add, update, delete or clone
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
@ -169,7 +171,9 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($_POST['qty_frozen']);
|
||||
unset($_POST['idprod']);
|
||||
unset($_POST['qty']);
|
||||
unset($_POST['qty_frozen']);
|
||||
unset($_POST['disable_stock_change']);
|
||||
}
|
||||
}
|
||||
@ -207,7 +211,9 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($_POST['qty_frozen']);
|
||||
unset($_POST['idprod']);
|
||||
unset($_POST['qty']);
|
||||
unset($_POST['qty_frozen']);
|
||||
unset($_POST['disable_stock_change']);
|
||||
}
|
||||
}
|
||||
@ -644,7 +650,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
{
|
||||
if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write))
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/mrp/mo_card.php?action=create&fk_bom='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("CreateMO").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/mrp/mo_card.php?action=create&fk_bom='.$object->id.'&backtopageforcancel='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("CreateMO").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,12 @@ if ($cancel)
|
||||
{
|
||||
/*var_dump($cancel);
|
||||
var_dump($backtopage);exit;*/
|
||||
if (!empty($backtopage))
|
||||
if (!empty($backtopageforcancel))
|
||||
{
|
||||
header("Location: ".$backtopageforcancel);
|
||||
exit;
|
||||
}
|
||||
elseif (!empty($backtopage))
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
|
||||
@ -554,6 +554,7 @@ ALTER TABLE llx_mrp_production MODIFY COLUMN qty real NOT NULL DEFAULT 1;
|
||||
|
||||
ALTER TABLE llx_mrp_production ADD COLUMN qty_frozen smallint DEFAULT 0;
|
||||
ALTER TABLE llx_mrp_production ADD COLUMN disable_stock_change smallint DEFAULT 0;
|
||||
|
||||
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_mo FOREIGN KEY (fk_mo) REFERENCES llx_mrp_mo (rowid);
|
||||
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
|
||||
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_stock_movement FOREIGN KEY (fk_stock_movement) REFERENCES llx_stock_mouvement (rowid);
|
||||
|
||||
@ -201,6 +201,13 @@ delete from llx_element_element where sourcetype='commande' and fk_source not in
|
||||
DELETE FROM llx_actioncomm_resources WHERE fk_actioncomm not in (select id from llx_actioncomm);
|
||||
|
||||
|
||||
-- Fix: delete orphelin links in llx_bank_url
|
||||
DELETE from llx_bank_url where type = 'payment' and url_id not in (select rowid from llx_paiement);
|
||||
DELETE from llx_bank_url where type = 'payment_supplier' and url_id not in (select rowid from llx_paiementfourn);
|
||||
DELETE from llx_bank_url where type = 'company' and url_id not in (select rowid from llx_societe);
|
||||
--SELECT * from llx_bank where rappro = 0 and label LIKE '(CustomerInvoicePayment%)' and rowid not in (select fk_bank from llx_bank_url where type = 'payment');
|
||||
--SELECT * from llx_bank where rappro = 0 and label LIKE '(SupplierInvoicePayment%)' and rowid not in (select fk_bank from llx_bank_url where type = 'payment_supplier');
|
||||
|
||||
-- Fix link on parent that were removed
|
||||
DROP table tmp_user;
|
||||
CREATE TABLE tmp_user as (select * from llx_user);
|
||||
@ -462,7 +469,10 @@ update llx_facturedet set product_type = 1 where product_type = 0 AND fk_product
|
||||
update llx_facture_fourn_det set product_type = 0 where product_type = 1 AND fk_product > 0 AND fk_product IN (SELECT rowid FROM llx_product WHERE fk_product_type = 0);
|
||||
update llx_facture_fourn_det set product_type = 1 where product_type = 0 AND fk_product > 0 AND fk_product IN (SELECT rowid FROM llx_product WHERE fk_product_type = 1);
|
||||
|
||||
|
||||
|
||||
DELETE FROM llx_mrp_production where qty = 0;
|
||||
|
||||
|
||||
UPDATE llx_accounting_bookkeeping set date_creation = tms where date_creation IS NULL;
|
||||
|
||||
|
||||
|
||||
@ -54,6 +54,7 @@ ToConsume=To consume
|
||||
ToProduce=To produce
|
||||
QtyAlreadyConsumed=Qty already consumed
|
||||
QtyAlreadyProduced=Qty already produced
|
||||
ConsumeOrProduce=Consume or Produce
|
||||
ConsumeAndProduceAll=Consume and Produce All
|
||||
Manufactured=Manufactured
|
||||
TheProductXIsAlreadyTheProductToProduce=The product to add is already the product to produce.
|
||||
|
||||
@ -143,6 +143,7 @@ InventoryCode=Movement or inventory code
|
||||
IsInPackage=Contained into package
|
||||
WarehouseAllowNegativeTransfer=Stock can be negative
|
||||
qtyToTranferIsNotEnough=You don't have enough stock from your source warehouse and your setup does not allow negative stocks.
|
||||
qtyToTranferLotIsNotEnough=You don't have enough stock, for this lot number, from your source warehouse and your setup does not allow negative stocks (Qty for product '%s' with lot '%s' is %s in warehouse '%s').
|
||||
ShowWarehouse=Show warehouse
|
||||
MovementCorrectStock=Stock correction for product %s
|
||||
MovementTransferStock=Stock transfer of product %s into another warehouse
|
||||
|
||||
@ -496,6 +496,7 @@ class Mo extends CommonObject
|
||||
if ($obj) {
|
||||
$resarray[] = array(
|
||||
'rowid'=> $obj->rowid,
|
||||
'date'=> $this->db->jdate($obj->date_creation),
|
||||
'qty' => $obj->qty,
|
||||
'role' => $obj->role,
|
||||
'fk_product' => $obj->fk_product,
|
||||
|
||||
@ -93,7 +93,7 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>'."\n";
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("MO").'</th></tr>'."\n";
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr><td class="center" colspan="2">';
|
||||
|
||||
@ -43,6 +43,12 @@ function moPrepareHead($object)
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/mrp/mo_production.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Production");
|
||||
$arrayproduced = $object->fetchLinesLinked('produced', 0);
|
||||
$nbProduced = 0;
|
||||
foreach($arrayproduced as $lineproduced) {
|
||||
$nbProduced += $lineproduced['qty'];
|
||||
}
|
||||
$head[$h][1].= '<span class="badge marginleftonlyshort">'.$nbProduced.' / '.$object->qty.'</span>';
|
||||
$head[$h][2] = 'production';
|
||||
$h++;
|
||||
|
||||
|
||||
@ -62,6 +62,7 @@ $confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
//$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
// Initialize technical objects
|
||||
@ -135,6 +136,10 @@ if (empty($reshook))
|
||||
else $backtopage = DOL_URL_ROOT.'/mrp/mo_card.php?id='.($id > 0 ? $id : '__ID__');
|
||||
}
|
||||
}
|
||||
if ($cancel && ! empty($backtopageforcancel)) {
|
||||
$backtopage = $backtopageforcancel;
|
||||
}
|
||||
|
||||
$triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
||||
@ -202,7 +207,8 @@ if ($action == 'create')
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
|
||||
dol_fiche_head(array(), '');
|
||||
|
||||
@ -304,8 +310,9 @@ if (($id || $ref) && $action == 'edit')
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
dol_include_once('/mrp/class/mo.class.php');
|
||||
dol_include_once('/mrp/lib/mrp_mo.lib.php');
|
||||
@ -66,6 +67,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'moc
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
//$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
$collapse = GETPOST('collapse', 'aZ09comma');
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new Mo($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
@ -157,7 +160,7 @@ if (empty($reshook))
|
||||
$result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_REOPEN');
|
||||
}
|
||||
|
||||
if (in_array($action, array('confirm_consume', 'confirm_produce', 'confirm_consumeandproduceall'))) {
|
||||
if (in_array($action, array('confirm_consumeorproduce', 'confirm_consumeandproduceall'))) {
|
||||
$stockmove = new MouvementStock($db);
|
||||
|
||||
$labelmovement = GETPOST('inventorylabel', 'alphanohtml');
|
||||
@ -256,13 +259,13 @@ if (empty($reshook))
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(GETPOST('batchtoproduce-'.$line->id.'-'.$i));
|
||||
$idstockmove = 0;
|
||||
if (! $error && GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) > 0) {
|
||||
// Record stock movement
|
||||
$id_product_batch = 0;
|
||||
$stockmove->origin = $object;
|
||||
$idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batchtoproduce-'.$line->id.'-'.$i), $id_product_batch, $codemovement);
|
||||
$idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, '', '', GETPOST('batchtoproduce-'.$line->id.'-'.$i), dol_now(), $id_product_batch, $codemovement);
|
||||
if ($idstockmove < 0) {
|
||||
$error++;
|
||||
setEventMessages($stockmove->error, $stockmove->errors, 'errors');
|
||||
@ -371,6 +374,7 @@ $form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
$formproject = new FormProjets($db);
|
||||
$formproduct = new FormProduct($db);
|
||||
$tmpwarehouse = new Entrepot($db);
|
||||
|
||||
llxHeader('', $langs->trans('Mo'), '');
|
||||
|
||||
@ -516,7 +520,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
if (! in_array($action, array('consume', 'produce', 'consumeandproduceall')))
|
||||
if (! in_array($action, array('consumeorproduce', 'consumeandproduceall')))
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
@ -524,27 +528,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Note that $action and $object may be modified by hook
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
// Consume
|
||||
|
||||
// Consume or produce
|
||||
if ($object->status == Mo::STATUS_VALIDATED || $object->status == Mo::STATUS_INPROGRESS) {
|
||||
if ($permissiontoproduce) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=consume">'.$langs->trans('Consume').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=consumeorproduce">'.$langs->trans('ConsumeOrProduce').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('Consume').'</a>';
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('ConsumeOrProduce').'</a>';
|
||||
}
|
||||
} elseif ($object->status == Mo::STATUS_DRAFT) {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ValidateBefore").'">'.$langs->trans('Consume').'</a>';
|
||||
}
|
||||
|
||||
// Produce
|
||||
if ($object->status == Mo::STATUS_VALIDATED || $object->status == Mo::STATUS_INPROGRESS) {
|
||||
if ($permissiontoproduce) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=produce">'.$langs->trans('Produce').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('Produce').'</a>';
|
||||
}
|
||||
} elseif ($object->status == Mo::STATUS_DRAFT) {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ValidateBefore").'">'.$langs->trans('Produce').'</a>';
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ValidateBefore").'">'.$langs->trans('ConsumeOrProduce').'</a>';
|
||||
}
|
||||
|
||||
// ConsumeAndProduceAll
|
||||
@ -571,7 +563,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if (in_array($action, array('consume', 'produce', 'consumeandproduceall')))
|
||||
if (in_array($action, array('consumeorproduce', 'consumeandproduceall')))
|
||||
{
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -599,6 +591,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
/*
|
||||
* Lines
|
||||
*/
|
||||
$collapse = 1;
|
||||
|
||||
if (!empty($object->table_element_line))
|
||||
{
|
||||
@ -613,26 +606,36 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print load_fiche_titre($langs->trans('Consumption'), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
print '<table id="tablelines" class="noborder noshadow nobottom centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Product").'</td>';
|
||||
print '<td>'.$langs->trans("Qty").'</td>';
|
||||
print '<td>'.$langs->trans("QtyAlreadyConsumed").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Qty").'</td>';
|
||||
print '<td class="right">'.$langs->trans("QtyAlreadyConsumed").'</td>';
|
||||
print '<td>';
|
||||
if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) print $langs->trans("Warehouse");
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) print $langs->trans("Warehouse");
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
print '<td>';
|
||||
if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) print $langs->trans("Batch");
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) print $langs->trans("Batch");
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($object->lines))
|
||||
{
|
||||
foreach($object->lines as $line) {
|
||||
$nblinetoconsume = 0;
|
||||
foreach($object->lines as $line) {
|
||||
if ($line->role == 'toconsume') {
|
||||
$nblinetoconsume++;
|
||||
}
|
||||
}
|
||||
|
||||
$nblinetoconsumecursor = 0;
|
||||
foreach($object->lines as $line) {
|
||||
if ($line->role == 'toconsume') {
|
||||
$nblinetoconsumecursor++;
|
||||
|
||||
$tmpproduct = new Product($db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
|
||||
@ -644,31 +647,37 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$tmpproduct->getNomUrl(1).'</td>';
|
||||
print '<td>';
|
||||
print '<td class="right">';
|
||||
$help = '';
|
||||
if ($line->qty_frozen) $help.=($help ? '<br>' : '').'<strong>'.$langs->trans("QuantityFrozen").'</strong>: '.yn(1).' ('.$langs->trans("QuantityConsumedInvariable").')';
|
||||
if ($line->disable_stock_change) $help.=($help ? '<br>' : '').'<strong>'.$langs->trans("DisableStockChange").'</strong>: '.yn(1).' ('.(($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")).')';
|
||||
if ($help) {
|
||||
print $form->textwithpicto($line->qty, $help);
|
||||
print $form->textwithpicto($line->qty, $help, -1);
|
||||
} else {
|
||||
print $line->qty;
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$alreadyconsumed.'</td>';
|
||||
print '<td>'; // Warehouse
|
||||
print '<td class="right">';
|
||||
if ($alreadyconsumed) {
|
||||
print '<script>';
|
||||
print 'jQuery(document).ready(function() {
|
||||
print '<script>';
|
||||
print 'jQuery(document).ready(function() {
|
||||
jQuery("#expandtoproduce'.$line->id.'").click(function() {
|
||||
console.log("Expand mrp_production line '.$line->id.'");
|
||||
jQuery(".expanddetail'.$line->id.'").toggle();
|
||||
jQuery(".expanddetail'.$line->id.'").toggle();';
|
||||
if ($nblinetoconsume == $nblinetoconsumecursor) {
|
||||
print 'if (jQuery("#tablelines").hasClass("nobottom")) { jQuery("#tablelines").removeClass("nobottom"); } else { jQuery("#tablelines").addClass("nobottom"); }';
|
||||
}
|
||||
print '
|
||||
});
|
||||
});';
|
||||
print '</script>';
|
||||
if (empty($conf->use_javascript_ajax)) print '<a href="'.$_SERVER["PHP_SELF"].'?collapse='.$collapse.','.$line->id.'">';
|
||||
print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"');
|
||||
if (empty($conf->use_javascript_ajax)) print '</a>';
|
||||
print '</script>';
|
||||
if (empty($conf->use_javascript_ajax)) print '<a href="'.$_SERVER["PHP_SELF"].'?collapse='.$collapse.','.$line->id.'">';
|
||||
print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"');
|
||||
if (empty($conf->use_javascript_ajax)) print '</a>';
|
||||
}
|
||||
print ' '.$alreadyconsumed;
|
||||
print '</td>';
|
||||
print '<td>'; // Warehouse
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
print '<td></td>'; // Lot
|
||||
@ -676,15 +685,30 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</tr>';
|
||||
|
||||
// Show detailed of already consumed with js code to collapse
|
||||
//$arrayoflines = $object->fetchLinesLinked('consumed', $line->id);
|
||||
foreach($arrayoflines as $line2) {
|
||||
print '<tr class="expanddetail'.$line->id.' hideobject opacitylow">';
|
||||
print '<td>';
|
||||
print dol_print_date($line2['date'], 'dayhour');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="right">'.$line2['qty'].'</td>';
|
||||
print '<td>';
|
||||
if ($line2['fk_warehouse'] > 0) {
|
||||
$tmpwarehouse->fetch($line2['fk_warehouse']);
|
||||
print $tmpwarehouse->getNomUrl();
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$line2['batch'].'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) {
|
||||
if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
$i = 1;
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("ToConsume").'</td>';
|
||||
$preselected = (GETPOSTISSET('qty-'.$line->id.'-'.$i) ? GETPOST('qty-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyconsumed));
|
||||
if ($action == 'produce') $preselected = 0;
|
||||
print '<td><input type="text" class="width50" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
||||
if ($action == 'consumeorproduce' && ! GETPOSTISSET('qty-'.$line->id.'-'.$i)) $preselected = 0;
|
||||
print '<td class="right"><input type="text" class="width50" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
||||
print '<td></td>';
|
||||
print '<td>';
|
||||
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
@ -712,24 +736,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
}
|
||||
|
||||
/*if (!empty($object->lines))
|
||||
{
|
||||
$object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/mrp/tpl');
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines')
|
||||
{
|
||||
if ($action != 'editline')
|
||||
{
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc, '/mrp/tpl');
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
}
|
||||
}*/
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -740,26 +746,36 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print load_fiche_titre($langs->trans('Production'), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
print '<table id="tablelinestoproduce" class="noborder noshadow nobottom centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Product").'</td>';
|
||||
print '<td>'.$langs->trans("Qty").'</td>';
|
||||
print '<td>'.$langs->trans("QtyAlreadyProduced").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Qty").'</td>';
|
||||
print '<td class="right">'.$langs->trans("QtyAlreadyProduced").'</td>';
|
||||
print '<td>';
|
||||
if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) print $langs->trans("Warehouse");
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) print $langs->trans("Warehouse");
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
print '<td>';
|
||||
if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) print $langs->trans("Batch");
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) print $langs->trans("Batch");
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($object->lines))
|
||||
{
|
||||
$nblinetoproduce = 0;
|
||||
foreach($object->lines as $line) {
|
||||
if ($line->role == 'toproduce') {
|
||||
$nblinetoproduce++;
|
||||
}
|
||||
}
|
||||
|
||||
$nblinetoproducecursor = 0;
|
||||
foreach($object->lines as $line) {
|
||||
if ($line->role == 'toproduce') {
|
||||
$nblinetoproducecursor++;
|
||||
|
||||
$tmpproduct = new Product($db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
|
||||
@ -771,34 +787,58 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$tmpproduct->getNomUrl(1).'</td>';
|
||||
print '<td>'.$line->qty.'</td>';
|
||||
print '<td>'.$alreadyproduced.'</td>';
|
||||
print '<td>'; // Warehouse
|
||||
print '<td class="right">'.$line->qty.'</td>';
|
||||
print '<td class="right">';
|
||||
if ($alreadyproduced) {
|
||||
print '<script>';
|
||||
print 'jQuery(document).ready(function() {
|
||||
jQuery("#expand'.$line->id.'").click(function() {
|
||||
jQuery("#expandtoproduce'.$line->id.'").click(function() {
|
||||
console.log("Expand mrp_production line '.$line->id.'");
|
||||
jQuery(".expanddetail'.$line->id.'").toggle();
|
||||
jQuery(".expanddetailtoproduce'.$line->id.'").toggle();';
|
||||
if ($nblinetoproduce == $nblinetoproducecursor) {
|
||||
print 'if (jQuery("#tablelinestoproduce").hasClass("nobottom")) { jQuery("#tablelinestoproduce").removeClass("nobottom"); } else { jQuery("#tablelinestoproduce").addClass("nobottom"); }';
|
||||
}
|
||||
print '
|
||||
});
|
||||
});';
|
||||
print '</script>';
|
||||
if (empty($conf->use_javascript_ajax)) print '<a href="'.$_SERVER["PHP_SELF"].'?collapse='.$collapse.','.$line->id.'">';
|
||||
print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expand'.$line->id.'"');
|
||||
print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"');
|
||||
if (empty($conf->use_javascript_ajax)) print '</a>';
|
||||
}
|
||||
print ' '.$alreadyproduced;
|
||||
print '</td>';
|
||||
print '<td>'; // Warehouse
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
print '<td></td>'; // Lot
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
if (in_array($action, array('consume', 'produce', 'consumeandproduceall'))) {
|
||||
// Show detailed of already consumed with js code to collapse
|
||||
foreach($arrayoflines as $line2) {
|
||||
print '<tr class="expanddetailtoproduce'.$line->id.' hideobject opacitylow">';
|
||||
print '<td>';
|
||||
print dol_print_date($line2['date'], 'dayhour');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="right">'.$line2['qty'].'</td>';
|
||||
print '<td>';
|
||||
if ($line2['fk_warehouse'] > 0) {
|
||||
$tmpwarehouse->fetch($line2['fk_warehouse']);
|
||||
print $tmpwarehouse->getNomUrl();
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$line2['batch'].'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("ToProduce").'</td>';
|
||||
$preselected = (GETPOSTISSET('qtytoproduce-'.$line->id.'-'.$i) ? GETPOST('qtytoproduce-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyproduced));
|
||||
if ($action == 'consume') $preselected = 0;
|
||||
print '<td><input type="text" class="width50" name="qtytoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
||||
if ($action == 'consumeorproduce' && ! GETPOSTISSET('qtytoproduce-'.$line->id.'-'.$i)) $preselected = 0;
|
||||
print '<td class="right"><input type="text" class="width50" name="qtytoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
||||
print '<td></td>';
|
||||
print '<td>';
|
||||
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
@ -829,7 +869,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if (in_array($action, array('consume', 'produce', 'consumeandproduceall')))
|
||||
if (in_array($action, array('consumeorproduce', 'consumeandproduceall')))
|
||||
{
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
@ -318,14 +318,18 @@ class MouvementStock extends CommonObject
|
||||
{
|
||||
if ($batch != $batchcursor) continue;
|
||||
$foundforbatch=1;
|
||||
if ($prodbatch->qty < abs($qty)) $qtyisnotenough=1;
|
||||
if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty;
|
||||
break;
|
||||
}
|
||||
if (! $foundforbatch || $qtyisnotenough)
|
||||
{
|
||||
$langs->load("stocks");
|
||||
$this->error = $langs->trans('qtyToTranferLotIsNotEnough').' : '.$product->ref;
|
||||
$this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough').' : '.$product->ref;
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
$tmpwarehouse = new Entrepot($this->db);
|
||||
$tmpwarehouse->fetch($entrepot_id);
|
||||
|
||||
$this->error = $langs->trans('qtyToTranferLotIsNotEnough', $product->ref, $batch, $qtyisnotenough, $tmpwarehouse->ref);
|
||||
$this->errors[] = $langs->trans('qtyToTranferLotIsNotEnough', $product->ref, $batch, $qtyisnotenough, $tmpwarehouse->ref);
|
||||
$this->db->rollback();
|
||||
return -8;
|
||||
}
|
||||
|
||||
@ -244,6 +244,9 @@ select.flat, form.flat select {
|
||||
.opacitymediumbycolor {
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
.opacitylow {
|
||||
opacity: 0.6;
|
||||
}
|
||||
.opacityhigh {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
@ -462,6 +462,9 @@ select.flat, form.flat select {
|
||||
.opacitymediumbycolor {
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
.opacitylow {
|
||||
opacity: 0.6;
|
||||
}
|
||||
.opacityhigh {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user