pay.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <?php
  2. /* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/takepos/pay.php
  19. * \ingroup takepos
  20. * \brief Page with the content of the popup to enter payments
  21. */
  22. //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language
  23. //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language
  24. //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
  25. //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
  26. if (!defined('NOCSRFCHECK')) {
  27. define('NOCSRFCHECK', '1');
  28. }
  29. if (!defined('NOTOKENRENEWAL')) {
  30. define('NOTOKENRENEWAL', '1');
  31. }
  32. if (!defined('NOREQUIREMENU')) {
  33. define('NOREQUIREMENU', '1');
  34. }
  35. if (!defined('NOREQUIREHTML')) {
  36. define('NOREQUIREHTML', '1');
  37. }
  38. //if (!defined('NOREQUIREAJAX')) {
  39. // define('NOREQUIREAJAX', '1');
  40. //}
  41. require '../main.inc.php'; // Load $user and permissions
  42. require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
  43. $langs->loadLangs(array("main", "bills", "cashdesk", "banks"));
  44. $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'); // $place is id of table for Bar or Restaurant
  45. $invoiceid = GETPOST('invoiceid', 'int');
  46. if (empty($user->rights->takepos->run)) {
  47. accessforbidden();
  48. }
  49. /*
  50. * View
  51. */
  52. $invoice = new Facture($db);
  53. if ($invoiceid > 0) {
  54. $invoice->fetch($invoiceid);
  55. } else {
  56. $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
  57. $resql = $db->query($sql);
  58. $obj = $db->fetch_object($resql);
  59. if ($obj) {
  60. $invoiceid = $obj->rowid;
  61. }
  62. if (!$invoiceid) {
  63. $invoiceid = 0; // Invoice does not exist yet
  64. } else {
  65. $invoice->fetch($invoiceid);
  66. }
  67. }
  68. $arrayofcss = array('/takepos/css/pos.css.php');
  69. $arrayofjs = array();
  70. $head = '';
  71. $title = '';
  72. $disablejs = 0;
  73. $disablehead = 0;
  74. top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
  75. // Define list of possible payments
  76. $arrayOfValidPaymentModes = array();
  77. $arrayOfValidBankAccount = array();
  78. $sql = "SELECT code, libelle as label FROM ".MAIN_DB_PREFIX."c_paiement";
  79. $sql .= " WHERE entity IN (".getEntity('c_paiement').")";
  80. $sql .= " AND active = 1";
  81. $sql .= " ORDER BY libelle";
  82. $resql = $db->query($sql);
  83. if ($resql) {
  84. while ($obj = $db->fetch_object($resql)) {
  85. $paycode = $obj->code;
  86. if ($paycode == 'LIQ') {
  87. $paycode = 'CASH';
  88. }
  89. if ($paycode == 'CB') {
  90. $paycode = 'CB';
  91. }
  92. if ($paycode == 'CHQ') {
  93. $paycode = 'CHEQUE';
  94. }
  95. $accountname = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
  96. if (!empty($conf->global->$accountname) && $conf->global->$accountname > 0) {
  97. $arrayOfValidBankAccount[$conf->global->$accountname] = $conf->global->$accountname;
  98. $arrayOfValidPaymentModes[] = $obj;
  99. }
  100. }
  101. }
  102. ?>
  103. <link rel="stylesheet" href="css/pos.css.php">
  104. <?php
  105. if ($conf->global->TAKEPOS_COLOR_THEME == 1) {
  106. print '<link rel="stylesheet" href="css/colorful.css">';
  107. }
  108. ?>
  109. </head>
  110. <body>
  111. <script>
  112. <?php
  113. $remaintopay = 0;
  114. if ($invoice->id > 0) {
  115. $remaintopay = $invoice->getRemainToPay();
  116. }
  117. $alreadypayed = (is_object($invoice) ? ($invoice->total_ttc - $remaintopay) : 0);
  118. if ($conf->global->TAKEPOS_NUMPAD == 0) {
  119. print "var received='';";
  120. } else {
  121. print "var received=0;";
  122. }
  123. ?>
  124. var alreadypayed = <?php echo $alreadypayed ?>;
  125. function addreceived(price)
  126. {
  127. <?php
  128. if (empty($conf->global->TAKEPOS_NUMPAD)) {
  129. print 'received+=String(price);'."\n";
  130. } else {
  131. print 'received+=parseFloat(price);'."\n";
  132. }
  133. ?>
  134. $('.change1').html(pricejs(parseFloat(received), 'MT'));
  135. $('.change1').val(parseFloat(received));
  136. alreadypaydplusreceived=price2numjs(alreadypayed + parseFloat(received));
  137. //console.log("already+received = "+alreadypaydplusreceived);
  138. //console.log("total_ttc = "+<?php echo $invoice->total_ttc; ?>);
  139. if (alreadypaydplusreceived > <?php echo $invoice->total_ttc; ?>)
  140. {
  141. var change=parseFloat(alreadypayed + parseFloat(received) - <?php echo $invoice->total_ttc; ?>);
  142. $('.change2').html(pricejs(change, 'MT'));
  143. $('.change2').val(change);
  144. $('.change1').removeClass('colorred');
  145. $('.change1').addClass('colorgreen');
  146. $('.change2').removeClass('colorwhite');
  147. $('.change2').addClass('colorred');
  148. }
  149. else
  150. {
  151. $('.change2').html(pricejs(0, 'MT'));
  152. $('.change2').val(0);
  153. if (alreadypaydplusreceived == <?php echo $invoice->total_ttc; ?>)
  154. {
  155. $('.change1').removeClass('colorred');
  156. $('.change1').addClass('colorgreen');
  157. $('.change2').removeClass('colorred');
  158. $('.change2').addClass('colorwhite');
  159. }
  160. else
  161. {
  162. $('.change1').removeClass('colorgreen');
  163. $('.change1').addClass('colorred');
  164. $('.change2').removeClass('colorred');
  165. $('.change2').addClass('colorwhite');
  166. }
  167. }
  168. }
  169. function reset()
  170. {
  171. received=0;
  172. $('.change1').html(pricejs(received, 'MT'));
  173. $('.change1').val(price2numjs(received));
  174. $('.change2').html(pricejs(received, 'MT'));
  175. $('.change2').val(price2numjs(received));
  176. $('.change1').removeClass('colorgreen');
  177. $('.change1').addClass('colorred');
  178. $('.change2').removeClass('colorred');
  179. $('.change2').addClass('colorwhite');
  180. }
  181. function Validate(payment)
  182. {
  183. var invoiceid = <?php echo ($invoiceid > 0 ? $invoiceid : 0); ?>;
  184. var accountid = $("#selectaccountid").val();
  185. var amountpayed = $("#change1").val();
  186. var excess = $("#change2").val();
  187. if (amountpayed > <?php echo $invoice->total_ttc; ?>) {
  188. amountpayed = <?php echo $invoice->total_ttc; ?>;
  189. }
  190. console.log("We click on the payment mode to pay amount = "+amountpayed);
  191. parent.$("#poslines").load("invoice.php?place=<?php echo $place; ?>&action=valid&pay="+payment+"&amount="+amountpayed+"&excess="+excess+"&invoiceid="+invoiceid+"&accountid="+accountid, function() {
  192. if (amountpayed > <?php echo $remaintopay; ?> || amountpayed == <?php echo $remaintopay; ?> || amountpayed==0 ) {
  193. console.log("Close popup");
  194. parent.$.colorbox.close();
  195. }
  196. else {
  197. console.log("Amount is not comple, so we do NOT close popup and reload it.");
  198. location.reload();
  199. }
  200. });
  201. }
  202. function ValidateSumup() {
  203. console.log("Launch ValidateSumup");
  204. <?php $_SESSION['SMP_CURRENT_PAYMENT'] = "NEW" ?>
  205. var invoiceid = <?php echo($invoiceid > 0 ? $invoiceid : 0); ?>;
  206. var amountpayed = $("#change1").val();
  207. if (amountpayed > <?php echo $invoice->total_ttc; ?>) {
  208. amountpayed = <?php echo $invoice->total_ttc; ?>;
  209. }
  210. // Starting sumup app
  211. 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 + '&currency=EUR&title=' + invoiceid + '&callback=<?php echo DOL_MAIN_URL_ROOT ?>/takepos/smpcb.php');
  212. var loop = window.setInterval(function () {
  213. $.ajax({
  214. method: 'POST',
  215. data: { token: '<?php echo currentToken(); ?>' },
  216. url: '<?php echo DOL_URL_ROOT ?>/takepos/smpcb.php?status' }).done(function (data) {
  217. console.log(data);
  218. if (data === "SUCCESS") {
  219. parent.$("#poslines").load("invoice.php?place=<?php echo $place; ?>&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () {
  220. //parent.$("#poslines").scrollTop(parent.$("#poslines")[0].scrollHeight);
  221. parent.$.colorbox.close();
  222. //parent.setFocusOnSearchField(); // This does not have effect
  223. });
  224. clearInterval(loop);
  225. } else if (data === "FAILED") {
  226. parent.$.colorbox.close();
  227. clearInterval(loop);
  228. }
  229. });
  230. }, 2500);
  231. }
  232. </script>
  233. <div style="position:relative; padding-top: 20px; left:5%; height:150px; width:90%;">
  234. <div class="paymentbordline paymentbordlinetotal center">
  235. <span class="takepospay colorwhite"><?php echo $langs->trans('TotalTTC'); ?>: <span id="totaldisplay" class="colorwhite"><?php echo price($invoice->total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span></span>
  236. </div>
  237. <?php if ($remaintopay != $invoice->total_ttc) { ?>
  238. <div class="paymentbordline paymentbordlineremain center">
  239. <span class="takepospay colorwhite"><?php echo $langs->trans('RemainToPay'); ?>: <span id="remaintopaydisplay" class="colorwhite"><?php echo price($remaintopay, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span></span>
  240. </div>
  241. <?php } ?>
  242. <div class="paymentbordline paymentbordlinereceived center">
  243. <span class="takepospay colorwhite"><?php echo $langs->trans("Received"); ?>: <span class="change1 colorred"><?php echo price(0, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span><input type="hidden" id="change1" class="change1" value="0"></span>
  244. </div>
  245. <div class="paymentbordline paymentbordlinechange center">
  246. <span class="takepospay colorwhite"><?php echo $langs->trans("Change"); ?>: <span class="change2 colorwhite"><?php echo price(0, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span><input type="hidden" id="change2" class="change2" value="0"></span>
  247. </div>
  248. <?php
  249. if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
  250. require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
  251. print '<div class="paymentbordline paddingtop paddingbottom center">';
  252. $filter = '';
  253. $form = new Form($db);
  254. print '<span class="takepospay colorwhite">'.$langs->trans("BankAccount").': </span>';
  255. $form->select_comptes(0, 'accountid', 0, $filter, 1, '');
  256. print ajax_combobox('selectaccountid');
  257. print '</div>';
  258. }
  259. ?>
  260. </div>
  261. <div style="position:absolute; left:5%; height:52%; width:90%;">
  262. <?php
  263. $action_buttons = array(
  264. array(
  265. "function" =>"reset()",
  266. "span" => "style='font-size: 150%;'",
  267. "text" => "C",
  268. "class" => "poscolorblue"
  269. ),
  270. array(
  271. "function" => "parent.$.colorbox.close();",
  272. "span" => "id='printtext' style='font-weight: bold; font-size: 18pt;'",
  273. "text" => "X",
  274. "class" => "poscolordelete"
  275. ),
  276. );
  277. $numpad = $conf->global->TAKEPOS_NUMPAD;
  278. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '7' : '10').');">'.($numpad == 0 ? '7' : '10').'</button>';
  279. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '8' : '20').');">'.($numpad == 0 ? '8' : '20').'</button>';
  280. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '9' : '50').');">'.($numpad == 0 ? '9' : '50').'</button>';
  281. ?>
  282. <?php if (count($arrayOfValidPaymentModes) > 0) {
  283. $paycode = $arrayOfValidPaymentModes[0]->code;
  284. $payIcon = '';
  285. if ($paycode == 'LIQ') {
  286. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  287. $payIcon = 'coins';
  288. }
  289. } elseif ($paycode == 'CB') {
  290. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  291. $payIcon = 'credit-card';
  292. }
  293. } elseif ($paycode == 'CHQ') {
  294. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  295. $payIcon = 'money-check';
  296. }
  297. }
  298. print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><span class="hideonsmartphone"><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).'</span></button>';
  299. } else {
  300. print '<button type="button" class="calcbutton2">'.$langs->trans("NoPaimementModesDefined").'</button>';
  301. }
  302. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '4' : '1').');">'.($numpad == 0 ? '4' : '1').'</button>';
  303. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '5' : '2').');">'.($numpad == 0 ? '5' : '2').'</button>';
  304. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '6' : '5').');">'.($numpad == 0 ? '6' : '5').'</button>';
  305. ?>
  306. <?php if (count($arrayOfValidPaymentModes) > 1) {
  307. $paycode = $arrayOfValidPaymentModes[1]->code;
  308. $payIcon = '';
  309. if ($paycode == 'LIQ') {
  310. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  311. $payIcon = 'coins';
  312. }
  313. } elseif ($paycode == 'CB') {
  314. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  315. $payIcon = 'credit-card';
  316. }
  317. } elseif ($paycode == 'CHQ') {
  318. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  319. $payIcon = 'money-check';
  320. }
  321. }
  322. print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br> '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).'</button>';
  323. } else {
  324. $button = array_pop($action_buttons);
  325. print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
  326. }
  327. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '1' : '0.10').');">'.($numpad == 0 ? '1' : '0.10').'</button>';
  328. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '2' : '0.20').');">'.($numpad == 0 ? '2' : '0.20').'</button>';
  329. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '3' : '0.50').');">'.($numpad == 0 ? '3' : '0.50').'</button>';
  330. ?>
  331. <?php if (count($arrayOfValidPaymentModes) > 2) {
  332. $paycode = $arrayOfValidPaymentModes[2]->code;
  333. $payIcon = '';
  334. if ($paycode == 'LIQ') {
  335. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  336. $payIcon = 'coins';
  337. }
  338. } elseif ($paycode == 'CB') {
  339. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  340. $payIcon = 'credit-card';
  341. }
  342. } elseif ($paycode == 'CHQ') {
  343. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  344. $payIcon = 'money-check';
  345. }
  346. }
  347. print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).'</button>';
  348. } else {
  349. $button = array_pop($action_buttons);
  350. print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
  351. }
  352. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '0' : '0.01').');">'.($numpad == 0 ? '0' : '0.01').'</button>';
  353. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '\'000\'' : '0.02').');">'.($numpad == 0 ? '000' : '0.02').'</button>';
  354. print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '\'.\'' : '0.05').');">'.($numpad == 0 ? '.' : '0.05').'</button>';
  355. $i = 3;
  356. while ($i < count($arrayOfValidPaymentModes)) {
  357. $paycode = $arrayOfValidPaymentModes[$i]->code;
  358. $payIcon = '';
  359. if ($paycode == 'LIQ') {
  360. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  361. $payIcon = 'coins';
  362. }
  363. } elseif ($paycode == 'CB') {
  364. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  365. $payIcon = 'credit-card';
  366. }
  367. } elseif ($paycode == 'CHQ') {
  368. if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) {
  369. $payIcon = 'money-check';
  370. }
  371. }
  372. print '<button type="button" class="calcbutton2" onclick="Validate(\''.dol_escape_js($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code)).'</button>';
  373. $i = $i + 1;
  374. }
  375. $keyforsumupbank = "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"];
  376. if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
  377. if (!empty($conf->global->$keyforsumupbank)) {
  378. print '<button type="button" class="calcbutton2" onclick="ValidateSumup();">Sumup</button>';
  379. } else {
  380. $langs->loadLangs(array("errors", "admin"));
  381. print '<button type="button" class="calcbutton2 disabled" title="'.$langs->trans("SetupNotComplete").'">Sumup</button>';
  382. }
  383. }
  384. $class = ($i == 3) ? "calcbutton3" : "calcbutton2";
  385. foreach ($action_buttons as $button) {
  386. $newclass = $class.($button["class"] ? " ".$button["class"] : "");
  387. print '<button type="button" class="'.$newclass.'" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
  388. }
  389. if ($conf->global->TAKEPOS_DELAYED_PAYMENT) {
  390. print '<button type="button" class="calcbutton2" onclick="Validate(\'delayed\');">'.$langs->trans("Reported").'</button>';
  391. }
  392. ?>
  393. </div>
  394. </body>
  395. </html>