Page 1 of 1

Add Special Price to Debtor Class Specific Pricing

PostPosted: Wed Nov 16, 2016 12:01 pm
by DannyC
Hi,
Based on the nice trick to add a column to the Credit Reason Maintenance form ( see viewtopic.php?f=26&t=656), I am trying to add a decimal/money column to Debtor Class Specific Pricing.
I am stuck on one line. In the Save_Ending handler, you have a line
Code: Select all
   Dim creditReason As JiwaSales.Configuration.CreditReasons.CreditReason = creditReasonForm.BusinessLogic(recID)
.
I am trying to do the similar Dim for Debtor Class Pricing but am having trouble with the syntax. I have
Code: Select all
Dim DebtorClass As JiwaInventory.DebtorClassificationInventorySpecific = InventoryForm.BusinessLogic(recID)
but it is not compiling.
I've attached the plugin I've done, see line 79.
Can you have a quick squiz and advise what the correct syntax should be? I have tried various syntaxes and collections but can't seem to get it right.

Cheers

Re: Add Special Price to Debtor Class Specific Pricing  Topic is solved

PostPosted: Wed Nov 16, 2016 12:12 pm
by Mike.Sheen
DannyC wrote:I am trying to do the similar Dim for Debtor Class Pricing but am having trouble with the syntax. I have
Code: Select all
Dim DebtorClass As JiwaInventory.DebtorClassificationInventorySpecific = InventoryForm.BusinessLogic(recID)
but it is not compiling.


InventoryForm.BusinessLogic will be the Inventory Business Logic - i.e.: the JiwaFinancials.Jiwa.JiwaInventory.Inventory class. That has a property containing the debtor classification pricing - DebtorClassPrices which is of the type DebtorClassificationInventorySpecificCollection.

The following should make it clearer:
Code: Select all
Dim inventoryBusinessLogic As JiwaFinancials.Jiwa.JiwaInventory.Inventory= InventoryForm.BusinessLogic

If inventoryBusinessLogic.DebtorClassPrices.Count > 0
' Following gets the first debtor classification price in the collection
    Dim DebtorClass As JiwaInventory.DebtorClassificationInventorySpecific = inventoryBusinessLogic.DebtorClassPrices(1)
End If


Note that InventoryForm.BusinessLogic(recID) is invalid in this case, as the inventory business logic is not a collection itself - it's of type JiwaApplication.BusinessLogic.Maintenance. The code you based this off was a List Maintenance business logic which is itself a collection, so BusinessLogic(recID) made sense with that type.