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.