GL Distribution Any Account

82 views
Skip to first unread message

Andrea Checchia

unread,
Apr 20, 2017, 12:14:03 PM4/20/17
to iDempiere
Hi,

 we would like to extend the MDistribution class as we need to overwrite the postingtype "actual" with "budget".

Our filter should be "Documenttype = MYYPE"  and overwrite all lines with the specific posting type.

For this we added 2 new fields  : LIT_OverwritePostingType (Y/N) and PostingType
but we find out a problem..... if we don't specify the account_id it doesn't work.

This is the specif source code .. where is writting  "exit if account id is not set", why is there an option ANY ACCOUNT  if the code exit. 

=== org.compiere.model.MDistribution.get(Properties, int, String, int, int, int, int, int, int, int, int, int, int, int, int, int, int) ===

....
public static MDistribution[] get (Properties ctx, int C_AcctSchema_ID,
 
String PostingType, int C_DocType_ID,
 
int AD_Org_ID, int Account_ID,
 
int M_Product_ID, int C_BPartner_ID, int C_Project_ID,
 
int C_Campaign_ID, int C_Activity_ID, int AD_OrgTrx_ID,
 
int C_SalesRegion_ID, int C_LocTo_ID, int C_LocFrom_ID,
 
int User1_ID, int User2_ID)
 
{
 
MDistribution[] acctList = get (ctx, Account_ID);
 
if (acctList == null || acctList.length == 0)        <---------- (here...)
   
return null;
 





Am i missing something ?

Thanks advance.

Andrew.

Carlos Antonio Ruiz Gómez

unread,
Apr 21, 2017, 11:06:55 AM4/21/17
to iDempiere
Hi Andrea, sounds like an old bug (compiere times).

I tested the attached patch and it seems to fix the problem - but I think more community tests would be good.

If you find the patch ok can you please add a JIRA ticket with this?

Regards,

Carlos Ruiz
DistributeAnyAccount.patch

Andrea Checchia

unread,
Apr 24, 2017, 4:39:37 AM4/24/17
to iDempiere
Hi Carlos.

Thank you so much for your patch, it was what we needed for our management.
 
Andrea
Reply all
Reply to author
Forward
0 new messages