Grouped VAT
Add an option to group VAT by rate in receipt
This commit is contained in:
parent
48a0c447b4
commit
4b61f0d606
@ -56,3 +56,4 @@ BillsCoinsPad=Bills and Coins Pad
|
|||||||
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
|
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
|
||||||
TakeposNeedsCategories=TakePOS needs product categories to work
|
TakeposNeedsCategories=TakePOS needs product categories to work
|
||||||
OrderNotes=Order Notes
|
OrderNotes=Order Notes
|
||||||
|
TicketVatGrouped=Group VAT by rate in tickets
|
||||||
|
|||||||
@ -49,3 +49,4 @@ AmountAtEndOfPeriod=Montant en fin de période (jour, mois ou année)
|
|||||||
TheoricalAmount=Montant théorique
|
TheoricalAmount=Montant théorique
|
||||||
RealAmount=Montant réel
|
RealAmount=Montant réel
|
||||||
CashFenceDone=Clôture de caisse faite pour la période
|
CashFenceDone=Clôture de caisse faite pour la période
|
||||||
|
TicketVatGrouped=Grouper la TVA par taux dans les tickets
|
||||||
|
|||||||
@ -61,6 +61,7 @@ if (GETPOST('action', 'alpha') == 'set')
|
|||||||
|
|
||||||
$res = dolibarr_set_const($db, "TAKEPOSCONNECTOR", GETPOST('TAKEPOSCONNECTOR', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOSCONNECTOR", GETPOST('TAKEPOSCONNECTOR', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
$res = dolibarr_set_const($db, "TAKEPOS_TICKET_VAT_GROUPPED", GETPOST('TAKEPOS_TICKET_VAT_GROUPPED', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
@ -146,6 +147,7 @@ if ($conf->global->TAKEPOSCONNECTOR){
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Bar Restaurant mode
|
// Bar Restaurant mode
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print 'Bar Restaurant';
|
print 'Bar Restaurant';
|
||||||
@ -167,6 +169,12 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOSCONNECTOR){
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $langs->trans('TicketVatGrouped');
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print $form->selectyesno("TAKEPOS_TICKET_VAT_GROUPPED", $conf->global->TAKEPOS_TICKET_VAT_GROUPPED, 1);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Payment numpad
|
// Payment numpad
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $langs->trans("Paymentnumpad");
|
print $langs->trans("Paymentnumpad");
|
||||||
|
|||||||
@ -103,9 +103,30 @@ print $object->ref;
|
|||||||
<th class="right"><?php echo $langs->trans("TotalHT");?></th>
|
<th class="right"><?php echo $langs->trans("TotalHT");?></th>
|
||||||
<td class="right"><?php echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
<td class="right"><?php echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php if($conf->global->TAKEPOS_TICKET_VAT_GROUPPED):?>
|
||||||
|
<?php
|
||||||
|
$vat_groups = array();
|
||||||
|
foreach ($object->lines as $line)
|
||||||
|
{
|
||||||
|
if(!array_key_exists($line->tva_tx, $vat_groups)){
|
||||||
|
$vat_groups[$line->tva_tx] = 0;
|
||||||
|
}
|
||||||
|
$vat_groups[$line->tva_tx] += $line->total_tva;
|
||||||
|
}
|
||||||
|
foreach($vat_groups as $key => $val){
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th align="right"><?php echo $langs->trans("VAT").' '.vatrate($key, 1);?></th>
|
||||||
|
<td align="right"><?php echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php else: ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="right"><?php echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
<th class="right"><?php echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php endif ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="right"><?php echo ''.$langs->trans("TotalTTC").'</th><td class="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
<th class="right"><?php echo ''.$langs->trans("TotalTTC").'</th><td class="right">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n";?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user