Maxi debug v13

This commit is contained in:
Laurent Destailleur 2020-11-16 12:20:18 +01:00
parent 65144f4d5a
commit 6c42535eb2
25 changed files with 157 additions and 118 deletions

View File

@ -171,13 +171,14 @@ if (empty($reshook))
GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryday', 'int'),
GETPOST('date_deliveryyear', 'int') GETPOST('date_deliveryyear', 'int')
); );
if (!empty($object->date_livraison) && !empty($date_delivery)) $date_delivery_old = (empty($object->delivery_date) ? $object->date_livraison : $object->delivery_date);
if (!empty($date_delivery_old) && !empty($date_delivery))
{ {
//Attempt to get the date without possible hour rounding errors //Attempt to get the date without possible hour rounding errors
$old_date_delivery = dol_mktime(12, 0, 0, $old_date_delivery = dol_mktime(12, 0, 0,
dol_print_date($object->date_livraison, '%m'), dol_print_date($date_delivery_old, '%m'),
dol_print_date($object->date_livraison, '%d'), dol_print_date($date_delivery_old, '%d'),
dol_print_date($object->date_livraison, '%Y') dol_print_date($date_delivery_old, '%Y')
); );
//Calculate the difference and apply if necessary //Calculate the difference and apply if necessary
$difference = $date_delivery - $old_date_delivery; $difference = $date_delivery - $old_date_delivery;
@ -341,7 +342,9 @@ if (empty($reshook))
if ($object->fetch(GETPOST('copie_propal', 'int')) > 0) { if ($object->fetch(GETPOST('copie_propal', 'int')) > 0) {
$object->ref = GETPOST('ref'); $object->ref = GETPOST('ref');
$object->datep = $datep; $object->datep = $datep;
$object->date_livraison = $date_delivery; $object->date = $datep;
$object->date_livraison = $date_delivery; // deprecated
$object->delivery_date = $date_delivery;
$object->availability_id = GETPOST('availability_id'); $object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id'); $object->demand_reason_id = GETPOST('demand_reason_id');
$object->fk_delivery_address = GETPOST('fk_address', 'int'); $object->fk_delivery_address = GETPOST('fk_address', 'int');
@ -355,8 +358,9 @@ if (empty($reshook))
$object->socid = GETPOST('socid', 'int'); $object->socid = GETPOST('socid', 'int');
$object->contact_id = GETPOST('contactid', 'int'); $object->contact_id = GETPOST('contactid', 'int');
$object->fk_project = GETPOST('projectid', 'int'); $object->fk_project = GETPOST('projectid', 'int');
$object->model_pdf = GETPOST('model'); $object->model_pdf = GETPOST('model', 'alphanohtml');
$object->author = $user->id; // deprecated $object->author = $user->id; // deprecated
$object->user_author_id = $user->id;
$object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_private = GETPOST('note_private', 'restricthtml');
$object->note_public = GETPOST('note_public', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml');
$object->statut = Propal::STATUS_DRAFT; $object->statut = Propal::STATUS_DRAFT;
@ -372,7 +376,9 @@ if (empty($reshook))
$object->ref = GETPOST('ref'); $object->ref = GETPOST('ref');
$object->ref_client = GETPOST('ref_client'); $object->ref_client = GETPOST('ref_client');
$object->datep = $datep; $object->datep = $datep;
$object->date = $datep;
$object->date_livraison = $date_delivery; $object->date_livraison = $date_delivery;
$object->delivery_date = $date_delivery;
$object->availability_id = GETPOST('availability_id', 'int'); $object->availability_id = GETPOST('availability_id', 'int');
$object->demand_reason_id = GETPOST('demand_reason_id', 'int'); $object->demand_reason_id = GETPOST('demand_reason_id', 'int');
$object->fk_delivery_address = GETPOST('fk_address', 'int'); $object->fk_delivery_address = GETPOST('fk_address', 'int');
@ -1823,8 +1829,8 @@ if ($action == 'create')
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)')) array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)'))
); );
if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->date_livraison)) { if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->delivery_date)) {
$formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->date_livraison); $formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date);
} }
// Incomplete payment. We ask if reason = discount or other // Incomplete payment. We ask if reason = discount or other
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
@ -2048,9 +2054,9 @@ if ($action == 'create')
// Delivery date // Delivery date
$langs->load('deliveries'); $langs->load('deliveries');
print '<tr><td>'; print '<tr><td>';
print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $usercancreate, 'datepicker'); print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker');
print '</td><td>'; print '</td><td>';
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $usercancreate, 'datepicker'); print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -991,6 +991,9 @@ class Propal extends CommonObject
$this->multicurrency_tx = 1; $this->multicurrency_tx = 1;
} }
// Set tmp vars
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
dol_syslog(get_class($this)."::create"); dol_syslog(get_class($this)."::create");
// Check parameters // Check parameters
@ -1078,7 +1081,7 @@ class Propal extends CommonObject
$sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL'); $sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL');
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
$sql .= ", '".$this->db->escape($this->ref_client)."'"; $sql .= ", '".$this->db->escape($this->ref_client)."'";
$sql .= ", ".($this->date_livraison != '' ? "'".$this->db->idate($this->date_livraison)."'" : "NULL"); $sql .= ", ".(empty($delivery_date) ? "NULL" : "'".$this->db->idate($delivery_date)."'");
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL'); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
$sql .= ", ".$this->availability_id; $sql .= ", ".$this->availability_id;
$sql .= ", ".$this->demand_reason_id; $sql .= ", ".$this->demand_reason_id;
@ -1441,7 +1444,7 @@ class Propal extends CommonObject
$sql .= ", p.date_valid as datev"; $sql .= ", p.date_valid as datev";
$sql .= ", p.datep as dp"; $sql .= ", p.datep as dp";
$sql .= ", p.fin_validite as dfv"; $sql .= ", p.fin_validite as dfv";
$sql .= ", p.date_livraison as date_livraison"; $sql .= ", p.date_livraison as delivery_date";
$sql .= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams"; $sql .= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams";
$sql .= ", p.note_private, p.note_public"; $sql .= ", p.note_private, p.note_public";
$sql .= ", p.fk_projet as fk_project, p.fk_statut"; $sql .= ", p.fk_projet as fk_project, p.fk_statut";
@ -1523,8 +1526,8 @@ class Propal extends CommonObject
$this->date = $this->db->jdate($obj->dp); // Proposal date $this->date = $this->db->jdate($obj->dp); // Proposal date
$this->datep = $this->db->jdate($obj->dp); // deprecated $this->datep = $this->db->jdate($obj->dp); // deprecated
$this->fin_validite = $this->db->jdate($obj->dfv); $this->fin_validite = $this->db->jdate($obj->dfv);
$this->date_livraison = $this->db->jdate($obj->date_livraison); $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->date_livraison); $this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null; $this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
$this->availability_id = $obj->fk_availability; $this->availability_id = $obj->fk_availability;
$this->availability_code = $obj->availability_code; $this->availability_code = $obj->availability_code;
@ -2111,7 +2114,7 @@ class Propal extends CommonObject
{ {
$this->oldcopy = clone $this; $this->oldcopy = clone $this;
$this->date_livraison = $delivery_date; $this->date_livraison = $delivery_date;
$this->date_delivery = $delivery_date; $this->delivery_date = $delivery_date;
} }
if (!$notrigger && empty($error)) if (!$notrigger && empty($error))
@ -3574,16 +3577,24 @@ class Propal extends CommonObject
if (isset($this->statut)) { if (isset($this->statut)) {
$label .= ' '.$this->getLibStatut(5); $label .= ' '.$this->getLibStatut(5);
} }
if (!empty($this->ref)) if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_client)) }
if (!empty($this->ref_client)) {
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client; $label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
if (!empty($this->total_ht)) }
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_tva)) }
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_ttc)) }
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->delivery_date)) {
$label .= '<br><b>'.$langs->trans('DeliveryDate').':</b> '.dol_print_date($this->delivery_date, 'dayhour');
}
if ($option == '') { if ($option == '') {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params; $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id.$get_params;

View File

@ -120,6 +120,8 @@ if (!empty($conf->expedition->enabled) && !empty($conf->global->WAREHOUSE_ASK_WA
$error = 0; $error = 0;
$date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
/* /*
* Actions * Actions
@ -274,7 +276,7 @@ if (empty($reshook))
$object->fk_account = GETPOST('fk_account', 'int'); $object->fk_account = GETPOST('fk_account', 'int');
$object->availability_id = GETPOST('availability_id'); $object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id'); $object->demand_reason_id = GETPOST('demand_reason_id');
$object->date_livraison = $datelivraison; $object->date_livraison = $datelivraison; // deprecated
$object->delivery_date = $datelivraison; $object->delivery_date = $datelivraison;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->warehouse_id = GETPOST('warehouse_id', 'int'); $object->warehouse_id = GETPOST('warehouse_id', 'int');
@ -539,10 +541,10 @@ if (empty($reshook))
} }
} elseif ($action == 'setdate_livraison' && $usercancreate) { } elseif ($action == 'setdate_livraison' && $usercancreate) {
// print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$object->fetch($id); $object->fetch($id);
$result = $object->setDeliveryDate($user, $datedelivery); $result = $object->setDeliveryDate($user, $date_delivery);
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
@ -1507,7 +1509,8 @@ if ($action == 'create' && $usercancreate)
$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : ''; $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : '';
$datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : ''); $date_delivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : '');
if (empty($date_delivery)) $date_delivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : '');
if (!empty($conf->multicurrency->enabled)) if (!empty($conf->multicurrency->enabled))
{ {
@ -1620,8 +1623,7 @@ if ($action == 'create' && $usercancreate)
// Date delivery planned // Date delivery planned
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>'; print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
//print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. $date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery);
$date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';
@ -2138,12 +2140,12 @@ if ($action == 'create' && $usercancreate)
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">'; print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
print $object->date_livraison ? dol_print_date($object->date_livraison, 'dayhour') : '&nbsp;'; print $object->delivery_date ? dol_print_date($object->delivery_date, 'dayhour') : '&nbsp;';
if ($object->hasDelay() && !empty($object->date_livraison)) { if ($object->hasDelay() && !empty($object->delivery_date)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
} }
} }

View File

@ -886,8 +886,9 @@ class Commande extends CommonOrder
// Clean parameters // Clean parameters
$this->brouillon = 1; // set command as draft $this->brouillon = 1; // set command as draft
// $date_commande is deprecated // Set tmp vars
$date = ($this->date_commande ? $this->date_commande : $this->date); $date = ($this->date_commande ? $this->date_commande : $this->date);
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
@ -960,7 +961,7 @@ class Commande extends CommonOrder
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
$sql .= ", ".($this->availability_id > 0 ? $this->availability_id : "null"); $sql .= ", ".($this->availability_id > 0 ? $this->availability_id : "null");
$sql .= ", ".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null"); $sql .= ", ".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null");
$sql .= ", ".($this->date_livraison ? "'".$this->db->idate($this->date_livraison)."'" : "null"); $sql .= ", ".($this->$delivery_date ? "'".$this->db->idate($this->$delivery_date)."'" : "null");
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : 'NULL'); $sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : 'NULL');
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL'); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
$sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL'); $sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL');
@ -1359,7 +1360,7 @@ class Commande extends CommonOrder
$this->fk_account = $object->fk_account; $this->fk_account = $object->fk_account;
$this->availability_id = $object->availability_id; $this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id; $this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison; $this->date_livraison = $object->date_livraison; // deprecated
$this->delivery_date = $object->date_livraison; $this->delivery_date = $object->date_livraison;
$this->shipping_method_id = $object->shipping_method_id; $this->shipping_method_id = $object->shipping_method_id;
$this->warehouse_id = $object->warehouse_id; $this->warehouse_id = $object->warehouse_id;
@ -1784,7 +1785,7 @@ class Commande extends CommonOrder
$sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason'; $sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason';
$sql .= ', c.fk_account'; $sql .= ', c.fk_account';
$sql .= ', c.date_commande, c.date_valid, c.tms'; $sql .= ', c.date_commande, c.date_valid, c.tms';
$sql .= ', c.date_livraison'; $sql .= ', c.date_livraison as delivery_date';
$sql .= ', c.fk_shipping_method'; $sql .= ', c.fk_shipping_method';
$sql .= ', c.fk_warehouse'; $sql .= ', c.fk_warehouse';
$sql .= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed'; $sql .= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed';
@ -1870,8 +1871,8 @@ class Commande extends CommonOrder
$this->availability = $obj->availability_label; $this->availability = $obj->availability_label;
$this->demand_reason_id = $obj->fk_input_reason; $this->demand_reason_id = $obj->fk_input_reason;
$this->demand_reason_code = $obj->demand_reason_code; $this->demand_reason_code = $obj->demand_reason_code;
$this->date_livraison = $this->db->jdate($obj->date_livraison); $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->date_livraison); $this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null; $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->warehouse_id = ($obj->fk_warehouse > 0) ? $obj->fk_warehouse : null;
$this->fk_delivery_address = $obj->fk_delivery_address; $this->fk_delivery_address = $obj->fk_delivery_address;
@ -3660,6 +3661,9 @@ class Commande extends CommonOrder
if (!empty($this->total_ttc)) { if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
} }
if (!empty($this->delivery_date)) {
$label .= '<br><b>'.$langs->trans('DeliveryDate').':</b> '.dol_print_date($this->delivery_date, 'dayhour');
}
} }
$linkclose = ''; $linkclose = '';

View File

@ -931,7 +931,7 @@ if ($resql)
$generic_commande->statut = $obj->fk_statut; $generic_commande->statut = $obj->fk_statut;
$generic_commande->billed = $obj->billed; $generic_commande->billed = $obj->billed;
$generic_commande->date = $db->jdate($obj->date_commande); $generic_commande->date = $db->jdate($obj->date_commande);
$generic_commande->date_livraison = $db->jdate($obj->date_delivery); $generic_commande->date_livraison = $db->jdate($obj->date_delivery); // deprecated
$generic_commande->delivery_date = $db->jdate($obj->date_delivery); $generic_commande->delivery_date = $db->jdate($obj->date_delivery);
$generic_commande->ref_client = $obj->ref_client; $generic_commande->ref_client = $obj->ref_client;
$generic_commande->total_ht = $obj->total_ht; $generic_commande->total_ht = $obj->total_ht;

View File

@ -1338,8 +1338,8 @@ class Facture extends CommonInvoice
$this->mode_reglement_id = $object->mode_reglement_id; $this->mode_reglement_id = $object->mode_reglement_id;
$this->availability_id = $object->availability_id; $this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id; $this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison; $this->delivery_date = (empty($object->delivery_date) ? $object->date_livraison : $object->delivery_date);
$this->delivery_date = $object->date_livraison; $this->date_livraison = $object->delivery_date; // deprecated
$this->fk_delivery_address = $object->fk_delivery_address; // deprecated $this->fk_delivery_address = $object->fk_delivery_address; // deprecated
$this->contact_id = $object->contact_id; $this->contact_id = $object->contact_id;
$this->ref_client = $object->ref_client; $this->ref_client = $object->ref_client;

View File

@ -115,7 +115,6 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
$delivery_date = $this->db->jdate($objp->delivery_date); $delivery_date = $this->db->jdate($objp->delivery_date);
$datem = $this->db->jdate($objp->tms); $datem = $this->db->jdate($objp->tms);
$supplierorderstatic->date_livraison = $delivery_date;
$supplierorderstatic->delivery_date = $delivery_date; $supplierorderstatic->delivery_date = $delivery_date;
$supplierorderstatic->statut = $objp->fk_statut; $supplierorderstatic->statut = $objp->fk_statut;

View File

@ -741,7 +741,7 @@ class pdf_einstein extends ModelePDFCommandes
}*/ }*/
// Show planed date of delivery // Show planed date of delivery
if (!empty($object->date_livraison)) if (!empty($object->delivery_date))
{ {
$outputlangs->load("sendings"); $outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
@ -750,7 +750,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2); $pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L'); $pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1; $posy = $pdf->GetY() + 1;

View File

@ -958,7 +958,7 @@ class pdf_eratosthene extends ModelePDFCommandes
}*/ }*/
// Show planed date of delivery // Show planed date of delivery
if (!empty($object->date_livraison)) if (!empty($object->delivery_date))
{ {
$outputlangs->load("sendings"); $outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
@ -967,7 +967,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2); $pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L'); $pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1; $posy = $pdf->GetY() + 1;

View File

@ -139,7 +139,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder
return 0; return 0;
} }
$numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->date_livraison); $numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->delivery_date);
return $numFinal; return $numFinal;
} }

