33 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
53 $this->family =
"products";
54 $this->module_position =
'26';
56 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
60 $this->version =
'dolibarr';
62 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
63 $this->picto =
'product';
66 $this->dirs = array(
"/product/temp");
69 $this->hidden =
false;
70 $this->depends = array();
71 $this->requiredby = array(
"modStock",
"modBarcode",
"modProductBatch",
"modVariants");
72 $this->conflictwith = array();
73 $this->phpmin = array(5, 4);
76 $this->config_page_url = array(
"product.php@product");
77 $this->langfiles = array(
"products",
"companies",
"stocks",
"bills");
80 $this->
const = array();
83 $this->
const[$r][0] =
"PRODUCT_CODEPRODUCT_ADDON";
84 $this->
const[$r][1] =
"chaine";
85 $this->
const[$r][2] =
"mod_codeproduct_leopard";
86 $this->
const[$r][3] =
'Module to control product codes';
87 $this->
const[$r][4] = 0;
90 $this->
const[$r][0] =
"PRODUCT_PRICE_UNIQ";
91 $this->
const[$r][1] =
"chaine";
92 $this->
const[$r][2] =
"1";
93 $this->
const[$r][3] =
'pricing rule by default';
94 $this->
const[$r][4] = 0;
105 $this->boxes = array(
106 0=>array(
'file'=>
'box_produits.php',
'enabledbydefaulton'=>
'Home'),
107 1=>array(
'file'=>
'box_produits_alerte_stock.php',
'enabledbydefaulton'=>
''),
108 2=>array(
'file'=>
'box_graph_product_distribution.php',
'enabledbydefaulton'=>
'Home')
112 $this->rights = array();
113 $this->rights_class =
'produit';
116 $this->rights[$r][0] = 31;
117 $this->rights[$r][1] =
'Read products';
118 $this->rights[$r][2] =
'r';
119 $this->rights[$r][3] = 0;
120 $this->rights[$r][4] =
'lire';
123 $this->rights[$r][0] = 32;
124 $this->rights[$r][1] =
'Create/modify products';
125 $this->rights[$r][2] =
'w';
126 $this->rights[$r][3] = 0;
127 $this->rights[$r][4] =
'creer';
130 $this->rights[$r][0] = 34;
131 $this->rights[$r][1] =
'Delete products';
132 $this->rights[$r][2] =
'd';
133 $this->rights[$r][3] = 0;
134 $this->rights[$r][4] =
'supprimer';
137 $this->rights[$r][0] = 38;
138 $this->rights[$r][1] =
'Export products';
139 $this->rights[$r][2] =
'r';
140 $this->rights[$r][3] = 0;
141 $this->rights[$r][4] =
'export';
144 $this->rights[$r][0] = 39;
145 $this->rights[$r][1] =
'Ignore minimum price';
146 $this->rights[$r][2] =
'r';
147 $this->rights[$r][3] = 0;
148 $this->rights[$r][4] =
'ignore_price_min_advance';
171 if (is_object($mysoc)) $usenpr = $mysoc->useNPR();
178 $this->export_code[$r] = $this->rights_class.
'_'.$r;
179 $this->export_label[$r] =
"Products";
180 $this->export_permission[$r] = array(array(
"produit",
"export"));
181 $this->export_fields_array[$r] = array(
182 'p.rowid'=>
"Id",
'p.ref'=>
"Ref",
'p.label'=>
"Label",
183 'p.fk_product_type'=>
'Type',
'p.tosell'=>
"OnSell",
'p.tobuy'=>
"OnBuy",
184 'p.description'=>
"Description",
'p.url'=>
"PublicUrl",
185 'p.customcode'=>
'CustomCode',
'p.fk_country'=>
'IDCountry',
186 'p.accountancy_code_sell'=>
"ProductAccountancySellCode",
'p.accountancy_code_sell_intra'=>
"ProductAccountancySellIntraCode",
187 'p.accountancy_code_sell_export'=>
"ProductAccountancySellExportCode",
'p.accountancy_code_buy'=>
"ProductAccountancyBuyCode",
188 'p.accountancy_code_buy_intra'=>
"ProductAccountancyBuyIntraCode",
'p.accountancy_code_buy_export'=>
"ProductAccountancyBuyExportCode",
189 'p.note'=>
"NotePrivate",
'p.note_public'=>
'NotePublic',
190 'p.weight'=>
"Weight",
'p.weight_units'=>
"WeightUnits",
'p.length'=>
"Length",
'p.length_units'=>
"LengthUnits",
'p.width'=>
"Width",
'p.width_units'=>
"WidthUnits",
'p.height'=>
"Height",
'p.height_units'=>
"HeightUnits",
191 'p.surface'=>
"Surface",
'p.surface_units'=>
"SurfaceUnits",
'p.volume'=>
"Volume",
'p.volume_units'=>
"VolumeUnits",
192 'p.duration'=>
"Duration",
193 'p.finished' =>
'Nature',
194 'p.price_base_type'=>
"PriceBase",
'p.price'=>
"UnitPriceHT",
'p.price_ttc'=>
"UnitPriceTTC",
195 'p.tva_tx'=>
'VATRate',
196 'p.datec'=>
'DateCreation',
'p.tms'=>
'DateModification'
198 if (is_object($mysoc) && $usenpr) $this->export_fields_array[$r][
'p.recuperableonly'] =
'NPR';
199 if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'p.cost_price'=>
'CostPrice'));
200 if (!empty($conf->stock->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'e.ref'=>
'DefaultWarehouse',
'p.tobatch'=>
'ManageLotSerial',
'p.stock'=>
'Stock',
'p.seuil_stock_alerte'=>
'StockLimit',
'p.desiredstock'=>
'DesiredStock',
'p.pmp'=>
'PMPValue'));
201 if (!empty($conf->barcode->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'p.barcode'=>
'BarCode'));
202 $keyforselect =
'product'; $keyforelement =
'product'; $keyforaliasextra =
'extra';
203 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
204 if (!empty($conf->fournisseur->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
's.nom'=>
'Supplier',
'pf.ref_fourn'=>
'SupplierRef',
'pf.quantity'=>
'QtyMin',
'pf.remise_percent'=>
'DiscountQtyMin',
'pf.unitprice'=>
'BuyingPrice',
'pf.delivery_time_days'=>
'NbDaysToDelivery'));
205 if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'group_concat(cat.label)'=>
'Categories'));
206 if (!empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'l.lang'=>
'Language',
'l.label'=>
'TranslatedLabel',
'l.description'=>
'TranslatedDescription',
'l.note'=>
'TranslatedNote'));
207 if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r][
'p.fk_unit'] =
'Unit';
208 $this->export_TypeFields_array[$r] = array(
209 'p.ref'=>
"Text",
'p.label'=>
"Text",
210 'p.fk_product_type'=>
'Numeric',
'p.tosell'=>
"Boolean",
'p.tobuy'=>
"Boolean",
211 'p.description'=>
"Text",
'p.url'=>
"Text",
212 'p.accountancy_code_sell'=>
"Text",
'p.accountancy_code_sell_intra'=>
"Text",
'p.accountancy_code_sell_export'=>
"Text",
213 'p.accountancy_code_buy'=>
"Text",
'p.accountancy_code_buy_intra'=>
"Text",
'p.accountancy_code_buy_export'=>
"Text",
214 'p.note'=>
"Text",
'p.note_public'=>
"Text",
215 'p.weight'=>
"Numeric",
'p.length'=>
"Numeric",
'p.width'=>
"Numeric",
'p.height'=>
"Numeric",
'p.surface'=>
"Numeric",
'p.volume'=>
"Numeric",
216 'p.customcode'=>
'Text',
217 'p.duration'=>
"Text",
218 'p.finished' =>
'Numeric',
219 'p.price_base_type'=>
"Text",
'p.price'=>
"Numeric",
'p.price_ttc'=>
"Numeric",
'p.tva_tx'=>
'Numeric',
220 'p.datec'=>
'Date',
'p.tms'=>
'Date'
222 if (!empty($conf->stock->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array(
'e.ref'=>
'Text',
'p.tobatch'=>
'Numeric',
'p.stock'=>
'Numeric',
'p.seuil_stock_alerte'=>
'Numeric',
'p.desiredstock'=>
'Numeric',
'p.pmp'=>
'Numeric',
'p.cost_price'=>
'Numeric'));
223 if (!empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array(
'p.barcode'=>
'Text'));
224 if (!empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array(
's.nom'=>
'Text',
'pf.ref_fourn'=>
'Text',
'pf.unitprice'=>
'Numeric',
'pf.quantity'=>
'Numeric',
'pf.remise_percent'=>
'Numeric',
'pf.delivery_time_days'=>
'Numeric'));
225 if (!empty($conf->global->MAIN_MULTILANGS)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array(
'l.lang'=>
'Text',
'l.label'=>
'Text',
'l.description'=>
'Text',
'l.note'=>
'Text'));
226 if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array(
"group_concat(cat.label)"=>
'Text'));
227 $this->export_entities_array[$r] = array();
228 if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
"group_concat(cat.label)"=>
'category'));
229 if (!empty($conf->stock->enabled)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'p.stock'=>
'product',
'p.pmp'=>
'product'));
230 if (!empty($conf->barcode->enabled)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'p.barcode'=>
'product'));
231 if (!empty($conf->fournisseur->enabled)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
's.nom'=>
'product_supplier_ref',
'pf.ref_fourn'=>
'product_supplier_ref',
'pf.unitprice'=>
'product_supplier_ref',
'pf.quantity'=>
'product_supplier_ref',
'pf.remise_percent'=>
'product_supplier_ref',
'pf.delivery_time_days'=>
'product_supplier_ref'));
232 if (!empty($conf->global->MAIN_MULTILANGS)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'l.lang'=>
'translation',
'l.label'=>
'translation',
'l.description'=>
'translation',
'l.note'=>
'translation'));
233 if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_dependencies_array[$r] = array(
'category'=>
'p.rowid');
234 if (!empty($conf->stock->enabled)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'p.stock'=>
'product',
'p.pmp'=>
'product'));
235 if (!empty($conf->barcode->enabled)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'p.barcode'=>
'product'));
236 if (!empty($conf->fournisseur->enabled)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
's.nom'=>
'product_supplier_ref',
'pf.ref_fourn'=>
'product_supplier_ref',
'pf.unitprice'=>
'product_supplier_ref',
'pf.quantity'=>
'product_supplier_ref',
'pf.remise_percent'=>
'product_supplier_ref',
'pf.delivery_time_days'=>
'product_supplier_ref'));
237 if (!empty($conf->global->MAIN_MULTILANGS)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'l.lang'=>
'translation',
'l.label'=>
'translation',
'l.description'=>
'translation',
'l.note'=>
'translation'));
238 if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_dependencies_array[$r] = array(
'category'=>
'p.rowid');
239 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
240 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'product as p';
241 if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'categorie_product as cp ON cp.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.
'categorie as cat ON cp.fk_categorie = cat.rowid';
242 if (!empty($conf->global->MAIN_MULTILANGS)) $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_lang as l ON l.fk_product = p.rowid';
243 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_extrafields as extra ON p.rowid = extra.fk_object';
244 if (!empty($conf->fournisseur->enabled)) $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.
'societe s ON s.rowid = pf.fk_soc';
245 if (!empty($conf->stock->enabled)) $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'entrepot as e ON e.rowid = p.fk_default_warehouse';
246 $this->export_sql_end[$r] .=
' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity(
'product').
')';
247 if (!empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_sql_order[$r] =
' GROUP BY p.rowid';
249 if (!empty($conf->global->PRODUIT_MULTIPRICES))
253 $this->export_code[$r] = $this->rights_class.
'_'.$r;
254 $this->export_label[$r] =
"ProductsMultiPrice";
255 $this->export_permission[$r] = array(array(
"produit",
"export"));
256 $this->export_fields_array[$r] = array(
'p.rowid'=>
"Id",
'p.ref'=>
"Ref",
257 'pr.price_base_type'=>
"PriceBase",
'pr.price_level'=>
"PriceLevel",
258 'pr.price'=>
"PriceLevelUnitPriceHT",
'pr.price_ttc'=>
"PriceLevelUnitPriceTTC",
259 'pr.price_min'=>
"MinPriceLevelUnitPriceHT",
'pr.price_min_ttc'=>
"MinPriceLevelUnitPriceTTC",
260 'pr.tva_tx'=>
'PriceLevelVATRate',
261 'pr.date_price'=>
'DateCreation');
262 if (is_object($mysoc) && $usenpr) $this->export_fields_array[$r][
'pr.recuperableonly'] =
'NPR';
269 $this->export_entities_array[$r] = array(
'p.rowid'=>
"product",
'p.ref'=>
"product",
270 'pr.price_base_type'=>
"product",
'pr.price_level'=>
"product",
'pr.price'=>
"product",
271 'pr.price_ttc'=>
"product",
272 'pr.price_min'=>
"product",
'pr.price_min_ttc'=>
"product",
273 'pr.tva_tx'=>
'product',
274 'pr.recuperableonly'=>
'product',
275 'pr.date_price'=>
"product");
276 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
277 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'product as p';
278 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity;
279 $this->export_sql_end[$r] .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
282 if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
286 $this->export_code[$r] = $this->rights_class.
'_'.$r;
287 $this->export_label[$r] =
"ProductsPricePerCustomer";
288 $this->export_permission[$r] = array(array(
"produit",
"export"));
289 $this->export_fields_array[$r] = array(
'p.rowid'=>
"Id",
'p.ref'=>
"Ref",
290 's.nom'=>
'ThirdParty',
291 'pr.price_base_type'=>
"PriceBase",
292 'pr.price'=>
"PriceUnitPriceHT",
'pr.price_ttc'=>
"PriceUnitPriceTTC",
293 'pr.price_min'=>
"MinPriceUnitPriceHT",
'pr.price_min_ttc'=>
"MinPriceUnitPriceTTC",
294 'pr.tva_tx'=>
'PriceVATRate',
295 'pr.default_vat_code'=>
'PriceVATCode',
296 'pr.datec'=>
'DateCreation');
297 if (is_object($mysoc) && $usenpr) $this->export_fields_array[$r][
'pr.recuperableonly'] =
'NPR';
298 $this->export_entities_array[$r] = array(
'p.rowid'=>
"product",
'p.ref'=>
"product",
300 'pr.price_base_type'=>
"product",
'pr.price'=>
"product",
301 'pr.price_ttc'=>
"product",
302 'pr.price_min'=>
"product",
'pr.price_min_ttc'=>
"product",
303 'pr.tva_tx'=>
'product',
304 'pr.default_vat_code'=>
'product',
305 'pr.recuperableonly'=>
'product',
306 'pr.datec'=>
"product");
307 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
308 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'product as p';
309 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_customer_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity;
310 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'societe as s ON pr.fk_soc = s.rowid';
311 $this->export_sql_end[$r] .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
314 if (!empty($conf->global->PRODUIT_SOUSPRODUITS))
318 $this->export_code[$r] = $this->rights_class.
'_'.$r;
319 $this->export_label[$r] =
"AssociatedProducts";
320 $this->export_permission[$r] = array(array(
"produit",
"export"));
321 $this->export_fields_array[$r] = array(
322 'p.rowid'=>
"Id",
'p.ref'=>
"Ref",
'p.label'=>
"Label",
'p.description'=>
"Description",
'p.url'=>
"PublicUrl",
323 'p.accountancy_code_sell'=>
"ProductAccountancySellCode",
'p.accountancy_code_sell_intra'=>
"ProductAccountancySellIntraCode",
324 'p.accountancy_code_sell_export'=>
"ProductAccountancySellExportCode",
'p.accountancy_code_buy'=>
"ProductAccountancyBuyCode",
325 'p.accountancy_code_buy_intra'=>
"ProductAccountancyBuyIntraCode",
'p.accountancy_code_buy_export'=>
"ProductAccountancyBuyExportCode",
326 'p.note'=>
"NotePrivate",
'p.note_public'=>
'NotePublic',
327 'p.weight'=>
"Weight",
'p.length'=>
"Length",
'p.surface'=>
"Surface",
'p.volume'=>
"Volume",
'p.customcode'=>
'CustomCode',
328 'p.price_base_type'=>
"PriceBase",
'p.price'=>
"UnitPriceHT",
'p.price_ttc'=>
"UnitPriceTTC",
'p.tva_tx'=>
'VATRate',
'p.tosell'=>
"OnSell",
329 'p.tobuy'=>
"OnBuy",
'p.datec'=>
'DateCreation',
'p.tms'=>
'DateModification'
331 if (!empty($conf->stock->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'p.stock'=>
'Stock',
'p.seuil_stock_alerte'=>
'StockLimit',
'p.desiredstock'=>
'DesiredStock',
'p.pmp'=>
'PMPValue'));
332 if (!empty($conf->barcode->enabled)) $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'p.barcode'=>
'BarCode'));
333 $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'pa.qty'=>
'Qty',
'pa.incdec'=>
'ComposedProductIncDecStock'));
334 $this->export_TypeFields_array[$r] = array(
335 'p.ref'=>
"Text",
'p.label'=>
"Text",
'p.description'=>
"Text",
'p.url'=>
"Text",
336 'p.accountancy_code_sell'=>
"Text",
'p.accountancy_code_sell_intra'=>
"Text",
'p.accountancy_code_sell_export'=>
"Text",
337 'p.accountancy_code_buy'=>
"Text",
'p.accountancy_code_buy_intra'=>
"Text",
'p.accountancy_code_buy_export'=>
"Text",
338 'p.note'=>
"Text",
'p.note_public'=>
"Text",
339 'p.weight'=>
"Numeric",
'p.length'=>
"Numeric",
'p.surface'=>
"Numeric",
'p.volume'=>
"Numeric",
'p.customcode'=>
'Text',
340 'p.price_base_type'=>
"Text",
'p.price'=>
"Numeric",
'p.price_ttc'=>
"Numeric",
'p.tva_tx'=>
'Numeric',
'p.tosell'=>
"Boolean",
'p.tobuy'=>
"Boolean",
341 'p.datec'=>
'Date',
'p.tms'=>
'Date'
343 if (!empty($conf->stock->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array(
'p.stock'=>
'Numeric',
'p.seuil_stock_alerte'=>
'Numeric',
'p.desiredstock'=>
'Numeric',
'p.pmp'=>
'Numeric',
'p.cost_price'=>
'Numeric'));
344 if (!empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array(
'p.barcode'=>
'Text'));
345 $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array(
'pa.qty'=>
'Numeric'));
346 $this->export_entities_array[$r] = array(
347 'p.rowid'=>
"virtualproduct",
'p.ref'=>
"virtualproduct",
'p.label'=>
"virtualproduct",
'p.description'=>
"virtualproduct",
'p.url'=>
"virtualproduct",
348 'p.accountancy_code_sell'=>
'virtualproduct',
'p.accountancy_code_sell_intra'=>
'virtualproduct',
'p.accountancy_code_sell_export'=>
'virtualproduct',
349 'p.accountancy_code_buy'=>
'virtualproduct',
'p.accountancy_code_buy_intra'=>
'virtualproduct',
'p.accountancy_code_buy_export'=>
'virtualproduct',
350 'p.note'=>
"virtualproduct",
'p.length'=>
"virtualproduct",
351 'p.surface'=>
"virtualproduct",
'p.volume'=>
"virtualproduct",
'p.weight'=>
"virtualproduct",
'p.customcode'=>
'virtualproduct',
352 'p.price_base_type'=>
"virtualproduct",
'p.price'=>
"virtualproduct",
'p.price_ttc'=>
"virtualproduct",
'p.tva_tx'=>
"virtualproduct",
353 'p.tosell'=>
"virtualproduct",
'p.tobuy'=>
"virtualproduct",
'p.datec'=>
"virtualproduct",
'p.tms'=>
"virtualproduct"
355 if (!empty($conf->stock->enabled)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'p.stock'=>
'virtualproduct',
'p.seuil_stock_alerte'=>
'virtualproduct',
'p.desiredstock'=>
'virtualproduct',
'p.pmp'=>
'virtualproduct'));
356 if (!empty($conf->barcode->enabled)) $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'p.barcode'=>
'virtualproduct'));
357 $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'pa.qty'=>
"subproduct",
'pa.incdec'=>
'subproduct'));
358 $keyforselect =
'product'; $keyforelement =
'product'; $keyforaliasextra =
'extra';
359 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
360 $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array(
'p2.rowid'=>
"Id",
'p2.ref'=>
"Ref",
'p2.label'=>
"Label",
'p2.description'=>
"Description"));
361 $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array(
'p2.rowid'=>
"subproduct",
'p2.ref'=>
"subproduct",
'p2.label'=>
"subproduct",
'p2.description'=>
"subproduct"));
362 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
363 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'product as p';
364 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product_extrafields as extra ON p.rowid = extra.fk_object,';
365 $this->export_sql_end[$r] .=
' '.MAIN_DB_PREFIX.
'product_association as pa, '.MAIN_DB_PREFIX.
'product as p2';
366 $this->export_sql_end[$r] .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
367 $this->export_sql_end[$r] .=
' AND p.rowid = pa.fk_product_pere AND p2.rowid = pa.fk_product_fils';
377 $this->import_code[$r] = $this->rights_class.
'_'.$r;
378 $this->import_label[$r] =
"Products";
379 $this->import_icon[$r] = $this->picto;
380 $this->import_entities_array[$r] = array();
381 $this->import_tables_array[$r] = array(
'p'=>MAIN_DB_PREFIX.
'product',
'extra'=>MAIN_DB_PREFIX.
'product_extrafields');
382 $this->import_tables_creator_array[$r] = array(
'p'=>
'fk_user_author');
383 $this->import_fields_array[$r] = array(
385 'p.label' =>
"Label*",
386 'p.fk_product_type' =>
"Type*",
387 'p.tosell' =>
"OnSell*",
388 'p.tobuy' =>
"OnBuy*",
389 'p.description' =>
"Description",
390 'p.url' =>
"PublicUrl",
391 'p.customcode' =>
'CustomCode',
392 'p.fk_country' =>
'CountryCode',
393 'p.accountancy_code_sell' =>
"ProductAccountancySellCode",
394 'p.accountancy_code_sell_intra' =>
"ProductAccountancySellIntraCode",
395 'p.accountancy_code_sell_export' =>
"ProductAccountancySellExportCode",
396 'p.accountancy_code_buy' =>
"ProductAccountancyBuyCode",
397 'p.accountancy_code_buy_intra' =>
"ProductAccountancyBuyIntraCode",
398 'p.accountancy_code_buy_export' =>
"ProductAccountancyBuyExportCode",
399 'p.note_public' =>
"NotePublic",
400 'p.note' =>
"NotePrivate",
401 'p.weight' =>
"Weight",
402 'p.weight_units' =>
"WeightUnits",
403 'p.length' =>
"Length",
404 'p.length_units' =>
"LengthUnits",
405 'p.width' =>
"Width",
406 'p.width_units' =>
"WidthUnits",
407 'p.height' =>
"Height",
408 'p.height_units' =>
"HeightUnits",
409 'p.surface' =>
"Surface",
410 'p.surface_units' =>
"SurfaceUnits",
411 'p.volume' =>
"Volume",
412 'p.volume_units' =>
"VolumeUnits",
413 'p.duration' =>
"Duration",
414 'p.finished' =>
'Nature',
415 'p.price' =>
"SellingPriceHT",
416 'p.price_min' =>
"MinPrice",
417 'p.price_ttc' =>
"SellingPriceTTC",
418 'p.price_min_ttc' =>
"SellingMinPriceTTC",
419 'p.price_base_type' =>
"PriceBaseType",
420 'p.tva_tx' =>
'VATRate',
421 'p.datec' =>
'DateCreation',
422 'p.cost_price' =>
"CostPrice",
425 $this->import_convertvalue_array[$r] = array(
426 'p.weight_units' => array(
427 'rule' =>
'fetchscalefromcodeunits',
428 'classfile' =>
'/core/class/cunits.class.php',
432 'dict' =>
'DictionaryMeasuringUnits'
434 'p.length_units' => array(
435 'rule' =>
'fetchscalefromcodeunits',
436 'classfile' =>
'/core/class/cunits.class.php',
440 'dict' =>
'DictionaryMeasuringUnits'
442 'p.width_units' => array(
443 'rule' =>
'fetchscalefromcodeunits',
444 'classfile' =>
'/core/class/cunits.class.php',
448 'dict' =>
'DictionaryMeasuringUnits'
450 'p.height_units' => array(
451 'rule' =>
'fetchscalefromcodeunits',
452 'classfile' =>
'/core/class/cunits.class.php',
456 'dict' =>
'DictionaryMeasuringUnits'
458 'p.surface_units' => array(
459 'rule' =>
'fetchscalefromcodeunits',
460 'classfile' =>
'/core/class/cunits.class.php',
463 'units' =>
'surface',
464 'dict' =>
'DictionaryMeasuringUnits'
466 'p.volume_units' => array(
467 'rule' =>
'fetchscalefromcodeunits',
468 'classfile' =>
'/core/class/cunits.class.php',
472 'dict' =>
'DictionaryMeasuringUnits'
474 'p.fk_country' => array(
475 'rule' =>
'fetchidfromcodeid',
476 'classfile' =>
'/core/class/ccountry.class.php',
477 'class' =>
'Ccountry',
479 'dict' =>
'DictionaryCountry'
481 'p.finished'=> array(
482 'rule' =>
'fetchidfromcodeorlabel',
483 'classfile' =>
'/core/class/cproductnature.class.php',
484 'class' =>
'CProductNature',
486 'dict' =>
'DictionaryProductNature'
490 $this->import_regex_array[$r] = array(
492 'p.price_base_type' =>
'\AHT\z|\ATTC\z',
493 'p.tosell' =>
'^[0|1]$',
494 'p.tobuy' =>
'^[0|1]$',
495 'p.fk_product_type' =>
'^[0|1]$',
496 'p.datec' =>
'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$',
497 'p.recuperableonly' =>
'^[0|1]$',
500 if (!empty($conf->stock->enabled)) {
501 $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
502 'p.fk_default_warehouse'=>
'DefaultWarehouse',
503 'p.tobatch'=>
'ManageLotSerial',
504 'p.seuil_stock_alerte' =>
'StockLimit',
505 'p.pmp' =>
'PMPValue',
506 'p.desiredstock' =>
'DesiredStock'
509 $this->import_regex_array[$r] = array_merge($this->import_regex_array[$r], array(
510 'p.tobatch' =>
'^[0|1]$'
513 $this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array(
514 'p.fk_default_warehouse' => array(
515 'rule' =>
'fetchidfromref',
516 'classfile' =>
'/product/stock/class/entrepot.class.php',
517 'class' =>
'Entrepot',
519 'element'=>
'Warehouse'
524 if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.cost_price'=>
'CostPrice'));
525 if (is_object($mysoc) && $usenpr) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.recuperableonly'=>
'NPR'));
526 if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.localtax1_tx'=>
'LT1',
'p.localtax1_type'=>
'LT1Type'));
527 if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.localtax2_tx'=>
'LT2',
'p.localtax2_type'=>
'LT2Type'));
528 if (!empty($conf->barcode->enabled)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'p.barcode'=>
'BarCode'));
529 if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r][
'p.fk_unit'] =
'Unit';
532 $import_extrafield_sample = array();
533 $sql =
"SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX.
"extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.
")";
537 while ($obj = $this->
db->fetch_object(
$resql))
539 $fieldname =
'extra.'.$obj->name;
540 $fieldlabel = ucfirst($obj->label);
541 $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ?
'*' :
'');
542 $import_extrafield_sample[$fieldname] = $fieldlabel;
546 $this->import_fieldshidden_array[$r] = array(
'extra.fk_object'=>
'lastrowid-'.MAIN_DB_PREFIX.
'product');
549 $import_sample = array(
550 'p.ref' =>
"ref:PREF123456",
552 'p.label' =>
"Product name in default language",
553 'p.description' =>
"Product description in default language",
554 'p.note_public' =>
"a public note (free text)",
555 'p.note' =>
"a private note (free text)",
556 'p.customcode' =>
'customs code',
557 'p.fk_country' =>
'FR',
559 'p.price_min' =>
"100",
560 'p.price_ttc' =>
"110",
561 'p.price_min_ttc' =>
"110",
562 'p.price_base_type' =>
"HT (show/use price excl. tax) / TTC (show/use price incl. tax)",
564 'p.tosell' =>
"0 (not for sale to customer, eg. raw material) / 1 (for sale)",
565 'p.tobuy' =>
"0 (not for purchase from supplier, eg. virtual product) / 1 (for purchase)",
566 'p.fk_product_type' =>
"0 (product) / 1 (service)",
567 'p.duration' =>
"eg. 365d/12m/1y",
568 'p.url' =>
'link to product (no https)',
569 'p.accountancy_code_sell' =>
"",
570 'p.accountancy_code_sell_intra' =>
"",
571 'p.accountancy_code_sell_export' =>
"",
572 'p.accountancy_code_buy' =>
"",
573 'p.accountancy_code_buy_intra' =>
"",
574 'p.accountancy_code_buy_export' =>
"",
576 'p.weight_units' =>
'kg',
578 'p.length_units' =>
'm',
580 'p.width_units' =>
'm',
582 'p.height_units' =>
'm',
584 'p.surface_units' =>
'm2',
586 'p.volume_units' =>
'm3',
587 'p.finished' =>
'0 (raw material) / 1 (finished goods), matches field "code" in dictionary table "'.MAIN_DB_PREFIX.
'c_product_nature"'
590 if (!empty($conf->stock->enabled)) $import_sample = array_merge($import_sample, array(
591 'p.tobatch'=>
"0 (don't use) / 1 (use batch/serial number)",
592 'p.seuil_stock_alerte' =>
'',
594 'p.desiredstock' =>
''
596 if (!empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $import_sample = array_merge($import_sample, array(
'p.cost_price'=>
'90'));
597 if (is_object($mysoc) && $usenpr) $import_sample = array_merge($import_sample, array(
'p.recuperableonly'=>
'0'));
598 if (is_object($mysoc) && $mysoc->useLocalTax(1)) $import_sample = array_merge($import_sample, array(
'p.localtax1_tx'=>
'',
'p.localtax1_type'=>
''));
599 if (is_object($mysoc) && $mysoc->useLocalTax(2)) $import_sample = array_merge($import_sample, array(
'p.localtax2_tx'=>
'',
'p.localtax2_type'=>
''));
600 if (!empty($conf->barcode->enabled)) $import_sample = array_merge($import_sample, array(
'p.barcode'=>
''));
601 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
602 $import_sample = array_merge(
605 'p.fk_unit' =>
'use a unit of measure from the dictionary. G/KG/M2/M3 etc....matches field "code" in table "'.MAIN_DB_PREFIX.
'c_units"'
609 $this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array(
610 'p.fk_unit' => array(
611 'rule' =>
'fetchidfromcodeorlabel',
612 'classfile' =>
'/core/class/cunits.class.php',
615 'dict' =>
'DictionaryUnits'
619 $this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample);
620 $this->import_updatekeys_array[$r] = array(
'p.ref'=>
'Ref');
621 if (!empty($conf->barcode->enabled)) $this->import_updatekeys_array[$r] = array_merge($this->import_updatekeys_array[$r], array(
'p.barcode'=>
'BarCode'));
623 if (!empty($conf->fournisseur->enabled))
627 $this->import_code[$r] = $this->rights_class.
'_supplierprices';
628 $this->import_label[$r] =
"SuppliersPricesOfProductsOrServices";
629 $this->import_icon[$r] = $this->picto;
630 $this->import_entities_array[$r] = array();
631 $this->import_tables_array[$r] = array(
'sp'=>MAIN_DB_PREFIX.
'product_fournisseur_price',
'extra'=>MAIN_DB_PREFIX.
'product_fournisseur_price_extrafields');
632 $this->import_tables_creator_array[$r] = array(
'sp'=>
'fk_user');
633 $this->import_fields_array[$r] = array(
634 'sp.fk_product'=>
"ProductOrService*",
635 'sp.fk_soc' =>
"Supplier*",
636 'sp.ref_fourn' =>
'SupplierRef*',
637 'sp.quantity' =>
"QtyMin*",
638 'sp.tva_tx' =>
'VATRate',
639 'sp.default_vat_code' =>
'VATCode',
640 'sp.delivery_time_days' =>
'DeliveryDelay',
641 'sp.supplier_reputation' =>
'SupplierReputation'
643 if (is_object($mysoc) && $usenpr) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'sp.recuperableonly'=>
'VATNPR'));
644 if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'sp.localtax1_tx'=>
'LT1',
'sp.localtax1_type'=>
'LT1Type'));
645 if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'sp.localtax2_tx'=>
'LT2',
'sp.localtax2_type'=>
'LT2Type'));
646 $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
647 'sp.price'=>
"PriceQtyMinHT*",
648 'sp.unitprice'=>
'UnitPriceHT*',
649 'sp.remise_percent'=>
'DiscountQtyMin'
652 if (!empty($conf->multicurrency->enabled))
654 $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
655 'sp.fk_multicurrency'=>
'CurrencyCodeId',
656 'sp.multicurrency_code'=>
'CurrencyCode',
657 'sp.multicurrency_tx'=>
'CurrencyRate',
658 'sp.multicurrency_unitprice'=>
'CurrencyUnitPrice',
659 'sp.multicurrency_price'=>
'CurrencyPrice',
663 if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
664 $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'sp.packaging' =>
'PackagingForThisProduct'));
668 $import_extrafield_sample = array();
669 $sql =
"SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX.
"extrafields WHERE elementtype = 'product_fournisseur_price' AND entity IN (0, ".$conf->entity.
")";
673 while ($obj = $this->
db->fetch_object(
$resql))
675 $fieldname =
'extra.'.$obj->name;
676 $fieldlabel = ucfirst($obj->label);
677 $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ?
'*' :
'');
678 $import_extrafield_sample[$fieldname] = $fieldlabel;
682 $this->import_fieldshidden_array[$r] = array(
'extra.fk_object'=>
'lastrowid-'.MAIN_DB_PREFIX.
'product_fournisseur_price');
684 $this->import_convertvalue_array[$r] = array(
685 'sp.fk_soc'=>array(
'rule'=>
'fetchidfromref',
'classfile'=>
'/societe/class/societe.class.php',
'class'=>
'Societe',
'method'=>
'fetch',
'element'=>
'ThirdParty'),
686 'sp.fk_product'=>array(
'rule'=>
'fetchidfromref',
'classfile'=>
'/product/class/product.class.php',
'class'=>
'Product',
'method'=>
'fetch',
'element'=>
'Product')
689 $this->import_examplevalues_array[$r] = array(
690 'sp.fk_product' =>
"ref:PRODUCT_REF or id:123456",
691 'sp.fk_soc' =>
"My Supplier",
692 'sp.ref_fourn' =>
"XYZ-F123456",
693 'sp.quantity' =>
"5",
696 'sp.unitprice'=>
'50',
697 'sp.remise_percent'=>
'0',
698 'sp.default_vat_code' =>
'',
699 'sp.delivery_time_days' =>
'5',
700 'sp.supplier_reputation' =>
'FAVORITE / NOTTHGOOD / DONOTORDER'
702 if (is_object($mysoc) && $usenpr) $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
'sp.recuperableonly'=>
''));
703 if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
'sp.localtax1_tx'=>
'LT1',
'sp.localtax1_type'=>
'LT1Type'));
704 if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
'sp.localtax2_tx'=>
'LT2',
'sp.localtax2_type'=>
'LT2Type'));
705 $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
706 'sp.price' =>
"50.00",
707 'sp.unitprice' =>
'10',
709 'sp.remise_percent' =>
'20'
711 if (!empty($conf->multicurrency->enabled))
713 $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
714 'sp.fk_multicurrency'=>
'eg: 2, rowid for code of multicurrency currency',
715 'sp.multicurrency_code'=>
'GBP',
716 'sp.multicurrency_tx'=>
'1.12345',
717 'sp.multicurrency_unitprice'=>
'',
719 'sp.multicurrency_price'=>
''
722 if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
723 $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
724 'sp.packagning'=>
'1',
728 $this->import_updatekeys_array[$r] = array(
'sp.fk_product'=>
'ProductOrService',
'sp.ref_fourn'=>
'SupplierRef',
'sp.fk_soc'=>
'Supplier');
731 if (!empty($conf->global->PRODUIT_MULTIPRICES))
735 $this->import_code[$r] = $this->rights_class.
'_multiprice';
736 $this->import_label[$r] =
"ProductsOrServiceMultiPrice";
737 $this->import_icon[$r] = $this->picto;
738 $this->import_entities_array[$r] = array();
739 $this->import_tables_array[$r] = array(
'pr'=>MAIN_DB_PREFIX.
'product_price');
740 $this->import_tables_creator_array[$r] = array(
'pr'=>
'fk_user_author');
741 $this->import_fields_array[$r] = array(
'pr.fk_product'=>
"ProductOrService*",
742 'pr.price_base_type'=>
"PriceBase",
'pr.price_level'=>
"PriceLevel",
743 'pr.price'=>
"PriceLevelUnitPriceHT",
'pr.price_ttc'=>
"PriceLevelUnitPriceTTC",
744 'pr.price_min'=>
"MinPriceLevelUnitPriceHT",
'pr.price_min_ttc'=>
"MinPriceLevelUnitPriceTTC",
745 'pr.date_price'=>
'DateCreation*');
746 if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) $this->import_fields_array[$r][
'pr.tva_tx'] =
'VATRate';
747 if (is_object($mysoc) && $usenpr) $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'pr.recuperableonly'=>
'NPR'));
748 $this->import_regex_array[$r] = array(
'pr.datec'=>
'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$',
'pr.recuperableonly'=>
'^[0|1]$');
749 $this->import_convertvalue_array[$r] = array(
750 'pr.fk_product'=>array(
'rule'=>
'fetchidfromref',
'classfile'=>
'/product/class/product.class.php',
'class'=>
'Product',
'method'=>
'fetch',
'element'=>
'Product')
752 $this->import_examplevalues_array[$r] = array(
'pr.fk_product'=>
"ref:PRODUCT_REF or id:123456",
753 'pr.price_base_type'=>
"HT (for excl tax) or TTC (for inc tax)",
'pr.price_level'=>
"1",
754 'pr.price'=>
"100",
'pr.price_ttc'=>
"110",
755 'pr.price_min'=>
"100",
'pr.price_min_ttc'=>
"110",
757 'pr.recuperableonly'=>
'0',
758 'pr.date_price'=>
'2020-12-31');
761 if (!empty($conf->global->MAIN_MULTILANGS))
765 $this->import_code[$r] = $this->rights_class.
'_languages';
766 $this->import_label[$r] =
"ProductsOrServicesTranslations";
767 $this->import_icon[$r] = $this->picto;
768 $this->import_entities_array[$r] = array();
769 $this->import_tables_array[$r] = array(
'l'=>MAIN_DB_PREFIX.
'product_lang');
771 $this->import_fields_array[$r] = array(
'l.fk_product'=>
'ProductOrService*',
'l.lang'=>
'Language*',
'l.label'=>
'TranslatedLabel',
'l.description'=>
'TranslatedDescription');
773 $this->import_convertvalue_array[$r] = array(
774 'l.fk_product'=>array(
'rule'=>
'fetchidfromref',
'classfile'=>
'/product/class/product.class.php',
'class'=>
'Product',
'method'=>
'fetch',
'element'=>
'Product')
776 $this->import_examplevalues_array[$r] = array(
'l.fk_product'=>
'PRODUCT_REF or id:123456',
'l.lang'=>
'en_US',
'l.label'=>
'Label in en_US',
'l.description'=>
'Desc in en_US');
777 $this->import_updatekeys_array[$r] = array(
'l.fk_product'=>
'ProductOrService',
'l.lang'=>
'Language');
790 public function init($options =
'')
792 $this->
remove($options);
796 return $this->
_init($sql, $options);
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
dol_now($mode= 'auto')
Return date for now.
init($options= '')
Function called when module is enabled.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
Class descriptor of Product module.
__construct($db)
Constructor.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
_init($array_sql, $options= '')
Enables a module.
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.