My firm is an Abbyy VAR and I am designing Layouts in FLS and then modifying Document Definitions in FlexiCapture 11 to eventually capture vendor invoice data for our customers (Country: United States).
Almost in all vendor invoices, there is a line items table with Quantity (shipped, sold, etc) and Unit price, whose multiplication gives Extended Price (or Amount), except for any deductions such as line item discounts or line adjustments.
I would like to ensure that line items table data is correctly recognized. Thus, I will need to create a rule that checks if Qty * Unit Price equals Extended Price. If the recalculation is correct, no changes will be made for that table row. If not, I want Extended Price column to be replaced by the recalculated Extended Price amount, if not, be written into a read-only control column that will be used to compare with Extended Price and to be summed up for being written into another field in Document Definition.
Right now, I have a rule that sums up all values in Extended Price Column, and compares a recalculated total with 'Invoice Total' cell data, after adding all other charges (i.e Sales Tax, Freight). Functionality of this rule depends on Extended Price Column to be recognized correctly. So I need to make sure Extended Price is recognized correctly, if not, force a rule to recalculate it correctly as a control measure and one way to eliminate the need for validation by Data Verification Operator.
My question: How can I create a rule that multiplies two cells in each row of a line item table, checks the result with another cell, and if necessary force-writes the calculation result into a target cell? Can you provide a solution or script samples if this is achievable only by script?