payment bill added and origami bug fixed
This commit is contained in:
@@ -17,10 +17,10 @@
|
|||||||
//= require cable
|
//= require cable
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
// auto refresh every 5 seconds
|
// auto refresh every 10 seconds
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
window.location.reload(1);
|
window.location.reload(1);
|
||||||
}, 5000);
|
}, 10000);
|
||||||
|
|
||||||
$('.queue_station').on('click',function(){
|
$('.queue_station').on('click',function(){
|
||||||
var orderZone=$(this).children().children().children('.order-zone').text();
|
var orderZone=$(this).children().children().children('.order-zone').text();
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ $(document).ready(function(){
|
|||||||
var balance = data["response_data"]["data"][i]["balance"];
|
var balance = data["response_data"]["data"][i]["balance"];
|
||||||
if (data["response_data"]["status"]==true) {
|
if (data["response_data"]["status"]==true) {
|
||||||
$('.rebate_amount').removeClass('hide');
|
$('.rebate_amount').removeClass('hide');
|
||||||
console.log(balance);
|
|
||||||
row =
|
row =
|
||||||
'<td class="charges-name">' + data["response_data"]["data"][i]["accountable_type"] +'</td>'
|
'<td class="charges-name">' + data["response_data"]["data"][i]["accountable_type"] +'</td>'
|
||||||
+'<td class="item-attr">' + balance + '</td>';
|
+'<td class="item-attr">' + balance + '</td>';
|
||||||
|
|||||||
@@ -51,33 +51,13 @@ class Crm::CustomersController < BaseCrmController
|
|||||||
|
|
||||||
#get customer amount
|
#get customer amount
|
||||||
@customer = Customer.find(params[:id])
|
@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)
|
if(response["status"] == true)
|
||||||
@membership = response["data"]
|
@membership = response["data"]
|
||||||
else
|
else
|
||||||
@membership = 0
|
@membership = 0
|
||||||
end
|
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 customer amount
|
||||||
|
|
||||||
|
|||||||
@@ -69,19 +69,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
|
|
||||||
@customer = Customer.find(params[:customer_id])
|
@customer = Customer.find(params[:customer_id])
|
||||||
|
|
||||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
response = Customer.get_member_account(@customer)
|
||||||
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js do
|
format.js do
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
sale_payment.process_payment(saleObj, @user, cash, "cash")
|
sale_payment.process_payment(saleObj, @user, cash, "cash")
|
||||||
|
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.where('customer_id=' + saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
# get member information
|
# get member information
|
||||||
response = get_member_information(customer, "get_all_member_account")
|
member_info = Customer.get_member_account(customer)
|
||||||
|
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
@@ -25,7 +25,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items)
|
food_total, beverage_total = SaleItem.calculate_food_beverage(saleObj.sale_items)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total)
|
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
@customer = Customer.find(@sale_data.customer_id)
|
@customer = Customer.find(@sale_data.customer_id)
|
||||||
|
|
||||||
# get member information
|
# get member information
|
||||||
response = get_member_information(@customer, "get_all_member_account")
|
response = Customer.get_member_account(@customer)
|
||||||
|
|
||||||
@balance = 0.00
|
@balance = 0.00
|
||||||
@accountable_type = ''
|
@accountable_type = ''
|
||||||
|
|||||||
@@ -92,6 +92,16 @@ class Transactions::SalesController < ApplicationController
|
|||||||
end
|
end
|
||||||
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
|
private
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
def set_transactions_sale
|
def set_transactions_sale
|
||||||
|
|||||||
@@ -12,21 +12,39 @@ class Customer < ApplicationRecord
|
|||||||
|
|
||||||
paginates_per 50
|
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
|
||||||
|
|
||||||
|
# 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")
|
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||||
memberaction = MembershipAction.find_by_membership_type("get_all_member_group")
|
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
|
||||||
app_token = membership.auth_token.to_s
|
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
|
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
|
||||||
response = HTTParty.get(url,
|
|
||||||
:body => { app_token: app_token}.to_json,
|
response = HTTParty.get(url, :body => { membership_id: customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||||
:headers => {
|
:headers => {
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Accept' => 'application/json'
|
'Accept' => 'application/json'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
puts response.body, response.code, response.message, response.headers.inspect
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ class Order < ApplicationRecord
|
|||||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_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")
|
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||||
.where("(orders.status = 'new' or orders.status = 'billed')")
|
.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")
|
.group("bookings.booking_id")
|
||||||
# For PG
|
# For PG
|
||||||
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true
|
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,true
|
||||||
@@ -261,7 +261,7 @@ class Order < ApplicationRecord
|
|||||||
.joins("left join dining_facilities on dining_facilities.id = bookings.dining_facility_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")
|
.joins("left join sales on sales.sale_id = bookings.sale_id")
|
||||||
.where("(orders.status = 'new' or orders.status = 'billed')")
|
.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")
|
.group("bookings.booking_id")
|
||||||
# For PG
|
# For PG
|
||||||
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true
|
# booking_orders.order_id IS NOT NULL and dining_facilities.type=? and dining_facilities.is_active=?",DiningFacility::ROOM_TYPE,true
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
|
|
||||||
#Bill Receipt Print
|
#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
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#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"
|
pdf.render_file "tmp/receipt_bill.pdf"
|
||||||
self.print("tmp/receipt_bill.pdf")
|
self.print("tmp/receipt_bill.pdf")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class ReceiptBillPdf < Prawn::Document
|
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
|
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_width = 250
|
||||||
self.page_height = 1450
|
self.page_height = 1450
|
||||||
self.margin = 10
|
self.margin = 10
|
||||||
@@ -32,6 +32,11 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
cashier_info(sale_data, customer_name)
|
cashier_info(sale_data, customer_name)
|
||||||
line_items(sale_items, food_total, beverage_total)
|
line_items(sale_items, food_total, beverage_total)
|
||||||
all_total(sale_data)
|
all_total(sale_data)
|
||||||
|
|
||||||
|
if member_info != nil
|
||||||
|
member_info(member_info)
|
||||||
|
end
|
||||||
|
|
||||||
footer
|
footer
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -183,7 +188,24 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
move_down 5
|
move_down 5
|
||||||
# stroke_horizontal_rule
|
# 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
|
end
|
||||||
|
|
||||||
def footer
|
def footer
|
||||||
|
|||||||
@@ -86,7 +86,6 @@
|
|||||||
<%
|
<%
|
||||||
@booking_orders.each do |bko|
|
@booking_orders.each do |bko|
|
||||||
# No Show completed
|
# No Show completed
|
||||||
puts bko.sale_status
|
|
||||||
if bko.sale_status == 'completed'
|
if bko.sale_status == 'completed'
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
@@ -209,7 +208,6 @@
|
|||||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||||
<%
|
<%
|
||||||
@orders.each do |odr|
|
@orders.each do |odr|
|
||||||
puts odr
|
|
||||||
# No Show completed
|
# No Show completed
|
||||||
if odr.sale_status == 'completed'
|
if odr.sale_status == 'completed'
|
||||||
next
|
next
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<td>Grand Total</td>
|
<td>Grand Total</td>
|
||||||
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td> <td></tr>
|
<tr><td colspan="5"> <td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 style="text-align:center"></td>
|
<td colspan=2 style="text-align:center"></td>
|
||||||
<td>Pay Amount</td>
|
<td>Pay Amount</td>
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan=2 style="text-align:center"></td>
|
<td colspan=2 style="text-align:center"></td>
|
||||||
<td>Payment <%= r.payment_method rescue ' '%></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>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@@ -166,16 +166,22 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<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">
|
<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
|
<i class="fa fa-arrow-left fa-lg"></i> Back
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- Temporary No Needs -->
|
<!-- 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">
|
||||||
|
|
||||||
|
<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_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
|
<i class="fa fa-trash fa-lg"></i> Void Sale
|
||||||
</a>
|
</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
|
<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
|
namespace :transactions do
|
||||||
resources :sales
|
resources :sales
|
||||||
resources :orders
|
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
|
end
|
||||||
|
|
||||||
#--------- Reports Controller Sections ------------#
|
#--------- Reports Controller Sections ------------#
|
||||||
|
|||||||
Reference in New Issue
Block a user