For Pull
This commit is contained in:
@@ -143,7 +143,7 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Payment for Bill
|
// Payment for Bill
|
||||||
$('#pay').click(function() {
|
$('#pay-bill').click(function() {
|
||||||
var sale_id=$(".selected-item").find(".orders-id").text();
|
var sale_id=$(".selected-item").find(".orders-id").text();
|
||||||
if(sale_id!=""){
|
if(sale_id!=""){
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||||
@@ -160,10 +160,9 @@ $(document).ready(function(){
|
|||||||
window.location.href = '/crm/customers/'+ sale_id + "/assign_sale_id"
|
window.location.href = '/crm/customers/'+ sale_id + "/assign_sale_id"
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
/* For Receipt - Calculate discount or tax */
|
/* For Receipt - Calculate discount or tax */
|
||||||
$(document).on('click', '.cashier_number', function(event){
|
$('.cashier_number').on('click', function(event){
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
var original_value=0;
|
var original_value=0;
|
||||||
original_value = $('#discount-amount').val();
|
original_value = $('#discount-amount').val();
|
||||||
@@ -208,6 +207,8 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
/* Button Control by Status */
|
/* Button Control by Status */
|
||||||
function control_button(order_status){
|
function control_button(order_status){
|
||||||
if(order_status=="billed"){
|
if(order_status=="billed"){
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
// $(document).on('touchstart click', '.keypad', function(event){
|
|
||||||
// event.stopPropagation();
|
|
||||||
// event.preventDefault();
|
|
||||||
// if(event.handled !== true) {
|
|
||||||
//
|
|
||||||
// // Do your magic here.
|
|
||||||
// var input_value = $(this).attr("data-value");
|
|
||||||
// switch (input_value) {
|
|
||||||
//
|
|
||||||
// case 'delete':
|
|
||||||
// process_delete_payment();
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case 'foc':
|
|
||||||
// remove_input_action();
|
|
||||||
// $(".foc").attr("data-action","true");
|
|
||||||
// if(customerName.toString() != " "){ //if already chosen customer
|
|
||||||
// if($("#foc_reason_lists").attr("foc_reason") == ' '){
|
|
||||||
// alert("Please! Choose or Add FOC reason");
|
|
||||||
// foc_additional_form();
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// process_foc_payment();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// alert("Please! Choose or Save Customer");
|
|
||||||
// foc_additional_form();
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case 'nett':
|
|
||||||
// remove_input_action();
|
|
||||||
// $(".nett").attr("data-action","true");
|
|
||||||
// if($(".credit_note_payment").hasClass("payment_selected")){
|
|
||||||
// if(customerName == " "){
|
|
||||||
// alert("Please! Choose or Save Customer");
|
|
||||||
// showCustomer();
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// $("#accept_payment_btn").attr("data-payment","credit");
|
|
||||||
// process_nett_payment();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// process_nett_payment();
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case 'edit':
|
|
||||||
// process_edit_invoice();
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case 'cancel':
|
|
||||||
// remove_input_action();
|
|
||||||
// var status = $("#label_amountdue").attr("data-status");
|
|
||||||
// if (status != 'completed' && status != 'void'){
|
|
||||||
// $(".cancel").attr("data-action","true");
|
|
||||||
// var message = confirm("Are you sure to void? Please, add reason!");
|
|
||||||
// if (message == true) {
|
|
||||||
// $(".additional_form").hide();
|
|
||||||
// $("#void_sale_additional_form").show();
|
|
||||||
// process_cancel_payment();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// $(".cancel").addClass("dim");
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case 'ent':
|
|
||||||
// amount_due = parseFloat($("#label_amountdue").attr("data-original"));
|
|
||||||
// other_amt = parseFloat($("#label_cash_amount").attr("data-value"));
|
|
||||||
// credit_amount = parseFloat($("#label_credit_note").text());
|
|
||||||
// if ($(".credit_note_payment").hasClass("payment_selected") && credit_amount > 0){
|
|
||||||
// if(customerName.toString() != " "){
|
|
||||||
// if(credit_amount > (amount_due - other_amt)){
|
|
||||||
// alert("You shouldn't exceed the amount due.");
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// $("#accept_payment_btn").attr("data-payment","credit");
|
|
||||||
// update_balance_due();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// alert("Please! Choose or Save Customer");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// update_balance_due();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// break;
|
|
||||||
// case 'clear':
|
|
||||||
// process_clear_payment();
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// default:
|
|
||||||
//
|
|
||||||
// var existing_value = $(".payment_selected span").text();
|
|
||||||
//
|
|
||||||
// if (existing_value == "0" || existing_value == "0.00") { existing_value = ""; }
|
|
||||||
// existing_value = existing_value + input_value;
|
|
||||||
// $(".payment_selected span").text(existing_value);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// event.handled = true;
|
|
||||||
// } else {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Place all the behaviors and hooks related to the matching controller here.
|
|
||||||
# All this logic will automatically be available in application.js.
|
|
||||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Place all the behaviors and hooks related to the matching controller here.
|
|
||||||
# All this logic will automatically be available in application.js.
|
|
||||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
// Place all the styles related to the origami/paypar controller here.
|
|
||||||
// They will automatically be included in application.css.
|
|
||||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
// Place all the styles related to the origami/RequestBills controller here.
|
|
||||||
// They will automatically be included in application.css.
|
|
||||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
||||||
@@ -9,11 +9,11 @@ class Api::BillController < Api::ApiController
|
|||||||
#create Bill by Booking ID
|
#create Bill by Booking ID
|
||||||
if (params[:booking_id])
|
if (params[:booking_id])
|
||||||
@sale = Sale.new
|
@sale = Sale.new
|
||||||
@status = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee.name)
|
@status, @sale_id = @sale.generate_invoice_from_booking(params[:booking_id], current_login_employee.name)
|
||||||
|
|
||||||
elsif (params[:order_id])
|
elsif (params[:order_id])
|
||||||
@sale = Sale.new
|
@sale = Sale.new
|
||||||
@status = @sale.generate_invoice_from_order(params[:order_id], current_login_employee.name)
|
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee.name)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -63,8 +63,6 @@ class Crm::CustomersController < ApplicationController
|
|||||||
)
|
)
|
||||||
|
|
||||||
if response["status"] == true
|
if response["status"] == true
|
||||||
puts "hhhhhhhhhhhhhhhhhh"
|
|
||||||
puts params[:sale_id]
|
|
||||||
customer = Customer.find(@crm_customers.customer_id)
|
customer = Customer.find(@crm_customers.customer_id)
|
||||||
status = customer.update_attributes(membership_id: response["customer_datas"]["id"])
|
status = customer.update_attributes(membership_id: response["customer_datas"]["id"])
|
||||||
if params[:sale_id] != 0
|
if params[:sale_id] != 0
|
||||||
@@ -179,5 +177,3 @@ class Crm::CustomersController < ApplicationController
|
|||||||
params.require(:customer).permit(:name, :company, :contact_no, :email, :date_of_birth, :membership_type, :membership_authentication_code)
|
params.require(:customer).permit(:name, :company, :contact_no, :email, :date_of_birth, :membership_type, :membership_authentication_code)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
if(Sale.exists?(sale_id))
|
if(Sale.exists?(sale_id))
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
sale_payment = SalePayment.new
|
sale_payment = SalePayment.new
|
||||||
sale_payment.process_payment(saleObj, @user, cash)
|
sale_payment.process_payment(saleObj, @user, cash, "cash")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -18,6 +18,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
if Sale.exists?(sale_id)
|
if Sale.exists?(sale_id)
|
||||||
@sale_data = Sale.find_by_sale_id(sale_id)
|
@sale_data = Sale.find_by_sale_id(sale_id)
|
||||||
|
@sale_data.sale_payments.each do |spay|
|
||||||
|
if spay.payment_method == "cash"
|
||||||
|
@cash = spay.payment_amount
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,12 @@ class Settings::MembershipActionsController < ApplicationController
|
|||||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||||
if sale_data.customer_id
|
if sale_data.customer_id
|
||||||
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
|
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
|
||||||
|
puts customer_data.to_json
|
||||||
@membership_id = customer_data.membership_id
|
@membership_id = customer_data.membership_id
|
||||||
@campaign_type_id =1
|
@campaign_type_id =1
|
||||||
if !@membership_id.nil?
|
if !@membership_id.nil?
|
||||||
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
|
puts membership_setting
|
||||||
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id)
|
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id)
|
||||||
if membership_data["status"]==true
|
if membership_data["status"]==true
|
||||||
@membership_rebate_balance=membership_data["balance"]
|
@membership_rebate_balance=membership_data["balance"]
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ class Sale < ApplicationRecord
|
|||||||
|
|
||||||
#primary key - need to be unique generated for multiple shops
|
#primary key - need to be unique generated for multiple shops
|
||||||
before_create :generate_custom_id
|
before_create :generate_custom_id
|
||||||
|
|
||||||
#before_create :generate_receipt_no
|
#before_create :generate_receipt_no
|
||||||
belongs_to :cashier, :optional => true
|
belongs_to :cashier, :optional => true
|
||||||
belongs_to :customer, :optional => true
|
belongs_to :customer, :optional => true
|
||||||
@@ -17,7 +16,6 @@ class Sale < ApplicationRecord
|
|||||||
scope :open_invoices, -> { where("sale_status = 'new' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") }
|
scope :open_invoices, -> { where("sale_status = 'new' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") }
|
||||||
|
|
||||||
def generate_invoice_from_booking(booking_id, requested_by)
|
def generate_invoice_from_booking(booking_id, requested_by)
|
||||||
puts "get invoice from booking"
|
|
||||||
booking = Booking.find(booking_id)
|
booking = Booking.find(booking_id)
|
||||||
status = false
|
status = false
|
||||||
Rails.logger.debug "Booking -> " + booking.id.to_s
|
Rails.logger.debug "Booking -> " + booking.id.to_s
|
||||||
@@ -33,7 +31,6 @@ class Sale < ApplicationRecord
|
|||||||
booking.sale_id = sale_id
|
booking.sale_id = sale_id
|
||||||
end
|
end
|
||||||
order = booking.booking_orders.take.order
|
order = booking.booking_orders.take.order
|
||||||
puts "add sale order"
|
|
||||||
link_order_sale(order.id)
|
link_order_sale(order.id)
|
||||||
return status, sale_id
|
return status, sale_id
|
||||||
end
|
end
|
||||||
@@ -233,7 +230,8 @@ class Sale < ApplicationRecord
|
|||||||
saleOrder = SaleOrder.where("sale_id=? and order_id=?", self.id, order_id).take
|
saleOrder = SaleOrder.where("sale_id=? and order_id=?", self.id, order_id).take
|
||||||
|
|
||||||
if saleOrder.nil?
|
if saleOrder.nil?
|
||||||
SaleOrder.create(:sale_id => self.id, :order_id => order_id)
|
sale_order = SaleOrder.new
|
||||||
|
sale_order.create_sale_order(self.id, order_id)
|
||||||
end
|
end
|
||||||
# if (SaleOrder.where("sale_id = #{self.id} and order_id=#{order_id}").nil?)
|
# if (SaleOrder.where("sale_id = #{self.id} and order_id=#{order_id}").nil?)
|
||||||
# SaleOrder.create(:sale_id => self.id, :order_id => order_id)
|
# SaleOrder.create(:sale_id => self.id, :order_id => order_id)
|
||||||
@@ -261,6 +259,7 @@ class Sale < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def generate_custom_id
|
def generate_custom_id
|
||||||
self.sale_id = SeedGenerator.generate_id(self.class.name, "SAL")
|
self.sale_id = SeedGenerator.generate_id(self.class.name, "SAL")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,13 +2,22 @@ class SaleOrder < ApplicationRecord
|
|||||||
self.primary_key = "sale_order_id"
|
self.primary_key = "sale_order_id"
|
||||||
|
|
||||||
#primary key - need to be unique generated for multiple shops
|
#primary key - need to be unique generated for multiple shops
|
||||||
before_create :generate_custom_id
|
before_create :generate_sale_order_id
|
||||||
|
|
||||||
belongs_to :sale
|
belongs_to :sale
|
||||||
belongs_to :order
|
belongs_to :order
|
||||||
|
|
||||||
|
def create_sale_order(sale, order)
|
||||||
|
self.sale_id = sale
|
||||||
|
self.order_id = order
|
||||||
|
self.save
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def generate_custom_id
|
def generate_sale_order_id
|
||||||
self.sale_order_id = SeedGenerator.generate_id(self.class.name, "SOI")
|
self.class.name
|
||||||
|
saleOrderId = SeedGenerator.generate_id(self.class.name, "SOI")
|
||||||
|
self.sale_order_id = saleOrderId
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class SalePayment < ApplicationRecord
|
|||||||
payment_status = false
|
payment_status = false
|
||||||
self.payment_method = "cash"
|
self.payment_method = "cash"
|
||||||
self.payment_amount = self.received_amount
|
self.payment_amount = self.received_amount
|
||||||
self.outstanding_amount = self.sale.grand_total - self.received_amount
|
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
|
||||||
self.payment_status = "paid"
|
self.payment_status = "paid"
|
||||||
payment_method = self.save!
|
payment_method = self.save!
|
||||||
|
|
||||||
@@ -200,16 +200,28 @@ class SalePayment < ApplicationRecord
|
|||||||
sale_update_payment_status(0)
|
sale_update_payment_status(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return payment_status
|
return payment_status
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def sale_update_payment_status(paid_amount)
|
def sale_update_payment_status(paid_amount)
|
||||||
|
puts "sale update"
|
||||||
#update amount_outstanding
|
#update amount_outstanding
|
||||||
self.sale.amount_received = self.sale.amount_received + paid_amount
|
self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f
|
||||||
self.sale.amount_changed = paid_amount - self.sale.amount_received
|
|
||||||
if (self.sale.grand_total <= self.sale.amount_received && self.sale.amount_changed > 0)
|
self.sale.amount_changed = paid_amount.to_f - self.sale.amount_received.to_f
|
||||||
|
|
||||||
|
all_received_amount = 0.0
|
||||||
|
sObj = self.sale
|
||||||
|
sObj.sale_payments.each do |spay|
|
||||||
|
puts spay
|
||||||
|
puts spay.payment_amount
|
||||||
|
all_received_amount += spay.payment_amount.to_f
|
||||||
|
end
|
||||||
|
puts all_received_amount
|
||||||
|
puts self.sale.grand_total
|
||||||
|
if (self.sale.grand_total <= all_received_amount)
|
||||||
|
puts " sale update ......"
|
||||||
self.sale.payment_status = "paid"
|
self.sale.payment_status = "paid"
|
||||||
self.sale.sale_status = "completed"
|
self.sale.sale_status = "completed"
|
||||||
self.sale.save!
|
self.sale.save!
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
class SeedGenerator < ApplicationRecord
|
class SeedGenerator < ApplicationRecord
|
||||||
|
|
||||||
def self.generate_id(model, prefix)
|
def self.generate_id(model, prefix)
|
||||||
seed = SeedGenerator.find_by_model(model)
|
seed = SeedGenerator.find_by_model(model)
|
||||||
new_receipt_no = 0
|
new_receipt_no = 0
|
||||||
|
|
||||||
if (seed.nil?)
|
if (seed.nil?)
|
||||||
seed = SeedGenerator.new()
|
seed = SeedGenerator.new()
|
||||||
seed.model = model
|
seed.model = model
|
||||||
@@ -16,8 +18,8 @@ class SeedGenerator < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
padding_len = 15 - prefix.length
|
padding_len = 15 - prefix.length
|
||||||
|
saleOrderId = prefix +"-"+ seed.current.to_s.to_s.rjust((14-prefix.length)+1,'0')
|
||||||
return prefix +"-"+ seed.current.to_s.to_s.rjust((14-prefix.length)+1,'0')
|
return saleOrderId
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
<li><%= link_to "Membership Setting",settings_membership_settings_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Membership Setting",settings_membership_settings_path, :tabindex =>"-1" %></li>
|
||||||
<li><%= link_to "Payment Method", settings_payment_method_settings_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Payment Method", settings_payment_method_settings_path, :tabindex =>"-1" %></li>
|
||||||
<li><%= link_to "Tax Profile", settings_tax_profiles_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Tax Profile", settings_tax_profiles_path, :tabindex =>"-1" %></li>
|
||||||
|
<li><%= link_to "Print Setting", print_settings_path, :tabindex =>"-1" %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -30,9 +31,14 @@
|
|||||||
<li><%= link_to "Sales ", crm_root_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Sales ", crm_root_path, :tabindex =>"-1" %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<!-- <li class="navbar-nav mr-auto">
|
<li class="navbar-nav mr-auto dropdown">
|
||||||
Reports
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> Reports</a>
|
||||||
</li> -->
|
<ul class="dropdown-menu">
|
||||||
|
<li><%= link_to "Daily Sale Report", origami_root_path, :tabindex =>"-1" %></li>
|
||||||
|
<li><%= link_to "Sales Item Report", origami_root_path, :tabindex =>"-1" %></li>
|
||||||
|
<li><%= link_to "Receipt Report", origami_root_path, :tabindex =>"-1" %></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
<title>SmartSales : Restaurant</title>
|
<title>SmartSales : Restaurant</title>
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
|
|
||||||
<%= stylesheet_link_tag 'orgiami', media: 'all', 'data-turbolinks-track': 'reload' %>
|
<%= stylesheet_link_tag 'origami', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||||
<%= javascript_include_tag 'orgiami', 'data-turbolinks-track': 'reload' %>
|
<%= javascript_include_tag 'origami', 'data-turbolinks-track': 'reload' %>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -215,13 +215,13 @@
|
|||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Customer</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled id="customer">Customer</button>
|
||||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||||
<!-- Cashier Buttons -->
|
<!-- Cashier Buttons -->
|
||||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button>
|
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button> -->
|
||||||
|
|
||||||
<button type="button" id="pay" class="btn btn-primary btn-lg btn-block" >Pay</button>
|
<button type="button" id="pay-bill" class="btn btn-primary btn-lg btn-block" >Pay</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<div class="col-md-12 cashier_number long purple" id="redeem" data-member-value = "">PAY</div>
|
<div class="col-md-12 cashier_number long purple" id="redeem" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">PAY</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -133,7 +133,6 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#REDIMREBATE").click(function(){
|
$("#REDIMREBATE").click(function(){
|
||||||
$('.rebate-form').removeAttr("hidden");
|
$('.rebate-form').removeAttr("hidden");
|
||||||
gateway_url = $(this).attr("data-url");
|
gateway_url = $(this).attr("data-url");
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">CASH</div>
|
<div class="col-md-8">CASH</div>
|
||||||
<div class="col-md-4" id="cash" >0.0</div>
|
<div class="col-md-4" id="cash" ><%= @cash %></div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="row" id="credit_payment">
|
<div class="row" id="credit_payment">
|
||||||
@@ -165,8 +165,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).on('click', '.cashier_number', function(event){
|
$(document).on('click', '.cashier_number', function(event){
|
||||||
event.stopPropagation();
|
|
||||||
event.preventDefault();
|
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
var original_value;
|
var original_value;
|
||||||
original_value = $('#cash').text();
|
original_value = $('#cash').text();
|
||||||
@@ -184,14 +182,17 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
update_balance();
|
update_balance();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'add':
|
case 'add':
|
||||||
var input_value = $(this).attr("data-value");
|
var input_value = $(this).attr("data-value");
|
||||||
amount = parseInt(input_value) + parseInt(original_value);
|
amount = parseInt(input_value) + parseInt(original_value);
|
||||||
$('#cash').text(amount);
|
$('#cash').text(amount);
|
||||||
update_balance();
|
update_balance();
|
||||||
break;
|
break;
|
||||||
|
case 'del' :
|
||||||
|
var cash=$('#cash').text();
|
||||||
|
$('#cash').text(cash.substr(0,cash.length-1));
|
||||||
|
update_balance();
|
||||||
|
break;
|
||||||
case 'clr':
|
case 'clr':
|
||||||
$('#cash').text("0.0");
|
$('#cash').text("0.0");
|
||||||
update_balance();
|
update_balance();
|
||||||
@@ -233,7 +234,6 @@ $( document ).ready(function() {
|
|||||||
alert("THANK YOU")
|
alert("THANK YOU")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ Rails.application.config.assets.version = '1.0'
|
|||||||
# Rails.application.config.assets.precompile += %w( search.js )
|
# Rails.application.config.assets.precompile += %w( search.js )
|
||||||
|
|
||||||
# --- Waiter/ Cashier - Orgiami ----
|
# --- Waiter/ Cashier - Orgiami ----
|
||||||
Rails.application.config.assets.precompile += %w( orgiami.css )
|
Rails.application.config.assets.precompile += %w( origami.css )
|
||||||
Rails.application.config.assets.precompile += %w( orgiami.js )
|
Rails.application.config.assets.precompile += %w( origami.js )
|
||||||
# -- Order Queue Station -----
|
# -- Order Queue Station -----
|
||||||
Rails.application.config.assets.precompile += %w( OQS.css )
|
Rails.application.config.assets.precompile += %w( OQS.css )
|
||||||
Rails.application.config.assets.precompile += %w( OQS.js )
|
Rails.application.config.assets.precompile += %w( OQS.js )
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class CreateOrderItems < ActiveRecord::Migration[5.1]
|
|||||||
t.string :options
|
t.string :options
|
||||||
t.json :set_menu_items #this parameter is require to route the items correctly
|
t.json :set_menu_items #this parameter is require to route the items correctly
|
||||||
t.boolean :taxable, :null => false, :default => true
|
t.boolean :taxable, :null => false, :default => true
|
||||||
|
t.string :completed_by
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class CreatePaymentMethodSettings < ActiveRecord::Migration[5.1]
|
|||||||
t.string :gateway_url
|
t.string :gateway_url
|
||||||
t.string :auth_token
|
t.string :auth_token
|
||||||
t.string :merchant_account_id
|
t.string :merchant_account_id
|
||||||
|
t.string :additional_parameters
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
class CreateSaleOrders < ActiveRecord::Migration[5.1]
|
class CreateSaleOrders < ActiveRecord::Migration[5.1]
|
||||||
def change
|
def change
|
||||||
create_table :sale_orders, :id => false do |t|
|
create_table :sale_orders, :id => false do |t|
|
||||||
t.primary_key :sale_order_id #custom primary key - to ensure consistence for cloud syncing
|
|
||||||
|
|
||||||
|
t.string :sale_order_id, :limit => 16, :primary_key => true
|
||||||
t.string :sale_id, foreign_key: true,:limit => 16
|
t.string :sale_id, foreign_key: true,:limit => 16
|
||||||
t.string :order_id, foreign_key: true, :limit => 16
|
t.string :order_id, foreign_key: true, :limit => 16
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
class AddCompanyAddressEmail < ActiveRecord::Migration[5.1]
|
|
||||||
def change
|
|
||||||
add_column :order_items, :completed_by, :string
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
class Additionparametertopaymentsettings < ActiveRecord::Migration[5.1]
|
|
||||||
def change
|
|
||||||
add_column :payment_method_settings, :additional_parameters, :string
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -142,6 +142,7 @@ beverage = Account.create({title: "Beverage", account_type: "1"})
|
|||||||
|
|
||||||
order_station1=PrintSetting.create({name: "OrderItemPdf", unique_code: "OrderItemPdf", printer_name: "EPSON-TM-T82-S-A"})
|
order_station1=PrintSetting.create({name: "OrderItemPdf", unique_code: "OrderItemPdf", printer_name: "EPSON-TM-T82-S-A"})
|
||||||
order_station2=PrintSetting.create({name: "Order Summary", unique_code: "OrderSummaryPdf", printer_name: "EPSON-TM-T82-S-A"})
|
order_station2=PrintSetting.create({name: "Order Summary", unique_code: "OrderSummaryPdf", printer_name: "EPSON-TM-T82-S-A"})
|
||||||
|
request_bill_printer=PrintSetting.create({name: "Receipt Bill", unique_code: "ReceiptBillPdf", printer_name: "EPSON-TM-T82-S-A"})
|
||||||
|
|
||||||
# shop = Shop.create(
|
# shop = Shop.create(
|
||||||
# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
|
# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
|
||||||
|
|||||||
Reference in New Issue
Block a user