update receipt bill payment
This commit is contained in:
@@ -28,7 +28,6 @@ $(document).on("focus", "[data-behaviour~='datepicker']", function(e){
|
|||||||
function export_to(path)
|
function export_to(path)
|
||||||
{
|
{
|
||||||
var form_params = $("#frm_report").serialize();
|
var form_params = $("#frm_report").serialize();
|
||||||
alert(form_params);
|
|
||||||
window.location = path+"?"+ form_params;
|
window.location = path+"?"+ form_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.find(saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
rebate_amount = Customer.get_membership_transactions(customer)
|
||||||
# get member information
|
# get member information
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
# get member information
|
# get member information
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
|
rebate_amount = Customer.get_membership_transactions(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)
|
||||||
|
|
||||||
@@ -98,7 +98,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,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info)
|
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, food_total, beverage_total, member_info,rebate_amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class Reports::DailySaleController < BaseReportController
|
class Reports::DailySaleController < BaseReportController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
from, to = get_date_range_from_params
|
from, to ,report_type = get_date_range_from_params
|
||||||
@sale_data = Sale.daily_sales_list(from,to)
|
@sale_data = Sale.daily_sales_list(from,to)
|
||||||
@tax = SaleTax.get_tax(from,to)
|
@tax = SaleTax.get_tax(from,to)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Reports::ReceiptNoController < BaseReportController
|
class Reports::ReceiptNoController < BaseReportController
|
||||||
load_and_authorize_resource
|
|
||||||
def index
|
def index
|
||||||
from, to = get_date_range_from_params
|
from, to = get_date_range_from_params
|
||||||
puts "from..."
|
puts "from..."
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Reports::SaleItemController < BaseReportController
|
class Reports::SaleItemController < BaseReportController
|
||||||
load_and_authorize_resource
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
from, to, report_type = get_date_range_from_params
|
from, to, report_type = get_date_range_from_params
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class Customer < ApplicationRecord
|
|||||||
def self.search(search)
|
def self.search(search)
|
||||||
if search
|
if search
|
||||||
# find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"])
|
# find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"])
|
||||||
where("name LIKE ? OR contact_no LIKE ?", "%#{search}%", "%#{search}%",)
|
where("name LIKE ? OR contact_no LIKE ? OR card_no LIKE ?", "%#{search}%", "%#{search}%",)
|
||||||
else
|
else
|
||||||
find(:all)
|
find(:all)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -260,17 +260,27 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
if rebate_amount["status"] == true
|
if rebate_amount["status"] == true
|
||||||
rebate_amount["data"].each do |res|
|
rebate_amount["data"].each do |res|
|
||||||
|
|
||||||
if res["receipt_no"]== sale_data.receipt_no
|
if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Rebate"
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||||
text "Rebate Balance", :size => self.item_font_size,:align => :left
|
text "Rebate Amount", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||||
text "#{ res["rebate"] }" , :size => self.item_font_size,:align => :right
|
text "#{ res["rebate"] }" , :size => self.item_font_size,:align => :right
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Redeem"
|
||||||
|
|
||||||
|
move_down 5
|
||||||
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||||
|
text "Redeem Amount", :size => self.item_font_size,:align => :left
|
||||||
|
end
|
||||||
|
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||||
|
text "#{ res["redeem"] }" , :size => self.item_font_size,:align => :right
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -301,7 +311,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
move_down 5
|
move_down 5
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||||
text "Customer", :size => self.item_font_size,:align => :left
|
text "Customer Name", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||||
text "#{ customer_name }" , :size => self.item_font_size,:align => :right
|
text "#{ customer_name }" , :size => self.item_font_size,:align => :right
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> Reports</a>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> Reports</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><%= link_to "Daily Sale Report", reports_daily_sale_index_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Daily Sale Report", reports_daily_sale_index_path, :tabindex =>"-1" %></li>
|
||||||
<li><%= link_to "Sales Item Report", origami_root_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Sales Item Report", reports_sale_item_index_path, :tabindex =>"-1" %></li>
|
||||||
<li><%= link_to "Receipt Report", reports_receipt_no_index_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Receipt Report", reports_receipt_no_index_path, :tabindex =>"-1" %></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user