Sales Order Freight change  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Sales Order Freight change

Postby Riyaz » Fri Oct 21, 2016 1:11 pm

Hi There

We have a requirement wherein we need to calculate Freight / Courier based on the line items weight, quantity and custom field. We have the calculated value but not sure how to change the CartageCharge values, tried getting SalesOrderHistory object but appears to be noninvokable. Have attached the plugin for your reference. Kindly advise.
Attachments
Plugin Sales Orders - Freight Calculation.xml
(36.29 KiB) Downloaded 125 times
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales Order Freight change

Postby Riyaz » Thu Nov 10, 2016 8:18 pm

Hi There

Pls advise on this

Thanks
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales Order Freight change  Topic is solved

Postby Mike.Sheen » Sun Nov 13, 2016 12:47 pm

CartageCharge1 is an object, and is read-only. You want to set the ExGSTAmount property of that instead.

So, in your code you have:
Code: Select all
salesOrderH.CartageCharge1 = salesOrderH.CartageCharge1 + FreightCharge;


Change that to:
Code: Select all
salesOrderH.CartageCharge1.ExGSTAmount = salesOrderH.CartageCharge1 + FreightCharge;


Mike
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Sales Order Freight change

Postby Riyaz » Fri Dec 02, 2016 1:25 pm

Thanks Mike

But having problems with the salesorderhistory object , it says its non-invocable member

var salesOrderH = (JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderHistory)salesOrder.SalesOrderHistorys(salesOrder.CurrentHistoryNo);

Pls help
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales Order Freight change

Postby Mike.Sheen » Sat Dec 03, 2016 2:22 pm

Riyaz wrote:Thanks Mike

But having problems with the salesorderhistory object , it says its non-invocable member

var salesOrderH = (JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderHistory)salesOrder.SalesOrderHistorys(salesOrder.CurrentHistoryNo);

Pls help


Yes - because you're using C# and to index into an array or list or collection you need square brackets, not parenthesis.

Code: Select all
var salesOrderH = (JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderHistory)salesOrder.SalesOrderHistorys[salesOrder.CurrentHistoryNo];
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 11 guests