Skip to content

Commit

Permalink
NEW [ task #3768 ] Improve product multiprices view
Browse files Browse the repository at this point in the history
Close #3768
  • Loading branch information
marcosgdf committed Oct 18, 2015
1 parent 1f05cb8 commit 12de2d5
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions htdocs/product/price.php
Expand Up @@ -9,6 +9,7 @@
* Copyright (C) 2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -378,13 +379,13 @@

// Ref
print '<tr>';
print '<td width="15%">' . $langs->trans("Ref") . '</td><td colspan="2">';
print '<td width="20%">' . $langs->trans("Ref") . '</td><td colspan="2">';
print $form->showrefnav($object, 'ref', '', 1, 'ref');
print '</td>';
print '</tr>';

// Label
print '<tr><td>' . $langs->trans("Label") . '</td><td>' . $object->label . '</td>';
print '<tr><td>' . $langs->trans("Label") . '</td><td colspan="2">' . $object->label . '</td>';

$isphoto = $object->is_photo_available($conf->product->multidir_output [$object->entity]);

Expand All @@ -409,8 +410,8 @@
$soc->fetch($socid);

// Selling price
print '<tr><td>' . $langs->trans("SellingPrice") . '</td>';
print '<td>';
print '<tr>' . $langs->trans("SellingPrice") . '</td>';
print '<td colspan="2">';
if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') {
print price($object->multiprices_ttc["$soc->price_level"]);
} else {
Expand All @@ -424,7 +425,7 @@
print '</td></tr>';

// Price min
print '<tr><td>' . $langs->trans("MinPrice") . '</td><td>';
print '<tr><td>' . $langs->trans("MinPrice") . '</td><td colspan="2">';
if ($object->multiprices_base_type["$soc->price_level"] == 'TTC')
{
print price($object->multiprices_min_ttc["$soc->price_level"]) . ' ' . $langs->trans($object->multiprices_base_type["$soc->price_level"]);
Expand All @@ -434,18 +435,16 @@
print '</td></tr>';

// TVA
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '</td></tr>';
print '<tr><td>' . $langs->trans("VATRate") . '</td><td colspan="2">' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '</td></tr>';
}
else
{
// We show only vat for level 1
print '<tr><td>' . $langs->trans("VATRate") . '</td><td colspan="2">' . vatrate($object->multiprices_tva_tx [1], true) . '</td></tr>';
print '<tr class="liste_titre"><td style="text-align: center">'.$langs->trans("PriceLevel").'</td><td style="text-align: center">'.$langs->trans("SellingPrice").'</td><td style="text-align: center">'.$langs->trans("MinPrice").'</td></tr>';

for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++)
{
// TVA
if ($i == 1) // We show only vat for level 1
{
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->multiprices_tva_tx [1], true) . '</td></tr>';
}

print '<tr>';

// Label of price
Expand All @@ -455,20 +454,19 @@
print '</td>';

if ($object->multiprices_base_type ["$i"] == 'TTC') {
print '<td>' . price($object->multiprices_ttc["$i"]);
print '<td style="text-align: right">' . price($object->multiprices_ttc["$i"]);
} else {
print '<td>' . price($object->multiprices["$i"]);
print '<td style="text-align: right">' . price($object->multiprices["$i"]);
}

if ($object->multiprices_base_type["$i"]) {
print ' ' . $langs->trans($object->multiprices_base_type ["$i"]);
print ' '.$langs->trans($object->multiprices_base_type ["$i"]).'</td>';;
} else {
print ' ' . $langs->trans($object->price_base_type);
print ' '.$langs->trans($object->price_base_type).'</td>';;
}
print '</td></tr>';

// Prix mini
print '<tr><td>' . $langs->trans("MinPrice") . ' ' . $i . '</td><td>';
// Prix min
print '<td style="text-align: right">';
if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT";
if ($object->multiprices_base_type["$i"] == 'TTC')
{
Expand Down Expand Up @@ -652,7 +650,7 @@
}

// Status (to sell)
print '<tr><td>' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')</td><td>';
print '<tr><td>' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')</td><td colspan="2">';
print $object->getLibStatut(2, 0);
print '</td></tr>';

Expand Down Expand Up @@ -702,7 +700,7 @@
print '</td></tr>';

// Price base
print '<tr><td width="15%">';
print '<tr><td width="20%">';
print $langs->trans('PriceBase');
print '</td>';
print '<td>';
Expand Down

0 comments on commit 12de2d5

Please sign in to comment.