Sales Order Line prices  Topic is solved

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

Sales Order Line prices

Postby Mark Shipman » Thu Aug 13, 2020 11:12 am

Hi,

(another newbie question)

Environment is Jiwa 7.2.1 and MS SQL Server 2019.

I create a Jiwa Sales Order business object and add lines to the SalesOrderLineCollection using the AddInventoryItem() method with either a SalesOrderLineInventorySeedTypes.e_SalesOrderLineInventoryID or SalesOrderLineInventorySeedTypes.e_SalesOrderLinePartNo seed.
Code: Select all
if (!string.IsNullOrEmpty(inventoryId))
{
    salesOrderLines.AddInventoryItem(
        inventoryId,
        JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLineCollection.SalesOrderLineInventorySeedTypes.e_SalesOrderLineInventoryID,
        ref newOrderLineKey);
}
else if (!string.IsNullOrEmpty(orderLineItem.sku))
{
    salesOrderLines.AddInventoryItem(
        orderLineItem.sku,
        JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLineCollection.SalesOrderLineInventorySeedTypes.e_SalesOrderLinePartNo,
        ref newOrderLineKey);
}

Jiwa very nicely populates the PriceIncGST and SellPriceIncGST properties for the order-line.

I want to check if the price we are importing is different to the Jiwa price and, if so, override the Jiwa price.

Which price do I use to:
  • Check if the price is different;
  • Override the calculated Jiwa selling price (including tax)?
Many thanks,
Mark Shipman
Software Developer
Mark Shipman
Occasional Contributor
Occasional Contributor
 
Posts: 21
Joined: Mon Mar 02, 2020 1:44 pm
Location: Auckland, New Zealand

Re: Sales Order Line prices  Topic is solved

Postby SBarnes » Thu Aug 13, 2020 1:34 pm

Hi Mark,

Providing no price will make Jiwa price the products itself like in the sales order screen, the code below is how you tell Jiwa to ignore its pricing and go with what you provide, as ex tax.

Code: Select all
                        //
                        salesorder.SalesOrderLines[(KeyToGetBackHere as string)].FixPrice = true;
                        salesorder.SalesOrderLines[(KeyToGetBackHere as string)].FixSellPrice = true;
                        salesorder.SalesOrderLines[(KeyToGetBackHere as string)].DiscountedPrice = (decimal)line.UnitPrice;
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Sales Order Line prices

Postby Scott.Pearce » Thu Aug 13, 2020 3:14 pm

Price Ex. on the Sales order screen maps to SalesOrderLine.DiscountedPrice in the business logic. This is the ex tax price, after discounts etc have been applied. This is what is normally edited by the user on screen if they want to change the ex price.

Price Inc. on the Sales order screen maps to SalesOrderLine.PriceIncGST in the business logic. This is the inc tax price, after discounts etc have been applied. This is what is normally edited by the user on screen if they want to change the inc price. This is what you would change if you wanted to override the calculated Jiwa selling price (including tax).

Sell Price on the sales order screen maps to SalesOrderLine.SellPriceExGST for normal items, or SalesOrderLine.SellPriceIncGST for items that have their SellPriceIsIncTax flag set. This is the price of the item as far as Jiwa is concerned, before it is changed by the user (via SalesOrderLine.DiscountedPrice or SalesOrderLine.PriceIncGST). It is readonly. I believe this is what you would want to look at to compare prices with the other system (Check if the price is different).


Edit #1 - add Sell Price info.
Edit #2 - add (Check if the price is different) answer.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 0 guests