From 8f457ac937654b8f94417ffa9d605134271ff61a Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 12 Oct 2017 16:28:45 +0630 Subject: [PATCH 1/7] change header --- app/assets/images/SX-Logo-small.png | Bin 0 -> 989 bytes app/assets/stylesheets/application.scss | 2 +- app/views/layouts/_header.html.erb | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 app/assets/images/SX-Logo-small.png diff --git a/app/assets/images/SX-Logo-small.png b/app/assets/images/SX-Logo-small.png new file mode 100644 index 0000000000000000000000000000000000000000..be14a5c97aa63a9bcc862db43d253ae1a5ae55ed GIT binary patch literal 989 zcmV<310wv1P)n6#eWZwWvBErDoA6aW}~BOyz|c`#{MO*Vq>Is82G$I9;Jl(p^cfm zj^cnM&+|tcTg=me$HXHW4O~rPWEl&AgGL-`$-G)aWETT@wTb}90d?t47p)gU9w+m> z-0(a03Qr_kCs2mk@_QOt?A$VWCDud3QkEePVgHvEbK6@N_E~mO%qwCe&=r?!-fW8m z?qjPy3aq#VN-V@?J&?t%Ua{;BmR~1R?Q^VoAkXUx1W#_aPGF^}e+vWhROMW;+d4F* zSnWaHF%~f?1CYo6FQ_VKp~zqtKEBSpbijbAeRLVHjSwdiQLcOh#}5d_cUXe9OxhW0g~%0Hp!IBWn-t*S!eAwJ|0 zL3kJ(>>Gn`QX#eBYr}iFkas|^uURvBMkL;lyfC?>qW6YQpd)z|#Ycsr!jKvanvb18 zc~78}Pi$0@V&7M7U)lVZxnO{Oxu#wA0ru@cm49g3UObEV25qxoOLtK1K?s%=s^=N3 z4y7;{yb;m(lDGHS09w?o=;XoN(Wkc7+E8CrLoMSuku7-P zQIMdnnY_J*Jc4nPQb5=!A?5%cS1FS4o012lRfg@kJ=RUz0PP}CW1yz%L1P;SN)Uzj zSxbCUT3wvj8hOOVvpRzqR~f_$=Wg#^k_U#Ho(TGT#LC04QIrzg?XuPM(w1k_=6_d) zXWHl@&B<3x9x)M&Oq8N18U{;zU!InPn^w@V$OYxpCv09{BxT(#Uj&-$ - Logo + Logo SX Restaurant From 6b8f986a240d3967b3742f769ba25b93d65d6cd2 Mon Sep 17 00:00:00 2001 From: Yan Date: Mon, 16 Oct 2017 13:17:45 +0630 Subject: [PATCH 2/7] default mm --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 4a8b873a..abeac50e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,7 +13,7 @@ module SXRestaurants # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - config.i18n.default_locale = :'en' + config.i18n.default_locale = :'mm' config.active_record.time_zone_aware_types = [:datetime, :time] config.active_job.queue_adapter = :sidekiq From 96cd4e71810999b0f38a7e9145b02acaec9de89c Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 17 Oct 2017 10:31:43 +0630 Subject: [PATCH 3/7] add mm --- config/locales/mm.yml | 92 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 10 deletions(-) diff --git a/config/locales/mm.yml b/config/locales/mm.yml index 711041d5..a998f2ac 100644 --- a/config/locales/mm.yml +++ b/config/locales/mm.yml @@ -3,21 +3,93 @@ mm: main_navigation: "မာတိကာ" dashboard: "မျက်နှာစာ" oqs: "အမှာစာနေရာများ" - origami: "အရောင်းဌာန" + origami: "အရောင်းကောင်တာ" crm: "စားသုံးသူကြီးကြပ်ရေး" inventory: "ကုန်လှောင်ရုံ" settings: "သတ်မှတ်ချက်များ" - transactions: "အလုပ်ဲပြီးမြောက်မှု့များ" + transactions: "အလုပ်ပြီးမြောက်မှု့များ" reports: "အစီရင်ခံစာ" - zones: "Zones" - menu: "Menu" - cashier: "Cashier" - terminal: "Terminal" - print: "Print" - staff: "Staff" - product: "Product" - promotion: "Promotion" + zones: "ဇုန်" + dinings: "စားပွဲရုံ" + menu: "စားဖွယ်စုံ" + cashier: "ငွေရှင်း" + terminal: "ကောင်တာ" + print: "စာထုတ်ပါ" + staff: "၀န်ထမ်းများ" + products: "ကုန်စည်များ" + promotions: "အရောင်းမြှင့်တင်ရေး" + printer: "ပရင့်တာ" + logout: "ထွက်ရန်" + sale: "အရောင်း" + hourly: "နာရီအလိုက်" + top: "အရောင်းရဆုံး" + orders: "အော်ဒါများ" + credit: "အကြွေး" + home: "မူလစာမျက်နှာ" + simple_menu_item: "ဟင်းလျာများ" + set_menu_item: "တွဲဖက်ဟင်းလျာများ" + table: "စားပွဲ" + room: "အခန်း" + item_set: "တွဲဖက်ဟင်းလျာ" + category: "အမျိုးအစား" + processed: "လုပ်ဆောင်ခဲ့ပြီး" + completed: "ဆောင်ရွက်ပြီးစီး" + views: + btn: + create: "အသစ်တည်ဆောက်ရန်" + new: "အသစ်ခေါ်ရန်" + add: "ထည့်သွင်းရန်" + edit: "ပြင်ဆင်ရန်" + update: "ထပ်မံထည့်သွင်းရန်" + cancel: "ဖျက်သိမ်းရန်" + back: "နောက်သို့" + show: "ပြသရန်" + remove: "ဖယ်ရှားရန်" + delete: "ဖျက်ပစ်ရန်" + destroy: "ဖျက်စီးရန်" + submit: "တင်သွင်းရန်" + reset: "ပြန်ညှိမှု" + search: "ရှာရန်" + enter: "ဝင်ရန်" + clear: "ရှင်းလင်းရန်" + finish: "ပြီးစီးရန်" + filter: "ဇကာစစ်ရှာဖွေရန်" + del: "ဖျက်ပါ" + clr: "ရှင်းပါ" + + print_order_summary: "အော်ဒါအကျဉ်းချုပ်များ စာရွက်ထုတ်ရန်" + memeber_card: "အသင်းဝင်ကတ်ပြား" + qr_code: "QR ကုတ်ဒ်" + cash_in: "ပိုက်ဆံထည့်သွင်းရန်" + cash_out: "ပိုက်ဆံထုတ်ယူရန်" + close_cashier: "ငွေရှင်းကောင်တာပိတ်ရန်" + add_order: "အော်ဒါများထည့်သွင်းရန်" + customer: "စားသုံးသူ" + discount: "လျှော့စျေး" + charges: "ပိုက်ဆံကောက်သည်" + commissions: "ကော်မရှင်များ" + in_duties: "တာဝန်ကျသူများ" + move: "ရွေ့ပြောင်းသည်" + req_bill: "ကျသင့်ငွေတောင်းခံသည်" + first_bill: "ပထမငွေတောင်းခံလွှာ" + pay: "ပေးသည်" + void: "အတည်မဖြစ်ပါ" + foc: "မေတ္တာဖြင့်ကျွေးမွေးသည်" + nett: "အသားတင်" + cash: "ငွေသား" + credit: "အကြွေး" + other_payment: "အခြားငွေပေးဆောင်မှုများ" + percentage: "ရာခိုင်နှုန်း" + remove_item_dis: "တပွဲချင်းစျေးလျှော့ပေးခြင်းပြန်လည်ဖယ်ရှားရန်" + remove_all: "အားလုံးဖယ်ရှားရန်" + new_stock_taking: "ပစ္စည်းစာရင်းအသစ်ထည့်သွင်းရန်" + stock_check_report: "ပစ္စည်းစာရင်းစစ်ဆေးမှုအစီရင်ခံစာ" + new_inventory_product: "ကုန်လှောင်ရုံရောက်ပစ္စည်းအသစ်များ" + generate_report: "အစီရင်ခံစာများရှာဖွေရန်" + exp_to_excel: "Excel သို့ ပို့ပြီးဆက်လက်လုပ်ဆောင်ရန်" + + pagination: first: "« ပထမ" last: "အဆံုး »" From 50140dea04de215dd3e4b97e9cdea285b4c74906 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 17 Oct 2017 10:32:33 +0630 Subject: [PATCH 4/7] add translation --- config/locales/en.yml | 75 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 39bd8303..dc49b5a5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -10,16 +10,85 @@ en: transactions: "Transactions" reports: "Reports" zones: "Zones" + dinings: "Dinings" menu: "Menu" cashier: "Cashier" terminal: "Terminal" print: "Print" staff: "Staff" - product: "Product" - promotion: "Promotion" - + products: "Products" + promotions: "Promotions" + printer: "Printer" + logout: "Logout" + sale: "Sale" + hourly: "Hourly" + top: "Top" + orders: "Orders" + credit: "Credit" + home: "Home" + simple_menu_item: "Simple Menu Item" + set_menu_item: "Set Menu Item" + table: "Table" + room: "Room" + item_set: "Item Set" + category: "Category" + processed: "Processed" + competed: "Completed" views: + btn: + create: "Create" + new: "New" + add: "Add" + edit: "Edit" + update: "Update" + cancel: "Cancel" + back: "Back" + show: "Show" + remove: "Remove" + delete: "Delete" + destroy: "Destroy" + submit: "Submit" + reset: "Reset" + search: "Search" + enter: "Enter" + clear: "Clear" + finish: "Finish" + filter: "Filter" + del: "DEL" + clr: "CLR" + + print_order_summary: "Print Order Summary" + memeber_card: "Member Card" + qr_code: "QR Code" + cash_in: "CASH IN" + cash_out: "CASH OUT" + close_cashier: "CLOSE CASHIER" + add_order: "ADD ORDER" + customer: "CUSTOMER" + discount: "DISCOUNT" + charges: "CHARGES" + commissions: "COMMISSIONS" + in_duties: "IN DUTIES" + move: "MOVE" + req_bill: "REQ BILL" + first_bill: "FIRST BILL" + pay: "PAY" + void: "VOID" + foc: "FOC" + nett: "NETT" + cash: "CASH" + credit: "CREDIT" + other_payment: "Other Payment" + percentage: "PERCENTAGE" + remove_item_dis: "REMOVE ITEM DISCOUNT" + remove_all: "REMOVE ALL" + new_stock_taking: "NEW STOCK TAKING" + stock_check_report: "STOCK CHECK REPORT" + new_inventory_product: "NEW INVENTORY PRODUCT" + generate_report: "GENERATE REPORT" + exp_to_excel: "EXPORT TO EXCEL" + pagination: first: "« First" last: "Last »" From eaea08ebc4f9307327aa2c1c4dbf5d8743cd2b3a Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 17 Oct 2017 10:41:19 +0630 Subject: [PATCH 5/7] add mm sidebar --- app/views/layouts/_sidebar.html.erb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/layouts/_sidebar.html.erb b/app/views/layouts/_sidebar.html.erb index b74ec6ae..626d95e1 100644 --- a/app/views/layouts/_sidebar.html.erb +++ b/app/views/layouts/_sidebar.html.erb @@ -14,23 +14,23 @@
  • <%= link_to (t :inventory), inventory_path,:class =>"" %>
  • <%= t :settings %>
  • -
  • <%= link_to "Zones ", settings_zones_path,:class =>"" %>
  • -
  • <%= link_to "Order Queue Station ", settings_order_queue_stations_path,:class =>"" %>
  • -
  • <%= link_to "Menu ", settings_menus_path,:class =>"" %>
  • +
  • <%= link_to (t :zones), settings_zones_path,:class =>"" %>
  • +
  • <%= link_to (t :oqs), settings_order_queue_stations_path,:class =>"" %>
  • +
  • <%= link_to (t :menu), settings_menus_path,:class =>"" %>
  • <%= link_to (t :cashier), settings_cashier_terminals_path,:class =>"" %>
  • -
  • <%= link_to "Print Settings ", print_settings_path,:class =>"" %>
  • -
  • <%= link_to "Staff ", settings_employees_path,:class =>"" %>
  • -
  • <%= link_to "Product ", settings_products_path,:class =>"" %>
  • -
  • <%= link_to "Promotion ", settings_promotions_path,:class =>"" %>
  • -
  • <%= link_to "Reports", reports_dailysale_index_path, :class =>"" %>
  • +
  • <%= link_to (t :printer), print_settings_path,:class =>"" %>
  • +
  • <%= link_to (t :staff), settings_employees_path,:class =>"" %>
  • +
  • <%= link_to (t :products), settings_products_path,:class =>"" %>
  • +
  • <%= link_to (t :promotions), settings_promotions_path,:class =>"" %>
  • +
  • <%= link_to (t :reports), reports_dailysale_index_path, :class =>"" %>
  • From f0e155c77fef448a2362a3cef7d5afe7c979fc5b Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 17 Oct 2017 17:03:27 +0630 Subject: [PATCH 6/7] fix duplicate key in seed --- app/models/seed_generator.rb | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/app/models/seed_generator.rb b/app/models/seed_generator.rb index a5bf5976..a174b904 100644 --- a/app/models/seed_generator.rb +++ b/app/models/seed_generator.rb @@ -2,6 +2,7 @@ class SeedGenerator < ApplicationRecord # Generate ID for Tables def self.generate_id(model, prefix) seed = SeedGenerator.find_by_model(model) + currentNo = seed.current new_receipt_no = 0 if (seed.nil?) @@ -9,16 +10,17 @@ class SeedGenerator < ApplicationRecord seed.model = model new_receipt_no = seed.next seed.save - - else - current_no = seed.next - seed.next = seed.next + seed.increase_by - seed.current = current_no - seed.save + else + next_current = self.update_seed(model, seed.next, seed.increase_by) + currentNo = next_current + + # current_no = seed.next + # seed.next = seed.next + seed.increase_by + # seed.current = current_no + # seed.save end - padding_len = 15 - prefix.length - saleOrderId = prefix +"-"+ seed.current.to_s.to_s.rjust((14-prefix.length)+1,'0') + saleOrderId = prefix +"-"+ currentNo.to_s.to_s.rjust((14-prefix.length)+1,'0') return saleOrderId end @@ -71,4 +73,22 @@ class SeedGenerator < ApplicationRecord next_code = prefix + seed.current.to_s.to_s.rjust((count)+1,'0') return next_code end + + private + def self.update_seed(model, current, inc) + next_val = 0 + nex = current + inc + update_sql = "update seed_generators set current= #{current}, next= #{nex} where model='#{model}';"; + select_sql = "select * from seed_generators where model='#{model}';" + update_result = ActiveRecord::Base.connection.execute(update_sql); + Rails.logger.debug "SeedGenerator -> " + update_result.to_s + + select_result = ActiveRecord::Base.connection.execute(select_sql); + select_result.each do |row| + p row[3] + next_val = row[3] + end + + return next_val + end end From 1bea819f64193a5940d1a0de3d63ce11d0fc09db Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 19 Oct 2017 17:11:24 +0630 Subject: [PATCH 7/7] re-origin seed generate --- app/models/seed_generator.rb | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/app/models/seed_generator.rb b/app/models/seed_generator.rb index a174b904..a5bf5976 100644 --- a/app/models/seed_generator.rb +++ b/app/models/seed_generator.rb @@ -2,7 +2,6 @@ class SeedGenerator < ApplicationRecord # Generate ID for Tables def self.generate_id(model, prefix) seed = SeedGenerator.find_by_model(model) - currentNo = seed.current new_receipt_no = 0 if (seed.nil?) @@ -10,17 +9,16 @@ class SeedGenerator < ApplicationRecord seed.model = model new_receipt_no = seed.next seed.save - else - next_current = self.update_seed(model, seed.next, seed.increase_by) - currentNo = next_current - - # current_no = seed.next - # seed.next = seed.next + seed.increase_by - # seed.current = current_no - # seed.save + + else + current_no = seed.next + seed.next = seed.next + seed.increase_by + seed.current = current_no + seed.save end + padding_len = 15 - prefix.length - saleOrderId = prefix +"-"+ currentNo.to_s.to_s.rjust((14-prefix.length)+1,'0') + saleOrderId = prefix +"-"+ seed.current.to_s.to_s.rjust((14-prefix.length)+1,'0') return saleOrderId end @@ -73,22 +71,4 @@ class SeedGenerator < ApplicationRecord next_code = prefix + seed.current.to_s.to_s.rjust((count)+1,'0') return next_code end - - private - def self.update_seed(model, current, inc) - next_val = 0 - nex = current + inc - update_sql = "update seed_generators set current= #{current}, next= #{nex} where model='#{model}';"; - select_sql = "select * from seed_generators where model='#{model}';" - update_result = ActiveRecord::Base.connection.execute(update_sql); - Rails.logger.debug "SeedGenerator -> " + update_result.to_s - - select_result = ActiveRecord::Base.connection.execute(select_sql); - select_result.each do |row| - p row[3] - next_val = row[3] - end - - return next_val - end end