Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into pre_master

This commit is contained in:
Yan
2017-06-14 10:16:55 +06:30
52 changed files with 1332 additions and 700 deletions

View File

@@ -17,6 +17,8 @@
//= require turbolinks
//= require cable
//= require settings/processing_items
//= require jquery-ui
//= require bootstrap-datepicker
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
$(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});

View File

@@ -192,7 +192,7 @@ $(document).ready(function(){
}else{
var sale_id = $(".selected-item").find(".order-cid").text();
}
window.location.href = '/origami/'+ sale_id + "/add_customer"
window.location.href = '/origami/'+ sale_id + "/customers"
return false;
});
@@ -205,10 +205,11 @@ $(document).ready(function(){
var url = "origami/"+customer_id+"/get_customer/"
}
$('.customer_detail').removeClass('hide');
$('.customer_detail').removeClass('hide');
//Start Ajax
$.ajax({
type: "GET",
$.ajax({
type: "GET",
url: url,
data: {},
dataType: "json",
@@ -217,8 +218,16 @@ $(document).ready(function(){
$.each(data["response_data"]["data"], function (i) {
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
var balance = data["response_data"]["data"][i]["balance"];
console.log(balance);
$("#customer_amount").text(balance);
if (data["response_data"]["status"]==true) {
$('.rebate_amount').removeClass('hide');
console.log(balance);
row =
'<td class="charges-name">' + data["response_data"]["data"][i]["accountable_type"] +'</td>'
+'<td class="item-attr">' + balance + '</td>';
$(".rebate_amount").append(row);
}
}
});
}

View File

@@ -0,0 +1,40 @@
// number key pad
$(document).on('click', '.cashier_number', function(event){
event.stopPropagation();
event.preventDefault();
if(event.handled !== true) {
var original_value;
original_value = $('#amount').text();
var input_value = $(this).attr("data-value");
var input_type = $(this).attr("data-type");
switch (input_type) {
case 'num':
if (original_value == "0.0"){
$('#amount').text(input_value);
}else{
$('#amount').append(input_value);
}
break;
case 'add':
var input_value = $(this).attr("data-value");
amount = parseInt(input_value) + parseInt(original_value);
$('#amount').html(amount);
break;
case 'clr':
$('#amount').html("0.0");
break;
case 'del' :
var cash=$('#amount').text();
$('#amount').text(cash.substr(0,cash.length-1));
break;
}
event.handled = true;
} else {
return false;
}
});

View File

@@ -0,0 +1,7 @@
//= require jquery
//= require bootstrap
//= require jquery_ujs
//= require turbolinks
//= require cable
//= require jquery-ui
//= require bootstrap-datepicker

View File

@@ -2,6 +2,8 @@
@import "bootstrap";
@import "font-awesome";
@import "theme";
@import "jquery-ui";
@import "bootstrap-datepicker3";
/* Show it is fixed to the top */

View File

@@ -0,0 +1,5 @@
@import "bootstrap";
@import "font-awesome";
@import "theme";
@import "jquery-ui";
@import "bootstrap-datepicker3";

View File

@@ -33,27 +33,22 @@ class Api::OrdersController < Api::ApiController
@order.guest = params[:guest_info]
@order.table_id = params[:table_id]
@order.new_booking = true
#@order.employee_name = "Emenu"
@order.employee_name = current_login_employee.name
#Create Table Booking or Room Booking
if !params["booking_id"].nil?
@order.new_booking = false
@order.booking_id = params[:booking_id]
# check booking id is already completed.
booking = Booking.find(params[:booking_id])
if !booking.sale_id.nil?
if booking.sale.sale_status == "completed"
@order.new_booking = true
else
@order.new_booking = false
@order.booking_id = params[:booking_id]
end
end
end
@status, @booking = @order.generate
# rescue Exception => error
# @status = false
# @error_messages = "Exception has occurs on System"
#
# logger.fatal("Exception Raise - " + error.message)
# end
end
# Description

View File

@@ -10,9 +10,12 @@ class Crm::CustomersController < BaseCrmController
@crm_customers = Customer.order("customer_id").page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5)
else
@crm_customers = Customer.where("name LIKE ?", "%#{filter}%").order("name").page(params[:page]) end
@crm_customers = Customer.search(filter)
end
#@crm_customers = Customer.all
@crm_customer = Customer.new
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50)
@crm_customer = Customer.new
if flash["errors"]
@crm_customer.valid?
@@ -45,6 +48,35 @@ class Crm::CustomersController < BaseCrmController
@sale_items = @sale_items + sale.sale_items
end
end
#get customer amount
@customer = Customer.find(params[: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'
}
)
@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
# GET /crm/customers/new
@@ -75,12 +107,13 @@ class Crm::CustomersController < BaseCrmController
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("create_membership_customer")
merchant_uid = memberaction.merchant_account_id.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
response = HTTParty.post(url, :body => { name: name,phone: phone,email: email,
dob: dob,
member_group_id: member_group_id,merchant_uid:merchant_uid}.to_json,
member_group_id: member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
@@ -93,7 +126,7 @@ class Crm::CustomersController < BaseCrmController
status = customer.update_attributes(membership_id: response["customer_datas"]["id"])
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer', notice: 'Customer was successfully created.' }
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers', notice: 'Customer was successfully created.' }
else
format.html { redirect_to crm_customers_path, notice: 'Customer was successfully created'}
end
@@ -102,7 +135,7 @@ class Crm::CustomersController < BaseCrmController
@crm_customers.destroy
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer'}
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers'}
else
format.html { redirect_to crm_customers_path, notice: response["message"] }
end
@@ -111,7 +144,7 @@ class Crm::CustomersController < BaseCrmController
if params[:sale_id]
flash[:errors] = @crm_customers.errors
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer'}
format.html { redirect_to '/origami/'+params[:sale_id]+'/customers'}
format.json { render json: @crm_customers.errors, status: :unprocessable_entity }
else
flash[:errors] = @crm_customers.errors
@@ -140,11 +173,12 @@ end
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("update_membership_customer")
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.post(url, :body => { name: name,phone: phone,email: email,
dob: dob,
id: id,member_group_id:member_group_id,merchant_uid:merchant_uid}.to_json,
id: id,member_group_id:member_group_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'

View File

@@ -10,19 +10,22 @@ class Origami::CustomersController < BaseOrigamiController
def show
end
def add_customer
@sale_id = params[:sale_id]
filter = params[:filter]
filter = params[:filter]
if filter.nil?
@crm_customers = Customer.order("name").page params[:page]
@crm_customers = Customer.order("customer_id").page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5)
else
@crm_customers = Customer.where("name LIKE ?", "%#{filter}%").order("name").page params[:page]
@crm_customers = Customer.search(filter)
end
# @crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(2)
#@crm_customers = Customer.all
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50)
@crm_customer = Customer.new
if flash["errors"]

View File

@@ -74,9 +74,10 @@ class Origami::HomeController < BaseOrigamiController
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}.to_json,
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'

View File

@@ -0,0 +1,17 @@
class Origami::JcbController < BaseOrigamiController
def index
@sale_id = params[:sale_id]
end
def create
cash = params[:amount]
sale_id = params[:sale_id]
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu")
end
end
end

View File

@@ -0,0 +1,17 @@
class Origami::MasterController < BaseOrigamiController
def index
@sale_id = params[:sale_id]
end
def create
cash = params[:amount]
sale_id = params[:sale_id]
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu")
end
end
end

View File

@@ -27,22 +27,28 @@ class Origami::PaymentsController < BaseOrigamiController
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
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}.to_json,
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'
}
)
@balance = 0.00
response["data"].each do |res|
if res["accountable_type"] == "RebateAccount"
@balance = res["balance"]
end
@accountable_type = ''
if response["data"]==true
response["data"].each do |res|
if res["accountable_type"] == "RebateAccount"
@balance = res["balance"]
@accountable_type = res["accountable_type"]
end
end
end
#end customer amount
@sale_data.sale_payments.each do |spay|

