30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
39$hookmanager->initHooks(array(
'sendingindex'));
42$langs->loadLangs(array(
'orders',
'sendings'));
49$companystatic =
new Societe($db);
52$helpurl =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
53llxHeader(
'', $langs->trans(
"Shipment"), $helpurl,
'', 0, 0,
'',
'',
'',
'mod-expedition page-index');
58print
'<div class="fichecenter"><div class="fichethirdleft">';
66$sql =
"SELECT e.rowid, e.ref, e.ref_customer,";
67$sql .=
" s.nom as name, s.rowid as socid,";
68$sql .=
" c.ref as commande_ref, c.rowid as commande_id";
69$sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
70$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping'";
71$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande as c ON el.fk_source = c.rowid";
72$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
73if (!$user->hasRight(
'societe',
'client',
'voir')) {
74 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
75 $sql .= $clause.
" sc.fk_user = ".((int) $user->id);
79$sql .=
" AND e.entity IN (".getEntity(
'expedition').
")";
81 $sql .=
" AND c.fk_soc = ".((int) $socid);
84$resql = $db->query($sql);
86 $num = $db->num_rows($resql);
88 print
'<div class="div-table-responsive-no-min">';
89 print
'<table class="noborder centpercent">';
90 print
'<tr class="liste_titre">';
91 print
'<th colspan="3">';
92 print $langs->trans(
"SendingsToValidate").
' ';
94 print
'<span class="badge">'.$num.
'</span>';
102 $obj = $db->fetch_object($resql);
104 $shipment->id = $obj->rowid;
105 $shipment->ref = $obj->ref;
106 $shipment->ref_customer = $obj->ref_customer;
108 print
'<tr class="oddeven"><td class="nowrap">';
109 print $shipment->getNomUrl(1);
112 print
'<a href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$obj->socid.
'">'.$obj->name.
'</a>';
115 if ($obj->commande_id) {
116 print
'<a href="'.DOL_URL_ROOT.
'/commande/card.php?id='.$obj->commande_id.
'">'.$obj->commande_ref.
'</a>';
122 print
'<tr><td>'.$langs->trans(
"None").
'</td><td></td><td></td></tr>';
125 print
"</table></div><br>";
131print
'</div><div class="fichetwothirdright">';
138$sql =
"SELECT e.rowid, e.ref, e.ref_customer,";
139$sql .=
" s.nom as name, s.rowid as socid,";
140$sql .=
" c.ref as commande_ref, c.rowid as commande_id";
141$sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
142$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')";
143$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'";
144$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
145if (!$user->hasRight(
'societe',
'client',
'voir')) {
146 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
148$sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
149if (!$user->hasRight(
'societe',
'client',
'voir')) {
150 $sql .=
" AND sc.fk_user = ".((int) $user->id);
152$sql .=
" AND e.fk_statut = ".Expedition::STATUS_VALIDATED;
154 $sql .=
" AND c.fk_soc = ".((int) $socid);
156$sql .=
" ORDER BY e.date_delivery DESC";
157$sql .= $db->plimit($max, 0);
159$resql = $db->query($sql);
161 $num = $db->num_rows($resql);
163 print
'<div class="div-table-responsive-no-min">';
164 print
'<table class="noborder centpercent">';
165 print
'<tr class="liste_titre">';
166 print
'<th colspan="4">';
167 print $langs->trans(
"LastSendings").
' ';
169 print
'<span class="badge">'.$num.
'</span>';
177 $obj = $db->fetch_object($resql);
179 $shipment->id = $obj->rowid;
180 $shipment->ref = $obj->ref;
181 $shipment->ref_customer = $obj->ref_customer;
183 print
'<tr class="oddeven"><td>';
184 print $shipment->getNomUrl(1);
186 print
'<td><a href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$obj->socid.
'">'.
img_object($langs->trans(
"ShowCompany"),
"company").
' '.$obj->name.
'</a></td>';
188 if ($obj->commande_id > 0) {
189 $orderstatic->id = $obj->commande_id;
190 $orderstatic->ref = $obj->commande_ref;
191 print $orderstatic->getNomUrl(1);
194 print
'<td class="">';
201 print
'<tr><td>'.$langs->trans(
"None").
'</td><td></td><td></td><td></td></tr>';
203 print
"</table></div><br>";
212$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";
213$sql .=
" FROM ".MAIN_DB_PREFIX.
"commande as c,";
214$sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
215if (!$user->hasRight(
'societe',
'client',
'voir')) {
216 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
218$sql .=
" WHERE c.fk_soc = s.rowid";
219$sql .=
" AND c.entity IN (".getEntity(
'order').
")";
222 $sql .=
" AND c.fk_soc = ".((int) $socid);
224if (!$user->hasRight(
'societe',
'client',
'voir')) {
225 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
227$sql .=
" ORDER BY c.rowid ASC";
229$resql = $db->query($sql);
231 $langs->load(
"orders");
233 $num = $db->num_rows($resql);
235 print
'<div class="div-table-responsive-no-min">';
236 print
'<table class="noborder centpercent">';
238 print
'<tr class="liste_titre">';
239 print
'<th colspan="3">'.$langs->trans(
"OrdersToProcess").
' ';
241 print
'<span class="badge">'.$num.
'</span>';
248 while ($i < $num && $i < 10) {
249 $obj = $db->fetch_object($resql);
251 $orderstatic->id = $obj->rowid;
252 $orderstatic->ref = $obj->ref;
253 $orderstatic->ref_customer = $obj->ref_customer;
254 $orderstatic->statut = $obj->status;
255 $orderstatic->billed = $obj->billed;
257 $companystatic->name = $obj->name;
258 $companystatic->id = $obj->socid;
260 print
'<tr class="oddeven"><td>';
261 print $orderstatic->getNomUrl(1);
264 print $companystatic->getNomUrl(1,
'customer', 32);
266 print
'<td class="right">';
267 print $orderstatic->getLibStatut(3);
274 print
'<tr class="opacitymedium">';
275 print
'<td>'.$langs->trans(
"More").
'...</td>';
281 print
'<tr><td>'.$langs->trans(
"None").
'</td><td></td><td></td></tr>';
284 print
"</table></div><br>";
292$parameters = array(
'user' => $user);
293$reshook = $hookmanager->executeHooks(
'dashboardWarehouseSendings', $parameters, $object);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage customers orders.
const STATUS_SHIPMENTONPROCESS
Shipment on process.
const STATUS_VALIDATED
Validated status.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated status -> parcel is ready to be sent prev status : draft next status : closed or shipment_i...
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...