diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index d768ea749f6..4c691f876c4 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -25,6 +25,7 @@ OrdersToBill=Commandes clients à délivrer OrdersInProcess=Commandes clients en traitement OrdersToProcess=Commandes clients à traiter SuppliersOrdersToProcess=Commandes fournisseurs à traiter +SuppliersOrdersInProcess=Commandes fournisseurs en traitement StatusOrderCanceledShort=Annulée StatusOrderDraftShort=Brouillon StatusOrderValidatedShort=Validée diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index bbf958d45c9..1c343614aff 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1939,7 +1939,7 @@ else if ($id || $ref) $sql.= " AND ed.fk_reception = e.rowid"; //if ($filter) $sql.= $filter; $sql.= " ORDER BY obj.fk_product"; - print $sql;exit; + dol_syslog("get list of reception lines", LOG_DEBUG); $resql = $db->query($sql); if ($resql) @@ -1953,7 +1953,7 @@ else if ($id || $ref) if ($obj) { // $obj->rowid is rowid in $origin."det" table - $alreadysent[$obj->rowid][$obj->receptionline_id]=array('reception_ref'=>$obj->reception_ref, 'reception_id'=>$obj->reception_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty_shipped, 'date_valid'=>$obj->date_valid, 'date_delivery'=>$obj->date_delivery); + $alreadysent[$obj->rowid][$obj->receptionline_id]=array('reception_ref'=>$obj->reception_ref, 'reception_id'=>$obj->reception_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty, 'date_valid'=>$obj->date_valid, 'date_delivery'=>$obj->date_delivery); } $i++; } @@ -1981,26 +1981,27 @@ else if ($id || $ref) { $prod = new Product($db); $prod->fetch($lines[$i]->fk_product); - $label = ( ! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label; + $label = ( ! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product->product_label; } else - $label = (! empty($lines[$i]->label)?$lines[$i]->label:$lines[$i]->product_label); + $label = (! empty($lines[$i]->product->label)?$lines[$i]->product->label:$lines[$i]->product->product_label); print ''; // Show product and description - $product_static->type=$lines[$i]->fk_product_type; - $product_static->id=$lines[$i]->fk_product; - $product_static->ref=$lines[$i]->ref; - $product_static->status_batch=$lines[$i]->product_tobatch; + $product_static->type=$lines[$i]->product->fk_product_type; + $product_static->id=$lines[$i]->product->fk_product; + $product_static->ref=$lines[$i]->product->ref; + $product_static->status_batch=$lines[$i]->product->product_tobatch; + $text=$product_static->getNomUrl(1); $text.= ' - '.$label; - $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($lines[$i]->description)); + $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($lines[$i]->product->description)); print $form->textwithtooltip($text,$description,3,'','',$i); print_date_range($lines[$i]->date_start,$lines[$i]->date_end); if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) { - print (! empty($lines[$i]->description) && $lines[$i]->description!=$lines[$i]->product)?'
'.dol_htmlentitiesbr($lines[$i]->description):''; + print (! empty($lines[$i]->product->description) && $lines[$i]->description!=$lines[$i]->product->description)?'
'.dol_htmlentitiesbr($lines[$i]->description):''; } print "\n"; } @@ -2030,7 +2031,7 @@ else if ($id || $ref) print ''; foreach ($alreadysent as $key => $val) { - if ($lines[$i]->fk_origin_line == $key) + if ($lines[$i]->fk_commandefourndet == $key) { $j = 0; foreach($val as $receptionline_id=> $receptionline_var) @@ -2042,6 +2043,7 @@ else if ($id || $ref) $reception_static->fetch($receptionline_var['reception_id']); print $reception_static->getNomUrl(1); print ' - '.$receptionline_var['qty_shipped']; + $htmltext=$langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid'])?$langs->trans("Draft"):dol_print_date($receptionline_var['date_valid'], 'dayhour')); if (! empty($conf->stock->enabled) && $receptionline_var['warehouse'] > 0) { @@ -2059,72 +2061,24 @@ else if ($id || $ref) { // edit mode print ''; - if (is_array($lines[$i]->detail_batch) && count($lines[$i]->detail_batch) > 0) - { - print ''; - $line = new CommandeFournisseurDispatch($db); - foreach ($lines[$i]->detail_batch as $detail_batch) - { - print ''; - // Qty to ship or shipped - print ''; - // Batch number managment - if ($lines[$i]->entrepot_id == 0) - { - // only show lot numbers from src warehouse when reception from multiple warehouses - $line->fetch($detail_batch->fk_receptiondet); - } - print ''; - print ''; - } - // add a 0 qty lot row to be able to add a lot - print ''; - // Qty to ship or shipped - print ''; - // Batch number managment - print ''; - print ''; - } - else if (! empty($conf->stock->enabled)) + if (! empty($conf->stock->enabled)) { if ($lines[$i]->fk_product > 0) { - if ($lines[$i]->entrepot_id > 0) - { - print ''; + print ''; print ''; // Qty to ship or shipped print ''; // Warehouse source print ''; - // Batch number managment - print ''; + //@TODO Batch number managment + if($conf->productbatch->enabled)print ''; print ''; - } - else if (count($lines[$i]->details_entrepot) > 1) - { - print ''; - foreach ($lines[$i]->details_entrepot as $detail_entrepot) - { - print ''; - // Qty to ship or shipped - print ''; - // Warehouse source - print ''; - // Batch number managment - print ''; - print ''; - } - } - else - { - print ''; - print ''; - } + } else { - print ''; + print ''; print ''; // Qty to ship or shipped print ''; @@ -2140,16 +2094,16 @@ else if ($id || $ref) else { // Qty to ship or shipped - print ''; + print ''; // Warehouse source if (! empty($conf->stock->enabled)) { print ''; // Volume print ''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index ddd7165a3b9..9a557a9a50c 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1190,7 +1190,7 @@ class Reception extends CommonObject function fetch_lines() { global $db; - + dol_include_once('/fourn/class/fournisseur.commande.dispatch.class.php'); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch WHERE fk_reception='.$this->id; $resql = $db->query($sql); if(!empty($resql)){ @@ -1199,7 +1199,14 @@ class Reception extends CommonObject $line = new CommandeFournisseurDispatch($db); $line->fetch($obj->rowid); $line->fetch_product(); - + $sql_qtyasked = 'SELECT qty FROM llx_commande_fournisseurdet WHERE rowid='.$line->fk_commandefourndet; + $resql_qtyasked = $db->query($sql_qtyasked); + if(!empty($resql_qtyasked)){ + $obj = $db->fetch_object($resql_qtyasked); + $line->qty_asked = $obj->qty; + }else { + $line->qty_asked = 0; + } $this->lines[]=$line; } @@ -1464,7 +1471,7 @@ class Reception extends CommonObject $i=0; $sql = "SELECT em.rowid, em.code, em.libelle, em.description, em.tracking, em.active"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_reception_mode as em"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as em"; if ($id!='') $sql.= " WHERE em.rowid=".$id; $resql = $this->db->query($sql); @@ -1495,13 +1502,13 @@ class Reception extends CommonObject { if ($id=='') { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_reception_mode (code, libelle, description, tracking)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)"; $sql.=" VALUES ('".$this->update['code']."','".$this->update['libelle']."','".$this->update['description']."','".$this->update['tracking']."')"; $resql = $this->db->query($sql); } else { - $sql = "UPDATE ".MAIN_DB_PREFIX."c_reception_mode SET"; + $sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET"; $sql.= " code='".$this->db->escape($this->update['code'])."'"; $sql.= ",libelle='".$this->db->escape($this->update['libelle'])."'"; $sql.= ",description='".$this->db->escape($this->update['description'])."'"; @@ -1521,7 +1528,7 @@ class Reception extends CommonObject */ function activ_delivery_method($id) { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'c_reception_mode SET active=1'; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=1'; $sql.= ' WHERE rowid='.$id; $resql = $this->db->query($sql); @@ -1537,7 +1544,7 @@ class Reception extends CommonObject */ function disable_delivery_method($id) { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'c_reception_mode SET active=0'; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=0'; $sql.= ' WHERE rowid='.$id; $resql = $this->db->query($sql); @@ -1556,7 +1563,7 @@ class Reception extends CommonObject if (! empty($this->shipping_method_id)) { $sql = "SELECT em.code, em.tracking"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_reception_mode as em"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as em"; $sql.= " WHERE em.rowid = ".$this->shipping_method_id; $resql = $this->db->query($sql); diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index 7eaba0b29ad..04fe5bc969a 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -18,30 +18,30 @@ */ /** - * \file htdocs/expedition/index.php - * \ingroup expedition - * \brief Home page of shipping area. + * \file htdocs/reception/index.php + * \ingroup reception + * \brief Home page of reception area. */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; $langs->load("orders"); -$langs->load("sendings"); +$langs->load("receptions"); /* * View */ -$orderstatic=new Commande($db); +$orderstatic=new CommandeFournisseur($db); $companystatic=new Societe($db); -$shipment=new Expedition($db); +$reception=new Reception($db); -$helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; -llxHeader('',$langs->trans("Shipment"),$helpurl); +$helpurl='EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones'; +llxHeader('',$langs->trans("Reception"),$helpurl); -print load_fiche_titre($langs->trans("SendingsArea")); +print load_fiche_titre($langs->trans("ReceptionsArea")); print '
'; @@ -54,21 +54,21 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print '
' . '' . '' . $formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_receptiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $line->entrepot_id). '
' . '' . '' . $formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product). '
' . '' . '' . $formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1). ' - ' . $langs->trans("NA") . ' - ' . $langs->trans("NA") . '
' . '' . '' . $formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1) . ' - ' . $langs->trans("NA") . '
'.$langs->trans("NotEnoughStock").'
' . '' . ''.$lines[$i]->qty_shipped.''.$lines[$i]->qty.''; - if ($lines[$i]->entrepot_id > 0) + if ($lines[$i]->fk_entrepot > 0) { $entrepot = new Entrepot($db); - $entrepot->fetch($lines[$i]->entrepot_id); + $entrepot->fetch($lines[$i]->fk_entrepot); print $entrepot->getNomUrl(1); } else if (count($lines[$i]->details_entrepot) > 1) @@ -2172,21 +2126,20 @@ else if ($id || $ref) // Batch number managment if (! empty($conf->productbatch->enabled)) { - if (isset($lines[$i]->detail_batch)) + if (isset($lines[$i]->batch)) { print ''; print ''; - if ($lines[$i]->product_tobatch) + $detail =''; + if ($lines[$i]->product->status_batch) { - $detail = ''; - foreach ($lines[$i]->detail_batch as $dbatch) - { - $detail.= $langs->trans("Batch").': '.$dbatch->batch; - $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby,"day"); - $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby,"day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->dluo_qty; + + $detail.= $langs->trans("Batch").': '.$lines[$i]->batch; + $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($lines[$i]->sellby,"day"); + $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($lines[$i]->eatby,"day"); + $detail.= '
'; - } + print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"),$detail); } else @@ -2202,13 +2155,13 @@ else if ($id || $ref) // Weight print '
'; - if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->weight*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->weight_units,"weight"); + if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->product->weight*$lines[$i]->qty.' '.measuring_units_string($lines[$i]->product->weight_units,"weight"); else print ' '; print ''; - if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units,"volume"); + if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->product->volume*$lines[$i]->qty.' '.measuring_units_string($lines[$i]->product->volume_units,"volume"); else print ' '; print '
'; print ''; print ''; + print $langs->trans("Reception").':'; print "
'.$langs->trans("Search").'
'; - print $langs->trans("Shipment").':

\n"; } /* - * Shipments to validate + * Receptions to validate */ $clause = " WHERE "; -$sql = "SELECT e.rowid, e.ref, e.ref_customer,"; +$sql = "SELECT e.rowid, e.ref, e.ref_supplier,"; $sql.= " s.nom as name, s.rowid as socid,"; -$sql.= " c.ref as commande_ref, c.rowid as commande_id"; -$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping'"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid"; +$sql.= " c.ref as commande_fournisseur_ref, c.rowid as commande_fournisseur_id"; +$sql.= " FROM ".MAIN_DB_PREFIX."reception as e"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'reception'"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur as c ON el.fk_source = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (!$user->rights->societe->client->voir && !$socid) { @@ -77,7 +77,7 @@ if (!$user->rights->societe->client->voir && !$socid) $clause = " AND "; } $sql.= $clause." e.fk_statut = 0"; -$sql.= " AND e.entity IN (".getEntity('expedition').")"; +$sql.= " AND e.entity IN (".getEntity('reception').")"; if ($socid) $sql.= " AND c.fk_soc = ".$socid; $resql=$db->query($sql); @@ -88,24 +88,24 @@ if ($resql) { print ''; print ''; - print ''; + print ''; $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); - $shipment->id=$obj->rowid; - $shipment->ref=$obj->ref; - $shipment->ref_customer=$obj->ref_customer; + $reception->id=$obj->rowid; + $reception->ref=$obj->ref; + $reception->ref_supplier=$obj->ref_supplier; print '"; print ''; print ''; $i++; } @@ -115,19 +115,18 @@ if ($resql) /* - * Commandes a traiter + * CommandeFournisseurs a traiter */ -$sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut, s.nom as name, s.rowid as socid"; -$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,"; +$sql = "SELECT c.rowid, c.ref, c.ref_supplier as ref_supplier, c.fk_statut, s.nom as name, s.rowid as socid"; +$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity = ".$conf->entity; -$sql.= " AND c.fk_statut = 1"; +$sql.= " AND c.fk_statut = 2";//Approuvé if ($socid) $sql.= " AND c.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY c.rowid ASC"; - $resql=$db->query($sql); if ($resql) { @@ -139,14 +138,14 @@ if ($resql) $i = 0; print '
'.$langs->trans("SendingsToValidate").'
'.$langs->trans("ReceptionsToValidate").'
'; - print $shipment->getNomUrl(1); + print $reception->getNomUrl(1); print "'; print ''.$obj->name.''; print ''; - if ($obj->commande_id) print ''.$obj->commande_ref.''; + if ($obj->commande_fournisseur_id) print ''.$obj->commande_fournisseur_ref.''; print '
'; print ''; - print ''; + print ''; while ($i < $num) { $obj = $db->fetch_object($resql); $orderstatic->id=$obj->rowid; $orderstatic->ref=$obj->ref; - $orderstatic->ref_customer=$obj->ref_customer; + $orderstatic->ref_supplier=$obj->ref_supplier; $orderstatic->statut=$obj->fk_statut; $orderstatic->facturee=0; @@ -176,15 +175,15 @@ print '
'; /* - * Commandes en traitement + * CommandeFournisseurs en traitement */ -$sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut as status, c.facture as billed, s.nom as name, s.rowid as socid"; -$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,"; +$sql = "SELECT c.rowid, c.ref, c.ref_supplier as ref_supplier, c.fk_statut as status, c.billed as billed, s.nom as name, s.rowid as socid"; +$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity = ".$conf->entity; -$sql.= " AND c.fk_statut = 2"; +$sql.= " AND c.fk_statut IN (3,4)"; if ($socid) $sql.= " AND c.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -199,14 +198,14 @@ if ( $resql ) $i = 0; print '
'.$langs->trans("OrdersToProcess").'
'.$langs->trans("SuppliersOrdersToProcess").'
'; print ''; - print ''; + print ''; while ($i < $num) { $obj = $db->fetch_object($resql); $orderstatic->id=$obj->rowid; $orderstatic->ref=$obj->ref; - $orderstatic->ref_customer=$obj->ref_customer; + $orderstatic->ref_supplier=$obj->ref_supplier; $orderstatic->statut=$obj->status; $orderstatic->facturee=$obj->billed; @@ -232,17 +231,17 @@ else dol_print_error($db); /* - * Last shipments + * Last receptions */ -$sql = "SELECT e.rowid, e.ref, e.ref_customer,"; +$sql = "SELECT e.rowid, e.ref, e.ref_supplier,"; $sql.= " s.nom as name, s.rowid as socid,"; -$sql.= " c.ref as commande_ref, c.rowid as commande_id"; -$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping' AND el.sourcetype IN ('commande')"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'"; +$sql.= " c.ref as commande_fournisseur_ref, c.rowid as commande_fournisseur_id"; +$sql.= " FROM ".MAIN_DB_PREFIX."reception as e"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'reception' AND el.sourcetype IN ('commande_fournisseur')"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande_fournisseur') AND el.targettype = 'reception'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; -$sql.= " WHERE e.entity IN (".getEntity('expedition').")"; +$sql.= " WHERE e.entity IN (".getEntity('reception').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND sc.fk_user = " .$user->id; $sql.= " AND e.fk_statut = 1"; if ($socid) $sql.= " AND c.fk_soc = ".$socid; @@ -258,24 +257,24 @@ if ($resql) $i = 0; print '
'.$langs->trans("OrdersInProcess").'
'.$langs->trans("SuppliersOrdersInProcess").'
'; print ''; - print ''; + print ''; while ($i < $num) { $obj = $db->fetch_object($resql); - $shipment->id=$obj->rowid; - $shipment->ref=$obj->ref; - $shipment->ref_customer=$obj->ref_customer; + $reception->id=$obj->rowid; + $reception->ref=$obj->ref; + $reception->ref_supplier=$obj->ref_supplier; print ''; print ''; print '
'.$langs->trans("LastSendings", $num).'
'.$langs->trans("LastReceptions", $num).'
'; - print $shipment->getNomUrl(1); + print $reception->getNomUrl(1); print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''; - if ($obj->commande_id > 0) + if ($obj->commande_fournisseur_id > 0) { - $orderstatic->id=$obj->commande_id; - $orderstatic->ref=$obj->commande_ref; + $orderstatic->id=$obj->commande_fournisseur_id; + $orderstatic->ref=$obj->commande_fournisseur_ref; print $orderstatic->getNomUrl(1); } else print ' ';