Display default xero invoice dates

fixes #682

* pre-fill the invoice_date and due_date in the xero report generation form
* increase the default period between invoice_date and due_date to 1 month in
XeroInvoiceReport
This commit is contained in:
Em-AK
2015-12-13 16:42:32 +01:00
parent a3874d42af
commit fcc328f00a
3 changed files with 6 additions and 4 deletions

View File

@@ -244,7 +244,9 @@ Spree::Admin::ReportsController.class_eval do
def xero_invoices
if request.get?
params[:q] ||= {}
params[:q][:completed_at_gt] = Time.zone.now.beginning_of_month
params[:q][:completed_at_gt] = Time.zone.today.beginning_of_month
params[:invoice_date] = Time.zone.today
params[:due_date] = Time.zone.today + 1.month
end
@distributors = Enterprise.is_distributor.managed_by(spree_current_user)
@order_cycles = OrderCycle.active_or_complete.accessible_by(spree_current_user).order('orders_close_at DESC')