mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/ARCHIVED-IZYIM.git
synced 2026-08-19 04:14:01 +00:00
partially added validation for qty
This commit is contained in:
+2
-1
@@ -1,2 +1,3 @@
|
||||
.htaccess
|
||||
**/logs
|
||||
**/logs
|
||||
/includes/vendor
|
||||
@@ -188,7 +188,7 @@ var FormWizard = function () {
|
||||
$("#finish").hide();
|
||||
$("#wait").show();
|
||||
$("#suksesupdate").hide();
|
||||
$("#gagalupdate").hide();
|
||||
$("#gagalupdate").hide();
|
||||
},
|
||||
complete: function(e, xhr, settings){
|
||||
if(e.status === 200){
|
||||
@@ -209,6 +209,21 @@ var FormWizard = function () {
|
||||
});
|
||||
}).hide();
|
||||
$('#decision_request .submit').click(function () {
|
||||
|
||||
// check if item is empty
|
||||
var rowCount = $('#shipping_order_items tr').length;
|
||||
if ($(".dataTables_empty")[0]){
|
||||
alert("There is no order item, please contact importer");
|
||||
//return false;
|
||||
}
|
||||
|
||||
// check if all field in item is empty
|
||||
for (let i = 1; i < rowCount+1; i++)
|
||||
{
|
||||
if($('.warehouse_arrangement_items_' + i).val() == ''){
|
||||
alert('please input quantity');
|
||||
}
|
||||
}
|
||||
var dataString = $('#submit_form').serialize() + '&' + $('#decision_request').serialize() + '&type=decision_request';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -227,13 +242,13 @@ var FormWizard = function () {
|
||||
$("#wait").hide();
|
||||
$("#suksesupdate").show();
|
||||
//$("#gagalupdate").hide();
|
||||
location.reload();
|
||||
//location.reload();
|
||||
}else{
|
||||
$("#finish").show();
|
||||
$("#wait").hide();
|
||||
//$("#suksesupdate").show();
|
||||
$("#gagalupdate").show();
|
||||
location.reload();
|
||||
//location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,6 +263,22 @@ var FormWizard = function () {
|
||||
jQuery("#form_decision_reject").modal('show');
|
||||
});
|
||||
$('#decision_reject .submit').click(function () {
|
||||
// check if item is empty
|
||||
var rowCount = $('#shipping_order_items tr').length;
|
||||
if ($(".dataTables_empty")[0]){
|
||||
alert("There is no order item, please contact importer");
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if all field in item is empty
|
||||
for (let i = 1; i < rowCount+1; i++)
|
||||
{
|
||||
if($('#warehouse_arrangement_items[1][actual_weight_ctn]').val() == ''){
|
||||
alert('please input quantity');
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
var dataString = $('#submit_form').serialize() + '&' + $('#decision_reject').serialize() + '&type=decision_reject';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -258,7 +289,7 @@ var FormWizard = function () {
|
||||
$("#finish").hide();
|
||||
$("#wait").show();
|
||||
$("#suksesupdate").hide();
|
||||
$("#gagalupdate").hide();
|
||||
$("#gagalupdate").hide();
|
||||
},
|
||||
complete: function(e, xhr, settings){
|
||||
if(e.status === 200){
|
||||
@@ -433,26 +464,13 @@ jQuery(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
//var x = document.getElementById("shipping_order_items").rows.length;
|
||||
//var count = $(shipping_order_items).children('tbody').children('tr').children('td').length;
|
||||
var rowCount = $('#shipping_order_items tr').length;
|
||||
for (let index = 0; index < rowCount; index++)
|
||||
{
|
||||
if ($(".dataTables_empty")[0]){
|
||||
alert("You need to enter atleast one item to proceed!");
|
||||
//return false;
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/warehouse-arrangements/getSOItems",
|
||||
data: dataStringg,
|
||||
success: function(data) {
|
||||
$("#tbody").html(data);}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/warehouse-arrangements/getSOItems",
|
||||
data: dataStringg,
|
||||
success: function(data) {
|
||||
$("#tbody").html(data);}
|
||||
});
|
||||
});
|
||||
});
|
||||
jQuery('body').on('change','input.warehouse_arrangement_items',function(e){
|
||||
|
||||
@@ -92,11 +92,11 @@ function the_warehouse_arrangement(){
|
||||
."<td>". $count. "</td>"
|
||||
."<td>". $shipping_order_item['description']. "</td>"
|
||||
."<td>". $shipping_order_item['packaging_quantity']. "</td>"
|
||||
."<td><input name='warehouse_arrangement_items[".$count."][actual_ctn]' id='warehouse_arrangement_items[".$count."][actual_ctn]' class='form-control input-sm warehouse_arrangement_items ctn ' required /></td>"
|
||||
."<td><input name='warehouse_arrangement_items[".$count."][actual_ctn]' id='warehouse_arrangement_items[".$count."][actual_ctn]' class='form-control input-sm warehouse_arrangement_items_".$count." ctn ' required /></td>"
|
||||
."<td>". $shipping_order_item['packaging_height']. " x ". $shipping_order_item['packaging_width']. " x ". $shipping_order_item['packaging_depth']. "</td>"
|
||||
."<td><input placeholder='Height' name='warehouse_arrangement_items[".$count."][actual_height_ctn]' id='warehouse_arrangement_items[".$count."][actual_height_ctn]' class='form-control input-sm warehouse_arrangement_items height' required /> x <input placeholder='Width' name='warehouse_arrangement_items[".$count."][actual_width_ctn]' id='warehouse_arrangement_items[".$count."][actual_width_ctn]' class='form-control input-sm warehouse_arrangement_items width' required/> x <input placeholder='Depth' name='warehouse_arrangement_items[".$count."][actual_depth_ctn]' id='warehouse_arrangement_items[".$count."][actual_depth_ctn]' class='form-control input-sm warehouse_arrangement_items depth' required/></td>"
|
||||
."<td>". $shipping_order_item['packaging_nett']. "</td>"
|
||||
."<td><input name='warehouse_arrangement_items[".$count."][actual_weight_ctn]' id='warehouse_arrangement_items[".$count."][actual_weight_ctn]' class='form-control input-sm warehouse_arrangement_items weight' /></td>"
|
||||
."<td><input type='number' name='warehouse_arrangement_items[".$count."][actual_weight_ctn]' id='warehouse_arrangement_items[".$count."][actual_weight_ctn]' class='form-control input-sm warehouse_arrangement_items weight' /></td>"
|
||||
."<td>".getItemBalance($shipping_order_item['id'], $so_id)."</td>"
|
||||
."<td></td>"
|
||||
."<td><label class='mt-checkbox mt-checkbox-single mt-checkbox-outline'><input name='warehouse_arrangement_items[".$count."][isDamaged]' id='warehouse_arrangement_items[".$count."][isDamaged]' type='checkbox' class='checkboxes' onchange='toggleCheckbox(this)' value='1'><span></span></label></td>"
|
||||
|
||||
Reference in New Issue
Block a user