Revert "fixes"

This reverts commit 174a232421.
This commit is contained in:
Dev Team
2025-06-02 17:21:41 +06:30
parent 174a232421
commit 555de796c4
10 changed files with 176 additions and 72 deletions

View File

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

View File

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

View File

@@ -289,3 +289,149 @@ i.logout_icon{
.blue{ .blue{
background-color: 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 end
def find_tenant_by_subdomain_or_name def find_tenant_by_subdomain_or_name
# if request.subdomains.first && request.subdomains.first != "www" if request.subdomains.first && request.subdomains.first != "www"
# set_current_tenant(Shop.find_by(subdomain: request.subdomains.first)) set_current_tenant(Shop.find_by(subdomain: request.subdomains.first))
# elsif Shop.count == 1 elsif Shop.count == 1
set_current_tenant(Shop.last) set_current_tenant(Shop.first)
# end end
end end
def not_found def not_found

View File

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

View File

@@ -230,8 +230,6 @@ class Foodcourt::QrpayController < BaseFoodcourtController
def create def create
sale_id = params[:sale_id] 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 unless current_login_employee
render json: { status: false, message: "User not authenticated or employee context missing." }, status: :unauthorized render json: { status: false, message: "User not authenticated or employee context missing." }, status: :unauthorized
@@ -241,17 +239,6 @@ class Foodcourt::QrpayController < BaseFoodcourtController
qrpayment_service = QrPaymentService.new(sale_id, current_login_employee) qrpayment_service = QrPaymentService.new(sale_id, current_login_employee)
result = qrpayment_service.process 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] if result[:status]
render json: result, status: :ok render json: result, status: :ok
else else
@@ -286,7 +273,7 @@ class Foodcourt::QrpayController < BaseFoodcourtController
if response[:data]['code'] == '0' if response[:data]['code'] == '0'
case response[:data]['trade_status'] case response[:data]['trade_status']
when 'PAY_SUCCESS' when 'PAY_SUCCESS'
render json: { status: response[:data][:trade_status], data: response[:data] } render json: { status: 'PAY_SUCCESS' }
else else
render json: { status: response[:data]['trade_status'] || 'PENDING' } render json: { status: response[:data]['trade_status'] || 'PENDING' }
end end

View File

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

View File

@@ -16,19 +16,6 @@ class KbzMerchant
api_url = "#{@url}/precreate" api_url = "#{@url}/precreate"
payload = build_create_payload(amount, merch_order_id, timeout) payload = build_create_payload(amount, merch_order_id, timeout)
response = send_request(payload, api_url) 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) handle_response(response)
end end
@@ -36,18 +23,6 @@ class KbzMerchant
api_url = "#{@url}/closeorder" api_url = "#{@url}/closeorder"
payload = build_close_payload(merch_order_id) payload = build_close_payload(merch_order_id)
response = send_request(payload, api_url) 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) handle_response(response)
end end

View File

@@ -20,11 +20,10 @@ module SXRestaurants
config.active_record.time_zone_aware_types = [:datetime, :time] config.active_record.time_zone_aware_types = [:datetime, :time]
config.active_job.queue_adapter = :sidekiq config.active_job.queue_adapter = :sidekiq
config.time_zone = 'Asia/Yangon' config.time_zone = 'Asia/Rangoon'
config.autoload_paths << Rails.root.join('app/services') 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 config.middleware.insert_before ActionDispatch::Static, Rack::Cors do
allow do allow do
origins '*' origins '*'

View File

@@ -54,10 +54,7 @@ Rails.application.configure do
# routes, locales, etc. This feature depends on the listen gem. # routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker 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 # Set Cable URL
# config.action_cable.url = "ws://192.168.1.196:3002/cable" # config.action_cable.url = "ws://192.168.1.196:3002/cable"
end end