Jiwa Price Change Event  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Jiwa Price Change Event

Postby nsbandara » Wed Nov 08, 2017 6:09 pm

Jiwa version : 7.0.175

I need to apply price calculated from custom module when sales order is created. The sell prices / Price scheme price recorded in Jiwa needs to go through few more filters based on debtor custom field value. Currently I apply pricing when new inventory item is added to sales order.

Code: Select all
private void SalesOrderLines_AddInventoryItemEnd(JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLine item)
    {
          .......
  item.SellPriceExGST = calculatedPrice;
    }


But whenever Jiwa internally apply pricing from another module like Re-Apply Quantities price get reset .

Is there a better event that I can use to apply custom price calculated other than property change events(Cannot use property change events, since user should be able to manually override calculated price).

Thanks.
User avatar
nsbandara
Occasional Contributor
Occasional Contributor
 
Posts: 43
Joined: Tue Jul 16, 2013 5:02 pm
Location: Sri Lanka
Topics Solved: 11

Re: Jiwa Price Change Event  Topic is solved

Postby SBarnes » Wed Nov 08, 2017 9:57 pm

You may be able to get around the need to even write a plugin here by the possibility of the following:

1. Jiwa defines a pricing schemes to which every debtor must have one (Go Debtor Maintenance - > Financials Tab -> Pricing Tab and drill down into the schemes)
2. In a pricing scheme You can define a new available type of price say called Debtor Custom Fields price.
3. For this you set a stored procedure that it is to use to work out the price. An example of this would be like, which seems to be consistent for all the Jiwa defined ones

Code: Select all
ALTER PROCEDURE [dbo].[usp_Jiwa_Price_DebtorsDiscountPrice]    @DebtorID Char(20),
                  @OrderDate DateTime,
                  @InventoryID Char(20),
                  @LogicalID Char(20),
                  @Quantity DECIMAL(19,6)

4. The last step of the procedure seems to be a select statement that follows the lines of

Code: Select all
SELECT #tmpPrices.Price AS Price,
      #tmpPrices.Description As PriceDescription,
      #tmpPrices.HasQuantityBreak As HasQuantityBreak,
      #tmpPrices.QuantityBreak As QuantityBreak,
      1 As HasDateRange,
      #tmpPrices.StartDate As StartDate,
      #tmpPrices.EndDate As EndDate,
      0 As HasSOHID,
      '' As SOHID,
      #tmpPrices.IncTax AS PriceIsIncTax,
      RecID [RecID]
   FROM #tmpPrices


If you have a look at what Jiwa themselves have done for some of the standard ones you should get the idea but you should be able to put your logic inside a stored procedure and then let Jiwa take care of the rest and let the sales order events just fire as normal.

The way Jiwa have set this up has been thought through really well in that it makes fairly easy to customise by just defining a stored procedure. Other parts of the system such as batch print filters etc let you set up stored procedures to do the same sort of thing.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 19 guests

cron