Fix look and feel v10
This commit is contained in:
parent
e3d50c533c
commit
e60131e3ee
@ -214,7 +214,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border tableforfield" width="100%">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
// Nature
|
// Nature
|
||||||
if ($object->type!=Product::TYPE_SERVICE)
|
if ($object->type!=Product::TYPE_SERVICE)
|
||||||
@ -268,236 +268,223 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$nbofsubproducts=count($prodschild); // This include only first level of childs
|
$nbofsubproducts=count($prodschild); // This include only first level of childs
|
||||||
|
|
||||||
|
|
||||||
// Number of parent virtual products
|
print '<div class="fichecenter">';
|
||||||
//print $form->textwithpicto($langs->trans("ParentProductsNumber").': '.count($prodsfather), $langs->trans('IfZeroItIsNotUsedByVirtualProduct'));
|
|
||||||
|
|
||||||
//if (count($prodsfather) > 0)
|
print load_fiche_titre($langs->trans("ProductParentList"), '', '');
|
||||||
//{
|
|
||||||
print load_fiche_titre($langs->trans("ProductParentList"), '', '');
|
print '<table class="liste">';
|
||||||
print '<table class="centpercent noborder">';
|
print '<tr class="liste_titre">';
|
||||||
print '<tr class="liste_titre">';
|
print '<td>'.$langs->trans('ParentProducts').'</td>';
|
||||||
print '<td>'.$langs->trans('ParentProducts').'</td>';
|
print '<td>'.$langs->trans('Label').'</td>';
|
||||||
print '<td>'.$langs->trans('Label').'</td>';
|
print '<td>'.$langs->trans('Qty').'</td>';
|
||||||
print '<td>'.$langs->trans('Qty').'</td>';
|
print '</td>';
|
||||||
print '</td>';
|
if (count($prodsfather) > 0)
|
||||||
if (count($prodsfather) > 0)
|
{
|
||||||
|
foreach($prodsfather as $value)
|
||||||
{
|
{
|
||||||
$class='pair';
|
$idprod= $value["id"];
|
||||||
|
$productstatic->id=$idprod;// $value["id"];
|
||||||
|
$productstatic->type=$value["fk_product_type"];
|
||||||
|
$productstatic->ref=$value['ref'];
|
||||||
|
$productstatic->label=$value['label'];
|
||||||
|
$productstatic->entity=$value['entity'];
|
||||||
|
|
||||||
foreach($prodsfather as $value)
|
print '<tr class="oddeven">';
|
||||||
{
|
print '<td>'.$productstatic->getNomUrl(1, 'composition').'</td>';
|
||||||
$idprod= $value["id"];
|
print '<td>'.$productstatic->label.'</td>';
|
||||||
$productstatic->id=$idprod;// $value["id"];
|
print '<td>'.$value['qty'].'</td>';
|
||||||
$productstatic->type=$value["fk_product_type"];
|
|
||||||
$productstatic->ref=$value['ref'];
|
|
||||||
$productstatic->label=$value['label'];
|
|
||||||
$productstatic->entity=$value['entity'];
|
|
||||||
|
|
||||||
$class=($class=='impair')?'pair':'impair';
|
|
||||||
print '<tr class="'.$class.'">';
|
|
||||||
|
|
||||||
print '<td>'.$productstatic->getNomUrl(1, 'composition').'</td>';
|
|
||||||
print '<td>'.$productstatic->label.'</td>';
|
|
||||||
print '<td>'.$value['qty'].'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<tr class="impair">';
|
|
||||||
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
}
|
||||||
//}
|
else
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
|
|
||||||
// Number of subproducts
|
print '<div class="fichecenter">';
|
||||||
//print $form->textwithpicto($langs->trans("AssociatedProductsNumber").': '.(empty($conf->global->PRODUCT_SHOW_SUB_SUB_PRODUCTS)?$nbofsubproducts:$nbofsubsubproducts), $langs->trans('IfZeroItIsNotAVirtualProduct'));
|
|
||||||
|
|
||||||
// List of subproducts
|
$atleastonenotdefined=0;
|
||||||
//if (count($prods_arbo) > 0)
|
print load_fiche_titre($langs->trans("ProductAssociationList"), '', '');
|
||||||
//{
|
|
||||||
$atleastonenotdefined=0;
|
|
||||||
print load_fiche_titre($langs->trans("ProductAssociationList"), '', '');
|
|
||||||
|
|
||||||
print '<form name="formComposedProduct" action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
print '<form name="formComposedProduct" action="'.$_SERVER['PHP_SELF'].'" method="post">';
|
||||||
print '<input type="hidden" name="action" value="save_composed_product" />';
|
print '<input type="hidden" name="action" value="save_composed_product" />';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'" />';
|
print '<input type="hidden" name="id" value="'.$id.'" />';
|
||||||
|
|
||||||
print '<table class="centpercent noborder">';
|
print '<table class="liste">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans('ComposedProduct').'</td>';
|
print '<td>'.$langs->trans('ComposedProduct').'</td>';
|
||||||
print '<td>'.$langs->trans('Label').'</td>';
|
print '<td>'.$langs->trans('Label').'</td>';
|
||||||
print '<td class="right" colspan="2">'.$langs->trans('MinSupplierPrice').'</td>';
|
print '<td class="right" colspan="2">'.$langs->trans('MinSupplierPrice').'</td>';
|
||||||
print '<td class="right" colspan="2">'.$langs->trans('MinCustomerPrice').'</td>';
|
print '<td class="right" colspan="2">'.$langs->trans('MinCustomerPrice').'</td>';
|
||||||
if (! empty($conf->stock->enabled)) print '<td class="right">'.$langs->trans('Stock').'</td>';
|
if (! empty($conf->stock->enabled)) print '<td class="right">'.$langs->trans('Stock').'</td>';
|
||||||
print '<td class="center">'.$langs->trans('Qty').'</td>';
|
print '<td class="center">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td class="center">'.$langs->trans('ComposedProductIncDecStock').'</td>';
|
print '<td class="center">'.$langs->trans('ComposedProductIncDecStock').'</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\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 '<tr class="oddeven">';
|
||||||
|
|
||||||
if ($value['level'] <= 1)
|
$notdefined=0;
|
||||||
|
$nb_of_subproduct = $value['nb'];
|
||||||
|
|
||||||
|
print '<td>'.$productstatic->getNomUrl(1, 'composition').'</td>';
|
||||||
|
print '<td>'.$productstatic->label.'</td>';
|
||||||
|
|
||||||
|
// Best buying price
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0)
|
||||||
{
|
{
|
||||||
$class=($class=='impair')?'pair':'impair';
|
print $langs->trans("BuyingPriceMinShort").': ';
|
||||||
print '<tr class="'.$class.'">';
|
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 '</td>';
|
||||||
|
|
||||||
$notdefined=0;
|
// For avoid a non-numeric value
|
||||||
$nb_of_subproduct = $value['nb'];
|
$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 '<td>'.$productstatic->getNomUrl(1, 'composition').'</td>';
|
$totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT');
|
||||||
print '<td>'.$productstatic->label.'</td>';
|
$total+=$totalline;
|
||||||
|
|
||||||
// Best buying price
|
print '<td class="right">';
|
||||||
print '<td class="right">';
|
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice, '', '', 0, 0, -1, $conf->currency));
|
||||||
if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0)
|
print '</td>';
|
||||||
{
|
|
||||||
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 '</td>';
|
|
||||||
|
|
||||||
// For avoid a non-numeric value
|
// Best selling price
|
||||||
$fourn_unitprice = (!empty($product_fourn->fourn_unitprice)?$product_fourn->fourn_unitprice:0);
|
$pricesell=$productstatic->price;
|
||||||
$fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0);
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
$fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0);
|
{
|
||||||
|
$pricesell='Variable';
|
||||||
$totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT');
|
|
||||||
$total+=$totalline;
|
|
||||||
|
|
||||||
print '<td class="right">';
|
|
||||||
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice, '', '', 0, 0, -1, $conf->currency));
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Best selling price
|
|
||||||
$pricesell=$productstatic->price;
|
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
|
||||||
{
|
|
||||||
$pricesell='Variable';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$totallinesell=price2num($value['nb'] * ($pricesell), 'MT');
|
|
||||||
$totalsell+=$totallinesell;
|
|
||||||
}
|
|
||||||
print '<td class="right" colspan="2">';
|
|
||||||
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 '</td>';
|
|
||||||
|
|
||||||
// Stock
|
|
||||||
if (! empty($conf->stock->enabled)) print '<td class="right">'.$value['stock'].'</td>'; // Real stock
|
|
||||||
|
|
||||||
// Qty + IncDec
|
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
|
||||||
{
|
|
||||||
print '<td class="center"><input type="text" value="'.$nb_of_subproduct.'" name="TProduct['.$productstatic->id.'][qty]" size="4" /></td>';
|
|
||||||
print '<td class="center"><input type="checkbox" name="TProduct['.$productstatic->id.'][incdec]" value="1" '.($value['incdec']==1?'checked':'' ).' /></td>';
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
print '<td>'.$nb_of_subproduct.'</td>';
|
|
||||||
print '<td>'.($value['incdec']==1?'x':'' ).'</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</tr>'."\n";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$hide='';
|
$totallinesell=price2num($value['nb'] * ($pricesell), 'MT');
|
||||||
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
|
$totalsell+=$totallinesell;
|
||||||
|
|
||||||
$class=($class=='impair')?'pair':'impair';
|
|
||||||
print '<tr class="'.$class.$hide.'" id="sub-'.$value['id_parent'].'">';
|
|
||||||
|
|
||||||
//$productstatic->ref=$value['label'];
|
|
||||||
$productstatic->ref=$value['ref'];
|
|
||||||
print '<td>';
|
|
||||||
for ($i=0; $i < $value['level']; $i++) print ' '; // Add indentation
|
|
||||||
print $productstatic->getNomUrl(1, 'composition').'</td>';
|
|
||||||
print '<td>'.$productstatic->label.'</td>';
|
|
||||||
|
|
||||||
// Best buying price
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
// Best selling price
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
|
|
||||||
if (! empty($conf->stock->enabled)) print '<td></td>'; // Real stock
|
|
||||||
print '<td class="center">'.$value['nb'].'</td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
|
|
||||||
print '</tr>'."\n";
|
|
||||||
}
|
}
|
||||||
|
print '<td class="right" colspan="2">';
|
||||||
|
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 '</td>';
|
||||||
|
|
||||||
|
// Stock
|
||||||
|
if (! empty($conf->stock->enabled)) print '<td class="right">'.$value['stock'].'</td>'; // Real stock
|
||||||
|
|
||||||
|
// Qty + IncDec
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||||
|
{
|
||||||
|
print '<td class="center"><input type="text" value="'.$nb_of_subproduct.'" name="TProduct['.$productstatic->id.'][qty]" size="4" /></td>';
|
||||||
|
print '<td class="center"><input type="checkbox" name="TProduct['.$productstatic->id.'][incdec]" value="1" '.($value['incdec']==1?'checked':'' ).' /></td>';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
print '<td>'.$nb_of_subproduct.'</td>';
|
||||||
|
print '<td>'.($value['incdec']==1?'x':'' ).'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
print '<tr class="liste_total">';
|
|
||||||
print '<td class="liste_total"></td>';
|
|
||||||
print '<td class="liste_total"></td>';
|
|
||||||
|
|
||||||
// Minimum buying price
|
|
||||||
print '<td class="liste_total right">';
|
|
||||||
print $langs->trans("TotalBuyingPriceMinShort");
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '<td class="liste_total right">';
|
|
||||||
if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
|
|
||||||
print ($atleastonenotdefined?'':price($total, '', '', 0, 0, -1, $conf->currency));
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Minimum selling price
|
|
||||||
print '<td class="liste_total right">';
|
|
||||||
print $langs->trans("TotalSellingPriceMinShort");
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '<td class="liste_total right">';
|
|
||||||
if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
|
|
||||||
print ($atleastonenotdefined?'':price($totalsell, '', '', 0, 0, -1, $conf->currency));
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Stock
|
|
||||||
if (! empty($conf->stock->enabled)) print '<td class="liste_total right"> </td>';
|
|
||||||
|
|
||||||
print '<td class="right" colspan="2">';
|
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
|
||||||
{
|
{
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Save').'">';
|
$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 '<tr class="oddeven'.$hide.'" id="sub-'.$value['id_parent'].'">';
|
||||||
|
|
||||||
|
//$productstatic->ref=$value['label'];
|
||||||
|
$productstatic->ref=$value['ref'];
|
||||||
|
print '<td>';
|
||||||
|
for ($i=0; $i < $value['level']; $i++) print ' '; // Add indentation
|
||||||
|
print $productstatic->getNomUrl(1, 'composition').'</td>';
|
||||||
|
print '<td>'.$productstatic->label.'</td>';
|
||||||
|
|
||||||
|
// Best buying price
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
// Best selling price
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
|
||||||
|
if (! empty($conf->stock->enabled)) print '<td></td>'; // Real stock
|
||||||
|
print '<td class="center">'.$value['nb'].'</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
|
||||||
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
print '</td>';
|
|
||||||
print '</tr>'."\n";
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td class="liste_total"></td>';
|
||||||
|
print '<td class="liste_total"></td>';
|
||||||
|
|
||||||
|
// Minimum buying price
|
||||||
|
print '<td class="liste_total right">';
|
||||||
|
print $langs->trans("TotalBuyingPriceMinShort");
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="liste_total right">';
|
||||||
|
if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
|
||||||
|
print ($atleastonenotdefined?'':price($total, '', '', 0, 0, -1, $conf->currency));
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Minimum selling price
|
||||||
|
print '<td class="liste_total right">';
|
||||||
|
print $langs->trans("TotalSellingPriceMinShort");
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="liste_total right">';
|
||||||
|
if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')';
|
||||||
|
print ($atleastonenotdefined?'':price($totalsell, '', '', 0, 0, -1, $conf->currency));
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Stock
|
||||||
|
if (! empty($conf->stock->enabled)) print '<td class="liste_total right"> </td>';
|
||||||
|
|
||||||
|
print '<td class="right" colspan="2">';
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||||
{
|
{
|
||||||
$colspan=8;
|
|
||||||
if (! empty($conf->stock->enabled)) $colspan++;
|
|
||||||
|
|
||||||
print '<tr class="impair">';
|
|
||||||
print '<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
/*if($user->rights->produit->creer || $user->rights->service->creer) {
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Save').'">';
|
print '<input type="submit" class="button" value="'.$langs->trans('Save').'">';
|
||||||
}*/
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$colspan=8;
|
||||||
|
if (! empty($conf->stock->enabled)) $colspan++;
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
/*if($user->rights->produit->creer || $user->rights->service->creer) {
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans('Save').'">';
|
||||||
|
}*/
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
//}
|
|
||||||
|
|
||||||
// Form with product to add
|
// Form with product to add
|
||||||
if ((empty($action) || $action == 'view' || $action == 'edit' || $action == 'search' || $action == 're-edit') && ($user->rights->produit->creer || $user->rights->service->creer))
|
if ((empty($action) || $action == 'view' || $action == 'edit' || $action == 'search' || $action == 're-edit') && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user