View File

@@ -4,7 +4,25 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
payment_method = params[:payment_method]
@membership_rebate_balance=0
sale_data = Sale.find_by_sale_id(@sale_id)
@food_prices, @beverage_prices = SaleItem.calculate_food_beverage(sale_data.sale_items)
# limit redeem_amount
food_prices, beverage_prices = SaleItem.calculate_food_beverage(sale_data.sale_items)
@payparcount = 0
others = 0
sale_data.sale_payments.each do |sale_payment|
if sale_payment.payment_method == "paypar"
@payparcount = @payparcount + sale_payment.payment_amount
else
others = others + sale_payment.payment_amount
end
end
is_bervage_exceed = others - (beverage_prices + sale_data.total_tax)
if is_bervage_exceed < 0
@food_prices = food_prices - @payparcount
else
@food_prices = food_prices - @payparcount -is_bervage_exceed
end
if sale_data
if sale_data.customer_id
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
@@ -18,7 +36,8 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
@campaign_type_id = member_actions.additional_parameter["campaign_type_id"]
url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s
merchant_uid= member_actions.merchant_account_id
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid)
auth_token = member_actions.auth_token.to_s
membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid,auth_token)
if membership_data["status"]==true
@membership_rebate_balance=membership_data["balance"]
@out = true, @membership_rebate_balance,@membership_id

View File

@@ -0,0 +1,17 @@
class Origami::VisaController < BaseOrigamiController
def index
@sale_id = params[:sale_id]
end
def create
cash = params[:amount]
sale_id = params[:sale_id]
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "mpu")
end
end
end

View File

@@ -1,21 +1,9 @@
class Reports::DailySaleController < BaseReportController
PERIOD = {
"today" => 0,
"yesterday" => 1,
"this_week" => 2,
"last_week" => 3,
"last_7" => 4,
"this_month" => 5,
"last_month" => 6,
"last_30" => 7,
"this_year" => 8,
"last_year" => 9
}
def index
from, to = get_date_range_from_params
@sale_data = Sale.get_receipt_no_list(from,to)
@sale_data = Kaminari.paginate_array(@sale_data).page(params[:page]).per(50)
end
end
end

View File

@@ -1,32 +0,0 @@
class Settings::SalesController < ApplicationController
def index
search_date = params[:date]
receipt_no = params[:receipt_no]
today = Date.today
if receipt_no.nil?
@sales = Sale.order("sale_id").page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5)
else
@sales = Sale.where("receipt_no LIKE ?", "%#{receipt_no}%").order("receipt_no").page(params[:page])
end
#@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50)
respond_to do |format|
format.html # index.html.erb
format.json { render json: @sales }
end
end
def show
@sale = Sale.find(params[:id])
# @sale_receivables = SaleReceivable.where('sale_id = ?', @sale.id)
respond_to do |format|
format.html # show.html.erb
format.json { render json: @sale }
end
end
end

View File

@@ -1,16 +1,16 @@
class Settings::OrdersController < ApplicationController
class Transactions::OrdersController < ApplicationController
def index
filter = params[:filter]
if filter.nil?
orders = Order.order("order_id desc").limit(1000)
orders = Order.order("order_id desc")
else
order = Order.where("order_id LIKE ?", "%#{filter}%").order("order_id desc").limit(1000).page(params[:page])
order = Order.search(filter)
if order.count > 0
orders = order
else
orders = Order.order("order_id desc").limit(1000)
flash[:notice] = "There is no data."
orders = Order.order("order_id desc")
end
end
@orders = Kaminari.paginate_array(orders).page(params[:page]).per(50)

View File

@@ -4,12 +4,34 @@ class Transactions::SalesController < ApplicationController
# GET /transactions/sales
# GET /transactions/sales.json
def index
@transactions_sales = Sale.all
search_date = params[:date]
receipt_no = params[:receipt_no]
today = Date.today
if receipt_no.nil?
@sales = Sale.order("sale_id").page(params[:page])
#@products = Product.order("name").page(params[:page]).per(5)
else
@sales = Sale.search(receipt_no)
end
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50)
respond_to do |format|
format.html # index.html.erb
format.json { render json: @sales }
end
end
# GET /transactions/sales/1
# GET /transactions/sales/1.json
def show
@sale = Sale.find(params[:id])
# @sale_receivables = SaleReceivable.where('sale_id = ?', @sale.id)
respond_to do |format|
format.html # show.html.erb
format.json { render json: @sale }
end
end
# GET /transactions/sales/new

View File

@@ -34,12 +34,17 @@ class Customer < ApplicationRecord
def self.search(search)
if search
find(:all, :conditions => ['name LIKE ?', "%#{search}%"])
# find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"])
where("name LIKE ? OR contact_no LIKE ?", "%#{search}%", "%#{search}%",)
else
find(:all)
end
end
# def self.search(search)
# where("name LIKE ? OR contact_no LIKE ?", "%#{search}%", "%#{search}%",)
# end
def lastest_invoices
sales.where(:customer_id => self.id).order("created_at desc").limit(5)
end

View File

@@ -25,7 +25,7 @@ class Order < ApplicationRecord
booking = nil
if self.new_booking
puts "a"
booking = Booking.create({:dining_facility_id => self.table_id,:type => "TableBooking",
:checkin_at => Time.now.utc, :checkin_by => self.employee_name,
:booking_status => "assign" })
@@ -311,6 +311,15 @@ class Order < ApplicationRecord
end
def self.search(search)
if search
# find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"])
where("order_id LIKE ?", "%#{search}%")
else
find(:all)
end
end
private
def generate_custom_id

View File

@@ -12,7 +12,8 @@ class Sale < ApplicationRecord
has_many :sale_taxes
has_many :sale_payments
has_many :sale_orders
has_many :bookings
scope :open_invoices, -> { where("sale_status = 'new' and receipt_date BETWEEN '#{DateTime.now.utc.end_of_day}' AND '#{DateTime.now.utc.beginning_of_day}'") }
def generate_invoice_from_booking(booking_id, requested_by)
@@ -260,7 +261,8 @@ class Sale < ApplicationRecord
def self.search(search)
if search
find(:all, :conditions => ['receipt_no LIKE ?', "%#{search}%"])
# find(:all, :conditions => ['name LIKE ? OR contact_no LIKE ?', "%#{search}%", "%#{search}%"])
where("receipt_no LIKE ?", "%#{search}%",)
else
find(:all)
end

