NEW Add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT
This commit is contained in:
parent
2d0d2e0019
commit
bb74804b74
@ -23,6 +23,8 @@
|
|||||||
* \brief File of class with all html predefined components
|
* \brief File of class with all html predefined components
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to manage generation of HTML components for bank module
|
* Class to manage generation of HTML components for bank module
|
||||||
|
|||||||
@ -157,7 +157,7 @@ button.actionbutton {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
overflow: visible; /* removes extra width in IE */
|
overflow: visible; /* removes extra width in IE */
|
||||||
width: calc(33% - 2px);
|
width: calc(33.33% - 2px);
|
||||||
height: calc(25% - 2px);
|
height: calc(25% - 2px);
|
||||||
margin: 1px;
|
margin: 1px;
|
||||||
border-width: 0;
|
border-width: 0;
|
||||||
@ -274,10 +274,12 @@ table.postablelines tr td {
|
|||||||
|
|
||||||
div.paymentbordline
|
div.paymentbordline
|
||||||
{
|
{
|
||||||
width:50%;
|
width:calc(50% - 16px);
|
||||||
background-color:#888;
|
background-color:#888;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-aspect-ratio: 6/4) {
|
@media only screen and (max-aspect-ratio: 6/4) {
|
||||||
@ -471,6 +473,14 @@ div.description_content {
|
|||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 767px) {
|
||||||
|
.topnav .login_block_other a {
|
||||||
|
padding: 5px 5px;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.topnav-right > a {
|
.topnav-right > a {
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
@ -572,7 +582,7 @@ div#moreinfo, div#infowarehouse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.topnav input[type="text"] {
|
.topnav input[type="text"] {
|
||||||
max-width: 100px;
|
max-width: 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topnav-right {
|
.topnav-right {
|
||||||
|
|||||||
@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
|||||||
|
|
||||||
global $mysoc;
|
global $mysoc;
|
||||||
|
|
||||||
$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks"));
|
$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks", "banks"));
|
||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
@ -137,20 +137,36 @@ else $soc->fetch($conf->global->$constforcompanyid);
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Action to record a payment on a TakePOS invoice
|
||||||
if ($action == 'valid' && $user->rights->facture->creer)
|
if ($action == 'valid' && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
$bankaccount = 0;
|
||||||
elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
$error = 0;
|
||||||
elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
|
||||||
else {
|
if (! empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
|
||||||
$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
|
$bankaccount = GETPOST('accountid', 'int');
|
||||||
$bankaccount = $conf->global->$accountname;
|
}
|
||||||
}
|
else {
|
||||||
|
if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||||
|
elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||||
|
elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
|
||||||
|
else {
|
||||||
|
$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
|
||||||
|
$bankaccount = $conf->global->$accountname;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($bankaccount <= 0) {
|
||||||
|
$errormsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount"));
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$res = 0;
|
$res = 0;
|
||||||
|
|
||||||
$invoice = new Facture($db);
|
$invoice = new Facture($db);
|
||||||
$invoice->fetch($placeid);
|
$invoice->fetch($placeid);
|
||||||
|
|
||||||
if ($invoice->total_ttc < 0) {
|
if ($invoice->total_ttc < 0) {
|
||||||
$invoice->type = $invoice::TYPE_CREDIT_NOTE;
|
$invoice->type = $invoice::TYPE_CREDIT_NOTE;
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE ";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE ";
|
||||||
@ -180,19 +196,20 @@ if ($action == 'valid' && $user->rights->facture->creer)
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
|
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
|
||||||
if ($invoice->statut != Facture::STATUS_DRAFT) {
|
if ($error) {
|
||||||
|
dol_htmloutput_errors($errormsg, null, 1);
|
||||||
|
} elseif ($invoice->statut != Facture::STATUS_DRAFT) {
|
||||||
//If invoice is validated but it is not fully paid is not error and make the payment
|
//If invoice is validated but it is not fully paid is not error and make the payment
|
||||||
if ($invoice->getRemainToPay() > 0) $res = 1;
|
if ($invoice->getRemainToPay() > 0) {
|
||||||
else {
|
$res = 1;
|
||||||
|
} else {
|
||||||
dol_syslog("Sale already validated");
|
dol_syslog("Sale already validated");
|
||||||
dol_htmloutput_errors($langs->trans("InvoiceIsAlreadyValidated", "TakePos"), null, 1);
|
dol_htmloutput_errors($langs->trans("InvoiceIsAlreadyValidated", "TakePos"), null, 1);
|
||||||
}
|
}
|
||||||
} elseif (count($invoice->lines) == 0)
|
} elseif (count($invoice->lines) == 0) {
|
||||||
{
|
|
||||||
dol_syslog("Sale without lines");
|
dol_syslog("Sale without lines");
|
||||||
dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1);
|
dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1);
|
||||||
} elseif (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1")
|
} elseif (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") {
|
||||||
{
|
|
||||||
$savconst = $conf->global->STOCK_CALCULATE_ON_BILL;
|
$savconst = $conf->global->STOCK_CALCULATE_ON_BILL;
|
||||||
$conf->global->STOCK_CALCULATE_ON_BILL = 1;
|
$conf->global->STOCK_CALCULATE_ON_BILL = 1;
|
||||||
|
|
||||||
@ -219,7 +236,7 @@ if ($action == 'valid' && $user->rights->facture->creer)
|
|||||||
$remaintopay = $invoice->getRemainToPay();
|
$remaintopay = $invoice->getRemainToPay();
|
||||||
|
|
||||||
// Add the payment
|
// Add the payment
|
||||||
if ($res >= 0 && $remaintopay > 0) {
|
if (!$error && $res >= 0 && $remaintopay > 0) {
|
||||||
$payment = new Paiement($db);
|
$payment = new Paiement($db);
|
||||||
$payment->datepaye = $now;
|
$payment->datepaye = $now;
|
||||||
$payment->fk_account = $bankaccount;
|
$payment->fk_account = $bankaccount;
|
||||||
|
|||||||
@ -34,6 +34,8 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
|||||||
require '../main.inc.php'; // Load $user and permissions
|
require '../main.inc.php'; // Load $user and permissions
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
|
$langs->loadLangs(array("main", "bills", "cashdesk", "banks"));
|
||||||
|
|
||||||
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'); // $place is id of table for Bar or Restaurant
|
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'); // $place is id of table for Bar or Restaurant
|
||||||
|
|
||||||
$invoiceid = GETPOST('invoiceid', 'int');
|
$invoiceid = GETPOST('invoiceid', 'int');
|
||||||
@ -70,16 +72,23 @@ if ($invoiceid > 0)
|
|||||||
$arrayofcss = array('/takepos/css/pos.css.php');
|
$arrayofcss = array('/takepos/css/pos.css.php');
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
|
|
||||||
|
$head = '';
|
||||||
|
$title = '';
|
||||||
|
$disablejs = 0;
|
||||||
|
$disablehead = 0;
|
||||||
|
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
$langs->loadLangs(array("main", "bills", "cashdesk"));
|
// Define list of possible payments
|
||||||
|
$arrayOfValidPaymentModes = array();
|
||||||
|
$arrayOfValidBankAccount = array();
|
||||||
|
|
||||||
$sql = "SELECT code, libelle as label FROM ".MAIN_DB_PREFIX."c_paiement";
|
$sql = "SELECT code, libelle as label FROM ".MAIN_DB_PREFIX."c_paiement";
|
||||||
$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
|
$sql .= " WHERE entity IN (".getEntity('c_paiement').")";
|
||||||
$sql .= " AND active = 1";
|
$sql .= " AND active = 1";
|
||||||
$sql .= " ORDER BY libelle";
|
$sql .= " ORDER BY libelle";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$paiements = array();
|
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
$paycode = $obj->code;
|
$paycode = $obj->code;
|
||||||
@ -88,7 +97,10 @@ if ($resql) {
|
|||||||
if ($paycode == 'CHQ') $paycode = 'CHEQUE';
|
if ($paycode == 'CHQ') $paycode = 'CHEQUE';
|
||||||
|
|
||||||
$accountname = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
|
$accountname = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
|
||||||
if (!empty($conf->global->$accountname) && $conf->global->$accountname > 0) array_push($paiements, $obj);
|
if (!empty($conf->global->$accountname) && $conf->global->$accountname > 0) {
|
||||||
|
$arrayOfValidBankAccount[$conf->global->$accountname] = $conf->global->$accountname;
|
||||||
|
$arrayOfValidPaymentModes[] = $obj;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -172,12 +184,13 @@ else print "var received=0;";
|
|||||||
function Validate(payment)
|
function Validate(payment)
|
||||||
{
|
{
|
||||||
var invoiceid = <?php echo ($invoiceid > 0 ? $invoiceid : 0); ?>;
|
var invoiceid = <?php echo ($invoiceid > 0 ? $invoiceid : 0); ?>;
|
||||||
|
var accountid = $("#selectaccountid").val();
|
||||||
var amountpayed = $("#change1").val();
|
var amountpayed = $("#change1").val();
|
||||||
if (amountpayed > <?php echo $invoice->total_ttc; ?>) {
|
if (amountpayed > <?php echo $invoice->total_ttc; ?>) {
|
||||||
amountpayed = <?php echo $invoice->total_ttc; ?>;
|
amountpayed = <?php echo $invoice->total_ttc; ?>;
|
||||||
}
|
}
|
||||||
console.log("We click on the payment mode to pay amount = "+amountpayed);
|
console.log("We click on the payment mode to pay amount = "+amountpayed);
|
||||||
parent.$("#poslines").load("invoice.php?place=<?php echo $place; ?>&action=valid&pay="+payment+"&amount="+amountpayed+"&invoiceid="+invoiceid, function() {
|
parent.$("#poslines").load("invoice.php?place=<?php echo $place; ?>&action=valid&pay="+payment+"&amount="+amountpayed+"&invoiceid="+invoiceid+"&accountid="+accountid, function() {
|
||||||
if (amountpayed > <?php echo $remaintopay; ?> || amountpayed == <?php echo $remaintopay; ?> || amountpayed==0 ) parent.$.colorbox.close();
|
if (amountpayed > <?php echo $remaintopay; ?> || amountpayed == <?php echo $remaintopay; ?> || amountpayed==0 ) parent.$.colorbox.close();
|
||||||
else location.reload();
|
else location.reload();
|
||||||
});
|
});
|
||||||
@ -196,7 +209,7 @@ else print "var received=0;";
|
|||||||
window.open('sumupmerchant://pay/1.0?affiliate-key=<?php echo $conf->global->TAKEPOS_SUMUP_AFFILIATE ?>&app-id=<?php echo $conf->global->TAKEPOS_SUMUP_APPID ?>&total=' + amountpayed + '¤cy=EUR&title=' + invoiceid + '&callback=<?php echo DOL_MAIN_URL_ROOT ?>/takepos/smpcb.php');
|
window.open('sumupmerchant://pay/1.0?affiliate-key=<?php echo $conf->global->TAKEPOS_SUMUP_AFFILIATE ?>&app-id=<?php echo $conf->global->TAKEPOS_SUMUP_APPID ?>&total=' + amountpayed + '¤cy=EUR&title=' + invoiceid + '&callback=<?php echo DOL_MAIN_URL_ROOT ?>/takepos/smpcb.php');
|
||||||
|
|
||||||
var loop = window.setInterval(function () {
|
var loop = window.setInterval(function () {
|
||||||
$.ajax('/takepos/smpcb.php?status').done(function (data) {
|
$.ajax('<?php echo DOL_URL_ROOT ?>/takepos/smpcb.php?status').done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data === "SUCCESS") {
|
if (data === "SUCCESS") {
|
||||||
parent.$("#poslines").load("invoice.php?place=<?php echo $place; ?>&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () {
|
parent.$("#poslines").load("invoice.php?place=<?php echo $place; ?>&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () {
|
||||||
@ -214,26 +227,40 @@ else print "var received=0;";
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div style="position:relative; padding-top: 10px; left:5%; height:150px; width:91%;">
|
<div style="position:relative; padding-top: 20px; left:5%; height:150px; width:90%;">
|
||||||
<center>
|
|
||||||
<div class="paymentbordline paymentbordlinetotal">
|
<div class="paymentbordline paymentbordlinetotal">
|
||||||
<center><span class="takepospay"><font color="white"><?php echo $langs->trans('TotalTTC'); ?>: </font><span id="totaldisplay" class="colorwhite"><?php echo price($invoice->total_ttc, 1, '', 1, -1, -1) ?></span></font></span></center>
|
<center><span class="takepospay"><font color="white"><?php echo $langs->trans('TotalTTC'); ?>: </font><span id="totaldisplay" class="colorwhite"><?php echo price($invoice->total_ttc, 1, '', 1, -1, -1) ?></span></span></center>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($remaintopay != $invoice->total_ttc) { ?>
|
<?php if ($remaintopay != $invoice->total_ttc) { ?>
|
||||||
<div class="paymentbordline paymentbordlineremain">
|
<div class="paymentbordline paymentbordlineremain">
|
||||||
<center><span class="takepospay"><font color="white"><?php echo $langs->trans('RemainToPay'); ?>: </font><span id="remaintopaydisplay" class="colorwhite"><?php echo price($remaintopay, 1, '', 1, -1, -1) ?></span></font></span></center>
|
<center><span class="takepospay"><font color="white"><?php echo $langs->trans('RemainToPay'); ?>: </font><span id="remaintopaydisplay" class="colorwhite"><?php echo price($remaintopay, 1, '', 1, -1, -1) ?></span></span></center>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="paymentbordline paymentbordlinereceived">
|
<div class="paymentbordline paymentbordlinereceived">
|
||||||
<center><span class="takepospay"><font color="white"><?php echo $langs->trans("Received"); ?>: </font><span class="change1 colorred"><?php echo price(0) ?></span><input type="hidden" id="change1" class="change1" value="0"></font></span></center>
|
<center><span class="takepospay"><font color="white"><?php echo $langs->trans("Received"); ?>: </font><span class="change1 colorred"><?php echo price(0) ?></span><input type="hidden" id="change1" class="change1" value="0"></span></center>
|
||||||
</div>
|
</div>
|
||||||
<div class="paymentbordline paymentbordlinechange">
|
<div class="paymentbordline paymentbordlinechange">
|
||||||
<center><span class="takepospay"><font color="white"><?php echo $langs->trans("Change"); ?>: </font><span class="change2 colorwhite"><?php echo price(0) ?></span><input type="hidden" id="change2" class="change2" value="0"></font></span></center>
|
<center><span class="takepospay"><font color="white"><?php echo $langs->trans("Change"); ?>: </font><span class="change2 colorwhite"><?php echo price(0) ?></span><input type="hidden" id="change2" class="change2" value="0"></span></center>
|
||||||
</div>
|
</div>
|
||||||
</center>
|
<?php
|
||||||
|
if (! empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
|
||||||
|
print '<div class="paymentbordline paddingtop paddingbottom">
|
||||||
|
<center>';
|
||||||
|
$filter = '';
|
||||||
|
$form = new Form($db);
|
||||||
|
print '<span class="takepospay"><font color="white">'.$langs->trans("BankAccount").': </font></span>';
|
||||||
|
$form->select_comptes(0, 'accountid', 0, $filter, 1, '');
|
||||||
|
print ajax_combobox('selectaccountid');
|
||||||
|
print '</center>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="position:absolute; left:5%; height:52%; width:92%;">
|
|
||||||
|
<div style="position:absolute; left:5%; height:52%; width:90%;">
|
||||||
<?php
|
<?php
|
||||||
$action_buttons = array(
|
$action_buttons = array(
|
||||||
array(
|
array(
|
||||||
@ -255,8 +282,8 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||||||
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '8' : '20').');">'.($numpad == 0 ? '8' : '20').'</button>';
|
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '8' : '20').');">'.($numpad == 0 ? '8' : '20').'</button>';
|
||||||
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '9' : '50').');">'.($numpad == 0 ? '9' : '50').'</button>';
|
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '9' : '50').');">'.($numpad == 0 ? '9' : '50').'</button>';
|
||||||
?>
|
?>
|
||||||
<?php if (count($paiements) > 0) {
|
<?php if (count($arrayOfValidPaymentModes) > 0) {
|
||||||
$paycode = $paiements[0]->code;
|
$paycode = $arrayOfValidPaymentModes[0]->code;
|
||||||
$payIcon = '';
|
$payIcon = '';
|
||||||
if ($paycode == 'LIQ') {
|
if ($paycode == 'LIQ') {
|
||||||
$paycode = 'cash';
|
$paycode = 'cash';
|
||||||
@ -269,7 +296,7 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||||||
if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
|
if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.'"></span>' : $langs->trans("PaymentTypeShort".$paiements[0]->code)).'</button>';
|
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.'"></span>' : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).'</button>';
|
||||||
} else {
|
} else {
|
||||||
print '<button type="button" class="calcbutton2">'.$langs->trans("NoPaimementModesDefined").'</button>';
|
print '<button type="button" class="calcbutton2">'.$langs->trans("NoPaimementModesDefined").'</button>';
|
||||||
}
|
}
|
||||||
@ -278,8 +305,8 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||||||
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '5' : '2').');">'.($numpad == 0 ? '5' : '2').'</button>';
|
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '5' : '2').');">'.($numpad == 0 ? '5' : '2').'</button>';
|
||||||
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '6' : '5').');">'.($numpad == 0 ? '6' : '5').'</button>';
|
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '6' : '5').');">'.($numpad == 0 ? '6' : '5').'</button>';
|
||||||
?>
|
?>
|
||||||
<?php if (count($paiements) > 1) {
|
<?php if (count($arrayOfValidPaymentModes) > 1) {
|
||||||
$paycode = $paiements[1]->code;
|
$paycode = $arrayOfValidPaymentModes[1]->code;
|
||||||
$payIcon = '';
|
$payIcon = '';
|
||||||
if ($paycode == 'LIQ') {
|
if ($paycode == 'LIQ') {
|
||||||
$paycode = 'cash';
|
$paycode = 'cash';
|
||||||
@ -292,7 +319,7 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||||||
if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
|
if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.'"></span>' : $langs->trans("PaymentTypeShort".$paiements[1]->code)).'</button>';
|
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.'"></span>' : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).'</button>';
|
||||||
} else {
|
} else {
|
||||||
$button = array_pop($action_buttons);
|
$button = array_pop($action_buttons);
|
||||||
print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
|
print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
|
||||||
@ -302,8 +329,8 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||||||
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '2' : '0.20').');">'.($numpad == 0 ? '2' : '0.20').'</button>';
|
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '2' : '0.20').');">'.($numpad == 0 ? '2' : '0.20').'</button>';
|
||||||
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '3' : '0.50').');">'.($numpad == 0 ? '3' : '0.50').'</button>';
|
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '3' : '0.50').');">'.($numpad == 0 ? '3' : '0.50').'</button>';
|
||||||
?>
|
?>
|
||||||
<?php if (count($paiements) > 2) {
|
<?php if (count($arrayOfValidPaymentModes) > 2) {
|
||||||
$paycode = $paiements[2]->code;
|
$paycode = $arrayOfValidPaymentModes[2]->code;
|
||||||
$payIcon = '';
|
$payIcon = '';
|
||||||
if ($paycode == 'LIQ') {
|
if ($paycode == 'LIQ') {
|
||||||
$paycode = 'cash';
|
$paycode = 'cash';
|
||||||
@ -316,7 +343,7 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||||||
if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
|
if (!empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.'"></span>' : $langs->trans("PaymentTypeShort".$paiements[2]->code)).'</button>';
|
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.'"></span>' : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).'</button>';
|
||||||
} else {
|
} else {
|
||||||
$button = array_pop($action_buttons);
|
$button = array_pop($action_buttons);
|
||||||
print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
|
print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
|
||||||
@ -327,8 +354,8 @@ print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad
|
|||||||
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '\'.\'' : '0.05').');">'.($numpad == 0 ? '.' : '0.05').'</button>';
|
print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '\'.\'' : '0.05').');">'.($numpad == 0 ? '.' : '0.05').'</button>';
|
||||||
|
|
||||||
$i = 3;
|
$i = 3;
|
||||||
while ($i < count($paiements)) {
|
while ($i < count($arrayOfValidPaymentModes)) {
|
||||||
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paiements[$i]->code).'\');">'.$langs->trans("PaymentTypeShort".$paiements[$i]->code).'</button>';
|
print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($arrayOfValidPaymentModes[$i]->code).'\');">'.$langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code).'</button>';
|
||||||
$i = $i + 1;
|
$i = $i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user