Translation
This commit is contained in:
parent
370f6b907e
commit
b9d2de99e1
@ -1302,8 +1302,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur_dispatch ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur_dispatch";
|
||||||
$sql.= " (fk_commande,fk_product, qty, fk_entrepot, fk_user, datec) VALUES ";
|
$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.= " ('".$this->id."','".$product."','".$qty."',".($entrepot>0?"'".$entrepot."'":"null").",'".$user->id."','".$this->db->idate($now)."')";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::DispatchProduct", LOG_DEBUG);
|
dol_syslog(get_class($this)."::DispatchProduct", LOG_DEBUG);
|
||||||
|
|||||||
@ -96,7 +96,9 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
|
|||||||
setEventMessage($langs->trans('ErrorFieldRequired',$text), 'errors');
|
setEventMessage($langs->trans('ErrorFieldRequired',$text), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
|
}
|
||||||
|
else if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg))
|
||||||
|
{
|
||||||
//eat-by date dispatch
|
//eat-by date dispatch
|
||||||
$prod = "product_".$reg[1]."_".$reg[2];
|
$prod = "product_".$reg[1]."_".$reg[2];
|
||||||
$qty = "qty_".$reg[1]."_".$reg[2];
|
$qty = "qty_".$reg[1]."_".$reg[2];
|
||||||
@ -166,10 +168,12 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!empty($conf->productbatch->enabled)) {
|
if (!empty($conf->productbatch->enabled))
|
||||||
|
{
|
||||||
llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur",'',0,0,array('/core/js/lib_batch.js'));
|
llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur",'',0,0,array('/core/js/lib_batch.js'));
|
||||||
|
}
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur");
|
llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,6 +276,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<input type="hidden" name="action" value="dispatch">';
|
print '<input type="hidden" name="action" value="dispatch">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
// Set $products_dispatched with qty dispatech for each product id
|
||||||
|
$products_dispatched = array();
|
||||||
$sql = "SELECT cfd.fk_product, sum(cfd.qty) as qty";
|
$sql = "SELECT cfd.fk_product, sum(cfd.qty) as qty";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
|
||||||
$sql.= " WHERE cfd.fk_commande = ".$commande->id;
|
$sql.= " WHERE cfd.fk_commande = ".$commande->id;
|
||||||
@ -280,7 +286,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
while ( $row = $db->fetch_row($resql) )
|
while ($row = $db->fetch_row($resql))
|
||||||
{
|
{
|
||||||
$products_dispatched[$row[0]] = $row[1];
|
$products_dispatched[$row[0]] = $row[1];
|
||||||
}
|
}
|
||||||
@ -338,7 +344,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$remaintodispatch=($objp->qty - $products_dispatched[$objp->fk_product]); // Calculation of dispatched
|
$remaintodispatch=($objp->qty - (empty($products_dispatched[$objp->fk_product])?0:$products_dispatched[$objp->fk_product])); // Calculation of dispatched
|
||||||
if ($remaintodispatch < 0) $remaintodispatch=0;
|
if ($remaintodispatch < 0) $remaintodispatch=0;
|
||||||
if ($remaintodispatch)
|
if ($remaintodispatch)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -24,5 +24,8 @@ create table llx_commande_fournisseur_dispatch
|
|||||||
qty float, -- qty
|
qty float, -- qty
|
||||||
fk_entrepot integer,
|
fk_entrepot integer,
|
||||||
fk_user integer,
|
fk_user integer,
|
||||||
datec datetime
|
comment varchar(255),
|
||||||
|
status integer,
|
||||||
|
datec datetime,
|
||||||
|
tms timestamp
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ StatusOrderDraftShort=Draft
|
|||||||
StatusOrderValidatedShort=Validated
|
StatusOrderValidatedShort=Validated
|
||||||
StatusOrderSentShort=In process
|
StatusOrderSentShort=In process
|
||||||
StatusOrderSent=Shipment in process
|
StatusOrderSent=Shipment in process
|
||||||
StatusOrderOnProcessShort=Order sent
|
StatusOrderOnProcessShort=Ordered
|
||||||
StatusOrderProcessedShort=Processed
|
StatusOrderProcessedShort=Processed
|
||||||
StatusOrderToBillShort=Delivered
|
StatusOrderToBillShort=Delivered
|
||||||
StatusOrderToBill2Short=To bill
|
StatusOrderToBill2Short=To bill
|
||||||
@ -41,7 +41,7 @@ StatusOrderReceivedAllShort=Everything received
|
|||||||
StatusOrderCanceled=Canceled
|
StatusOrderCanceled=Canceled
|
||||||
StatusOrderDraft=Draft (needs to be validated)
|
StatusOrderDraft=Draft (needs to be validated)
|
||||||
StatusOrderValidated=Validated
|
StatusOrderValidated=Validated
|
||||||
StatusOrderOnProcess=Order sent - Standby reception
|
StatusOrderOnProcess=Ordered - Standby reception
|
||||||
StatusOrderProcessed=Processed
|
StatusOrderProcessed=Processed
|
||||||
StatusOrderToBill=Delivered
|
StatusOrderToBill=Delivered
|
||||||
StatusOrderToBill2=To bill
|
StatusOrderToBill2=To bill
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user