Merge pull request #10912 from Tetras-Libre/VATGrouped
TakePOS tickets : Grouped VAT
This commit is contained in:
commit
24af5cfab5
@ -56,4 +56,5 @@ 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
|
||||||
AutoPrintTickets=Automatically print tickets
|
TicketVatGrouped=Group VAT by rate in tickets
|
||||||
|
AutoPrintTickets=Automatically print tickets
|
||||||
@ -49,4 +49,5 @@ 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
|
||||||
AutoPrintTickets=Imprimet les tickets automatiquement
|
TicketVatGrouped=Grouper la TVA par taux dans les tickets
|
||||||
|
AutoPrintTickets=Imprimet les tickets automatiquement
|
||||||
@ -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);
|
||||||
@ -154,6 +155,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';
|
||||||
@ -175,6 +177,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");
|
||||||
@ -233,7 +241,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3) AND s.status = 1', 1, 0, 0, array(), 0);
|
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1, 3) AND s.status = 1', 1, 0, 0, array(), 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -103,11 +103,32 @@ 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>
|
||||||
</table>
|
</table>
|
||||||
<div style="border-top-style: double;">
|
<div style="border-top-style: double;">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user