From fa7fcdd5596e89b8d85f7ffcfd9f9f1c854ce5a4 Mon Sep 17 00:00:00 2001 From: Phyo Date: Mon, 11 Sep 2017 13:55:38 +0630 Subject: [PATCH] Room Charges(Account ID change,add dropdown list,tac not calculate) --- app/models/sale.rb | 4 ++-- app/views/settings/dining_charges/_form.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 6eec518f..9a75b42a 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -177,7 +177,7 @@ class Sale < ApplicationRecord sale_item = SaleItem.new sale_item.product_code = chargeObj.item_code sale_item.product_name = dining_name.to_s + " ( " + dining_time.to_s + " )" - # sale_item.account_id = item.account_id + sale_item.account_id = 0 sale_item.product_alt_name = "-" sale_item.qty = 1 sale_item.unit_price = chargeObj.unit_price @@ -186,7 +186,7 @@ class Sale < ApplicationRecord sale_item.sale_id = self.id sale_item.price = diningprice sale_item.save - self.compute + self.compute_by_sale_items(self.id, self.sale_items, self.total_discount) end def update_item (item) diff --git a/app/views/settings/dining_charges/_form.html.erb b/app/views/settings/dining_charges/_form.html.erb index 5cc25062..0138a774 100644 --- a/app/views/settings/dining_charges/_form.html.erb +++ b/app/views/settings/dining_charges/_form.html.erb @@ -8,7 +8,7 @@ <%= f.input :charge_type, :collection => [:hr, :day] %> <%= f.input :minimum_free_time %> <%= f.input :charge_block, :input_html => { :id => 'charge_block'} %> - <%= f.input :time_rounding %> + <%= f.input :time_rounding, :collection => [:down, :up] %> <%= f.input :time_rounding_block, :input_html => { :id => 'time_rounding_block'} %> <%= f.input :time_rounding_block_price, :input_html => { :id => 'time_rounding_block_price'} %>