diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index c47255647cb..71839ecf08a 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -150,7 +150,7 @@ $userstatic = new User($db); $bankaccountstatic = new Account($db); $chargestatic = new ChargeSociales($db); $paymentdonstatic = new PaymentDonation($db); -$paymentvatstatic = new TVA($db); +$paymentvatstatic = new Tva($db); $paymentsalstatic = new PaymentSalary($db); $paymentexpensereportstatic = new PaymentExpenseReport($db); $paymentvariousstatic = new PaymentVarious($db); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 63021eb3b07..ae0840c5b86 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -286,8 +286,9 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) $cat1 = GETPOST("cat1", 'alpha'); $bankaccountid = $id; - if (GETPOST('add_account', 'int') > 0) $bankaccountid = GETPOST('add_account', 'int'); - + if (GETPOST('add_account', 'int') > 0) { + $bankaccountid = GETPOST('add_account', 'int'); + } if (!$dateop) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); @@ -304,8 +305,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); } - if (!$bankaccountid > 0) - { + if (!$bankaccountid > 0) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); } @@ -315,8 +315,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) $error++; }*/ - if (!$error && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) - { + if (!$error && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { $objecttmp = new Account($db); $objecttmp->fetch($bankaccountid); $insertid = $objecttmp->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user, '', '', $search_accountancy_code); @@ -368,7 +367,7 @@ $donstatic = new Don($db); $paymentstatic = new Paiement($db); $paymentsupplierstatic = new PaiementFourn($db); $paymentscstatic = new PaymentSocialContribution($db); -$paymentvatstatic = new TVA($db); +$paymentvatstatic = new Tva($db); $paymentsalstatic = new PaymentSalary($db); $paymentdonationstatic = new PaymentDonation($db); $paymentvariousstatic = new PaymentVarious($db); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 9a534b76320..c14c1bf6ab5 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -199,7 +199,7 @@ $chargestatic = new ChargeSociales($db); $memberstatic = new Adherent($db); $paymentstatic = new Paiement($db); $paymentsupplierstatic = new PaiementFourn($db); -$paymentvatstatic = new TVA($db); +$paymentvatstatic = new Tva($db); $bankstatic = new Account($db); $banklinestatic = new AccountLine($db); $remisestatic = new RemiseCheque($db); diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index c304a00ce3f..efa8472ce78 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2017 Olivier Geffroy * Copyright (C) 2017 Saasprov - * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2018-2021 Thibault FOUCART * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -387,6 +387,21 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code print ''; } +// Activate Bancontact +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code +{ + print ''; + print $langs->trans("STRIPE_BANCONTACT").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STRIPE_BANCONTACT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STRIPE_BANCONTACT", $arrval, $conf->global->STRIPE_BANCONTACT); + } + print '   '.$langs->trans("ExampleOnlyForBECustomers").''; + print ''; +} + // Activate iDEAL if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code { @@ -402,6 +417,36 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code print ''; } +// Activate Giropay +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code +{ + print ''; + print $langs->trans("STRIPE_GIROPAY").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STRIPE_GIROPAY'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STRIPE_GIROPAY", $arrval, $conf->global->STRIPE_GIROPAY); + } + print '   '.$langs->trans("ExampleOnlyForDECustomers").''; + print ''; +} + +// Activate Sofort +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code +{ + print ''; + print $langs->trans("STRIPE_SOFORT").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STRIPE_SOFORT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STRIPE_SOFORT", $arrval, $conf->global->STRIPE_SOFORT); + } + print '   '.$langs->trans("ExampleOnlyForATBEDEITNLESCustomers").''; + print ''; +} + // Warehouse for automatic decrement //if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment //{ diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index db225196ea7..97d45a49a1f 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018-2021 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -409,7 +409,10 @@ class Stripe extends CommonObject // list of payment method types $paymentmethodtypes = array("card"); if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) $paymentmethodtypes[] = "sepa_debit"; //&& ($object->thirdparty->isInEEC()) - if (!empty($conf->global->STRIPE_IDEAL)) $paymentmethodtypes[] = "ideal"; //&& ($object->thirdparty->isInEEC()) + if (!empty($conf->global->STRIPE_BANCONTACT)) $paymentmethodtypes[] = "bancontact"; + if (!empty($conf->global->STRIPE_IDEAL)) $paymentmethodtypes[] = "ideal"; + if (!empty($conf->global->STRIPE_GIROPAY)) $paymentmethodtypes[] = "giropay"; + if (!empty($conf->global->STRIPE_SOFORT)) $paymentmethodtypes[] = "sofort"; $dataforintent = array( "confirm" => $confirmnow, // Do not confirm immediatly during creation of intent @@ -430,8 +433,9 @@ class Stripe extends CommonObject if ($off_session) { unset($dataforintent['setup_future_usage']); - $dataforintent["off_session"] = true; + $dataforintent["setup_future_usage"] = "off_session"; } + if (!empty($conf->global->STRIPE_GIROPAY)) unset($dataforintent['setup_future_usage']); if (!is_null($payment_method)) { $dataforintent["payment_method"] = $payment_method; @@ -578,7 +582,10 @@ class Stripe extends CommonObject // list of payment method types $paymentmethodtypes = array("card"); if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) $paymentmethodtypes[] = "sepa_debit"; //&& ($object->thirdparty->isInEEC()) - // iDEAL not supported with setupIntent + if (!empty($conf->global->STRIPE_BANCONTACT)) $paymentmethodtypes[] = "bancontact"; + if (!empty($conf->global->STRIPE_IDEAL)) $paymentmethodtypes[] = "ideal"; + // Giropay not possible for setup intent + if (!empty($conf->global->STRIPE_SOFORT)) $paymentmethodtypes[] = "sofort"; $dataforintent = array( "confirm" => $confirmnow, // Do not confirm immediatly during creation of intent