diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 8c3d7cc4..35308c5f 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -86,10 +86,10 @@ class HomeController < ApplicationController @total_payment_methods.each do |payment| if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" pay = Sale.payment_sale('card', today) - @sale_data.push({'card' => pay}) + @sale_data.push({'card' => pay.payment_amount}) else pay = Sale.payment_sale(payment.payment_method, today) - @sale_data.push({payment.payment_method => pay}) + @sale_data.push({payment.payment_method => pay.payment_amount}) end end @summ_sale = Sale.summary_sale_receipt(today) diff --git a/app/models/sale.rb b/app/models/sale.rb index a1367b98..3db6efb1 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -1039,7 +1039,7 @@ end else query = query.where("sales.sale_status = 'completed' and sp.payment_method = '#{payment_method}' and DATE_FORMAT(sales.receipt_date,'%Y-%m-%d') = ?",today) end - query.sum("sp.payment_amount") + query.select("(CASE WHEN sp.payment_method='cash' THEN (SUM(sp.payment_amount) - SUM(sales.amount_changed)) ELSE SUM(sp.payment_amount) END) as payment_amount").first() end def self.total_customer(today) diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index 89900056..2682f203 100755 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -13,74 +13,85 @@
-
- - - - - - - - - - - - - - - - - - - <% if @crm_customers.count > 0 %> - <% @i = 0 %> - <% @crm_customers.each do |crm_customer| %> - - - - - - - - - <% end %> - <% else %> - - <% end %> - -
- -
- <%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %> -
-
- - -
- - - - - +
+
+
+ <%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %> +
+
+ +
- <% end %> + + + + +
-
<%= t("views.right_panel.detail.sr_no") %><%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.card_no") %><%= t("views.right_panel.detail.contact_no") %><%= t("views.right_panel.detail.email") %><%= t("views.right_panel.detail.action") %>
- - <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> - <%= @i += 1 %> - <%else%> - - - <% end %> - <%= crm_customer.name %><%= crm_customer.card_no rescue '-' %><%= crm_customer.contact_no %><%= crm_customer.email %><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %>

There is no data for search <%=@filter%>....

-
- <%= paginate @crm_customers %> +
+
+
+
+ + + + + + + + + + + + + + + + + <% if @crm_customers.count > 0 %> + <% @i = 0 %> + <% @crm_customers.each do |crm_customer| %> + + + + + + + + + + <% end %> + <% else %> + + <% end %> + +
<%= t("views.right_panel.detail.sr_no") %><%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.card_no") %><%= t("views.right_panel.detail.contact_no") %><%= t("views.right_panel.detail.email") %><%= t("views.right_panel.detail.action") %>
+ + + <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> + <%= @i += 1 %> + <%else%> + - + <% end %> + <%= crm_customer.name %><%= crm_customer.card_no rescue '-' %><%= crm_customer.contact_no %><%= crm_customer.email %><%= link_to t("views.btn.show"), crm_customer_path(crm_customer) %>

There is no data for search <%=@filter%>....

+
+ <%= paginate @crm_customers %> +
+
+
+ +
diff --git a/app/views/home/dashboard.html.erb b/app/views/home/dashboard.html.erb index 54ea2859..a42bce49 100755 --- a/app/views/home/dashboard.html.erb +++ b/app/views/home/dashboard.html.erb @@ -157,16 +157,17 @@ <% end %> <% end %> <% end %> - - <%= t("views.right_panel.detail.card_sale") %> : - - <% total_card = 0.0 %> - <% @sale_data.each do |data| %> - <% total_card = data["card"] %> - <% break end %> - <%= total_card.to_f %> - - + + <% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %> + <% if !total_card.nil? %> + + <%= t("views.right_panel.detail.card_sale") %> : + + <%= total_card["card"].to_f %> + + + <% end %> + <% end %>
diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 18512b93..e788a08f 100755 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -14,86 +14,84 @@
-
-
- +
+
+
+ + <% path ="/origami/#{@sale_id}/customers" %> + <%= form_tag path, :id => "filter_form", :method => :get do %> +
+
-
+ + - - + <% end %> + <%else%> + + <% end %> + +
- -
- <% path ="/origami/#{@sale_id}/customers" %> - <%= form_tag path, :id => "filter_form", :method => :get do %> -
-
+
+
+ +
- - + -
-
- -
+
+ <% end %> + + +
+
+ + + + + + + + + + + + - + + <% if @crm_customers.count > 0 %> + <% @i = 0 %> + <% @crm_customers.each do |crm_customer| %> - - <% end %> - - - - - - - - - - - - - - - - <% if @crm_customers.count > 0 %> - <% @i = 0 %> - <% @crm_customers.each do |crm_customer| %> - - - + - - - - - + + + + + + + - - <% end %> - <%else%> - - <% end %> - -
<%= t("views.right_panel.detail.sr_no") %><%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.card_no") %><%= t("views.right_panel.detail.contact_no") %><%= t("views.right_panel.detail.email") %>
<%= t("views.right_panel.detail.sr_no") %><%= t("views.right_panel.detail.name") %><%= t("views.right_panel.detail.card_no") %><%= t("views.right_panel.detail.contact_no") %><%= t("views.right_panel.detail.email") %>
-
- <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> - <%= @i += 1 %> - <%else%> - - - <% end %> - <%= crm_customer.name %><%= crm_customer.company rescue '-' %><%= crm_customer.contact_no %><%= crm_customer.email %> + <% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %> + <%= @i += 1 %> + <%else%> + - + <% end %> + <%= crm_customer.name %><%= crm_customer.company rescue '-' %><%= crm_customer.contact_no %><%= crm_customer.email %>

