Add history to view and print previous sales.

This commit is contained in:
andreubisquerra 2019-04-28 18:12:33 +02:00
parent 3c90461502
commit 00db274956
4 changed files with 36 additions and 4 deletions

View File

@ -67,6 +67,11 @@ $confirm=GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'invoicelist';
if ($contextpage == 'poslist')
{
$_GET['optioncss'] = 'print';
}
$lineid=GETPOST('lineid', 'int');
$userid=GETPOST('userid', 'int');
$search_product_category=GETPOST('search_product_category', 'int');
@ -950,7 +955,12 @@ if ($resql)
$totalpay = $facturestatic->total_ttc - $remaintopay;
}
print '<tr class="oddeven">';
print '<tr class="oddeven"';
if ($contextpage == 'poslist')
{
print ' onclick="parent.$(\'#poslines\').load(\'invoice.php?action=history&placeid='.$obj->id.'\', function() {parent.$.colorbox.close();});"';
}
print '>';
if (! empty($arrayfields['f.ref']['checked']))
{
print '<td class="nowrap">';
@ -958,7 +968,14 @@ if ($resql)
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowraponall">';
print $facturestatic->getNomUrl(1, '', 200, 0, '', 0, 1);
if ($contextpage == 'poslist')
{
print $obj->ref;
}
else
{
print $facturestatic->getNomUrl(1, '', 200, 0, '', 0, 1);
}
print empty($obj->increment)?'':' ('.$obj->increment.')';
$filename=dol_sanitizeFileName($obj->ref);

View File

@ -61,4 +61,5 @@ NoPaimementModesDefined=No paiment mode defined in TakePOS configuration
TicketVatGrouped=Group VAT by rate in tickets
AutoPrintTickets=Automatically print tickets
EnableBarOrRestaurantFeatures=Enable features for Bar or Restaurant
ConfirmDeletionOfThisPOSSale=Do your confirm the deletion of this current sale ?
ConfirmDeletionOfThisPOSSale=Do your confirm the deletion of this current sale ?
History=History

View File

@ -171,6 +171,13 @@ if ($action == 'valid' && $user->rights->facture->creer)
}
}
if ($action == 'history')
{
$placeid = GETPOST('placeid', 'int');
$invoice = new Facture($db);
$invoice->fetch($placeid);
}
if (($action=="addline" || $action=="freezone") && $placeid == 0)
{
$invoice->socid = $conf->global->CASHDESK_ID_THIRDPARTY;
@ -336,7 +343,7 @@ if ($action == "order" and $placeid != 0)
}
$sectionwithinvoicelink='';
if ($action=="valid")
if ($action=="valid" || $action=="history")
{
$sectionwithinvoicelink.='<!-- Section with invoice link -->'."\n";
$sectionwithinvoicelink.='<input type="hidden" name="invoiceid" id="invoiceid" value="'.$invoice->id.'">';

View File

@ -352,6 +352,12 @@ function Customer() {
$.colorbox({href:"../societe/list.php?contextpage=poslist&nomassaction=1&place="+place, width:"90%", height:"80%", transition:"none", iframe:"true", title:"<?php echo $langs->trans("Customer");?>"});
}
function History()
{
console.log("Open box to select the history");
$.colorbox({href:"../compta/facture/list.php?contextpage=poslist", width:"90%", height:"80%", transition:"none", iframe:"true", title:"<?php echo $langs->trans("History");?>"});
}
function CloseBill() {
invoiceid = $("#invoiceid").val();
console.log("Open popup to enter payment on invoiceid="+invoiceid);
@ -607,6 +613,7 @@ else
}
$menus[$r++]=array('title'=>'<span class="far fa-building paddingrightonly"></span><div class="trunc">'.$langs->trans("Customer").'</div>', 'action'=>'Customer();');
$menus[$r++]=array('title'=>'<span class="fa fa-history paddingrightonly"></span><div class="trunc">'.$langs->trans("History").'</div>', 'action'=>'History();');
$menus[$r++]=array('title'=>'<span class="fa fa-cube paddingrightonly"></span><div class="trunc">'.$langs->trans("FreeZone").'</div>', 'action'=>'FreeZone();');
$menus[$r++]=array('title'=>'<span class="far fa-money-bill-alt paddingrightonly"></span><div class="trunc">'.$langs->trans("Payment").'</div>', 'action'=>'CloseBill();');