diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 11f4f5f1b87..3e4f1b7ad3d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1670,8 +1670,9 @@ CashDesk=Point of Sale CashDeskSetup=Point of Sales module setup CashDeskThirdPartyForSell=Default generic third party to use for sales CashDeskBankAccountForSell=Default account to use to receive cash payments -CashDeskBankAccountForCheque= Default account to use to receive payments by check -CashDeskBankAccountForCB= Default account to use to receive payments by credit cards +CashDeskBankAccountForCheque=Default account to use to receive payments by check +CashDeskBankAccountForCB=Default account to use to receive payments by credit cards +CashDeskBankAccountForSumup=Default bank account to use to receive payments by SumUp CashDeskDoNotDecreaseStock=Disable stock decrease when a sale is done from Point of Sale (if "no", stock decrease is done for each sale done from POS, irrespective of the option set in module Stock). CashDeskIdWareHouse=Force and restrict warehouse to use for stock decrease StockDecreaseForPointOfSaleDisabled=Stock decrease from Point of Sale disabled diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index a6b475508c9..2e82f0471bd 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -245,20 +245,6 @@ print ''; print $form->selectyesno("TAKEPOS_DIRECT_PAYMENT", $conf->global->TAKEPOS_DIRECT_PAYMENT, 1); print "\n"; -// Sumup options -if ($conf->global->TAKEPOS_ENABLE_SUMUP) { - print ''; - print $langs->trans("SumupAffiliate"); - print ''; - print ''; - print "\n"; - print ''; - print $langs->trans("SumupAppId"); - print ''; - print ''; - print "\n"; -} - // Custom Receipt print ''; print $langs->trans('CustomReceipt'); @@ -293,6 +279,32 @@ print "\n"; print ''; print ''; +// Sumup options +if ($conf->global->TAKEPOS_ENABLE_SUMUP) { + print '
'; + + print '
'; + print ''; + + print ''; + print ''; + print "\n"; + + print '\n"; + print '\n"; + + print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; + print $langs->trans("SumupAffiliate"); + print ''; + print ''; + print "
'; + print $langs->trans("SumupAppId"); + print ''; + print ''; + print "
'; + print '
'; +} + print '
'; print '
'; diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index b40bf2fba08..47930f91e59 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -178,7 +178,8 @@ else print "var received=0;"; } function ValidateSumup() { - + console.log("Launch ValidateSumup"); + var invoiceid = 0 ? $invoiceid : 0); ?>; var amountpayed = $("#change1").val(); if (amountpayed > total_ttc; ?>) { @@ -186,7 +187,7 @@ else print "var received=0;"; } // Starting sumup app - window.open('sumupmerchant://pay/1.0?affiliate-key=&app-id=&total=' + amountpayed + '¤cy=EUR&title=' + invoiceid + '&callback=/takepos/smpcb.php'); + window.open('sumupmerchant://pay/1.0?affiliate-key=global->TAKEPOS_SUMUP_AFFILIATE ?>&app-id=global->TAKEPOS_SUMUP_APPID ?>&total=' + amountpayed + '¤cy=EUR&title=' + invoiceid + '&callback=/takepos/smpcb.php'); var loop = window.setInterval(function () { $.ajax('/takepos/smpcb.php?status').done(function (data) { @@ -299,10 +300,15 @@ while ($i < count($paiements)) { $i = $i + 1; } -if ($conf->global->TAKEPOS_ENABLE_SUMUP && !empty(dolibarr_get_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"]))) { - ?> - - global->TAKEPOS_ENABLE_SUMUP) { + if (!empty($conf->global->$keyforsumupbank)) { + print ''; + } else { + $langs->load("errors"); + $langs->load("admin"); + print ''; + } } $class = ($i == 3) ? "calcbutton3" : "calcbutton2";