dmitrirussu / php-sepa-xml-generator

SEPA SDD XML Generator recommended to see. PHP SEPA XML Generator, (Single Euro Payments Area ISO20022 SDD V1_0 20122009) (SEPA)(PHP5)
https://github.com/dmitrirussu/PHP-SEPA-XML-GENERATOR
MIT License
53 stars 36 forks source link

directDebitTransaction aggregation #17

Closed ruben-podadera closed 9 years ago

ruben-podadera commented 9 years ago

Hello Dmitri,

First of all, a very big thank you for this library which is well written, nice to use and really useful. We are using it for a project and it will certainly avoid me a couple of headaches.

I have a question for which I did not find any relevant answer. In PaymentInfo::addDirectDebitTransaction, if there is an existing directDebitTransaction for a given mandate, you add the new debit to it so there is always one directDebitTransaction per mandate. Is this a mandatory behavior specified by ISO 20022 or a convenience behavior you defined ?

In our case, we prefer to not have them aggregated so we can more easily match each invoice with a single line in our bank admin.

I can fork the project and add a pull request if you want.

Best Regards

ghost commented 9 years ago

Well, I did the pull request :-) You can merge it if you like the idea, otherwise I will use my forked project. Thanks again

dmitrirussu commented 9 years ago

Hi, I have to check, I think, I did a mistake

dmitrirussu commented 9 years ago

Ok, you do not need to put in SEPA XML file two transactions of the same Mandate ID, you need to do an total amount of that. But I implemented some thing like a trick, if you have two customer which use same mandate to buy some thing. But in SEPA XML shloud be one mandate and amount of total transaction which was created by 2 customers. Is a mistake if you will send to bank the to transactions with same Mandate ID

dmitrirussu commented 9 years ago

I do aggregation of that do not permit, duplicate of the same mandate by same customer or two customer with same mandate.

dmitrirussu commented 9 years ago

You have to create for your customer a unique (mandate , IBAN, (BIC-optional)).

If your customer will decide to change (IBAN AND BIC) you need to generate another unique Mandate ID.

I think you have a mistake, in your process is missing unique mandate ID per customer

ghost commented 9 years ago

I do have a unique mandate per customer. We are paying invoices per SEPA. One invoice per month, per customer. It may happen that we have to pay 3 months at the same time, or 3 invoices. Its the same customer, same mandate, but 3 payments. The default behavior is to agregate those 3 payments into one.

We want to test to not aggregate the 3 payments, so it will be easier for the accounting to match the transactions. We are going to make a test with our back to see if it works. I will let you know when its done

ruben-podadera commented 9 years ago

Hello Dmitri, our bank (Société Générale, France) has accepted the xml file with multiples DrctDbtTx per Sepa Mandate.

sepa-example.xml | uploaded via ZenHub

dmitrirussu commented 9 years ago

:) fine, some banks does not accept to split transactions with same mandate, about grab mode it will be by default, by ISO standards should be like this.

ruben-podadera commented 9 years ago

So, are you going to merge my PR ? :-)

dmitrirussu commented 9 years ago

yes, with small change

ruben-podadera commented 9 years ago

great :-) Thanks!