SQA urgent issues

This commit is contained in:
phyusin
2018-03-16 09:42:56 +06:30
parent 6ccf315242
commit 8cea60ec02
17 changed files with 96 additions and 46 deletions

View File

@@ -104,6 +104,8 @@ class Origami::PaymentsController < BaseOrigamiController
end
end
#end rounding adjustment
puts "sale"
puts saleObj.to_json
sale_payment = SalePayment.new
sale_payment.process_payment(saleObj, current_user.name, cash, "cash")
@@ -152,10 +154,22 @@ class Origami::PaymentsController < BaseOrigamiController
if customer.membership_id != nil && rebate && credit_data.nil?
member_info = Customer.get_member_account(customer)
if member_info["status"] == true
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
current_balance = SaleAudit.paymal_search(sale_id)
end
#orders print out
if params[:type] == "quick_service"
booking = Booking.find_by_sale_id(sale_id)
if booking.dining_facility_id.to_i>0
table_id = booking.dining_facility_id
else
table_id = 0
end
booking.booking_orders.each do |order|
Order.pay_process_order_queue(order.order_id,table_id)
end
end
#for card sale data
@@ -181,19 +195,6 @@ class Origami::PaymentsController < BaseOrigamiController
filename, sale_receipt_no, printer_name = 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, "Paid",current_balance,card_data)
render json: JSON.generate({:status => saleObj.rebate_status, :message => "Can't Rebate coz of Sever Error ", :filename => filename, :receipt_no => sale_receipt_no, :printer_name => printer_name})
if params[:type] == "quick_service"
booking = Booking.find_by_sale_id(sale_id)
if booking.dining_facility_id.to_i>0
table_id = booking.dining_facility_id
else
table_id = 0
end
booking.booking_orders.each do |order|
Order.pay_process_order_queue(order.order_id,table_id)
end
end
end
end
end

View File

@@ -3,6 +3,7 @@ class Origami::ShiftsController < BaseOrigamiController
end
def show
@type = params[:type]
@shift = ShiftSale.current_open_shift(current_user.id)
#for bank integration
bank_integration = Lookup.collection_of('bank_integration')

View File

@@ -37,7 +37,7 @@ class OrderItemPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if order_item.dining.to_i > 0
if !order_item.dining.nil?
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20

2
app/pdf/order_item_slim_pdf.rb Normal file → Executable file
View File

@@ -37,7 +37,7 @@ class OrderItemSlimPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if order_item_slim.dining.to_i > 0
if !order_item_slim.dining.nil?
text "#{ order_item_slim.type + '-' + order_item_slim.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20

2
app/pdf/order_set_item_pdf.rb Normal file → Executable file
View File

@@ -37,7 +37,7 @@ class OrderSetItemPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if order_set_item.dining.to_i > 0
if !order_set_item.dining.nil?
text "#{ order_set_item.type + '-' + order_set_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20

View File

@@ -36,7 +36,8 @@ class OrderSummaryPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].dining.to_i > 0
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20

2
app/pdf/order_summary_set_pdf.rb Normal file → Executable file
View File

@@ -36,7 +36,7 @@ class OrderSummarySetPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].dining.to_i > 0
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20

2
app/pdf/order_summary_slim_pdf.rb Normal file → Executable file
View File

@@ -36,7 +36,7 @@ class OrderSummarySlimPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].dining.to_i > 0
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20

View File

