mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
13180: increase filter time to 1 year
This commit is contained in:
@@ -97,7 +97,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
|
||||
$scope.loadAssociatedData = ->
|
||||
RequestMonitor.load $scope.distributors = Enterprises.index(action: "visible", ams_prefix: "basic", "q[sells_in][]": ["own", "any"])
|
||||
RequestMonitor.load $scope.orderCycles = OrderCycles.index(ams_prefix: "basic", as: "distributor", "q[orders_close_at_gt]": "#{moment().subtract(90,'days').format()}")
|
||||
RequestMonitor.load $scope.orderCycles = OrderCycles.index(ams_prefix: "basic", as: "distributor", "q[orders_close_at_gt]": "#{moment().subtract(1,'year').format()}")
|
||||
RequestMonitor.load $scope.suppliers = Enterprises.index(action: "visible", ams_prefix: "basic", "q[is_primary_producer_eq]": "true")
|
||||
|
||||
$scope.dereferenceLoadedData = ->
|
||||
|
||||
@@ -681,6 +681,14 @@ RSpec.describe '
|
||||
let!(:oc1) { create(:simple_order_cycle, distributors: [distributor]) }
|
||||
let!(:oc2) { create(:simple_order_cycle, distributors: [distributor]) }
|
||||
let!(:oc3) { create(:simple_order_cycle, distributors: [distributor]) }
|
||||
let!(:oc4) do
|
||||
create(
|
||||
:simple_order_cycle,
|
||||
orders_close_at: 364.days.ago,
|
||||
orders_open_at: 400.days.ago,
|
||||
distributors: [distributor]
|
||||
)
|
||||
end
|
||||
let!(:o1) {
|
||||
create(:order_with_distributor, state: 'complete', shipment_state: 'ready',
|
||||
completed_at: Time.zone.now,
|
||||
@@ -701,6 +709,11 @@ RSpec.describe '
|
||||
completed_at: 2.weeks.from_now,
|
||||
order_cycle: oc3 )
|
||||
}
|
||||
let!(:o5) {
|
||||
create(:order_with_distributor, state: 'complete', shipment_state: 'ready',
|
||||
completed_at: 100.days.ago,
|
||||
order_cycle: oc4 )
|
||||
}
|
||||
let!(:li1) { create(:line_item_with_shipment, order: o1 ) }
|
||||
let!(:li2) { create(:line_item_with_shipment, order: o2 ) }
|
||||
let!(:li3) { create(:line_item_with_shipment, order: o3 ) }
|
||||
|
||||
Reference in New Issue
Block a user