NEW Add line total on list of payments
This commit is contained in:
parent
8a6e28860b
commit
37b8796f3c
@ -26,7 +26,7 @@
|
||||
/**
|
||||
* \file htdocs/compta/paiement/list.php
|
||||
* \ingroup compta
|
||||
* \brief Page liste des paiements des factures clients
|
||||
* \brief Payment page for customer invoices
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@ -37,9 +37,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('bills', 'compta', 'companies'));
|
||||
$langs->loadLangs(array('bills', 'banks', 'compta', 'companies'));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
// Security check
|
||||
$facid = GETPOST('facid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$userid = GETPOST('userid', 'int');
|
||||
@ -47,6 +50,7 @@ $day = GETPOST('day', 'int');
|
||||
$month = GETPOST('month', 'int');
|
||||
$year = GETPOST('year', 'int');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'facture', $facid, '');
|
||||
|
||||
@ -83,7 +87,7 @@ $arrayfields=array();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_account="";
|
||||
@ -94,22 +98,22 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
|
||||
$day='';
|
||||
$year='';
|
||||
$month='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans('ListPayment'));
|
||||
|
||||
$form=new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
|
||||
if (GETPOST("orphelins"))
|
||||
llxHeader('', $langs->trans('ListPayment'));
|
||||
|
||||
if (GETPOST("orphelins","alpha"))
|
||||
{
|
||||
// Paiements lies a aucune facture (pour aide au diagnostic)
|
||||
// Payments not linked to an invoice. Should not happend. For debug only.
|
||||
$sql = "SELECT p.rowid, p.ref, p.datep as dp, p.amount,";
|
||||
$sql.= " p.statut, p.num_paiement,";
|
||||
$sql.= " c.code as paiement_code";
|
||||
@ -197,7 +201,6 @@ $resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
@ -213,6 +216,7 @@ if ($resql)
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
@ -228,18 +232,18 @@ if ($resql)
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day" value="'.dol_escape_htmltag($day).'">';
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month" value="'.dol_escape_htmltag($month).'">';
|
||||
$formother->select_year($year?$year:-1, 'year', 1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).'">';
|
||||
print '</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
@ -264,7 +268,7 @@ if ($resql)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "p.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "dp", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "dp", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "c.libelle", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "p.num_paiement", "", $param, "", $sortfield, $sortorder);
|
||||
@ -283,6 +287,8 @@ if ($resql)
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
$i = 0;
|
||||
$totalarray=array();
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
@ -290,35 +296,39 @@ if ($resql)
|
||||
$paymentstatic->id=$objp->rowid;
|
||||
$paymentstatic->ref=$objp->ref;
|
||||
|
||||
$companystatic->id=$objp->socid;
|
||||
$companystatic->name=$objp->name;
|
||||
$companystatic->email=$objp->email;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Date
|
||||
$dateformatforpayment = 'day';
|
||||
if (! empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment='dayhour';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Thirdparty
|
||||
print '<td>';
|
||||
if ($objp->socid > 0)
|
||||
{
|
||||
$companystatic->id=$objp->socid;
|
||||
$companystatic->name=$objp->name;
|
||||
$companystatic->email=$objp->email;
|
||||
|
||||
print $companystatic->getNomUrl(1, '', 24);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Type
|
||||
print '<td>'.$langs->trans("PaymentTypeShort".$objp->paiement_code).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Payment number
|
||||
print '<td>'.$objp->num_paiement.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
@ -338,11 +348,15 @@ if ($resql)
|
||||
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Amount
|
||||
print '<td class="right">'.price($objp->amount).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
$totalarray['pos'][7]='amount';
|
||||
$totalarray['val']['amount'] += $objp->amount;
|
||||
|
||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||
{
|
||||
@ -351,13 +365,39 @@ if ($resql)
|
||||
print $paymentstatic->LibStatut($objp->statut, 5);
|
||||
if ($objp->statut == 0) print '</a>';
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
print '<td></td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Show total line
|
||||
if (isset($totalarray['pos']))
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
$i=0;
|
||||
while ($i < $totalarray['nbfield'])
|
||||
{
|
||||
$i++;
|
||||
if (! empty($totalarray['pos'][$i])) print '<td class="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>';
|
||||
else
|
||||
{
|
||||
if ($i == 1)
|
||||
{
|
||||
if ($num < $limit) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
else print '<td></td>';
|
||||
}
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
print "</div>";
|
||||
print "</form>\n";
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
/**
|
||||
* \file htdocs/fourn/facture/paiement.php
|
||||
* \ingroup fournisseur,facture
|
||||
* \brief Payment page for suppliers invoices
|
||||
* \brief Payment page for supplier invoices
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@ -38,11 +38,13 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('companies', 'bills', 'banks', 'compta'));
|
||||
|
||||
// Security check
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
$facid = GETPOST('facid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$accountid = GETPOST('accountid', 'int');
|
||||
@ -50,24 +52,23 @@ $day = GETPOST('day', 'int');
|
||||
$month = GETPOST('month', 'int');
|
||||
$year = GETPOST('year', 'int');
|
||||
|
||||
$search_ref=GETPOST("search_ref", "int");
|
||||
$search_ref=GETPOST("search_ref", "alpha");
|
||||
$search_account=GETPOST("search_account", "int");
|
||||
$search_paymenttype=GETPOST("search_paymenttype");
|
||||
$search_amount=GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x"
|
||||
$search_company=GETPOST("search_company", 'alpha');
|
||||
$search_payment_num=GETPOST('search_payment_num', 'alpha');
|
||||
|
||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="p.rowid";
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
$amounts = array();
|
||||
$amountsresttopay=array();
|
||||
@ -84,7 +85,7 @@ if ($user->societe_id > 0)
|
||||
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('paymentsupplier'));
|
||||
$hookmanager->initHooks(array('paymentsupplierlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
@ -333,20 +334,20 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
|
||||
$supplierstatic=new Societe($db);
|
||||
$invoicesupplierstatic = new FactureFournisseur($db);
|
||||
|
||||
llxHeader('', $langs->trans('ListPayment'));
|
||||
|
||||
$form=new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
|
||||
if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement')
|
||||
{
|
||||
$object = new FactureFournisseur($db);
|
||||
$result = $object->fetch($facid);
|
||||
|
||||
$datefacture=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||
$datefacture=dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||
$dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datefacture);
|
||||
|
||||
$sql = 'SELECT s.nom as name, s.rowid as socid,';
|
||||
@ -767,7 +768,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
/*
|
||||
* Show list
|
||||
*/
|
||||
if (empty($action))
|
||||
if (empty($action) || $action == 'list')
|
||||
{
|
||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
@ -861,9 +862,10 @@ if (empty($action))
|
||||
|
||||
print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
@ -899,18 +901,21 @@ if (empty($action))
|
||||
print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month" value="'.dol_escape_htmltag($month).'">';
|
||||
$formother->select_year($year?$year:-1, 'year', 1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre left">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_comptes($search_account, 'search_account', 0, '', 1);
|
||||
print '</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_comptes($search_account, 'search_account', 0, '', 1);
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="liste_titre right">';
|
||||
print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
|
||||
print '</td>';
|
||||
@ -926,12 +931,21 @@ if (empty($action))
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], 'c.libelle', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "p.num_paiement", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], 'ba.label', '', $param, '', $sortfield, $sortorder);
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], 'ba.label', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], 'p.amount', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
//print_liste_field_titre("Invoice",$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
|
||||
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
$i = 0;
|
||||
$totalarray=array();
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
@ -940,32 +954,46 @@ if (empty($action))
|
||||
|
||||
// Ref payment
|
||||
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$objp->pid.'">'.img_object($langs->trans('ShowPayment'), 'payment').' '.$objp->pid.'</a></td>';
|
||||
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Date
|
||||
$dateformatforpayment = 'day';
|
||||
if (! empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment='dayhour';
|
||||
print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->dp), $dateformatforpayment)."</td>\n";
|
||||
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Thirdparty
|
||||
print '<td>';
|
||||
if ($objp->socid) print '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'), 'company').' '.dol_trunc($objp->name, 32).'</a>';
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Type
|
||||
$payment_type = $langs->trans("PaymentType".$objp->paiement_type)!=("PaymentType".$objp->paiement_type)?$langs->trans("PaymentType".$objp->paiement_type):$objp->paiement_libelle;
|
||||
print '<td>'.$payment_type.' '.dol_trunc($objp->num_paiement, 32)."</td>\n";
|
||||
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Payment number
|
||||
print '<td>'.$objp->num_paiement.'</td>';
|
||||
|
||||
print '<td>';
|
||||
if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"), 'account').' '.dol_trunc($objp->label, 24).'</a>';
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
// Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"), 'account').' '.dol_trunc($objp->label, 24).'</a>';
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Amount
|
||||
print '<td class="right">'.price($objp->pamount).'</td>';
|
||||
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
$totalarray['pos'][7]='amount';
|
||||
$totalarray['val']['amount'] += $objp->pamount;
|
||||
|
||||
// Ref invoice
|
||||
/*$invoicesupplierstatic->ref=$objp->ref_supplier;
|
||||
$invoicesupplierstatic->id=$objp->facid;
|
||||
@ -973,10 +1001,35 @@ if (empty($action))
|
||||
print $invoicesupplierstatic->getNomUrl(1);
|
||||
print '</td>';*/
|
||||
|
||||
print '<td> </td>';
|
||||
print '<td></td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Show total line
|
||||
if (isset($totalarray['pos']))
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
$i=0;
|
||||
while ($i < $totalarray['nbfield'])
|
||||
{
|
||||
$i++;
|
||||
if (! empty($totalarray['pos'][$i])) print '<td class="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>';
|
||||
else
|
||||
{
|
||||
if ($i == 1)
|
||||
{
|
||||
if ($num < $limit) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
else print '<td></td>';
|
||||
}
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
print "</form>\n";
|
||||
|
||||
@ -60,4 +60,5 @@ CashDeskBankAccountFor=Default account to use for payments in
|
||||
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
|
||||
EnableBarOrRestaurantFeatures=Enable features for Bar or Restaurant
|
||||
ConfirmDeletionOfThisPOSSale=Do your confirm the deletion of this current sale ?
|
||||
@ -225,11 +225,11 @@ if ($action == "addnote") {
|
||||
}
|
||||
|
||||
if ($action == "deleteline") {
|
||||
if ($idline > 0 and $placeid > 0) { //If exist invoice and line, to avoid errors if deleted from other device or no line selected
|
||||
if ($idline > 0 and $placeid > 0) { // If invoice exists and line selected. To avoid errors if deleted from another device or no line selected.
|
||||
$invoice->deleteline($idline);
|
||||
$invoice->fetch($placeid);
|
||||
}
|
||||
elseif ($placeid > 0) { //If exist invoice, but no line selected, proceed to delete last line
|
||||
elseif ($placeid > 0) { // If invoice exists but no line selected, proceed to delete last line.
|
||||
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture='".$placeid."' order by rowid DESC";
|
||||
$resql = $db->query($sql);
|
||||
$row = $db->fetch_array($resql);
|
||||
@ -239,6 +239,19 @@ if ($action == "deleteline") {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "delete") {
|
||||
if ($placeid > 0) { //If invoice exists
|
||||
$result = $invoice->fetch($placeid);
|
||||
if ($result > 0)
|
||||
{
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture='".$placeid."'";
|
||||
$resql = $db->query($sql);
|
||||
|
||||
$invoice->fetch($placeid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "updateqty")
|
||||
{
|
||||
foreach($invoice->lines as $line)
|
||||
|
||||
@ -380,6 +380,16 @@ function Refresh() {
|
||||
});
|
||||
}
|
||||
|
||||
function New() {
|
||||
console.log("New");
|
||||
var r = confirm('<?php echo $langs->trans("ConfirmDeletionOfThisPOSSale"); ?>');
|
||||
if (r == true) {
|
||||
$("#poslines").load("invoice.php?action=delete&place="+place, function() {
|
||||
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function Search2() {
|
||||
console.log("Search2");
|
||||
pageproducts=0;
|
||||
@ -585,7 +595,17 @@ if (count($maincategories)==0) {
|
||||
// User menu and external TakePOS modules
|
||||
$menus = array();
|
||||
$r=0;
|
||||
//$menus[$r++]=array('title'=>'<span class="fas fa-search paddingrightonly"></span><div class="trunc">'.$langs->trans("SearchProduct").'</div>', 'action'=>'Search();');
|
||||
|
||||
if (empty($conf->global->TAKEPOS_BAR_RESTAURANT))
|
||||
{
|
||||
$menus[$r++]=array('title'=>'<span class="fa fa-layer-group paddingrightonly"></span><div class="trunc">'.$langs->trans("New").'</div>', 'action'=>'New();');
|
||||
}
|
||||
else
|
||||
{
|
||||
// BAR RESTAURANT specific menu
|
||||
$menus[$r++]=array('title'=>'<span class="fa fa-layer-group paddingrightonly"></span><div class="trunc">'.$langs->trans("Floors").'</div>', 'action'=>'Floors();');
|
||||
}
|
||||
|
||||
$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-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();');
|
||||
@ -593,7 +613,6 @@ $menus[$r++]=array('title'=>'<span class="far fa-money-bill-alt paddingrightonly
|
||||
// BAR RESTAURANT specific menu
|
||||
if ($conf->global->TAKEPOS_BAR_RESTAURANT)
|
||||
{
|
||||
$menus[$r++]=array('title'=>'<span class="fa fa-layer-group paddingrightonly"></span><div class="trunc">'.$langs->trans("Floors").'</div>', 'action'=>'Floors();');
|
||||
if ($conf->global->TAKEPOS_ORDER_PRINTERS)
|
||||
{
|
||||
$menus[$r++]=array('title'=>$langs->trans("Order"), 'action'=>'TakeposPrintingOrder();');
|
||||
|
||||
@ -1896,6 +1896,9 @@ span.fa.atoplogin, span.fa.atoplogin:hover {
|
||||
font-size: 16px;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
.atoplogin #dropdown-icon-down, .atoplogin #dropdown-icon-up {
|
||||
font-size: 0.7em;
|
||||
}
|
||||
img.login, img.printer, img.entity {
|
||||
/* padding: 0px 0px 0px 4px; */
|
||||
/* margin: 0px 0px 0px 8px; */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user