diff --git a/app/controllers/transactions/sales_controller.rb b/app/controllers/transactions/sales_controller.rb index fafc89f3..321fa44a 100755 --- a/app/controllers/transactions/sales_controller.rb +++ b/app/controllers/transactions/sales_controller.rb @@ -11,7 +11,7 @@ class Transactions::SalesController < ApplicationController to = params[:to] if receipt_no.nil? && from.nil? && to.nil? - @sales = Sale.where("NOT sale_status = 'void' " ).order("sale_id desc") + @sales = Sale.order("sale_id desc") @sales = Kaminari.paginate_array(@sales).page(params[:page]).per(20) else sale = Sale.search(receipt_no,from,to) diff --git a/app/controllers/transactions/surveys_controller.rb b/app/controllers/transactions/surveys_controller.rb new file mode 100644 index 00000000..8d11fa41 --- /dev/null +++ b/app/controllers/transactions/surveys_controller.rb @@ -0,0 +1,5 @@ +class Transactions::SurveysController < ApplicationController + def index + @surveys = Survey.all + end +end diff --git a/app/views/layouts/_left_sidebar.html.erb b/app/views/layouts/_left_sidebar.html.erb old mode 100755 new mode 100644 index e3d08824..f06b52ab --- a/app/views/layouts/_left_sidebar.html.erb +++ b/app/views/layouts/_left_sidebar.html.erb @@ -69,14 +69,14 @@ <% end %> - <% if can? :menage, Inventory %> +
  • <%= t :backend %>
  • @@ -109,6 +109,11 @@ <%= (t :shiftsale) %>
  • <% end %> + <% if can? :menage, Survey %> +
  • + <%= t("views.right_panel.detail.survey") %> +
  • + <% end %> <% if can? :index, :dailysale %> diff --git a/app/views/transactions/sales/show.html.erb b/app/views/transactions/sales/show.html.erb index bd6ce960..9cab82a5 100755 --- a/app/views/transactions/sales/show.html.erb +++ b/app/views/transactions/sales/show.html.erb @@ -52,7 +52,7 @@ <%= @sale.receipt_no %> <%= @sale.cashier_name rescue '-' %> <%= @sale.sale_status %> - <%= @sale.requested_at.strftime("%m-%d-%Y %H:%M %p") %> + <%= @sale.requested_at.strftime("%m-%d-%Y %H:%M %p") %> <%= t :sale %> <%= t("views.right_panel.detail.item_txt") %> <%= t("views.right_panel.detail.name_txt2") %> @@ -60,6 +60,7 @@ <%= t("views.right_panel.detail.unit_price") %> <%= t("views.right_panel.detail.total_price") %> <%= t("views.right_panel.detail.created_at") %> + <%= t("views.right_panel.detail.remark") %> <% @sale.sale_items.each do |s| %> @@ -69,42 +70,43 @@ <%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%> <%= number_with_precision(s.qty * s.price, :precision => 2, :delimiter => ',') rescue ' '%> <%=l s.created_at.utc.getlocal , :format => :short rescue ' ' %> + <%=s.remark rescue ' '%> <% end %> <%= t("views.right_panel.detail.total") %> - <%= number_with_precision(@sale.total_amount, :precision => 2, :delimiter => ',') rescue ' '%> + <%= number_with_precision(@sale.total_amount, :precision => 2, :delimiter => ',') rescue ' '%> <%= t("views.right_panel.detail.discount") %> - <%= number_with_precision(@sale.total_discount, :precision => 2, :delimiter => ',') rescue ' '%> + <%= number_with_precision(@sale.total_discount, :precision => 2, :delimiter => ',') rescue ' '%> <% @sale.sale_taxes.each do |r|%> <%= r.tax_name %> - <%= number_with_precision(r.tax_payable_amount, :precision => 2, :delimiter => ',') rescue ' '%> + <%= number_with_precision(r.tax_payable_amount, :precision => 2, :delimiter => ',') rescue ' '%> <% end %> <%= t("views.right_panel.detail.grand_total") %> - <%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%> + <%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%>   <%= t("views.right_panel.detail.total_pay_amount") %> - <%= number_with_precision(@sale.amount_received, :precision => 2, :delimiter => ',') rescue ' '%> + <%= number_with_precision(@sale.amount_received, :precision => 2, :delimiter => ',') rescue ' '%> <% @sale_receivables.each do |r|%> <%= r.payment_method.capitalize rescue ' '%> Payment - <%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%> + <%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%> @@ -114,7 +116,7 @@ <%= t("views.right_panel.detail.change") %> - <%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%> + <%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%> @@ -258,9 +260,3 @@ - - - - - - diff --git a/app/views/transactions/surveys/index.html.erb b/app/views/transactions/surveys/index.html.erb new file mode 100644 index 00000000..4e1c02d3 --- /dev/null +++ b/app/views/transactions/surveys/index.html.erb @@ -0,0 +1,53 @@ + +
    +
    +
    +
    +
    + + + + + + + + + + + + + <% if !@surveys.nil? %> + <% @surveys.each do |survey| %> + + + + + + + + + + + <% end %> + <% end %> + +
    <%= t("views.right_panel.detail.dining") %><%= t("views.right_panel.detail.receipt_no") %><%= t("views.right_panel.detail.created_by") %><%= t("views.right_panel.detail.child") %><%= t("views.right_panel.detail.adult") %><%= t("views.right_panel.detail.male") %><%= t("views.right_panel.detail.female") %><%= t("views.right_panel.detail.foreigner") %>
    <%= survey.dining_name rescue ' '%><%= survey.receipt_no rescue '-'%><%= survey.created_by rescue ' '%><%= survey.child rescue ' '%><%= survey.adult rescue ' '%><%= survey.male rescue ' '%><%= survey.female rescue ' '%> + <% if !survey.foreigner.nil? %> + <%= JSON.parse(survey.foreigner) %> + <% end %> +
    +
    +
    +
    +
    + +
    +
    diff --git a/config/locales/en.yml b/config/locales/en.yml old mode 100755 new mode 100644 index dda9180c..4852f454 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -450,7 +450,10 @@ en: additional_parameter: "Additional parameter" lookup: "Lookup" product_sale_report: "Product Sale" - group_type: "Group Type" + dining: "Dining" + child: "Child" + adult: "Adult" + foreigner: "Foreigner" code_txt: "code " charge_txt: "charge" diff --git a/config/locales/mm.yml b/config/locales/mm.yml old mode 100755 new mode 100644 index af901d6e..b8a567bc --- a/config/locales/mm.yml +++ b/config/locales/mm.yml @@ -65,8 +65,8 @@ mm: sale_audits: "အရောင်းပြင်ဆင်ခြင်းများ" bottom: "အရောင်းအနဲဆုံး" payment: "ငွေပေးချေမှု" - backend: "Backend" - date_time: "DateTime" + backend: "နောက်ကွယ်" + date_time: "ရက်စွဲအချိန်" views: btn: @@ -444,8 +444,11 @@ mm: additional_parameter: "ထပ်ဖြည့်အကြောင်းအရာ" survey: "ခြုံငုံလေ့လာခြင်း" lookup: "သတ်မှတ်ချက်များ" - product_sale_report: "Product Sale" - group_type: "Group Type" + product_sale_report: "ကုန်ပစ္စည်းရောင်းရမှုအစီရင်ခံစာ" + dining: "ဆိုင်စား" + child: "ကလေး" + adult: "လူကြီး" + foreigner: "နိုင်ငံခြားသား" code_txt: "ကုတ်ဒ် " charge_txt: "ကောက်ခံသည်" diff --git a/config/routes.rb b/config/routes.rb index 5bb51b19..4293a341 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -383,6 +383,7 @@ scope "(:locale)", locale: /en|mm/ do resources :credit_notes resources :bookings resources :shift_sales + resources :surveys get "/sales/:sale_id/manual_complete_sale" => "manual_sales#manual_complete_sale", :as => "manual_complete_sale" get "/sales/:sale_id/void" => "manual_sales#void", :as => "void"