fixed for reprint and query
This commit is contained in:
@@ -196,7 +196,7 @@ $(document).on('turbolinks:load', function() {
|
|||||||
|
|
||||||
$(document).on('click', '.access_modal', function(event){
|
$(document).on('click', '.access_modal', function(event){
|
||||||
type = $(this).data("type");
|
type = $(this).data("type");
|
||||||
$(".ok").attr("data-action",type)
|
$(".ok").attr("data-action",type);
|
||||||
$('#AccessCodeModal').modal('show');
|
$('#AccessCodeModal').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class HomeController < ApplicationController
|
|||||||
|
|
||||||
if !@total_payment_methods.nil?
|
if !@total_payment_methods.nil?
|
||||||
@total_payment_methods.each do |payment|
|
@total_payment_methods.each do |payment|
|
||||||
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay" || payment.payment_method == "paymal" || payment.payment_method == "dinga" || payment.payment_method == "JunctionPay"
|
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay"
|
||||||
pay = Sale.payment_sale('card', today, current_user,@from,@to,@from_time,@to_time)
|
pay = Sale.payment_sale('card', today, current_user,@from,@to,@from_time,@to_time)
|
||||||
@sale_data.push({'card' => pay.payment_amount})
|
@sale_data.push({'card' => pay.payment_amount})
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -18,16 +18,16 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
# .sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)')
|
# .sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)')
|
||||||
# @inventories = StockJournal.inventory_balances(today).sum(:balance)
|
# @inventories = StockJournal.inventory_balances(today).sum(:balance)
|
||||||
|
|
||||||
@total_sale = Sale.total_sale(today,current_user)
|
# @total_sale = Sale.total_sale(today,current_user)
|
||||||
@total_count = Sale.total_count(today,current_user)
|
# @total_count = Sale.total_count(today,current_user)
|
||||||
@total_card = Sale.total_card_sale(today,current_user)
|
# @total_card = Sale.total_card_sale(today,current_user)
|
||||||
@total_credit = Sale.credit_payment(today,current_user)
|
# @total_credit = Sale.credit_payment(today,current_user)
|
||||||
|
|
||||||
@sale_data = Array.new
|
@sale_data = Array.new
|
||||||
@total_payment_methods = Sale.total_payment_methods(today,current_user)
|
@total_payment_methods = Sale.total_payment_methods(today,current_user)
|
||||||
if !@total_payment_methods.nil?
|
if !@total_payment_methods.nil?
|
||||||
@total_payment_methods.each do |payment|
|
@total_payment_methods.each do |payment|
|
||||||
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb"
|
if payment.payment_method == "mpu" || payment.payment_method == "visa" || payment.payment_method == "master" || payment.payment_method == "jcb" || payment.payment_method == "unionpay" || payment.payment_method == "alipay"
|
||||||
pay = Sale.payment_sale('card', today, current_user)
|
pay = Sale.payment_sale('card', today, current_user)
|
||||||
@sale_data.push({'card' => pay.payment_amount})
|
@sale_data.push({'card' => pay.payment_amount})
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
var payment_method = "";
|
var payment_method = "";
|
||||||
$('.payment-type').on('click',function(){
|
$('.payment-type').on('click',function(){
|
||||||
$('.payment-type').css("background-color","#7a62d3")
|
$('.payment-type').css("background-color","#7a62d3");
|
||||||
$(this).css("background-color","green");
|
$(this).css("background-color","green");
|
||||||
var type = $(this).attr('data-id')
|
var type = $(this).attr('data-id')
|
||||||
if(type == 'cash'){
|
if(type == 'cash'){
|
||||||
|
|||||||
@@ -324,15 +324,14 @@ $(document).ready(function(){
|
|||||||
swal("Opps","You are not authorized for void","warning")
|
swal("Opps","You are not authorized for void","warning")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('click', '.access_modal', function(event){
|
$(document).on('click', '.access_modal', function(event){
|
||||||
type = $(this).data("type");
|
type = $(this).data("type");
|
||||||
$(".ok").attr("data-action",type)
|
$(".ok").attr("data-action",type);
|
||||||
$('#AccessCodeModal').modal('show');
|
$('#AccessCodeModal').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
function check_emp_access_code(access_code,type) {
|
function check_emp_access_code(access_code,type) {
|
||||||
var url = "/origami/check_emp_access_code/" + access_code ;
|
var url = "/origami/check_emp_access_code/" + access_code ;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ $('#back').on('click',function(){
|
|||||||
|
|
||||||
$(document).on('click', '.access_modal', function(event){
|
$(document).on('click', '.access_modal', function(event){
|
||||||
type = $(this).data("type");
|
type = $(this).data("type");
|
||||||
$(".ok").attr("data-action",type)
|
$(".ok").attr("data-action",type);
|
||||||
$('#AccessCodeModal').modal('show');
|
$('#AccessCodeModal').modal('show');
|
||||||
});
|
});
|
||||||
$('#void').on('click', function () {
|
$('#void').on('click', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user