@@ -241,7 +241,7 @@ $('#cash_out').on('click',function(){
$('#close_cashier').on('click',function(e){
e.preventDefault(); // Prevent the href from redirecting directly
var linkURL = '/origami/shift/close';
var linkURL = '/origami/shift/cashier/close';
warnBeforeRedirect(linkURL);
})

22
app/views/origami/pending_order/index.html.erb Normal file → Executable file
View File

@@ -34,7 +34,9 @@
<i class="material-icons">reply</i>
<%= t("views.btn.back") %>
</button>
<% if current_user.role != "waiter" %>
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<% end %>
</div>
</div>
</div>
@@ -51,4 +53,22 @@
$('#back').on('click', function () {
window.location.href = '/origami/quick_service';
})
$('#close_cashier').on('click',function(e){
e.preventDefault(); // Prevent the href from redirecting directly
var linkURL = '/origami/shift/quick_service/close';
warnBeforeRedirect(linkURL);
});
function warnBeforeRedirect(linkURL) {
swal({
title: "Alert!",
text: "Are you sure you want to close cashier?",
type: "warning",
showCancelButton: true
}, function() {
// Redirect the user
window.location.href = linkURL;
});
}
</script>

28
app/views/origami/pending_order/show.html.erb Normal file → Executable file
View File

@@ -1,7 +1,7 @@
<div class="container-fluid">
<div class="row">
<!-- Column One -->
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="col-lg-5 col-md-5 col-sm-5">
<div class="card">
<div class="card-header">
<strong id="order-title"> PENDING ORDER </strong>
@@ -148,7 +148,7 @@
</div>
</div>
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<div class="col-lg-2 col-md-2 col-sm-2">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
<% if current_user.role != "waiter" || @status != "sale"%>
<button type="button" id="addorder" class="btn bg-blue btn-block">Add Order</button>
@@ -167,6 +167,9 @@
<% if @status != "sale"%>
<button type="button" id="request_bills" class="btn btn-block bg-blue waves-effect">Req.Bill</button>
<%end%>
<% if current_user.role != "waiter" %>
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<% end %>
</div>
</div>
</div>
@@ -203,12 +206,11 @@ $(document).ready(function(){
url: ajax_url,
// data: 'order_id='+ order_id,
success: function (result) {
console.log(result)
if (!result.status) {
swal("Information!", result.error_message);
}
else {
window.location.href = '../pending_order/'+ result.data;
location.reload();
}
}
});
@@ -269,5 +271,23 @@ $(document).ready(function(){
}
return false;
});
$('#close_cashier').on('click',function(e){
e.preventDefault(); // Prevent the href from redirecting directly
var linkURL = '/origami/shift/quick_service/close';
warnBeforeRedirect(linkURL);
});
function warnBeforeRedirect(linkURL) {
swal({
title: "Alert!",
text: "Are you sure you want to close cashier?",
type: "warning",
showCancelButton: true
}, function() {
// Redirect the user
window.location.href = linkURL;
});
}
});
</script>

View File

@@ -58,6 +58,7 @@
</div>
</div>
<script>
var type = '<%= @type %>';
$('#close_cashier').on('click',function(){
var amount = $('#closing_balance_amount').val();
var shift_id = "<%= @shift.id rescue ""%>"
@@ -72,7 +73,11 @@
});
$('#back').on('click',function(){
if(type!='quick_service'){
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
}
});
/** start CB Card Settle process **/
@@ -90,7 +95,7 @@
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/shift/close';
window.location.href = '/origami/shift/'+type+'/close';
});
}
});
@@ -115,7 +120,7 @@
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/shift/close';
window.location.href = '/origami/shift/'+type+'/close';
});
}
}

2
app/views/reports/product_sale/index.html.erb Normal file → Executable file
View File

@@ -1,7 +1,7 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.sale_item_report") %></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.product_sale_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>

View File

@@ -449,6 +449,7 @@ en:
gateway_url: "Gateway url"
additional_parameter: "Additional parameter"
lookup: "Lookup"
product_sale_report: "Product Sale"
code_txt: "code "
charge_txt: "charge"

View File

@@ -444,6 +444,7 @@ mm:
additional_parameter: "ထပ်ဖြည့်အကြောင်းအရာ"
survey: "ခြုံငုံလေ့လာခြင်း"
lookup: "သတ်မှတ်ချက်များ"
product_sale_report: "Product Sale"
code_txt: "ကုတ်ဒ် "
charge_txt: "ကောက်ခံသည်"

View File

@@ -152,7 +152,7 @@ scope "(:locale)", locale: /en|mm/ do
#---------Shift ---------------#
resources :shifts, only: [:index, :new, :create, :edit]
post 'close_shift' => 'shifts#update_shift'
get 'shift/close' => 'shifts#show'
get 'shift/:type/close' => 'shifts#show'
get 'shift/sale_summary' => 'shifts#sale_summary'
#shift - index (open/close shift landing page)
#shift - show (sales summary display)