New: The comment of the stock movement when making a supplier order
receiving is also stored into the tracking dispatch table (not only into stock movement table).
This commit is contained in:
parent
b9d2de99e1
commit
fb3cf4da1e
@ -1296,6 +1296,9 @@ class CommandeFournisseur extends CommonOrder
|
||||
return -1;
|
||||
}
|
||||
|
||||
$dispatchstatus = 1;
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) $dispatchstatus = 0; // Setting status will be done manually to 1 if this option is on
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
if (($this->statut == 3 || $this->statut == 4 || $this->statut == 5))
|
||||
@ -1303,8 +1306,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur_dispatch";
|
||||
$sql.= " (fk_commande, fk_product, qty, fk_entrepot, fk_user, datec) VALUES ";
|
||||
$sql.= " ('".$this->id."','".$product."','".$qty."',".($entrepot>0?"'".$entrepot."'":"null").",'".$user->id."','".$this->db->idate($now)."')";
|
||||
$sql.= " (fk_commande, fk_product, qty, fk_entrepot, fk_user, datec, status, comment) VALUES";
|
||||
$sql.= " ('".$this->id."','".$product."','".$qty."',".($entrepot>0?"'".$entrepot."'":"null").",'".$user->id."','".$this->db->idate($now)."', ".$dispatchstatus.", '".$this->db->escape($comment)."')";
|
||||
|
||||
dol_syslog(get_class($this)."::DispatchProduct", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -449,7 +449,7 @@ if ($id > 0 || ! empty($ref))
|
||||
// List of already dispatching
|
||||
$sql = "SELECT p.ref, p.label,";
|
||||
$sql.= " e.rowid as warehouse_id, e.label as entrepot,";
|
||||
$sql.= " cfd.fk_product, cfd.qty, cfd.rowid";
|
||||
$sql.= " cfd.rowid, cfd.fk_product, cfd.qty, cfd.comment, cfd.status";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e ON cfd.fk_entrepot = e.rowid";
|
||||
@ -474,7 +474,10 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="right">'.$langs->trans("QtyDispatched").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td></td>';
|
||||
print '<td>'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td>'.$langs->trans("Comment").'</td>';
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) print '<td align="right">'.$langs->trans("Status").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
@ -488,12 +491,28 @@ if ($id > 0 || ! empty($ref))
|
||||
print ' - '.$objp->label;
|
||||
print "</td>\n";
|
||||
|
||||
// Qty
|
||||
print '<td align="right">'.$objp->qty.'</td>';
|
||||
print '<td align="right">';
|
||||
print '<td> </td>';
|
||||
|
||||
// Warehouse
|
||||
print '<td>';
|
||||
$warehouse_static->id=$objp->warehouse_id;
|
||||
$warehouse_static->libelle=$objp->entrepot;
|
||||
print $warehouse_static->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
// Comment
|
||||
print '<td>'.dol_trunc($objp->comment).'</td>';
|
||||
|
||||
// Status
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS))
|
||||
{
|
||||
print '<td>';
|
||||
print $objp->status;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
@ -516,6 +535,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -101,3 +101,10 @@ create table llx_contratdet_extrafields
|
||||
ALTER TABLE llx_contratdet_extrafields ADD INDEX idx_contratdet_extrafields (fk_object);
|
||||
|
||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN delivery_time_days integer;
|
||||
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN comment varchar(255);
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN status integer;
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN tms timestamp;
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ create table llx_commande_fournisseur_dispatch
|
||||
qty float, -- qty
|
||||
fk_entrepot integer,
|
||||
fk_user integer,
|
||||
comment varchar(255),
|
||||
comment varchar(255), -- comment on movement
|
||||
status integer,
|
||||
datec datetime,
|
||||
tms timestamp
|
||||
|
||||
@ -28,7 +28,7 @@ create table llx_stock_mouvement
|
||||
price float(13,4) DEFAULT 0,
|
||||
type_mouvement smallint,
|
||||
fk_user_author integer,
|
||||
label varchar(255),
|
||||
label varchar(255), -- comment on movement
|
||||
inventorycode varchar(128),
|
||||
fk_origin integer,
|
||||
origintype varchar(32)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user