Sale Save
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
class Origami::HomeController < BaseOrigamiController
|
||||
def index
|
||||
@order_table = Order.get_order_table()
|
||||
@order_rooms = Order.get_order_rooms()
|
||||
@booking_orders = Order.get_booking_order_table()
|
||||
@booking_rooms = Order.get_booking_order_rooms()
|
||||
@orders = Order.get_orders()
|
||||
end
|
||||
def show
|
||||
str = []
|
||||
@order_details = OrderItem.get_order_items_details(params[:order_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
render :json => str.to_json
|
||||
if !params[:sale_id].nil?
|
||||
@order_details = SaleItem.get_order_items_details(params[:sale_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
render :json => str.to_json
|
||||
else
|
||||
@order_details = OrderItem.get_order_items_details(params[:order_id])
|
||||
@order_details.each do |ord_detail|
|
||||
str.push(ord_detail)
|
||||
end
|
||||
render :json => str.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
class Origami::RequestBillsController < BaseOrigamiController
|
||||
def show
|
||||
@sale = Sale.new
|
||||
check_order = Order.find_by_id(params[:id])
|
||||
if check_order
|
||||
@order_details = OrderItem.get_order_items_details(check_order.id)
|
||||
@order_details = OrderItem.get_order_items_details(check_order.id)
|
||||
@status, @sale_id = @sale.generate_invoice_from_order(check_order.id, nil,current_login_employee.name)
|
||||
@sale_data = Sale.find_by_id(@sale_id)
|
||||
@sale_items = SaleItem.where("sale_id=?",@sale_id)
|
||||
booking_id = params[:id]
|
||||
check_booking = Booking.find_by_id(booking_id)
|
||||
if check_booking.sale_id.nil?
|
||||
#check if it doesn't exist
|
||||
@status = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee.name)
|
||||
@sale_data = Sale.find_by_id(check_booking.sale_id)
|
||||
@sale_items = SaleItem.where("sale_id=?",check_booking.sale_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -193,7 +193,7 @@ class Order < ApplicationRecord
|
||||
# Count number of different items
|
||||
self.item_count = self.order_items.item_count
|
||||
self.quantity_count = quantity_count
|
||||
# Counter number of quantity
|
||||
# Counter number of quantityf
|
||||
end
|
||||
|
||||
#Process order items and send to order queue
|
||||
@@ -203,38 +203,48 @@ class Order < ApplicationRecord
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view order type Table
|
||||
def self.get_order_table
|
||||
order_table = Order.select("orders.id as order_id,sum(order_items.qty*order_items.price) as total_price,
|
||||
order_items.id as order_items_id,dining_facilities.name as table_name")
|
||||
.joins("left join booking_orders on booking_orders.order_id = orders.id
|
||||
left join bookings on bookings.id = booking_orders.id
|
||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
left join order_items on order_items.order_id = orders.id")
|
||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true)
|
||||
.group("orders.id")
|
||||
def self.get_booking_order_table
|
||||
booking_orders = Booking.select("sales.receipt_no,orders.status as order_status,bookings.id,sales.id as sale_id,dining_facilities.name as table_name")
|
||||
.joins("left join booking_orders on booking_orders.booking_id = bookings.id")
|
||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||
.joins("left join orders on orders.id = booking_orders.order_id")
|
||||
.joins("left join sale_orders on sale_orders.order_id = orders.id")
|
||||
.joins("left join sales on sales.id = sale_orders.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.id")
|
||||
end
|
||||
#Origami: Cashier : to view order type Room
|
||||
def self.get_order_rooms
|
||||
order_rooms = Order.select("orders.id as order_id,sum(order_items.qty*order_items.price) as total_price,
|
||||
order_items.id as order_items_id,dining_facilities.name as room_name")
|
||||
.joins("left join booking_orders on booking_orders.order_id = orders.id
|
||||
left join bookings on bookings.id = booking_orders.id
|
||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
left join order_items on order_items.order_id = orders.id")
|
||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,"dine_in",true)
|
||||
.group("orders.id")
|
||||
def self.get_booking_order_rooms
|
||||
booking_rooms = Booking.select("sales.receipt_no,orders.status as order_status,bookings.id,sales.id as sale_id,dining_facilities.name as room_name")
|
||||
.joins("left join booking_orders on booking_orders.booking_id = bookings.id")
|
||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||
.joins("left join orders on orders.id = booking_orders.order_id")
|
||||
.joins("left join sale_orders on sale_orders.order_id = orders.id")
|
||||
.joins("left join sales on sales.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.id")
|
||||
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.id as order_id,sum(order_items.qty*order_items.price) as total_price,
|
||||
order_items.id as order_items_id,dining_facilities.name as table_or_room_name")
|
||||
orders = Order.select("orders.id as order_id,sales.receipt_no,orders.status as order_status,bookings.id,sales.id as sale_id,dining_facilities.name as table_name")
|
||||
.joins("left join booking_orders on booking_orders.order_id = orders.id
|
||||
left join bookings on bookings.id = booking_orders.id
|
||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||
left join order_items on order_items.order_id = orders.id")
|
||||
left join order_items on order_items.order_id = orders.id
|
||||
left join sale_orders on sale_orders.order_id = orders.id
|
||||
left join sales on sales.id = sale_orders.sale_id")
|
||||
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||
.group("orders.id")
|
||||
|
||||
# Booking.select("sales.receipt_no,orders.status as order_status,bookings.id,sales.id as sale_id,dining_facilities.name as table_name")
|
||||
# .joins("left join booking_orders on booking_orders.booking_id = bookings.id")
|
||||
# .joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_id")
|
||||
# .joins("left join orders on orders.id = booking_orders.order_id")
|
||||
# .joins("left join sale_orders on sale_orders.order_id = orders.id")
|
||||
# .joins("left join sales on sales.id = sale_orders.sale_id")
|
||||
# .where("booking_orders.order_id IS NOT NULL and dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||
# .group("orders.id")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,9 +34,17 @@ class OrderItem < ApplicationRecord
|
||||
|
||||
end
|
||||
#Origami : Cashier : to show order items details
|
||||
def self.get_order_items_details(order_id)
|
||||
order_details = OrderItem.select("order_items.item_name,order_items.qty,order_items.price,(order_items.qty*order_items.price) as total_price")
|
||||
.joins("left join orders on orders.id = order_items.order_id")
|
||||
.where("order_items.order_id=?",order_id)
|
||||
def self.get_order_items_details(booking_id)
|
||||
booking_orders = BookingOrder.where("booking_id=?",booking_id)
|
||||
if booking_orders
|
||||
booking_orders.each do |book_order|
|
||||
order_details = OrderItem.select("order_items.item_name,order_items.qty,order_items.price,(order_items.qty*order_items.price) as total_price")
|
||||
.joins("left join orders on orders.id = order_items.order_id")
|
||||
.where("order_items.order_id=?",book_order.order_id)
|
||||
return order_details
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,9 +20,9 @@ class Sale < ApplicationRecord
|
||||
#get all order attached to this booking and combine into 1 invoice
|
||||
booking.booking_orders.each do |order|
|
||||
if booking.sale_id
|
||||
status, sale_id = generate_invoice_from_order(order.order_id, nil, requested_by)
|
||||
status, sale_id = generate_invoice_from_order(order.order_id, nil, booking, requested_by)
|
||||
else
|
||||
status, sale_id = generate_invoice_from_order(order.order_id, booking.sale_id, requested_by)
|
||||
status, sale_id = generate_invoice_from_order(order.order_id, booking.sale_id, booking, requested_by)
|
||||
end
|
||||
booking.sale_id = sale_id
|
||||
end
|
||||
@@ -31,7 +31,7 @@ class Sale < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def generate_invoice_from_order (order_id, sale_id, requested_by)
|
||||
def generate_invoice_from_order (order_id, sale_id, booking, requested_by)
|
||||
taxable = true
|
||||
#if sale_id is exsit and validate
|
||||
#add order to that invoice
|
||||
@@ -62,8 +62,8 @@ class Sale < ApplicationRecord
|
||||
add_item(item)
|
||||
end
|
||||
|
||||
link_order_sale(order.id)
|
||||
|
||||
link_order_sale(order.id)
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -73,6 +73,11 @@ class Sale < ApplicationRecord
|
||||
|
||||
#Update the order items that is billed
|
||||
order.update_items_status_to_billed(nil)
|
||||
order.status = "billed"
|
||||
order.save
|
||||
|
||||
booking.sale_id = self.id
|
||||
booking.save
|
||||
|
||||
return true, self.id
|
||||
end
|
||||
|
||||
@@ -4,4 +4,18 @@ class SaleItem < ApplicationRecord
|
||||
#compute items - discount, tax, price_change
|
||||
def compute_item
|
||||
end
|
||||
|
||||
def self.get_order_items_details(sale_id)
|
||||
sale_orders = SaleOrder.where("sale_id=?",sale_id)
|
||||
if sale_orders
|
||||
sale_orders.each do |sale_order|
|
||||
order_details = SaleItem.select("sales.total_discount as discount_amount,DATE_FORMAT(sales.receipt_date,'%Y-%m-%d %h:%m') as receipt_date,sales.cashier_name,sales.receipt_no,sale_items.product_name as item_name,sale_items.qty,sale_items.price,sale_items.unit_price as total_price")
|
||||
.joins("left join sales on sales.id = sale_items.sale_id")
|
||||
.where("sale_items.sale_id=?",sale_order.sale_id)
|
||||
return order_details
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,34 +22,56 @@
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<% if @order_table %>
|
||||
<% @order_table.each do |order_table| %>
|
||||
<div class="card" id="table-order-<%=order_table.order_id%>" onclick="callOrderDetails('<%=order_table.order_id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><span id="table-name-<%=order_table.order_id%>" class="table-name"><%=order_table.table_name%></span></h4>
|
||||
<p class="card-text"><%=order_table.total_price%></p>
|
||||
</div>
|
||||
</div>
|
||||
<% if @booking_orders %>
|
||||
<% @booking_orders.each do |booking_order| %>
|
||||
<% if !booking_order.order_status = 'new'%>
|
||||
<div style="background-color: red;color: white;" class="card" id="table-order-<%=booking_order.sale_id%>" onclick="callOrderDetails('sale_<%=booking_order.sale_id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span id="table-name-<%=booking_order.sale_id%>" class="table-name"><%=booking_order.table_name%></span></h4>
|
||||
<span>Receipt No : <%=booking_order.receipt_no%></span><br/>
|
||||
<span>Order Status : <%=booking_order.order_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card" id="table-order-<%=booking_order.id%>" onclick="callOrderDetails('order_<%=booking_order.id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><span id="table-name-<%=booking_order.id%>" class="table-name"><%=booking_order.table_name%></span></h4>
|
||||
<span>Order Status : <%=booking_order.order_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%end %>
|
||||
<%end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Panel 1 - Tables - End -->
|
||||
<!-- Panel 2 - Rooms -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<% @order_rooms.each do |order_room| %>
|
||||
<div class="card" id="table-order-<%=order_room.order_id%>" onclick="callOrderDetails('<%=order_room.order_id%>')">
|
||||
|
||||
<div class="card-block">
|
||||
<% tablename = order_room.room_name%>
|
||||
<h4 class="card-title"><span id="table-name-<%=order_room.order_id%>" class="table-name"><%=order_room.room_name%></span></h4>
|
||||
<p class="card-text"><%=order_room.total_price%></p>
|
||||
</div>
|
||||
</div>
|
||||
<% if @booking_rooms %>
|
||||
<% @booking_rooms.each do |booking_room| %>
|
||||
<% if !booking_room.order_status = 'new'%>
|
||||
<div style="background-color: red;color: white;" class="card" id="table-order-<%=booking_room.id%>" onclick="callOrderDetails('sale_<%=booking_room.id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span id="table-name-<%=booking_room.id%>" class="table-name"><%=booking_room.room_name%></span></h4>
|
||||
<span>Receipt No : <%=booking_room.receipt_no%></span><br/>
|
||||
<span>Order Status : <%=booking_room.order_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card" id="table-order-<%=booking_room.id%>" onclick="callOrderDetails('order_<%=booking_room.id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><span id="table-name-<%=booking_room.id%>" class="table-name"><%=booking_room.room_name%>ddd</span></h4> \
|
||||
<span>Order Status : <%=booking_room.order_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%end %>
|
||||
<%end %>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -60,15 +82,29 @@
|
||||
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card" id="table-order-<%=order.order_id%>" onclick="callOrderDetails('<%=order.order_id%>')">
|
||||
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><span id="table-name-<%=order.order_id%>" class="table-name"><%=order.table_or_room_name%></span></h4>
|
||||
<p class="card-text"><%=order.total_price%></p>
|
||||
</div>
|
||||
</div>
|
||||
<% if @orders %>
|
||||
<% @orders.each do |order| %>
|
||||
<% if !order.order_status = 'new'%>
|
||||
<div style="background-color: green;color: white;" class="card" id="table-order-<%=order.order_id%>" onclick="callOrderDetails('sale_<%=order.order_id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span id="table-name-<%=order.order_id%>" class="table-name">Order No:<%=order.order_id%></span></h4>
|
||||
<span>Receipt No : <%=order.receipt_no%></span><br/>
|
||||
<span>Order Status : <%=order.order_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card" id="table-order-<%=order.order_id%>" onclick="callOrderDetails('order_<%=order.order_id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><span id="table-name-<%=order.order_id%>" class="table-name">Order No:<%=order.order_id%></span></h4>
|
||||
<span>Order Status : <%=order.order_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%end %>
|
||||
<%end %>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -83,7 +119,9 @@
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div id="order-title"><strong>ORDER DETAILS</strong> <span id="order-detail-header"></span></div>
|
||||
<div id="order-title"><strong><span id="receipt-no">ORDER DETAILS</span></strong>
|
||||
<strong><span id ="receipt-date" style="margin-left: 20%"></span></strong></div><br/>
|
||||
<div ><strong><span id="cashier-name"></span></strong><strong><span style="margin-left: 36%" id="order-detail-header"></span></strong></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
@@ -120,7 +158,19 @@
|
||||
<tfooter>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Sub Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span id="sub-total"></span></strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span id="sub-total"></span></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong><span id="discount-header"></strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span id="discount_amount"></span></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong><span id="tax-header"></strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span id="tax_amount"></span></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong><span id="grand-total-header"></strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span id="grand_total_amount"></span></strong></td>
|
||||
</tr>
|
||||
</tfooter>
|
||||
</table>
|
||||
@@ -152,9 +202,22 @@
|
||||
var old_table_name = ""
|
||||
var table_or_order_id = 0
|
||||
|
||||
function callOrderDetails(order_id){
|
||||
table_or_order_id = order_id
|
||||
$("#test").html(order_id)
|
||||
function callOrderDetails(sale_order_id){
|
||||
var order_id = 0
|
||||
var data_val = ""
|
||||
sale_order = sale_order_id.split("_")[0]
|
||||
if (sale_order == 'sale') {
|
||||
order_id = sale_order_id.split("_")[1]
|
||||
url = "origami/"+sale_order_id.split("_")[1]
|
||||
data_val = { sale_id: sale_order_id.split("_")[1]}
|
||||
|
||||
}else{
|
||||
order_id = sale_order_id.split("_")[1]
|
||||
url = "origami/"+order_id
|
||||
data_val = { order_id: sale_order_id.split("_")[1]}
|
||||
|
||||
}
|
||||
table_or_order_id = order_id
|
||||
var tbody = ""
|
||||
$("#append-table").html("")
|
||||
if (old_order_id != order_id){
|
||||
@@ -163,30 +226,70 @@ function callOrderDetails(order_id){
|
||||
old_order_id = order_id
|
||||
}
|
||||
$("#order-detail-header").html("")
|
||||
$("#order-detail-header").append(document.getElementById("table-name-"+order_id).innerHTML)
|
||||
$("#sub-total").html("")
|
||||
url = "origami/"+order_id
|
||||
$("#order-detail-header").append("Table Name : "+document.getElementById("table-name-"+order_id).innerHTML)
|
||||
$("#sub-total").html("")
|
||||
$.ajax({type: "GET",
|
||||
url: url,
|
||||
data: { order_id: order_id},
|
||||
data: data_val,
|
||||
success:function(result){
|
||||
var sub_total = 0
|
||||
var discount_amount = 0
|
||||
var receipt_no = ""
|
||||
var cashier_name = ""
|
||||
var receipt_date = ""
|
||||
var tax_amount = 0
|
||||
var grand_total_amount = 0
|
||||
row = "<tbody>"
|
||||
for (i = 0; i < result.length; i++) {
|
||||
var data = JSON.stringify(result[i]);
|
||||
var parse_data = JSON.parse(data)
|
||||
sub_total += (parse_data.qty*parse_data.price)
|
||||
row = '<tbody><tr><td style="width:60%; text-align:left"><span id="item-name-price">'+parse_data.item_name+"@"+(parse_data.price*1)+'</span></td>'
|
||||
row = '<tr><td style="width:60%; text-align:left"><span id="item-name-price">'+parse_data.item_name+"@"+(parse_data.price*1)+'</span></td>'
|
||||
+'<td style="width:20%; text-align:right"><span id="item-qty">'+(parse_data.qty*1)+'</span></td>s'
|
||||
+'<td style="width:20%; text-align:right"><span id="item-total-price">'+(parse_data.qty*parse_data.price)+'</span></td>'
|
||||
+'</tr></tbody>'
|
||||
+'</tr>>'
|
||||
tbody += row
|
||||
discount_amount = result[i].discount_amount;
|
||||
|
||||
tax_amount = result[i].tax_amount;
|
||||
grand_total_amount = result[i].grand_total_amount;
|
||||
|
||||
receipt_no = result[i].receipt_no;
|
||||
cashier_name = result[i].cashier_name;
|
||||
receipt_date = result[i].receipt_date;
|
||||
|
||||
}
|
||||
|
||||
row = "</tbody>"
|
||||
$("#append-table").append(tbody)
|
||||
$("#sub-total").append((sub_total)+"<br/>")
|
||||
|
||||
|
||||
if (discount_amount > 0 ) {
|
||||
$("#discount-header").html("(Discount)")
|
||||
$("#discount_amount").html("("+discount_amount+")")
|
||||
}
|
||||
|
||||
if (tax_amount > 0 ) {
|
||||
$("#tax-header").html("Tax")
|
||||
$("#tax_amount").html(tax_amount)
|
||||
}
|
||||
|
||||
if (grand_total_amount > 0 ) {
|
||||
$("#grand-total-header").html("Grand Total")
|
||||
$("#grand_total_amount").html(grand_total_amount)
|
||||
}
|
||||
|
||||
if (cashier_name == null){
|
||||
cashier_name = ""
|
||||
}
|
||||
if(receipt_no != null){
|
||||
$("#receipt-no").html("Receipt No : "+receipt_no)
|
||||
}
|
||||
if (receipt_date != null) {
|
||||
$("#receipt-date").html("Receipt Date : "+receipt_date);
|
||||
}
|
||||
if (cashier_name != null) {
|
||||
$("#cashier-name").html("Cashier Name : "+cashier_name);
|
||||
}
|
||||
},
|
||||
error:function(result){
|
||||
// alert('error');
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div id="order-title">
|
||||
<span><strong>Receipt No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></span>
|
||||
<span><strong>Receipt No : <%=@sale_data.receipt_no rescue ' '%></strong></span>
|
||||
<span style="margin-left: 40%"><strong>Receipt Date : <%=@sale_data.receipt_date rescue '-'%></strong></span>
|
||||
<span><strong>Table No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,18 +52,21 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>(Discount)</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span>(<%=@sale_data.total_discount%>)</span></strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span>(<%=@sale_data.total_discount rescue 0%>)</span></strong></td>
|
||||
</tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Tax</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.total_tax%></span></strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.total_tax rescue 0%></span></strong></td>
|
||||
</tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Grand Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.grand_total%></span></strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@sale_data.grand_total rescue 0%></span></strong></td>
|
||||
</tr>
|
||||
</tfooter>
|
||||
</table>
|
||||
</div>
|
||||
<div style='text-align:center;margin-top:20px'>
|
||||
<INPUT TYPE="Button" class='btn btn-primary' VALUE="Reprint" onClick="" style='width:120px'/>
|
||||
<INPUT TYPE="Submit" class='btn btn-primary' VALUE="CANCEL" action="origami/index" style='width:120px'/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user