NEW: TakePOS Gift Receipt

This commit is contained in:
jove@bisquerra.com 2020-08-02 11:13:41 +02:00
parent ebe2e8ea04
commit 593c7242c4
4 changed files with 26 additions and 12 deletions

View File

@ -117,3 +117,5 @@ HideCategoryImages=Hide Category Images
HideProductImages=Hide Product Images HideProductImages=Hide Product Images
NumberOfLinesToShow=Number of lines of images to show NumberOfLinesToShow=Number of lines of images to show
DefineTablePlan=Define tables plan DefineTablePlan=Define tables plan
GiftReceiptButton=Gift receipt button
GiftReceipt=Gift receipt

View File

@ -365,6 +365,13 @@ print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_CONTROL_CASH_OPENING", array(), $conf->entity, 0, 0, 1, 0); print ajax_constantonoff("TAKEPOS_CONTROL_CASH_OPENING", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n"; print "</td></tr>\n";
// Gift receipt
print '<tr class="oddeven"><td>';
print $langs->trans('GiftReceiptButton');
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_GIFT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
// Numbering module // Numbering module
//print '<tr class="oddeven"><td>'; //print '<tr class="oddeven"><td>';
//print $langs->trans("BillsNumberingModule"); //print $langs->trans("BillsNumberingModule");

View File

@ -597,6 +597,9 @@ if ($action == "valid" || $action == "history")
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="DolibarrTakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button>'; $sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="DolibarrTakeposPrinting('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
} else { } else {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="Print('.$placeid.');">'.$langs->trans('PrintTicket').'</button>'; $sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="Print('.$placeid.');">'.$langs->trans('PrintTicket').'</button>';
if ($conf->global->TAKEPOS_GIFT_RECEIPT) {
$sectionwithinvoicelink .= ' <button id="buttonprint" type="button" onclick="Print('.$placeid.', 1);">'.$langs->trans('GiftReceipt').'</button><br>';
}
} }
if ($conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0) if ($conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0)
{ {
@ -700,8 +703,8 @@ function SendTicket(id)
$.colorbox({href:"send.php?facid="+id, width:"70%", height:"30%", transition:"none", iframe:"true", title:"<?php echo $langs->trans("SendTicket"); ?>"}); $.colorbox({href:"send.php?facid="+id, width:"70%", height:"30%", transition:"none", iframe:"true", title:"<?php echo $langs->trans("SendTicket"); ?>"});
} }
function Print(id){ function Print(id, gift){
$.colorbox({href:"receipt.php?facid="+id, width:"40%", height:"90%", transition:"none", iframe:"true", title:"<?php $.colorbox({href:"receipt.php?facid="+id+"&gift="+gift, width:"40%", height:"90%", transition:"none", iframe:"true", title:"<?php
echo $langs->trans("PrintTicket"); ?>"}); echo $langs->trans("PrintTicket"); ?>"});
} }

View File

@ -34,6 +34,8 @@ $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is
$facid = GETPOST('facid', 'int'); $facid = GETPOST('facid', 'int');
$gift = GETPOST('gift', 'int');
if (empty($user->rights->takepos->run)) { if (empty($user->rights->takepos->run)) {
accessforbidden(); accessforbidden();
} }
@ -125,8 +127,8 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)
<tr> <tr>
<th class="center"><?php print $langs->trans("Label"); ?></th> <th class="center"><?php print $langs->trans("Label"); ?></th>
<th class="right"><?php print $langs->trans("Qty"); ?></th> <th class="right"><?php print $langs->trans("Qty"); ?></th>
<th class="right"><?php print $langs->trans("Price"); ?></th> <th class="right"><?php if ($gift!=1) print $langs->trans("Price"); ?></th>
<th class="right"><?php print $langs->trans("TotalTTC"); ?></th> <th class="right"><?php if ($gift!=1) print $langs->trans("TotalTTC"); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -140,8 +142,8 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)
else echo $line->description; ?> else echo $line->description; ?>
</td> </td>
<td class="right"><?php echo $line->qty; ?></td> <td class="right"><?php echo $line->qty; ?></td>
<td class="right"><?php echo price(price2num($line->total_ttc / $line->qty, 'MT'), 1); ?></td> <td class="right"><?php if ($gift!=1) echo price(price2num($line->total_ttc / $line->qty, 'MT'), 1); ?></td>
<td class="right"><?php echo price($line->total_ttc, 1); ?></td> <td class="right"><?php if ($gift!=1) echo price($line->total_ttc, 1); ?></td>
</tr> </tr>
<?php <?php
} }
@ -151,8 +153,8 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)
<br> <br>
<table class="right"> <table class="right">
<tr> <tr>
<th class="right"><?php echo $langs->trans("TotalHT"); ?></th> <th class="right"><?php if ($gift!=1) 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 if ($gift!=1) echo price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
</tr> </tr>
<?php if ($conf->global->TAKEPOS_TICKET_VAT_GROUPPED) { <?php if ($conf->global->TAKEPOS_TICKET_VAT_GROUPPED) {
$vat_groups = array(); $vat_groups = array();
@ -166,18 +168,18 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)
foreach ($vat_groups as $key => $val) { foreach ($vat_groups as $key => $val) {
?> ?>
<tr> <tr>
<th align="right"><?php echo $langs->trans("VAT").' '.vatrate($key, 1); ?></th> <th align="right"><?php if ($gift!=1) echo $langs->trans("VAT").' '.vatrate($key, 1); ?></th>
<td align="right"><?php echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td> <td align="right"><?php if ($gift!=1) echo price($val, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
</tr> </tr>
<?php <?php
} }
} else { ?> } 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 if ($gift!=1) echo $langs->trans("TotalVAT").'</th><td class="right">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
<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 if ($gift!=1) 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;">