invoice_parsing.resolved and unresolved (what the parser read), invoice_meta (what the invoice itself says) and diff (how the invoice compares with the order). diff reads for a person: the import writes the lines of the body and removes nothing. Every list of the diff stops at 100 lines, and diff.diff_summary keeps the real counts.po_level_changes compares the order with the lines the parser matched, so its subtotal counts resolved alone, rounded to 2 decimals. When a line of resolved has no price, the subtotal of the invoice is unknown: its inv_value is null and it is not a change. The total of the invoice is invoice_meta.subtotal. An inv_value of null means that the invoice does not show that cost. It is not a change, and the order keeps its cost.changed or unchanged compares on the price basis of the order item. Its changes hold the values that the import writes: the price of one case for an item priced per case, and the quantity in units. item_unit_cost and item_unit_count give the same values for a line with no change. basis tells if the line price is per unit or per case. basis_unknown is true when SA is not sure of the basis: neither the price nor the quantity tells it, the price is 10% to 25% off the item price, or the quantity tells the other basis. basis is the basis that the import writes. With no basis found, it is unit. A line with no price on the invoice has unit_price and item_unit_cost null. It is never a price change, so only its quantity can change. A price of 0 on the invoice is a price.