Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/comm/propal/card.php htdocs/commande/card.php htdocs/emailcollector/class/emailcollector.class.php htdocs/index.php htdocs/website/index.php
This commit is contained in:
commit
95b1b3f990
@ -1220,14 +1220,16 @@ if ($id > 0) {
|
||||
$sql .= natural_search("code_iso", $search_code);
|
||||
} elseif ($search_code != '' && $id == 28) {
|
||||
$sql .= natural_search("h.code", $search_code);
|
||||
} elseif ($search_code != '' && $id == 32) {
|
||||
} elseif ($search_code != '' && ($id == 7 || $id == 32)) {
|
||||
$sql .= natural_search("a.code", $search_code);
|
||||
} elseif ($search_code != '' && $id == 3) {
|
||||
$sql .= natural_search("r.code_region", $search_code);
|
||||
} elseif ($search_code != '' && $id == 7) {
|
||||
$sql .= natural_search("a.code", $search_code);
|
||||
} elseif ($search_code != '' && $id == 10) {
|
||||
} elseif ($search_code != '' && ($id == 8 || $id == 10)) {
|
||||
$sql .= natural_search("t.code", $search_code);
|
||||
} elseif ($search_code != '' && $id == 1) {
|
||||
$sql .= natural_search("f.code", $search_code);
|
||||
} elseif ($search_code != '' && $id == 2) {
|
||||
$sql .= natural_search("d.code_departement", $search_code);
|
||||
} elseif ($search_code != '' && $id != 9) {
|
||||
$sql .= natural_search("code", $search_code);
|
||||
}
|
||||
|
||||
@ -305,7 +305,8 @@ class Categories extends DolibarrApi
|
||||
Categorie::TYPE_CUSTOMER,
|
||||
Categorie::TYPE_SUPPLIER,
|
||||
Categorie::TYPE_MEMBER,
|
||||
Categorie::TYPE_PROJECT
|
||||
Categorie::TYPE_PROJECT,
|
||||
Categorie::TYPE_KNOWLEDGEMANAGEMENT
|
||||
])) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
@ -322,6 +323,8 @@ class Categories extends DolibarrApi
|
||||
throw new RestException(401);
|
||||
} elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) {
|
||||
throw new RestException(401);
|
||||
} elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page);
|
||||
|
||||
@ -75,7 +75,7 @@ if ($_socid > 0) {
|
||||
// We load data of thirdparty
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->id = $_socid;
|
||||
$objsoc->fetch($_socid, $to);
|
||||
$objsoc->fetch($_socid);
|
||||
|
||||
|
||||
$head = societe_prepare_head($objsoc);
|
||||
@ -141,7 +141,6 @@ if ($_socid > 0) {
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
print '<table class="noborder centpercent">';
|
||||
$tag = !$tag;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("PriceLevel").'</td>';
|
||||
|
||||
@ -112,9 +112,9 @@ if ($id > 0 || !empty($ref)) {
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('propalcard', 'globalcard'));
|
||||
|
||||
$usercanread = $user->rights->propal->lire;
|
||||
$usercancreate = $user->rights->propal->creer;
|
||||
$usercandelete = $user->rights->propal->supprimer;
|
||||
$usercanread = $user->hasRight("propal", "lire");
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
$usercandelete = $user->hasRight("propal", "supprimer");
|
||||
|
||||
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->close)));
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->propal->propal_advance->validate)));
|
||||
|
||||
@ -108,9 +108,9 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
|
||||
$usercanread = $user->hasRight('commande', 'lire');
|
||||
$usercancreate = $user->hasRight('commande', 'creer');
|
||||
$usercandelete = $user->hasRight('commande', 'supprimer');
|
||||
$usercanread = $user->hasRight("commande", "lire");
|
||||
$usercancreate = $user->hasRight("commande", "creer");
|
||||
$usercandelete = $user->hasRight("commande", "supprimer");
|
||||
// Advanced permissions
|
||||
|
||||
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->hasRight('commande', 'order_advance', 'close'))));
|
||||
|
||||
@ -128,11 +128,11 @@ if ($id > 0 || !empty($ref)) {
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('invoicecard', 'globalcard'));
|
||||
|
||||
$usercanread = $user->rights->facture->lire;
|
||||
$usercancreate = $user->rights->facture->creer;
|
||||
$usercanissuepayment = $user->rights->facture->paiement;
|
||||
$usercandelete = $user->rights->facture->supprimer;
|
||||
$usercancreatecontract = $user->rights->contrat->creer;
|
||||
$usercanread = $user->hasRight("facture", "lire");
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
$usercanissuepayment = $user->hasRight("facture", "paiement");
|
||||
$usercandelete = $user->hasRight("facture", "supprimer");
|
||||
$usercancreatecontract = $user->hasRight("contrat", "creer");
|
||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->validate)));
|
||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->send)));
|
||||
$usercanreopen = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->reopen)));
|
||||
|
||||
@ -6024,7 +6024,7 @@ abstract class CommonObject
|
||||
// Test fetch_array ! is_int($key) because fetch_array result is a mix table with Key as alpha and Key as int (depend db engine)
|
||||
if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && !is_int($key)) {
|
||||
// we can add this attribute to object
|
||||
if (!empty($extrafields) && in_array($extrafields->attributes[$this->table_element]['type'][$key], array('date', 'datetime'))) {
|
||||
if (!empty($extrafields->attributes[$this->table_element]) && in_array($extrafields->attributes[$this->table_element]['type'][$key], array('date', 'datetime'))) {
|
||||
//var_dump($extrafields->attributes[$this->table_element]['type'][$key]);
|
||||
$this->array_options["options_".$key] = $this->db->jdate($value);
|
||||
} else {
|
||||
@ -6037,7 +6037,7 @@ abstract class CommonObject
|
||||
|
||||
// If field is a computed field, value must become result of compute
|
||||
foreach ($tab as $key => $value) {
|
||||
if (!empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
|
||||
if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
|
||||
//var_dump($conf->disable_compute);
|
||||
if (empty($conf->disable_compute)) {
|
||||
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '');
|
||||
|
||||
@ -111,7 +111,7 @@ class EmailCollector extends CommonObject
|
||||
public $fields = array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax200'),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax150'),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'),
|
||||
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'csslist'=>'small'),
|
||||
'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflow125'),
|
||||
|
||||
@ -162,7 +162,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
||||
}
|
||||
|
||||
// Number of project opened
|
||||
if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->hasRight('projet', 'lire')) {
|
||||
if (isModEnabled('project') && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->hasRight('projet', 'lire')) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
$board = new Project($db);
|
||||
$dashboardlines[$board->element] = $board->load_board($user);
|
||||
@ -235,7 +235,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
||||
}
|
||||
|
||||
// Number of supplier invoices (paid)
|
||||
if (isModEnabled('supplier_invoice') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->hasRight('fournisseur', 'facture', 'lire'))) {
|
||||
if (isModEnabled('supplier_invoice') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight('fournisseur', 'facture', 'lire')) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
$board = new FactureFournisseur($db);
|
||||
$dashboardlines[$board->element] = $board->load_board($user);
|
||||
|
||||
@ -468,6 +468,24 @@ class KnowledgeRecord extends CommonObject
|
||||
$this->error .= $this->db->lasterror();
|
||||
$errorflag = -1;
|
||||
}
|
||||
|
||||
// Delete all child tables
|
||||
if (!$error) {
|
||||
$elements = array('categorie_knowledgemanagement');
|
||||
foreach ($elements as $table) {
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$table;
|
||||
$sql .= " WHERE fk_knowledgemanagement = ".(int) $this->id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result) {
|
||||
$error++;
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->deleteCommon($user, $notrigger);
|
||||
//return $this->deleteCommon($user, $notrigger, 1);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ class Mo extends CommonObject
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>'1', 'noteditable'=>1),
|
||||
'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>'$conf->bom->enabled', 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth300', 'csslist'=>'nowraponall'),
|
||||
'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>'$conf->bom->enabled', 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth300', 'csslist'=>'nowraponall', 'picto'=>'bom'),
|
||||
'mrptype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>34, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>'$conf->product->enabled', 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax100', 'picto'=>'product'),
|
||||
'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1),
|
||||
@ -1375,13 +1375,13 @@ class Mo extends CommonObject
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
// Product or sub-bom
|
||||
print '<td class="linecoldescription">'.$langs->trans('Description');
|
||||
print '<td class="linecoldescription">'.$langs->trans('Ref');
|
||||
if (!empty($conf->global->BOM_SUB_BOM)) {
|
||||
print ' <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a> ';
|
||||
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a> ';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('Ref').'</td>';
|
||||
// Qty
|
||||
print '<td class="right">'.$langs->trans('Qty');
|
||||
if ($this->bom->bomtype == 0) {
|
||||
print ' <span class="opacitymedium">('.$langs->trans("ForAQuantityOf", $this->bom->qty).')</span>';
|
||||
@ -1395,7 +1395,7 @@ class Mo extends CommonObject
|
||||
print '<td class="center">'.$langs->trans('DisableStockChange').'</td>';
|
||||
print '<td class="center">'.$langs->trans('MoChildGenerate').'</td>';
|
||||
//print '<td class="center">'.$form->showCheckAddButtons('checkforselect', 1).'</td>';
|
||||
// print '<td class="center"></td>';
|
||||
//print '<td class="center"></td>';
|
||||
print '</tr>';
|
||||
$i = 0;
|
||||
|
||||
|
||||
@ -711,7 +711,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
$url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addconsumeline&token='.newToken();
|
||||
$permissiontoaddaconsumeline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall';
|
||||
$permissiontoaddaconsumeline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED;
|
||||
$parameters = array('morecss'=>'reposition');
|
||||
|
||||
$newcardbutton = '';
|
||||
@ -999,6 +999,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$i = 1;
|
||||
print '<!-- Enter line to consume -->'."\n";
|
||||
print '<tr name="batch_'.$line->id.'_'.$i.'">';
|
||||
// Ref
|
||||
print '<td><span class="opacitymedium">'.$langs->trans("ToConsume").'</span></td>';
|
||||
$preselected = (GETPOSTISSET('qty-'.$line->id.'-'.$i) ? GETPOST('qty-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyconsumed));
|
||||
if ($action == 'consumeorproduce' && !GETPOSTISSET('qty-'.$line->id.'-'.$i)) {
|
||||
@ -1047,12 +1048,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : '');
|
||||
print '<input type="text" class="width50" name="batch-'.$line->id.'-'.$i.'" value="'.$preselected.'" list="batch-'.$line->id.'-'.$i.'">';
|
||||
print $formproduct->selectLotDataList('batch-'.$line->id.'-'.$i, 0, $line->fk_product, '', '');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($tmpproduct->status_batch) {
|
||||
|
||||
$type = 'batch';
|
||||
print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$line->id.', \''.$type.'\', \'qtymissingconsume\')"');
|
||||
print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
@ -1097,10 +1095,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
$newcardbutton = '';
|
||||
$url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addproduceline&token='.newToken();
|
||||
$permissiontoaddaproductline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall';
|
||||
$permissiontoaddaproductline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED;
|
||||
$parameters = array('morecss'=>'reposition');
|
||||
if ($nblinetoproduce == 0 || $object->mrptype == 1) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddNewProduceLines'), '', 'fa fa-plus-circle size15x', $url, '', $permissiontoaddaproductline, $parameters);
|
||||
if ($action != 'consumeorproduce' && $action != 'consumeandproduceall') {
|
||||
if ($nblinetoproduce == 0 || $object->mrptype == 1) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddNewProduceLines'), '', 'fa fa-plus-circle size15x', $url, '', $permissiontoaddaproductline, $parameters);
|
||||
}
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans('Production'), $newcardbutton, '', 0, '', '');
|
||||
@ -1199,12 +1199,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<td class="right">'.$line->qty.'</td>';
|
||||
if ($permissiontoupdatecost) {
|
||||
// Defined $manufacturingcost
|
||||
$manufacturingcost = $bomcost;
|
||||
if (empty($manufacturingcost)) {
|
||||
$manufacturingcost = price2num($tmpproduct->cost_price, 'MU');
|
||||
}
|
||||
if (empty($manufacturingcost)) {
|
||||
$manufacturingcost = price2num($tmpproduct->pmp, 'MU');
|
||||
$manufacturingcost = 0;
|
||||
if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble"
|
||||
$manufacturingcost = $bomcost;
|
||||
if (empty($manufacturingcost)) {
|
||||
$manufacturingcost = price2num($tmpproduct->cost_price, 'MU');
|
||||
}
|
||||
if (empty($manufacturingcost)) {
|
||||
$manufacturingcost = price2num($tmpproduct->pmp, 'MU');
|
||||
}
|
||||
}
|
||||
|
||||
print '<td class="right nowraponall">';
|
||||
@ -1303,19 +1306,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<td class="right"><input type="text" class="width50 right" id="qtytoproduce-'.$line->id.'-'.$i.'" name="qtytoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
||||
if ($permissiontoupdatecost) {
|
||||
// Defined $manufacturingcost
|
||||
$manufacturingcost = $bomcost;
|
||||
if (empty($manufacturingcost)) {
|
||||
$manufacturingcost = price2num($tmpproduct->cost_price, 'MU');
|
||||
}
|
||||
if (empty($manufacturingcost)) {
|
||||
$manufacturingcost = price2num($tmpproduct->pmp, 'MU');
|
||||
$manufacturingcost = 0;
|
||||
if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble"
|
||||
$manufacturingcost = $bomcost;
|
||||
if (empty($manufacturingcost)) {
|
||||
$manufacturingcost = price2num($tmpproduct->cost_price, 'MU');
|
||||
}
|
||||
if (empty($manufacturingcost)) {
|
||||
$manufacturingcost = price2num($tmpproduct->pmp, 'MU');
|
||||
}
|
||||
}
|
||||
|
||||
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
$preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : price($manufacturingcost));
|
||||
$preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : ($manufacturingcost ? price($manufacturingcost) : ''));
|
||||
print '<td class="right"><input type="text" class="width50 right" name="pricetoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
||||
} else {
|
||||
print '<td><input type="hidden" class="width50 right" name="pricetoproduce-'.$line->id.'-'.$i.'" value="'.$manufacturingcost.'"></td>';
|
||||
print '<td><input type="hidden" class="width50 right" name="pricetoproduce-'.$line->id.'-'.$i.'" value="'.($manufacturingcost ? $manufacturingcost : '').'"></td>';
|
||||
}
|
||||
}
|
||||
print '<td></td>';
|
||||
|
||||
@ -44,6 +44,7 @@ $res = $tmpbom->fetch($line->fk_bom_child);
|
||||
<!-- BEGIN PHP TEMPLATE originproductline.tpl.php -->
|
||||
<?php
|
||||
print '<tr class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabled').'">';
|
||||
// Ref or label
|
||||
print '<td>';
|
||||
if ($res) {
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
@ -58,7 +59,7 @@ if ($res) {
|
||||
print $this->tpl['label'];
|
||||
}
|
||||
print '</td>';
|
||||
//print '<td>'.$this->tpl['label'].'</td>';
|
||||
// Qty
|
||||
print '<td class="right">'.$this->tpl['qty'].(($this->tpl['efficiency'] > 0 && $this->tpl['efficiency'] < 1) ? ' / '.$form->textwithpicto($this->tpl['efficiency'], $langs->trans("ValueOfMeansLoss")).' = '.$qtytoconsumeforline : '').'</td>';
|
||||
print '<td class="center">'.(empty($this->tpl['stock']) ? 0 : price2num($this->tpl['stock'], 'MS'));
|
||||
if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['stock'] < $this->tpl['seuil_stock_alerte'])) {
|
||||
@ -78,18 +79,19 @@ $selected = 1;
|
||||
if (!empty($selectedLines) && !in_array($this->tpl['id'], $selectedLines)) {
|
||||
$selected = 0;
|
||||
}
|
||||
print '<td class="center">';
|
||||
//print '<input id="cb'.$this->tpl['id'].'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->tpl['id'].'"'.($selected?' checked="checked"':'').'>';
|
||||
print '</td>';
|
||||
|
||||
if ($tmpbom->id) {
|
||||
if ($tmpbom->id > 0) {
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" name="bomlineid[]" value="' . $line->id . '">';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center"> </td>';
|
||||
print '<td class="center"></td>';
|
||||
}
|
||||
|
||||
//print '<td class="center">';
|
||||
//print '<input id="cb'.$this->tpl['id'].'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->tpl['id'].'"'.($selected?' checked="checked"':'').'>';
|
||||
//print '</td>';
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Select of all the sub-BOM lines
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* Copyright (C) 2016-2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
|
||||
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
*
|
||||
@ -1973,7 +1973,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
|
||||
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
||||
$doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
|
||||
$doleditor = new DolEditor('desc', GETPOSTISSET('desc') ? GETPOST('desc', 'restricthtml') : $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print "</td></tr>";
|
||||
@ -1983,7 +1983,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) {
|
||||
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td>';
|
||||
print img_picto('', 'globe', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="url" class="quatrevingtpercent" value="'.$object->url.'">';
|
||||
print '<input type="text" name="url" class="quatrevingtpercent" value="'.(GETPOSTISSET('url') ? GETPOST('url') : $object->url).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -471,6 +471,7 @@ if ($id > 0 || $ref) {
|
||||
print load_fiche_titre($langs->trans("AddSupplierPrice"));
|
||||
}
|
||||
|
||||
print "<!-- form to add a supplier price -->\n";
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="save_price">';
|
||||
@ -480,7 +481,7 @@ if ($id > 0 || $ref) {
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Supplier
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Supplier").'</td><td>';
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Supplier").'</td><td>';
|
||||
if ($rowid) {
|
||||
$supplier = new Fournisseur($db);
|
||||
$supplier->fetch($socid);
|
||||
@ -636,7 +637,7 @@ if ($id > 0 || $ref) {
|
||||
$currencycodetouse = $conf->currency;
|
||||
}
|
||||
print $form->selectMultiCurrency($currencycodetouse, "multicurrency_code", 1);
|
||||
print ' '.$langs->trans("CurrencyRate").' ';
|
||||
print ' '.$langs->trans("CurrencyRate").' ';
|
||||
print '<input class="flat" name="multicurrency_tx" size="4" value="'.vatrate(GETPOST('multicurrency_tx') ? GETPOST('multicurrency_tx') : (isset($object->fourn_multicurrency_tx) ? $object->fourn_multicurrency_tx : '')).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -106,7 +106,7 @@ if ($object->element == 'stock') {
|
||||
print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>';
|
||||
print '<td>';
|
||||
if ($object->element == 'product' || $object->element == 'stock') {
|
||||
print '<select name="mouvement" id="mouvement" class="minwidth100 valignmiddle">';
|
||||
print '<select name="mouvement" id="mouvement" class="minwidth125 valignmiddle">';
|
||||
print '<option value="0">'.$langs->trans("Add").'</option>';
|
||||
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
|
||||
print '</select>';
|
||||
@ -134,7 +134,7 @@ if (!empty($conf->productbatch->enabled) &&
|
||||
) {
|
||||
print '<tr>';
|
||||
print '<td'.($object->element == 'stock' ? '' : ' class="fieldrequired"').'>'.$langs->trans("batch_number").'</td><td colspan="3">';
|
||||
print '<input type="text" name="batch_number" size="40" value="'.GETPOST("batch_number").'">';
|
||||
print '<input type="text" name="batch_number" class="minwidth300" value="'.GETPOST("batch_number").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
@ -161,7 +161,7 @@ if (!empty($conf->project->enabled)) {
|
||||
print '<td>'.$langs->trans('Project').'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'project');
|
||||
$formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
|
||||
$formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300 widthcentpercentminusx');
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
@ -171,7 +171,7 @@ $valformovementlabel = ((GETPOST("label") && (GETPOST('label') != $langs->trans(
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("MovementLabel").'</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="label" class="minwidth300" value="'.$valformovementlabel.'">';
|
||||
print '<input type="text" name="label" class="minwidth400" value="'.dol_escape_htmltag($valformovementlabel).'">';
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("InventoryCode").'</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -75,7 +75,7 @@ if ($object->element == 'product') {
|
||||
print img_picto('', 'stock');
|
||||
$selected = (GETPOST("dwid") ?GETPOST("dwid", 'int') : (GETPOST('id_entrepot') ?GETPOST('id_entrepot', 'int') : ($object->element == 'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse : 'ifone')));
|
||||
$warehousestatus = 'warehouseopen,warehouseinternal';
|
||||
print $formproduct->selectWarehouses($selected, 'id_entrepot', $warehousestatus, 1);
|
||||
print $formproduct->selectWarehouses($selected, 'id_entrepot', $warehousestatus, 1, 0, 0, '', 0, 0, array(), 'minwidth75 maxwidth300 widthcentpercentminusx');
|
||||
print '</td>';
|
||||
}
|
||||
if ($object->element == 'stock') {
|
||||
@ -87,7 +87,7 @@ if ($object->element == 'stock') {
|
||||
}
|
||||
|
||||
print '<td class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td>';
|
||||
print img_picto('', 'stock').$formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1);
|
||||
print img_picto('', 'stock').$formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth75 maxwidth300 widthcentpercentminusx');
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td colspan="3"><input type="text" name="nbpiece" class="center maxwidth75" value="'.dol_escape_htmltag(GETPOST("nbpiece")).'"></td>';
|
||||
print '</tr>';
|
||||
@ -104,7 +104,7 @@ if (!empty($conf->productbatch->enabled) &&
|
||||
print '<input type="text" name="batch_number_bis" size="40" disabled="disabled" value="'.(GETPOST('batch_number') ?GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
print '<input type="hidden" name="batch_number" value="'.(GETPOST('batch_number') ?GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
} else {
|
||||
print '<input type="text" name="batch_number" size="40" value="'.(GETPOST('batch_number') ?GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
print '<input type="text" name="batch_number" class="minwidth300" value="'.(GETPOST('batch_number') ? GETPOST('batch_number') : $pdluo->batch).'">';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -128,7 +128,7 @@ $valformovementlabel = (GETPOST("label") ? GETPOST("label") : $langs->trans("Mov
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("MovementLabel").'</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="label" class="minwidth300" value="'.$valformovementlabel.'">';
|
||||
print '<input type="text" name="label" class="minwidth300" value="'.dol_escape_htmltag($valformovementlabel).'">';
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("InventoryCode").'</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -373,6 +373,7 @@ if ($ispaymentok) {
|
||||
}
|
||||
if (empty($user->rights->adherent)) {
|
||||
$user->rights->adherent = new stdClass();
|
||||
$user->rights->adherent->cotisation = new stdClass();
|
||||
}
|
||||
$user->rights->societe->creer = 1;
|
||||
$user->rights->facture->creer = 1;
|
||||
|
||||
@ -2741,8 +2741,12 @@ if (!GETPOST('hide_websitemenu')) {
|
||||
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
||||
|
||||
//print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'"'.($atleastonepage ? ' disabled="disabled"' : '').'>';
|
||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'">';
|
||||
// Delete website
|
||||
if ($website->status == $website::STATUS_VALIDATED) {
|
||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("WebsiteMustBeDisabled")).'">';
|
||||
} else {
|
||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'"'.($atleastonepage ? ' disabled="disabled"' : '').'>';
|
||||
}
|
||||
|
||||
// Regenerate all pages
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=regeneratesite&token='.newToken().'&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"><span class="far fa-hdd"></span></a>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user