View File

@ -870,7 +870,7 @@ class pdf_azur extends ModelePDFPropales
$posxval = 52; $posxval = 52;
// Show shipping date // Show shipping date
if (!empty($object->date_livraison)) if (!empty($object->delivery_date))
{ {
$outputlangs->load("sendings"); $outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
@ -879,7 +879,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2); $pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L'); $pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1; $posy = $pdf->GetY() + 1;

View File

@ -1006,7 +1006,7 @@ class pdf_cyan extends ModelePDFPropales
$posxval = 52; $posxval = 52;
// Show shipping date // Show shipping date
if (!empty($object->date_livraison)) if (!empty($object->delivery_date))
{ {
$outputlangs->load("sendings"); $outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
@ -1015,7 +1015,7 @@ class pdf_cyan extends ModelePDFPropales
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2); $pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L'); $pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1; $posy = $pdf->GetY() + 1;

View File

@ -1276,11 +1276,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetTextColor(0, 0, 60); $pdf->SetTextColor(0, 0, 60);
$usehourmin = 'day'; $usehourmin = 'day';
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour'; if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour';
if (!empty($object->date_livraison)) if (!empty($object->delivery_date))
{ {
$posy += 4; $posy += 4;
$pdf->SetXY($posx - 90, $posy); $pdf->SetXY($posx - 90, $posy);
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison, $usehourmin, false, $outputlangs, true), '', 'R'); $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->delivery_date, $usehourmin, false, $outputlangs, true), '', 'R');
} }
if ($object->thirdparty->code_fournisseur) if ($object->thirdparty->code_fournisseur)

