mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/ARCHIVED-IZYIM.git
synced 2026-08-19 04:14:01 +00:00
tried to fix the minimum item no. issue on warehouse receive note
This commit is contained in:
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
||||
@@ -17,7 +17,7 @@ var FormWizard = function () {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var form = $('#submit_form');
|
||||
var error = $('.alert-danger', form);
|
||||
var success = $('.alert-success', form);
|
||||
@@ -54,27 +54,27 @@ var FormWizard = function () {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
messages: { // custom messages for radio buttons and checkboxes
|
||||
'so_id': {
|
||||
required: "Please select at least one option",
|
||||
},
|
||||
required: "Please select at least one option",
|
||||
},
|
||||
'consignment_note_no': {
|
||||
remote: "Consigment Note No. must be unique! Try another."
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
'warehouse_receive_note_no': {
|
||||
remote: "Warehouse Receive Note No. must be unique! Try another."
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
errorPlacement: function (error, element) { // render error placement for each input type
|
||||
error.insertAfter(element); // for other inputs, just perform default behavior
|
||||
error.insertAfter(element); // for other inputs, just perform default behavior
|
||||
},
|
||||
|
||||
invalidHandler: function (event, validator) { //display error alert on form submit
|
||||
invalidHandler: function (event, validator) { //display error alert on form submit
|
||||
success.hide();
|
||||
error.show();
|
||||
App.scrollTo(error, -200);
|
||||
@@ -93,7 +93,7 @@ var FormWizard = function () {
|
||||
success: function (label) {
|
||||
label
|
||||
.addClass('valid') // mark the current input as valid and display OK icon
|
||||
.closest('.form-group').removeClass('has-error').addClass('has-success'); // set success class to the control group
|
||||
.closest('.form-group').removeClass('has-error').addClass('has-success'); // set success class to the control group
|
||||
},
|
||||
|
||||
submitHandler: function (form) {
|
||||
@@ -121,10 +121,10 @@ var FormWizard = function () {
|
||||
|
||||
if (current >= total) {
|
||||
$('#form_wizard_1').find('.button-next').hide();
|
||||
$('#form_wizard_1').find('.button-submit').show();
|
||||
$('#form_wizard_1').find('.button-submit').show();
|
||||
|
||||
$('#form_wizard_1').find('.button-decision-request').show();
|
||||
$('#form_wizard_1').find('.button-decision-reject').show();
|
||||
$('#form_wizard_1').find('.button-decision-reject').show();
|
||||
} else {
|
||||
$('#form_wizard_1').find('.button-next').show();
|
||||
$('#form_wizard_1').find('.button-submit').hide();
|
||||
@@ -140,13 +140,13 @@ var FormWizard = function () {
|
||||
'previousSelector': '.button-previous',
|
||||
onTabClick: function (tab, navigation, index, clickedIndex) {
|
||||
return false;
|
||||
|
||||
|
||||
success.hide();
|
||||
error.hide();
|
||||
if (form.valid() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
handleTitle(tab, navigation, clickedIndex);
|
||||
},
|
||||
onNext: function (tab, navigation, index) {
|
||||
@@ -176,7 +176,7 @@ var FormWizard = function () {
|
||||
});
|
||||
|
||||
$('#form_wizard_1').find('.button-previous').hide();
|
||||
|
||||
|
||||
$('#form_wizard_1 .button-submit').click(function () {
|
||||
var dataString = $('#submit_form').serialize() + '&submit_type=no_decision_request';
|
||||
$.ajax({
|
||||
@@ -184,7 +184,7 @@ var FormWizard = function () {
|
||||
url: "/warehouse-arrangements/add-warehouse-arrangements",
|
||||
data: dataString,
|
||||
cache: false,
|
||||
beforeSend: function(){
|
||||
beforeSend: function(){
|
||||
$("#finish").hide();
|
||||
$("#wait").show();
|
||||
$("#suksesupdate").hide();
|
||||
@@ -205,7 +205,7 @@ var FormWizard = function () {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}).hide();
|
||||
$('#decision_request .submit').click(function () {
|
||||
@@ -215,7 +215,7 @@ var FormWizard = function () {
|
||||
url: "/warehouse-arrangements/add-warehouse-arrangements",
|
||||
data: dataString,
|
||||
cache: false,
|
||||
beforeSend: function(){
|
||||
beforeSend: function(){
|
||||
$("#finish").hide();
|
||||
$("#wait").show();
|
||||
$("#suksesupdate").hide();
|
||||
@@ -236,16 +236,16 @@ var FormWizard = function () {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}).hide();
|
||||
$('#form_wizard_1 .button-decision-request').click(function () {
|
||||
jQuery("#form_add").modal('hide');
|
||||
jQuery("#form_decision_request").modal('show');
|
||||
jQuery("#form_decision_request").modal('show');
|
||||
});
|
||||
$('#form_wizard_1 .button-decision-reject').click(function () {
|
||||
jQuery("#form_add").modal('hide');
|
||||
jQuery("#form_decision_reject").modal('show');
|
||||
jQuery("#form_decision_reject").modal('show');
|
||||
});
|
||||
$('#decision_reject .submit').click(function () {
|
||||
var dataString = $('#submit_form').serialize() + '&' + $('#decision_reject').serialize() + '&type=decision_reject';
|
||||
@@ -254,7 +254,7 @@ var FormWizard = function () {
|
||||
url: "/warehouse-arrangements/add-warehouse-arrangements",
|
||||
data: dataString,
|
||||
cache: false,
|
||||
beforeSend: function(){
|
||||
beforeSend: function(){
|
||||
$("#finish").hide();
|
||||
$("#wait").show();
|
||||
$("#suksesupdate").hide();
|
||||
@@ -275,7 +275,7 @@ var FormWizard = function () {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}).hide();
|
||||
|
||||
@@ -293,7 +293,7 @@ var FormRepeater = function () {
|
||||
$('.mt-repeater').each(function(){
|
||||
$(this).repeater({
|
||||
show: function () {
|
||||
$(this).slideDown();
|
||||
$(this).slideDown();
|
||||
},
|
||||
|
||||
hide: function (deleteElement) {
|
||||
@@ -326,7 +326,7 @@ var ComponentsDateTimePickers = function() {
|
||||
$("#submit_form .date-picker").datepicker("place")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
t()
|
||||
@@ -343,7 +343,7 @@ var ComponentsDateTimePickers = function() {
|
||||
},
|
||||
"columnDefs": [
|
||||
{ className: "dt-body-center", "targets": [ 0,1,2,3,4,5,6,7,8,9 ] },
|
||||
|
||||
|
||||
],
|
||||
"language": {
|
||||
"aria": {
|
||||
@@ -367,9 +367,9 @@ var ComponentsDateTimePickers = function() {
|
||||
"order": [
|
||||
[ 0, 'asc' ]
|
||||
],
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
var tableWrapper = jQuery('#warehouse-arrangements_wrapper');
|
||||
$('.search-input-text').on( 'keyup click change', function () { // for text boxes
|
||||
var i =$(this).attr('data-column'); // getting column index
|
||||
@@ -377,8 +377,8 @@ var ComponentsDateTimePickers = function() {
|
||||
oTable.columns(i).search(v).draw();
|
||||
} );
|
||||
$('.search-input-select').on( 'change', function () { // for select box
|
||||
var i =$(this).attr('data-column');
|
||||
var v =$(this).val();
|
||||
var i =$(this).attr('data-column');
|
||||
var v =$(this).val();
|
||||
oTable.columns(i).search(v).draw();
|
||||
} );
|
||||
$('.filter-cancel').on( 'click', function () { // for select box
|
||||
@@ -386,25 +386,25 @@ var ComponentsDateTimePickers = function() {
|
||||
$('.search-input-select').val('');
|
||||
$('.search-input-text').trigger('change');
|
||||
$('.search-input-select').trigger('change');
|
||||
|
||||
|
||||
oTable.draw();
|
||||
} );
|
||||
$("#warehouse-arrangements_filter").css("display","none");
|
||||
$("#warehouse-arrangements_filter").css("display","none");
|
||||
$('#sample_3_tools > li > a.tool-action').on('click', function() {
|
||||
var action = $(this).attr('data-action');
|
||||
oTable.DataTable().button(action).trigger();
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
|
||||
loadData(1);
|
||||
FormWizard.init();
|
||||
FormRepeater.init();
|
||||
ComponentsDateTimePickers.init()
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on("click", ".details", function() {
|
||||
var so_id = $(this).data('id');
|
||||
var dataStringg = 'so_id=' + so_id;
|
||||
@@ -419,53 +419,66 @@ jQuery(document).ready(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#so_id").change(function() {
|
||||
var so_id = $("#so_id").val();
|
||||
var dataStringg = 'so_id='+so_id;
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/warehouse-arrangements/getSOWarehouse",
|
||||
data: dataStringg,
|
||||
data: dataStringg,
|
||||
success: function(data) {
|
||||
$("#warehouse").html(data);
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/warehouse-arrangements/getSOItems",
|
||||
data: dataStringg,
|
||||
success: function(data) {
|
||||
$("#tbody").html(data);
|
||||
|
||||
//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);}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
jQuery('body').on('change','input.warehouse_arrangement_items',function(e){
|
||||
if($(this).closest('tr').find("input[name*='actual_height_ctn']").val()){
|
||||
$(this).closest('tr').find("input[name*='actual_height_ctn']").val(parseFloat($(this).closest('tr').find("input[name*='actual_height_ctn']").val()).toFixed(2));
|
||||
}
|
||||
|
||||
|
||||
if($(this).closest('tr').find("input[name*='actual_width_ctn']").val()){
|
||||
$(this).closest('tr').find("input[name*='actual_width_ctn']").val(parseFloat($(this).closest('tr').find("input[name*='actual_width_ctn']").val()).toFixed(2));
|
||||
}
|
||||
|
||||
|
||||
if($(this).closest('tr').find("input[name*='actual_depth_ctn']").val()){
|
||||
$(this).closest('tr').find("input[name*='actual_depth_ctn']").val(parseFloat($(this).closest('tr').find("input[name*='actual_depth_ctn']").val()).toFixed(2));
|
||||
}
|
||||
|
||||
|
||||
if($(this).closest('tr').find("input[name*='actual_weight_ctn']").val()){
|
||||
$(this).closest('tr').find("input[name*='actual_weight_ctn']").val(parseFloat($(this).closest('tr').find("input[name*='actual_weight_ctn']").val()).toFixed(2));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var actual_ctn = $(this).closest('tr').find("td:eq(2)").text();
|
||||
var current_ctn = $(this).closest('tr').find("input[name*='actual_ctn']").val();
|
||||
var current_balance = $(this).closest('tr').find("input[name*='balance']").val();
|
||||
var balance = current_balance - current_ctn;
|
||||
|
||||
if( balance == 0 ){
|
||||
|
||||
if( balance == 0 ){
|
||||
var changetdtext = $(this).closest('tr').find("td:eq(8)").html(balance);
|
||||
var changetdtext = $(this).closest('tr').find("td:eq(9)").html("<span class='font-green-meadow'>Matched</span>");
|
||||
$(this).closest('tr').find("input[name*='status']").val("0");
|
||||
@@ -482,6 +495,6 @@ function PreviewImage(cc) {
|
||||
oFReader.onload = function (oFREvent) {
|
||||
document.getElementById("uploadPreview["+cc+"]").src = oFREvent.target.result;
|
||||
document.getElementById("warehouse_arrangement_items["+cc+"][image]").value = oFREvent.target.result;
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
@@ -96,7 +96,7 @@ var TableDatatablesEditable = function() {
|
||||
document.getElementById("uploadPreview4").src = "http://www.placehold.it/200/EFEFEF/AAAAAA&text=no+image";
|
||||
|
||||
$('.button-previous2').trigger('click');
|
||||
|
||||
|
||||
$('#finish2').remove();
|
||||
$('.button-next2').after(' <a class="btn green button-submit2" id="finish2" style="display: inline-block;"> Finish!</a>'); //add input box
|
||||
$('#finish2').hide();
|
||||
@@ -171,7 +171,7 @@ var TableDatatablesEditable = function() {
|
||||
},
|
||||
packaging_quantity: {
|
||||
required: true,
|
||||
|
||||
|
||||
},
|
||||
messages: {
|
||||
description: {
|
||||
@@ -180,14 +180,14 @@ var TableDatatablesEditable = function() {
|
||||
packaging_quantity: {
|
||||
required: "You must choose package quantity to proceed",
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
errorPlacement: function(error, element) { // render error placement for each input type
|
||||
error.insertAfter(element); // for other inputs, just perform default behavior
|
||||
},
|
||||
|
||||
invalidHandler: function(event, validator) { //display error alert on form submit
|
||||
invalidHandler: function(event, validator) { //display error alert on form submit
|
||||
success.hide();
|
||||
error.show();
|
||||
App.scrollTo(error, -200);
|
||||
@@ -216,11 +216,11 @@ var TableDatatablesEditable = function() {
|
||||
});
|
||||
success.hide();
|
||||
error.hide();
|
||||
|
||||
|
||||
if (form.valid() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//add new row
|
||||
t.row.add([
|
||||
counter,
|
||||
@@ -444,7 +444,7 @@ function PreviewImage2() {
|
||||
var oFReader = new FileReader();
|
||||
var mime = document.getElementById("image2").files[0].type;
|
||||
oFReader.readAsDataURL(document.getElementById("image2").files[0]);
|
||||
|
||||
|
||||
if(mime == "image/jpeg" || mime == "image/gif" || mime == "image/png" || mime == "image/tiff" || mime == "image/x-windows-bmp" || mime == "image/bmp" || mime == "image/pjpeg" || mime == "image/x-jps"){
|
||||
oFReader.onload = function(oFREvent) {
|
||||
document.getElementById("uploadPreview2").src = oFREvent.target.result;
|
||||
@@ -454,7 +454,7 @@ function PreviewImage2() {
|
||||
alert("Only image files are allowed!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
function PreviewImage3() {
|
||||
@@ -570,7 +570,7 @@ var FormWizard = function() {
|
||||
error.insertAfter(element); // for other inputs, just perform default behavior
|
||||
},
|
||||
|
||||
invalidHandler: function(event, validator) { //display error alert on form submit
|
||||
invalidHandler: function(event, validator) { //display error alert on form submit
|
||||
success.hide();
|
||||
error.show();
|
||||
App.scrollTo(error, -200);
|
||||
@@ -640,7 +640,7 @@ var FormWizard = function() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (e.status === 403){
|
||||
$("#finish").show();
|
||||
$("#wait").hide();
|
||||
@@ -657,7 +657,7 @@ var FormWizard = function() {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -677,7 +677,7 @@ var FormWizard = function() {
|
||||
|
||||
if (current == 1) {
|
||||
$('#form_wizard_1').find('.button-previous').hide();
|
||||
|
||||
|
||||
} else {
|
||||
$('#form_wizard_1').find('.button-previous').show();
|
||||
}
|
||||
@@ -854,7 +854,7 @@ jQuery(document).ready(function() {
|
||||
FormRepeater.init();
|
||||
SweetAlert.init();
|
||||
|
||||
|
||||
|
||||
function loadData() {
|
||||
var oTable = $('#contact').DataTable({
|
||||
"serverSide": true,
|
||||
@@ -896,11 +896,11 @@ jQuery(document).ready(function() {
|
||||
var v = $(this).val();
|
||||
oTable.columns(i).search(v).draw();
|
||||
});
|
||||
|
||||
|
||||
$('#forwarder_id').on('change', function() {
|
||||
$('#stepy_form').find('select,input:not(#forwarder_id),button,a,textarea,.button-next').prop( "disabled", false );
|
||||
});
|
||||
|
||||
|
||||
$('.filter-cancel').on('click', function() { // for select box
|
||||
$('.search-input-text').val('');
|
||||
$('.search-input-select').val('');
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Time : 12:18:45
|
||||
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc LIMIT 0 ,10' at line 1
|
||||
Raw SQL : SELECT * FROM warehouse_arrangements WHERE company_id = '13' ORDER BY asc LIMIT 0 ,10
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
global $hooks;
|
||||
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
$hooks->add_action('silex_action','the_warehouse_arrangement');
|
||||
$hooks->add_action('silex_action','the_warehouse_arrangement');
|
||||
function create_warehouse_arrangement_title(){
|
||||
echo "Warehouse Receive Note";
|
||||
}
|
||||
@@ -32,7 +32,7 @@ function create_warehouse_arrangement_js() {
|
||||
<script src="/assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
|
||||
<script src="/assets/modul-js/arrangements/warehouse-arrangement/create.js" type="text/javascript"></script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
function warehouse_arrangement_js() {
|
||||
?>
|
||||
<script src="/assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript"></script>
|
||||
@@ -48,14 +48,14 @@ function warehouse_arrangement_js() {
|
||||
<script src="/assets/global/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js" type="text/javascript"></script>
|
||||
<script src="/assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
|
||||
<script src="/assets/global/plugins/clockface/js/clockface.js" type="text/javascript"></script>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function the_warehouse_arrangement(){
|
||||
global $app;
|
||||
|
||||
$app->get('/warehouse-arrangements', function(){
|
||||
$app->get('/warehouse-arrangements', function(){
|
||||
global $hooks;
|
||||
global $app;
|
||||
$company_id = getCompany($_SESSION['user_id']);
|
||||
@@ -63,26 +63,26 @@ function the_warehouse_arrangement(){
|
||||
$hooks->add_action('global_css',"create_warehouse_arrangement_css");
|
||||
$hooks->add_action('global_js',"create_warehouse_arrangement_js");
|
||||
$hooks->add_action('the_title',"create_warehouse_arrangement_title");
|
||||
|
||||
|
||||
the_head();
|
||||
include 'warehouse.tpl.php';
|
||||
the_footer();
|
||||
|
||||
|
||||
|
||||
|
||||
return "";
|
||||
});
|
||||
});
|
||||
$app->post('/warehouse-arrangements/getSOWarehouse', function(Request $request) {
|
||||
global $db;
|
||||
$so_id = $request->get('so_id');
|
||||
|
||||
return getSOData($so_id, "warehouse_name");
|
||||
|
||||
|
||||
});
|
||||
$app->post('/warehouse-arrangements/getSOItems', function(Request $request) {
|
||||
|
||||
|
||||
});
|
||||
$app->post('/warehouse-arrangements/getSOItems', function(Request $request) {
|
||||
global $db;
|
||||
$so_id = $request->get('so_id');
|
||||
|
||||
|
||||
$db->bind("so_id", $so_id);
|
||||
$shipping_order_items = $db->query("SELECT * FROM shipping_order_items WHERE so_id = :so_id");
|
||||
$table = "";
|
||||
@@ -92,9 +92,9 @@ 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 ' /></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>". $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' /> 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' /> 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' /></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>".getItemBalance($shipping_order_item['id'], $so_id)."</td>"
|
||||
@@ -102,10 +102,10 @@ function the_warehouse_arrangement(){
|
||||
."<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>"
|
||||
."<td>
|
||||
<div class='fileinput fileinput-new' data-provides='fileinput'>
|
||||
<div class='fileinput-new thumbnail' style='width: 100px; height: auto;'>
|
||||
<img id='uploadPreview[".$count."]' src='".($shipping_order_item['image'] <> '' ? $shipping_order_item['image'] : "http://www.placehold.it/200/EFEFEF/AAAAAA&text=no+image") ."' alt='' />
|
||||
<div class='fileinput-new thumbnail' style='width: 100px; height: auto;'>
|
||||
<img id='uploadPreview[".$count."]' src='".($shipping_order_item['image'] <> '' ? $shipping_order_item['image'] : "http://www.placehold.it/200/EFEFEF/AAAAAA&text=no+image") ."' alt='' />
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<span class='btn default btn-file'>
|
||||
<span class='fileinput-new'> Select image </span>
|
||||
@@ -120,10 +120,10 @@ function the_warehouse_arrangement(){
|
||||
."</tr>";
|
||||
$count++;
|
||||
}
|
||||
|
||||
|
||||
return $table;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$app->post('/warehouse-arrangements/checkConsignmentNote', function(Request $request) {
|
||||
global $db;
|
||||
$company_id = $_SESSION['company_id'];
|
||||
@@ -139,7 +139,7 @@ function the_warehouse_arrangement(){
|
||||
echo $status;
|
||||
return '';
|
||||
});
|
||||
|
||||
|
||||
$app->post('/warehouse-arrangements/checkReceiveNote', function(Request $request) {
|
||||
global $db;
|
||||
$company_id = $_SESSION['company_id'];
|
||||
@@ -155,16 +155,16 @@ function the_warehouse_arrangement(){
|
||||
echo $status;
|
||||
return '';
|
||||
});
|
||||
|
||||
|
||||
$app->post('/warehouse-arrangements/list', function(Request $request) {
|
||||
$curpage = $request->get('page');
|
||||
include 'warehouse.list.php';
|
||||
return '';
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$app->post('/warehouse-arrangements/add-warehouse-arrangements', function (Request $request) {
|
||||
global $db;
|
||||
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$company_id = $_SESSION['company_id'];
|
||||
$so_id = $request->get('so_id');
|
||||
@@ -185,7 +185,7 @@ function the_warehouse_arrangement(){
|
||||
$status = "0";
|
||||
}
|
||||
$warehouse_arrangement_items = $request->get('warehouse_arrangement_items');
|
||||
|
||||
|
||||
$db->bind("user_id", $user_id);
|
||||
$db->bind("company_id", $company_id);
|
||||
$db->bind("so_id", $so_id);
|
||||
@@ -196,7 +196,7 @@ function the_warehouse_arrangement(){
|
||||
$db->bind("receiving_person", $receiving_person);
|
||||
$db->bind("remarks", $remarks);
|
||||
$db->bind("status", $status);
|
||||
|
||||
|
||||
$warehousearrangementsCreate = $db->query("INSERT INTO warehouse_arrangements (receive_on, transport_company_name, consignment_note_no, warehouse_receive_note_no, receiving_person, remarks, status, so_id, user_id, company_id) VALUES (:receive_on, :transport_company_name, :consignment_note_no, :warehouse_receive_note_no, :receiving_person, :remarks, :status, :so_id, :user_id, :company_id);");
|
||||
$warehouse_arrangement_id = $db->lastInsertId();
|
||||
$unmatch_count = 0;
|
||||
@@ -213,34 +213,34 @@ function the_warehouse_arrangement(){
|
||||
$db->bind("image", $warehouse_arrangement_item['image']);
|
||||
$db->bind("so_item_id", $warehouse_arrangement_item['so_item_id']);
|
||||
$db->bind("warehouse_arrangement_id", $warehouse_arrangement_id);
|
||||
|
||||
|
||||
$warehouse_arrangement_itemsCreate = $db->query("INSERT INTO warehouse_arrangement_items (actual_ctn, actual_measurement_ctn, actual_weight_ctn, actual_height_ctn, actual_width_ctn, actual_depth_ctn, status, isDamaged, image, so_item_id, warehouse_arrangement_id) VALUES (:actual_ctn, :actual_measurement_ctn, :actual_weight_ctn, :actual_height_ctn, :actual_width_ctn, :actual_depth_ctn, :status, :isDamaged, :image, :so_item_id, :warehouse_arrangement_id);");
|
||||
|
||||
|
||||
if($warehouse_arrangement_item['status'] == 1 || $warehouse_arrangement_item['isDamaged'] == 1){
|
||||
$unmatch_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($warehouse_arrangement_itemsCreate) {
|
||||
|
||||
|
||||
|
||||
|
||||
if ($warehouse_arrangement_itemsCreate) {
|
||||
|
||||
//update so status
|
||||
$db->bind("status", "1");
|
||||
$db->bind("so_id", $so_id);
|
||||
$soUpdate = $db->query("UPDATE `shipping_orders` SET `status`=:status WHERE so_id = :so_id");
|
||||
|
||||
$soUpdate = $db->query("UPDATE `shipping_orders` SET `status`=:status WHERE so_id = :so_id");
|
||||
|
||||
//create messages
|
||||
$db->bind("message", "Your Warehouse Receive Note have been created.");
|
||||
$db->bind("chat_type", "7");
|
||||
$db->bind("from_id", $user_id);
|
||||
$createMessage = $db->query("INSERT INTO notice_messages(message,chat_type,from_id) VALUES (:message,:chat_type,:from_id)");
|
||||
$message_id = $db->lastInsertId();
|
||||
|
||||
|
||||
//find room for current so
|
||||
$room_id = getRoomIDFromSO($so_id);
|
||||
|
||||
|
||||
//connecting messages with room
|
||||
$db->bind("room_id", $room_id);
|
||||
$db->bind("message_id", $message_id);
|
||||
@@ -263,10 +263,10 @@ function the_warehouse_arrangement(){
|
||||
$db->bind("from_id", $user_id);
|
||||
$createMessage = $db->query("INSERT INTO notice_messages(message,chat_type,from_id, decision, decision_type, warehouse_arrangement_id) VALUES (:message,:chat_type,:from_id, :decision, :decision_type, :warehouse_arrangement_id)");
|
||||
$message_id = $db->lastInsertId();
|
||||
|
||||
|
||||
//find room for current so
|
||||
$room_id = getRoomIDFromSO($so_id);
|
||||
|
||||
|
||||
//connecting messages with room
|
||||
$db->bind("room_id", $room_id);
|
||||
$db->bind("message_id", $message_id);
|
||||
@@ -275,21 +275,21 @@ function the_warehouse_arrangement(){
|
||||
if($soUpdate){
|
||||
return new Response("SUCCESS", 200);
|
||||
}else{
|
||||
return new Response('FAILED', 201);
|
||||
return new Response('FAILED', 201);
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
return new Response('FAILED', 201);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$app->post('/get-unread', function(Request $request) {
|
||||
if(getOrderUnread() + getGeneralUnread() + getHelpUnread() > 0){
|
||||
$unread_order = getOrderUnread()+ getGeneralUnread() + getHelpUnread();
|
||||
}else{
|
||||
$unread_order = "";
|
||||
}
|
||||
if(getStatusCompanyFriend($_SESSION['company_id']) > 0 && $_SESSION['group_id'] == 1){
|
||||
if(getStatusCompanyFriend($_SESSION['company_id']) > 0 && $_SESSION['group_id'] == 1){
|
||||
$unread_contact = getStatusCompanyFriend($_SESSION['company_id']) + getContactUnread();
|
||||
}else{
|
||||
$unread_contact = getContactUnread();
|
||||
@@ -301,31 +301,31 @@ function the_warehouse_arrangement(){
|
||||
}
|
||||
$output_array = array();
|
||||
$output_array[] = array('unread_order' => $unread_order, 'unread_contact' => $unread_contact, 'unread_so' => $unread_so);
|
||||
|
||||
|
||||
return json_encode( $output_array );
|
||||
});
|
||||
$app->get('/warehouse-arrangements/details/{id}', function ($id) use ($app) {
|
||||
global $db;
|
||||
global $hooks;
|
||||
global $WAID;
|
||||
|
||||
|
||||
$WAID = $id;
|
||||
|
||||
|
||||
|
||||
|
||||
if (!isset($id) || !isSOMine(getWADatafromWAID($id, "so_id"))) {
|
||||
return $app->redirect('/warehouse-arrangements');
|
||||
}
|
||||
|
||||
|
||||
$hooks->add_action('global_css', "create_warehouse_arrangement_css");
|
||||
$hooks->add_action('global_js', "create_warehouse_arrangement_js");
|
||||
$hooks->add_action('the_title',"create_warehouse_arrangement_title");
|
||||
|
||||
|
||||
the_head();
|
||||
include 'warehouse.details.php';
|
||||
the_footer();
|
||||
return "";
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
include 'warehouse.func.php';
|
||||
@@ -30,16 +30,16 @@ th.dt-body-center,
|
||||
<div class="portlet box blue-hoki">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i><strong>Departure Warehouse Receive Note</strong>
|
||||
<i class="fa fa-cogs"></i><strong>Departure Warehouse Receive Note</strong>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<a class="btn white btn-circle btn-outline pull-right" href="#form_add" data-toggle="modal">
|
||||
Add New <i class="fa fa-plus"></i>
|
||||
</a>
|
||||
<div class="actions">
|
||||
<a class="btn white btn-circle btn-outline pull-right" href="#form_add" data-toggle="modal">
|
||||
Add New <i class="fa fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
|
||||
|
||||
<table class="table table-striped table-bordered table-hover" id="warehouse-arrangements">
|
||||
<thead>
|
||||
<tr role="row" class="heading">
|
||||
@@ -71,7 +71,7 @@ th.dt-body-center,
|
||||
<form class="form-horizontal" id="decision_request">
|
||||
<div class="modal-body form">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="form-body" style="padding-top: 10px;padding-bottom: 10px;">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3">Title</label>
|
||||
@@ -86,7 +86,7 @@ th.dt-body-center,
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -110,7 +110,7 @@ th.dt-body-center,
|
||||
<form class="form-horizontal" id="decision_reject">
|
||||
<div class="modal-body form">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="form-body" style="padding-top: 10px;padding-bottom: 10px;">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3">Title</label>
|
||||
@@ -125,7 +125,7 @@ th.dt-body-center,
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -239,7 +239,7 @@ th.dt-body-center,
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-scrollable" style="max-width:900px; font-size:100px;">
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
<table class="table table-striped table-bordered table-hover" id="shipping_order_items">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>No</td>
|
||||
@@ -282,7 +282,7 @@ th.dt-body-center,
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<?php }elseif ($_SESSION['company_id'] <> 0 && getAllSOWithoutWarehouseCount() == 0){ ?>
|
||||
<center style="margin-top:70px;margin-bottom: 70px">
|
||||
There is no order created to your company. Please ask your importer to create an order to your company.
|
||||
|
||||
Reference in New Issue
Block a user