How to assign regular GL Journals with multiple B.partners to regular Invoices.

227 views
Skip to first unread message

Pedro Rozo

unread,
Oct 18, 2015, 10:08:42 AM10/18/15
to iDempiere

Hi Everyone


Currently as part of the “Open Items” functionality Idempiere can cross/assign the regular outstanding AR Invoice, AR Receipt and AR Credit memo with the AP Invoice, AP Payment y AP Credit memo documents to perform the payments/assignments between them (allocation window payment allocation).


However each ERP document is restricted to just one business partner at the same time; here in Colombia we have a common practice for accountants & export companies where they require GL journals with multiple business partners and for each Bpartner, where  they multiple process services charges but each of them to different b.partnet and all of them relatd with commercial transaction …. (for instance: one import of products, with many related services charges: transportation, packaging, and so on performed by different b. partners)


Having in minda that limitation, we were checking the advanced options of GL journals and we foudn & already tested the current support for multiple business partners, and that works good from the accounting perspective , but it does not assign those payments/assignments to the Original Invoices properly (open items).


Then we are wondering is there is any Idempiere configuration to extend the Payment allocation to GLJournals with multiple b.partners because usually in these GL journals are frequent and so it does not make sense for them to have individual documents …(manual approach) .... Perhaps is a missing functionality ?


If that is not available, I would appreciate your suggestions about which java classes or processes to modify, and perhaps sharing your suggestions/experiences about similar business practcies in other countries, so if we decide to customize this topic, we can perform it with a more flexible approach for future contributions


Regards


Pedro R.

Nicolas Micoud

unread,
Oct 19, 2015, 7:48:04 AM10/19/15
to iDempiere
Hi Pedro,

I think we did something similar (https://groups.google.com/d/msg/idempiere/dZCn-X7hhLw/346LcsiQO4cJ, #3) but i was not working in a tenant which has more than one accounting schema (see Carlos and hengsin comments).
ATM, i still haven't migrated this functionnality to iDempiere and I always find another solution (the Charge field on the allocation payment could be useful. you can select here a charge/combination which will be the same on the GL journal line).

Regards,

Nicolas

Pedro Rozo

unread,
Oct 19, 2015, 11:00:17 AM10/19/15
to iDempiere
Thanks for your quick reply  Nicolas..

I have read the feedback of everyone in that thread, and we want to test your contribution, could you share wiht us that java code/AD changes ?  we did not find it with the thread provided).

Regards..

Pedro R.

Nicolas Micoud

unread,
Oct 19, 2015, 11:50:47 AM10/19/15
to iDempiere
Hi,

Yes, i could share it.
As it was done in 2011, it's not clear in my head.

Anyway, AD changes are quite simple :

New columns :
C_AllocationLine.GL_JournaLine_ID
GL_JournalLine.IsPaid

For the code :

DocLine_Allocation / Doc_AllocationHdr
 -> new case : C_AllocationLine.GL_JournaLine_ID > 0

VAllocation / Allocation (it was not done in webUI)
 - journal lines are displayed in invoices panel

Validator to forbid reactivate/void gl journal if one of the line is paid (you need to delete the allocation before)

MBPartner.setTotalOpenBalance use GL_JournalLine


MJournalLine : new methods : getOfBPartner, testAllocation, getAllocatedAmt et isSOTrx

MAllocationHdr.getOfJournalLine / setDocInfo has a new param (JournalLineID)

BPartnerValidate : check journal

SQL functions :GLJournalLineMultiplier  / GLJournalLineOpen



If interested, i can find a document (in French) which explains the customization
Will try to upload a kind of patch with all raw modification, but later (really busy ATM)

Regards,

Nicolas

Pedro Rozo

unread,
Oct 19, 2015, 12:41:29 PM10/19/15
to iDempiere
Sure Nicolas, if can sahre the customization document in French we can take a look..

Thanks for sharing.

Pedro R.

Nicolas Micoud

unread,
Oct 19, 2015, 2:11:12 PM10/19/15
to iDempiere
Here it is !

Nicolas
Intégration des OD dans les affectations.pdf

Chuck Boecking

unread,
Oct 19, 2015, 6:32:09 PM10/19/15
to iDempiere
Hi Pedro,

