20210109
This commit is contained in:
parent
456c9d985a
commit
5effd4e897
@ -128,6 +128,10 @@ $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc
|
||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||
$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php
|
||||
|
||||
if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL) && ($action == 'create' || $action == 'edit')) {
|
||||
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
|
||||
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse;
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -238,6 +242,7 @@ if (empty($reshook))
|
||||
} // Validation
|
||||
elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate)
|
||||
{
|
||||
$idwarehouse = GETPOST('idwarehouse');
|
||||
$result = $object->valid($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
@ -340,6 +345,7 @@ if (empty($reshook))
|
||||
$object->demand_reason_id = GETPOST('demand_reason_id');
|
||||
$object->fk_delivery_address = GETPOST('fk_address', 'int');
|
||||
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
|
||||
$object->warehouse_id = GETPOST('warehouse_id', 'int');
|
||||
$object->duree_validite = $duration;
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
@ -371,6 +377,7 @@ if (empty($reshook))
|
||||
$object->demand_reason_id = GETPOST('demand_reason_id');
|
||||
$object->fk_delivery_address = GETPOST('fk_address');
|
||||
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
|
||||
$object->Warehouse_id = GETPOST('warehouse_id', 'int');
|
||||
$object->duree_validite = GETPOST('duree_validite');
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
@ -1295,6 +1302,9 @@ if (empty($reshook))
|
||||
} // shipping method
|
||||
elseif ($action == 'setshippingmethod' && $usercancreate) {
|
||||
$result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
|
||||
}// warehouse
|
||||
elseif ($action == 'setwarehouse' && $usercancreate) {
|
||||
$result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
|
||||
} elseif ($action == 'update_extras') {
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
@ -1489,6 +1499,7 @@ if ($action == 'create')
|
||||
if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($soc->shipping_method_id)) {
|
||||
$shipping_method_id = $soc->shipping_method_id;
|
||||
}
|
||||
//$warehouse_id = $soc->warehouse_id;
|
||||
} else {
|
||||
print '<td>';
|
||||
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
@ -1571,6 +1582,15 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
|
||||
print $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Delivery date (or manufacturing)
|
||||
print '<tr><td>'.$langs->trans("DeliveryDate").'</td>';
|
||||
print '<td>';
|
||||
@ -2068,6 +2088,24 @@ if ($action == 'create')
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
|
||||
$langs->load('stocks');
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
$formproduct = new FormProduct($db);
|
||||
print '<tr><td>';
|
||||
$editenable = $usercancreate;
|
||||
print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable);
|
||||
print '</td><td>';
|
||||
if ($action == 'editwarehouse') {
|
||||
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
|
||||
} else {
|
||||
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Origin of demand
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
|
||||
@ -288,6 +288,7 @@ class Propal extends CommonObject
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'PDFTemplate', 'enabled'=>1, 'visible'=>0, 'position'=>180),
|
||||
'date_livraison' =>array('type'=>'date', 'label'=>'DateDeliveryPlanned', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
||||
'fk_shipping_method' =>array('type'=>'integer', 'label'=>'ShippingMethod', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
|
||||
'fk_warehouse' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Fk warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>191),
|
||||
'fk_availability' =>array('type'=>'integer', 'label'=>'Availability', 'enabled'=>1, 'visible'=>-1, 'position'=>195),
|
||||
'fk_delivery_address' =>array('type'=>'integer', 'label'=>'DeliveryAddress', 'enabled'=>1, 'visible'=>0, 'position'=>200), // deprecated
|
||||
'fk_input_reason' =>array('type'=>'integer', 'label'=>'InputReason', 'enabled'=>1, 'visible'=>-1, 'position'=>205),
|
||||
@ -1038,6 +1039,7 @@ class Propal extends CommonObject
|
||||
$sql .= ", ref_client";
|
||||
$sql .= ", date_livraison";
|
||||
$sql .= ", fk_shipping_method";
|
||||
$sql .= ", fk_warehouse";
|
||||
$sql .= ", fk_availability";
|
||||
$sql .= ", fk_input_reason";
|
||||
$sql .= ", fk_projet";
|
||||
@ -1070,6 +1072,7 @@ class Propal extends CommonObject
|
||||
$sql .= ", '".$this->db->escape($this->ref_client)."'";
|
||||
$sql .= ", ".($this->date_livraison != '' ? "'".$this->db->idate($this->date_livraison)."'" : "NULL");
|
||||
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
|
||||
$sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL');
|
||||
$sql .= ", ".$this->availability_id;
|
||||
$sql .= ", ".$this->demand_reason_id;
|
||||
$sql .= ", ".($this->fk_project ? $this->fk_project : "null");
|
||||
@ -1441,6 +1444,7 @@ class Propal extends CommonObject
|
||||
$sql .= ", p.fk_mode_reglement";
|
||||
$sql .= ', p.fk_account';
|
||||
$sql .= ", p.fk_shipping_method";
|
||||
$sql .= ", p.fk_warehouse";
|
||||
$sql .= ", p.fk_incoterms, p.location_incoterms";
|
||||
$sql .= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc";
|
||||
$sql .= ", p.tms as date_modification";
|
||||
@ -1510,6 +1514,7 @@ class Propal extends CommonObject
|
||||
$this->fin_validite = $this->db->jdate($obj->dfv);
|
||||
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
||||
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
|
||||
$this->warehouse_id = ($obj->fk_warehouse > 0) ? $obj->fk_warehouse : null;
|
||||
$this->availability_id = $obj->fk_availability;
|
||||
$this->availability_code = $obj->availability_code;
|
||||
$this->availability = $obj->availability;
|
||||
|
||||
@ -113,7 +113,7 @@ $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc
|
||||
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
|
||||
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
|
||||
if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
|
||||
if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER) && ($action == 'create' || $action == 'edit')) {
|
||||
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
|
||||
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse;
|
||||
}
|
||||
|
||||
0
htdocs/install/mysql/migration/13.0.0-14.0.0.sql
Normal file
0
htdocs/install/mysql/migration/13.0.0-14.0.0.sql
Normal file
Loading…
Reference in New Issue
Block a user