ledger123 / runmyaccounts

SQL-Ledger Customizations by Run My Accounts
GNU General Public License v2.0
16 stars 9 forks source link

[IBP-1256] Bulk invoice payments creation API #566

Open bohte opened 1 week ago

bohte commented 1 week ago

Hello,

As we discussed on different channel - we would like to request new API endpoint creation on SQL-Ledger side that will allow to execute bulk invoice payments creation instead of using functionality provided on AR/AP invoice pages: image

1) To cover all our needs, introduced route must accept and process following request body: Example written in JSON (may be also sent as form data which is, i believe, more usual approach) [ { "invoiceId": {TARGET INVOICE ID}, "datePaid": {DATE VALUE} ('date' field from invoice payment form), "source": {STRING VALUE} ('source' field from invoice payment form), "memo": {STRING VALUE} ('memo' field from invoice payment form), "amount": {NUMBER VALUE} ('amount' field from invoice payment form), "exchangeRate": {NUMBER VALUE) ('exch' field from invoice payment form), "account": {CHART REFERENCE} ('account' field from invoice payment form) }, { ... } ] 2) Type of the invoice: AR, AP, may also be needed. Would be good to make it specified as URL path or query parameter, but it can be also done as JSON/form data payload parameter. 3) As far as I know - login of the user is also required. It can be sent as form data parameter in case of according approach, if we go with JSON - it would better be request header 4) IMPORTANT: bulk processing must be transactional, which means that either all requested payments are created or none of them are.

Please, use following branch for implementation: IBP-1256-E-Banking-Sub-Ledger-Splitting-and-Compatibility-Partial-and-multiple-invoice-linking

Thanks in advance!