function createJCPacking(json) {

	if (json['data'] != '') {
		// console.log("Process", json);
		let rows = json['data'].map((ob, index) => {
			let date = format_Date(ob.jc_created_date);

			let actionHtml = `<i class="fa fa-eye " title="View Job Card" aria-hidden="true" style="color:#4e73df ;right:16px" data-toggle="modal"data-target="#viewModal" onclick="viewJobCard('${ob.internal_order_id}')"></i>

		   <i class="fa fa-check-circle" aria-hidden="true" title="Accept" style="color:green;right:16px" onclick="acceptQC_3('${ob.internal_order_id}','${"#weight_input" + (index + 1)}','${"#weight_sunit" + (index + 1)}')"></i>
		   
           <i class="fa fa-ban" aria-hidden="true" title="Alter" style="color:red;" onclick="rejectbyqc1('${ob.internal_order_id}')" data-toggle="modal" data-target="#rejctModal"></i>`;
			let unit = json['unit'];
			// console.log(unit)
			let input = `<div class="input-group">
			<input type="text" class="form-control" id='weight_input${index + 1}'>
 			 <select class="form-control" id="weight_sunit${index + 1}" name="unit">`

			   	for (let i = 0; i < unit.length; i++) {
					input += `<option>${unit[i]['unit_name']}</option>`
			}
			input += `</select>
		</div>`
			let row = [(index + 1), ob.internal_order_id, date, ob.title, ob.quantity, ob.remark, input, actionHtml];
			return row;
		})
		// console.log(rows);
		table = $('#dataTable').DataTable();
		table.destroy();
		$('#dataTable').DataTable({
			data: rows,
		});
	}
}
// load job card views to job card table
load job card views to job card table
load job card views to job card table
function createJCPacking(json) {
	if (json['data'] != '') {
		let rows = json['data'].map((ob, index) => {
			let date = format_Date(ob.jc_created_date);
			let actionHtml = `<i class="fa fa-eye " title="View Job Card" aria-hidden="true" style="color:#4e73df ;right:16px" data-toggle="modal"data-target="#viewModal" onclick="viewJobCard('${ob.internal_order_id}')"></i>
		   <i class="fa fa-check-circle" aria-hidden="true" title="Accept" style="color:green;right:16px" onclick="acceptQC_3('${ob.internal_order_id}','${"#weight_input" + (index + 1)}','${"#weight_sunit" + (index + 1)}')"></i>
           <i class="fa fa-ban" aria-hidden="true" title="Alter" style="color:red;" onclick="rejectbyqc1('${ob.internal_order_id}')" data-toggle="modal" data-target="#rejctModal"></i>`;
			let unit = json['unit'];
			let input = `<div class="input-group">
			<input type="text" class="form-control" id='weight_input${index + 1}'>
 			 <select class="form-control" id="weight_sunit${index + 1}" name="unit">`
			   	for (let i = 0; i < unit.length; i++) {
					input += `<option>${unit[i]['unit_name']}</option>`
			}
			input += `</select>
		</div>`
			let row = [(index + 1), ob.internal_order_id, date, ob.title, ob.quantity, ob.remark, input, actionHtml];
			return row;
		})
		table = $('#dataTable').DataTable();
		table.destroy();
		$('#dataTable').DataTable({
			data: rows,
		});
	}
}
function createJCPacking ( json ) { if ( json [ 'data' ] != '' ) { let rows = json [ 'data' ] . map ( ( ob , index ) => { let date = format_Date ( ob . jc_created_date ) ; let actionHtml = ` ${ ob . internal_order_id } ${ ob . internal_order_id } ${ "#weight_input" + ( index + 1 ) } ${ "#weight_sunit" + ( index + 1 ) } ${ ob . internal_order_id } ` ; let unit = json [ 'unit' ] ; let input = ` ${ index + 1 } ${ index + 1 } ` for ( let i = 0 ; i < unit . length ; i ++ ) { input += ` ${ unit [ i ] [ 'unit_name' ] } ` } input += ` ` let row = [ ( index + 1 ) , ob . internal_order_id , date , ob . title , ob . quantity , ob . remark , input , actionHtml ] ; return row ; } ) table = $ ( '#dataTable' ) . DataTable ( ) ; table . destroy ( ) ; $ ( '#dataTable' ) . DataTable ( { data : rows , } ) ; } }
load job card views to job card table
load job card views to job card table
// console.log("Process", json); // console.log(unit) // console.log(rows);