Merge pull request #10369 from mwelters/mwelters/addays
Add configurable days to SEPA Withdrawal Execution Date
This commit is contained in:
commit
c26f264cac
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -21,7 +22,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/admin/prelevement.php
|
* \file htdocs/admin/prelevement.php
|
||||||
* \ingroup prelevement
|
* \ingroup prelevement
|
||||||
* \brief Page configuration des prelevements
|
* \brief Page to setup Withdrawals
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
@ -82,15 +83,21 @@ if ($action == "set")
|
|||||||
}
|
}
|
||||||
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="")
|
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="")
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"),'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"),'chaine',0,'',$conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
}
|
}
|
||||||
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="")
|
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="")
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "USTRD", GETPOST("PRELEVEMENT_USTRD"),'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"),'chaine',0,'',$conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="")
|
||||||
|
{
|
||||||
|
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"),'chaine',0,'',$conf->entity);
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
} else
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@ -234,15 +241,21 @@ print '</tr>';
|
|||||||
//EntToEnd
|
//EntToEnd
|
||||||
print '<tr class="pair"><td>'.$langs->trans("END_TO_END").'</td>';
|
print '<tr class="pair"><td>'.$langs->trans("END_TO_END").'</td>';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->END_TO_END.'" size="15" ></td>';
|
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" size="15" ></td>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
//USTRD
|
//USTRD
|
||||||
print '<tr class="pair"><td>'.$langs->trans("USTRD").'</td>';
|
print '<tr class="pair"><td>'.$langs->trans("USTRD").'</td>';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->USTRD.'" size="15" ></td>';
|
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" size="15" ></td>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
//ADDDAYS
|
||||||
|
print '<tr class="pair"><td>'.$langs->trans("ADDDAYS").'</td>';
|
||||||
|
print '<td align="left">';
|
||||||
|
if (! $conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS=0;
|
||||||
|
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" size="15" ></td>';
|
||||||
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -1605,7 +1605,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf;
|
$XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <PmtId>'.$CrLf;
|
$XML_DEBITOR .=' <PmtId>'.$CrLf;
|
||||||
// $XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
// $XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||||
$XML_DEBITOR .=' <EndToEndId>'.(($conf->global->END_TO_END != "" ) ? $conf->global->END_TO_END : ('AS-'.dol_trunc($row_ref,20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
$XML_DEBITOR .=' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "" ) ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref,20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||||
$XML_DEBITOR .=' </PmtId>'.$CrLf;
|
$XML_DEBITOR .=' </PmtId>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
$XML_DEBITOR .=' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
||||||
$XML_DEBITOR .=' <DrctDbtTx>'.$CrLf;
|
$XML_DEBITOR .=' <DrctDbtTx>'.$CrLf;
|
||||||
@ -1638,7 +1638,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$XML_DEBITOR .=' <RmtInf>'.$CrLf;
|
$XML_DEBITOR .=' <RmtInf>'.$CrLf;
|
||||||
// $XML_DEBITOR .=' <Ustrd>'.($row_ref.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
|
// $XML_DEBITOR .=' <Ustrd>'.($row_ref.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
|
||||||
// $XML_DEBITOR .=' <Ustrd>'.dol_trunc($row_ref, 135).'</Ustrd>'.$CrLf; // 140 max
|
// $XML_DEBITOR .=' <Ustrd>'.dol_trunc($row_ref, 135).'</Ustrd>'.$CrLf; // 140 max
|
||||||
$XML_DEBITOR .=' <Ustrd>'.(($conf->global->USTRD != "" ) ? $conf->global->USTRD : dol_trunc($row_ref, 135) ).'</Ustrd>'.$CrLf; // 140 max
|
$XML_DEBITOR .=' <Ustrd>'.(($conf->global->PRELEVEMENT_USTRD != "" ) ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135) ).'</Ustrd>'.$CrLf; // 140 max
|
||||||
$XML_DEBITOR .=' </RmtInf>'.$CrLf;
|
$XML_DEBITOR .=' </RmtInf>'.$CrLf;
|
||||||
$XML_DEBITOR .=' </DrctDbtTxInf>'.$CrLf;
|
$XML_DEBITOR .=' </DrctDbtTxInf>'.$CrLf;
|
||||||
return $XML_DEBITOR;
|
return $XML_DEBITOR;
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2019 Markus Welters <markus@welters.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -67,7 +68,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
|
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
|
||||||
$bprev = new BonPrelevement($db);
|
$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->PRELEVEMENT_ADDDAYS), GETPOST('reyear'));
|
||||||
|
|
||||||
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format,$executiondate);
|
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format,$executiondate);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
|
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
|
||||||
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
|
-- Copyright (C) 2019 Markus Welters <markus@welters.de>
|
||||||
--
|
--
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- 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
|
-- it under the terms of the GNU General Public License as published by
|
||||||
@ -43,7 +44,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG
|
|||||||
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_LEVEL','7','chaine','Level of debug info to show',0,0);
|
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_LEVEL','7','chaine','Level of debug info to show',0,0);
|
||||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_UPLOAD_DOC','2048','chaine','Max size for file upload (0 means no upload allowed)',0,0);
|
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_UPLOAD_DOC','2048','chaine','Max size for file upload (0 means no upload allowed)',0,0);
|
||||||
|
|
||||||
-- Hidden but specific to one entity
|
-- Hidden but specific to one entity
|
||||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_OVERWRITE_TRANSLATION','1','chaine','Enable translation overwrite',0,1);
|
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_OVERWRITE_TRANSLATION','1','chaine','Enable translation overwrite',0,1);
|
||||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_DEFAULT_VALUES','1','chaine','Enable default value overwrite',0,1);
|
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_DEFAULT_VALUES','1','chaine','Enable default value overwrite',0,1);
|
||||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Monnaie',0,1);
|
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Monnaie',0,1);
|
||||||
|
|||||||
@ -256,3 +256,6 @@ CREATE TABLE llx_pos_cash_fence(
|
|||||||
import_key VARCHAR(14)
|
import_key VARCHAR(14)
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|
||||||
|
-- Withdrawals / Prelevements
|
||||||
|
UPDATE llx_const set name = 'PRELEVEMENT_END_TO_END' where name = 'END_TO_END');
|
||||||
|
UPDATE llx_const set name = 'PRELEVEMENT_USTRD' where name = 'USTRD');
|
||||||
@ -105,6 +105,7 @@ CreateForSepa=Create direct debit file
|
|||||||
ICS=Creditor Identifier CI
|
ICS=Creditor Identifier CI
|
||||||
END_TO_END="EndToEndId" SEPA XML tag - Unique id assigned per transaction
|
END_TO_END="EndToEndId" SEPA XML tag - Unique id assigned per transaction
|
||||||
USTRD="Unstructured" SEPA XML tag
|
USTRD="Unstructured" SEPA XML tag
|
||||||
|
ADDDAYS=Add days to Execution Date
|
||||||
|
|
||||||
### Notifications
|
### Notifications
|
||||||
InfoCreditSubject=Payment of direct debit payment order %s by the bank
|
InfoCreditSubject=Payment of direct debit payment order %s by the bank
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user