Sales Order Decimal issue rounding  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Sales Order Decimal issue rounding

Postby Riyaz » Mon Aug 06, 2018 3:45 pm

Hi Mike

A strange issue, the value which gets assigned is 5.6 but it appears as 5.5999 on the sales order lines in the ExtPrice field, below is the code used, pls advise

decimal dPrice = (decimal) nondel.Price;

System.Windows.Forms.MessageBox.Show(dPrice.ToString());

salesorder.SalesOrderLines.AddInventoryItem(nondel.PartNo, JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLineCollection.SalesOrderLineInventorySeedTypes.e_SalesOrderLinePartNo, ref KeyToGetBackHere);
salesorder.SalesOrderLines[(KeyToGetBackHere as string)].DiscountedPrice = dPrice;
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales Order Decimal issue rounding

Postby Mike.Sheen » Mon Aug 06, 2018 3:57 pm

What type and what value is nondel.Price?

What version of Jiwa?
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 Decimal issue rounding

Postby Riyaz » Mon Aug 06, 2018 4:57 pm

its jiwa 7.1.0

and nondel.Price is a double
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Sales Order Decimal issue rounding  Topic is solved

Postby Mike.Sheen » Tue Aug 07, 2018 10:40 am

Hi Riyaz,

Can you test with the attached plugin?

It adds a button to the ribbon of the sales order form, "Test" - when click it adds part "1170" and sets the discounted price to be 5.6.

It seems to work fine for me - you might want to test first on a Jiwa demo database which has part "1170" in it - then on your own database and at that point you might want to change the part number used.

Mike
Attachments
Plugin Sales Order Test Set DiscountedPrice.xml
(26.58 KiB) Downloaded 73 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: 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 15 guests

cron