add new field

This commit is contained in:
Sunandar
2017-02-09 18:01:50 +06:30
parent 9dc6fd3cbe
commit 07477f1a06
7 changed files with 132 additions and 91 deletions

View File

@@ -1,7 +1,7 @@
class Batch < ApplicationRecord
has_many :batch_line_item
def self.create_batch(created_by,date,order_ref, card_qty,user_id,adult_or_child,client_id)
def self.create_batch(created_by,date,order_ref, card_qty,user_id,adult_or_child,client_id,product_category_id)
batch = Batch.new
batch.created_by = created_by
batch.order_ref = order_ref
@@ -14,6 +14,7 @@ class Batch < ApplicationRecord
batch.user_id=user_id
batch.export_count=0
batch.client_id=client_id
batch.product_category_id=product_category_id
batch.adult_or_child=adult_or_child.upcase
if batch.save
return batch