Change credit note sales account  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Change credit note sales account

Postby DannyC » Fri Aug 12, 2016 10:19 am

I have an odd request from a customer. Well I reckon it's strange anyway but I sort of see their reasoning.

At the moment when a credit note is created, it uses the same GL posting as an invoice, just reversed. Including the Sales account.
They have a list of about 15 different Credit Reasons, and based on the credit reason, they want the Sales posted to a unique GL account.

First question:
Can I change the dialog screen for Credit Reasons to add a column to select GL account? Failing that, I can easily just pop a sales order custom field and look up the GL account.

2nd Question:
When the credit is processed, how can I change the Sales GL account that gets posted?

3rd Question:
The overarching question - is it even possible?

One more thing, I still prefer VB .Net over C#! The client are on 7.0.149 right now but will be upgrading as soon as the new version is out.

Cheers

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Change credit note sales account  Topic is solved

Postby Mike.Sheen » Wed Nov 09, 2016 5:18 pm

Hi Danny,

Attached is a plugin which does this (in VB.NET as requested).

It adds a column to the Credit Reason Maintenance form to allow the user to select a GL Account to use instead when processing credit notes using that credit reason.

EDIT: The plugin has a SQL script attached as a document to create the table needed for the plugin - once the plugin is imported, this should be saved to disk and run.

Mike

CreditReason_InventorySalesAccounts.PNG
screenshot
CreditReason_InventorySalesAccounts.PNG (18.97 KiB) Viewed 2312 times
Attachments
Plugin Add Sales Account to Credit Reasons.xml
Sample Plugin
(71.14 KiB) Downloaded 728 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Change credit note sales account

Postby DannyC » Fri Nov 11, 2016 9:45 am

That is awesome!

In the intervening time since the first post, I have prob spent maybe a full week trying to nut this one out myself.
I managed to get a separate maintenance form running with string columns in the grid for the users to manually type in the reasons and GL accounts.

Now I can see how to add another column to the existing form, it opens up possibilities elsewhere (e.g. I have been asked to add a decimal column to Debtor Class Specific Pricing). Your solution is elegant and the code is easy to understand.

And I also worked out how to change the account when the sales order is processed - in this regard I was pleasantly surprised to see how similar my code was to yours.

Really appreciate your help on this one.

Cheers

Danny
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Change credit note sales account

Postby Mike.Sheen » Fri Nov 11, 2016 9:42 pm

DannyC wrote:In the intervening time since the first post, I have prob spent maybe a full week trying to nut this one out myself.


My apologies for it taking so long. I'm going through the process of addressing unanswered posts from oldest to newest, and hope to get on top of this soon.

Also, I noticed I have an error in my plugin.

In the Save_Ending handler I missed an @ in the INSERT statement:

Code: Select all
Sql = "INSERT INTO CreditReason_InventorySalesAccounts (CreditReasonID, GLLedgerID) VALUES (@CreditReasonID, GLLedgerID)"


Should be:

Code: Select all
Sql = "INSERT INTO CreditReason_InventorySalesAccounts (CreditReasonID, GLLedgerID) VALUES (@CreditReasonID, @GLLedgerID)"


Not sure how I missed that. I obviously failed to test creating a new credit reason, or that error would have been apparent.

I've updated my post to include a revised version of the plugin with the above fix. Also I failed to mention the plugin has a SQL script attached as a document to create the table needed for the plugin - once the plugin is imported, this should be saved to disk and run.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests