28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/reception/class/reception.class.php';
35 $hookmanager->initHooks(array(
'receptionindex'));
37 $langs->loadLangs(array(
"orders",
"receptions"));
44 $companystatic =
new Societe($db);
47 $helpurl =
'EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones';
48 llxHeader(
'', $langs->trans(
"Reception"), $helpurl);
53 print '<div class="fichecenter"><div class="fichethirdleft">';
56 if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS))
58 print
'<form method="post" action="list.php">';
59 print
'<input type="hidden" name="token" value="'.newToken().
'">';
60 print
'<div class="div-table-responsive-no-min">';
61 print
'<table class="noborder nohover centpercent">';
62 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Search").
'</td></tr>';
63 print
'<tr class="oddeven"><td>';
64 print $langs->trans(
"Reception").
':</td><td><input type="text" class="flat" name="sall" size="18"></td><td><input type="submit" value="'.$langs->trans(
"Search").
'" class="button"></td></tr>';
65 print
"</table></div></form><br>\n";
75 $sql =
"SELECT e.rowid, e.ref, e.ref_supplier,";
76 $sql .=
" s.nom as name, s.rowid as socid,";
77 $sql .=
" c.ref as commande_fournisseur_ref, c.rowid as commande_fournisseur_id";
78 $sql .=
" FROM ".MAIN_DB_PREFIX.
"reception as e";
79 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON e.rowid = el.fk_target AND el.targettype = 'reception'";
80 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseur as c ON el.fk_source = c.rowid";
81 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
82 if (!$user->rights->societe->client->voir && !$socid)
84 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
85 $sql .= $clause.
" sc.fk_user = ".$user->id;
88 $sql .= $clause.
" e.fk_statut = 0";
89 $sql .=
" AND e.entity IN (".getEntity(
'reception').
")";
90 if ($socid) $sql .=
" AND c.fk_soc = ".$socid;
95 print
'<div class="div-table-responsive-no-min">';
96 print
'<table class="noborder centpercent">';
97 print
'<tr class="liste_titre">';
98 print
'<th colspan="3">'.$langs->trans(
"ReceptionsToValidate").
'</th></tr>';
100 $num = $db->num_rows(
$resql);
106 $obj = $db->fetch_object(
$resql);
108 $reception->id = $obj->rowid;
109 $reception->ref = $obj->ref;
110 $reception->ref_supplier = $obj->ref_supplier;
112 print
'<tr class="oddeven"><td class="nowrap">';
113 print $reception->getNomUrl(1);
116 print
'<a href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$obj->socid.
'">'.$obj->name.
'</a>';
119 if ($obj->commande_fournisseur_id) print
'<a href="'.DOL_URL_ROOT.
'/commande_fournisseur/card.php?id='.$obj->commande_fournisseur_id.
'">'.$obj->commande_fournisseur_ref.
'</a>';
124 print
'<tr><td><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td><td></td><td></td></tr>';
127 print
"</table></div><br>";
132 print
'</div><div class="fichetwothirdright"><div class="ficheaddleft">';
140 $sql =
"SELECT e.rowid, e.ref, e.ref_supplier,";
141 $sql .=
" s.nom as name, s.rowid as socid,";
142 $sql .=
" c.ref as commande_fournisseur_ref, c.rowid as commande_fournisseur_id";
143 $sql .=
" FROM ".MAIN_DB_PREFIX.
"reception as e";
144 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as el ON e.rowid = el.fk_target AND el.targettype = 'reception' AND el.sourcetype IN ('order_supplier')";
145 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"commande_fournisseur as c ON el.fk_source = c.rowid AND el.sourcetype IN ('order_supplier') AND el.targettype = 'reception'";
146 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
147 if (!$user->rights->societe->client->voir && !$socid) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
148 $sql .=
" WHERE e.entity IN (".getEntity(
'reception').
")";
149 if (!$user->rights->societe->client->voir && !$socid) $sql .=
" AND sc.fk_user = ".$user->id;
150 $sql .=
" AND e.fk_statut = 1";
151 if ($socid) $sql .=
" AND c.fk_soc = ".$socid;
152 $sql .=
" ORDER BY e.date_delivery DESC";
153 $sql .= $db->plimit($max, 0);
155 $resql = $db->query($sql);
158 $num = $db->num_rows(
$resql);
162 print
'<div class="div-table-responsive-no-min">';
163 print
'<table class="noborder centpercent">';
164 print
'<tr class="liste_titre">';
165 print
'<th colspan="3">'.$langs->trans(
"LastReceptions", $num).
'</th></tr>';
168 $obj = $db->fetch_object(
$resql);
170 $reception->id = $obj->rowid;
171 $reception->ref = $obj->ref;
172 $reception->ref_supplier = $obj->ref_supplier;
174 print
'<tr class="oddeven"><td>';
175 print $reception->getNomUrl(1);
177 print
'<td><a href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$obj->socid.
'">'.
img_object($langs->trans(
"ShowCompany"),
"company").
' '.$obj->name.
'</a></td>';
179 if ($obj->commande_fournisseur_id > 0)
181 $orderstatic->id = $obj->commande_fournisseur_id;
182 $orderstatic->ref = $obj->commande_fournisseur_ref;
183 print $orderstatic->getNomUrl(1);
184 }
else print
' ';
188 print
"</table></div><br>";
199 $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";
200 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as c,";
201 $sql .=
" ".MAIN_DB_PREFIX.
"societe as s";
202 if (!$user->rights->societe->client->voir && !$socid) $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
203 $sql .=
" WHERE c.fk_soc = s.rowid";
204 $sql .=
" AND c.entity IN (".getEntity(
'supplier_order').
")";
206 if ($socid > 0) $sql .=
" AND c.fk_soc = ".$socid;
207 if (!$user->rights->societe->client->voir && !$socid) $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
208 $sql .=
" ORDER BY c.rowid ASC";
209 $resql = $db->query($sql);
212 $num = $db->num_rows(
$resql);
215 $langs->load(
"orders");
218 print
'<div class="div-table-responsive-no-min">';
219 print
'<table class="noborder centpercent">';
220 print
'<tr class="liste_titre">';
221 print
'<th colspan="3">'.$langs->trans(
"SuppliersOrdersToProcess").
' <span class="badge">'.$num.
'</span></th></tr>';
224 $obj = $db->fetch_object(
$resql);
226 $orderstatic->id = $obj->rowid;
227 $orderstatic->ref = $obj->ref;
228 $orderstatic->ref_supplier = $obj->ref_supplier;
229 $orderstatic->statut = $obj->status;
230 $orderstatic->facturee = $obj->billed;
232 $companystatic->name = $obj->name;
233 $companystatic->id = $obj->socid;
235 print
'<tr class="oddeven">';
236 print
'<td class="nowrap">';
237 print $orderstatic->getNomUrl(1);
240 print $companystatic->getNomUrl(1,
'customer', 32);
242 print
'<td class="right">';
243 print $orderstatic->getLibStatut(3);
248 print
"</table></div><br>";
252 print
'</div></div></div>';
254 $parameters = array(
'user' => $user);
255 $reshook = $hookmanager->executeHooks(
'dashboardWarehouseReceptions', $parameters, $object);
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
const STATUS_RECEIVED_PARTIALLY
Received partially.
Class to manage receptions.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Class to manage predefined suppliers products.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.