'erp_vat_reconciliation', 'label' => 'VAT reconciliation', 'description' => 'Input VAT from the scanned purchase invoices, bucketed by the month printed on each document and by VAT rate — the taxable base per bucket, the VAT that rate implies, and the documents the scanner flagged as internally inconsistent.', 'footnote' => 'Buckets follow the date printed on the document, not the day it was scanned; documents with no readable date sit in their own undated bucket. VAT is computed as net times the line\'s rate, because the scanner stores rates rather than per-line VAT amounts; lines with no readable rate keep their base visible and their VAT honestly blank. Credit notes are subtracted, delivery notes excluded. Cross-currency footer totals mean nothing until the currency column is filtered to one value.', 'group' => 'eshop_insights', 'section' => 'comparative_turnover', 'icon' => 'receipt', 'tier' => 'pro', 'scope' => 'both', 'source' => 'sql', 'sql' => $aieo_vr_sql, 'registry_id' => 'erp_vat_reconciliation.by_month_rate', 'version' => '1', 'per_page' => 50, 'row_key' => 'row_uid', 'default_sort' => array( 'month', 'desc' ), 'empty_state' => 'No purchase invoices scanned yet, so there is no input VAT to reconcile. Buckets appear as soon as the Invoice Scanner reads the first document.', 'columns' => array( array( 'key' => 'row_uid', 'label' => 'Key', 'type' => 'id', 'hidden' => true, ), array( 'key' => 'month', 'label' => 'Month', 'type' => 'code', 'width' => '90px', 'sortable' => true, 'filter' => 'select', 'empty' => '— undated —', ), array( 'key' => 'vat_rate', 'label' => 'VAT rate', 'type' => 'percent', 'format' => array( 'precision' => 0 ), 'width' => '90px', 'sortable' => true, 'filter' => 'select', 'empty' => '— missing —', 'header_tip' => 'The rate read off the invoice line. Lines where no rate could be read form their own bucket.', ), array( 'key' => 'currency', 'label' => 'Currency', 'type' => 'code', 'width' => '80px', 'sortable' => true, 'filter' => 'select', ), array( 'key' => 'documents', 'label' => 'Documents', 'type' => 'integer', 'width' => '90px', 'sortable' => true, ), array( 'key' => 'item_lines', 'label' => 'Item lines', 'type' => 'integer', 'width' => '90px', 'aggregate' => 'SUM', ), array( 'key' => 'taxable_base', 'label' => 'Taxable base', 'type' => 'money', 'sortable' => true, 'aggregate' => 'SUM', ), array( 'key' => 'vat_amount', 'label' => 'VAT amount', 'type' => 'money', 'sortable' => true, 'aggregate' => 'SUM', 'empty' => '—', ), array( 'key' => 'flagged_docs', 'label' => 'Flagged', 'type' => 'integer', 'width' => '80px', 'sortable' => true, 'empty_zero' => true, 'empty' => '—', 'tone' => 'warning', 'header_tip' => 'Documents in this bucket whose stated totals disagree with their own line sums (the scanner\'s totals_mismatch flag). Reconcile these first.', ), ), );