check current balance for rebate member & change firstbill fun:
This commit is contained in:
@@ -15,6 +15,45 @@
|
|||||||
//= require BSBMaterial/demo.js
|
//= require BSBMaterial/demo.js
|
||||||
//= require custom.js
|
//= require custom.js
|
||||||
|
|
||||||
|
/* start check first bill or not funs: */
|
||||||
|
function checkReceiptNoInFirstBillData(receipt_no) {
|
||||||
|
var status = false;
|
||||||
|
if((receipt_no!=undefined) && (receipt_no!="")){
|
||||||
|
var arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
||||||
|
if((arr_data!=undefined) && (arr_data!=null)){
|
||||||
|
var json_data = arr_data.filter(function(e) { return e.receipt_no !== receipt_no });
|
||||||
|
if((arr_data.length) > (json_data.length)){
|
||||||
|
status = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createReceiptNoInFirstBillData(receipt_no) {
|
||||||
|
var arr_data = [];
|
||||||
|
var json_data = [];
|
||||||
|
var receipt_lists = localStorage.getItem("receipt_lists");
|
||||||
|
if((receipt_lists!=undefined) && (receipt_lists!=null) && (receipt_lists!="")){
|
||||||
|
arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
||||||
|
json_data = arr_data.filter(function(e) { return e.receipt_no == receipt_no });
|
||||||
|
}
|
||||||
|
if(((arr_data.length == 0) && (json_data.length == 0)) || ((arr_data.length > 0) && (json_data.length == 0))){
|
||||||
|
arr_data.push({receipt_no});
|
||||||
|
localStorage.setItem("receipt_lists",JSON.stringify(arr_data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteReceiptNoInFirstBillData(receipt_no) {
|
||||||
|
var arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
||||||
|
if((arr_data!=undefined) && (arr_data!=null)){
|
||||||
|
var json_data = arr_data.filter(function(e) { return e.receipt_no !== receipt_no });
|
||||||
|
localStorage.setItem("receipt_lists",JSON.stringify(json_data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* end check first bill or not funs: */
|
||||||
|
|
||||||
$(document).on('turbolinks:load', function() {
|
$(document).on('turbolinks:load', function() {
|
||||||
$('.datetimepicker').bootstrapMaterialDatePicker({
|
$('.datetimepicker').bootstrapMaterialDatePicker({
|
||||||
format: 'DD-MM-YYYY - HH:mm',
|
format: 'DD-MM-YYYY - HH:mm',
|
||||||
@@ -143,42 +182,3 @@ $(document).on('turbolinks:load', function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/* start check first bill or not funs: */
|
|
||||||
function checkReceiptNoInFirstBillData(receipt_no) {
|
|
||||||
var status = false;
|
|
||||||
if((receipt_no!=undefined) && (receipt_no!="")){
|
|
||||||
var arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
|
||||||
if((arr_data!=undefined) && (arr_data!=null)){
|
|
||||||
var json_data = arr_data.filter(function(e) { return e.receipt_no !== receipt_no });
|
|
||||||
if((arr_data.length) > (json_data.length)){
|
|
||||||
status = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createReceiptNoInFirstBillData(receipt_no) {
|
|
||||||
var arr_data = [];
|
|
||||||
var json_data = [];
|
|
||||||
var receipt_lists = localStorage.getItem("receipt_lists");
|
|
||||||
if((receipt_lists!=undefined) && (receipt_lists!=null) && (receipt_lists!="")){
|
|
||||||
arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
|
||||||
json_data = arr_data.filter(function(e) { return e.receipt_no == receipt_no });
|
|
||||||
}
|
|
||||||
if(((arr_data.length == 0) && (json_data.length == 0)) || ((arr_data.length > 0) && (json_data.length == 0))){
|
|
||||||
arr_data.push({receipt_no});
|
|
||||||
localStorage.setItem("receipt_lists",JSON.stringify(arr_data));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteReceiptNoInFirstBillData(receipt_no) {
|
|
||||||
var arr_data = JSON.parse(localStorage.getItem("receipt_lists"));
|
|
||||||
if((arr_data!=undefined) && (arr_data!=null)){
|
|
||||||
var json_data = arr_data.filter(function(e) { return e.receipt_no !== receipt_no });
|
|
||||||
localStorage.setItem("receipt_lists",JSON.stringify(json_data));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* end check first bill or not funs: */
|
|
||||||
@@ -45,7 +45,8 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
rebate = MembershipSetting.find_by_rebate(1)
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
if customer.membership_id != nil && rebate
|
if customer.membership_id != nil && rebate
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
current_balance = SaleAudit.paymal_search(sale_id)
|
# current_balance = SaleAudit.paymal_search(sale_id)
|
||||||
|
current_balance = 0
|
||||||
end
|
end
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|||||||
Reference in New Issue
Block a user