View File

@ -1190,11 +1190,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetTextColor(0, 0, 60); $pdf->SetTextColor(0, 0, 60);
$usehourmin = 'day'; $usehourmin = 'day';
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour'; if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour';
if (!empty($object->date_livraison)) if (!empty($object->delivery_date))
{ {
$posy += 4; $posy += 4;
$pdf->SetXY($posx - 90, $posy); $pdf->SetXY($posx - 90, $posy);
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_livraison, $usehourmin, false, $outputlangs, true), '', 'R'); $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->delivery_date, $usehourmin, false, $outputlangs, true), '', 'R');
} }
if ($object->thirdparty->code_fournisseur) if ($object->thirdparty->code_fournisseur)

View File

@ -724,7 +724,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$posxval = 52; $posxval = 52;
// Show shipping date // Show shipping date
if (!empty($object->date_livraison)) if (!empty($object->delivery_date))
{ {
$outputlangs->load("sendings"); $outputlangs->load("sendings");
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
@ -733,7 +733,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2); $pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
$dlp = dol_print_date($object->date_livraison, "daytext", false, $outputlangs, true); $dlp = dol_print_date($object->delivery_date, "daytext", false, $outputlangs, true);
$pdf->MultiCell(80, 4, $dlp, 0, 'L'); $pdf->MultiCell(80, 4, $dlp, 0, 'L');
$posy = $pdf->GetY() + 1; $posy = $pdf->GetY() + 1;
@ -745,7 +745,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->SetFont('', '', $default_font_size - 2); $pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posxval, $posy); $pdf->SetXY($posxval, $posy);
//$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true); //$dlp=dol_print_date($object->delivery_date,"daytext",false,$outputlangs,true);
$pdf->MultiCell(80, 4, '', 0, 'L'); $pdf->MultiCell(80, 4, '', 0, 'L');
$posy = $pdf->GetY() + 1; $posy = $pdf->GetY() + 1;
@ -1325,7 +1325,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$posy+=4; $posy+=4;
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->date_livraison, "day", false, $outputlangs, true), '', 'R'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->delivery_date, "day", false, $outputlangs, true), '', 'R');
*/ */
if ($object->thirdparty->code_fournisseur) if ($object->thirdparty->code_fournisseur)

