This commit is contained in:
Dev Team
2025-06-02 17:18:11 +06:30
parent 1a373f0d2a
commit 174a232421
10 changed files with 72 additions and 176 deletions

View File

@@ -85,7 +85,7 @@ GEM
mime-types (>= 1.16)
chartkick (3.4.0)
chronic (0.10.2)
chunky_png (1.3.12)
chunky_png (1.4.0)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
@@ -182,7 +182,6 @@ GEM
json (> 1.8.4)
rails (> 4.2.0)
sass-rails (~> 5.0)
pg (1.2.3)
prawn (2.3.0)
pdf-core (~> 0.8.1)
ttfunk (~> 1.6)
@@ -239,10 +238,10 @@ GEM
nokogiri
rubyzip
spreadsheet (> 0.6.4)
rqrcode (1.1.2)
rqrcode (2.1.2)
chunky_png (~> 1.0)
rqrcode_core (~> 0.1)
rqrcode_core (0.1.2)
rqrcode_core (~> 1.0)
rqrcode_core (1.2.0)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.2)
@@ -381,7 +380,6 @@ DEPENDENCIES
mysql2 (~> 0.5.2)
nested_form
pdfjs_viewer-rails
pg
prawn
prawn-qrcode
prawn-table
@@ -391,6 +389,7 @@ DEPENDENCIES
rails (~> 5.1.0)
redis (~> 3.0)
roo
rqrcode (= 2.1.2)
rspec-rails (~> 3.5)
rubyzip (= 1.0.0)
sass-rails (~> 5.0)

View File

