35 $form =
new Form($db);
38 if (
GETPOST(
'filtre',
'alpha')) {
40 $ret = array(); $i = 0;
42 $sql =
"SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type";
43 if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .=
", ps.reel";
44 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p";
45 if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$db->escape($conf_fkentrepot).
"'";
46 $sql .=
" WHERE p.entity IN (".getEntity(
'product').
")";
47 $sql .=
" AND p.tosell = 1";
48 if (!$conf->global->CASHDESK_SERVICES) $sql .=
" AND p.fk_product_type = 0";
50 $sql .=
"p.ref LIKE '%".$db->escape(
GETPOST(
'filtre')).
"%' OR p.label LIKE '%".$db->escape(
GETPOST(
'filtre')).
"%'";
51 if (!empty($conf->barcode->enabled))
53 $filtre =
GETPOST(
'filtre',
'alpha');
58 if (strlen($filtre) == 13) {
59 $crit_12digit = substr($filtre, 0, 12);
60 $sql .=
" OR p.barcode LIKE '%".$db->escape($crit_12digit).
"%'";
62 $sql .=
" OR p.barcode LIKE '%".$db->escape($filtre).
"%'";
66 $sql .=
" ORDER BY label";
72 $nbr_enreg = $db->num_rows(
$resql);
74 while ($i < $conf_taille_listes && $tab = $db->fetch_array(
$resql))
76 foreach ($tab as $cle => $valeur)
78 $ret[$i][$cle] = $valeur;
86 $tab_designations = $ret;
92 $sql =
"SELECT p.rowid, ref, label, tva_tx, p.fk_product_type";
93 if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .=
", ps.reel";
94 $sql .=
" FROM ".MAIN_DB_PREFIX.
"product as p";
95 if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$db->escape($conf_fkentrepot).
"'";
96 $sql .=
" WHERE p.entity IN (".getEntity(
'product').
")";
97 $sql .=
" AND p.tosell = 1";
98 if (!$conf->global->CASHDESK_SERVICES) $sql .=
" AND p.fk_product_type = 0";
99 $sql .=
" ORDER BY p.label";
102 $resql = $db->query($sql);
105 $nbr_enreg = $db->num_rows(
$resql);
107 while ($i < $conf_taille_listes && $tab = $db->fetch_array(
$resql))
109 foreach ($tab as $cle => $valeur)
111 $ret[$i][$cle] = $valeur;
119 $tab_designations = $ret;
126 if ($nbr_enreg > $conf_taille_listes)
128 $top_liste_produits =
'----- '.$conf_taille_listes.
' '.$langs->transnoentitiesnoconv(
"CashDeskProducts").
' '.$langs->trans(
"CashDeskOn").
' '.$nbr_enreg.
' -----';
130 $top_liste_produits =
'----- '.$nbr_enreg.
' '.$langs->transnoentitiesnoconv(
"CashDeskProducts").
' '.$langs->trans(
"CashDeskOn").
' '.$nbr_enreg.
' -----';
132 } elseif ($nbr_enreg == 1)
134 $top_liste_produits =
'----- 1 '.$langs->transnoentitiesnoconv(
"ProductFound").
' -----';
136 $top_liste_produits =
'----- '.$langs->transnoentitiesnoconv(
"NoProductFound").
' -----';
147 $obj_facturation->getSetPaymentMode(
'RESET');
148 $obj_facturation->amountCollected(
'RESET');
149 $obj_facturation->amountReturned(
'RESET');
150 $obj_facturation->paiementLe(
'RESET');
154 require
'tpl/facturation1.tpl.php';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
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...