diff --git a/README.md b/README.md index 31bf0bd..87fd565 100644 --- a/README.md +++ b/README.md @@ -159,12 +159,13 @@ Refunds for canceled orders and returned parts, following SOP-OPS-014, so they d **Business report** in the top menu compares, for a period (this or last week, month, quarter or year, or custom dates; weeks start on the day set in Redmine's *Start calendars on* setting, Monday when it follows the language): * **Sales**: estimates written, invoices written, invoices paid in full (on the day each was paid in full) and payments received (totals and counts), invoiced vs. estimated, collected vs. invoiced, and what's still owed on those invoices. Estimates and invoices are without sales tax (QuickBooks' tax on each is cached with it); payments are as received, so collected vs. invoiced compares them with the invoices' totals with tax. +* **Sales tax**: **tax invoiced**, the sales tax on invoices dated in the period, paid or not (accrual), and **tax collected**, the sales tax on invoices paid in full in the period, counted on the day each was paid in full (cash), each with how many invoices carried tax, a line chart and a month-by-month table. A partly paid invoice's tax counts as collected once it's paid in full. Only invoices are counted: sales receipts, refund receipts and credit memos aren't kept in Redmine, so file sales tax from QuickBooks' *Sales Tax Liability* report. * **Hours**: estimated hours on estimates, issues' estimated time, invoiced hours on invoices and time spent, with spent vs. estimated, and the **cost performance index** (CPI = invoiced hours รท spent hours): green at 1.00 or more, yellow below 1, red below 0.80. Each month shows its CPI too. * **Charts**: above each set of bars, a line chart of the same figures in the same colors (Chart.js 4.5.1, MIT licensed, bundled with the plugin in assets/javascripts so it doesn't clash with other plugins' copies such as redmine_indicator's Chart.js 2), with a point per day for a week, per week for up to about three months, and per month beyond. Hovering a point shows its figures. **Compare with last year** adds last year's lines, dashed and faded, without reloading: days and weeks go back 52 weeks so weekdays line up, months go back to the same month. Clicking a figure in the legend hides it (and its last-year line); clicking *last year* stops comparing. Today's line stops at today. -* **By month**: every figure month by month, with totals. +* **By month**: every sales and hours figure month by month, with totals (the sales tax has its own table). * **Projects**: pick one or more open projects (Ctrl/Cmd-click; closed and archived projects aren't listed) to count only their issues' estimated time and spent time, in the totals, charts and months; none picked counts every project. Estimates, invoices and payments have no project in QuickBooks, so they always cover the whole business (as do the CPI's invoiced hours). **Remember these projects** saves the choice in your Redmine preferences, and the report opens with it until you save another (saving none goes back to every project). -Estimates, invoices and payments count by their QuickBooks date. Issues' estimated time counts issues created in the period, leaving out parents so subtasks aren't counted twice. Spent time counts time logged in the period. While estimates, invoices or payments are syncing, the report says so (with how many have been read) and refreshes every 30 seconds; the settings page's Synchronization table shows the same per type. Estimates and invoices synced before these figures were added have no total or hours until a full sync (the report says how many); run one again after changing the labor products/services. +Estimates, invoices and payments count by their QuickBooks date; invoices paid in full and tax collected by the day each invoice was paid in full. Issues' estimated time counts issues created in the period, leaving out parents so subtasks aren't counted twice. Spent time counts time logged in the period. While estimates, invoices or payments are syncing, the report says so (with how many have been read) and refreshes every 30 seconds; the settings page's Synchronization table shows the same per type. Estimates and invoices synced before these figures were added have no total, hours or sales tax, and paid invoices no paid-in-full day, until a full sync (the report says how many); run one again after changing the labor products/services. ### QuickBooks custom fields diff --git a/app/views/qbo_reports/index.html.erb b/app/views/qbo_reports/index.html.erb index a822702..7a6f9dc 100644 --- a/app/views/qbo_reports/index.html.erb +++ b/app/views/qbo_reports/index.html.erb @@ -42,6 +42,10 @@ [:invoices, l(:label_report_invoices_written), '#e8a33d'], [:paid, l(:label_report_invoices_paid), '#c0504d'], [:payments, l(:label_report_payments_received), '#5aa05a']]) %> +<% taxes = @report.taxes %> +<% max_tax = taxes.values.map { |t| t[:total] }.max.to_f %> +<% tax_series = chart_series.call([[:tax_invoiced, l(:label_report_tax_invoiced), '#e8a33d'], + [:tax_collected, l(:label_report_tax_collected), '#c0504d']]) %> <% hours_series = chart_series.call([[:estimate_hours, l(:label_report_estimate_hours), '#628db6'], [:issue_hours, l(:label_report_issue_hours), '#9b7fc0'], [:invoice_hours, l(:label_report_invoice_hours), '#e8a33d'], @@ -182,6 +186,54 @@ +
| <%= label %> (<%= l(:label_report_taxed_invoices, count: taxes[key][:count]) %>) | ++ | <%= number_to_currency(taxes[key][:total]) %> | +
<%= l(:text_report_taxes) %>
+| <%= l(:label_month) %> | +<%= l(:label_report_tax_invoiced) %> | +<%= l(:label_report_tax_collected) %> | +
|---|---|---|
| <%= ::I18n.t('date.abbr_month_names')[row[:month].month] %> <%= row[:month].year %> | +<%= number_to_currency(row[:tax_invoiced]) %> | +<%= number_to_currency(row[:tax_collected]) %> | +
| <%= l(:label_total) %> | +<%= number_to_currency(taxes[:tax_invoiced][:total]) %> | +<%= number_to_currency(taxes[:tax_collected][:total]) %> | +