Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant into adminbsb_material_ui
This commit is contained in:
@@ -4,7 +4,7 @@ class Origami::OthersPaymentsController < BaseOrigamiController
|
||||
@sale_id = params[:sale_id]
|
||||
@payment_method_setting = PaymentMethodSetting.all
|
||||
|
||||
@rebate = MembershipSetting.find_by_rebate(1)
|
||||
@rebate = MembershipSetting.find_by_rebate(1)
|
||||
|
||||
# @sale_id = params[:sale_id]
|
||||
# sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
|
||||
@@ -164,28 +164,40 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
sale_id = params[:sale_id]
|
||||
member_info = nil
|
||||
|
||||
saleObj = Sale.find(sale_id)
|
||||
saleObj = Sale.find(sale_id)
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
# For Cashier by Zone
|
||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||
if bookings.count > 1
|
||||
# for Multiple Booking
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
else
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
end
|
||||
|
||||
#shop detail
|
||||
shop_details = Shop.find(1)
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
end
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
# Calculate price_by_accounts
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Re-print")
|
||||
#shop detail
|
||||
shop_details = Shop.find(1)
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
end
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
# Calculate price_by_accounts
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Re-print")
|
||||
end
|
||||
|
||||
def foc
|
||||
@@ -200,6 +212,18 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
sale_payment = SalePayment.new
|
||||
sale_payment.process_payment(saleObj, @user, cash, "foc")
|
||||
|
||||
# For Cashier by Zone
|
||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||
if bookings.count > 1
|
||||
# for Multiple Booking
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
else
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
end
|
||||
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
@@ -213,7 +237,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC")
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -129,10 +129,19 @@ class Ability
|
||||
can :item_edit, :sale_edit
|
||||
can :item_void_cancel, :sale_edit
|
||||
can :cancel_all_void, :sale_edit
|
||||
can :apply_void, :sale_edit
|
||||
|
||||
can :apply_void, :sale_edit
|
||||
can :overall_void, :void
|
||||
|
||||
can :index, :other_charge
|
||||
can :create, :other_charge
|
||||
can :index, :discount
|
||||
can :create, :discount
|
||||
can :remove_discount_items, :discount
|
||||
can :remove_all_discount, :discount
|
||||
|
||||
can :manage, Customer
|
||||
can :manage, DiningQueue
|
||||
|
||||
can :first_bill, :payment
|
||||
can :create, :payment
|
||||
can :show, :payment
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class PaymentMethodSetting < ApplicationRecord
|
||||
# validations
|
||||
validates_presence_of :payment_method, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id
|
||||
validates_presence_of :payment_method #, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id
|
||||
end
|
||||
|
||||
@@ -14,22 +14,14 @@ class SeedGenerator < ApplicationRecord
|
||||
|
||||
# Generate Receipt No
|
||||
def self.new_receipt_no
|
||||
seed = SeedGenerator.find_by_model("sale")
|
||||
new_receipt_no = 0
|
||||
if (seed.nil?)
|
||||
seed = SeedGenerator.new()
|
||||
seed.model = "sale"
|
||||
new_receipt_no = seed.next
|
||||
seed.save
|
||||
# Only return seed no
|
||||
cur_val, next_val = self.update_seed("sale")
|
||||
|
||||
else
|
||||
current_no = seed.next
|
||||
seed.next = seed.next
|
||||
seed.current = current_no
|
||||
seed.save
|
||||
end
|
||||
if (cur_val == 0)
|
||||
cur_val, next_val = self.execute_query("sale")
|
||||
end
|
||||
|
||||
return seed.current
|
||||
return cur_val
|
||||
end
|
||||
|
||||
# Generate for 4 digit Code
|
||||
|
||||
@@ -35,18 +35,21 @@
|
||||
<span><%= t :dashboard %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% if can? :menage, OrderQueueStation %>
|
||||
<li>
|
||||
<a href="<%= oqs_root_path %>">
|
||||
<i class="material-icons">room_service</i>
|
||||
<span><%= t :oqs %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<li>
|
||||
<a href="<%= origami_root_path %>">
|
||||
<i class="material-icons">monetization_on</i>
|
||||
<span><%= t :origami %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% if can? :menage, Customer %>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">widgets</i>
|
||||
@@ -61,6 +64,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
<li>
|
||||
<a href="<%= inventory_path %>">
|
||||
<i class="material-icons">store</i>
|
||||
|
||||
@@ -55,5 +55,5 @@ Rails.application.configure do
|
||||
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
||||
|
||||
# Set Cable URL
|
||||
config.action_cable.url = "ws://192.168.1.39:3002/cable"
|
||||
config.action_cable.url = "ws://192.168.1.196:3002/cable"
|
||||
end
|
||||
|
||||
@@ -101,6 +101,7 @@ en:
|
||||
discount: "DISCOUNT"
|
||||
charges: "CHARGES"
|
||||
commissions: "COMMISSIONS"
|
||||
commissioners: "COMMISSIONERS"
|
||||
in_duties: "IN DUTIES"
|
||||
move: "MOVE"
|
||||
req_bill: "REQ BILL"
|
||||
|
||||
@@ -6,7 +6,7 @@ mm:
|
||||
origami: "အရောင်းကောင်တာ"
|
||||
crm: "စားသုံးသူကြီးကြပ်ရေး"
|
||||
customer: "စားသုံးသူကြီးကြပ်ရေး"
|
||||
queue: "စားသုံးသူကြီးကြပ်ရေး"
|
||||
queue: "တန်းစီစာရင်း"
|
||||
inventory: "ကုန်လှောင်ရုံ"
|
||||
settings: "သတ်မှတ်ချက်များ"
|
||||
transactions: "အလုပ်ပြီးမြောက်မှု့များ"
|
||||
@@ -21,7 +21,7 @@ mm:
|
||||
products: "ကုန်စည်များ"
|
||||
promotions: "အရောင်းမြှင့်တင်ရေး"
|
||||
commissions: "ကော်မရှင်များ"
|
||||
commissioners: "ကော်မရှင်များ"
|
||||
commissioners: "ကော်မရှင်နာများ"
|
||||
printer: "ပရင့်တာ"
|
||||
logout: "ထွက်ရန်"
|
||||
sale: "အရောင်း"
|
||||
@@ -38,9 +38,33 @@ mm:
|
||||
category: "အမျိုးအစား"
|
||||
processed: "လုပ်ဆောင်ခဲ့ပြီး"
|
||||
completed: "ဆောင်ရွက်ပြီးစီး"
|
||||
tax_profile: "Tax Profile"
|
||||
payment_methods: "Payment Methods"
|
||||
accounts: "Accounts"
|
||||
tax_profile: "အခွန်အမျိုးအစား"
|
||||
payment_method: "ငွေပေးချေရန်နည်းလမ်း"
|
||||
payment_methods: "ငွေပေးချေရန်နည်းလမ်းများ"
|
||||
accounts: "အကောင့်များ"
|
||||
details: "အသေးစိတ်များ"
|
||||
menus: "မီနူးများ"
|
||||
sale_count: "ရောင်းရသည့်အရေအတွက်"
|
||||
total_sale: "စုစုပေါင်းရောင်းရငွေ"
|
||||
total_credit: "စုစုပေါင်းအကြွေး"
|
||||
total_card: "ငွေရှင်းကတ်စုစုပေါင်း"
|
||||
OQS: "အိုကျူအက်စ်"
|
||||
tables: "စားပွဲများ"
|
||||
rooms: "အခန်းများ"
|
||||
cash_in: "ငွေသွင်း"
|
||||
cash_out: "ငွေထုတ်"
|
||||
close_cashier: "ငွေစာရင်းအပိတ်"
|
||||
payment_reference: "ငွေပေးချေမှုအကိုးအကား"
|
||||
reference_number: "ငွေပေးချေမှုနံပါတ်"
|
||||
shift_started_at: "တာ၀န်စခဲ့သည့်အချိန်"
|
||||
cashier_name: "ငွေထိန်းနာမည်"
|
||||
closing_balance: "ငွေစာရင်းအပိတ်စာရင်း"
|
||||
card_tap: "ကတ်ဖြင့်တို့ထိပါ"
|
||||
customer_details: "စားသုံးသူကိုယ်ရေးအသေးစိတ်"
|
||||
order_details: "မှာကြားမှုအသေးစိတ်"
|
||||
sale_details: "ရောင်းရငွေအသေးစိတ်"
|
||||
inventory_definitions: "ကုန်လှောင်ရုံပစ္စည်းဖွင့်ဆိုချက်များ"
|
||||
sale_audits: "အရောင်းပြင်ဆင်ခြင်းများ"
|
||||
|
||||
views:
|
||||
btn:
|
||||
@@ -75,7 +99,7 @@ mm:
|
||||
customer: "စားသုံးသူ"
|
||||
discount: "လျှော့စျေး"
|
||||
charges: "ပိုက်ဆံကောက်သည်"
|
||||
commissions: "ကော်မရှင်များ"
|
||||
commissions: "ကော်မရှင်များ"
|
||||
in_duties: "တာဝန်ကျသူများ"
|
||||
move: "ရွေ့ပြောင်းသည်"
|
||||
req_bill: "ကျသင့်ငွေတောင်းခံသည်"
|
||||
|
||||
BIN
public/image/SX-Logo-small.png
Normal file
BIN
public/image/SX-Logo-small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 989 B |
BIN
public/image/SX-logo.png
Normal file
BIN
public/image/SX-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Reference in New Issue
Block a user