I did a customization once that allowed two BP fields on the payment allocation window. This modification simply allowed more records (invoices and payments) to the existing window with no other modifications. The code (at the time - many years ago) was smart enough to post the correct business partner with the correct account without any modification.

To test this scenario and see if it works without having to modify code, do the following:
  • Create invoice with BP-A for $100.
  • Create a payment with BP-A for $100.
  • Allocate the Invoice to the Payment.
  • Create invoice with BP-Z for $100.
  • Create a payment with BP-Z for $100.
  • Manually manipulate the BP-A allocation to reference BP-Z's Payment.
  • Repost the BP-A allocation (now a hybrid allocation).
  • Check the postings to make sure they are correct.
If they are correct, you should be able to easily update the Payment Allocation to add the second BP field.

Does this speak to your point?

Pedro Rozo

unread,
Oct 19, 2015, 9:24:08 PM10/19/15
to iDempiere
Thanks for your message chuck, but our current business requirement is focussed in GLjournals with multiple bpartners (n) (that behaving as payments to be assigned to invoices ) I guess that Nicolas approach is the closest solution so far, then we will be implementing and testing it soon to see how that works, having in mind that our customer just works with a single accounting schema ...

Regards.

Pedro R 

Chuck Boecking

unread,
Oct 19, 2015, 10:42:02 PM10/19/15
to idem...@googlegroups.com
You can add a BP column to the C_InvoiceLine table. When doing so, the system will post the line's value to the line's BP (which can be different than the header or just left blank to assume the header BP). Therefore, many related services charges: transportation, packaging, and so on performed and assigned to different b. partners both in terms of the sub-ledger and the GL.

The one thing you cannot do is age invoices by lines; therefore, you could not product an accurate aging by BP. Is this a show stopper?


Regards,


Chuck Boecking
512.850.6068 (office and cell)
ch...@chuboe.com
ChuckBoecking.com
chuck.boecking (skype)

--
You received this message because you are subscribed to a topic in the Google Groups "iDempiere" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idempiere/rBvOyU-34Ts/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/ff6d7d05-5672-48e0-9464-6e484d583d2a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Pedro Rozo

unread,
Oct 19, 2015, 10:50:45 PM10/19/15
to iDempiere
Interesting approach (simpler than GL journal I see) .... that would solve the first part of the issue which is to assign charges to different bp, but 

1. Just adding the additional bp field on each onvocie line would do the trick ? no java changes or config required ?
2. What about the payment/invoices assignments ?  if I unedrstadn correctly the payments woudl be assigned to regular charges (to each bp),, so n change woudl be required in this area ?  is that a valid assumption ?

Regards

Pedro R.

Chuck Boecking

unread,
Oct 19, 2015, 11:00:56 PM10/19/15
to idem...@googlegroups.com
Seems to work perfectly in the quick tests I performed before my last email. No code changes. I created three invoices:
  1. One BP at the header (blank bp line)
  2. One BP at the header and a different on a single line
  3. One BP at the header, a different BP on line 10, and a blank BP on line 20.
All posted as expected.

If I understand you correctly, an invoice would collect a lot of expenses from many business partners. Therefore, you could have an invoice (say $1,000) with 10 lines (each $100) from 10 different BPs. 

Also if I understand you correctly, you want the invoice ($1,000) paid by each of the 10 BPs ($100 each). If so, you can use my first post of adding a second BP field to the payment allocation screen and allocate the respective Payments to the single $1,000 invoice one by one. This assumes that my prescribed test in the first post works.


Regards,


Chuck Boecking
512.850.6068 (office and cell)
ch...@chuboe.com
ChuckBoecking.com
chuck.boecking (skype)

Pedro Rozo

unread,
Oct 19, 2015, 11:11:12 PM10/19/15
to iDempiere
It looks like both suggestions/workarounds are very close to what we are looking for indeed .... then  we will test them tomorrow in detail and will document results here after that ... 

Thanks Chuck.

Pedro R 

Nicolas Micoud

unread,
Oct 20, 2015, 2:32:14 PM10/20/15
to iDempiere
Hi,

Here's all the modification made for the development.
I group them by classes.

Note that the source was a 361 version, so quite far from current idempiere sources :)

Hope you'll be able to integrate it and test.

That's possible i miss something so don't hesitate to ask.

Regards,

Nicolas
GLJournalAllocation.zip
Reply all
Reply to author
Forward
0 new messages