credit payment for quick service

This commit is contained in:
phyusin
2018-07-11 18:32:09 +06:30
parent c67655d1f3
commit c4ab456176
23 changed files with 666 additions and 119 deletions

View File

@@ -229,7 +229,12 @@ $(document).on('turbolinks:load', function() {
$(document).on("click", ".credit_detail",function(){
var sale_id = $(this).attr("data-id");
window.location.href = "/origami/cashier/credit_sales/"+sale_id;
var cashier_type = $(this).attr("data-type");
if(cashier_type=='cashier'){
window.location.href = "/origami/cashier/credit_sales/"+sale_id;
}else{
window.location.href = "/origami/quick_service/credit_sales/"+sale_id;
}
});
});
@@ -523,7 +528,7 @@ function timeFormat(date){
return time;
}
function getCreditData(){
function getCreditData(cashier_type){
var filter = $("#filter").val();
var customer = $("#sel_customer").val();
@@ -535,11 +540,11 @@ function getCreditData(){
if((customer!=undefined) && (customer!=null) && (customer!="")){
customer_id = customer;
}
getCreditSales(receipt_no, customer_id);
getCreditSales(receipt_no, customer_id, cashier_type);
}
function getCreditSales(filter, customer){
$(".credit_items").hide();
function getCreditSales(filter, customer, cashier_type){
// $(".credit_items").hide();
$(".tbd_credit_lists").empty();
var html_credit_items = $("#html_credit_items").html();
var receipt_no = "";
@@ -554,7 +559,7 @@ function getCreditSales(filter, customer){
type: "POST",
data: {receipt_no: receipt_no, customer_id: customer_id},
dataType: 'json',
url: "/origami/cashier/credit_sales",
url: "/origami/"+cashier_type+"/credit_sales",
success: function(data){
// console.log(data);
if(data.status){
@@ -572,7 +577,8 @@ function getCreditSales(filter, customer){
'receipt_no':credit_sales[i].receipt_no,
'cashier_name':credit_sales[i].cashier_name,
'customer_name':credit_sales[i].customer_name,
'credit_amount':credit_sales[i].payment_amount
'credit_amount':credit_sales[i].payment_amount,
'cashier_type':cashier_type
}));
}
}