Enable option to swith vat calculation mode

This commit is contained in:
Laurent Destailleur 2013-11-06 17:45:55 +01:00
parent 4a29431b69
commit 4c4064d7b9

View File

@ -1688,18 +1688,15 @@ else
print '<tr><td>'.$langs->trans('AmountHT').'</td><td align="right">'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">';
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
{
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
if ($calculationrule == 'totalofround') $calculationrulenum=1;
else $calculationrulenum=2;
$s=$langs->trans("ReCalculate").' ';
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
$s.=' / ';
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help'));
}
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
if ($calculationrule == 'totalofround') $calculationrulenum=1;
else $calculationrulenum=2;
$s=$langs->trans("ReCalculate").' ';
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
$s.=' / ';
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help'));
print '</td></tr>';
// Amount Local Taxes