Add configurable days to SEPA Withdrawal Execution Date

This commit is contained in:
markus 2019-01-18 16:16:55 +01:00
parent 58bda12e22
commit de9b8f427d
3 changed files with 15 additions and 2 deletions

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Markus Welters <markus@welters.de>
*
* 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
@ -21,7 +22,7 @@
/**
* \file htdocs/admin/prelevement.php
* \ingroup prelevement
* \brief Page configuration des prelevements
* \brief Page to setup Withdrawals
*/
require '../main.inc.php';
@ -91,6 +92,12 @@ if ($action == "set")
if (! $res > 0) $error++;
}
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="")
{
$res = dolibarr_set_const($db, "ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
if (! $error)
{
$db->commit();
@ -243,6 +250,11 @@ print '<td class="left">';
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->USTRD.'" size="15" ></td>';
print '</td></tr>';
//ADDDAYS
print '<tr class="pair"><td>'.$langs->trans("ADDDAYS").'</td>';
print '<td align="left">';
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->ADDDAYS.'" size="15" ></td>';
print '</td></tr>';
print '</table>';
print '<br>';

View File

@ -67,7 +67,7 @@ if ($action == 'create')
{
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
$bprev = new BonPrelevement($db);
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), (GETPOST('reday')+$conf->global->ADDDAYS), GETPOST('reyear'));
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format,$executiondate);
if ($result < 0)

View File

@ -105,6 +105,7 @@ CreateForSepa=Create direct debit file
ICS=Creditor Identifier CI
END_TO_END="EndToEndId" SEPA XML tag - Unique id assigned per transaction
USTRD="Unstructured" SEPA XML tag
ADDDAYS=Add days to Execution Date
### Notifications
InfoCreditSubject=Payment of direct debit payment order %s by the bank