Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-01-24 15:30:10 +01:00
commit 33903cb5c7
5 changed files with 65 additions and 14 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Saasprov <saasprov@gmail.com>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018-2021 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* 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 '</td></tr>';
}
// Activate Bancontact
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code
{
print '<tr class="oddeven"><td>';
print $langs->trans("STRIPE_BANCONTACT").'</td><td>';
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 ' &nbsp; <span class="opacitymedium">'.$langs->trans("ExampleOnlyForBECustomers").'</span>';
print '</td></tr>';
}
// 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 '</td></tr>';
}
// Activate Giropay
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code
{
print '<tr class="oddeven"><td>';
print $langs->trans("STRIPE_GIROPAY").'</td><td>';
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 ' &nbsp; <span class="opacitymedium">'.$langs->trans("ExampleOnlyForDECustomers").'</span>';
print '</td></tr>';
}
// Activate Sofort
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // TODO Not used by current code
{
print '<tr class="oddeven"><td>';
print $langs->trans("STRIPE_SOFORT").'</td><td>';
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 ' &nbsp; <span class="opacitymedium">'.$langs->trans("ExampleOnlyForATBEDEITNLESCustomers").'</span>';
print '</td></tr>';
}
// Warehouse for automatic decrement
//if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // warehouse to reduce stock for online payment
//{

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
/* Copyright (C) 2018-2021 Thibault FOUCART <support@ptibogxiv.net>
*
* 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