parent
67ad202859
commit
085562dbf4
4 changed files with 23 additions and 8 deletions
|
|
@ -33,7 +33,7 @@ class Finance::InvoicesController < ApplicationController
|
|||
|
||||
def fill_deliveries_and_orders_collection(invoice_id, supplier_id)
|
||||
@deliveries_collection = Delivery.where('invoice_id = ? OR (invoice_id IS NULL AND supplier_id = ?)', invoice_id, supplier_id).order(:date)
|
||||
@orders_collection = Order.where('invoice_id = ? OR (invoice_id IS NULL AND supplier_id = ? AND state = ?)', invoice_id, supplier_id, 'finished').order(:ends)
|
||||
@orders_collection = Order.where('invoice_id = ? OR (invoice_id IS NULL AND supplier_id = ? AND state IN (?))', invoice_id, supplier_id, %w[finished received]).order(:ends)
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue