I can either instantiate the Batch Processing object and simulate firing that. Sort of like
- Code: Select all
JiwaFinancials.Jiwa.JiwaSales.BatchProcessing.BatchProcess batch = Plugin.Manager.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaSales.BatchProcessing.BatchProcess>(null);
batch.ProcessCandidates.Read();
batch.Process();
Or, I can knock up a SQL SELECT to get my candidate orders, basically like this forum topic viewtopic.php?f=26&t=1649
Populate a list as the attached plugin demonstrates (in that forum post, not this one).
Then just loop through the list and process one by one, like this:
- Code: Select all
if (InvoiceIds.Count > 0)
{
JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder salesOrder = Plugin.Manager.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder>(null);
foreach (string invoiceID in InvoiceIds)
{
Plugin.Manager.LogEvent(String.Format("Processing invoice '{0}'", invoiceID), System.Diagnostics.EventLogEntryType.Information, 0, 0, true);
salesOrder.Read(invoiceID);
salesOrder.Process()
}
}
I think my preference is the latter but would like to hear other thoughts.
And I can see the Process method has parameters for sales order report. Is that essential or can I leave the brackets blank?
EDIT: Re my last question about the brackets, I can see in the POS plugin that I can leave the .Process() brackets blank.