From 0af1e5997f0dd86bdf229999823e1b07c068bed5 Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 30 Nov 2017 11:18:08 +0630 Subject: [PATCH 1/2] remove blank in account type --- app/views/settings/set_menu_items/_form.html.erb | 2 +- app/views/settings/simple_menu_items/_form.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/settings/set_menu_items/_form.html.erb b/app/views/settings/set_menu_items/_form.html.erb index 4b7d570e..31a31c15 100755 --- a/app/views/settings/set_menu_items/_form.html.erb +++ b/app/views/settings/set_menu_items/_form.html.erb @@ -12,7 +12,7 @@ <%= f.input :alt_name,:input_html => {:class => "col-md-9"} %> <%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"},:input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %> <%= f.input :min_qty,:input_html => {:class => "col-md-9"} %> - <%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %> + <%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %> <%= f.input :is_available,:input_html => {:class => "col-md-9"} %> diff --git a/app/views/settings/simple_menu_items/_form.html.erb b/app/views/settings/simple_menu_items/_form.html.erb index 7fd4b353..ff143e46 100755 --- a/app/views/settings/simple_menu_items/_form.html.erb +++ b/app/views/settings/simple_menu_items/_form.html.erb @@ -12,7 +12,7 @@ <%= f.input :alt_name,:input_html => {:class => "col-md-9"} %> <%= f.input :type, :collection => ["SimpleMenuItem","SetMenuItem"], :input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %> <%= f.input :min_qty,:input_html => {:class => "col-md-9"} %> - <%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"} %> + <%= f.input :account_id, :label => "Account type", :collection => Account.collection,:input_html => {:class => "col-md-9"}, include_blank: false, include_hidden: false %> <%= f.input :is_available,:input_html => {:class => "col-md-9"} %> From de9701100d7a62f2b34e2133b18444526a76c176 Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 30 Nov 2017 11:23:44 +0630 Subject: [PATCH 2/2] to_i to to_f in shift --- app/models/shift_sale.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/shift_sale.rb b/app/models/shift_sale.rb index 6c956620..86499ab1 100755 --- a/app/models/shift_sale.rb +++ b/app/models/shift_sale.rb @@ -52,10 +52,10 @@ class ShiftSale < ApplicationRecord self.total_taxes = self.total_taxes + saleobj.total_tax self.grand_total = self.grand_total + saleobj.grand_total self.cash_sales = self.cash_sales.to_f + cash.to_f - self.credit_sales = self.credit_sales.to_i + credit.to_f - self.other_sales = self.other_sales.to_i + other_sales.to_f - self.nett_sales = self.nett_sales + (saleobj.total_amount.to_f - saleobj.total_discount) #self.grand_total.to_i - self.commercial_taxes - self.commercial_taxes = self.commercial_taxes.to_i + tax.to_f + self.credit_sales = self.credit_sales.to_f + credit.to_f + self.other_sales = self.other_sales.to_f + other_sales.to_f + self.nett_sales = self.nett_sales + (saleobj.total_amount.to_f - saleobj.total_discount) #self.grand_total.to_f - self.commercial_taxes + self.commercial_taxes = self.commercial_taxes.to_f + tax.to_f self.total_rounding = self.total_rounding + saleobj.rounding_adjustment self.total_receipt = self.total_receipt + 1 if saleobj.customer.customer_type == "Dinein" @@ -79,10 +79,10 @@ class ShiftSale < ApplicationRecord self.total_taxes = self.total_taxes - saleobj.total_tax self.grand_total = self.grand_total - saleobj.grand_total self.cash_sales = self.cash_sales.to_f - cash.to_f - self.credit_sales = self.credit_sales.to_i - credit.to_f - self.other_sales = self.other_sales.to_i - other_sales.to_f + self.credit_sales = self.credit_sales.to_f - credit.to_f + self.other_sales = self.other_sales.to_f - other_sales.to_f self.nett_sales = self.nett_sales - (saleobj.total_amount.to_f - self.total_discounts) #self.grand_total.to_i - self.commercial_taxes - self.commercial_taxes = self.commercial_taxes.to_i - tax.to_f + self.commercial_taxes = self.commercial_taxes.to_f - tax.to_f self.total_rounding = self.total_rounding - saleobj.rounding_adjustment self.total_void = self.total_void + saleobj.grand_total if saleobj.customer.customer_type == "Dinein"