Page 1 of 1

Unlock discount percentage on snap>1

PostPosted: Mon Aug 17, 2020 2:34 pm
by DannyC
When a new snapshot is created, I want to allow the user to enter a discount percentage snapshots > 1, all the columns are locked.
I have
Code: Select all
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
   if (JiwaForm is JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)
   {
      JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm salesOrderForm = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)JiwaForm;
      _soForm = salesOrderForm;
      salesOrderForm.SalesOrder.SalesOrderHistorys.Added += SalesOrderNewSnap;
      
   }   
}

private void SalesOrderNewSnap(JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderHistory historyObj)
{
   _soForm.grdLines.LockColumn(false,"DiscountPercentage",-1);
}


But I never expected it to be that easy.
Whats the trick?

Re: Unlock discount percentage on snap>1

PostPosted: Mon Aug 17, 2020 2:57 pm
by Mike.Sheen
DannyC wrote:But I never expected it to be that easy.
Whats the trick?


Many things will not use discount % or prices on snaps > 1. Assumptions are made that the prices and discounts and so on are the same on all snapshots.

Re: Unlock discount percentage on snap>1

PostPosted: Mon Aug 17, 2020 3:17 pm
by DannyC
OK. That throws a spanner in the works for this particular client.

Sometimes there can be quite some time between snap 1 and the next snapshots, such that the inventory pricing has changed and the customer will be needing a different price on snaos > 1. As an example,lets say the items have arrived on a shipment and the landed cost was different than last time, so that means the profit margin is now different. That means they need to charge the debtor a different price to achieve a similar margin.

On subsequent snaps, they need to be able at at least adjust the discount percentage to tweak in line with what the customer will now be charged for that item. It's an essential part of their business practise else I'd tell them to move lines to a new sales order, but that's not an option in this case.

Re: Unlock discount percentage on snap>1  Topic is solved

PostPosted: Mon Aug 17, 2020 4:06 pm
by Mike.Sheen
DannyC wrote:As an example,lets say the items have arrived on a shipment and the landed cost was different than last time, so that means the profit margin is now different. That means they need to charge the debtor a different price to achieve a similar margin.


No.

You cannot change the price. If you want to do that, it's a different order / invoice - the contract of sale cannot be changed like that on the same order.

Re: Unlock discount percentage on snap>1

PostPosted: Mon Aug 17, 2020 11:11 pm
by DannyC
the contract of sale cannot be changed like that on the same order.

So is it a technical limitation or a legal one?

Re: Unlock discount percentage on snap>1

PostPosted: Mon Aug 17, 2020 11:16 pm
by Mike.Sheen
DannyC wrote:So is it a technical limitation or a legal one?


Both.

The technical limit is there because of the accounting and business principle that you don't change prices on an invoice. You credit the invoice and create a new one if it was wrong, which leaves an audit of the change.