View File

@@ -66,9 +66,9 @@ class SalePayment < ApplicationRecord
end
def self.get_paypar_account(url,token,membership_id,campaign_type_id,merchant_uid)
def self.get_paypar_account(url,token,membership_id,campaign_type_id,merchant_uid,auth_token)
response = HTTParty.get(url,
:body => { app_token: token,membership_id:membership_id,campaign_type_id:campaign_type_id,merchant_uid:merchant_uid}.to_json,
:body => { app_token: token,membership_id:membership_id,campaign_type_id:campaign_type_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
@@ -83,11 +83,12 @@ class SalePayment < ApplicationRecord
if !membership_actions_data.nil?
url = paypar_url.to_s + membership_actions_data.gateway_url.to_s
merchant_uid = membership_actions_data.merchant_account_id
auth_token = membership_actions_data.auth_token
campaign_type_id = membership_actions_data.additional_parameter["campaign_type_id"]
sale_data = Sale.find_by_sale_id(sale_id)
if sale_data
response = HTTParty.post(url,
:body => { generic_customer_id:membership_id,redeem_amount:received_amount,receipt_no:sale_data.receipt_no,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid}.to_json,
:body => { generic_customer_id:membership_id,redeem_amount:received_amount,receipt_no:sale_data.receipt_no,campaign_type_id:campaign_type_id,account_no:"",merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
@@ -211,7 +212,8 @@ class SalePayment < ApplicationRecord
def sale_update_payment_status(paid_amount)
#update amount_outstanding
self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f
self.sale.amount_changed = paid_amount.to_f - self.sale.amount_received.to_f
self.sale.amount_changed = self.sale.amount_received.to_f - self.sale.grand_total.to_f
all_received_amount = 0.0
sObj = Sale.find(self.sale_id)
sObj.sale_payments.each do |spay|
@@ -255,10 +257,10 @@ class SalePayment < ApplicationRecord
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("rebate")
campaign_type_id = memberaction.additional_parameter["campaign_type_id"]
app_token = membership.auth_token.to_s
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,
receipt_no: receipt_no}.to_json,
receipt_no: receipt_no,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'

View File

@@ -14,7 +14,7 @@
<div class="row">
<div class="col-lg-8">
<div class="col-lg-7 col-md-7 col-sm-7">
<div class="main-box-body clearfix">
<div class="table-responsive">
@@ -25,8 +25,8 @@
<tr>
<td colspan="6">
<%= form_tag crm_customers_path, :method => :get do %>
<div class="input-append form-group pull-left">
<input type="text" name="filter" placeholder="Search" class="form-control input-sm col-md-8">
<div class="input-append col-md-12 form-group pull-left">
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" class="form-control input-sm col-md-4">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
</div>
<% end %>
@@ -42,20 +42,21 @@
</thead>
<tbody>
<% @crm_customers.each do |crm_customer| %>
<tr>
<td>
<input type="radio" style="width:20px;" value="<%= crm_customer.customer_id %>" name="checkbox" class="checkbox_check" ></td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
<td>
<%= link_to 'Show', crm_customer_path(crm_customer) %>
</td>
</tr>
<% if @crm_customers.count > 0 %>
<% @crm_customers.each do |crm_customer| %>
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
<td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company rescue '-' %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
<td><%= link_to 'Show', crm_customer_path(crm_customer) %></td>
</tr>
<% end %>
<%else%>
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
<% end %>
</tbody>
</table>
@@ -66,7 +67,7 @@
</div>
</div>
<div class="col-lg-4">
<div class="col-lg-4 col-md-4 col-sm-4">
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
@@ -115,6 +116,12 @@
</div>
<%end%>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<br>
<a href="<%= crm_customers_path%>" class="btn btn-primary">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
</div>
</div>
@@ -129,11 +136,10 @@ $(function() {
$('.datepicker').css('cursor','pointer');
});
$(document).on('click',".checkbox_check",function(){
if(this.checked){
$(document).on('click',".customer_tr",function(){
// if(this.checked){
var sale_id = $("#sale_id").val() || 0;
var customer_id = $(this).val();
var customer_id = $(this).attr('data-ref');
if(sale_id != 0){
// var url = "/"+customer_id;
@@ -172,9 +178,9 @@ $(function() {
//$(".edit_customer").attr('method', 'PATCH');
}
});
}else{
// }else{
}
// }
})
function update_sale(customer_id,sale_id) {
@@ -199,7 +205,6 @@ $(function() {
success: function(data) {
if(data.status == true)
{
alert('Customer has assigned');
window.location.href = '/origami'
}else{
alert('Record not found!');
@@ -216,7 +221,4 @@ $(function() {
}
</script>

View File

@@ -1,113 +1,130 @@
<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="<%= crm_customers_path %>">Customer</a>
</li>
<li class="active">Details
</li>
</ol>
</div>
</div>
<div class="col-lg-10 col-md-10 col-sm-10">
<!-- Column One -->
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#queue" role="tab">Customer Details </a>
</li>
<li class="nav-item">
<a class="nav-link " data-toggle="tab" href="#booking" role="tab">Orders </a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#customer" role="tab">Sales</a>
</li>
</ul>
<!-- Nav tabs - End -->
<div class="row">
<div class="col-lg-12">
<div class="main-box-body clearfix">
<div class="table-responsive">
<hr>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Contact no</th>
<th>Company</th>
<th>Date Of Birth</th>
</tr>
</thead>
<div class="tab-content" style="min-height:670px; max-height:670px; overflow-y:scroll">
<tbody>
<tr>
<td><%= @crm_customer.name %></td>
<td><%= @crm_customer.email %></td>
<td><%= @crm_customer.contact_no %></td>
<td><%= @crm_customer.company %></td>
<td><%= @crm_customer.date_of_birth %> </td>
</tr>
</tbody>
</table>
<br>
<h3>Order Items</h3>
<div class="tab-pane active" id="queue" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:">
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr>
<th>Name</th>
<td><%= @crm_customer.name %></td>
</tr>
<tr>
<th>Email</th>
<td><%= @crm_customer.email %></td>
</tr>
<tr>
<th>Contact no</th>
<td><%= @crm_customer.contact_no %></td>
</tr>
<tr>
<th>Company</th>
<td><%= @crm_customer.company %></td>
</tr>
<tr>
<th>Date Of Birth</th>
<td><%= @crm_customer.date_of_birth %> </td>
</tr>
</tbody>
</table>
</div>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>Created at </th>
<th>Menu Item</th>
<th>QTY</th>
<th>Unit Price </th>
<th>Option</th>
<th>Status</th>
<th>Waiter</th>
</tr>
</thead>
<div class="tab-pane" id="booking" role="tabpanel">
<h3>Order Details</h3>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Order ID</th>
<th>Menu Item</th>
<th>QTY</th>
<th>Unit Price </th>
<th>Option</th>
<th>Status</th>
<th>Waiter</th>
<th>Created at </th>
</tr>
</thead>
<tbody>
<% @order_items.each do |order_item| %>
<tr>
<td><%= order_item.created_at %></td>
<td><%= order_item.item_name %></td>
<td><%= order_item.qty %></td>
<td><%= order_item.price %></td>
<td><%= order_item.options %></td>
<td><%= order_item.order_item_status %></td>
<td><%= order_item.item_order_by %> </td>
</tr>
<% end %>
</tbody>
</table>
<tbody>
<% @order_items.each do |order_item| %>
<tr>
<td><%= order_item.order_id %></td>
<td><%= order_item.item_name %></td>
<td><%= order_item.qty %></td>
<td><%= order_item.price %></td>
<td><%= order_item.options %></td>
<td><%= order_item.order_item_status %></td>
<td><%= order_item.item_order_by %> </td>
<td><%= order_item.created_at.strftime("%d-%m-%y") %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<h3>Sale Items</h3>
<div class="tab-pane" id="customer" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:">
<h3>Sale Details</h3>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Sale ID </th>
<th>Menu Item</th>
<th>QTY</th>
<th>Unit Price </th>
<th>Tax Price</th>
<th>Created At</th>
</tr>
</thead>
<table class="table table-striped">
<thead>
<tr>
<th>Sale ID </th>
<th>Menu Item</th>
<th>QTY</th>
<th>Unit Price </th>
<th>Tax Price</th>
<th>Created At</th>
</tr>
</thead>
<tbody>
<% @sale_items.each do |sale_item| %>
<tr>
<td><%= sale_item.sale_id %></td>
<td><%= sale_item.product_name %></td>
<td><%= sale_item.qty %></td>
<td><%= sale_item.unit_price %></td>
<td><%= sale_item.taxable_price %></td>
<td><%= sale_item.created_at %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<tbody>
<% @sale_items.each do |sale_item| %>
<tr>
<td><%= sale_item.sale_id %></td>
<td><%= sale_item.product_name %></td>
<td><%= sale_item.qty %></td>
<td><%= sale_item.unit_price %></td>
<td><%= sale_item.taxable_price %></td>
<td><%= sale_item.created_at %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<br><br>
<a href="<%= crm_customers_path%>" class="btn btn-primary pull">
<i class="fa fa-arrow-left fa-xs"></i> Back
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,85 @@
<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="<%= crm_customers_path %>">Customer</a>
</li>
<li class="active">Details
</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="main-box-body clearfix">
<div class="table-responsive">
<hr>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Contact no</th>
<th>Company</th>
<th>Date Of Birth</th>
<th>Membership Account</th>
</tr>
</thead>
<tbody>
<tr>
<td><%= @crm_customer.name %></td>
<td><%= @crm_customer.email %></td>
<td><%= @crm_customer.contact_no %></td>
<td><%= @crm_customer.company %></td>
<td><%= @crm_customer.date_of_birth %> </td>
</tr>
</tbody>
</table>
<br>
<h3>Sale Items</h3>
<table class="table table-striped">
<thead>
<tr>
<th>Sale ID </th>
<th>Menu Item</th>
<th>QTY</th>
<th>Unit Price </th>
<th>Tax Price</th>
<th>Created At</th>
</tr>
</thead>
<tbody>
<% @sale_items.each do |sale_item| %>
<tr>
<td><%= sale_item.sale_id %></td>
<td><%= sale_item.product_name %></td>
<td><%= sale_item.qty %></td>
<td><%= sale_item.unit_price %></td>
<td><%= sale_item.taxable_price %></td>
<td><%= sale_item.created_at %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@@ -21,7 +21,7 @@
<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
<% if !flash["errors"]%>
<%=message%>
<%=message%>
<% end %>
</div>
<% end %>

View File

@@ -28,8 +28,8 @@
<li class="navbar-nav mr-auto dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;Transactions</a>
<ul class="dropdown-menu">
<li><%= link_to "Orders ", settings_orders_path, :tabindex =>"-1" %></li>
<li><%= link_to "Sales ", settings_sales_path, :tabindex =>"-1" %></li>
<li><%= link_to "Orders ", transactions_orders_path, :tabindex =>"-1" %></li>
<li><%= link_to "Sales ", transactions_sales_path, :tabindex =>"-1" %></li>
</ul>
</li>
<li class="navbar-nav mr-auto dropdown">

View File

@@ -14,7 +14,7 @@
<div class="row">
<div class="col-lg-8">
<div class="col-lg-7 col-md-7 col-sm-7">
<div class="main-box-body clearfix">
<div class="table-responsive">
@@ -24,9 +24,10 @@
<tr>
<td colspan="6">
<%= form_tag crm_customers_path, :method => :get do %>
<div class="input-append form-group pull-left">
<input type="text" name="filter" placeholder="Search" class="form-control input-sm col-md-8">
<% path ="/origami/#{@sale_id}/customers" %>
<%= form_tag path, :method => :get do %>
<div class="input-append col-md-12 form-group pull-left">
<input type="text" name="filter" style="margin-right:10px" placeholder="Search" class="form-control input-sm col-md-4">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
</div>
<% end %>
@@ -38,25 +39,25 @@
<th>Company</th>
<th>Contact no</th>
<th>Email</th>
<th>Date of Birth</th>
</tr>
</thead>
<tbody>
<% @crm_customers.each do |crm_customer| %>
<tr>
<td>
<input type="radio" style="width:20px;" value="<%= crm_customer.customer_id %>" name="checkbox" class="checkbox_check" ></td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company rescue '-' %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
<td>
<%= crm_customer.date_of_birth rescue '-' %>
</td>
</tr>
<% if @crm_customers.count > 0 %>
<% @crm_customers.each do |crm_customer| %>
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
<td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company rescue '-' %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
</tr>
<% end %>
<%else%>
<tr><td colspan="5"><p style="text-align:center"><strong>There are no record for your search</strong></p></td></tr>
<% end %>
</tbody>
</table>
@@ -68,7 +69,7 @@
</div>
<div class="col-lg-4">
<div class="col-lg-4 col-md-4 col-sm-4">
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
<span class="patch_method"></span>
@@ -92,27 +93,33 @@
</div>
<div class="form-group">
<label>Date Of Birth</label>
<%= f.text_field :date_of_birth,:class=>"form-control datepicker"%>
<label>Date Of Birth</label>
<%= f.text_field :date_of_birth,:class=>"form-control datepicker"%>
</div>
<div class="form-group">
<label>Select Member Group</label>
<select class="selectpicker form-control col-md-12" name="member_group_id">
<option>Select Member Group</option>
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
<option value="<%= member.value %>">
<%= member.name %></option>
<%end %>
</select>
</div>
<div class="form-group">
<%= f.button :submit, "Submit",:class => 'btn btn-primary ', :id => 'submit_customer' %>
<!-- <%= f.button :submit, "Update",:class => 'btn btn-primary ', :disabled =>'', :id => 'update_customer' %> -->
</div>
<%end%>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<br>
<a href="<%= origami_root_path%>" class="btn btn-primary">
<i class="fa fa-arrow-left fa-lg"></i> Back
</a>
</div>
<div class="form-group">
<label>Select Member Group</label>
<select class="selectpicker form-control col-md-12" name="member_group_id">
<option>Select Member Group</option>
<% Lookup.where("lookup_type = ?", "member_group_type" ).each do |member| %>
<option value="<%= member.value %>">
<%= member.name %></option>
<%end %>
</select>
</div>
<div class="form-group">
<%= f.button :submit, "Submit",:class => 'btn btn-primary ', :id => 'submit_customer' %>
<!-- <%= f.button :submit, "Update",:class => 'btn btn-primary ', :disabled =>'', :id => 'update_customer' %> -->
</div>
<%end%>
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.2.0/jquery-confirm.min.css">
@@ -127,11 +134,11 @@
$('.datepicker').css('cursor','pointer');
});
$(document).on('click',".checkbox_check",function(){
if(this.checked){
$(document).on('click',".customer_tr",function(){
// if(this.checked){
var sale_id = $("#sale_id").val() || 0;
var customer_id = $(this).val();
var customer_id = $(this).attr('data-ref');
if(sale_id != 0){
// var url = "/"+customer_id;
@@ -170,9 +177,9 @@
//$(".edit_customer").attr('method', 'PATCH');
}
});
}else{
// }else{
}
// }
})
function update_sale(customer_id,sale_id) {
@@ -197,7 +204,7 @@
success: function(data) {
if(data.status == true)
{
alert('Customer has assigned');
window.location.href = '/origami'
}else{
alert('Record not found!');

View File

@@ -291,9 +291,7 @@
<p>Customer : <span id="customer_name"></span></p>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
<p>Amount : <span id="customer_amount"></span></p>
</div>
</div>
<div class="card-text">
<table class="table table-striped" id="order-items-table">
@@ -366,6 +364,9 @@
<td class="charges-name"><strong>Grand Total:</strong></td>
<td class="item-attr"><strong id="order-grand-total"><%=@selected_item.grand_total rescue 0%></strong></td>
</tr>
<tr class="rebate_amount">
</tr>
</table>
</div>
</div>

View File

@@ -0,0 +1,5 @@
if(@status)
json.status @status
else
json.status false
end

View File

@@ -0,0 +1,98 @@
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-3">
<div class="row">
<div class="col-md-6">
<h2>JCB</h2>
</div>
</div>
<div class="card" style="margin-top:10px;padding-top:20px;">
<div class="rebate-form">
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
</div>
<hr>
</div>
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
</div>
<hr>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
<div class="row">
<div class="col-lg-6 col-md-1 col-sm-1">
<div class="row bottom">
<div class=" cashier_number " data-value="1" data-type="num">1</div>
<div class=" cashier_number left" data-value="2" data-type="num">2</div>
<div class=" cashier_number left" data-value="3" data-type="num">3</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="4" data-type="num">4</div>
<div class=" cashier_number left" data-value="5" data-type="num">5</div>
<div class=" cashier_number left" data-value="6" data-type="num">6</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="7" data-type="num">7</div>
<div class=" cashier_number left" data-value="8" data-type="num">8</div>
<div class=" cashier_number left" data-value="9" data-type="num">9</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="0" data-type="num">0</div>
<div class=" cashier_number left" data-value="." data-type="num">.</div>
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
</div>
<div class="row bottom">
<div class=" cashier_number del_cashier_number" data-type="nett" disable>Nett</div>
<div class=" cashier_number red left" data-type="del">Del</div>
<div class=" cashier_number green left" data-type="clr">Clr</div>
</div>
</div>
<div class="col-lg-6 col-md-1 col-sm-1">
<div class="row bottom">
<div class="cashier_number long" data-value="1000" data-type="add">1000</div>
<div class="cashier_number long left" data-value="3000" data-type="add">3000</div>
</div>
<div class="row bottom">
<div class="cashier_number long" data-value="5000" data-type="add">5000</div>
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
</div>
<div class="row bottom">
<div class="pay purple" id="redeem">Pay</div>
</div>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
</div>
</div>
<script>
$('#mpu_pay').on('click',function(){
var amount = $('#amount').val();
var sale_id = "<%= @sale_id %>";
$.ajax({type: "POST",
url: "<%= origami_payment_mpu_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
alert("Payment success")
window.location.href = '/origami/sale/'+ sale_id + "/payment";
}
}
});
})
</script>

View File

@@ -0,0 +1,5 @@
if(@status)
json.status @status
else
json.status false
end

View File

@@ -0,0 +1,98 @@
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-3">
<div class="row">
<div class="col-md-6">
<h2>Master</h2>
</div>
</div>
<div class="card" style="margin-top:10px;padding-top:20px;">
<div class="rebate-form">
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="" data-value="<%=@sale_id %>" data-member-value="">
</div>
<hr>
</div>
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
</div>
<hr>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
<div class="row">
<div class="col-lg-6 col-md-1 col-sm-1">
<div class="row bottom">
<div class=" cashier_number " data-value="1" data-type="num">1</div>
<div class=" cashier_number left" data-value="2" data-type="num">2</div>
<div class=" cashier_number left" data-value="3" data-type="num">3</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="4" data-type="num">4</div>
<div class=" cashier_number left" data-value="5" data-type="num">5</div>
<div class=" cashier_number left" data-value="6" data-type="num">6</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="7" data-type="num">7</div>
<div class=" cashier_number left" data-value="8" data-type="num">8</div>
<div class=" cashier_number left" data-value="9" data-type="num">9</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="0" data-type="num">0</div>
<div class=" cashier_number left" data-value="." data-type="num">.</div>
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
</div>
<div class="row bottom">
<div class=" cashier_number del_cashier_number" data-type="nett" disable>Nett</div>
<div class=" cashier_number red left" data-type="del">Del</div>
<div class=" cashier_number green left" data-type="clr">Clr</div>
</div>
</div>
<div class="col-lg-6 col-md-1 col-sm-1">
<div class="row bottom">
<div class="cashier_number long" data-value="1000" data-type="add">1000</div>
<div class="cashier_number long left" data-value="3000" data-type="add">3000</div>
</div>
<div class="row bottom">
<div class="cashier_number long" data-value="5000" data-type="add">5000</div>
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
</div>
<div class="row bottom">
<div class="pay purple" id="redeem">Pay</div>
</div>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
</div>
</div>
<script>
$('#mpu_pay').on('click',function(){
var amount = $('#amount').val();
var sale_id = "<%= @sale_id %>";
$.ajax({type: "POST",
url: "<%= origami_payment_mpu_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
alert("Payment success")
window.location.href = '/origami/sale/'+ sale_id + "/payment";
}
}
});
})
</script>

View File

@@ -1,11 +1,83 @@
<h2> MPU </h2>
<div class="row">
Amount :
<div class="col-lg-5 col-md-5 col-sm-3">
<div class="row">
<div class="col-md-6">
<h2>MPU</h2>
</div>
</div>
<div class="card" style="margin-top:10px;padding-top:20px;">
<div class="rebate-form">
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="" data-value="<%=@sale_id %>" data-member-value="">
</div>
<hr>
</div>
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
</div>
<hr>
</div>
</div>
</div>
</div>
<input type="text" name="amount" id="amount" value=""/>
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
<button type="submit" id="mpu_pay" > PAY </button>
<div class="row">
<div class="col-lg-6 col-md-1 col-sm-1">
<div class="row bottom">
<div class=" cashier_number " data-value="1" data-type="num">1</div>
<div class=" cashier_number left" data-value="2" data-type="num">2</div>
<div class=" cashier_number left" data-value="3" data-type="num">3</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="4" data-type="num">4</div>
<div class=" cashier_number left" data-value="5" data-type="num">5</div>
<div class=" cashier_number left" data-value="6" data-type="num">6</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="7" data-type="num">7</div>
<div class=" cashier_number left" data-value="8" data-type="num">8</div>
<div class=" cashier_number left" data-value="9" data-type="num">9</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="0" data-type="num">0</div>
<div class=" cashier_number left" data-value="." data-type="num">.</div>
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
</div>
<div class="row bottom">
<div class=" cashier_number del_cashier_number" data-type="nett" disable>Nett</div>
<div class=" cashier_number red left" data-type="del">Del</div>
<div class=" cashier_number green left" data-type="clr">Clr</div>
</div>
</div>
<div class="col-lg-6 col-md-1 col-sm-1">
<div class="row bottom">
<div class="cashier_number long" data-value="1000" data-type="add">1000</div>
<div class="cashier_number long left" data-value="3000" data-type="add">3000</div>
</div>
<div class="row bottom">
<div class="cashier_number long" data-value="5000" data-type="add">5000</div>
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
</div>
<div class="row bottom">
<div class="pay purple" id="redeem">Pay</div>
</div>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
</div>
</div>
<script>
$('#mpu_pay').on('click',function(){

View File

@@ -6,8 +6,8 @@
<div id="order-title">
<table>
<tr>
<td style="width:55%;"><strong>Receipt No : <%=@sale_data.receipt_no rescue ' '%></strong></td>
<td style="width:45%;"><strong>Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></strong></td>
<td style="width:50%;"><strong>Receipt No : <%=@sale_data.receipt_no rescue ' '%></strong></td>
<td style="width:50%;"><strong>Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></strong></td>
</tr>
<tr>
<td><strong>Table No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></td>
@@ -15,7 +15,6 @@
</tr>
<tr>
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
<td><strong>Points :</strong> <%= @balance %> </td>
</tr>
</table>
</div>
@@ -70,6 +69,12 @@
<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 rescue 0%></span></strong></td>
</tr>
<%if @balance > 0%>
</tr>
<td style="width:80%; text-align:left; border-top:none"><strong><%= @accountable_type %></strong></td>
<td style="width:20%; text-align:right; border-top:none"><strong><span><%=@balance%></span></strong></td>
</tr>
<% end %>
</tfooter>
</table>
</div>
@@ -88,7 +93,7 @@
<hr>
<div class="row">
<div class="col-md-8">Cash</div>
<div class="col-md-4" id="cash" ><%= @cash %></div>
<div class="col-md-4" id="amount" ><%= @cash %></div>
</div>
<hr>
<div class="row" id="credit_payment">
@@ -162,6 +167,7 @@
$(document).ready(function(){
update_balance();
})
$(document).on('click', '.cashier_number', function(event){
if(event.handled !== true) {
var original_value;
@@ -187,7 +193,7 @@ $(document).on('click', '.cashier_number', function(event){
update_balance();
break;
case 'del' :
var cash=$('#cash').text();
var cash=$('#amount').text();
$('#cash').text(cash.substr(0,cash.length-1));
update_balance();
break;
@@ -253,6 +259,6 @@ function update_balance(){
var amount_due = $('#amount_due').text();
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card)
var result = amount_due - total
$('#balance').text(result);
$('#balance').text(result.toFixed(2));
}
</script>

View File

@@ -5,21 +5,24 @@
<div class="rebate-form">
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Valid Redeem Amount</label>
<label class="col-lg-4 col-md-4 col-sm-4">Valid Rebate Amount</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@membership_rebate_balance%>" data-value="<%=@sale_id %>" data-member-value="<%= @membership_id %>">
</div>
<hr>
</div>
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Used Amount</label>
<label class="col-lg-4 col-md-4 col-sm-4">Redeem Amount</label>
<div id="used_amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
</div>
<hr>
</div>
</div>
<p class="">You can rebate upto <span style="color:red;" id="food_prices"><%= @food_prices %></span></p>
</div>
<% if @payparcount > 0 %>
<p class="">Last time rebate amount is <%= @payparcount %></p>
<% end %>
<p class="">You can rebate upto <span style="color:red;" id="food_prices"><%= @food_prices %></span></p>
</div>
<div class="col-lg-7 col-md-7 col-sm-7">
@@ -73,51 +76,12 @@
</div>
<script type="text/javascript">
$(document).on('click', '.cashier_number', function(event){
event.stopPropagation();
event.preventDefault();
if(event.handled !== true) {
var original_value;
original_value = $('#used_amount').text();
var input_value = $(this).attr("data-value");
var input_type = $(this).attr("data-type");
switch (input_type) {
case 'num':
if (original_value == "0.0"){
$('#used_amount').text(input_value);
}else{
$('#used_amount').append(input_value);
}
break;
case 'add':
var input_value = $(this).attr("data-value");
amount = parseInt(input_value) + parseInt(original_value);
$('#used_amount').html(amount);
break;
case 'clr':
$('#used_amount').html("0.0");
break;
case 'del' :
var cash=$('#used_amount').text();
$('#used_amount').text(cash.substr(0,cash.length-1));
break;
}
event.handled = true;
} else {
return false;
}
});
$("#redeem").click(function(){
valid_amount = $("#valid_amount").val();
sale_id = $("#valid_amount").attr('data-value');
membership_id = $("#valid_amount").attr('data-member-value');
redeem_amount = parseInt($("#used_amount").text());
redeem_amount = parseFloat($("#used_amount").text());
if(redeem_amount<=0 ){
alert("Please type valid amount");

View File

@@ -0,0 +1,5 @@
if(@status)
json.status @status
else
json.status false
end

View File

@@ -0,0 +1,98 @@
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-3">
<div class="row">
<div class="col-md-6">
<h2>VISA</h2>
</div>
</div>
<div class="card" style="margin-top:10px;padding-top:20px;">
<div class="rebate-form">
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="" data-value="<%=@sale_id %>" data-member-value="">
</div>
<hr>
</div>
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
</div>
<hr>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6" style="margin-top:75px;">
<div class="row">
<div class="col-lg-6 col-md-1 col-sm-1">
<div class="row bottom">
<div class=" cashier_number " data-value="1" data-type="num">1</div>
<div class=" cashier_number left" data-value="2" data-type="num">2</div>
<div class=" cashier_number left" data-value="3" data-type="num">3</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="4" data-type="num">4</div>
<div class=" cashier_number left" data-value="5" data-type="num">5</div>
<div class=" cashier_number left" data-value="6" data-type="num">6</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="7" data-type="num">7</div>
<div class=" cashier_number left" data-value="8" data-type="num">8</div>
<div class=" cashier_number left" data-value="9" data-type="num">9</div>
</div>
<div class="row bottom">
<div class=" cashier_number " data-value="0" data-type="num">0</div>
<div class=" cashier_number left" data-value="." data-type="num">.</div>
<div class=" cashier_number left" data-value="00" data-type="num">00</div>
</div>
<div class="row bottom">
<div class=" cashier_number del_cashier_number" data-type="nett" disable>Nett</div>
<div class=" cashier_number red left" data-type="del">Del</div>
<div class=" cashier_number green left" data-type="clr">Clr</div>
</div>
</div>
<div class="col-lg-6 col-md-1 col-sm-1">
<div class="row bottom">
<div class="cashier_number long" data-value="1000" data-type="add">1000</div>
<div class="cashier_number long left" data-value="3000" data-type="add">3000</div>
</div>
<div class="row bottom">
<div class="cashier_number long" data-value="5000" data-type="add">5000</div>
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
</div>
<div class="row bottom">
<div class="pay purple" id="redeem">Pay</div>
</div>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-lg btn-block"> Back </button>
</div>
</div>
<script>
$('#mpu_pay').on('click',function(){
var amount = $('#amount').val();
var sale_id = "<%= @sale_id %>";
$.ajax({type: "POST",
url: "<%= origami_payment_mpu_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
alert("Payment success")
window.location.href = '/origami/sale/'+ sale_id + "/payment";
}
}
});
})
</script>

View File

@@ -1,84 +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="<%= settings_sales_path %>">Sale</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="8">
<%= form_tag settings_sales_path, :method => :get do %>
<div class="input-append form-group pull-right">
<!-- <input data-behaviour='datepicker' class="datepicker col-md-3 form-control" name="date" id="date" type="text" placeholder="Search by date" style="margin-right: 10px"> -->
<input type="text" name="receipt_no" class="col-md-8 form-control" placeholder="Receipt No" style="margin-right: 10px">
<button type="submit" class="btn btn-primary btn">Search</button>
</div>
<% end %>
</td>
</tr>
<tr>
<th>Sale Id </th>
<th>Receipt no </th>
<th>Grand total</th>
<th>Tax amount</th>
<th>Cashier</th>
<th>Sales status</th>
<th>Receipt Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<% @sales.each do |sale| %>
<tr>
<td><%= sale.sale_id %></td>
<td><%= sale.receipt_no %></td>
<td><%= sale.grand_total rescue '-' %></td>
<td><%= sale.total_tax %></td>
<td><%= sale.cashier_name rescue '-' %></td>
<td> <%= sale.sale_status %> </td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
<td><%= link_to 'Show', settings_sale_path(sale) %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
});
</script>

View File

@@ -1,103 +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="<%= settings_sales_path %>">Sale</a>
</li>
<li class="active">
<a href="<%= settings_sales_path %>"><%= @sale.sale_id %></a>
</li>
</ol>
</div>
</div>
<hr>
<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>
<th>Receipt Date </th>
<th>Receipt no</th>
<th>Cashier</th>
<th>OSales 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>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>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>Grand Total</td>
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr><td>&nbsp;<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>
<a href="<%= settings_sales_path%>" class="btn btn-primary pull-left">
<i class="fa fa-arrow-left fa-xs"></i> Back
</a>
</div>
</div>
</div>
</div>

View File

@@ -3,7 +3,7 @@
<ol class="breadcrumb">
<li><a href="<%= crm_root_path %>">Home</a></li>
<li class="active">
<a href="<%= settings_orders_path %>">Order</a>
<a href="<%= transactions_orders_path %>">Order</a>
</li>
</ol>
@@ -19,7 +19,7 @@
<thead>
<tr>
<td colspan="6">
<%= form_tag settings_orders_path, :method => :get do %>
<%= form_tag transactions_orders_path, :method => :get do %>
<div class="input-append form-group pull-right">
<input type="text" name="filter" placeholder="Order ID" class="form-control input-sm col-md-8">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
@@ -48,7 +48,7 @@
<td><%= order.status %></td>
<td> <%= order.date.strftime("%d-%m-%Y") %> </td>
<td> <%= order.item_count %> </td>
<td><%= link_to 'Show', settings_order_path(order) %></td>
<td><%= link_to 'Show', transactions_order_path(order) %></td>
</tr>
<% end %>
</tbody>

View File

@@ -1,59 +1,84 @@
<p id="notice"><%= notice %></p>
<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>
</ol>
</div>
</div>
<h1>Transactions Sales</h1>
<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="8">
<%= form_tag transactions_sales_path, :method => :get do %>
<div class="input-append form-group pull-right col-md-6">
<!-- <input class="datepicker col-md-3 form-control" name="date" id="date" type="text" placeholder="Receipt date" style="margin-right: 10px"> -->
<input type="text" name="receipt_no" class="col-md-6 form-control" placeholder="Receipt No" style="margin-right: 10px">
<button type="submit" class="btn btn-primary btn">Search</button>
</div>
<% end %>
</td>
</tr>
<tr>
<th>Sale Id </th>
<th>Receipt no </th>
<th>Grand total</th>
<th>Tax amount</th>
<th>Cashier</th>
<th>Sales status</th>
<th>Receipt Date</th>
<th>Action</th>
</tr>
</thead>
<table>
<thead>
<tr>
<th>Cashier</th>
<th>Cashier name</th>
<th>Requested by</th>
<th>Requested at</th>
<th>Receipt no</th>
<th>Receipt date</th>
<th>Customer</th>
<th>Payment status</th>
<th>Sale status</th>
<th>Total amount</th>
<th>Total discount</th>
<th>Total tax</th>
<th>Tax type</th>
<th>Grand total</th>
<th>Rounding adjustment</th>
<th>Amount received</th>
<th>Amount changed</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @sales.each do |sale| %>
<tbody>
<% @transactions_sales.each do |transactions_sale| %>
<tr>
<td><%= transactions_sale.cashier %></td>
<td><%= transactions_sale.cashier_name %></td>
<td><%= transactions_sale.requested_by %></td>
<td><%= transactions_sale.requested_at %></td>
<td><%= transactions_sale.receipt_no %></td>
<td><%= transactions_sale.receipt_date %></td>
<td><%= transactions_sale.customer %></td>
<td><%= transactions_sale.payment_status %></td>
<td><%= transactions_sale.sale_status %></td>
<td><%= transactions_sale.total_amount %></td>
<td><%= transactions_sale.total_discount %></td>
<td><%= transactions_sale.total_tax %></td>
<td><%= transactions_sale.tax_type %></td>
<td><%= transactions_sale.grand_total %></td>
<td><%= transactions_sale.rounding_adjustment %></td>
<td><%= transactions_sale.amount_received %></td>
<td><%= transactions_sale.amount_changed %></td>
<td><%= link_to 'Show', transactions_sale %></td>
<td><%= link_to 'Edit', edit_transactions_sale_path(transactions_sale) %></td>
<td><%= link_to 'Destroy', transactions_sale, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<tr>
<td><%= sale.sale_id %></td>
<td><%= sale.receipt_no %></td>
<td><%= sale.grand_total rescue '-' %></td>
<td><%= sale.total_tax %></td>
<td><%= sale.cashier_name rescue '-' %></td>
<td> <%= sale.sale_status %> </td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
<td><%= link_to 'Show', transactions_sale_path(sale) %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
</div>
</div>
<br>
</div>
</div>
<script type="text/javascript">
$(function () {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
});
</script>
<%= link_to 'New Transactions Sale', new_transactions_sale_path %>

View File

@@ -0,0 +1,59 @@
<p id="notice"><%= notice %></p>
<h1>Transactions Sales</h1>
<table>
<thead>
<tr>
<th>Cashier</th>
<th>Cashier name</th>
<th>Requested by</th>
<th>Requested at</th>
<th>Receipt no</th>
<th>Receipt date</th>
<th>Customer</th>
<th>Payment status</th>
<th>Sale status</th>
<th>Total amount</th>
<th>Total discount</th>
<th>Total tax</th>
<th>Tax type</th>
<th>Grand total</th>
<th>Rounding adjustment</th>
<th>Amount received</th>
<th>Amount changed</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @transactions_sales.each do |transactions_sale| %>
<tr>
<td><%= transactions_sale.cashier %></td>
<td><%= transactions_sale.cashier_name %></td>
<td><%= transactions_sale.requested_by %></td>
<td><%= transactions_sale.requested_at %></td>
<td><%= transactions_sale.receipt_no %></td>
<td><%= transactions_sale.receipt_date %></td>
<td><%= transactions_sale.customer %></td>
<td><%= transactions_sale.payment_status %></td>
<td><%= transactions_sale.sale_status %></td>
<td><%= transactions_sale.total_amount %></td>
<td><%= transactions_sale.total_discount %></td>
<td><%= transactions_sale.total_tax %></td>
<td><%= transactions_sale.tax_type %></td>
<td><%= transactions_sale.grand_total %></td>
<td><%= transactions_sale.rounding_adjustment %></td>
<td><%= transactions_sale.amount_received %></td>
<td><%= transactions_sale.amount_changed %></td>
<td><%= link_to 'Show', transactions_sale %></td>
<td><%= link_to 'Edit', edit_transactions_sale_path(transactions_sale) %></td>
<td><%= link_to 'Destroy', transactions_sale, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Transactions Sale', new_transactions_sale_path %>

View File

@@ -1,89 +1,103 @@
<p id="notice"><%= notice %></p>
<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="<%= settings_sales_path %>">Sale</a>
</li>
<li class="active">
<a href="<%= settings_sales_path %>"><%= @sale.sale_id %></a>
</li>
</ol>
</div>
</div>
<hr>
<p>
<strong>Cashier:</strong>
<%= @transactions_sale.cashier %>
</p>
<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>
<th>Receipt Date </th>
<th>Receipt no</th>
<th>Cashier</th>
<th>OSales status</th>
<th>Receipt generated at</th>
</tr>
</thead>
<p>
<strong>Cashier name:</strong>
<%= @transactions_sale.cashier_name %>
</p>
<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| %>
<p>
<strong>Requested by:</strong>
<%= @transactions_sale.requested_by %>
</p>
<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>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>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>Grand Total</td>
<td colspan="2"><%= number_with_precision(@sale.grand_total, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr><td>&nbsp;<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>
<p>
<strong>Requested at:</strong>
<%= @transactions_sale.requested_at %>
</p>
</tbody>
</table>
<a href="<%= settings_sales_path%>" class="btn btn-primary pull-left">
<i class="fa fa-arrow-left fa-xs"></i> Back
</a>
</div>
</div>
<p>
<strong>Receipt no:</strong>
<%= @transactions_sale.receipt_no %>
</p>
</div>
</div>
<p>
<strong>Receipt date:</strong>
<%= @transactions_sale.receipt_date %>
</p>
<p>
<strong>Customer:</strong>
<%= @transactions_sale.customer %>
</p>
<p>
<strong>Payment status:</strong>
<%= @transactions_sale.payment_status %>
</p>
<p>
<strong>Sale status:</strong>
<%= @transactions_sale.sale_status %>
</p>
<p>
<strong>Total amount:</strong>
<%= @transactions_sale.total_amount %>
</p>
<p>
<strong>Total discount:</strong>
<%= @transactions_sale.total_discount %>
</p>
<p>
<strong>Total tax:</strong>
<%= @transactions_sale.total_tax %>
</p>
<p>
<strong>Tax type:</strong>
<%= @transactions_sale.tax_type %>
</p>
<p>
<strong>Grand total:</strong>
<%= @transactions_sale.grand_total %>
</p>
<p>
<strong>Rounding adjustment:</strong>
<%= @transactions_sale.rounding_adjustment %>
</p>
<p>
<strong>Amount received:</strong>
<%= @transactions_sale.amount_received %>
</p>
<p>
<strong>Amount changed:</strong>
<%= @transactions_sale.amount_changed %>
</p>
<%= link_to 'Edit', edit_transactions_sale_path(@transactions_sale) %> |
<%= link_to 'Back', transactions_sales_path %>

View File

@@ -0,0 +1,89 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Cashier:</strong>
<%= @transactions_sale.cashier %>
</p>
<p>
<strong>Cashier name:</strong>
<%= @transactions_sale.cashier_name %>
</p>
<p>
<strong>Requested by:</strong>
<%= @transactions_sale.requested_by %>
</p>
<p>
<strong>Requested at:</strong>
<%= @transactions_sale.requested_at %>
</p>
<p>
<strong>Receipt no:</strong>
<%= @transactions_sale.receipt_no %>
</p>
<p>
<strong>Receipt date:</strong>
<%= @transactions_sale.receipt_date %>
</p>
<p>
<strong>Customer:</strong>
<%= @transactions_sale.customer %>
</p>
<p>
<strong>Payment status:</strong>
<%= @transactions_sale.payment_status %>
</p>
<p>
<strong>Sale status:</strong>
<%= @transactions_sale.sale_status %>
</p>
<p>
<strong>Total amount:</strong>
<%= @transactions_sale.total_amount %>
</p>
<p>
<strong>Total discount:</strong>
<%= @transactions_sale.total_discount %>
</p>
<p>
<strong>Total tax:</strong>
<%= @transactions_sale.total_tax %>
</p>
<p>
<strong>Tax type:</strong>
<%= @transactions_sale.tax_type %>
</p>
<p>
<strong>Grand total:</strong>
<%= @transactions_sale.grand_total %>
</p>
<p>
<strong>Rounding adjustment:</strong>
<%= @transactions_sale.rounding_adjustment %>
</p>
<p>
<strong>Amount received:</strong>
<%= @transactions_sale.amount_received %>
</p>
<p>
<strong>Amount changed:</strong>
<%= @transactions_sale.amount_changed %>
</p>
<%= link_to 'Edit', edit_transactions_sale_path(@transactions_sale) %> |
<%= link_to 'Back', transactions_sales_path %>