';
// Date from
- print '| '.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour').' | ';
+ if (!empty($arrayfields['pfp.datec']['checked'])) {
+ print ''.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour').' | ';
+ }
// Supplier
- print ''.$productfourn->getSocNomUrl(1, 'supplier').' | ';
+ if (!empty($arrayfields['s.nom']['checked'])) {
+ print ''.$productfourn->getSocNomUrl(1, 'supplier').' | ';
+ }
// Supplier ref
if ($usercancreate) // change required right here
@@ -934,7 +979,7 @@ SCRIPT;
}
// Availability
- if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY))
+ if (!empty($arrayfields['pfp.fk_availability']['checked']))
{
$form->load_cache_availability();
$availability = $form->cache_availability[$productfourn->fk_availability]['label'];
@@ -942,16 +987,18 @@ SCRIPT;
}
// Quantity
- print '';
- print $productfourn->fourn_qty;
- // Units
- if ($conf->global->PRODUCT_USE_UNITS) {
- $unit = $object->getLabelOfUnit();
- if ($unit !== '') {
- print ' '.$langs->trans($unit);
- }
- }
- print ' | ';
+ if (!empty($arrayfields['pfp.quantity']['checked'])) {
+ print '';
+ print $productfourn->fourn_qty;
+ // Units
+ if ($conf->global->PRODUCT_USE_UNITS) {
+ $unit = $object->getLabelOfUnit();
+ if ($unit !== '') {
+ print ' '.$langs->trans($unit);
+ }
+ }
+ print ' | ';
+ }
// VAT rate
print '';
@@ -971,18 +1018,21 @@ SCRIPT;
}
// Unit price
- print ' | ';
- print price($productfourn->fourn_unitprice);
- //print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):" ");
- print ' | ';
+ if (!empty($arrayfields['pfp.unitprice']['checked'])) {
+ print '';
+ print price($productfourn->fourn_unitprice);
+ //print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):" ");
+ print ' | ';
+ }
- if ($conf->multicurrency->enabled) {
- // Unit price in currency
+ // Unit price in currency
+ if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) {
print '';
print price($productfourn->fourn_multicurrency_unitprice);
- print ' | ';
+ print '';}
- // Currency
+ // Currency
+ if ($conf->multicurrency->enabled) {
print '';
print $productfourn->fourn_multicurrency_code ? currency_name($productfourn->fourn_multicurrency_code) : '';
print ' | ';
@@ -994,24 +1044,30 @@ SCRIPT;
print '';
// Delivery delay
- print '';
- print $productfourn->delivery_time_days;
- print ' | ';
+ if (!empty($arrayfields['pfp.delivery_time_days']['checked'])) {
+ print '';
+ print $productfourn->delivery_time_days;
+ print ' | ';
+ }
// Reputation
- print '';
- if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) {
- print $object->reputations[$productfourn->supplier_reputation];
+ if (!empty($arrayfields['pfp.supplier_reputation']['checked'])) {
+ print ' | ';
+ if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) {
+ print $object->reputations[$productfourn->supplier_reputation];
+ }
+ print' | ';
}
- print'';
- if ($conf->barcode->enabled) {
- // Barcode
+ // Barcode
+ if (!empty($arrayfields['pfp.barcode']['checked'])) {
print '';
print $productfourn->barcode;
- print ' | ';
+ print '';
+ }
- // Barcode type
+ // Barcode type
+ if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) {
print '';
$productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0;
$productfourn->fetch_barcode();
@@ -1020,17 +1076,18 @@ SCRIPT;
}
// Packaging
- if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
- {
+ if (!empty($arrayfields['pfp.packaging']['checked'])) {
print ' | ';
print price2num($productfourn->packaging);
print ' | ';
}
// Date
- print '';
- print dol_print_date(($productfourn->fourn_date_modification ? $productfourn->fourn_date_modification : $productfourn->date_modification), "dayhour");
- print ' | ';
+ if (!empty($arrayfields['pfp.tms']['checked'])) {
+ print '';
+ print dol_print_date(($productfourn->fourn_date_modification ? $productfourn->fourn_date_modification : $productfourn->date_modification), "dayhour");
+ print ' | ';
+ }
// Extrafields
if (!empty($extralabels)) {
@@ -1045,14 +1102,14 @@ SCRIPT;
if ($resql) {
if ($db->num_rows($resql) != 1) {
foreach ($extralabels as $key => $value) {
- if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
+ if (!empty($arrayfields['ef.'.$key]['checked']) && !empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
print " | ";
}
}
} else {
$obj = $db->fetch_object($resql);
foreach ($extralabels as $key => $value) {
- if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
+ if (!empty($arrayfields['ef.'.$key]['checked']) && !empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
print ''.$extrafields->showOutputField($key, $obj->{$key})." | ";
}
}
@@ -1087,6 +1144,7 @@ SCRIPT;
print '