View File

@ -105,6 +105,8 @@ $hookmanager->initHooks(array('expeditioncard', 'globalcard'));
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php $permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
//var_dump($object->lines[0]->detail_batch); //var_dump($object->lines[0]->detail_batch);
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
/* /*
* Actions * Actions
@ -201,8 +203,6 @@ if (empty($reshook))
$object->size_units = GETPOST('size_units', 'int'); $object->size_units = GETPOST('size_units', 'int');
$object->weight_units = GETPOST('weight_units', 'int'); $object->weight_units = GETPOST('weight_units', 'int');
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
// We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver // We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver
$classname = ucfirst($object->origin); $classname = ucfirst($object->origin);
$objectsrc = new $classname($db); $objectsrc = new $classname($db);
@ -936,8 +936,7 @@ if ($action == 'create')
// Date delivery planned // Date delivery planned
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>'; print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
//print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST
$date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';

View File

@ -212,7 +212,7 @@ llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
$sql = 'SELECT'; $sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,"; $sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, l.date_delivery as date_reception, e.fk_statut, e.billed, e.tracking_number,";
$sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, "; $sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
$sql .= " typent.code as typent_code,"; $sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -618,6 +618,7 @@ if ($resql)
$object = new Expedition($db); $object = new Expedition($db);
$object->fetch($obj->rowid); $object->fetch($obj->rowid);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
@ -705,7 +706,7 @@ if ($resql)
if (!empty($arrayfields['e.date_delivery']['checked'])) if (!empty($arrayfields['e.date_delivery']['checked']))
{ {
print '<td class="center">'; print '<td class="center">';
print dol_print_date($db->jdate($obj->date_livraison), "dayhour"); print dol_print_date($db->jdate($obj->delivery_date), "dayhour");
/*$now = time(); /*$now = time();
if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 ) if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 )
{ {

View File

@ -354,7 +354,7 @@ if ($id > 0 || !empty($ref))
print '<tr><td>'.$langs->trans('Date').'</td>'; print '<tr><td>'.$langs->trans('Date').'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
print dol_print_date($object->date, 'day'); print dol_print_date($object->date, 'day');
if ($object->hasDelay() && empty($object->date_livraison)) { if ($object->hasDelay() && empty($object->delivery_date)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
} }
print '</td>'; print '</td>';
@ -374,12 +374,12 @@ if ($id > 0 || !empty($ref))
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">'; print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdatedelivery">'; print '<input type="hidden" name="action" value="setdatedelivery">';
print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
print dol_print_date($object->date_livraison, 'dayhour'); print dol_print_date($object->delivery_date, 'dayhour');
if ($object->hasDelay() && !empty($object->date_livraison)) { if ($object->hasDelay() && !empty($object->delivery_date)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
} }
} }

View File

@ -375,7 +375,7 @@ class CommandeFournisseur extends CommonOrder
$this->date_approve = $this->db->jdate($obj->date_approve); $this->date_approve = $this->db->jdate($obj->date_approve);
$this->date_approve2 = $this->db->jdate($obj->date_approve2); $this->date_approve2 = $this->db->jdate($obj->date_approve2);
$this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier $this->date_commande = $this->db->jdate($obj->date_commande); // date we make the order to supplier
$this->date_livraison = $this->db->jdate($obj->delivery_date); $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->delivery_date); $this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->remise_percent = $obj->remise_percent; $this->remise_percent = $obj->remise_percent;
$this->methode_commande_id = $obj->fk_input_method; $this->methode_commande_id = $obj->fk_input_method;
@ -778,16 +778,24 @@ class CommandeFournisseur extends CommonOrder
if (isset($this->statut)) { if (isset($this->statut)) {
$label .= ' '.$this->getLibStatut(5); $label .= ' '.$this->getLibStatut(5);
} }
if (!empty($this->ref)) if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_supplier)) }
if (!empty($this->ref_supplier)) {
$label .= '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier; $label .= '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
if (!empty($this->total_ht)) }
if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_tva)) }
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (!empty($this->total_ttc)) }
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->delivery_date)) {
$label .= '<br><b>'.$langs->trans('DeliveryDate').':</b> '.dol_print_date($this->delivery_date, 'dayhour');
}
} }
$picto = 'order'; $picto = 'order';
@ -1257,9 +1265,10 @@ class CommandeFournisseur extends CommonOrder
$error = 0; $error = 0;
$now = dol_now(); $now = dol_now();
// $date_commande is deprecated // set tmp vars
$date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set $date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set
if (empty($date)) $date = $now; if (empty($date)) $date = $now;
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
// Clean parameters // Clean parameters
if (empty($this->source)) $this->source = 0; if (empty($this->source)) $this->source = 0;
@ -1308,7 +1317,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= ", ".$this->socid; $sql .= ", ".$this->socid;
$sql .= ", ".($this->fk_project > 0 ? $this->fk_project : "null"); $sql .= ", ".($this->fk_project > 0 ? $this->fk_project : "null");
$sql .= ", '".$this->db->idate($date)."'"; $sql .= ", '".$this->db->idate($date)."'";
$sql .= ", ".($this->date_livraison ? "'".$this->db->idate($this->date_livraison)."'" : "null"); $sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null");
$sql .= ", ".$user->id; $sql .= ", ".$user->id;
$sql .= ", ".self::STATUS_DRAFT; $sql .= ", ".self::STATUS_DRAFT;
$sql .= ", ".$this->db->escape($this->source); $sql .= ", ".$this->db->escape($this->source);
@ -2925,7 +2934,7 @@ class CommandeFournisseur extends CommonOrder
{ {
$response->nbtodo++; $response->nbtodo++;
$commandestatic->date_livraison = $this->db->jdate($obj->delivery_date); $commandestatic->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$commandestatic->delivery_date = $this->db->jdate($obj->delivery_date); $commandestatic->delivery_date = $this->db->jdate($obj->delivery_date);
$commandestatic->date_commande = $this->db->jdate($obj->date_commande); $commandestatic->date_commande = $this->db->jdate($obj->date_commande);
$commandestatic->statut = $obj->fk_statut; $commandestatic->statut = $obj->fk_statut;
@ -3079,10 +3088,10 @@ class CommandeFournisseur extends CommonOrder
{ {
global $conf; global $conf;
if (empty($this->date_delivery) && !empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility if (empty($this->delivery_date) && !empty($this->date_livraison)) $this->delivery_date = $this->date_livraison; // For backward compatibility
$now = dol_now(); $now = dol_now();
$date_to_test = empty($this->date_delivery) ? $this->date_commande : $this->date_delivery; $date_to_test = empty($this->delivery_date) ? $this->date_commande : $this->delivery_date;
return ($this->statut > 0 && $this->statut < 5) && $date_to_test && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay); return ($this->statut > 0 && $this->statut < 5) && $date_to_test && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay);
} }
@ -3096,9 +3105,9 @@ class CommandeFournisseur extends CommonOrder
{ {
global $conf, $langs; global $conf, $langs;
if (empty($this->date_delivery) && !empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility if (empty($this->delivery_date) && !empty($this->date_livraison)) $this->delivery_date = $this->date_livraison; // For backward compatibility
if (empty($this->date_delivery)) $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); if (empty($this->delivery_date)) $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day');
else $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->date_delivery, 'day'); else $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->date_delivery, 'day');
$text .= ' '.($conf->commande->fournisseur->warning_delay > 0 ? '+' : '-').' '.round(abs($conf->commande->fournisseur->warning_delay) / 3600 / 24, 1).' '.$langs->trans("days").' < '.$langs->trans("Today"); $text .= ' '.($conf->commande->fournisseur->warning_delay > 0 ? '+' : '-').' '.round(abs($conf->commande->fournisseur->warning_delay) / 3600 / 24, 1).' '.$langs->trans("days").' < '.$langs->trans("Today");

View File

@ -1145,7 +1145,7 @@ if (empty($reshook))
$object->fk_account = GETPOST('fk_account', 'int'); $object->fk_account = GETPOST('fk_account', 'int');
$object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_private = GETPOST('note_private', 'restricthtml');
$object->note_public = GETPOST('note_public', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml');
$object->date_livraison = $datelivraison; $object->date_livraison = $datelivraison; // deprecated
$object->delivery_date = $datelivraison; $object->delivery_date = $datelivraison;
$object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha');
@ -1200,7 +1200,8 @@ if (empty($reshook))
$result = $srcobject->fetch($object->origin_id); $result = $srcobject->fetch($object->origin_id);
if ($result > 0) if ($result > 0)
{ {
$object->setDeliveryDate($user, $srcobject->date_livraison); $tmpdate = ($srcobject->delivery_date ? $srcobject->delivery_date : $srcobject->date_livraison);
$object->setDeliveryDate($user, $tmpdate);
$object->set_id_projet($user, $srcobject->fk_project); $object->set_id_projet($user, $srcobject->fk_project);
$lines = $srcobject->lines; $lines = $srcobject->lines;
@ -1552,7 +1553,7 @@ if ($action == 'create')
$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : ''; $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '';
$datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : ''); $datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''));
if (!empty($conf->multicurrency->enabled)) if (!empty($conf->multicurrency->enabled))
{ {
@ -2161,14 +2162,14 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="setdate_livraison">'; print '<input type="hidden" name="action" value="setdate_livraison">';
$usehourmin = 0; $usehourmin = 0;
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 1; if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 1;
print $form->selectDate($object->date_livraison ? $object->date_livraison : -1, 'liv_', $usehourmin, $usehourmin, '', "setdate_livraison"); print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', $usehourmin, $usehourmin, '', "setdate_livraison");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
$usehourmin = 'day'; $usehourmin = 'day';
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour'; if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin = 'dayhour';
print $object->date_livraison ? dol_print_date($object->date_livraison, $usehourmin) : '&nbsp;'; print $object->delivery_date ? dol_print_date($object->delivery_date, $usehourmin) : '&nbsp;';
if ($object->hasDelay() && !empty($object->date_livraison)) { if ($object->hasDelay() && !empty($object->delivery_date)) {
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
} }
} }

View File

@ -2068,8 +2068,8 @@ function migrate_commande_livraison($db, $langs, $conf)
$db->begin(); $db->begin();
$sql = "SELECT l.rowid, l.fk_commande"; $sql = "SELECT l.rowid, l.fk_commande,";
$sql .= ", c.ref_client, c.date_livraison"; $sql .= " c.ref_client, c.date_livraison as delivery_date";
$sql .= " FROM ".MAIN_DB_PREFIX."livraison as l, ".MAIN_DB_PREFIX."commande as c"; $sql .= " FROM ".MAIN_DB_PREFIX."livraison as l, ".MAIN_DB_PREFIX."commande as c";
$sql .= " WHERE c.rowid = l.fk_commande"; $sql .= " WHERE c.rowid = l.fk_commande";
$resql = $db->query($sql); $resql = $db->query($sql);
@ -2090,7 +2090,7 @@ function migrate_commande_livraison($db, $langs, $conf)
if ($resql2) if ($resql2)
{ {
$delivery_date = $db->jdate($obj->date_livraison); $delivery_date = $db->jdate($obj->delivery_date);
$sqlu = "UPDATE ".MAIN_DB_PREFIX."livraison SET"; $sqlu = "UPDATE ".MAIN_DB_PREFIX."livraison SET";
$sqlu .= " ref_client='".$db->escape($obj->ref_client)."'"; $sqlu .= " ref_client='".$db->escape($obj->ref_client)."'";
@ -3007,7 +3007,7 @@ function migrate_customerorder_shipping($db, $langs, $conf)
if ($db->query($sqlAdd1) && $db->query($sqlAdd2)) if ($db->query($sqlAdd1) && $db->query($sqlAdd2))
{ {
$sqlSelect = "SELECT e.rowid as shipping_id, c.ref_client, c.date_livraison"; $sqlSelect = "SELECT e.rowid as shipping_id, c.ref_client, c.date_livraison as delivery_date";
$sqlSelect .= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sqlSelect .= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sqlSelect .= ", ".MAIN_DB_PREFIX."element_element as el"; $sqlSelect .= ", ".MAIN_DB_PREFIX."element_element as el";
$sqlSelect .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON c.rowid = el.fk_source AND el.sourcetype = 'commande'"; $sqlSelect .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON c.rowid = el.fk_source AND el.sourcetype = 'commande'";
@ -3028,7 +3028,7 @@ function migrate_customerorder_shipping($db, $langs, $conf)
$sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."expedition SET"; $sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."expedition SET";
$sqlUpdate .= " ref_customer = '".$db->escape($obj->ref_client)."'"; $sqlUpdate .= " ref_customer = '".$db->escape($obj->ref_client)."'";
$sqlUpdate .= ", date_delivery = '".$db->escape($obj->date_livraison ? $obj->date_livraison : 'null')."'"; $sqlUpdate .= ", date_delivery = '".$db->escape($obj->delivery_date ? $obj->delivery_date : 'null')."'";
$sqlUpdate .= " WHERE rowid = ".$obj->shipping_id; $sqlUpdate .= " WHERE rowid = ".$obj->shipping_id;
$result = $db->query($sqlUpdate); $result = $db->query($sqlUpdate);

View File

@ -111,6 +111,8 @@ $hookmanager->initHooks(array('receptioncard', 'globalcard'));
$permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php $permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php
//var_dump($object->lines[0]->detail_batch); //var_dump($object->lines[0]->detail_batch);
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
/* /*
* Actions * Actions
@ -226,8 +228,6 @@ if (empty($reshook))
$object->size_units = GETPOST('size_units', 'int'); $object->size_units = GETPOST('size_units', 'int');
$object->weight_units = GETPOST('weight_units', 'int'); $object->weight_units = GETPOST('weight_units', 'int');
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
// On va boucler sur chaque ligne du document d'origine pour completer objet reception // On va boucler sur chaque ligne du document d'origine pour completer objet reception
// avec info diverses + qte a livrer // avec info diverses + qte a livrer
@ -777,8 +777,7 @@ if ($action == 'create')
// Date delivery planned // Date delivery planned
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>'; print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
//print dol_print_date($object->date_livraison,"day"); // date_livraison come from order and will be stored into date_delivery planed. $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST
$date_delivery = ($date_delivery ? $date_delivery : $object->date_livraison); // $date_delivery comes from GETPOST
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';

View File

@ -409,7 +409,7 @@ $formfile = new FormFile($db);
$helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:M&oacute;dulo_Receptiones'; $helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:M&oacute;dulo_Receptiones';
llxHeader('', $langs->trans('ListOfReceptions'), $helpurl); llxHeader('', $langs->trans('ListOfReceptions'), $helpurl);
$sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut, e.billed,"; $sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as delivery_date, l.date_delivery as date_reception2, e.fk_statut, e.billed,";
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, '; $sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
$sql .= " typent.code as typent_code,"; $sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " state.code_departement as state_code, state.nom as state_name,";
@ -499,21 +499,21 @@ if ($resql)
$arrayofselected = is_array($toselect) ? $toselect : array(); $arrayofselected = is_array($toselect) ? $toselect : array();
$param = ''; $param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($sall) $param .= "&amp;sall=".$sall; if ($sall) $param .= "&amp;sall=".urlencode($sall);
if ($search_ref_rcp) $param .= "&amp;search_ref_rcp=".$search_ref_rcp; if ($search_ref_rcp) $param .= "&amp;search_ref_rcp=".urlencode($search_ref_rcp);
if ($search_ref_liv) $param .= "&amp;search_ref_liv=".$search_ref_liv; if ($search_ref_liv) $param .= "&amp;search_ref_liv=".urlencode($search_ref_liv);
if ($search_company) $param .= "&amp;search_company=".$search_company; if ($search_company) $param .= "&amp;search_company=".urlencode($search_company);
if ($optioncss != '') $param .= '&amp;optioncss='.$optioncss; if ($optioncss != '') $param .= '&amp;optioncss='.urlencode($optioncss);
if ($search_billed != '' && $search_billed >= 0)$param .= "&amp;search_billed=".$search_billed; if ($search_billed != '' && $search_billed >= 0) $param .= "&amp;search_billed=".urlencode($search_billed);
if ($search_town) $param .= "&amp;search_town=".$search_town; if ($search_town) $param .= "&amp;search_town=".urlencode($search_town);
if ($search_zip) $param .= "&amp;search_zip=".$search_zip; if ($search_zip) $param .= "&amp;search_zip=".urlencode($search_zip);
if ($search_state) $param .= "&amp;search_state=".$search_state; if ($search_state) $param .= "&amp;search_state=".urlencode($search_state);
if ($search_status) $param .= "&amp;search_status=".$search_status; if ($search_status) $param .= "&amp;search_status=".urlencode($search_status);
if ($search_country) $param .= "&amp;search_country=".$search_country; if ($search_country) $param .= "&amp;search_country=".urlencode($search_country);
if ($search_type_thirdparty) $param .= "&amp;search_type_thirdparty=".$search_type_thirdparty; if ($search_type_thirdparty) $param .= "&amp;search_type_thirdparty=".urlencode($search_type_thirdparty);
if ($search_ref_supplier) $param .= "&amp;search_ref_supplier=".$search_ref_supplier; if ($search_ref_supplier) $param .= "&amp;search_ref_supplier=".urlencode($search_ref_supplier);
// Add $param from extra fields // Add $param from extra fields
foreach ($search_array_options as $key => $val) foreach ($search_array_options as $key => $val)
{ {
@ -838,7 +838,7 @@ if ($resql)
if (!empty($arrayfields['e.date_delivery']['checked'])) if (!empty($arrayfields['e.date_delivery']['checked']))
{ {
print '<td class="center">'; print '<td class="center">';
print dol_print_date($db->jdate($obj->date_livraison), "day"); print dol_print_date($db->jdate($obj->delivery_date), "day");
/*$now = time(); /*$now = time();
if ( ($now - $db->jdate($obj->date_reception)) > $conf->warnings->lim && $obj->statutid == 1 ) if ( ($now - $db->jdate($obj->date_reception)) > $conf->warnings->lim && $obj->statutid == 1 )
{ {

View File

@ -257,7 +257,7 @@ if (empty($reshook))
{ {
if ($object->fetch(GETPOST('copie_supplier_proposal')) > 0) { if ($object->fetch(GETPOST('copie_supplier_proposal')) > 0) {
$object->ref = GETPOST('ref'); $object->ref = GETPOST('ref');
$object->date_livraison = $date_delivery; $object->date_livraison = $date_delivery; // deprecated
$object->delivery_date = $date_delivery; $object->delivery_date = $date_delivery;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->cond_reglement_id = GETPOST('cond_reglement_id'); $object->cond_reglement_id = GETPOST('cond_reglement_id');
@ -1565,11 +1565,11 @@ if ($action == 'create')
print '<form name="editdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" class="formconsumeproduce">'; print '<form name="editdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" class="formconsumeproduce">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">'; print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison"); print $form->selectDate($object->delivery_date, 'liv_', '', '', '', "editdate_livraison");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>'; print '</form>';
} else { } else {
print dol_print_date($object->date_livraison, 'daytext'); print dol_print_date($object->delivery_date, 'daytext');
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -109,6 +109,12 @@ class SupplierProposal extends CommonObject
*/ */
public $date; public $date;
/**
* @var integer|string date_livraison
* @deprecated
*/
public $date_livraison;
/** /**
* @var integer|string date_livraison * @var integer|string date_livraison
*/ */
@ -855,8 +861,6 @@ class SupplierProposal extends CommonObject
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
return -3; return -3;
} }
// Check parameters
if (!empty($this->ref)) // We check that ref is not already used if (!empty($this->ref)) // We check that ref is not already used
{ {
$result = self::isExistingObject($this->element, 0, $this->ref); // Check ref is not yet used $result = self::isExistingObject($this->element, 0, $this->ref); // Check ref is not yet used
@ -869,6 +873,9 @@ class SupplierProposal extends CommonObject
} }
} }
// Set tmp vars
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
// Multicurrency // Multicurrency
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now); if (!empty($this->multicurrency_code)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))
@ -923,7 +930,7 @@ class SupplierProposal extends CommonObject
$sql .= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'NULL'); $sql .= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'NULL');
$sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL'); $sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL');
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
$sql .= ", ".($this->date_livraison != '' ? "'".$this->db->idate($this->date_livraison)."'" : "null"); $sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null");
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL'); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
$sql .= ", ".($this->fk_project ? $this->fk_project : "null"); $sql .= ", ".($this->fk_project ? $this->fk_project : "null");
$sql .= ", ".$conf->entity; $sql .= ", ".$conf->entity;
@ -1256,7 +1263,7 @@ class SupplierProposal extends CommonObject
$this->datev = $this->db->jdate($obj->datev); // TODO deprecated $this->datev = $this->db->jdate($obj->datev); // TODO deprecated
$this->date_creation = $this->db->jdate($obj->datec); //Creation date $this->date_creation = $this->db->jdate($obj->datec); //Creation date
$this->date_validation = $this->db->jdate($obj->datev); //Validation date $this->date_validation = $this->db->jdate($obj->datev); //Validation date
$this->date_livraison = $this->db->jdate($obj->delivery_date); $this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->delivery_date); $this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null; $this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
@ -1538,6 +1545,7 @@ class SupplierProposal extends CommonObject
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$this->date_livraison = $delivery_date; $this->date_livraison = $delivery_date;
$this->delivery_date = $delivery_date;
return 1; return 1;
} else { } else {
$this->error = $this->db->error(); $this->error = $this->db->error();