diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb
index f78f162a..0e7f3388 100644
--- a/app/controllers/origami/home_controller.rb
+++ b/app/controllers/origami/home_controller.rb
@@ -15,7 +15,7 @@ class Origami::HomeController < BaseOrigamiController
@rooms = Room.all.active.order('status desc')
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('date desc')
- @shop = Shop.find_by_id(1)
+
@status_order = ""
@status_sale = ""
@sale_array = Array.new
diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb
index 24d63b71..8c328030 100644
--- a/app/controllers/origami/payments_controller.rb
+++ b/app/controllers/origami/payments_controller.rb
@@ -166,7 +166,14 @@ class Origami::PaymentsController < BaseOrigamiController
def rounding_adj
saleObj = Sale.find(params[:sale_id])
- new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
+ @shop = Shop.find_by_id(1)
+
+ if @shop.is_rounding_adj
+ new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
+ else
+ new_total = saleObj.grand_total
+ end
+
rounding_adj = new_total-saleObj.grand_total
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj)
diff --git a/app/controllers/reports/credit_payment_controller.rb b/app/controllers/reports/credit_payment_controller.rb
new file mode 100644
index 00000000..dd9b3987
--- /dev/null
+++ b/app/controllers/reports/credit_payment_controller.rb
@@ -0,0 +1,61 @@
+class Reports::CreditPaymentController < BaseReportController
+authorize_resource :class => false
+ def index
+
+ from, to = get_date_range_from_params
+
+ @shift_sale_range = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED)
+
+ @shift = ''
+ if params[:shift_name].to_i != 0
+ shift_sale = ShiftSale.find(params[:shift_name])
+ if to.blank?
+ @shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',shift_sale.shift_started_at)
+ else
+
+ @shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at)
+ end
+ end
+
+ @sale_data = Sale.get_by_shift_sale_credit_payment(@shift_sale_range,@shift,from,to)
+
+ @from = from
+ @to = to
+
+ if @shift.present?
+ @shift.each do |sh|
+ @shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
+ @shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
+ @shift_data = sh
+ end
+ end
+
+ respond_to do |format|
+ format.html
+ format.xls
+ end
+ end
+
+ def show
+ from, to = get_date_range_from_params
+
+ @sale_data = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED)
+
+ date_arr = Array.new
+ @sale_data.each do |sale|
+ local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
+ local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
+ opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
+ closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
+ shift_id = sale.id.nil? ? '-' : sale.id
+ str = {:shift_id => shift_id, :local_opening_date => local_opening_date, :local_closing_date => local_closing_date, :opening_date => opening_date, :closing_date => closing_date}
+ date_arr.push(str)
+ end
+
+ out = {:status => 'ok', :message => date_arr}
+
+ respond_to do |format|
+ format.json { render json: out }
+ end
+ end
+end
\ No newline at end of file
diff --git a/app/controllers/reports/void_sale_controller.rb b/app/controllers/reports/void_sale_controller.rb
new file mode 100644
index 00000000..80526ad0
--- /dev/null
+++ b/app/controllers/reports/void_sale_controller.rb
@@ -0,0 +1,60 @@
+class Reports::VoidSaleController < BaseReportController
+authorize_resource :class => false
+ def index
+
+ from, to = get_date_range_from_params
+
+ # @shift_sale_range = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED)
+ @shift = ''
+ if params[:shift_name].to_i != 0
+ shift_sale = ShiftSale.find(params[:shift_name])
+ if to.blank?
+ @shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',shift_sale.shift_started_at)
+ else
+
+ @shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at)
+ end
+ end
+
+ @sale_data = Sale.get_void_sale(@shift,from,to)
+
+ @from = from
+ @to = to
+
+ if @shift.present?
+ @shift.each do |sh|
+ @shift_from = sh.shift_started_at.nil? ? '-' : sh.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p")
+ @shift_to = sh.shift_closed_at.nil? ? '-' : sh.shift_closed_at.utc.getlocal.strftime("%e %b %I:%M%p")
+ @shift_data = sh
+ end
+ end
+
+ respond_to do |format|
+ format.html
+ format.xls
+ end
+ end
+
+ def show
+ from, to = get_date_range_from_params
+
+ @sale_data = Sale.get_by_shift_sale(from,to,Sale::SALE_STATUS_COMPLETED)
+
+ date_arr = Array.new
+ @sale_data.each do |sale|
+ local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")
+ local_closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc.getlocal.strftime("%e %b %I:%M%p")
+ opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc
+ closing_date = sale.closing_date.nil? ? '-' : sale.closing_date.utc
+ shift_id = sale.id.nil? ? '-' : sale.id
+ str = {:shift_id => shift_id, :local_opening_date => local_opening_date, :local_closing_date => local_closing_date, :opening_date => opening_date, :closing_date => closing_date}
+ date_arr.push(str)
+ end
+
+ out = {:status => 'ok', :message => date_arr}
+
+ respond_to do |format|
+ format.json { render json: out }
+ end
+ end
+end
\ No newline at end of file
diff --git a/app/controllers/transactions/manual_sales_controller.rb b/app/controllers/transactions/manual_sales_controller.rb
index 77dd4371..d7f26f39 100644
--- a/app/controllers/transactions/manual_sales_controller.rb
+++ b/app/controllers/transactions/manual_sales_controller.rb
@@ -3,6 +3,7 @@ class Transactions::ManualSalesController < ApplicationController
def void
@sale = params[:sale_id]
@reason = Lookup.where("lookup_type = 'void_reason'")
+
respond_to do |format|
format.html # index.html.erb
format.json { render json: @sales }
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 6f7de340..00bb5b2c 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -69,6 +69,8 @@ class Ability
can :overall_void, :void
elsif user.role == "cashier"
+
+ # can :overall_void, :void
can :read, Order
can :update, Order
diff --git a/app/models/customer.rb b/app/models/customer.rb
index 06f7f1d1..c1751104 100644
--- a/app/models/customer.rb
+++ b/app/models/customer.rb
@@ -7,8 +7,8 @@ class Customer < ApplicationRecord
has_many :sales
validates_presence_of :name, :contact_no, :email,:card_no
- validates :contact_no, uniqueness: true
- validates :email, uniqueness: true
+ validates :contact_no, uniqueness: true, numericality: true
+ validates :email, uniqueness: true,format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create }
validates :card_no, uniqueness: true
validates :paypar_account_no, uniqueness: true
diff --git a/app/models/sale.rb b/app/models/sale.rb
index 197c7106..b23c630b 100644
--- a/app/models/sale.rb
+++ b/app/models/sale.rb
@@ -91,7 +91,7 @@ class Sale < ApplicationRecord
add_item(item)
end
- link_order_sale(order.id)
+ # link_order_sale(order.id)
end
self.save!
@@ -352,7 +352,7 @@ class Sale < ApplicationRecord
if saleOrder.nil?
sale_order = SaleOrder.new
- sale_order.create_sale_order(self.id, order_id)
+ sale = sale_order.create_sale_order(self.id, order_id)
end
# if (SaleOrder.where("sale_id = #{self.id} and order_id=#{order_id}").nil?)
# SaleOrder.create(:sale_id => self.id, :order_id => order_id)
@@ -642,10 +642,42 @@ def self.get_shift_sales_by_receipt_no(shift_sale_range,shift,from,to,payment_ty
query = query.where("sale_status='completed' and sales.receipt_date between ? and ? #{payment_type} and sale_payments.payment_amount != 0",from,to)
.joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
.group("sales.sale_id")
- end
-
+ end
+end
+
+def self.get_by_shift_sale_credit_payment(shift_sale_range,shift,from,to)
+ query = SalePayment.select("s.receipt_no, sale_payments.*,s.receipt_date as sale_date,
+ s.cashier_name as cashier_name")
+ .joins("INNER JOIN sales s ON s.sale_id = sale_payments.sale_id")
+
+ if shift.present?
+ query = query.where("payment_method= 'creditnote' and s.sale_status = 'completed' and s.shift_sale_id in (?)",shift.to_a)
+ elsif shift_sale_range.present?
+ query = query.where("payment_method='creditnote' and s.sale_status = 'completed' and s.shift_sale_id in (?)",shift_sale_range.to_a)
+ else
+ query = query.where("payment_method='creditnote' and s.sale_status = 'completed' and s.receipt_date between ? and ? ",from,to)
+ end
end
+ def self.get_void_sale(shift,from,to)
+ sale_arr = Array.new
+
+ query = Sale.select("sales.receipt_no,sales.receipt_date, sales.payment_status, sales.sale_status,sales.total_amount,sales.grand_total, sales.rounding_adjustment")
+ # .joins("INNER JOIN shift_sales sh ON sh.id = sales.shift_sale_id")
+ # .where("sales.sale_status = 'void' and (sh.shift_started_at between ? and ?
+ # OR sh.shift_closed_at between ? and ? )", from ,to, from, to)
+
+ if shift.present?
+ query = query.where("sales.sale_status = 'void' and sales.shift_sale_id in (?)",shift.to_a)
+ else
+ query = query.where("sales.sale_status = 'void' and sales.receipt_date between ? and ? ",from,to)
+ end
+
+ out = {:items => query}
+ sale_arr.push(out)
+ return sale_arr
+end
+
def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type)
if payment_type.blank?
@@ -680,18 +712,6 @@ def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type)
.group("sale_taxes.tax_name")
.order("sale_taxes.sale_tax_id asc")
end
-
- # query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
- # .joins("INNER JOIN sales ON sales.sale_id = sale_taxes.sale_id")
- # .joins("join sale_payments on sale_payments.sale_id = sales.sale_id")
- # .group("sale_taxes.tax_name")
- # .order("sale_taxes.sale_tax_id asc")
-
- # if shift.present?
- # query = query.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed'", shift.to_a)
- # else
- # query = query.where("sales.receipt_date between ? and ? #{payment_type} and sale_status= 'completed' ",from,to)
- # end
end
# def self.get_separate_tax(from,to,payment_method=nil)
diff --git a/app/models/seed_generator.rb b/app/models/seed_generator.rb
index 335ab131..a5bf5976 100644
--- a/app/models/seed_generator.rb
+++ b/app/models/seed_generator.rb
@@ -35,7 +35,7 @@ class SeedGenerator < ApplicationRecord
else
current_no = seed.next
- seed.next = seed.next + seed.increase_by
+ seed.next = seed.next
seed.current = current_no
seed.save
end
diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb
index b99c25a3..5ec0b903 100644
--- a/app/views/crm/customers/_new_form.html.erb
+++ b/app/views/crm/customers/_new_form.html.erb
@@ -6,7 +6,7 @@
">
<%= f.input :card_no, :class => "form-control col-md-6 card_no"%>
<% flash.each do |name, msg| %>
- <% str="[\"#{msg['name']}\"]"
+ <% str="[\"#{msg['card_no']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
<%= str %>
@@ -32,11 +32,12 @@
Mdm
<%= f.radio_button :salutation,"Mdm", :class => "salutation mdm", :value=>"Mdm", :style=>"width: 30px"%>
-
+
diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb
index 77d85f10..04c12262 100644
--- a/app/views/origami/home/index.html.erb
+++ b/app/views/origami/home/index.html.erb
@@ -110,6 +110,12 @@
Close Cashier
+
+ <%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
+ Back
+
+ <%end%>
+
@@ -218,4 +224,7 @@ $('#cash_out').on('click',function(){
$('#close_cashier').on('click',function(){
window.location.href = '/origami/shift/close';
})
+$('#back').on('click',function(){
+ window.location.href = '/dashboard';
+})
diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb
index 709ed7ca..206c8f20 100644
--- a/app/views/origami/home/show.html.erb
+++ b/app/views/origami/home/show.html.erb
@@ -20,7 +20,6 @@
-
@@ -305,27 +304,27 @@
<% if @dining.bookings.length >= 1 %>
Customer
- <% if @status_order == 'order' && @status_sale != 'sale' %>
-
-
Edit
-
Discount
-
Charges
-
Move
-
Req.Bill
-
First Bill
-
Pay
-
Void
- <% else %>
-
-
Edit
-
Discount
-
Charges
-
Move
-
Req.Bill
-
First Bill
-
Pay
-
Void
- <% end %>
+ <% if @status_order == 'order' && @status_sale != 'sale' %>
+
+
Edit
+
Discount
+
Charges
+
Move
+
Req.Bill
+
First Bill
+
Pay
+
Void
+ <% else %>
+
+
Edit
+
Discount
+
Charges
+
Move
+
Req.Bill
+
First Bill
+
Pay
+
Void
+ <% end %>
@@ -452,9 +451,7 @@ $("#first_bill").on('click', function(){
$('#pay').on('click',function() {
var sale_id = $('#sale_id').val();
- var rounding_adj = $('#rounding_adj').val();
- if(rounding_adj == "true"){
var url = '/origami/sale/'+ sale_id + "/rounding_adj" ;
$.ajax({
type: "POST",
@@ -463,9 +460,7 @@ $('#pay').on('click',function() {
window.location.href = '/origami/sale/'+ sale_id + "/payment";
}
});
- }else{
- window.location.href = '/origami/sale/'+ sale_id + "/payment";
- }
+
});
diff --git a/app/views/reports/credit_payment/_shift_sale_report_filter.html.erb b/app/views/reports/credit_payment/_shift_sale_report_filter.html.erb
new file mode 100644
index 00000000..5313e61d
--- /dev/null
+++ b/app/views/reports/credit_payment/_shift_sale_report_filter.html.erb
@@ -0,0 +1,125 @@
+
+
+ <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
+ <% if period_type != false %>
+
+
+ Select Period
+
+ Select Period
+ Today
+ Yesterday
+ This week
+ Last week
+ Last 7 days
+ This month
+ Last month
+ Last 30 days
+ This year
+ Last year
+
+
+
+
+
+ From
+
+
+
+ To
+
+
+
+ All Shift
+
+
+
+
+
+
+
+ <% end %>
+
+ <% end %>
+
+
+
+
+
diff --git a/app/views/reports/credit_payment/index.html.erb b/app/views/reports/credit_payment/index.html.erb
new file mode 100644
index 00000000..6e3e6a58
--- /dev/null
+++ b/app/views/reports/credit_payment/index.html.erb
@@ -0,0 +1,150 @@
+
+
+
+ <%= render :partial=>'shift_sale_report_filter',
+ :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_credit_payment_index_path} %>
+
+
+
+
+
+
+
+ <% unless @sale_data.blank? %>
+
+
+
+ <% if !params[:from].blank?%>
+
+ From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%>
+
+ <% end %>
+
+ Shift Name
+ Receive No
+ Cashier Name
+ Customer Name
+ Credit Amount
+
+
+
+ <% @sale_data.each do |credit| %>
+
+
+ <% if @shift_from.nil? && @shift_to.nil? %>
+ <%= credit.sale_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-'%>
+ <% else %>
+ <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%>
+ <% end %>
+ <%= credit.receipt_no rescue '-' %>
+ <%= credit.cashier_name rescue '-' %>
+ <%= credit.sale.customer.name rescue '-' %>
+ <%= credit.payment_amount rescue '-' %>
+
+ <% end %>
+
+
+ <% end %>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/reports/credit_payment/index.xls.erb b/app/views/reports/credit_payment/index.xls.erb
new file mode 100644
index 00000000..9597e3d9
--- /dev/null
+++ b/app/views/reports/credit_payment/index.xls.erb
@@ -0,0 +1,39 @@
+
+
+ <% unless @sale_data.blank? %>
+
+
+
+ <% if !params[:from].blank?%>
+
+ From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%>
+
+ <% end %>
+
+ Shift Name
+ Receive No
+ Cashier Name
+ Customer Name
+ Credit Amount
+
+
+
+ <% @sale_data.each do |credit| %>
+
+
+ <% if @shift_from.nil? && @shift_to.nil? %>
+ <%= credit.sale_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-'%>
+ <% else %>
+ <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%>
+ <% end %>
+ <%= credit.receipt_no rescue '-' %>
+ <%= credit.cashier_name rescue '-' %>
+ <%= credit.sale.customer.name rescue '-' %>
+ <%= credit.payment_amount rescue '-' %>
+
+ <% end %>
+
+
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/reports/void_sale/_shift_sale_report_filter.html.erb b/app/views/reports/void_sale/_shift_sale_report_filter.html.erb
new file mode 100644
index 00000000..5313e61d
--- /dev/null
+++ b/app/views/reports/void_sale/_shift_sale_report_filter.html.erb
@@ -0,0 +1,125 @@
+
+
+ <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
+ <% if period_type != false %>
+
+
+ Select Period
+
+ Select Period
+ Today
+ Yesterday
+ This week
+ Last week
+ Last 7 days
+ This month
+ Last month
+ Last 30 days
+ This year
+ Last year
+
+
+
+
+
+ From
+
+
+
+ To
+
+
+
+ All Shift
+
+
+
+
+
+
+
+ <% end %>
+
+ <% end %>
+
+
+
+
+
diff --git a/app/views/reports/void_sale/index.html.erb b/app/views/reports/void_sale/index.html.erb
new file mode 100644
index 00000000..4e33c27d
--- /dev/null
+++ b/app/views/reports/void_sale/index.html.erb
@@ -0,0 +1,175 @@
+
+
+
+ <%= render :partial=>'shift_sale_report_filter',
+ :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_void_sale_index_path} %>
+
+
+
+
+
+
+
+ <% if @sale_data.count > 0 %>
+
+
+ <% if !params[:from].blank?%>
+
+ From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%>
+
+ <% end %>
+ <% if @shift_from %>
+
+ <% if @shift %>
+ <% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
+ <% end %>
+ Shift Name = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )
+
+ <% end %>
+
+ Receipt No
+ Sale Date
+ Total Amount
+ Grand Total
+ Rounding Adj.
+ Grand Total + Rounding Adj.
+ Sale Status
+ Remarks
+
+
+
+ <% total_amount = 0.0 %>
+ <% grand_total = 0.0 %>
+ <% rounding_adjustment = 0.0 %>
+ <% grand_rounding_adjustment = 0.0 %>
+ <% @sale_data.each do |result| %>
+ <% result[:items].each do |item| %>
+
+ <%= item.receipt_no rescue '-' %>
+ <%= item.date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-' %>
+ <%= item.total_amount.to_f rescue '-'%>
+ <%= item.grand_total.to_f rescue '-'%>
+ <%= item.rounding_adjustment.to_f rescue '-' %>
+ <%= item.grand_total.to_f + item.rounding_adjustment.to_f rescue '-'%>
+ <%= item.sales_status rescue '-' %>
+ <%= item.remarks rescue '-' %>
+
+ <% total_amount = total_amount.to_f + item.total_amount.to_f %>
+ <% grand_total = grand_total.to_f + item.grand_total.to_f %>
+ <% rounding_adjustment = rounding_adjustment.to_f + item.rounding_adjustment.to_f %>
+ <% grand_rounding_adjustment = grand_rounding_adjustment.to_f + item.grand_total.to_f + item.rounding_adjustment.to_f %>
+ <% end %>
+ <% end %>
+
+ Total Void Amount :
+ <%= total_amount rescue '-' %>
+ <%= grand_total rescue '-' %>
+ <%= rounding_adjustment rescue '-'%>
+ <%= grand_rounding_adjustment rescue '-'%>
+
+
+
+<% end %>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/reports/void_sale/index.xls.erb b/app/views/reports/void_sale/index.xls.erb
new file mode 100644
index 00000000..9597e3d9
--- /dev/null
+++ b/app/views/reports/void_sale/index.xls.erb
@@ -0,0 +1,39 @@
+
+
+ <% unless @sale_data.blank? %>
+
+
+
+ <% if !params[:from].blank?%>
+
+ From Date : <%= params[:from] rescue '-'%> , To Date : <%= params[:to] rescue '-'%>
+
+ <% end %>
+
+ Shift Name
+ Receive No
+ Cashier Name
+ Customer Name
+ Credit Amount
+
+
+
+ <% @sale_data.each do |credit| %>
+
+
+ <% if @shift_from.nil? && @shift_to.nil? %>
+ <%= credit.sale_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-'%>
+ <% else %>
+ <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%>
+ <% end %>
+ <%= credit.receipt_no rescue '-' %>
+ <%= credit.cashier_name rescue '-' %>
+ <%= credit.sale.customer.name rescue '-' %>
+ <%= credit.payment_amount rescue '-' %>
+
+ <% end %>
+
+
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/transactions/sales/show.html.erb b/app/views/transactions/sales/show.html.erb
index cbd07c41..0ea005c9 100644
--- a/app/views/transactions/sales/show.html.erb
+++ b/app/views/transactions/sales/show.html.erb
@@ -13,13 +13,13 @@
Back
-
+
diff --git a/config/routes.rb b/config/routes.rb
index c6ce7860..0753b64b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -277,14 +277,10 @@ Rails.application.routes.draw do
resources :dailysale, :only => [:index, :show]
resources :saleitem, :only => [:index, :show]
resources :shiftsale, :only => [:index, :show]
+ resources :credit_payment, :only => [:index, :show]
+ resources :void_sale, :only => [:index, :show]
get "receipt_no/get_shift_by_date", to: "receipt_no#get_shift_by_date", as: "get_shift_by_date"
- # resources :sales, :only => [:index, :show]
- # resources :orders, :only => [:index, :show]
- # resources :customers, :only => [:index, :show]
- # resources :products, :only => [:index, :show]
- # resources :inventory, :only => [:index, :show]
- # resources :employees, :only => [:index, :show]
end
#mount_compendium at: '/report' #, controller: 'reports'
diff --git a/lib/tasks/menu_osaka.rake b/lib/tasks/menu_osaka.rake
index 1f7603b8..77c8c348 100644
--- a/lib/tasks/menu_osaka.rake
+++ b/lib/tasks/menu_osaka.rake
@@ -924,7 +924,7 @@ member_actions= MembershipAction.create([{membership_type:"get_account_balance",
{membership_type:"update_membership_customer",gateway_url:"/api/generic_customer/update_membership_customer",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"get_all_member_group",gateway_url:"/api/member_group/get_all_member_group",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"rebate",gateway_url:"/api/membership_campaigns/rebate",additional_parameter:{campaign_type_id:1},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
- {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_data",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
+ {membership_type:"get_all_member_account",gateway_url:"/api/generic_customer/get_membership_account_data",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"get_member_transactions",gateway_url:"/api/generic_customer/get_membership_transactions",merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"member_discount",gateway_url:"/api/membership_campaigns/discount",additional_parameter:{campaign_type_id:6},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},
{membership_type:"get_member_campaign",gateway_url:"/api/membership_campaigns/get_member_campaign",additional_parameter:{campaign_type_id:6},merchant_account_id:"RxzaYyAGzm7VqAZ4hKnv",auth_token:"code2lab"},