Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
5
Gemfile
5
Gemfile
@@ -57,8 +57,11 @@ gem 'bcrypt', '~> 3.1.7'
|
||||
|
||||
gem 'sidekiq'
|
||||
|
||||
# XML parser
|
||||
#gem 'nokogiri', '~> 1.6'
|
||||
|
||||
# Pagination
|
||||
gem 'kaminari', '~> 0.16.3'
|
||||
gem 'kaminari', '~> 1.0.1'
|
||||
|
||||
# Datatable
|
||||
gem 'filterrific'
|
||||
|
||||
17
Gemfile.lock
17
Gemfile.lock
@@ -89,9 +89,18 @@ GEM
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (6.0.1)
|
||||
railties (>= 3.2.16)
|
||||
kaminari (0.16.3)
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
kaminari (1.0.1)
|
||||
activesupport (>= 4.1.0)
|
||||
kaminari-actionview (= 1.0.1)
|
||||
kaminari-activerecord (= 1.0.1)
|
||||
kaminari-core (= 1.0.1)
|
||||
kaminari-actionview (1.0.1)
|
||||
actionview
|
||||
kaminari-core (= 1.0.1)
|
||||
kaminari-activerecord (1.0.1)
|
||||
activerecord
|
||||
kaminari-core (= 1.0.1)
|
||||
kaminari-core (1.0.1)
|
||||
listen (3.0.8)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
@@ -247,7 +256,7 @@ DEPENDENCIES
|
||||
jbuilder (~> 2.5)
|
||||
jquery-rails
|
||||
jquery-ui-rails
|
||||
kaminari (~> 0.16.3)
|
||||
kaminari (~> 1.0.1)
|
||||
listen (~> 3.0.5)
|
||||
mysql2 (>= 0.3.18, < 0.5)
|
||||
pg
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
//= require cable
|
||||
|
||||
$(document).ready(function(){
|
||||
// auto refresh every 10 seconds
|
||||
setTimeout(function(){
|
||||
window.location.reload(1);
|
||||
}, 10000);
|
||||
|
||||
$('.queue_station').on('click',function(){
|
||||
var orderZone=$(this).children().children().children('.order-zone').text();
|
||||
var orderItem=$(this).children().children().children('.order-item').text();
|
||||
@@ -39,7 +44,8 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
// complete for queue item
|
||||
$('.order-complete').on('click',function(){
|
||||
$('.order-complete').on('click',function(e){
|
||||
//e.preventDefault();
|
||||
var _self = $(this); // To know in ajax return
|
||||
var assigned_item_id=$(this).attr('id').substr(15);
|
||||
var params = { 'id':assigned_item_id };
|
||||
@@ -72,8 +78,10 @@ $(document).ready(function(){
|
||||
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
|
||||
|
||||
alert("updated!");
|
||||
// Page reload
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#print_order_item').on('click',function(){
|
||||
|
||||
@@ -19,8 +19,17 @@
|
||||
//= require bootstrap-datepicker
|
||||
|
||||
$(document).ready(function(){
|
||||
// auto refresh every 60 seconds
|
||||
setTimeout(function(){
|
||||
window.location.reload(1);
|
||||
}, 60000);
|
||||
|
||||
// For selected order return
|
||||
var order_status = "";
|
||||
order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim();
|
||||
|
||||
// Enable/Disable Button
|
||||
control_button("disabled");
|
||||
control_button(order_status);
|
||||
|
||||
$(".orders").on('click', function(){
|
||||
$("#order-sub-total").text('');
|
||||
@@ -38,10 +47,6 @@ $(document).ready(function(){
|
||||
// Enable/Disable Button
|
||||
control_button(order_status);
|
||||
|
||||
//for customer button
|
||||
$("#customer").removeAttr('disabled');
|
||||
|
||||
|
||||
var customer_id=$(this).find(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
@@ -66,12 +71,15 @@ $(document).ready(function(){
|
||||
for (i = 0; i < result.length; i++) {
|
||||
var data = JSON.stringify(result[i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
var show_date = "";
|
||||
|
||||
// Receipt Header
|
||||
receipt_no = result[i].receipt_no;
|
||||
cashier = result[i].cashier_name;
|
||||
receipt_date = new Date(result[i].receipt_date);
|
||||
show_date = receipt_date.getDate() + "-" + receipt_date.getMonth() + "-" + receipt_date.getFullYear() + ' ' + receipt_date.getHours()+ ':' + receipt_date.getMinutes()
|
||||
if(result[i].receipt_date != null){
|
||||
receipt_date = new Date(result[i].receipt_date);
|
||||
show_date = receipt_date.getDate() + "-" + receipt_date.getMonth() + "-" + receipt_date.getFullYear() + ' ' + receipt_date.getHours()+ ':' + receipt_date.getMinutes()
|
||||
}
|
||||
|
||||
$("#receipt_no").text(receipt_no);
|
||||
$("#cashier").text(cashier == null ? "" : cashier);
|
||||
@@ -212,8 +220,7 @@ $(document).ready(function(){
|
||||
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
|
||||
var balance = data["response_data"]["data"][i]["balance"];
|
||||
if (data["response_data"]["status"]==true) {
|
||||
$('.rebate_amount').removeClass('hide');
|
||||
console.log(balance);
|
||||
$('.rebate_amount').removeClass('hide');
|
||||
row =
|
||||
'<td class="charges-name">' + data["response_data"]["data"][i]["accountable_type"] +'</td>'
|
||||
+'<td class="item-attr">' + balance + '</td>';
|
||||
@@ -283,18 +290,21 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
/* Button Control by Status */
|
||||
function control_button(order_status){
|
||||
if(order_status=="billed"){
|
||||
function control_button(order_status){
|
||||
if(order_status=="billed"){
|
||||
$("#customer").prop('disabled', false);
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', false);
|
||||
$("#pay-bill").prop('disabled', false);
|
||||
}
|
||||
else if(order_status=="new") {
|
||||
$("#customer").prop('disabled', false);
|
||||
$("#request_bills").prop('disabled', false);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
}
|
||||
else {
|
||||
$("#customer").prop('disabled', true);
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
|
||||
@@ -16,5 +16,6 @@
|
||||
}
|
||||
|
||||
.selected-item {
|
||||
color: #fff !important;
|
||||
background-color: blue;
|
||||
}
|
||||
|
||||
@@ -51,34 +51,14 @@ class Crm::CustomersController < BaseCrmController
|
||||
|
||||
#get customer amount
|
||||
@customer = Customer.find(params[:id])
|
||||
response = Customer.get_member_account(@customer)
|
||||
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
|
||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
response = HTTParty.get(url, :body => { membership_id: @customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
if(response["status"] == true)
|
||||
@membership = response["data"]
|
||||
else
|
||||
@membership = 0
|
||||
end
|
||||
# @type = "-"
|
||||
# @balance = 0.00
|
||||
# response["data"].each do |res|
|
||||
# if res["accountable_type"] == "RebateAccount"
|
||||
# @balance = res["balance"]
|
||||
# @type = "RebateAccount"
|
||||
# end
|
||||
# end
|
||||
|
||||
|
||||
#end customer amount
|
||||
|
||||
end
|
||||
|
||||
@@ -6,10 +6,13 @@ class Oqs::PrintController < ApplicationController
|
||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||
|
||||
# printer for each stations
|
||||
printer_name = assigned_item.order_queue_station.printer_name
|
||||
|
||||
# print when complete click
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||
order_queue_printer.print_order_item(print_settings,assigned_item.order_id, assigned_item.item_code )
|
||||
order_queue_printer.print_order_item(printer_name,assigned_item.order_id, assigned_item.item_code )
|
||||
|
||||
# update print status for completed same order items
|
||||
assigned_items.each do |ai|
|
||||
@@ -25,10 +28,13 @@ class Oqs::PrintController < ApplicationController
|
||||
assigned_item=AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_items=AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||
|
||||
# printer for each stations
|
||||
printer_name = assigned_item.order_queue_station.printer_name
|
||||
|
||||
# print when complete click
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||
order_queue_printer.print_order_summary(print_settings,assigned_item.order_id)
|
||||
order_queue_printer.print_order_summary(printer_name,assigned_item.order_id)
|
||||
|
||||
# update print status for completed same order items
|
||||
assigned_items.each do |ai|
|
||||
|
||||
@@ -11,12 +11,11 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@selected_item = Order.find(params[:booking_id])
|
||||
@selected_item_type="Order"
|
||||
end
|
||||
end
|
||||
puts params[:booking_id]
|
||||
end
|
||||
|
||||
@completed_orders = Order.get_completed_order()
|
||||
@booking_orders = Order.get_booking_order_table()
|
||||
@booking_rooms = Order.get_booking_order_rooms()
|
||||
@booking_rooms = Order.get_booking_order_rooms()
|
||||
@orders = Order.get_orders()
|
||||
end
|
||||
|
||||
@@ -69,20 +68,8 @@ class Origami::HomeController < BaseOrigamiController
|
||||
def get_customer
|
||||
|
||||
@customer = Customer.find(params[:customer_id])
|
||||
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
|
||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
response = HTTParty.get(url, :body => { membership_id: @customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
|
||||
response = Customer.get_member_account(@customer)
|
||||
|
||||
respond_to do |format|
|
||||
format.js do
|
||||
|
||||
@@ -11,6 +11,21 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
saleObj = Sale.find(sale_id)
|
||||
sale_payment = SalePayment.new
|
||||
sale_payment.process_payment(saleObj, @user, cash, "cash")
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
# get member information
|
||||
member_info = Customer.get_member_account(customer)
|
||||
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
# Calculate Food and Beverage Total
|
||||
food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -26,21 +41,10 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
@sale_data = Sale.find_by_sale_id(sale_id)
|
||||
|
||||
#get customer amount
|
||||
@customer = Customer.find(@sale_data.customer_id)
|
||||
@customer = Customer.find(@sale_data.customer_id)
|
||||
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
|
||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
response = HTTParty.get(url, :body => { membership_id: @customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
# get member information
|
||||
response = Customer.get_member_account(@customer)
|
||||
|
||||
@balance = 0.00
|
||||
@accountable_type = ''
|
||||
@@ -73,5 +77,4 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class Origami::RequestBillsController < BaseOrigamiController
|
||||
|
||||
|
||||
# Print Request Bill and add to sale tables
|
||||
def print
|
||||
@sale = Sale.new
|
||||
sale_order=SaleOrder.new
|
||||
@@ -9,7 +8,7 @@ class Origami::RequestBillsController < BaseOrigamiController
|
||||
check_booking = Booking.find_by_booking_id(booking_id)
|
||||
if check_booking.sale_id.nil?
|
||||
# Create Sale if it doesn't exist
|
||||
@status, @sale_id = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee.name)
|
||||
@status, @sale_id = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee)
|
||||
@sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
@sale_items = SaleItem.where("sale_id=?",@sale_id)
|
||||
else
|
||||
@@ -20,10 +19,11 @@ class Origami::RequestBillsController < BaseOrigamiController
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.where('customer_id=' + @sale_data.customer_id)
|
||||
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
# find order id by sale id
|
||||
sale_order = SaleOrder.find_by_sale_id(@sale_data.sale_id)
|
||||
# sale_order = SaleOrder.find_by_sale_id(@sale_data.sale_id)
|
||||
|
||||
# Calculate Food and Beverage Total
|
||||
food_total, beverage_total = SaleItem.calculate_food_beverage(@sale_items)
|
||||
|
||||
@@ -13,7 +13,7 @@ class Transactions::OrdersController < ApplicationController
|
||||
|
||||
end
|
||||
end
|
||||
@orders = Kaminari.paginate_array(orders).page(params[:page]).per(50)
|
||||
@orders = Kaminari.paginate_array(orders).page(params[:page]).per(2)
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @orders }
|
||||
|
||||
@@ -92,6 +92,16 @@ class Transactions::SalesController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def void
|
||||
@sale = params[:sale_id]
|
||||
@reason = Lookup.where("lookup_type = 'void_reason'")
|
||||
end
|
||||
|
||||
def manual_void_sale
|
||||
sale_id = params[:sale_id]
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_transactions_sale
|
||||
|
||||
@@ -12,21 +12,39 @@ class Customer < ApplicationRecord
|
||||
|
||||
paginates_per 50
|
||||
|
||||
def self.get_member_group
|
||||
# def self.get_member_group
|
||||
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_group")
|
||||
app_token = membership.auth_token.to_s
|
||||
# membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
# memberaction = MembershipAction.find_by_membership_type("get_all_member_group")
|
||||
# app_token = membership.auth_token.to_s
|
||||
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
response = HTTParty.get(url,
|
||||
:body => { app_token: app_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
puts response.body, response.code, response.message, response.headers.inspect
|
||||
# url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
# response = HTTParty.get(url,
|
||||
# :body => { app_token: app_token}.to_json,
|
||||
# :headers => {
|
||||
# 'Content-Type' => 'application/json',
|
||||
# 'Accept' => 'application/json'
|
||||
# }
|
||||
# )
|
||||
# puts response.body, response.code, response.message, response.headers.inspect
|
||||
|
||||
# return response;
|
||||
|
||||
# end
|
||||
|
||||
def self.get_member_account(customer)
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
|
||||
response = HTTParty.get(url, :body => { membership_id: customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}
|
||||
)
|
||||
|
||||
return response;
|
||||
|
||||
|
||||
@@ -228,22 +228,27 @@ class Order < ApplicationRecord
|
||||
bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name")
|
||||
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||
.where("booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true)
|
||||
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id")
|
||||
.where("(orders.status = 'new' or orders.status = 'billed') and (dining_facilities.type=? and dining_facilities.is_active=?)",DiningFacility::TABLE_TYPE,true)
|
||||
.group("bookings.booking_id")
|
||||
# For PG
|
||||
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true
|
||||
# sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view booking order Table
|
||||
def self.get_completed_order
|
||||
completed_orders = Booking.select("sales.receipt_no,orders.status as order_status,orders.order_id,
|
||||
completed_orders = Booking.select("sales.receipt_no, sales.sale_status, orders.status as order_status,orders.order_id,
|
||||
bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id")
|
||||
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||
.where("sales.sale_status='completed'")
|
||||
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id")
|
||||
.group("sales.sale_id")
|
||||
# For PG
|
||||
#bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.status,orders.order_id
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view order type Room
|
||||
@@ -255,10 +260,12 @@ class Order < ApplicationRecord
|
||||
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join sale_orders on sale_orders.order_id = orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = sale_orders.sale_id")
|
||||
.where("booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true)
|
||||
.group("bookings.booking_id,sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id,orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||
.where("(orders.status = 'new' or orders.status = 'billed') and (dining_facilities.type=? and dining_facilities.is_active=?)",DiningFacility::ROOM_TYPE,true)
|
||||
.group("bookings.booking_id")
|
||||
# For PG
|
||||
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true
|
||||
# sales.receipt_no,orders.status,sales.sale_id,dining_facilities.name,orders.customer_id,orders.order_id
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view order type Room
|
||||
@@ -271,24 +278,36 @@ class Order < ApplicationRecord
|
||||
left join order_items on order_items.order_id = orders.order_id")
|
||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,"dine_in",true)
|
||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no")
|
||||
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view orders
|
||||
def self.get_orders
|
||||
from = Time.now.beginning_of_day.utc
|
||||
to = Time.now.end_of_day.utc
|
||||
orders = Order.select("orders.order_id as order_id,sales.receipt_no,orders.status as order_status, sales.sale_status as sale_status,
|
||||
orders.order_id as order_id,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id
|
||||
,bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name")
|
||||
.joins("left join booking_orders on booking_orders.order_id = orders.order_id
|
||||
left join bookings on bookings.booking_id = booking_orders.order_id
|
||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
left join order_items on order_items.order_id = orders.order_id
|
||||
left join sale_orders on sale_orders.order_id = orders.order_id
|
||||
left join sales on sales.sale_id = sale_orders.sale_id")
|
||||
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id,orders.customer_id")
|
||||
orders=Booking.select("sales.receipt_no, sales.sale_status as sale_status, orders.status as order_status,
|
||||
orders.order_id as order_id,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id,
|
||||
bookings.booking_id,orders.customer_id as customer_id,
|
||||
sales.sale_id as sale_id,dining_facilities.name as table_name")
|
||||
.joins("left join booking_orders on booking_orders.booking_id = bookings.booking_id")
|
||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||
.joins("left join orders on orders.order_id = booking_orders.order_id")
|
||||
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||
.where("(orders.status = 'new' or orders.status = 'billed')")
|
||||
|
||||
# orders = Order.select("orders.order_id as order_id,sales.receipt_no,orders.status as order_status, sales.sale_status as sale_status,
|
||||
# orders.order_id as order_id,sales.customer_id as sale_customer_id,orders.customer_id as order_customer_id
|
||||
# ,bookings.booking_id,sales.sale_id as sale_id,dining_facilities.name as table_name")
|
||||
# .joins("left join booking_orders on booking_orders.order_id = orders.order_id
|
||||
# left join bookings on bookings.booking_id = booking_orders.order_id
|
||||
# left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
# left join order_items on order_items.order_id = orders.order_id
|
||||
# left join sale_orders on sale_orders.order_id = orders.order_id
|
||||
# left join sales on sales.sale_id = sale_orders.sale_id")
|
||||
# .where("(orders.status = 'new' or orders.status = 'billed')")
|
||||
# .group("orders.order_id")
|
||||
# For PG
|
||||
# .where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||
# .group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id,orders.customer_id")
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
|
||||
def print_order_item(printer_settings,order_id, item_code)
|
||||
def print_order_item(printer_name,order_id, item_code)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
order_item= print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
||||
pdf = OrderItemPdf.new(order_item[0],printer_settings)
|
||||
pdf = OrderItemPdf.new(order_item[0])
|
||||
pdf.render_file "tmp/receipt.pdf"
|
||||
self.print("tmp/receipt.pdf")
|
||||
self.print("tmp/receipt.pdf", printer_name)
|
||||
end
|
||||
|
||||
def print_order_summary(printer_settings,order_id)
|
||||
def print_order_summary(printer_name,order_id)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
order=print_query('order_summary',order_id)
|
||||
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
||||
pdf = OrderSummaryPdf.new(order,printer_settings)
|
||||
pdf = OrderSummaryPdf.new(order)
|
||||
pdf.render_file filename
|
||||
|
||||
self.print(filename)
|
||||
self.print(filename, printer_name)
|
||||
end
|
||||
|
||||
# Query for OQS with status
|
||||
|
||||
@@ -65,11 +65,11 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
||||
end
|
||||
|
||||
#Bill Receipt Print
|
||||
def print_receipt_bill(printer_settings,sale_items,sale_data, customer_name, food_total, beverage_total)
|
||||
def print_receipt_bill(printer_settings,sale_items,sale_data, customer_name, food_total, beverage_total, member_info = nil)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, food_total, beverage_total)
|
||||
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, food_total, beverage_total, member_info)
|
||||
pdf.render_file "tmp/receipt_bill.pdf"
|
||||
self.print("tmp/receipt_bill.pdf")
|
||||
end
|
||||
|
||||
@@ -56,7 +56,12 @@ class Sale < ApplicationRecord
|
||||
#Default Tax - Values
|
||||
self.tax_type = "exclusive"
|
||||
|
||||
self.requested_by = requested_by
|
||||
# set cashier by current login
|
||||
self.cashier_id = requested_by.id
|
||||
self.cashier_name = requested_by.name
|
||||
|
||||
|
||||
self.requested_by = requested_by.name
|
||||
self.requested_at = DateTime.now.utc
|
||||
|
||||
Rails.logger.debug "Order -> #{order.id} | order_status -> #{order.status}"
|
||||
@@ -252,7 +257,7 @@ class Sale < ApplicationRecord
|
||||
if self.receipt_no.nil?
|
||||
prefix = DateTime.now().utc
|
||||
#self.receipt_no = prefix.to_s + "/" + self.shit_id.to_s + "/" + SeedGenerator.new_receipt_no().to_s
|
||||
self.receipt_no = prefix.strftime("%Y%m%d") + "/" + SeedGenerator.new_receipt_no().to_s
|
||||
self.receipt_no = prefix.strftime("%Y%m%d") + "-" + SeedGenerator.new_receipt_no().to_s
|
||||
|
||||
self.receipt_date = prefix
|
||||
Rails.logger.debug "Receipt No #{self.receipt_no} | Date #{ self.receipt_date.to_s}"
|
||||
|
||||
@@ -256,10 +256,11 @@ class SalePayment < ApplicationRecord
|
||||
receipt_no = sObj.receipt_no
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
memberaction = MembershipAction.find_by_membership_type("rebate")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
campaign_type_id = memberaction.additional_parameter["campaign_type_id"]
|
||||
auth_token = memberaction.auth_token.to_s
|
||||
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||
response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,total_amount: total_amount,campaign_type_id: campaign_type_id,
|
||||
response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,merchant_uid:merchant_uid,total_amount: total_amount,campaign_type_id: campaign_type_id,
|
||||
receipt_no: receipt_no,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
class OrderItemPdf < Prawn::Document
|
||||
attr_accessor :receipt_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:item_description_width
|
||||
def initialize(order_item, print_settings)
|
||||
self.page_width = 300
|
||||
self.page_height = 400
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||
def initialize(order_item)
|
||||
self.page_width = 254
|
||||
self.page_height = 1450
|
||||
self.margin = 10
|
||||
self.price_width = 50
|
||||
self.qty_width = 50
|
||||
self.item_width = self.page_width - (self.price_width + self.qty_width)
|
||||
self.price_width = 40 # No Need for item
|
||||
self.qty_width = 34
|
||||
self.total_width = 40 # No Need for item
|
||||
self.item_width = self.page_width - (self.qty_width + (self.margin*4))
|
||||
self.item_height = 15
|
||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width)
|
||||
self.receipt_width=130
|
||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
|
||||
self.label_width=80
|
||||
|
||||
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||
# super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
||||
@@ -17,10 +18,10 @@ class OrderItemPdf < Prawn::Document
|
||||
# font "public/fonts/#{font_name}".to_s + ".ttf".to_s
|
||||
# font "public/fonts/Zawgyi-One.ttf"
|
||||
# font "public/fonts/padauk.ttf"
|
||||
self.header_font_size = 12
|
||||
self.item_font_size = 10
|
||||
self.header_font_size = 14
|
||||
self.item_font_size = 12
|
||||
|
||||
text "#{order_item.dining}", :size => self.header_font_size,:align => :center
|
||||
text "#{order_item.dining}", :size => self.header_font_size,:align => :center, :left_margin => -20
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
|
||||
@@ -35,36 +36,43 @@ class OrderItemPdf < Prawn::Document
|
||||
def order_info(order_by, order_at)
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width => self.item_width - 50, :height => self.item_height) do
|
||||
text "OrderBy:#{order_by} ", :size => self.item_font_size,:align => :left
|
||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||
text "OrderBy: #{order_by} ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
bounding_box([self.item_width - 50,y_position], :width => self.item_width + 50, :height => self.item_height) do
|
||||
text "Date:#{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
|
||||
move_down 20
|
||||
move_down 10
|
||||
end
|
||||
|
||||
# Write Order items to PDF
|
||||
def order_items(order_item)
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||
text "Item", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
# No Need for Order Item
|
||||
# bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||
# text "Item", :size => self.item_font_size,:align => :left
|
||||
# end
|
||||
|
||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||
text "Qty", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
# bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||
# text "Qty", :size => self.item_font_size,:align => :right
|
||||
# end
|
||||
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
# stroke_horizontal_rule
|
||||
# move_down 5
|
||||
|
||||
#Add Order Item
|
||||
add_order_items(order_item)
|
||||
|
||||
dash(1, :space => 1, :phase => 1)
|
||||
stroke_horizontal_line 0, self.page_width
|
||||
move_down 5
|
||||
end
|
||||
|
||||
# Add order items under order info
|
||||
@@ -78,7 +86,7 @@ class OrderItemPdf < Prawn::Document
|
||||
end
|
||||
|
||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||
text "#{order_item.qty}", :size => self.item_font_size,:align => :right
|
||||
text "[#{order_item.qty.to_i}]", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
move_down 5
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
class OrderSummaryPdf < Prawn::Document
|
||||
attr_accessor :receipt_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:item_description_width
|
||||
def initialize(order, print_settings)
|
||||
self.page_width = 300
|
||||
self.page_height = 400
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||
def initialize(order)
|
||||
self.page_width = 254
|
||||
self.page_height = 1450
|
||||
self.margin = 10
|
||||
self.price_width = 60
|
||||
self.qty_width = 60
|
||||
self.item_width = self.page_width - (self.price_width + self.qty_width)
|
||||
self.price_width = 40 # No Need for item
|
||||
self.qty_width = 34
|
||||
self.total_width = 40 # No Need for item
|
||||
self.item_width = self.page_width - (self.qty_width + (self.margin*4))
|
||||
self.item_height = 15
|
||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width)
|
||||
self.receipt_width=130
|
||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
|
||||
self.label_width=100
|
||||
|
||||
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||
|
||||
@@ -19,7 +20,7 @@ class OrderSummaryPdf < Prawn::Document
|
||||
self.header_font_size = 12
|
||||
self.item_font_size = 10
|
||||
|
||||
text "#{order[0].dining}", :size => self.header_font_size,:align => :center
|
||||
text "#{order[0].dining}", :size => self.header_font_size,:align => :center, :left_margin => -20
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
|
||||
@@ -35,17 +36,19 @@ class OrderSummaryPdf < Prawn::Document
|
||||
def order_info(order_by, order_at)
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width => self.item_width - 20, :height => self.item_height) do
|
||||
text "OrderBy:#{order_by} ", :size => self.item_font_size,:align => :left
|
||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||
text "OrderBy: #{order_by} ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
bounding_box([self.item_width - 20,y_position], :width => self.item_width + 20, :height => self.item_height) do
|
||||
text "Date:#{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||
text "Date: #{order_at.strftime("%Y-%m-%d %I:%M %p")}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
|
||||
move_down 20
|
||||
move_down 10
|
||||
end
|
||||
|
||||
# Write Order items to PDF
|
||||
@@ -57,7 +60,7 @@ class OrderSummaryPdf < Prawn::Document
|
||||
end
|
||||
|
||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||
text "Qty", :size => self.item_font_size,:align => :right
|
||||
text "Qty", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
@@ -79,7 +82,7 @@ class OrderSummaryPdf < Prawn::Document
|
||||
end
|
||||
|
||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||
text "#{odi.qty}", :size => self.item_font_size,:align => :right
|
||||
text "#{odi.qty}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class ReceiptBillPdf < Prawn::Document
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, food_total, beverage_total)
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, food_total, beverage_total, member_info = nil)
|
||||
self.page_width = 250
|
||||
self.page_height = 1450
|
||||
self.margin = 10
|
||||
@@ -32,6 +32,11 @@ class ReceiptBillPdf < Prawn::Document
|
||||
cashier_info(sale_data, customer_name)
|
||||
line_items(sale_items, food_total, beverage_total)
|
||||
all_total(sale_data)
|
||||
|
||||
if member_info != nil
|
||||
member_info(member_info)
|
||||
end
|
||||
|
||||
footer
|
||||
end
|
||||
|
||||
@@ -181,7 +186,24 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
move_down 5
|
||||
# stroke_horizontal_rule
|
||||
end
|
||||
|
||||
# show member information
|
||||
def member_info(member_info)
|
||||
move_down 7
|
||||
if member_info["data"] == true
|
||||
member_info["data"].each do |res|
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
|
||||
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "#{ res["accountable_type"] } : #{ res["balance"] }", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
move_down 5
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def footer
|
||||
|
||||
@@ -31,28 +31,28 @@
|
||||
customer_id = ""
|
||||
|
||||
# For CSS- Class for Order? Sale?
|
||||
sale_status=""
|
||||
if cpo.order_status == 'new'
|
||||
unique_id=cpo.booking_id
|
||||
# sale_status=""
|
||||
# if cpo.order_status == 'new'
|
||||
# unique_id=cpo.booking_id
|
||||
|
||||
customer_id=cpo.order_customer_id
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if cpo.order_id == @selected_item.order_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
else
|
||||
unique_id=cpo.sale_id
|
||||
customer_id=cpo.sale_customer_id
|
||||
sale_status="paid"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
# customer_id=cpo.order_customer_id
|
||||
# # check selected item and assign
|
||||
# if @selected_item_type == "Sale"
|
||||
# if cpo.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
unique_id=cpo.sale_id
|
||||
customer_id=cpo.sale_customer_id
|
||||
sale_status="paid"
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if unique_id == @selected_item.sale_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# end
|
||||
%>
|
||||
<div class="card orders <%= sale_status %>">
|
||||
<div class="card-block">
|
||||
@@ -69,9 +69,7 @@
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status">
|
||||
<%= cpo.order_status %>
|
||||
</span>
|
||||
<span class="orders-order-status"><%= cpo.sale_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -84,10 +82,10 @@
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@booking_orders.each do |bko|
|
||||
# No Show completed
|
||||
# No Show completed
|
||||
if bko.sale_status == 'completed'
|
||||
next
|
||||
end
|
||||
@@ -101,11 +99,11 @@
|
||||
unique_id=bko.booking_id
|
||||
customer_id=bko.order_customer_id
|
||||
# check selected item and assign
|
||||
if !@selected_item.nil?
|
||||
if bko.order_id == @selected_item.order_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# if @selected_item != nil
|
||||
# if bko.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=bko.sale_id
|
||||
customer_id=bko.sale_customer_id
|
||||
@@ -132,9 +130,7 @@
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status">
|
||||
<%= bko.order_status %>
|
||||
</span>
|
||||
<span class="orders-order-status"><%= bko.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -165,11 +161,11 @@
|
||||
unique_id=rmo.booking_id
|
||||
customer_id=rmo.order_customer_id
|
||||
# check selected item and assign
|
||||
if @selected_item != nil
|
||||
if rmo.order_id == @selected_item.order_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# if @selected_item != nil
|
||||
# if rmo.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=rmo.sale_id
|
||||
customer_id=rmo.sale_customer_id
|
||||
@@ -196,9 +192,7 @@
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status">
|
||||
<%= rmo.order_status %>
|
||||
</span>
|
||||
<span class="orders-order-status"><%= rmo.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -213,7 +207,7 @@
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<%
|
||||
@orders.each do |odr|
|
||||
@orders.each do |odr|
|
||||
# No Show completed
|
||||
if odr.sale_status == 'completed'
|
||||
next
|
||||
@@ -227,11 +221,11 @@
|
||||
if odr.order_status == 'new'
|
||||
unique_id=odr.booking_id
|
||||
customer_id = odr.order_customer_id
|
||||
if @selected_item != nil
|
||||
if odr.order_id == @selected_item.order_id
|
||||
sale_status = sale_status + " selected-item"
|
||||
end
|
||||
end
|
||||
# if @selected_item != nil
|
||||
# if odr.order_id == @selected_item.order_id
|
||||
# sale_status = sale_status + " selected-item"
|
||||
# end
|
||||
# end
|
||||
else
|
||||
unique_id=odr.sale_id
|
||||
customer_id = odr.sale_customer_id
|
||||
@@ -258,9 +252,7 @@
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Order Status :
|
||||
<span class="orders-order-status">
|
||||
<%= odr.order_status %>
|
||||
</span>
|
||||
<span class="orders-order-status"><%= odr.order_status %></span>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -308,14 +300,14 @@
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody>
|
||||
<%
|
||||
# For Sale Items
|
||||
sub_total = 0
|
||||
if @selected_item_type == "Sale"
|
||||
@selected_item.sale_items.each do |sale_item|
|
||||
sub_total += (sale_item.qty*sale_item.unit_price)
|
||||
%>
|
||||
%>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
@@ -327,8 +319,7 @@
|
||||
%>
|
||||
|
||||
<%
|
||||
# For Order Items
|
||||
sub_total = 0
|
||||
# For Order Items
|
||||
if @selected_item_type == "Order"
|
||||
@selected_item.order_items.each do |order_item|
|
||||
sub_total += (order_item.qty*order_item.unit_price)
|
||||
@@ -386,13 +377,12 @@
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Add Order</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" id="customer" class="btn btn-primary btn-lg btn-block" disabled>Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-lg btn-block">Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block" disabled>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" id="pay-bill" class="btn btn-primary btn-lg btn-block" disabled>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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -101,79 +101,87 @@
|
||||
<div class="col-md-4" id="credit">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row" id="card_payment">
|
||||
<div class="col-md-4">Other Payment</div>
|
||||
<div class="col-md-8">
|
||||
<div class="container">
|
||||
<!-- mpu -->
|
||||
<% if @other != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-2">MPU</div>
|
||||
<div class="col-md-4" id="others"><%= @other %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-2">MPU</div>
|
||||
<div class="col-md-4" id="others">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- paypar -->
|
||||
<% if @ppamount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-2">Paypar</div>
|
||||
<div class="col-md-4" id="ppamount"><%= @ppamount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-2">Paypar</div>
|
||||
<div class="col-md-4" id="ppamount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- Visa -->
|
||||
<% if @visacount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-2">Visa</div>
|
||||
<div class="col-md-4" id="visacount"><%= @visacount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-2">Visa</div>
|
||||
<div class="col-md-4" id="visacount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- JCB -->
|
||||
<% if @jcbcount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-2">JCB</div>
|
||||
<div class="col-md-4" id="jcbcount"><%= @jcbcount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-2">JCB</div>
|
||||
<div class="col-md-4" id="jcbcount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- Master -->
|
||||
<% if @mastercount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-2">Master</div>
|
||||
<div class="col-md-4" id="mastercount"><%= @mastercount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-2">Master</div>
|
||||
<div class="col-md-4" id="mastercount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @other == 0.0 && @ppamount == 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-4" id="others"><%= @ppamount %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0%>
|
||||
<div class="row" id="card_payment">
|
||||
<div class="col-md-8">Other Payments</div>
|
||||
<div class="col-md-4" id="others"><%= @other %></div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" id="card_payment">
|
||||
<div class="col-md-12">Other Payments</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!-- mpu -->
|
||||
<% if @other != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">MPU</div>
|
||||
<div class="col-md-4" id="others"><%= @other %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">MPU</div>
|
||||
<div class="col-md-4" id="others">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- paypar -->
|
||||
<% if @ppamount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Paypar</div>
|
||||
<div class="col-md-4" id="ppamount"><%= @ppamount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Paypar</div>
|
||||
<div class="col-md-4" id="ppamount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- Visa -->
|
||||
<% if @visacount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Visa</div>
|
||||
<div class="col-md-4" id="visacount"><%= @visacount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Visa</div>
|
||||
<div class="col-md-4" id="visacount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- JCB -->
|
||||
<% if @jcbcount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JCB</div>
|
||||
<div class="col-md-4" id="jcbcount"><%= @jcbcount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JCB</div>
|
||||
<div class="col-md-4" id="jcbcount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- Master -->
|
||||
<% if @mastercount != 0.0 %>
|
||||
<div class="row">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Master</div>
|
||||
<div class="col-md-4" id="mastercount"><%= @mastercount %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row" style="display:none">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">Master</div>
|
||||
<div class="col-md-4" id="mastercount">0.0</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-8">Balance</div>
|
||||
|
||||
@@ -18,5 +18,6 @@
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
<%= link_to 'Back', print_settings_path, :class => "btn btn-default" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<h1>Editing Print Setting</h1>
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
|
||||
<%= link_to 'Show', @print_setting %> |
|
||||
<%= link_to 'Back', print_settings_path %>
|
||||
|
||||
@@ -1,49 +1,55 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= %>">Home</a></li>
|
||||
<li>Print Settings</li>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")),new_print_setting_path,:class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h1>Print Settings</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Unique code</th>
|
||||
<th>Template</th>
|
||||
<th>Db name</th>
|
||||
<th>Db type</th>
|
||||
<th>Db username</th>
|
||||
<th>Db password</th>
|
||||
<th>Printer name</th>
|
||||
<th>Api settings</th>
|
||||
<th>Page width</th>
|
||||
<th>Page height</th>
|
||||
<th>Print copies</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @print_settings.each do |print_setting| %>
|
||||
<br />
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><%= print_setting.name %></td>
|
||||
<td><%= print_setting.unique_code %></td>
|
||||
<td><%= print_setting.template %></td>
|
||||
<td><%= print_setting.db_name %></td>
|
||||
<td><%= print_setting.db_type %></td>
|
||||
<td><%= print_setting.db_username %></td>
|
||||
<td><%= print_setting.db_password %></td>
|
||||
<td><%= print_setting.printer_name %></td>
|
||||
<td><%= print_setting.api_settings %></td>
|
||||
<td><%= print_setting.page_width %></td>
|
||||
<td><%= print_setting.page_height %></td>
|
||||
<td><%= print_setting.print_copies %></td>
|
||||
<td><%= link_to 'Show', print_setting %></td>
|
||||
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
|
||||
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<th>Name</th>
|
||||
<th>Unique code</th>
|
||||
<th>Template</th>
|
||||
<!-- <th>Db name</th>
|
||||
<th>Db type</th>
|
||||
<th>Db username</th>
|
||||
<th>Db password</th> -->
|
||||
<th>Printer name</th>
|
||||
<th>Api settings</th>
|
||||
<th>Page width</th>
|
||||
<th>Page height</th>
|
||||
<th>Print copies</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Print Setting', new_print_setting_path %>
|
||||
<tbody>
|
||||
<% @print_settings.each do |print_setting| %>
|
||||
<tr>
|
||||
<td><%= print_setting.name %></td>
|
||||
<td><%= print_setting.unique_code %></td>
|
||||
<td><%= print_setting.template %></td>
|
||||
<!-- <td><%= print_setting.db_name %></td>
|
||||
<td><%= print_setting.db_type %></td>
|
||||
<td><%= print_setting.db_username %></td>
|
||||
<td><%= print_setting.db_password %></td> -->
|
||||
<td><%= print_setting.printer_name %></td>
|
||||
<td><%= print_setting.api_settings %></td>
|
||||
<td><%= print_setting.page_width %></td>
|
||||
<td><%= print_setting.page_height %></td>
|
||||
<td><%= print_setting.print_copies %></td>
|
||||
<td><%= link_to 'Show', print_setting %></td>
|
||||
<td><%= link_to 'Edit', edit_print_setting_path(print_setting) %></td>
|
||||
<td><%= link_to 'Destroy', print_setting, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
<h1>New Print Setting</h1>
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%= render 'form', print_setting: @print_setting %>
|
||||
|
||||
<%= link_to 'Back', print_settings_path %>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= print_settings_path %>">Print Setting</a></li>
|
||||
<li>Show</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= @print_setting.name %>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', employee: @employee %>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employees</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', employee: @employee %>
|
||||
</div>
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<td>Grand Total</td>
|
||||
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<tr><td> <td></tr>
|
||||
<tr><td colspan="5"> <td></tr>
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td>Pay Amount</td>
|
||||
@@ -108,7 +108,7 @@
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td>Payment <%= r.payment_method rescue ' '%></td>
|
||||
<td><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%>
|
||||
<td colspan="2"><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@@ -166,17 +166,24 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||
</a>
|
||||
|
||||
<!-- Temporary No Needs -->
|
||||
<!-- <a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
|
||||
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||
</a>
|
||||
|
||||
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
<!-- <a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
|
||||
<i class="fa fa-trash fa-lg"></i> Void Sale
|
||||
</a>
|
||||
<a href="<%= transactions_sales_path%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
<a href="<%= transactions_manual_void_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
<i class="fa fa-invoice fa-lg"></i> Complete Sale
|
||||
</a>
|
||||
</a> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="<%= crm_root_path %>">Home</a></li>
|
||||
<li class="active">
|
||||
<a href="<%= transactions_sales_path %>">Sale</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="<%= transactions_sales_path %>"><%= @sale.sale_id %></a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Receipt Date </th>
|
||||
<th>Receipt no</th>
|
||||
<th>Cashier</th>
|
||||
<th>Sales status</th>
|
||||
<th>Receipt generated at</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= @sale.receipt_date.strftime("%d-%M-%Y") %></td>
|
||||
<td><%= @sale.receipt_no %></td>
|
||||
<td><%= @sale.cashier rescue '-' %></td>
|
||||
<td> <%= @sale.sale_status %> </td>
|
||||
<td> <%= @sale.requested_at.strftime("%d-%m-%Y") %> </td>
|
||||
</tr>
|
||||
<tr style="border-top:2px solid #000">
|
||||
<th>Sale item name</th>
|
||||
<th> Qty</th>
|
||||
<th>Unit price</th>
|
||||
<th>Total pirce </th>
|
||||
<th>Created at</th>
|
||||
</tr>
|
||||
<% @sale.sale_items.each do |s| %>
|
||||
|
||||
<tr>
|
||||
<td><%=s.product_name rescue ' '%></td>
|
||||
<td><%=s.qty rescue ' '%></td>
|
||||
<td><%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
<td><%= number_with_precision(s.qty * s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
<td><%=l s.created_at.utc.getlocal , :format => :short rescue ' ' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr style="border-top:2px solid #000">
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td>Total</td>
|
||||
<td colspan="2"><%= number_with_precision(@sale.total_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td>Discount</td>
|
||||
<td colspan="2"><%= number_with_precision(@sale.total_discount, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td>Tax</td>
|
||||
<td colspan="2"><%= number_with_precision(@sale.total_tax, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td>Grand Total</td>
|
||||
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<tr><td> <td></tr>
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td>Pay Amount</td>
|
||||
<td colspan="2"><%= number_with_precision(@sale.amount_received, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 style="text-align:center"></td>
|
||||
<td>Change</td>
|
||||
<td colspan="2"><%= number_with_precision(@sale.amount_changed, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
59
app/views/transactions/sales/void.html.erb
Normal file
59
app/views/transactions/sales/void.html.erb
Normal file
@@ -0,0 +1,59 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="<%= crm_root_path %>">Home</a></li>
|
||||
<li class="active">
|
||||
<a href="<%= transactions_sales_path %>">Sale</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a href="<%= transactions_sale_path(@sale) %>"><%= %></a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||
<div class="tab-content" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
|
||||
<div class="tab-pane active" id="queue" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:">
|
||||
<h3>Choose your reason</h3>
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="checkbox checkbox-primary">
|
||||
<input id="checkbox" class="styled checkbox-primary" type="checkbox" checked="">
|
||||
<label for="checkbox">
|
||||
Primary
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
|
||||
<a href="<%= transactions_sale_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
|
||||
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -198,6 +198,8 @@ Rails.application.routes.draw do
|
||||
namespace :transactions do
|
||||
resources :sales
|
||||
resources :orders
|
||||
get "/sales/:sale_id/void" =>"sales#void", :as => "void"
|
||||
post "sales/manual_void_sale", to: "sales#manual_void_sale", :as => "manual_void_sale"
|
||||
end
|
||||
|
||||
#--------- Reports Controller Sections ------------#
|
||||
|
||||
Reference in New Issue
Block a user