Merge branch 'adminbsb_material_ui' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -139,6 +139,13 @@ select.form-control {
|
||||
background-color:#795548;
|
||||
}
|
||||
|
||||
.others-color{
|
||||
background-color:#E1BEE7;
|
||||
height: 30px !important;
|
||||
line-height: 30px !important;
|
||||
}
|
||||
|
||||
|
||||
.cashier_number:hover{
|
||||
background:#A9F5F2;
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@ class Transactions::BookingsController < ApplicationController
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
@bookings = Booking.all.order("sale_id desc")
|
||||
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2)
|
||||
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(20)
|
||||
else
|
||||
sale = Sale.search(filter,from,to)
|
||||
if sale.count > 0
|
||||
@bookings = sale
|
||||
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2)
|
||||
booking = Booking.search(filter,from,to)
|
||||
if booking.count > 0
|
||||
@bookings = booking
|
||||
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(20)
|
||||
else
|
||||
@bookings = 0
|
||||
end
|
||||
|
||||
@@ -45,14 +45,14 @@ class Booking < ApplicationRecord
|
||||
if filter.blank?
|
||||
keyword = ''
|
||||
else
|
||||
keyword = "booking_id LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%"
|
||||
keyword = "booking_id LIKE ? OR checkin_by LIKE ? OR booking_status LIKE? OR checkout_by LIKE? OR sale_id ='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%","%#{filter}%"
|
||||
end
|
||||
|
||||
if from.present? && to.present?
|
||||
sale = Sale.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and NOT sale_status = 'void' ", from,to)
|
||||
query = sale.where(keyword)
|
||||
booking = Booking.where("DATE_FORMAT(created_at,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(created_at,'%d-%m-%Y') <= ? and NOT booking_status = 'void' ", from,to)
|
||||
query = booking.where(keyword)
|
||||
else
|
||||
where("receipt_no LIKE ? OR cashier_name LIKE ? OR sale_status ='#{filter}'","%#{filter}%","%#{filter}%",)
|
||||
where("booking_id LIKE ? OR checkin_by LIKE ? OR booking_status LIKE? OR checkout_by LIKE? OR sale_id ='#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%","%#{filter}%")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -264,8 +264,6 @@ class SalePayment < ApplicationRecord
|
||||
end
|
||||
|
||||
def sale_update_payment_status(paid_amount)
|
||||
puts paid_amount
|
||||
puts "parid Masssssssssssssssssssssssssssssssssssssssss"
|
||||
#update amount_outstanding
|
||||
self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f
|
||||
self.sale.save!
|
||||
@@ -316,8 +314,6 @@ class SalePayment < ApplicationRecord
|
||||
self.sale.rebate_status = nil
|
||||
end
|
||||
end
|
||||
puts "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr"
|
||||
puts response.to_json
|
||||
end
|
||||
|
||||
self.sale.save!
|
||||
@@ -375,7 +371,8 @@ class SalePayment < ApplicationRecord
|
||||
paypar.each do |pp|
|
||||
if pp.payment_method == "paypar"
|
||||
payparcost = payparcost + pp.payment_amount
|
||||
elsif pp.payment_method == "creditnote"
|
||||
end
|
||||
if pp.payment_method == "creditnote"
|
||||
credit = 1
|
||||
end
|
||||
end
|
||||
@@ -410,7 +407,9 @@ class SalePayment < ApplicationRecord
|
||||
rescue SocketError
|
||||
response = { "status": false, "message": "Can't connect server"}
|
||||
end
|
||||
|
||||
puts response.to_json
|
||||
puts payparcost
|
||||
puts overall_dis
|
||||
redeem_amount = payparcost + overall_dis
|
||||
|
||||
total_percentage = 0
|
||||
@@ -431,15 +430,19 @@ class SalePayment < ApplicationRecord
|
||||
data = {:type => a[:type], :amount => a[:amount]}
|
||||
type_arr.each do |si|
|
||||
if si[:type] == a[:type]
|
||||
amount = (redeem_amount / total_percentage)*si[:percentage]
|
||||
actual = a[:amount] - amount
|
||||
data[:amount] = actual
|
||||
if credit == 1
|
||||
data[:amount] = 0
|
||||
else
|
||||
amount = (redeem_amount / total_percentage)*si[:percentage]
|
||||
actual = a[:amount] - amount
|
||||
data[:amount] = actual
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
rebate_arr.push(data)
|
||||
end
|
||||
|
||||
|
||||
total_amount = rebate_prices - payparcost - overall_dis
|
||||
|
||||
if credit == 1
|
||||
@@ -485,6 +488,7 @@ class SalePayment < ApplicationRecord
|
||||
response = { "status": "no_member", "message": "Not membership"}
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<div class="card-title m-l-5 m-r-5">
|
||||
<!-- mpu -->
|
||||
<% if @other != 0.0 %>
|
||||
<div class="row payment other-payment-color">
|
||||
<div class="row payment others-color">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">MPU</div>
|
||||
<div class="col-md-4 mpu is_card" id="others"><%= @other %></div>
|
||||
@@ -162,7 +162,7 @@
|
||||
<% end %>
|
||||
<!-- paypar -->
|
||||
<% if @ppamount != 0.0 %>
|
||||
<div class="row payment other-payment-color">
|
||||
<div class="row payment others-color">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Redeem</div>
|
||||
<div class="col-md-4" id="ppamount"><%= @ppamount %></div>
|
||||
@@ -176,7 +176,7 @@
|
||||
<% end %>
|
||||
<!-- Visa -->
|
||||
<% if @visacount != 0.0 %>
|
||||
<div class="row payment other-payment-color">
|
||||
<div class="row payment others-color">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Visa</div>
|
||||
<div class="col-md-4 visa is_card" id="visacount"><%= @visacount %></div>
|
||||
@@ -190,7 +190,7 @@
|
||||
<% end %>
|
||||
<!-- JCB -->
|
||||
<% if @jcbcount != 0.0 %>
|
||||
<div class="row payment other-payment-color">
|
||||
<div class="row payment others-color">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JCB</div>
|
||||
<div class="col-md-4 jcb is_card" id="jcbcount"><%= @jcbcount %></div>
|
||||
@@ -204,7 +204,7 @@
|
||||
<% end %>
|
||||
<!-- Master -->
|
||||
<% if @mastercount != 0.0 %>
|
||||
<div class="row payment other-payment-color">
|
||||
<div class="row payment others-color">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Master</div>
|
||||
<div class="col-md-4 master is_card" id="mastercount"><%= @mastercount %></div>
|
||||
|
||||
@@ -174,9 +174,10 @@
|
||||
data: {redeem_amount:redeem_amount,membership_id:membership_id,sale_id:sale_id},
|
||||
success: function(result){
|
||||
if(result.status == true){
|
||||
console.log(result)
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: result.status,
|
||||
text: result.message,
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14">Select Period<%= t("views.right_panel.detail.select_period") %></label>
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<%= f.input :gateway_url %>
|
||||
<%= f.input :auth_token %>
|
||||
<%= f.input :merchant_account_id %>
|
||||
<%= f.input :additional_parameter, as: :text %>
|
||||
<%= f.input :created_by %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<%= form_tag transactions_orders_path, :method => :get do %>
|
||||
<%= form_tag transactions_bookings_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
|
||||
Reference in New Issue
Block a user