Hello community, here is the log from the commit of package aqbanking for openSUSE:Factory checked in at 2014-03-31 20:42:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/aqbanking (Old) and /work/SRC/openSUSE:Factory/.aqbanking.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "aqbanking" Changes: -------- --- /work/SRC/openSUSE:Factory/aqbanking/aqbanking.changes 2014-03-04 13:20:16.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.aqbanking.new/aqbanking.changes 2014-03-31 20:42:27.000000000 +0200 @@ -1,0 +2,6 @@ +Mon Mar 31 09:23:53 UTC 2014 - jcnengel@gmail.com + +- Update to 5.4.2beta + + Introduce command sepadebitnotes for aqbanking-cli + +------------------------------------------------------------------- Old: ---- aqbanking-5.4.1beta.tar.gz New: ---- aqbanking-5.4.2beta.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aqbanking.spec ++++++ --- /var/tmp/diff_new_pack.Khz8RJ/_old 2014-03-31 20:42:28.000000000 +0200 +++ /var/tmp/diff_new_pack.Khz8RJ/_new 2014-03-31 20:42:28.000000000 +0200 @@ -26,7 +26,7 @@ %define q4b_cfgmoddir %{fronts_libdir}/q4banking/cfgmodules Name: aqbanking -Version: 5.4.1beta +Version: 5.4.2beta Release: 0 Summary: Library for Online Banking Functions and Financial Data Import and Export License: GPL-2.0 or GPL-3.0 ++++++ aqbanking-5.4.1beta.tar.gz -> aqbanking-5.4.2beta.tar.gz ++++++ ++++ 1793 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/ChangeLog new/aqbanking-5.4.2beta/ChangeLog --- old/aqbanking-5.4.1beta/ChangeLog 2014-03-02 15:48:30.000000000 +0100 +++ new/aqbanking-5.4.2beta/ChangeLog 2014-03-30 21:54:42.000000000 +0200 @@ -1,6 +1,39 @@ ------------------------------------------------------------------ -2014-03-02 15:48:17 +0100 Martin Preuss +2014-03-30 00:10:53 +0000 martin +CSV: Added a profile for SEPA debit notes. +This profile can be used to import SEPA debit notes to be send to a bank. + +git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2547 5c42a225-8b10-0410-9873-89b7810ad06e + +------------------------------------------------------------------ +2014-03-25 21:58:38 +0000 martin +CSV-ImExporter: Added SEPA debit note fields to "full" profile. +git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2546 5c42a225-8b10-0410-9873-89b7810ad06e + +------------------------------------------------------------------ +2014-03-25 21:51:24 +0000 martin +AqBanking-CLI: Added command "sepadebitnotes" +This command reads multiple debit notes from a file. + +git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2545 5c42a225-8b10-0410-9873-89b7810ad06e + +------------------------------------------------------------------ +2014-03-25 21:49:57 +0000 martin +AqBanking-CLI: Fixed a typo. +git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2544 5c42a225-8b10-0410-9873-89b7810ad06e + +------------------------------------------------------------------ +2014-03-24 21:45:23 +0000 martin +AqHBCI: Started supporting COR1 SEPA debit notes. +Those new jobs aren't used ATM, we still have to figure out a way to select +this type of jobs. + +git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2543 5c42a225-8b10-0410-9873-89b7810ad06e + +------------------------------------------------------------------ +2014-03-02 14:49:50 +0000 martin Prepared release 5.4.1beta. +git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2542 5c42a225-8b10-0410-9873-89b7810ad06e ------------------------------------------------------------------ 2014-03-01 20:23:13 +0000 martin @@ -626,35 +659,3 @@ 2014-01-08 22:26:37 +0000 martin AqHBCI: Fixed limits for remote name in SEPA jobs. git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2448 5c42a225-8b10-0410-9873-89b7810ad06e - ------------------------------------------------------------------- -2014-01-08 22:25:28 +0000 martin -HHD: Addd function AH_HHD14_AddChallengeParams_32(). -git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2447 5c42a225-8b10-0410-9873-89b7810ad06e - ------------------------------------------------------------------- -2014-01-08 22:24:18 +0000 martin -Make AB_TRANSACTION_LIST public. -git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2446 5c42a225-8b10-0410-9873-89b7810ad06e - ------------------------------------------------------------------- -2014-01-08 19:53:02 +0000 mlenk -Fix check for Gwenhywfar version -Gwenhywfar 4.9.0 is required for GWEN_HTTP_SESSION_FLAGS_TLS_ONLY_SAFE_CIPHERS - -git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2445 5c42a225-8b10-0410-9873-89b7810ad06e - ------------------------------------------------------------------- -2014-01-07 20:44:55 +0000 martin -AqHBCI: Fallback to old SingleDebit job if SepaDebitDatedSingleCreate is not supported. -This is just a hack because the old job is no longer maintained by the -SEPA extension to FinTS. - -Next task will be to provide a job SepaDebitDatedMultiCreate. - -git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2444 5c42a225-8b10-0410-9873-89b7810ad06e - ------------------------------------------------------------------- -2014-01-07 20:43:47 +0000 martin -aqbanking-cli: Use AB_Banking_FillGapsInTransaction(). -git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@2443 5c42a225-8b10-0410-9873-89b7810ad06e diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/aqbanking.iss new/aqbanking-5.4.2beta/aqbanking.iss --- old/aqbanking-5.4.1beta/aqbanking.iss 2014-03-02 15:47:28.000000000 +0100 +++ new/aqbanking-5.4.2beta/aqbanking.iss 2014-03-30 21:53:30.000000000 +0200 @@ -8,7 +8,7 @@ [Setup] ; Using the name here directly because we want it capitalized AppName=AqBanking -AppVerName=AqBanking 5.4.1beta +AppVerName=AqBanking 5.4.2beta AppPublisher=AqBanking Development Team AppPublisherURL=http://sourceforge.net/projects/aqbanking AppSupportURL=http://sourceforge.net/support/getsupport.php?group_id=115695 @@ -18,7 +18,7 @@ DirExistsWarning=no InfoAfterFile=README LicenseFile=COPYING -OutputBaseFilename=aqbanking-5.4.1beta-setup +OutputBaseFilename=aqbanking-5.4.2beta-setup OutputDir=. UninstallFilesDir={app}\uninstall\aqbanking @@ -151,7 +151,7 @@ StringChange(FileString, '@'+'aqbanking_pkgdatadir@', pkgdatadir); StringChange(FileString, '@'+'AQBANKING_VERSION_MAJOR@', '5'); StringChange(FileString, '@'+'AQBANKING_VERSION_MINOR@', '4'); - StringChange(FileString, '@'+'AQBANKING_VERSION_PATCHLEVEL@', '1'); + StringChange(FileString, '@'+'AQBANKING_VERSION_PATCHLEVEL@', '2'); StringChange(FileString, '@'+'AQBANKING_VERSION_BUILD@', '0'); StringChange(FileString, '@'+'AQBANKING_VERSION_TAG@', 'beta'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/aqbanking.spec new/aqbanking-5.4.2beta/aqbanking.spec --- old/aqbanking-5.4.1beta/aqbanking.spec 2014-03-02 15:47:28.000000000 +0100 +++ new/aqbanking-5.4.2beta/aqbanking.spec 2014-03-30 21:53:30.000000000 +0200 @@ -2,7 +2,7 @@ # neededforbuild gwenhywfar gwenhywfar-devel ktoblzcheck python python-ctypes pyyxml libchipcard2-devel libchipcard2 pkgconfig gettext-devel libacl-devel libacl libattr-devel libattr %define name aqbanking -%define version 5.4.1beta +%define version 5.4.2beta %define dist %define disttag diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/configure.ac new/aqbanking-5.4.2beta/configure.ac --- old/aqbanking-5.4.1beta/configure.ac 2014-03-02 15:47:03.000000000 +0100 +++ new/aqbanking-5.4.2beta/configure.ac 2014-03-30 21:53:11.000000000 +0200 @@ -25,7 +25,7 @@ AQBANKING_VERSION_MAJOR=5 AQBANKING_VERSION_MINOR=4 -AQBANKING_VERSION_PATCHLEVEL=1 +AQBANKING_VERSION_PATCHLEVEL=2 AQBANKING_VERSION_BUILD=0 dnl "stable", "rcX", "betaX", "svn" AQBANKING_VERSION_TAG="beta" @@ -43,7 +43,7 @@ AQBANKING_SO_CURRENT=38 AQBANKING_SO_AGE=4 -AQBANKING_SO_REVISION=1 +AQBANKING_SO_REVISION=2 AQBANKING_SO_EFFECTIVE="`echo \$(($AQBANKING_SO_CURRENT-$AQBANKING_SO_AGE))`" # @@ -1431,6 +1431,7 @@ src/plugins/imexporters/csv/profiles/cli-transfers.conf src/plugins/imexporters/csv/profiles/sns.conf src/plugins/imexporters/csv/profiles/transfers.conf + src/plugins/imexporters/csv/profiles/sepadebitnotes.conf src/plugins/imexporters/openhbci1/Makefile src/plugins/imexporters/openhbci1/openhbci1.xml src/plugins/imexporters/openhbci1/profiles/Makefile @@ -1454,8 +1455,11 @@ src/plugins/imexporters/sepa/profiles/ccm.conf src/plugins/imexporters/sepa/profiles/001_002_03.conf src/plugins/imexporters/sepa/profiles/008_001_01.conf + src/plugins/imexporters/sepa/profiles/008_001_01_cor1.conf src/plugins/imexporters/sepa/profiles/008_002_02.conf + src/plugins/imexporters/sepa/profiles/008_002_02_cor1.conf src/plugins/imexporters/sepa/profiles/008_003_02.conf + src/plugins/imexporters/sepa/profiles/008_003_02_cor1.conf src/plugins/imexporters/ctxfile/Makefile src/plugins/imexporters/ctxfile/ctxfile.xml src/plugins/imexporters/ctxfile/profiles/Makefile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/i18nsources new/aqbanking-5.4.2beta/i18nsources --- old/aqbanking-5.4.1beta/i18nsources 2014-03-02 15:47:32.000000000 +0100 +++ new/aqbanking-5.4.2beta/i18nsources 2014-03-30 21:53:31.000000000 +0200 @@ -170,6 +170,7 @@ src/plugins/backends/aqhbci/plugin/accountjobs/jobsepadebitdatedmulticreate.c src/plugins/backends/aqhbci/plugin/accountjobs/jobsepaxfersingle.c src/plugins/backends/aqhbci/plugin/accountjobs/jobsepadebitsingle.c +src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.c src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase.c src/plugins/backends/aqhbci/plugin/accountjobs/jobsepastandingordercreate.c src/plugins/backends/aqhbci/plugin/applayer/adminjobs.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/Makefile.am new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/Makefile.am --- old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/Makefile.am 2014-01-17 22:54:38.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/Makefile.am 2014-03-24 21:45:34.000000000 +0100 @@ -39,6 +39,8 @@ jobsepaxfersingle_p.h \ jobsepadebitsingle_l.h \ jobsepadebitsingle_p.h \ + jobsepacor1datedsinglecreate_l.h \ + jobsepacor1datedsinglecreate_p.h \ jobtransferbase_l.h jobtransferbase_p.h \ jobsepastandingordercreate_l.h jobsepastandingordercreate_p.h @@ -57,6 +59,7 @@ jobsepadebitdatedmulticreate.c \ jobsepaxfersingle.c \ jobsepadebitsingle.c \ + jobsepacor1datedsinglecreate.c \ jobtransferbase.c \ jobsepastandingordercreate.c @@ -92,6 +95,7 @@ $(srcdir)/jobsepadebitdatedmulticreate.xml \ $(srcdir)/jobsepaxfersingle.xml \ $(srcdir)/jobsepadebitsingle.xml \ + $(srcdir)/jobsepacor1datedsinglecreate.xml \ $(srcdir)/jobsepastandingordercreate.xml \ $(srcdir)/jobsepastandingorderget.xml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.c new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.c --- old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.c 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.c 2014-03-24 22:42:22.000000000 +0100 @@ -0,0 +1,257 @@ +/*************************************************************************** + begin : Tue Dec 31 2013 + copyright : (C) 2004-2013 by Martin Preuss + email : martin@libchipcard.de + + *************************************************************************** + * Please see toplevel file COPYING for license details * + ***************************************************************************/ + + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + + +#include "jobsepacor1datedsinglecreate_p.h" +#include "jobtransferbase_l.h" +#include "aqhbci_l.h" +#include "accountjob_l.h" +#include "job_l.h" +#include "provider_l.h" +#include "hhd_l.h" +#include <gwenhywfar/debug.h> +#include <gwenhywfar/misc.h> +#include <gwenhywfar/inherit.h> +#include <gwenhywfar/text.h> + +#include <aqbanking/jobsepadebitnote_be.h> +#include <aqbanking/job_be.h> + +#include <stdlib.h> +#include <assert.h> +#include <string.h> + + + + +/* --------------------------------------------------------------- FUNCTION */ +AH_JOB *AH_Job_SepaCor1DebitDatedSingleCreate_new(AB_USER *u, AB_ACCOUNT *account) { + AH_JOB *j; + GWEN_DB_NODE *dbArgs; + + j=AH_Job_TransferBase_new("JobSepaCor1DebitDatedSingleCreate", + AB_Transaction_TypeSepaDebitNote, + AB_Transaction_SubTypeStandard, + u, account); + if (!j) + return 0; + + AH_Job_SetChallengeClass(j, 29); + + /* overwrite some virtual functions */ + AH_Job_SetPrepareFn(j, AH_Job_SepaCor1DebitDatedSingleCreate_Prepare); + AH_Job_SetAddChallengeParamsFn(j, AH_Job_SepaCor1DebitDatedSingleCreate_AddChallengeParams); + + /* overwrite virtual functions of transferBase class */ + AH_Job_TransferBase_SetExchangeParamsFn(j, AH_Job_SepaCor1DebitDatedSingleCreate_ExchangeParams); + AH_Job_TransferBase_SetExchangeArgsFn(j, AH_Job_TransferBase_ExchangeArgs_SepaDatedDebit); + + /* set some known arguments */ + dbArgs=AH_Job_GetArguments(j); + assert(dbArgs); + + AH_Job_TransferBase_LoadSepaDescriptors(j); + + return j; +} + + + +/* --------------------------------------------------------------- FUNCTION */ +int AH_Job_SepaCor1DebitDatedSingleCreate_ExchangeParams(AH_JOB *j, AB_JOB *bj, + AB_IMEXPORTER_CONTEXT *ctx) { + AB_TRANSACTION_LIMITS *lim; + GWEN_DB_NODE *dbParams; + int i, i1, i2; + + DBG_INFO(AQHBCI_LOGDOMAIN, "Exchanging params"); + + dbParams=AH_Job_GetParams(j); + DBG_DEBUG(AQHBCI_LOGDOMAIN, "Have this parameters to exchange:"); + if (GWEN_Logger_GetLevel(AQHBCI_LOGDOMAIN)>=GWEN_LoggerLevel_Debug) + GWEN_DB_Dump(dbParams, 2); + + /* set some default limits */ + lim=AB_TransactionLimits_new(); + AB_TransactionLimits_SetMaxLenPurpose(lim, 35); + AB_TransactionLimits_SetMaxLinesPurpose(lim, 4); + AB_TransactionLimits_SetMaxLenRemoteName(lim, 27); + AB_TransactionLimits_SetMaxLinesRemoteName(lim, 1); + + AB_TransactionLimits_SetNeedDate(lim, 1); + + /* set info from BPD */ + i1=GWEN_DB_GetIntValue(dbParams, "minDelay_FNAL_RCUR", 0, 0); + AB_TransactionLimits_SetMinValueSetupTimeRecurring(lim, i1); + AB_TransactionLimits_SetMinValueSetupTimeFinal(lim, i1); + + i2=GWEN_DB_GetIntValue(dbParams, "minDelay_FRST_OOFF", 0, 0); + AB_TransactionLimits_SetMinValueSetupTimeFirst(lim, i2); + AB_TransactionLimits_SetMinValueSetupTimeOnce(lim, i2); + + /* combine into minimum values for older apps */ + i=(i1>i2)?i1:i2; + AB_TransactionLimits_SetMinValueSetupTime(lim, i); + + i1=GWEN_DB_GetIntValue(dbParams, "maxDelay_FNAL_RCUR", 0, 0); + AB_TransactionLimits_SetMaxValueSetupTimeRecurring(lim, i1); + AB_TransactionLimits_SetMinValueSetupTimeFinal(lim, i1); + + i2=GWEN_DB_GetIntValue(dbParams, "maxDelay_FRST_OOFF", 0, 0); + AB_TransactionLimits_SetMaxValueSetupTimeFirst(lim, i2); + AB_TransactionLimits_SetMaxValueSetupTimeOnce(lim, i2); + + /* combine into minimum values for older apps */ + i=(i1<i2)?i1:i2; + AB_TransactionLimits_SetMaxValueSetupTime(lim, i); + + AB_Job_SetFieldLimits(bj, lim); + AB_TransactionLimits_free(lim); + + return 0; +} + + + +/* --------------------------------------------------------------- FUNCTION */ +int AH_Job_SepaCor1DebitDatedSingleCreate_AddChallengeParams(AH_JOB *j, int hkTanVer, GWEN_DB_NODE *dbMethod) { + const AB_TRANSACTION *t; + const char *s; + int tanVer=AH_JOB_TANVER_1_4; + + DBG_ERROR(AQHBCI_LOGDOMAIN, "AddChallengeParams function called"); + + t=AH_Job_GetFirstTransfer(j); + if (t==NULL) { + DBG_ERROR(AQHBCI_LOGDOMAIN, "No validated transaction"); + return GWEN_ERROR_INVALID; + } + + s=GWEN_DB_GetCharValue(dbMethod, "zkaTanVersion", 0, NULL); + if (s && *s && strncasecmp(s, "1.3", 3)==0) { + DBG_ERROR(AQHBCI_LOGDOMAIN, "TAN version is 1.3 (%s)", s); + tanVer=AH_JOB_TANVER_1_3; + } + + if (tanVer==AH_JOB_TANVER_1_4) { + int rv; + + DBG_ERROR(AQHBCI_LOGDOMAIN, "TAN version is 1.4.x"); + rv=AH_HHD14_AddChallengeParams_29(j, + AB_Transaction_GetValue(t), + AB_Transaction_GetRemoteIban(t), + AB_Transaction_GetDate(t)); + if (rv<0) { + DBG_INFO(AQHBCI_LOGDOMAIN, "here (%d)", rv); + return rv; + } + } + else { + DBG_ERROR(AQHBCI_LOGDOMAIN, "Unhandled tan version %d for now", tanVer); + return GWEN_ERROR_INTERNAL; + } + return 0; +} + + + +/* --------------------------------------------------------------- FUNCTION */ +int AH_Job_SepaCor1DebitDatedSingleCreate_Prepare(AH_JOB *j) { + GWEN_DB_NODE *dbArgs; + AB_BANKING *ab; + AB_USER *u; + int rv; + const char *profileName=""; + const char *descriptor=""; + const char *s; + AB_TRANSACTION *t; + GWEN_BUFFER *dbuf; + + DBG_INFO(AQHBCI_LOGDOMAIN, "Preparing transfer"); + + ab=AH_Job_GetBankingApi(j); + assert(ab); + + u=AH_Job_GetUser(j); + assert(u); + + dbArgs=AH_Job_GetArguments(j); + + /* choose from HISPAS */ + /* first check for any descriptor for pain 008.003.02 */ + s=AH_Job_TransferBase_FindSepaDescriptor(j, "*008.003.02*"); + if (s) { + profileName="008_003_02_cor1"; + descriptor=s; + } + if (!(descriptor && *descriptor)) { + /* look for pain 008.002.02 */ + s=AH_Job_TransferBase_FindSepaDescriptor(j, "*008.002.02*"); + if (s) { + profileName="008_002_02_cor1"; + descriptor=s; + } + } + if (!(descriptor && *descriptor)) { + /* look for pain 008.001.01 */ + s=AH_Job_TransferBase_FindSepaDescriptor(j, "*008.001.01*"); + if (s) { + profileName="008_001_01_cor1"; + descriptor=s; + } + } + + /* check for valid descriptor */ + if (!(descriptor && *descriptor)) { + DBG_ERROR(AQHBCI_LOGDOMAIN, "No SEPA descriptor found, please update your SEPA account information"); + return GWEN_ERROR_GENERIC; + } + DBG_INFO(AQHBCI_LOGDOMAIN, "Using SEPA descriptor %s", descriptor); + + + /* add transactions to ImExporter context */ + t=AH_Job_GetFirstTransfer(j); + if (t==NULL) { + DBG_ERROR(AQHBCI_LOGDOMAIN, "No transaction in job"); + assert(t); /* debug */ + return GWEN_ERROR_INTERNAL; + } + + /* export transfers to SEPA */ + dbuf=GWEN_Buffer_new(0, 256, 0, 1); + rv=AH_Job_TransferBase_SepaExportTransactions(j, profileName, dbuf); + if (rv<0) { + DBG_INFO(AQHBCI_LOGDOMAIN, "here (%d)", rv); + GWEN_Buffer_free(dbuf); + return rv; + } + + /* store descriptor */ + GWEN_DB_SetCharValue(dbArgs, + GWEN_DB_FLAGS_OVERWRITE_VARS, + "descriptor", + descriptor); + /* store transfer */ + GWEN_DB_SetBinValue(dbArgs, + GWEN_DB_FLAGS_OVERWRITE_VARS, + "transfer", + GWEN_Buffer_GetStart(dbuf), + GWEN_Buffer_GetUsedBytes(dbuf)); + GWEN_Buffer_free(dbuf); + + return 0; +} + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.xml new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.xml --- old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate.xml 2014-03-24 21:48:52.000000000 +0100 @@ -0,0 +1,104 @@ + +<SEGs> + + + <!-- + --------------------------------------------------------------------- + Geschaeftsvorfall: SEPA Terminierte Einzellastschrift (Version 1) + --------------------------------------------------------------------- + --> + + + <!-- Kundennachricht --> + <SEGdef id="SepaCor1DebitDatedSingleCreate" + code="HKDSC" + version="1" + delimiter="+" + terminator="'" + > + <GROUP type="SegHead" name="head" /> + <GROUP type="kti_i" version="1" /> + <ELEM name="descriptor" type="ascii" maxsize="256" /> + <ELEM name="transfer" type="bin" trustlevel="4" /> + <VALUES> + <VALUE path="head/code">%code</VALUE> + <VALUE path="head/version">%version</VALUE> + </VALUES> + </SEGdef> + + + <!-- Banknachricht --> + <SEGdef id="SepaCor1DebitDatedSingleCreateResponse" code="HIDSC" version="1" + delimiter="+" terminator="'" > + <GROUP type="SegHead" name="head" /> + <ELEM name="referenceId" type="AN" maxsize="99" minnum="0" /> + <VALUES> + <VALUE path="head/code">%code</VALUE> + <VALUE path="head/version">%version</VALUE> + </VALUES> + </SEGdef> + + + <!-- Beschreibungssegment --> + <SEGdef code="HIDSCS" version="1" + delimiter=":" terminator="'" isbpdjob="1" > + <GROUP type="BPDJob" version="2" /> + + <ELEM name="minDelay_FNAL_RCUR" type="num" maxsize="4" /> + <ELEM name="maxdelay_FNAL_RCUR" type="num" maxsize="4" /> + <ELEM name="minDelay_FRST_OOFF" type="num" maxsize="4" /> + <ELEM name="maxdelay_FRST_OOFF" type="num" maxsize="4" /> + <GROUP name="SupportedPurposeCodes" delimiter=":" terminator="" > + <ELEM name="Code" type="ascii" maxsize="4096" minnum="0" maxnum="99" /> + </GROUP> + <GROUP name="SupportedSepaFormats" delimiter=":" terminator="" > + <ELEM name="Format" type="ascii" maxsize="256" minnum="0" maxnum="9" /> + </GROUP> + + <VALUES> + <VALUE path="head/code">%code</VALUE> + <VALUE path="head/version">%version</VALUE> + </VALUES> + </SEGdef> + + + +</SEGs> + + + +<JOBs> + + <!-- Geschaeftsvorfall: SEPA Terminierte Einzellastschrift (Version 1) --> + <JOBdef id="JobSepaCor1DebitDatedSingleCreate" + code="HKDSE" + params="HIDSCS" + version="1" + crypt="1" + sign="1" + needBPD="1" + response="SepaCor1DebitDatedSingleCreateResponse" + > + <SEG type="SepaCor1DebitDatedSingleCreate" version="1" /> + <VALUES> + <VALUE path="head/code">%code</VALUE> + <VALUE path="head/version">%version</VALUE> + </VALUES> + </JOBdef> + + + +</JOBs> + + + + + + + + + + + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate_l.h new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate_l.h --- old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate_l.h 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate_l.h 2014-03-24 21:26:32.000000000 +0100 @@ -0,0 +1,23 @@ +/*************************************************************************** + begin : Mon Mar 01 2004 + copyright : (C) 2004-2013 by Martin Preuss + email : martin@libchipcard.de + + *************************************************************************** + * Please see toplevel file COPYING for license details * + ***************************************************************************/ + + +#ifndef AH_JOBSEPACOR1DEBITDATEDSINGLECREATE_L_H +#define AH_JOBSEPACOR1DEBITDATEDSINGLECREATE_L_H + + +#include "accountjob_l.h" + + +AH_JOB *AH_Job_SepaCor1DebitDatedSingleCreate_new(AB_USER *u, AB_ACCOUNT *account); + + +#endif /* AH_JOBSEPACOR1DEBITDATEDSINGLECREATE_L_H */ + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate_p.h new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate_p.h --- old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobsepacor1datedsinglecreate_p.h 2014-03-24 22:36:59.000000000 +0100 @@ -0,0 +1,31 @@ +/*************************************************************************** + begin : Tue Dec 31 2013 + copyright : (C) 2004-2013 by Martin Preuss + email : martin@libchipcard.de + + *************************************************************************** + * Please see toplevel file COPYING for license details * + ***************************************************************************/ + + +#ifndef AH_JOBSEPACOR1DEBITDATEDSINGLECREATE_P_H +#define AH_JOBSEPACOR1DEBITDATEDSINGLECREATE_P_H + + +#include "jobsepacor1datedsinglecreate_l.h" +#include <gwenhywfar/db.h> + + + +static int AH_Job_SepaCor1DebitDatedSingleCreate_ExchangeParams(AH_JOB *j, AB_JOB *bj, + AB_IMEXPORTER_CONTEXT *ctx); + +static int AH_Job_SepaCor1DebitDatedSingleCreate_AddChallengeParams(AH_JOB *j, int hkTanVer, GWEN_DB_NODE *dbMethod); +static int AH_Job_SepaCor1DebitDatedSingleCreate_Prepare(AH_JOB *j); + + + +#endif /* AH_JOBSEPACOR1DEBITDATEDSINGLECREATE_P_H */ + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase.c new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase.c --- old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase.c 2014-02-03 21:40:32.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase.c 2014-03-24 22:42:09.000000000 +0100 @@ -71,6 +71,7 @@ aj=(AH_JOB_TRANSFERBASE*)p; free(aj->fiid); + GWEN_StringList_free(aj->sepaDescriptors); GWEN_FREE_OBJECT(aj); } @@ -587,6 +588,77 @@ +/* --------------------------------------------------------------- FUNCTION */ +void AH_Job_TransferBase_LoadSepaDescriptors(AH_JOB *j){ + AH_JOB_TRANSFERBASE *aj; + GWEN_DB_NODE *dbParams; + GWEN_DB_NODE *dbT; + + assert(j); + aj=GWEN_INHERIT_GETDATA(AH_JOB, AH_JOB_TRANSFERBASE, j); + assert(aj); + + /* get params */ + dbParams=AH_Job_GetParams(j); + assert(dbParams); + + if (aj->sepaDescriptors==NULL) + aj->sepaDescriptors=GWEN_StringList_new(); + else + GWEN_StringList_Clear(aj->sepaDescriptors); + + /* read supported SEPA formats */ + dbT=GWEN_DB_FindFirstGroup(dbParams, "SupportedSepaFormats"); + if (!dbT) { + DBG_ERROR(AQHBCI_LOGDOMAIN, "No SEPA descriptor found"); + GWEN_DB_Dump(dbParams, 2); + } + while(dbT) { + int i; + + for (i=0; i<100; i++) { + const char *s; + + s=GWEN_DB_GetCharValue(dbT, "format", i, NULL); + if (! (s && *s)) + break; + GWEN_StringList_AppendString(aj->sepaDescriptors, s, 0, 1); + DBG_INFO(AQHBCI_LOGDOMAIN, + "Adding SEPA descriptor [%s] for GV %s", + s, AH_Job_GetName(j)); + } + + dbT=GWEN_DB_FindNextGroup(dbT, "SupportedSepaFormats"); + } +} + + + +/* --------------------------------------------------------------- FUNCTION */ +const char *AH_Job_TransferBase_FindSepaDescriptor(AH_JOB *j, const char *tmpl) { + AH_JOB_TRANSFERBASE *aj; + + assert(j); + aj=GWEN_INHERIT_GETDATA(AH_JOB, AH_JOB_TRANSFERBASE, j); + assert(aj); + + if (aj->sepaDescriptors) { + GWEN_STRINGLISTENTRY *se; + + se=GWEN_StringList_FirstEntry(aj->sepaDescriptors); + while(se) { + const char *s; + + s=GWEN_StringListEntry_Data(se); + if (s && *s && -1!=GWEN_Text_ComparePattern(s, tmpl, 1)) + return s; + + se=GWEN_StringListEntry_Next(se); + } + } + + return NULL; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase_l.h new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase_l.h --- old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase_l.h 2014-01-18 14:20:35.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase_l.h 2014-03-24 22:40:50.000000000 +0100 @@ -41,6 +41,27 @@ int AH_Job_TransferBase_ExchangeArgs_SepaDatedDebit(AH_JOB *j, AB_JOB *bj, AB_IMEXPORTER_CONTEXT *ctx); +/** + * @name SEPA Descriptors + * For jobs which have their own list of supported SEPA formats in their BPD those can be handled here. + * Those jobs MUST call @ref AH_Job_TransferBase_LoadSepaDescriptors inside the constructor. + */ +/*@{*/ + +/** + * Load list of supported SEPA descriptors from the job's BPD. + */ +void AH_Job_TransferBase_LoadSepaDescriptors(AH_JOB *j); + +/** + * Find a SEPA descriptor in the internal list of supported SEPA descriptors read from the BPD. + */ +const char *AH_Job_TransferBase_FindSepaDescriptor(AH_JOB *j, const char *tmpl); + +/*@}*/ + + + #endif /* AH_JOBTRANSFERBASE_L_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase_p.h new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase_p.h --- old/aqbanking-5.4.1beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase_p.h 2014-01-14 21:43:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqhbci/plugin/accountjobs/jobtransferbase_p.h 2014-03-24 22:29:30.000000000 +0100 @@ -25,6 +25,8 @@ AH_JOB_TRANSFERBASE_EXCHANGE_FN exchangeArgsFn; AH_JOB_TRANSFERBASE_EXCHANGE_FN exchangeResultsFn; + GWEN_STRINGLIST *sepaDescriptors; + }; static void GWENHYWFAR_CB AH_Job_TransferBase_FreeData(void *bp, void *p); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/backends/aqofxconnect/version.h new/aqbanking-5.4.2beta/src/plugins/backends/aqofxconnect/version.h --- old/aqbanking-5.4.1beta/src/plugins/backends/aqofxconnect/version.h 2014-03-02 15:47:28.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/backends/aqofxconnect/version.h 2014-03-30 21:53:30.000000000 +0200 @@ -16,11 +16,11 @@ #define AQOFXCONNECT_VERSION_MAJOR 5 #define AQOFXCONNECT_VERSION_MINOR 4 -#define AQOFXCONNECT_VERSION_PATCHLEVEL 1 +#define AQOFXCONNECT_VERSION_PATCHLEVEL 2 #define AQOFXCONNECT_VERSION_BUILD 0 #define AQOFXCONNECT_VERSION_TAG "beta" -#define AQOFXCONNECT_VERSION_FULL_STRING "5.4.1.0beta" -#define AQOFXCONNECT_VERSION_STRING "5.4.1" +#define AQOFXCONNECT_VERSION_FULL_STRING "5.4.2.0beta" +#define AQOFXCONNECT_VERSION_STRING "5.4.2" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/csv/profiles/Makefile.am new/aqbanking-5.4.2beta/src/plugins/imexporters/csv/profiles/Makefile.am --- old/aqbanking-5.4.1beta/src/plugins/imexporters/csv/profiles/Makefile.am 2012-08-03 22:24:05.000000000 +0200 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/csv/profiles/Makefile.am 2014-03-29 19:43:27.000000000 +0100 @@ -7,7 +7,7 @@ diba.conf.in sparda.conf.in full.conf.in dkb.conf.in dkb-cash.conf.in \ hypovereinsbank.conf.in postbankffm.conf.in cli-transfers.conf.in \ sns.conf.in consors-tagesgeld.conf.in \ - transfers.conf.in + transfers.conf.in sepadebitnotes.conf.in profilesdir = $(aqbanking_pkgdatadir)/imexporters/csv/profiles profiles_DATA=default.conf aqmoney1.conf aqmoney2.conf \ @@ -17,5 +17,5 @@ diba.conf sparda.conf full.conf dkb.conf dkb-cash.conf \ hypovereinsbank.conf postbankffm.conf cli-transfers.conf \ sns.conf consors-tagesgeld.conf \ - transfers.conf + transfers.conf sepadebitnotes.conf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/csv/profiles/full.conf.in new/aqbanking-5.4.2beta/src/plugins/imexporters/csv/profiles/full.conf.in --- old/aqbanking-5.4.1beta/src/plugins/imexporters/csv/profiles/full.conf.in 2010-02-13 14:45:14.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/csv/profiles/full.conf.in 2014-03-25 22:56:54.000000000 +0100 @@ -131,8 +131,16 @@ 78="commission/value" 79="commission/currency" 80="bankAccountId" - 81="groupId" # double entry + 81="groupId" # double entry + 82="creditorSchemeId" # SEPA debit notes + 83="mandateId" + 84="mandateDate/dateString" + 85="mandateDebitorName" + 86="sequenceType" + 87="originalCreditorSchemeId" + 88="originalMandateId" + 89="originalCreditorName" } # columns } # params diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/csv/profiles/sepadebitnotes.conf.in new/aqbanking-5.4.2beta/src/plugins/imexporters/csv/profiles/sepadebitnotes.conf.in --- old/aqbanking-5.4.1beta/src/plugins/imexporters/csv/profiles/sepadebitnotes.conf.in 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/csv/profiles/sepadebitnotes.conf.in 2014-03-29 19:55:46.000000000 +0100 @@ -0,0 +1,56 @@ + +char name="sepadebitnotes" +char shortDescr="sepadebitnotes" +char version="@AQBANKING_CLI_VERSION_STRING@" +char longDescr="This profile is used for SEPA debit notes" +int import="1" +int export="1" + +char type="csv" +char groupNames="transaction", "transfer", "debitnote", "line" +char dateFormat="YYYY/MM/DD" +int utc="0" + +char subject="transactions" + +params { + # if 1 then values are quoted + quote="1" + + # if 1 then a title line will be written containing the names of each + # column + title="1" + + # special values are "TAB" and "SPACE" + delimiter=";" + + # this is the group name looked for in the given data to GWEN_CSV_Write + # if not given then all groups match + #group="transaction" + + # this group contains the definition for each column + # each variable in this group has its number as name + # you can use index variables in the names (using square brackets) + columns { + 1="localBic" + 2="localIban" + 3="remoteBic" + 4="remoteIban" + 5="date" + 6="value/value" + 7="value/currency" + 8="localName" + 9="remoteName" + 19="creditorSchemeId" # SEPA debit notes + 11="mandateId" + 12="mandateDate/dateString" + 13="mandateDebitorName" + 14="sequenceType" + 15="purpose[0]" + 16="purpose[1]" + 17="purpose[2]" + 18="purpose[3]" + } # columns + +} # params + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/profiles/008_001_01_cor1.conf.in new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/profiles/008_001_01_cor1.conf.in --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/profiles/008_001_01_cor1.conf.in 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/profiles/008_001_01_cor1.conf.in 2014-03-24 22:15:20.000000000 +0100 @@ -0,0 +1,11 @@ + +char name="008_001_01_cor1" +char shortDescr="pain.008.001.01_cor1" +char version="@AQBANKING_VERSION_STRING@" +char longDescr="COR1 profile for pain.008.001.01" +int import="0" +int export="1" + +char type="008_001_01_cor1" + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/profiles/008_002_02_cor1.conf.in new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/profiles/008_002_02_cor1.conf.in --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/profiles/008_002_02_cor1.conf.in 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/profiles/008_002_02_cor1.conf.in 2014-03-24 22:18:40.000000000 +0100 @@ -0,0 +1,11 @@ + +char name="008_002_02_cor1" +char shortDescr="pain.008.002.02_cor1" +char version="@AQBANKING_VERSION_STRING@" +char longDescr="COR1 profile for pain.008.002.02_cor1" +int import="0" +int export="1" + +char type="008_002_02_cor1" + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/profiles/008_003_02_cor1.conf.in new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/profiles/008_003_02_cor1.conf.in --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/profiles/008_003_02_cor1.conf.in 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/profiles/008_003_02_cor1.conf.in 2014-03-24 22:16:04.000000000 +0100 @@ -0,0 +1,11 @@ + +char name="008_003_02_cor1" +char shortDescr="pain.008.003.02_cor1" +char version="@AQBANKING_VERSION_STRING@" +char longDescr="COR1 profile for pain.008.003.02_cor1" +int import="0" +int export="1" + +char type="008_003_02_cor1" + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/profiles/Makefile.am new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/profiles/Makefile.am --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/profiles/Makefile.am 2013-10-20 01:04:32.000000000 +0200 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/profiles/Makefile.am 2014-03-24 22:16:59.000000000 +0100 @@ -4,8 +4,11 @@ ccm.conf.in \ 001_002_03.conf.in \ 008_001_01.conf.in \ + 008_001_01_cor1.conf.in \ 008_002_02.conf.in \ - 008_003_02.conf.in + 008_002_02_cor1.conf.in \ + 008_003_02.conf.in \ + 008_003_02_cor1.conf.in profilesdir = $(aqbanking_pkgdatadir)/imexporters/sepa/profiles profiles_DATA=default.conf ccm.conf 001_002_03.conf 008_001_01.conf 008_002_02.conf 008_003_02.conf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa.c new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa.c --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa.c 2013-10-19 15:11:09.000000000 +0200 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa.c 2014-03-24 21:42:11.000000000 +0100 @@ -104,13 +104,22 @@ return AH_ImExporterSEPA_Export_001_002_03(ie, ctx, sio, params); } else if (strcasecmp(s, "008_001_01")==0) { - return AH_ImExporterSEPA_Export_008_001_01(ie, ctx, sio, params); + return AH_ImExporterSEPA_Export_008_001_01(ie, ctx, sio, params, AH_ImExportSEPA_SubType_Default); + } + else if (strcasecmp(s, "008_001_01_cor1")==0) { + return AH_ImExporterSEPA_Export_008_001_01(ie, ctx, sio, params, AH_ImExportSEPA_SubType_Cor1); } else if (strcasecmp(s, "008_002_02")==0) { - return AH_ImExporterSEPA_Export_008_002_02(ie, ctx, sio, params); + return AH_ImExporterSEPA_Export_008_002_02(ie, ctx, sio, params, AH_ImExportSEPA_SubType_Default); + } + else if (strcasecmp(s, "008_002_02_cor1")==0) { + return AH_ImExporterSEPA_Export_008_002_02(ie, ctx, sio, params, AH_ImExportSEPA_SubType_Cor1); } else if (strcasecmp(s, "008_003_02")==0) { - return AH_ImExporterSEPA_Export_008_003_02(ie, ctx, sio, params); + return AH_ImExporterSEPA_Export_008_003_02(ie, ctx, sio, params, AH_ImExportSEPA_SubType_Default); + } + else if (strcasecmp(s, "008_003_02_cor1")==0) { + return AH_ImExporterSEPA_Export_008_003_02(ie, ctx, sio, params, AH_ImExportSEPA_SubType_Cor1); } else { DBG_ERROR(AQBANKING_LOGDOMAIN, "Unknown SEPA type \"%s\"", s); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa_exp_008_001_01.c new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa_exp_008_001_01.c --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa_exp_008_001_01.c 2014-03-01 20:23:15.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa_exp_008_001_01.c 2014-03-24 21:39:52.000000000 +0100 @@ -7,7 +7,8 @@ int AH_ImExporterSEPA_Export_008_001_01(AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_SYNCIO *sio, - GWEN_DB_NODE *params){ + GWEN_DB_NODE *params, + int subType){ GWEN_XMLNODE *root; GWEN_XMLNODE *documentNode; GWEN_XMLNODE *painNode; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa_exp_008_002_02.c new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa_exp_008_002_02.c --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa_exp_008_002_02.c 2014-03-01 20:23:15.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa_exp_008_002_02.c 2014-03-24 21:44:15.000000000 +0100 @@ -7,7 +7,8 @@ int AH_ImExporterSEPA_Export_008_002_02(AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_SYNCIO *sio, - GWEN_DB_NODE *params){ + GWEN_DB_NODE *params, + int subType){ GWEN_XMLNODE *root; GWEN_XMLNODE *documentNode; GWEN_XMLNODE *painNode; @@ -171,7 +172,11 @@ nnn=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "LclInstrm"); if (nnn) { - GWEN_XMLNode_SetCharValue(nnn, "Cd", "CORE"); + switch(subType) { + default: + case AH_ImExportSEPA_SubType_Default: GWEN_XMLNode_SetCharValue(nnn, "Cd", "CORE"); break; + case AH_ImExportSEPA_SubType_Cor1: GWEN_XMLNode_SetCharValue(nnn, "Cd", "COR1"); break; + } GWEN_XMLNode_AddChild(nn, nnn); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa_exp_008_003_02.c new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa_exp_008_003_02.c --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa_exp_008_003_02.c 2014-03-01 20:23:15.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa_exp_008_003_02.c 2014-03-24 21:43:25.000000000 +0100 @@ -7,7 +7,8 @@ int AH_ImExporterSEPA_Export_008_003_02(AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_SYNCIO *sio, - GWEN_DB_NODE *params){ + GWEN_DB_NODE *params, + int subType){ GWEN_XMLNODE *root; GWEN_XMLNODE *documentNode; GWEN_XMLNODE *painNode; @@ -172,7 +173,11 @@ nnn=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "LclInstrm"); if (nnn) { - GWEN_XMLNode_SetCharValue(nnn, "Cd", "CORE"); + switch(subType) { + default: + case AH_ImExportSEPA_SubType_Default: GWEN_XMLNode_SetCharValue(nnn, "Cd", "CORE"); break; + case AH_ImExportSEPA_SubType_Cor1: GWEN_XMLNode_SetCharValue(nnn, "Cd", "COR1"); break; + } GWEN_XMLNode_AddChild(nn, nnn); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa_p.h new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa_p.h --- old/aqbanking-5.4.1beta/src/plugins/imexporters/sepa/sepa_p.h 2013-10-19 15:11:27.000000000 +0200 +++ new/aqbanking-5.4.2beta/src/plugins/imexporters/sepa/sepa_p.h 2014-03-24 21:44:13.000000000 +0100 @@ -21,6 +21,13 @@ }; + +enum { + AH_ImExportSEPA_SubType_Default=0, + AH_ImExportSEPA_SubType_Cor1 +}; + + AQBANKING_EXPORT GWEN_PLUGIN *imexporter_sepa_factory(GWEN_PLUGIN_MANAGER *pm, const char *name, @@ -67,20 +74,23 @@ int AH_ImExporterSEPA_Export_008_001_01(AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_SYNCIO *sio, - GWEN_DB_NODE *params); + GWEN_DB_NODE *params, + int subType); static int AH_ImExporterSEPA_Export_008_002_02(AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_SYNCIO *sio, - GWEN_DB_NODE *params); + GWEN_DB_NODE *params, + int subType); static int AH_ImExporterSEPA_Export_008_003_02(AB_IMEXPORTER *ie, AB_IMEXPORTER_CONTEXT *ctx, GWEN_SYNCIO *sio, - GWEN_DB_NODE *params); + GWEN_DB_NODE *params, + int subType); #endif /* AQHBCI_IMEX_SEPA_P_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/tools/aqbanking-cli/Makefile.am new/aqbanking-5.4.2beta/src/tools/aqbanking-cli/Makefile.am --- old/aqbanking-5.4.1beta/src/tools/aqbanking-cli/Makefile.am 2014-01-19 17:04:43.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/tools/aqbanking-cli/Makefile.am 2014-03-25 22:16:47.000000000 +0100 @@ -42,6 +42,7 @@ updateconf.c \ sepatransfer.c \ sepadebitnote.c \ + sepadebitnotes.c \ separecurtransfer.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/tools/aqbanking-cli/main.c new/aqbanking-5.4.2beta/src/tools/aqbanking-cli/main.c --- old/aqbanking-5.4.1beta/src/tools/aqbanking-cli/main.c 2014-03-01 20:23:15.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/tools/aqbanking-cli/main.c 2014-03-25 22:18:09.000000000 +0100 @@ -48,6 +48,7 @@ #include "sepatransfer.c" #include "addsepadebitnote.c" #include "sepadebitnote.c" +#include "sepadebitnotes.c" #include "separecurtransfer.c" @@ -246,6 +247,8 @@ cmdAddHelpStr(ubuf, "sepadebitnote", I18N("Issue a single SEPA debit note (data from command line)")); + cmdAddHelpStr(ubuf, "sepadebitnotes", + I18N("Issue a number of SEPA debit notes (data from a file)")); cmdAddHelpStr(ubuf, "addtrans", I18N("Add a transfer to an existing import context file")); @@ -369,6 +372,9 @@ else if (strcasecmp(cmd, "sepadebitnote")==0) { rv=sepaDebitNote(ab, db, argc, argv); } + else if (strcasecmp(cmd, "sepadebitnotes")==0) { + rv=sepaDebitNotes(ab, db, argc, argv); + } else if (strcasecmp(cmd, "sepacreatesto")==0) { rv=sepaRecurTransfer(ab, db, argc, argv); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/tools/aqbanking-cli/sepadebitnote.c new/aqbanking-5.4.2beta/src/tools/aqbanking-cli/sepadebitnote.c --- old/aqbanking-5.4.1beta/src/tools/aqbanking-cli/sepadebitnote.c 2014-03-01 21:16:22.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/tools/aqbanking-cli/sepadebitnote.c 2014-03-25 22:47:09.000000000 +0100 @@ -326,7 +326,7 @@ } rv=AB_Banking_CheckIban(lIBAN); if (rv<0) { - DBG_ERROR(0, "Invalid local IBAN (%s)", rIBAN); + DBG_ERROR(0, "Invalid local IBAN (%s)", lIBAN); AB_Transaction_free(t); return 3; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/src/tools/aqbanking-cli/sepadebitnotes.c new/aqbanking-5.4.2beta/src/tools/aqbanking-cli/sepadebitnotes.c --- old/aqbanking-5.4.1beta/src/tools/aqbanking-cli/sepadebitnotes.c 1970-01-01 01:00:00.000000000 +0100 +++ new/aqbanking-5.4.2beta/src/tools/aqbanking-cli/sepadebitnotes.c 2014-03-25 22:46:55.000000000 +0100 @@ -0,0 +1,409 @@ +/*************************************************************************** + begin : Tue Mar 25 2014 + copyright : (C) 2014 by Martin Preuss + email : martin@libchipcard.de + + *************************************************************************** + * Please see toplevel file COPYING for license details * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "globals.h" + +#include <aqbanking/jobsepadebitnote.h> + +#include <gwenhywfar/text.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> + + + +static +int sepaDebitNotes(AB_BANKING *ab, + GWEN_DB_NODE *dbArgs, + int argc, + char **argv) { + GWEN_DB_NODE *db; + int rv; + const char *ctxFile; + const char *inFile; + const char *importerName; + const char *profileName; + const char *profileFile; + const char *bankId; + const char *accountId; + const char *subAccountId; + int fillGaps; + AB_IMEXPORTER_CONTEXT *ctx=0; + AB_IMEXPORTER_ACCOUNTINFO *iea; + AB_ACCOUNT *forcedAccount=NULL; + AB_JOB_LIST2 *jobList; + int rvExec; + const GWEN_ARGS args[]={ + { + GWEN_ARGS_FLAGS_HAS_ARGUMENT, /* flags */ + GWEN_ArgsType_Char, /* type */ + "ctxFile", /* name */ + 0, /* minnum */ + 1, /* maxnum */ + "c", /* short option */ + "ctxfile", /* long option */ + "Specify the file to store the context in", /* short description */ + "Specify the file to store the context in" /* long description */ + }, + { + GWEN_ARGS_FLAGS_HAS_ARGUMENT, /* flags */ + GWEN_ArgsType_Char, /* type */ + "inFile", /* name */ + 0, /* minnum */ + 1, /* maxnum */ + "f", /* short option */ + "infile", /* long option */ + "Specify the file to read the data from", /* short description */ + "Specify the file to read the data from" /* long description */ + }, + { + GWEN_ARGS_FLAGS_HAS_ARGUMENT, /* flags */ + GWEN_ArgsType_Char, /* type */ + "importerName", /* name */ + 0, /* minnum */ + 1, /* maxnum */ + 0, /* short option */ + "importer", /* long option */ + "Specify the importer to use", /* short description */ + "Specify the importer to use" /* long description */ + }, + { + GWEN_ARGS_FLAGS_HAS_ARGUMENT, /* flags */ + GWEN_ArgsType_Char, /* type */ + "profileName", /* name */ + 0, /* minnum */ + 1, /* maxnum */ + 0, /* short option */ + "profile", /* long option */ + "Specify the export profile to use", /* short description */ + "Specify the export profile to use" /* long description */ + }, + { + GWEN_ARGS_FLAGS_HAS_ARGUMENT, /* flags */ + GWEN_ArgsType_Char, /* type */ + "profileFile", /* name */ + 0, /* minnum */ + 1, /* maxnum */ + 0, /* short option */ + "profile-file", /* long option */ + "Specify the file to load the export profile from",/* short description */ + "Specify the file to load the export profile from" /* long description */ + }, + { + GWEN_ARGS_FLAGS_HAS_ARGUMENT, /* flags */ + GWEN_ArgsType_Char, /* type */ + "bankId", /* name */ + 0, /* minnum */ + 1, /* maxnum */ + "b", /* short option */ + "bank", /* long option */ + "overwrite the bank code", /* short description */ + "overwrite the bank code" /* long description */ + }, + { + GWEN_ARGS_FLAGS_HAS_ARGUMENT, /* flags */ + GWEN_ArgsType_Char, /* type */ + "accountId", /* name */ + 0, /* minnum */ + 1, /* maxnum */ + "a", /* short option */ + "account", /* long option */ + "overwrite the account number", /* short description */ + "overwrite the account number" /* long description */ + }, + { + GWEN_ARGS_FLAGS_HAS_ARGUMENT, /* flags */ + GWEN_ArgsType_Char, /* type */ + "subAccountId", /* name */ + 0, /* minnum */ + 1, /* maxnum */ + "aa", /* short option */ + "subaccount", /* long option */ + "Specify the sub account id (Unterkontomerkmal)", /* short description */ + "Specify the sub account id (Unterkontomerkmal)" /* long description */ + }, + { + 0, + GWEN_ArgsType_Int, + "fillGaps", + 0, + 1, + 0, + "fill-gaps", + "let AqBanking fill-in missing account information if possible", + "let AqBanking fill-in missing account information if possible", + }, + { + GWEN_ARGS_FLAGS_HELP | GWEN_ARGS_FLAGS_LAST, /* flags */ + GWEN_ArgsType_Int, /* type */ + "help", /* name */ + 0, /* minnum */ + 0, /* maxnum */ + "h", /* short option */ + "help", /* long option */ + "Show this help screen", /* short description */ + "Show this help screen" /* long description */ + } + }; + + db=GWEN_DB_GetGroup(dbArgs, GWEN_DB_FLAGS_DEFAULT, "local"); + rv=GWEN_Args_Check(argc, argv, 1, + 0 /*GWEN_ARGS_MODE_ALLOW_FREEPARAM*/, + args, + db); + if (rv==GWEN_ARGS_RESULT_ERROR) { + fprintf(stderr, "ERROR: Could not parse arguments\n"); + return 1; + } + else if (rv==GWEN_ARGS_RESULT_HELP) { + GWEN_BUFFER *ubuf; + + ubuf=GWEN_Buffer_new(0, 1024, 0, 1); + if (GWEN_Args_Usage(args, ubuf, GWEN_ArgsOutType_Txt)) { + fprintf(stderr, "ERROR: Could not create help string\n"); + return 1; + } + fprintf(stderr, "%s\n", GWEN_Buffer_GetStart(ubuf)); + GWEN_Buffer_free(ubuf); + return 0; + } + + bankId=GWEN_DB_GetCharValue(db, "bankId", 0, 0); + accountId=GWEN_DB_GetCharValue(db, "accountId", 0, 0); + subAccountId=GWEN_DB_GetCharValue(db, "subAccountId", 0, 0); + importerName=GWEN_DB_GetCharValue(db, "importerName", 0, "csv"); + profileName=GWEN_DB_GetCharValue(db, "profileName", 0, "default"); + profileFile=GWEN_DB_GetCharValue(db, "profileFile", 0, NULL); + ctxFile=GWEN_DB_GetCharValue(db, "ctxfile", 0, 0); + fillGaps=GWEN_DB_GetIntValue(db, "fillGaps", 0, 0); + inFile=GWEN_DB_GetCharValue(db, "inFile", 0, 0); + + rv=AB_Banking_Init(ab); + if (rv) { + DBG_ERROR(0, "Error on init (%d)", rv); + return 2; + } + + rv=AB_Banking_OnlineInit(ab); + if (rv) { + DBG_ERROR(0, "Error on init (%d)", rv); + return 2; + } + + /* find local account to set later if requested */ + if (bankId || accountId) { + AB_ACCOUNT_LIST2 *al; + + /* get account */ + al=AB_Banking_FindAccounts(ab, "*", "*", bankId, accountId, subAccountId); + if (al==NULL || AB_Account_List2_GetSize(al)==0) { + DBG_ERROR(0, "Account not found"); + return 2; + } + else if (AB_Account_List2_GetSize(al)>1) { + DBG_ERROR(0, "Ambiguous account specification"); + AB_Account_List2_free(al); + return 2; + } + forcedAccount=AB_Account_List2_GetFront(al); + AB_Account_List2_free(al); + } + + /* import new context */ + ctx=AB_ImExporterContext_new(); + rv=AB_Banking_ImportFileWithProfile(ab, importerName, ctx, + profileName, profileFile, + inFile); + if (rv<0) { + DBG_ERROR(0, "Error reading file: %d", rv); + AB_ImExporterContext_free(ctx); + return 4; + } + + /* fill gaps */ + if (fillGaps) + AB_Banking_FillGapsInImExporterContext(ab, ctx); + + /* populate job list */ + jobList=AB_Job_List2_new(); + iea=AB_ImExporterContext_GetFirstAccountInfo(ctx); + while(iea) { + AB_ACCOUNT *a; + AB_TRANSACTION *t; + + if (forcedAccount) + a=forcedAccount; + else { + a=AB_Banking_GetAccountByCodeAndNumber(ab, + AB_ImExporterAccountInfo_GetBankCode(iea), + AB_ImExporterAccountInfo_GetAccountNumber(iea)); + if (!a) { + DBG_ERROR(0, "Account %s/%s not found, aborting", + AB_ImExporterAccountInfo_GetBankCode(iea), + AB_ImExporterAccountInfo_GetAccountNumber(iea)); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + } + + t=AB_ImExporterAccountInfo_GetFirstTransaction(iea); + while(t) { + AB_JOB *j; + const char *rIBAN; + const char *rBIC; + const char *lIBAN; + const char *lBIC; + + if (forcedAccount) { + AB_Transaction_SetLocalIban(t, AB_Account_GetIBAN(forcedAccount)); + AB_Transaction_SetLocalBic(t, AB_Account_GetBIC(forcedAccount)); + } + + rIBAN=AB_Transaction_GetRemoteIban(t); + rBIC=AB_Transaction_GetRemoteBic(t); + lIBAN=AB_Transaction_GetLocalIban(t); + lBIC=AB_Transaction_GetLocalBic(t); + + /* preset local BIC and IBAN from account, if not set */ + if (!lBIC || !(*lBIC)) + lBIC=AB_Account_GetBIC(a); + + if (!lIBAN || !(*lIBAN)) + lIBAN=AB_Account_GetIBAN(a); + + /* check remote account */ + if (!rBIC || !(*rBIC)) { + DBG_ERROR(0, "Missing remote BIC"); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + if (!rIBAN || !(*rIBAN)) { + DBG_ERROR(0, "Missing remote IBAN"); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + rv=AB_Banking_CheckIban(rIBAN); + if (rv<0) { + DBG_ERROR(0, "Invalid remote IBAN (%s)", rIBAN); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + + /* check local account */ + if (!lBIC || !(*lBIC)) { + DBG_ERROR(0, "Missing local BIC"); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + if (!lIBAN || !(*lIBAN)) { + DBG_ERROR(0, "Missing local IBAN"); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + rv=AB_Banking_CheckIban(lIBAN); + if (rv<0) { + DBG_ERROR(0, "Invalid local IBAN (%s)", lIBAN); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + + /* create job */ + j=AB_JobSepaDebitNote_new(a); + rv=AB_Job_CheckAvailability(j); + if (rv<0) { + DBG_ERROR(0, "Job not supported."); + AB_Job_free(j); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + rv=AB_Job_SetTransaction(j, t); + if (rv<0) { + DBG_ERROR(0, "Unable to add transaction for account %s/%s, aborting", + AB_ImExporterAccountInfo_GetBankCode(iea), + AB_ImExporterAccountInfo_GetAccountNumber(iea)); + AB_Job_free(j); + AB_Job_List2_FreeAll(jobList); + AB_ImExporterContext_free(ctx); + return 3; + } + AB_Job_List2_PushBack(jobList, j); + t=AB_ImExporterAccountInfo_GetNextTransaction(iea); + } /* while t */ + + iea=AB_ImExporterContext_GetNextAccountInfo(ctx); + } /* while */ + AB_ImExporterContext_free(ctx); + + /* execute jobs */ + rvExec=0; + ctx=AB_ImExporterContext_new(); + rv=AB_Banking_ExecuteJobs(ab, jobList, ctx); + if (rv) { + fprintf(stderr, "Error on executeQueue (%d)\n", rv); + rvExec=3; + } + AB_Job_List2_FreeAll(jobList); + + /* write context */ + rv=writeContext(ctxFile, ctx); + if (rv<0) { + AB_ImExporterContext_free(ctx); + AB_Banking_OnlineFini(ab); + AB_Banking_Fini(ab); + return 4; + } + AB_ImExporterContext_free(ctx); + + /* that's is */ + rv=AB_Banking_OnlineFini(ab); + if (rv) { + fprintf(stderr, "ERROR: Error on deinit (%d)\n", rv); + AB_Banking_Fini(ab); + if (rvExec) + return rvExec; + else + return 5; + } + + rv=AB_Banking_Fini(ab); + if (rv) { + fprintf(stderr, "ERROR: Error on deinit (%d)\n", rv); + if (rvExec) + return rvExec; + else + return 5; + } + + if (rvExec) + return rvExec; + else + return 0; +} + + + + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/aqbanking-5.4.1beta/version.h new/aqbanking-5.4.2beta/version.h --- old/aqbanking-5.4.1beta/version.h 2014-03-02 15:47:28.000000000 +0100 +++ new/aqbanking-5.4.2beta/version.h 2014-03-30 21:53:30.000000000 +0200 @@ -13,15 +13,15 @@ #define AQBANKING_VERSION_MAJOR 5 #define AQBANKING_VERSION_MINOR 4 -#define AQBANKING_VERSION_PATCHLEVEL 1 +#define AQBANKING_VERSION_PATCHLEVEL 2 #define AQBANKING_VERSION_BUILD 0 #define AQBANKING_VERSION_TAG "beta" -#define AQBANKING_VERSION_FULL_STRING "5.4.1.0beta" -#define AQBANKING_VERSION_STRING "5.4.1" +#define AQBANKING_VERSION_FULL_STRING "5.4.2.0beta" +#define AQBANKING_VERSION_STRING "5.4.2" #define AQBANKING_SO_CURRENT 38 -#define AQBANKING_SO_REVISION 1 +#define AQBANKING_SO_REVISION 2 #define AQBANKING_SO_AGE 4 #define AQBANKING_SO_EFFECTIVE 34 -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org