There are no record for your search

-
+

There are no record for your search

+
- <%= paginate @crm_customers %> + <%= paginate @crm_customers %> +
diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index 6daacbb2..d250e0b7 100755 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -147,7 +147,7 @@ $('#used_amount').text(cash.substr(0,cash.length-1)); break; case 'nett': - var remain_amount = $('#valid_amount').val(); + var remain_amount = $('#redeemamt').val(); $('#used_amount').text(remain_amount); break; diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index aee41b77..05f14c04 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -232,7 +232,7 @@ end if @status_order == 'order' && @status_sale != 'sale' - unless @order_items.nil? + unless @order_items.nil? || @order_items.empty? count = 0 @order_items.each do |order_item | count += 1 @@ -291,7 +291,7 @@
<% if @status_sale == 'sale' - unless @order_items.nil? + unless @order_items.nil? || @order_items.empty? %> Pending New Order diff --git a/config/locales/mm.yml b/config/locales/mm.yml index 82573242..29121da8 100755 --- a/config/locales/mm.yml +++ b/config/locales/mm.yml @@ -26,7 +26,7 @@ mm: top: "အရောင်းရဆုံး" orders: "အော်ဒါများ" credit: "အကြွေး" - + bookings: "ကြိုတင်စာရင်းသွင်းခြင်း" home: "မူလစာမျက်နှာ" simple_menu_item: "ဟင်းလျာများ" set_menu_item: "တွဲဖက်ဟင်းလျာများ" @@ -88,6 +88,7 @@ mm: filter: "ဇကာစစ်ရှာဖွေရန်" del: "ဖျက်ပါ" clr: "ရှင်းပါ" + assign: "ချမှတ်သည်" print_order_summary: "အော်ဒါအကျဉ်းချုပ်များ စာရွက်ထုတ်ရန်" memeber_card: "အသင်းဝင်ကတ်ပြား" @@ -109,6 +110,9 @@ mm: foc: "မေတ္တာဖြင့်ကျွေးမွေးသည်" nett: "အသားတင်" cash: "ငွေသား" + mpu: "MPU" + jcb: "JCB" + visa: "VISA" credit: "အကြွေး" other_payment: "အခြားငွေပေးဆောင်မှုများ" percentage: "ရာခိုင်နှုန်း" @@ -145,6 +149,11 @@ mm: order_queue_stations: "အော်ဒါများတန်းစီသည့်စက်" cashier_terminal: "ငွေရှင်းကောင်တာ" print_settings: "ပရင်တာပြင်ဆင်ရန်" + transaction_sales: "အရောင်းစာရင်းများ" + setting_membership_actions: "အဖွဲ့၀င်မှုဆိုင်ရာချိတ်ဆက်မှုပြင်ဆင်ချက်များ" + membership_actions: "အဖွဲ့၀င်မှုဆိုင်ရာချိတ်ဆက်မှု" + membership_setting: "အဖွဲ့၀င်မှုဆိုင်ရာပြင်ဆင်ချက်များ" + button: new: "အသစ်" create: "တည်ဆောက်" @@ -171,6 +180,8 @@ mm: queue: "တန်းစီ" save: "သိမ်းဆည်း" finish: "ပြီးဆုံး" + save_to_journal: "မှတ်တမ်းတင်မည်" + search_keyboard: "စကားလုံးရှာဖွေမှုများ" detail: name: "နာမည်" type: "အမျိုးအစား" @@ -183,6 +194,7 @@ mm: created_at: "ပြုလုပ်ခဲ့ချိန်" updated_at: "ပြောင်းလဲခဲ့ချိန်" action: "လုပ်ဆောင်မှု" + action_at: "လုပ်ဆောင်ခဲ့ချိန်" actions: "လုပ်ဆောင်မှုများ" item_code: "ဟင်းပွဲ၏နံပါတ်" unit_price: "တပွဲစာစျေးနှုန်း" @@ -266,6 +278,7 @@ mm: additional_parameters: "ထပ်ဆောင်းသတ်မှတ်မှုများ" title: "ခေါင်းစဥ်" discount: "လျှော့စျေး" + item_discount: "ဟင်းပွဲအလိုက်လျှော့စျေးများ" point: "ပွိုင့်" bonus: "အပိုဆောင်း" rebate: "ဆုကြေး" @@ -284,6 +297,7 @@ mm: net_price: "စျေးအသစ်" percentage: "ရာခိုင်နှုန်း" product: "ကုန်ပစ္စည်း" + commission: "ကော်မရှင်" commission_type: "ကော်မရှင်အမျိုးအစား" amount: "သင့်ငွေ" active: "လက်ရှိသုံးစွဲနေ" @@ -340,6 +354,91 @@ mm: tax_amount: "အခွန်ပမာဏ" sales_status: "အရောင်းအနေအထား" receipt_date: "ငွေလက်ခံဖြတ်ပိုင်းနေ့စွဲ" + check_by: "စစ်ဆေးသူ" + check_at: "စစ်ဆေးချိန်" + reason: "အကြောင်းပြချက်" + stock_count: "ပစ္စည်းရေတွက်မှု" + stock_balance: "ပစ္စည်းလက်ကျန်" + different: "ကွာခြားချက်" + order: "အော်ဒါ" + from: "မှ" + to: "ဆီသို့" + order_status: "အော်ဒါမှာကြားမှုအခြေအနေ" + order_items: "အော်ဒါမှာထားသောဟင်းလျာများ" + total_price: "စုစုပေါင်းကျသင့်ငွေ" + enter_keyboards: "စကားလုံးများရိုက်ထည့်ပါ" + receipt_generated_at: "ငွေလက်ခံဖြတ်ပိုင်းထွက်သည့်အချိန်" + total: "စုစုပေါင်း" + total_pay_amount: "စုစုပေါင်းပေးငွေပမာဏ" + change: "ပြန်အမ်းငွေ" + option: "ရွေးချယ်ရန်" + waiter: "ဆိုင်၀န်ထမ်း" + membership_transactions: "အဖွဲ့၀င်အရောင်းစာရင်းများ" + redeem: "ဆုကြေးပြန်သုံးငွေ" + approved_at: "ခွင့်ပြုချိန်" + credit_note: "အကြွေး" + requested_by: "တောင်းယူသူ" + requested_at: "တောင်းယူချိန်" + payment_status: "ငွေပေးချေမှုအခြေအနေ" + sale_status: "အရောင်းအခြေအနေ" + total_amount: "စုစုပေါင်းကျသင့်ငွေပမာဏ" + total_discount: "စုစုပေါင်းလျှော့စျေးပမာဏ" + total_tax: "အခွန်စုစုပေါင်း" + tax_type: "အခွန်အမျိုးအစား" + rnd_adj: "ငွေအတိုးအလျှော့ချိန်ညှိမှု" + amt_received: "လက်ခံရရှိငွေ" + amt_changed: "ပြန်အမ်းငွေ" + select_customer: "စားသုံးသူရွေးချယ်ပါ" + credit_amount: "အကြွေးငွေပမာဏ" + daily_sale_report: "နေ့စဥ်ရောင်းရငွေအစီရင်ခံစာ" + from_date: "မှ​ရက်စွဲ" + to_date: "ထိရက်စွဲ" + sr: "အမှတ်စဥ်" + void_amount: "ပြန်ဖျက်သည့်ပမာဏ" + mpu_sales: "MPU ရောင်းရငွေ" + master_sales: "Master ရောင်းရငွေ" + visa_sales: "Visa ရောင်းရငွေ" + jcb_sales: "JCB ရောင်းရငွေ" + redeem_sales: "ဆုကြေးပြန်သုံးငွေနှင့် ရောင်းရငွေ" + cash_sales: "ငွေသား ရောင်းရငွေ" + credit_sales: "အကြွေး ရောင်းရငွေ" + foc_sales: "အခမဲ့ ရောင်းရငွေ" + foc_item: "အခမဲ့ ဟင်းလျာများ" + net_amount: "အသတင်စျေးနှုန်း" + sale_item_report: "ရောင်းရဟင်းလျာအစီရင်ခံစာ" + select_period: "အချိန်ကာလသတ်မှတ်ပါ" + shift_name: "တာ၀န်ချိန်" + code: "ကုတ်နံပါတ်" + item: "ဟင်းလျာ" + revenue: "ရောင်းရ၀င်ငွေ" + total_price_by: "စုစုပေါင်းငွေပမာဏ" + sub_total: "စုစုပေါင်း" + cash_received: "လက်ခံရရှိငွေ" + card_sales: "ကတ်ဖြင့်ရောင်းရငွေများ" + select_payments: "ငွေပေးချေမှုအမျိုးအစားရွေးချယ်ပါ" + all_shift: "တာ၀န်ချိန်များအားလုံး" + receipt_no_report: "ငွေလက်ခံဖြတ်ပိုင်းနံပါတ် အစီရင်ခံစာ" + payment_method_report: "ငွေပေးချေမှုနည်းလမ်းအလိုက် အစီရင်ခံစာ" + rnd_adj_sh: "ငွေအတိုးအလျှော့ချိန်ညှိမှု" + shift_sale_report: "တာ၀န်ချိန်အလိုက်ရောင်းရငွေ အစီရင်ခံစာ" + cashier_station: "ငွေရှင်းကောင်တာ" + cash_payment: "ငွေသားပေးချေမှု" + credit_payment: "အကြွေးပေးချေမှု" + credit_payment_report: "အကြွေးပေးချေမှုဆိုင်ရာ အစီရင်ခံစာ" + void_sale_report: "ဖျက်သိမ်းအရောင်းစာရင်းများဆိုင်ရာ အစီရင်ခံစာ" + sale_date: "ရောင်းချသည့်ရက်စွဲ" + commission_report: "ကော်မရှင်စား အစီရင်ခံစာ" + commission_price: "ကော်မရှင်စား စျေးနှုန်း" + commission_amount: "ကော်မရှင်စား ငွေပမာဏ" + receipt: "ငွေလက်ခံဖြတ်ပိုင်း" + tax: "အခွန်" + card_sale: "ကတ်ဖြင့်ရောင်းရငွေ" + dine_in: "ဆိုင်တွင်စားသောက်ခြင်း" + takeaway: "ပါဆယ်၀ယ်ယူခြင်း" + membership: "အသင်း၀င်ခြင်း" + gateway_communication_type: "အဓိကလမ်းကြောင်းဆက်သွယ်မှုအမျိုးအစား" + gateway_url: "အဓိကလမ်းကြောင်းဆက်သွယ်မှုလိပ်စာ" + additional_parameter: "ထပ်ဖြည့်အကြောင်းအရာ" survey: "ခြုံငုံလေ့လာခြင်း" code_txt: "ကုတ်ဒ် " @@ -497,10 +596,16 @@ mm: stock_check_reason_txt: "စတော့စစ်ဆေးမှုအကြောင်းပြချက်" stock_check_txt: "စတော့စစ်ဆေးသည်" detail_txt: "အသေးစိတ်" - + no_data_txt: "ရှာဖွေခြင်း မတွေ့ရှိပါ" assign_txt: "ချမှတ်သည်" remove_txt: "ဖြုတ်ပစ်သည်" - + membership_type_txt: "အသင်း၀င်မှုအမျိုးအစား" + merchant_account_txt: "စားသောက်ဆိုင်ဘက်ဆိုင်ရာအကောင့်" + membership_actions_txt: "အဖွဲ့၀င်မှုဆိုင်ရာချိတ်ဆက်မှု" + gateway_communication_type_txt: "အဓိကလမ်းကြောင်းဆက်သွယ်မှုအမျိုးအစား" + gateway_url_txt: "အဓိကလမ်းကြောင်းဆက်သွယ်မှုလိပ်စာ" + membership_setting_txt: "အဖွဲ့၀င်မှုဆိုင်ရာပြင်ဆင်ချက်များ" + cancel_btn_txt: "ပြန်ဖျက်ရန်" image_btn_txt: "တင်သွင်းရန်" create_btn_txt: "တည်ဆောက်ရန်"