';
- print '';
- print ''.$langs->trans('ComposedProduct').' ';
- print ''.$langs->trans('Label').' ';
- print ''.$langs->trans('MinSupplierPrice').' ';
- print ''.$langs->trans('MinCustomerPrice').' ';
- if (! empty($conf->stock->enabled)) print ''.$langs->trans('Stock').' ';
- print ''.$langs->trans('Qty').' ';
- print ''.$langs->trans('ComposedProductIncDecStock').' ';
- print ' '."\n";
+ print '';
+ print ''.$langs->trans('ComposedProduct').' ';
+ print ''.$langs->trans('Label').' ';
+ print ''.$langs->trans('MinSupplierPrice').' ';
+ print ''.$langs->trans('MinCustomerPrice').' ';
+ if (! empty($conf->stock->enabled)) print ''.$langs->trans('Stock').' ';
+ print ''.$langs->trans('Qty').' ';
+ print ''.$langs->trans('ComposedProductIncDecStock').' ';
+ print ' '."\n";
- $class='pair';
-
- $totalsell=0;
- if (count($prods_arbo))
+ $totalsell=0;
+ if (count($prods_arbo))
+ {
+ foreach($prods_arbo as $value)
{
- foreach($prods_arbo as $value)
+ $productstatic->fetch($value['id']);
+
+ if ($value['level'] <= 1)
{
- $productstatic->fetch($value['id']);
+ print '';
- if ($value['level'] <= 1)
+ $notdefined=0;
+ $nb_of_subproduct = $value['nb'];
+
+ print ''.$productstatic->getNomUrl(1, 'composition').' ';
+ print ''.$productstatic->label.' ';
+
+ // Best buying price
+ print '';
+ if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0)
{
- $class=($class=='impair')?'pair':'impair';
- print ' ';
+ print $langs->trans("BuyingPriceMinShort").': ';
+ if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(0, 0);
+ else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; }
+ }
+ print '';
- $notdefined=0;
- $nb_of_subproduct = $value['nb'];
+ // For avoid a non-numeric value
+ $fourn_unitprice = (!empty($product_fourn->fourn_unitprice)?$product_fourn->fourn_unitprice:0);
+ $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0);
+ $fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0);
- print ''.$productstatic->getNomUrl(1, 'composition').' ';
- print ''.$productstatic->label.' ';
+ $totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT');
+ $total+=$totalline;
- // Best buying price
- print '';
- if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0)
- {
- print $langs->trans("BuyingPriceMinShort").': ';
- if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(0, 0);
- else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; }
- }
- print ' ';
+ print '';
+ print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice, '', '', 0, 0, -1, $conf->currency));
+ print ' ';
- // For avoid a non-numeric value
- $fourn_unitprice = (!empty($product_fourn->fourn_unitprice)?$product_fourn->fourn_unitprice:0);
- $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0);
- $fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0);
-
- $totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT');
- $total+=$totalline;
-
- print '';
- print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice, '', '', 0, 0, -1, $conf->currency));
- print ' ';
-
- // Best selling price
- $pricesell=$productstatic->price;
- if (! empty($conf->global->PRODUIT_MULTIPRICES))
- {
- $pricesell='Variable';
- }
- else
- {
- $totallinesell=price2num($value['nb'] * ($pricesell), 'MT');
- $totalsell+=$totallinesell;
- }
- print '';
- print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : ''));
- if (is_numeric($pricesell)) print price($pricesell, '', '', 0, 0, -1, $conf->currency);
- else print $langs->trans($pricesell);
- print ' ';
-
- // Stock
- if (! empty($conf->stock->enabled)) print ''.$value['stock'].' '; // Real stock
-
- // Qty + IncDec
- if ($user->rights->produit->creer || $user->rights->service->creer)
- {
- print ' ';
- print ' ';
- }
- else{
- print ''.$nb_of_subproduct.' ';
- print ''.($value['incdec']==1?'x':'' ).' ';
- }
-
- print ' '."\n";
+ // Best selling price
+ $pricesell=$productstatic->price;
+ if (! empty($conf->global->PRODUIT_MULTIPRICES))
+ {
+ $pricesell='Variable';
}
else
{
- $hide='';
- if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide=' hideobject'; // By default, we do not show this. It makes screen very difficult to understand
-
- $class=($class=='impair')?'pair':'impair';
- print '';
-
- //$productstatic->ref=$value['label'];
- $productstatic->ref=$value['ref'];
- print '';
- for ($i=0; $i < $value['level']; $i++) print ' '; // Add indentation
- print $productstatic->getNomUrl(1, 'composition').' ';
- print ''.$productstatic->label.' ';
-
- // Best buying price
- print ' ';
- print ' ';
- // Best selling price
- print ' ';
- print ' ';
-
- if (! empty($conf->stock->enabled)) print ' '; // Real stock
- print ''.$value['nb'].' ';
- print ' ';
-
- print ' '."\n";
+ $totallinesell=price2num($value['nb'] * ($pricesell), 'MT');
+ $totalsell+=$totallinesell;
}
+ print '';
+ print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : ''));
+ if (is_numeric($pricesell)) print price($pricesell, '', '', 0, 0, -1, $conf->currency);
+ else print $langs->trans($pricesell);
+ print ' ';
+
+ // Stock
+ if (! empty($conf->stock->enabled)) print ''.$value['stock'].' '; // Real stock
+
+ // Qty + IncDec
+ if ($user->rights->produit->creer || $user->rights->service->creer)
+ {
+ print ' ';
+ print ' ';
+ }
+ else{
+ print ''.$nb_of_subproduct.' ';
+ print ''.($value['incdec']==1?'x':'' ).' ';
+ }
+
+ print ''."\n";
}
-
- print '';
- print ' ';
- print ' ';
-
- // Minimum buying price
- print '';
- print $langs->trans("TotalBuyingPriceMinShort");
- print ' ';
-
- print '';
- if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
- print ($atleastonenotdefined?'':price($total, '', '', 0, 0, -1, $conf->currency));
- print ' ';
-
- // Minimum selling price
- print '';
- print $langs->trans("TotalSellingPriceMinShort");
- print ' ';
-
- print '';
- if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
- print ($atleastonenotdefined?'':price($totalsell, '', '', 0, 0, -1, $conf->currency));
- print ' ';
-
- // Stock
- if (! empty($conf->stock->enabled)) print ' ';
-
- print '';
- if ($user->rights->produit->creer || $user->rights->service->creer)
+ else
{
- print ' ';
+ $hide='';
+ if (empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)) $hide=' hideobject'; // By default, we do not show this. It makes screen very difficult to understand
+
+ print ' ';
+
+ //$productstatic->ref=$value['label'];
+ $productstatic->ref=$value['ref'];
+ print '';
+ for ($i=0; $i < $value['level']; $i++) print ' '; // Add indentation
+ print $productstatic->getNomUrl(1, 'composition').' ';
+ print ''.$productstatic->label.' ';
+
+ // Best buying price
+ print ' ';
+ print ' ';
+ // Best selling price
+ print ' ';
+ print ' ';
+
+ if (! empty($conf->stock->enabled)) print ' '; // Real stock
+ print ''.$value['nb'].' ';
+ print ' ';
+
+ print ' '."\n";
}
- print '';
- print ''."\n";
}
- else
+
+ print '';
+ print ' ';
+ print ' ';
+
+ // Minimum buying price
+ print '';
+ print $langs->trans("TotalBuyingPriceMinShort");
+ print ' ';
+
+ print '';
+ if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
+ print ($atleastonenotdefined?'':price($total, '', '', 0, 0, -1, $conf->currency));
+ print ' ';
+
+ // Minimum selling price
+ print '';
+ print $langs->trans("TotalSellingPriceMinShort");
+ print ' ';
+
+ print '';
+ if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
+ print ($atleastonenotdefined?'':price($totalsell, '', '', 0, 0, -1, $conf->currency));
+ print ' ';
+
+ // Stock
+ if (! empty($conf->stock->enabled)) print ' ';
+
+ print '';
+ if ($user->rights->produit->creer || $user->rights->service->creer)
{
- $colspan=8;
- if (! empty($conf->stock->enabled)) $colspan++;
-
- print ' ';
- print ''.$langs->trans("None").' ';
- print ' ';
- }
-
- print '
';
-
- /*if($user->rights->produit->creer || $user->rights->service->creer) {
print '