@@ -1212,11 +1212,11 @@ $(function() {
// });
$("#read_modal").on('shown.bs.modal', function(e) {
$(this).prop("disabled", true);
$("#create_pay_order").prop("disabled", true);
$("#create_order").prop("disabled", true);
// $(this).prop("disabled", true);
// $("#create_pay_order").prop("disabled", true);
// $("#create_order").prop("disabled", true);
$("#read_modal").attr('data-for', 'member');
e.preventDefault();
// e.preventDefault();
getCardNo();
onScan.attachTo(document, {

View File

@@ -289,149 +289,3 @@ i.logout_icon{
.blue{
background-color: blue;
}
.new-design-navbar {
background-color: #5856D6;
color: white;
padding: 0 15px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
height: 50px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
position: relative;
z-index: 1030;
}
.new-design-navbar .container-fluid {
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
padding-left: 0;
padding-right: 0;
}
.new-design-navbar .navbar-left-section,
.new-design-navbar .navbar-right-section {
display: flex;
align-items: center;
height: 100%;
}
.new-design-navbar .bars-toggle {
color: white;
text-decoration: none;
margin-right: 15px;
padding: 0 10px;
height: 100%;
display: flex;
align-items: center;
}
.new-design-navbar .bars-toggle:hover {
background-color: rgba(255,255,255,0.1);
}
.new-design-navbar .bars-toggle .material-icons {
font-size: 24px;
vertical-align: middle;
}
.new-design-navbar .navbar-brand {
color: white !important;
display: flex;
align-items: center;
font-size: 1.1rem; /* Adjust size */
font-weight: 500;
padding: 0;
margin: 0;
text-decoration: none;
}
.new-design-navbar .navbar-brand:hover {
opacity: 0.9;
}
.new-design-navbar .navbar-brand .material-icons {
margin-right: 8px;
font-size: 22px;
vertical-align: middle;
}
.new-design-navbar .navbar-right-section .nav-item {
display: flex;
align-items: center;
margin-left: 15px;
padding: 0 8px;
height: 100%;
cursor: default;
font-size: 0.9rem;
}
.new-design-navbar .navbar-right-section .nav-item .material-icons {
margin-right: 5px;
font-size: 20px;
vertical-align: middle;
}
.new-design-navbar .navbar-right-section .nav-item.dropdown > a.dropdown-toggle {
color: white;
text-decoration: none;
display: flex;
align-items: center;
height: 100%;
padding: 0 8px;
}
.new-design-navbar .navbar-right-section .nav-item.dropdown > a.dropdown-toggle:hover {
background-color: rgba(255,255,255,0.1);
}
.new-design-navbar .navbar-right-section .nav-item.dropdown > a .material-icons:last-child { /* Dropdown arrow */
margin-left: 2px;
margin-right: 0;
font-size: 22px;
}
/* Dropdown Menu Styling */
.new-design-navbar .dropdown-menu {
border-radius: 4px;
border: 1px solid #ddd;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
margin-top: 2px !important;
}
.new-design-navbar .dropdown-menu > li > a {
display: flex;
align-items: center;
padding: 10px 20px;
color: #333;
font-size: 14px;
text-decoration: none;
clear: both;
font-weight: normal;
line-height: 1.42857143;
white-space: nowrap;
}
.new-design-navbar .dropdown-menu > li > a:hover,
.new-design-navbar .dropdown-menu > li > a:focus {
background-color: #f5f5f5;
color: #333;
}
.new-design-navbar .dropdown-menu > li > a .material-icons {
margin-right: 12px;
color: #777;
font-size: 18px;
vertical-align: middle;
}
.new-design-navbar .dropdown-menu .hidden {
display: none;
}
.material-icons {
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
font-feature-settings: 'liga';
}

View File

@@ -13,11 +13,11 @@ module MultiTenancy
end
def find_tenant_by_subdomain_or_name
if request.subdomains.first && request.subdomains.first != "www"
set_current_tenant(Shop.find_by(subdomain: request.subdomains.first))
elsif Shop.count == 1
set_current_tenant(Shop.first)
end
# if request.subdomains.first && request.subdomains.first != "www"
# set_current_tenant(Shop.find_by(subdomain: request.subdomains.first))
# elsif Shop.count == 1
set_current_tenant(Shop.last)
# end
end
def not_found

View File

@@ -87,6 +87,7 @@ class Foodcourt::AddordersController < BaseFoodcourtController
end
def create
byebug
if params[:booking_id].present?
booking = Booking.find(params[:booking_id])
end

View File

@@ -230,6 +230,8 @@ class Foodcourt::QrpayController < BaseFoodcourtController
def create
sale_id = params[:sale_id]
response_body = params[:response_body]
receipt_no = Sale.find_by(sale_id: sale_id).receipt_no
unless current_login_employee
render json: { status: false, message: "User not authenticated or employee context missing." }, status: :unauthorized
@@ -239,6 +241,17 @@ class Foodcourt::QrpayController < BaseFoodcourtController
qrpayment_service = QrPaymentService.new(sale_id, current_login_employee)
result = qrpayment_service.process
PaymentGatewayAuditJob.perform_later({
receipt_no: receipt_no,
gateway_name: "MMQR",
endpoint_url: nil,
event_type: "kbz.payment.success",
request_body: nil,
response_body: response_body.to_json,
request_method: "POST",
shop_code: Shop.current_shop.shop_code
})
if result[:status]
render json: result, status: :ok
else
@@ -273,7 +286,7 @@ class Foodcourt::QrpayController < BaseFoodcourtController
if response[:data]['code'] == '0'
case response[:data]['trade_status']
when 'PAY_SUCCESS'
render json: { status: 'PAY_SUCCESS' }
render json: { status: response[:data][:trade_status], data: response[:data] }
else
render json: { status: response[:data]['trade_status'] || 'PENDING' }
end

View File

@@ -42,17 +42,17 @@ class Printer::PrinterWorker
end
def print(file_path, printer_destination = nil )
if printer_destination.nil?
printer_destination = self.printer_destination
end
# if printer_destination.nil?
# printer_destination = self.printer_destination
# end
copy = self.print_copies
#Print only when printer information is not null
if !self.printer_destination.nil?
(1..copy).each do
page = Cups::PrintJob.new(file_path, printer_destination)
page.print
end
end
# copy = self.print_copies
# #Print only when printer information is not null
# if !self.printer_destination.nil?
# (1..copy).each do
# page = Cups::PrintJob.new(file_path, printer_destination)
# page.print
# end
# end
end
end

View File

@@ -16,6 +16,19 @@ class KbzMerchant
api_url = "#{@url}/precreate"
payload = build_create_payload(amount, merch_order_id, timeout)
response = send_request(payload, api_url)
# audit
PaymentGatewayAuditJob.perform_later({
receipt_no: merch_order_id,
gateway_name: "MMQR",
endpoint_url: api_url,
event_type: "kbz.payment.precreate",
request_body: payload,
response_body: response,
request_method: "POST",
shop_code: Shop.current_shop.shop_code
})
handle_response(response)
end
@@ -23,6 +36,18 @@ class KbzMerchant
api_url = "#{@url}/closeorder"
payload = build_close_payload(merch_order_id)
response = send_request(payload, api_url)
PaymentGatewayAuditJob.perform_later({
receipt_no: merch_order_id,
gateway_name: "MMQR",
endpoint_url: api_url,
event_type: "kbz.payment.closeorder",
request_body: payload,
response_body: response,
request_method: "POST",
shop_code: Shop.current_shop.shop_code
})
handle_response(response)
end

View File

@@ -20,10 +20,11 @@ module SXRestaurants
config.active_record.time_zone_aware_types = [:datetime, :time]
config.active_job.queue_adapter = :sidekiq
config.time_zone = 'Asia/Rangoon'
config.time_zone = 'Asia/Yangon'
config.autoload_paths << Rails.root.join('app/services')
config.action_cable.disable_request_forgery_protection=true
config.action_cable.allowed_request_origins = [/http:\/\/*/, /https:\/\/*/]
config.middleware.insert_before ActionDispatch::Static, Rack::Cors do
allow do
origins '*'

View File

@@ -54,7 +54,10 @@ Rails.application.configure do
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.action_cable.disable_request_forgery_protection = true
# config.action_cable.disable_request_forgery_protection = true
config.action_cable.disable_request_forgery_protection=true
config.action_cable.allowed_request_origins = [/http:\/\/*/, /https:\/\/*/]
# Set Cable URL
# config.action_cable.url = "ws://192.168.1.196:3002/cable"
end