CashBook and CashJournal Problem

Whenever bugs are encountered they are quashed and reported. Here you can see their quashings up close.

Moderators: sureshquest, arulmani, trifon

CashBook and CashJournal Problem

Postby trifon » Wed Dec 29, 2004 12:45 am

This is fix that tries to resolve problem described at this thread: http://red1.org/forum/viewtopic.php?t=167

Affected files are:
org.compiere.grid.VPayment
org.compiere.model.MCash
I will try to describe changes:

org.compiere.grid.VPayment
-Changed method: private boolean saveChanges()
Here I made just one modification:
// Trifon. Fixed to use newC_CashBook_ID
MCash cash = MCash.get (Env.getCtx(), m_AD_Org_ID, newDateAcct, C_Currency_ID, newC_CashBook_ID);
The aim is to get proper Cash Journal etc. Cash Journal that is for choosen by user CashBook.

org.compiere.model.MCash
-Added new method: MCash get(Properties ctx, int AD_Org_ID, Timestamp dateAcct, int C_Currency_ID, int C_CashBook_ID)
The aim of this method is to return Cash Journal for given Currency, CashBook, Org and Date. The old method did not contain CashBook.
So when user change Cashbook of given SalesOrder or Invoice, Compiere will be able to choose proper CashBook.
In these method I have changed only 3 lines which are commented with "// Added by Trifon".

(The codes are here: http://compiere.red1.org/Sales-Order-Cashbook.zip )
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia

Postby red1 » Wed Dec 29, 2004 12:50 am

Hi Trifon,
U said in the MCash, u changed 3 lines, but i checked there is only one line commented.
// Get CashBook
// MCashBook cb = MCashBook.get (ctx, AD_Org_ID, C_Currency_ID); // Old One
MCashBook cb = new MCashBook (ctx, C_CashBook_ID); // Added by Trifon
if (cb == null)

Where is the other two? :roll:
But from what u wrote above, its not the same as the one u gave me. If u can send the correct one again i will repost to the link above.

It looks like Trifon has solved a bug if its what the manual says it supposed to do. What do u or Moyses or Lofx say? If its so, i can move this to the Bug's Galore :)

So, let us get the comments going as all here can learn together and improve. Thats the whole idea, as we open up the codes it will be like what Linus and Eric said as 'many eyeballs makes any bug shallow'

U are quite fast too!
:)
red1
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby trifon » Wed Dec 29, 2004 1:10 am

Hi Red1,
First changed line is:
+ " AND cb.C_CashBook_ID=?)"; // #4
The other two changed lines are those below.
red1 wrote:// Get CashBook
// MCashBook cb = MCashBook.get (ctx, AD_Org_ID, C_Currency_ID); // Old One
MCashBook cb = new MCashBook (ctx, C_CashBook_ID); // Added by Trifon
if (cb == null)
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia

Postby red1 » Wed Dec 29, 2004 1:26 am

Hi Trifon,
What u changed in the source and what u say above
trifon wrote: -Added new method: MCash get(Properties ctx, int AD_Org_ID, Timestamp dateAcct, int C_Currency_ID, int C_CashBook_ID)

is not the same.

In your code you seem to make it shorter and miss the Currency_ID.

regards
red1
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby trifon » Wed Dec 29, 2004 1:44 am

red1 wrote:In your code you seem to make it shorter and miss the Currency_ID.


Yes, i miss the Currency_Id, because i have CashBook_ID. One CashBook can have only one currency, so Currency_ID is not neccesary.
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia


Return to BUGS Galore!

Who is online

Users browsing this forum: No registered users and 1 guest

cron