SBarnes wrote:Is it possible to to inherit from the Batch Processing Object such as
- Code: Select all
class SplitBatchProcess : JiwaFinancials.Jiwa.JiwaSales.BatchProcessing.BatchProcess
{
public override void Process()
{
}
}
and then override the Process to ignore client ClientCancelledException and then attach this new object to the Jiwa Batch processing form or is there another type of exception that can be thrown that will make Jiwa think everything processed correctly as this would be an easier solution?
Any help is appreciated.
You can do that, but then you'd have to provide a custom batch processing form to use your business logic instead of ours because we haven't got any dependency injection providing an easy way to do that (assuming this is going to be invoked via the user via a form) - if it's some other process and not via our standard batch processing form then things are a bit simpler - you just need to replicate what we do in our batch process method and add a try catch on client cancelled and deal with it that way.
I can't see an easy solution to this without modifying our code to allow the level of customisation you need. There is also the consideration that various other aspects of the system (reports, for example) may make the assumption that only one debtor transaction exists for any given sales order history (snapshot).
We can add an event to be fired from the process method which passes you the necessary information (sales order object, candidate debtor transaction) and allows you to return by reference a list of debtor transaction objects, which we could then create for you. Some considerations as how to handle payment allocations (if there are payments on the order) would need to be made.
We could also add a property (or method parameter) and allow that property to be set on the sales order which is an anonymous method which we invoke for building the debtor transactions, and/or the processing in general. We do something similar for the ProcessPayments of a sales order:
- Code: Select all
Public Sub ProcessPayments(Optional x As Func(Of JiwaCashBook.CashBookTransaction, JiwaCashBook.CashBookTransaction) = Nothing)
We added the above to allow the cashbook receipt transaction created to have the transaction customised as desired - specifically in Magento integrations to set the reference to be a PayPal or CC provider transaction reference to assist in reconciliation.
Following the same approach, when we build a debtor transaction, we could check if the sales order process method has been provided a method as a parameter for debtor transaction construction, and invoke that instead of our transaction construction, and alter our framework to have a list of transactions instead of just one.
Lots of options, but we'd need to modify things our end to make this work in a robust and clean way.
I suggest creating an improvement request via
http://helpdesk.jiwa.com.au with your requirements to get things started.
Mike