Good day everyone
I have the BO Sales Analysis with the following rule:
Rule 1:
SalesAnalysis.GrossAmountMarketing=SUM InvoiceMarketing.GrossAmount WHERE (InvoiceMarketing IN SalesAnalysis.MyInvoiceMarketingID)
Rule 2:
SalesAnalysis.GrossAmountMarketingTopUp=SUM InvoiceMarketingTopUp.GrossAmount WHERE (InvoiceMarketingTopUp IN SalesAnalysis.MyInvoiceMarketingTopUpID)
Rule 3:
SalesAnalysis.GrossAmountProduct=SUM InvoiceProduct.GrossAmount WHERE (InvoiceProduct IN SalesAnalysis.MyInvoiceProductID)
Rule 4:
SalesAnalysis.GrossAmountTopUp=SUM InvoiceTopUp.GrossAmount WHERE (InvoiceTopUp IN SalesAnalysis.MyInvoiceTopUpID)
Rule 5:
SalesAnalysis.GrossAmountPackageNew=SUM InvoicePackage.GrossAmount WHERE (InvoicePackage IN SalesAnalysis.MyInvoicePackageID AND InvoicePackage.Type='New')
SalesAnalysis.GrossAmountPackageConversion=SUM InvoicePackage.GrossAmount WHERE (InvoicePackage IN SalesAnalysis.MyInvoicePackageID AND InvoicePackage.Type='Conversion')
SalesAnalysis.GrossAmountPackageReserved=SUM InvoicePackage.GrossAmount WHERE (InvoicePackage IN SalesAnalysis.MyInvoicePackageID AND InvoicePackage.Type='Reserved')
SalesAnalysis.GrossAmountPackageRenewal=SUM InvoicePackage.GrossAmount WHERE (InvoicePackage IN SalesAnalysis.MyInvoicePackageID AND InvoicePackage.Type='Renewal')
Rule 6:
SalesAnalysis.GrossAmountTotal=SalesAnalysis.GrossAmountMarketing+SalesAnalysis.GrossAmountMarketingTopUp+SalesAnalysis.GrossAmountPackageNew+SalesAnalysis.GrossAmountPackageConversion+SalesAnalysis.GrossAmountPackageReserved+SalesAnalysis.GrossAmountPackageRenewal+SalesAnalysis.GrossAmountProduct+SalesAnalysis.GrossAmountTopUp
My Invoice Form has the Tab of:
- InvoiceHeader
- InvoiceMarketing
- InvoiceMarketingTopUp
- InvoicePackage
- InvoiceTopUp
- InvoiceProduct
Now I create a New Invoice...there are no transaction for each tab..
Now I add new to the Invoice Package with the amount of $1000. In the process:
- InvoicePackage.MyInvoiceHeaderID = InvoiceHeader
- InvoicePackage.MySalesAnalysisID = InvoiceHeader.MySalesAnalysisID
However, the proccess slow very slow before show me the Edit Form...
I found the Log file perform the calculation for the Total Gross Amount, Tax Amount, Net Amount for the Invoice Header. That is fine..
I also found the Log file of the Sales Anlaysis perform the calculation for all the various Invoice as it will slow down the process.
How to ask the Sales Analysis BO only perform the process for the Invoice Package Only rather than every thing? Process the Sum calculation only transaction being change.
For Example: the InvoicePackage Gross Amount was change or InvoicePackage was Add New tranasction, compute the Sales Analysis for InvoicePackage only.. not every thing again and again.
I have tried to changed the code condition as:
SalesAnalysis.MyInvoicePackage Was Changed
it worked. But when I change the amount, the Sales Analysis did not perform the job to recompute the sum of gross amount.....
Please help......
Thanks...