change fun:
This commit is contained in:
@@ -15,45 +15,6 @@
|
||||
//= require BSBMaterial/demo.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() {
|
||||
$('.datetimepicker').bootstrapMaterialDatePicker({
|
||||
format: 'DD-MM-YYYY - HH:mm',
|
||||
@@ -182,3 +143,42 @@ $(document).on('turbolinks:load', function() {
|
||||
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: */
|
||||
Reference in New Issue
Block a user