';
print '';
- print '| ' . $langs->trans("PriceByQuantityRange") . ' | ';
- print '' . $langs->trans("HT") . ' | ';
+ //print '' . $langs->trans("PriceByQuantityRange") . ' | ';
+ print '' . $langs->trans("Quantity") . ' | ';
+ print '' . $langs->trans("Price") . ' | ';
+ print ' | ';
print '' . $langs->trans("UnitPrice") . ' | ';
print '' . $langs->trans("Discount") . ' | ';
print ' | ';
print '
';
- foreach ($object->prices_by_qty_list [0] as $ii => $prices)
+ if ($action != 'edit_price_by_qty')
+ {
+ print '';
+ }
+ foreach ($object->prices_by_qty_list[0] as $ii => $prices)
{
if ($action == 'edit_price_by_qty' && $rowid == $prices['rowid'] && ($user->rights->produit->creer || $user->rights->service->creer))
{
print '';
@@ -1017,10 +1052,15 @@ else
print '';
print '| ' . $prices['quantity'] . ' | ';
print '' . price($prices['price']) . ' | ';
+ print '';
+ //print $object->price_base_type;
+ print $prices['price_base_type'];
+ print ' | ';
print '' . price($prices['unitprice']) . ' | ';
print '' . price($prices['remise_percent']) . ' % | ';
print '';
- if (($user->rights->produit->creer || $user->rights->service->creer)) {
+ if (($user->rights->produit->creer || $user->rights->service->creer))
+ {
print 'id . '&action=edit_price_by_qty&rowid=' . $prices["rowid"] . '">';
print img_edit() . '';
print 'id . '&action=delete_price_by_qty&rowid=' . $prices["rowid"] . '">';
@@ -1032,21 +1072,6 @@ else
print ' |
';
}
}
- if ($action != 'edit_price_by_qty') {
- print '';
- }
-
print '
';
} else {
print $langs->trans("No");
@@ -1071,7 +1096,8 @@ dol_fiche_end();
/* */
/* ************************************************************************** */
-if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $action == 'showlog_default_price' || $action == 'add_customer_price')
+if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $action == 'showlog_default_price' || $action == 'add_customer_price'
+ || $action == 'activate_price_by_qty' || $action == 'disable_price_by_qty')
{
print "\n" . '' . "\n";
@@ -1474,23 +1500,31 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_
print '
' . $langs->trans($type) . " | ";
}
- print '
' . $langs->trans($objp->price_base_type) . " | ";
+ print '
';
+ if (empty($objp->price_by_qty)) {
+ print $langs->trans($objp->price_base_type);
+ }
+ print " | ";
+
if (empty($conf->global->PRODUIT_MULTIPRICES))
{
print '
';
- $positiverates='';
- if (price2num($objp->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($objp->tva_tx);
- if (price2num($objp->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax1_tx);
- if (price2num($objp->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax2_tx);
- if (empty($positiverates)) $positiverates='0';
- echo vatrate($positiverates.($objp->default_vat_code?' ('.$objp->default_vat_code.')':''), '%', $objp->tva_npr);
- /*
- if ($objp->default_vat_code)
- {
- print vatrate($objp->tva_tx, true) . ' ('.$objp->default_vat_code.')';
+ if (empty($objp->price_by_qty)) {
+ $positiverates='';
+ if (price2num($objp->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($objp->tva_tx);
+ if (price2num($objp->localtax1_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax1_tx);
+ if (price2num($objp->localtax2_type)) $positiverates.=($positiverates?'/':'').price2num($objp->localtax2_tx);
+ if (empty($positiverates)) $positiverates='0';
+ echo vatrate($positiverates.($objp->default_vat_code?' ('.$objp->default_vat_code.')':''), '%', $objp->tva_npr);
+ /*
+ if ($objp->default_vat_code)
+ {
+ print vatrate($objp->tva_tx, true) . ' ('.$objp->default_vat_code.')';
+ }
+ else print vatrate($objp->tva_tx, true, $objp->recuperableonly);*/
}
- else print vatrate($objp->tva_tx, true, $objp->recuperableonly);*/
+
print " | ";
}
@@ -1506,16 +1540,32 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_
}
else
{
- print '
' . ($objp->price_base_type != 'TTC' ? price($objp->price) : ''). " | ";
- print '
' . ($objp->price_base_type == 'TTC' ? price($objp->price_ttc) : '') . " | ";
+ print '
';
+ if (empty($objp->price_by_qty)) {
+ print ($objp->price_base_type != 'TTC' ? price($objp->price) : '');
+ }
+ print " | ";
+ print '
';
+ if (empty($objp->price_by_qty)) {
+ print ($objp->price_base_type == 'TTC' ? price($objp->price_ttc) : '');
+ }
+ print " | ";
if (! empty($conf->dynamicprices->enabled)) { //Only if module is enabled
print '
| ';
}
}
- print '
' . ($objp->price_base_type != 'TTC' ? price($objp->price_min) : '') . ' | ';
+ print '
';
+ if (empty($objp->price_by_qty)) {
+ print ($objp->price_base_type != 'TTC' ? price($objp->price_min) : '');
+ }
+ print ' | ';
- print '
' . ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : '') . ' | ';
+ print '
';
+ if (empty($objp->price_by_qty)) {
+ print ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : '');
+ }
+ print ' | ';
// User
print '
' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $objp->login . ' | ';