mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-16 04:24:23 +00:00
Preventing double creation of invoices by recognising completed invoices within the specifed period
This commit is contained in:
@@ -8,8 +8,6 @@
|
||||
|
||||
- @invoices.order('created_at DESC').each do |invoice|
|
||||
- month = (invoice.created_at.localtime - 1.day)
|
||||
- range = "#{month.beginning_of_month.strftime("%d/%m/%y")}"
|
||||
- range += " - #{[month.end_of_month, Time.now].min.strftime("%d/%m/%y")}"
|
||||
.row.invoice_title
|
||||
.eight.columns.alpha
|
||||
%h4= "#{month.strftime("%b %Y")}#{( invoice.completed_at ? '' : '*' )}"
|
||||
@@ -32,11 +30,11 @@
|
||||
%td= adjustment.display_amount
|
||||
- invoice.adjustments.where('source_type <> (?)', "BillablePeriod").each do |adjustment|
|
||||
%tr
|
||||
%td= range
|
||||
%td
|
||||
%td= adjustment.label
|
||||
%td= adjustment.display_amount
|
||||
%tr.total
|
||||
%td= range
|
||||
%td
|
||||
%td TOTAL
|
||||
%td= invoice.display_total
|
||||
|
||||
|
||||
Reference in New Issue
Block a user