8594 lines
413 KiB
PHP
8594 lines
413 KiB
PHP
<?php
|
|
$insuranceStatus = array(
|
|
array("name" => "NO", "value" => "0"), array("name" => "YES", "value" => "1")
|
|
);
|
|
$ReqType = '';
|
|
$CompanyAddress = '';
|
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
|
$CurrentDate = $dt->format('d-m-Y');
|
|
$CurrentDateNextYear = $dt->modify('+1 year')->format('d-m-Y');
|
|
|
|
$MaxPoDate = '';
|
|
if (!empty($MaxPODate)) {
|
|
foreach ($MaxPODate as $date) {
|
|
$MaxPoDate = $date->PODate;
|
|
}
|
|
}
|
|
if (!empty($CompanyDetails)) {
|
|
foreach ($CompanyDetails as $Req) {
|
|
$CompanyAddress = $Req->Address;
|
|
}
|
|
}
|
|
|
|
if (!empty($INRSYMBOL)) {
|
|
|
|
foreach ($INRSYMBOL as $INRS) {
|
|
$INRSYM = $INRS->FontCode2000;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/3.3.4/jquery.inputmask.bundle.min.js"></script>
|
|
<style>
|
|
#packagingcalmodel {
|
|
margin-top: 200px;
|
|
z-index: 1080 !important;
|
|
}
|
|
|
|
#submitmodel {
|
|
margin-top: 200px;
|
|
z-index: 1080 !important;
|
|
}
|
|
|
|
#freightmodel {
|
|
margin-top: 200px;
|
|
z-index: 1080 !important;
|
|
}
|
|
|
|
#ExciseDutyCalModel {
|
|
margin-top: 200px;
|
|
z-index: 1080 !important;
|
|
}
|
|
|
|
#VatCalModel {
|
|
margin-top: 200px;
|
|
z-index: 1080 !important;
|
|
}
|
|
|
|
#CSTCalModel {
|
|
margin-top: 200px;
|
|
z-index: 1080 !important;
|
|
}
|
|
|
|
.modal {
|
|
padding-right: 30% ! important;
|
|
}
|
|
|
|
.form-control {
|
|
text-align: left;
|
|
}
|
|
|
|
.nopad {
|
|
padding: 0px;
|
|
}
|
|
|
|
.select2 {
|
|
width: 100% ! important;
|
|
}
|
|
</style>
|
|
<script src="<?php echo base_url() ?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
|
|
<script src="<?php echo base_url() ?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
|
|
<script src="<?php echo base_url() ?>public/assets/tinymce/js/tinymce/tinymce.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
tinymce.init({
|
|
selector: "textarea#ScopeOfWork",
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
tinymce.init({
|
|
selector: "textarea#txtSpcialInstruction",
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
tinymce.init({
|
|
selector: "textarea#emergdescofpo", //main page description of service
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
tinymce.init({
|
|
selector: "textarea#txtSpcialInstructionSingle", //service Add model description service
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
tinymce.init({
|
|
selector: "textarea#EdittxtSpcialInstructionSingle", //service Edit model description service
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
tinymce.init({
|
|
selector: "textarea#Add_Service_Description", //service Edit model description service
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
tinymce.init({
|
|
selector: "textarea#Edit_Service_Description", //service Edit model description service
|
|
|
|
menubar: false,
|
|
statusbar: false,
|
|
toolbar: false
|
|
});
|
|
</script>
|
|
<script type="text/html" id="ServiceList">
|
|
<tr id="<%=index%>">
|
|
<td align="left"><%=index%></td>
|
|
<td align="left"><%=ReqNo%></td>
|
|
<td align="left"><%=MaterialCode%></td>
|
|
<td align="left"><%=MaterialName%></td>
|
|
<td align="left"><%=Quantity%></td>
|
|
<td align="left"><%=UOM%></td>
|
|
<td align="left"><%=Rate%></td>
|
|
<td align="left"><%=BasicAmount%></td>
|
|
<td align="left"><%=Taxvalue%></td>
|
|
<td align="left"><%=TotalValue%></td>
|
|
|
|
<td>
|
|
<a data-target='#EDITSERVICE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITSERVICE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</script>
|
|
<script src="<?php echo base_url(); ?>public/assets/js/CreatePOValidation.js" type="text/javascript"></script>
|
|
<script>
|
|
var NilType = '<?php echo NILTYPE; ?>';
|
|
var PercentageType = '<?php echo PERCENTAGE; ?>';
|
|
var POMaxDate = '<?php echo $MaxPoDate; ?>';
|
|
var PackagingCalculation = '';
|
|
var freightCalculation = '';
|
|
var ExciseCalculation = '';
|
|
var StateTaxCheck = '';
|
|
var VatCalculation = '';
|
|
var CSTCalculation = '';
|
|
var RequistQuantity = '';
|
|
var IsEdit = '0';
|
|
|
|
$(function() {
|
|
|
|
|
|
$("#PODate").datepicker({
|
|
// minDate : 'now',
|
|
// maxDate : 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '-100:+0'
|
|
});
|
|
$("#Deliverydt").datepicker({
|
|
minDate: 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '0:+10'
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#Date1").datepicker({
|
|
// minDate : 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '0:+10'
|
|
});
|
|
|
|
$("#MRC").datepicker({
|
|
// minDate : 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '0:+10'
|
|
});
|
|
|
|
var SelectedMaterialList = {
|
|
Mat: []
|
|
};
|
|
|
|
/* $('#drpSupplier').change(function() {
|
|
|
|
var id = $('#drpSupplier').val();
|
|
$("#SupAddress").val('');
|
|
|
|
if(id != '0')
|
|
{
|
|
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
|
|
|
|
|
|
$.each(y, function(idx, obj) {
|
|
if(obj.SupplierID === id)
|
|
{
|
|
$("#SupAddress").val(obj.Address);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
else
|
|
{
|
|
alert('Please select the SupplierID');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
|
|
$('#ReqNo').change(function() {
|
|
|
|
var id = $('#ReqNo').val();
|
|
$("#deptName").val('');
|
|
$("#CostCenter").empty();
|
|
$("#MaterialCode").empty();
|
|
resetTaxField();
|
|
if(id != '0')
|
|
{
|
|
var y = <?php //echo json_encode($RequistionDetails, JSON_PRETTY_PRINT)
|
|
?>;
|
|
var cost = <?php //echo json_encode($CostList, JSON_PRETTY_PRINT)
|
|
?>;
|
|
var Material = <?php //echo json_encode($MaterialList, JSON_PRETTY_PRINT)
|
|
?>;
|
|
|
|
// For Binding DepartmentName
|
|
$.each(y, function(idx, obj) {
|
|
if(obj.ReqNo === id)
|
|
{
|
|
$("#deptName").val(obj.DepartmentName);
|
|
|
|
}
|
|
});
|
|
// For Binding Cost center for the selected department
|
|
$("#CostCenter").append( $('<option></option>').val("0").html("Select Cost Center") );
|
|
$.each(cost, function(idx, obj) {
|
|
if(obj.ReqNo === id)
|
|
{
|
|
$("#CostCenter").append( $('<option></option>').val(obj.CostCenterCode).html(obj.CostCenterCode + "-" + obj.CostCenterName) );
|
|
|
|
}
|
|
|
|
});
|
|
// For Binding Material list center for the selected Requistion Number
|
|
$("#MaterialCode").append( $('<option></option>').val("0").html("Select Material Code") );
|
|
$.each(Material, function(idx, obj) {
|
|
if(obj.ReqNo === id)
|
|
{
|
|
$("#MaterialCode").append( $('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName) );
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
else
|
|
{
|
|
alert('Please select the Requisition Number');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
$('#MaterialCode').change(function() {
|
|
|
|
var id = $('#MaterialCode').val();
|
|
RequistQuantity = '';
|
|
resetTaxField();
|
|
if(id != '0')
|
|
{
|
|
var y = <?php //echo json_encode($MaterialList, JSON_PRETTY_PRINT)
|
|
?>;
|
|
|
|
|
|
$.each(y, function(idx, obj) {
|
|
if(obj.MaterialCode === id)
|
|
{
|
|
$("#ItemName").val(obj.MaterialName);
|
|
$("#UOM").val(obj.UOM);
|
|
$("#Quantity").val(obj.Quantity);
|
|
RequistQuantity = obj.Quantity;
|
|
}
|
|
});
|
|
}
|
|
else
|
|
{
|
|
alert('Please select the MaterialCode');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
|
|
$('#CostCenter').change(function() {
|
|
|
|
var id = $('#CostCenter').val();
|
|
$("#AvlBudAmt").val('');
|
|
|
|
if(id != '0')
|
|
{
|
|
var cost = <?php //echo json_encode($CostList, JSON_PRETTY_PRINT)
|
|
?>;
|
|
|
|
$.each(cost, function(idx, obj) {
|
|
if(obj.CostCenterCode === id)
|
|
{
|
|
$("#AvlBudAmt").val(obj.BudgetAmount);
|
|
}
|
|
|
|
});
|
|
}
|
|
else
|
|
{
|
|
alert('Please select the MaterialCode');
|
|
return false;
|
|
}
|
|
|
|
}); */
|
|
/* Revenue Tax calcualation */
|
|
|
|
$('#DiscountType').change(function() {
|
|
selValue = $("#DiscountType").val();
|
|
$('#txtDiscount').val('');
|
|
$('#txtAfterDiscount').val('');
|
|
if (selValue == NilType) {
|
|
|
|
$('#txtDiscount').attr('readonly', 'true');
|
|
$('#txtDiscount').val('0.00');
|
|
$('#txtAfterDiscount').val('0.00');
|
|
change();
|
|
|
|
} else {
|
|
$('#txtDiscount').removeAttr('readonly', 'true');
|
|
$('#txtDiscount').val('');
|
|
$('#txtAfterDiscount').val('');
|
|
}
|
|
change();
|
|
|
|
});
|
|
$('#EditDiscountType').change(function() {
|
|
if ($('#EditRevenueRate').val() != '' && $('#EditRevenueMaterialCode').val() != "0") {
|
|
selValue = $("#EditDiscountType").val();
|
|
$('#txtEditDiscount').val('');
|
|
$('#txtEditAfterDiscount').val('');
|
|
if (selValue == NilType) {
|
|
|
|
$('#txtEditDiscount').attr('readonly', 'true');
|
|
$('#txtEditDiscount').val('0.00');
|
|
$('#txtEditAfterDiscount').val('0.00');
|
|
change();
|
|
|
|
} else {
|
|
$('#txtEditDiscount').removeAttr('readonly', 'true');
|
|
$('#txtEditDiscount').val('');
|
|
$('#txtEditAfterDiscount').val('');
|
|
change();
|
|
}
|
|
} else {
|
|
alert('Please Select MaterialCode and Rate Field Value');
|
|
$('#EditDiscountType').val("0");
|
|
$('#EditRate').focus();
|
|
}
|
|
Editchange();
|
|
});
|
|
|
|
$('#PackagingType').change(function() {
|
|
$('#txtPackaging').val('');
|
|
$('#txtAfterPackaging').val('');
|
|
selValue = $("#PackagingType").val();
|
|
if (selValue == PercentageType) {
|
|
var PackagingCalculation = '';
|
|
$('#packagingcalmodel').modal('show');
|
|
$('#txtPackaging').removeAttr('readonly', 'true');
|
|
} else {
|
|
if (selValue == NilType) {
|
|
|
|
$('#txtPackaging').attr('readonly', 'true');
|
|
$('#txtPackaging').val('0.00');
|
|
$('#txtAfterPackaging').val('0.00');
|
|
change();
|
|
} else {
|
|
$('#txtPackaging').removeAttr('readonly', 'true');
|
|
}
|
|
}
|
|
//change();
|
|
});
|
|
$('#EditPackagingType').change(function() {
|
|
$('#txtEditPackaging').val('');
|
|
$('#txtEditAfterPackaging').val('');
|
|
selValue = $("#EditPackagingType").val();
|
|
if (selValue == PercentageType) {
|
|
var PackagingCalculation = '';
|
|
$('#packagingcalmodel').modal('show');
|
|
$('#txtEditPackaging').removeAttr('readonly', 'true');
|
|
} else {
|
|
if (selValue == NilType) {
|
|
|
|
$('#txtEditPackaging').attr('readonly', 'true');
|
|
$('#txtEditPackaging').val('0.00');
|
|
$('#txtEditAfterPackaging').val('0.00');
|
|
Editchange();
|
|
} else {
|
|
$('#txtEditPackaging').removeAttr('readonly', 'true');
|
|
}
|
|
}
|
|
//change();
|
|
|
|
});
|
|
$('#txtExciseDuty').change(function() {
|
|
|
|
if (ExciseCalculation == '') {
|
|
$('#ExciseDutyCalModel').modal('show');
|
|
}
|
|
|
|
});
|
|
$('#txtVat').change(function() {
|
|
|
|
/* if(VatCalculation == '')
|
|
{
|
|
$('#VatCalModel').modal('show');
|
|
}
|
|
*/
|
|
|
|
});
|
|
$('#txtCST').change(function() {
|
|
|
|
if (CSTCalculation == '') {
|
|
$('#CSTCalModel').modal('hide');
|
|
}
|
|
|
|
});
|
|
$('#drpEditFreight').change(function() {
|
|
$('#txtEditFreight').val('');
|
|
$('#txtEditAfterFreight').val('');
|
|
var FreightType = $("#drpEditFreight").val();
|
|
// selValue = $("#drpFreight").val() ;
|
|
|
|
if (FreightType == "PER TRIP") {
|
|
|
|
$('#EditTripsValue').show();
|
|
} else {
|
|
|
|
$('#EditTripsValue').hide();
|
|
}
|
|
if (FreightType == PercentageType) {
|
|
var freightCalculation = '';
|
|
$('#freightmodel').modal('show');
|
|
$('#txtEditFreight').removeAttr('readonly', 'true');
|
|
} else if (selValue == NilType) {
|
|
|
|
$('#txtEditFreight').attr('readonly', 'true');
|
|
$('#txtEditFreight').val('0.00');
|
|
$('#txtEditAfterFreight').val('0.00');
|
|
Editchange();
|
|
} else {
|
|
$('#txtEditFreight').removeAttr('readonly', 'true');
|
|
// $('#txtEditAfterFreight').val('');
|
|
|
|
|
|
}
|
|
// selValue = $("#drpEditFreight").val() ;
|
|
|
|
});
|
|
//add //
|
|
$('#drpFreight').change(function() {
|
|
var FreightType = $("#drpFreight").val();
|
|
|
|
if (FreightType == "PER TRIP") {
|
|
|
|
$('#TripsValue').show();
|
|
} else {
|
|
|
|
$('#TripsValue').hide();
|
|
}
|
|
|
|
selValue = $("#drpFreight").val();
|
|
if (selValue == PercentageType) {
|
|
var freightCalculation = '';
|
|
$('#freightmodel').modal('show');
|
|
$('#txtFreight').removeAttr('readonly', 'true');
|
|
} else if (selValue == NilType) {
|
|
|
|
$('#txtFreight').attr('readonly', 'true');
|
|
$('#txtFreight').val('0.00');
|
|
$('#txtAfterFreight').val('0.00');
|
|
change();
|
|
} else {
|
|
$('#txtFreight').removeAttr('readonly', 'true');
|
|
$('#txtFreight').val('');
|
|
|
|
|
|
}
|
|
change();
|
|
|
|
});
|
|
});
|
|
|
|
/*
|
|
* To calcuate the Discount */
|
|
function calculateDiscount(isEdit) {
|
|
|
|
if (isEdit == '0') {
|
|
if ($('#MaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtDiscount').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#Rate').focus();
|
|
$('#txtDiscount').val('');
|
|
return false;
|
|
}
|
|
if ($('#Rate').val() != '' && $('#MaterialCode').val() != "0") {
|
|
|
|
var basicValue = parseFloat($('#txtBasicValue').val());
|
|
var DiscountType = $("#DiscountType").val();
|
|
|
|
if (DiscountType == "0") {
|
|
alert('Please Select the discount Type');
|
|
$('#txtDiscount').val('');
|
|
$("#DiscountType").focus();
|
|
} else if ($('#txtDiscount').val() != '' && $('#txtDiscount').val() != '0') {
|
|
var AfterDiscount = 0.0;
|
|
var Discountval = parseFloat($('#txtDiscount').val());
|
|
if (DiscountType == PercentageType) {
|
|
|
|
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
|
|
|
|
} else if (DiscountType == NilType) {
|
|
AfterDiscount = "0.00";
|
|
|
|
} else {
|
|
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
|
|
}
|
|
var discount = parseFloat(AfterDiscount).toFixed(2);
|
|
$('#txtAfterDiscount').val(discount);
|
|
} else {
|
|
$('#txtAfterDiscount').val("0.00");
|
|
}
|
|
}
|
|
|
|
calculateTotalValue();
|
|
} else {
|
|
if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
$('#txtEditDiscount').val('');
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRevenueRate').focus();
|
|
$('#txtEditDiscount').val('');
|
|
return false;
|
|
}
|
|
if ($('#EditRevenueRate').val() != '' && $('#EditRevenueMaterialCode').val() != "0") {
|
|
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
var DiscountType = $("#EditDiscountType").val();
|
|
|
|
if (DiscountType == "0") {
|
|
alert('Please Select the discount Type');
|
|
$('#txtEditDiscount').val('');
|
|
$("#EditDiscountType").focus();
|
|
} else if ($('#txtEditDiscount').val() != '' && $('#txtEditDiscount').val() != '0') {
|
|
var AfterDiscount = 0.0;
|
|
var Discountval = parseFloat($('#txtEditDiscount').val());
|
|
if (DiscountType == PercentageType) {
|
|
|
|
AfterDiscount = <?php echo DIS_PERCENTAGE; ?>;
|
|
|
|
} else if (DiscountType == NilType) {
|
|
AfterDiscount = "0.00";
|
|
} else {
|
|
AfterDiscount = <?php echo DIS_LUMPSUM; ?>;
|
|
}
|
|
var discount = parseFloat(AfterDiscount).toFixed(2);
|
|
|
|
$('#txtEditAfterDiscount').val(discount);
|
|
} else {
|
|
$('#txtEditAfterDiscount').val("0.00");
|
|
}
|
|
}
|
|
calculateEditVatValue();
|
|
calculateEditTotalValue();
|
|
}
|
|
}
|
|
/*
|
|
* To calcuate the Packaging */
|
|
function calculatePackaging(isEdit) {
|
|
if (isEdit == '0') {
|
|
if ($('#MaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtPackaging').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#Rate').focus();
|
|
$('#txtPackaging').val('');
|
|
return false;
|
|
} else {
|
|
|
|
var basicValue = parseFloat($('#txtBasicValue').val());
|
|
|
|
var PackagingType = $("#PackagingType").val();
|
|
|
|
if (PackagingType == "0") {
|
|
alert('Please select the Packaging Type');
|
|
$('#txtPackaging').val('');
|
|
$("#PackagingType").focus();
|
|
} else if ($('#txtPackaging').val() != '' && $('#txtPackaging').val() != '0') {
|
|
var Packagingvalue = parseFloat($('#txtPackaging').val());
|
|
var AfterPackaging = 0.0;
|
|
|
|
if (PackagingType == PercentageType) {
|
|
if ($(PackagingCalculation != 0 && '#txtAfterDiscount').val() == '') {
|
|
alert('Please Enter the Discount value');
|
|
$('#txtPackaging').val('');
|
|
$('#DiscountType').focus();
|
|
|
|
return false;
|
|
} else {
|
|
var AfterDiscount = parseFloat($('#txtAfterDiscount').val());
|
|
AfterPackaging = PackagingCalculation == 0 ? <?php echo PACKAGING_PERCENTAGE_BYBASICVALUE; ?> : <?php echo PACKAGING_PERCENTAGE_BYDISCOUNTVALUE; ?>;
|
|
}
|
|
|
|
} else if (PackagingType == NilType) {
|
|
AfterPackaging = 0.00;
|
|
//Change();
|
|
|
|
} else {
|
|
|
|
|
|
AfterPackaging = PackagingCalculation == 0 ? <?php echo PACKAGING_LUMPSUM_BYBASICVALUE; ?> : <?php echo PACKAGING_LUMPSUM_BYDISCOUNTVALUE; ?>;
|
|
|
|
}
|
|
var Packaging = parseFloat(AfterPackaging).toFixed(2);
|
|
|
|
$('#txtAfterPackaging').val(Packaging);
|
|
//RevenueChangeSgst();
|
|
} else {
|
|
$('#txtAfterPackaging').val("0.00");
|
|
}
|
|
}
|
|
|
|
calculateTotalValue();
|
|
} else {
|
|
if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
$('#txtEditPackaging').val('');
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRate').focus();
|
|
$('#txtEditPackaging').val('');
|
|
return false;
|
|
} else {
|
|
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
|
|
var PackagingType = $("#EditPackagingType").val();
|
|
|
|
if (PackagingType == "0") {
|
|
alert('Please select the Packaging Type');
|
|
$('#txtEditPackaging').val('');
|
|
$("#EditPackagingType").focus();
|
|
} else if ($('#txtEditPackaging').val() != '' && $('#txtEditPackaging').val() != '0') {
|
|
var Packagingvalue = parseFloat($('#txtEditPackaging').val());
|
|
var AfterPackaging = 0.0;
|
|
|
|
if (PackagingType == PercentageType) {
|
|
if (PackagingCalculation != 0 && $('#txtEditAfterDiscount').val() == '') {
|
|
alert('Please Enter the Discount value');
|
|
$('#EditDiscountType').focus();
|
|
$('#txtEditPackaging').val('');
|
|
return false;
|
|
} else {
|
|
var AfterDiscount = parseFloat($('#txtEditAfterDiscount').val());
|
|
AfterPackaging = PackagingCalculation == 0 ? <?php echo PACKAGING_PERCENTAGE_BYBASICVALUE; ?> : <?php echo PACKAGING_PERCENTAGE_BYDISCOUNTVALUE; ?>;
|
|
}
|
|
|
|
} else if (PackagingType == NilType) {
|
|
AfterPackaging = "0.00";
|
|
// $('#txtEditAfterPackaging').val(AfterPackaging);
|
|
//RevenueChangeSgst();
|
|
} else {
|
|
|
|
AfterPackaging = PackagingCalculation == 0 ? <?php echo PACKAGING_LUMPSUM_BYBASICVALUE; ?> : <?php echo PACKAGING_LUMPSUM_BYDISCOUNTVALUE; ?>;
|
|
|
|
}
|
|
var Packaging = parseFloat(AfterPackaging).toFixed(2);
|
|
|
|
$('#txtEditAfterPackaging').val(Packaging);
|
|
//RevenueChangeEditSgst();
|
|
} else {
|
|
$('#txtEditAfterPackaging').val("0.00");
|
|
}
|
|
}
|
|
calculateEditVatValue();
|
|
calculateEditTotalValue();
|
|
}
|
|
}
|
|
|
|
function calculateExcise(isEdit) {
|
|
|
|
|
|
if (isEdit == '0') {
|
|
|
|
|
|
if ($('#MaterialCode').val() == "0") {
|
|
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtExciseDuty').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#txtExciseDuty').val('');
|
|
$('#Rate').focus();
|
|
return false;
|
|
} else {
|
|
|
|
var basicValue = parseFloat($('#txtBasicValue').val());
|
|
|
|
|
|
if ($('#txtExciseDuty').val() != '' && $('#txtExciseDuty').val() != '0' && ExciseCalculation != '') {
|
|
var AfterExciseDuty = 0.0;
|
|
var ExciseDuty = parseFloat($('#txtExciseDuty').val());
|
|
|
|
if (ExciseCalculation == '0') {
|
|
AfterExciseDuty = <?php echo EXCISE_ONBASICVALUE; ?>;
|
|
} else if (ExciseCalculation == '1') {
|
|
if ($('#txtAfterDiscount').val() == '') {
|
|
alert('Please Enter the Discount value');
|
|
$('#DiscountType').focus();
|
|
$('#txtExciseDuty').val('');
|
|
return false;
|
|
} else {
|
|
var AfterDiscount = parseFloat($('#txtAfterDiscount').val());
|
|
AfterExciseDuty = <?php echo EXCISE_ONBASIC_DISCOUNT; ?>;
|
|
}
|
|
} else if (ExciseCalculation == '2') {
|
|
if ($('#txtAfterDiscount').val() == '') {
|
|
alert('Please Enter the Discount value');
|
|
$('#DiscountType').focus();
|
|
$('#txtExciseDuty').val('');
|
|
return false;
|
|
} else if ($('#txtAfterPackaging').val() == '') {
|
|
alert('Please Enter the Packaging value');
|
|
$('#PackagingType').focus();
|
|
$('#txtExciseDuty').val('');
|
|
return false;
|
|
|
|
} else {
|
|
var AfterDiscount = parseFloat($('#txtAfterDiscount').val());
|
|
var AfterPackaging = parseFloat($('#txtAfterPackaging').val());
|
|
AfterExciseDuty = <?php echo EXCISE_ONBASIC_DISCOUNT_PACKAGING; ?>;
|
|
}
|
|
} else {
|
|
if ($('#txtAfterPackaging').val() == '') {
|
|
alert('Please Enter the Packaging value');
|
|
$('#PackagingType').focus();
|
|
$('#txtExciseDuty').val('');
|
|
return false;
|
|
} else {
|
|
AfterExciseDuty = <?php echo EXCISE_ONBASIC_PACKAGING; ?>;
|
|
var AfterPackaging = parseFloat($('#txtAfterPackaging').val());
|
|
}
|
|
}
|
|
var ExciseVal = parseFloat(AfterExciseDuty).toFixed(2);
|
|
|
|
$('#txtAfterExciseDuty').val(ExciseVal);
|
|
} else {
|
|
$('#txtAfterExciseDuty').val("0.00");
|
|
}
|
|
|
|
}
|
|
|
|
|
|
calculateTotalValue();
|
|
} else {
|
|
if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRevenueRate').focus();
|
|
return false;
|
|
} else {
|
|
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
|
|
|
|
|
|
if ($('#txtEditExciseDuty').val() != '' && $('#txtEditExciseDuty').val() != '0') {
|
|
var AfterExciseDuty = 0.0;
|
|
var ExciseDuty = parseFloat($('#txtEditExciseDuty').val());
|
|
if (ExciseCalculation == '0') {
|
|
AfterExciseDuty = <?php echo EXCISE_ONBASICVALUE; ?>;
|
|
} else if (ExciseCalculation == '1') {
|
|
if ($('#txtEditAfterDiscount').val() == '') {
|
|
alert('Please Enter the Discount value');
|
|
$('#EditDiscountType').focus();
|
|
$('#txtEditExciseDuty').val('');
|
|
return false;
|
|
} else {
|
|
var AfterDiscount = parseFloat($('#txtEditAfterDiscount').val());
|
|
AfterExciseDuty = <?php echo EXCISE_ONBASIC_DISCOUNT; ?>;
|
|
}
|
|
} else if (ExciseCalculation == '2') {
|
|
if ($('#txtEditAfterDiscount').val() == '') {
|
|
alert('Please Enter the Discount value');
|
|
$('#EditDiscountType').focus();
|
|
$('#txtEditExciseDuty').val('');
|
|
return false;
|
|
} else if ($('#txtEditAfterPackaging').val() == '') {
|
|
alert('Please Enter the Packaging value');
|
|
$('#EditPackagingType').focus();
|
|
$('#txtEditExciseDuty').val('');
|
|
return false;
|
|
} else {
|
|
var AfterDiscount = parseFloat($('#txtEditAfterDiscount').val());
|
|
var AfterPackaging = parseFloat($('#txtEditAfterPackaging').val());
|
|
AfterExciseDuty = <?php echo EXCISE_ONBASIC_DISCOUNT_PACKAGING; ?>;
|
|
}
|
|
} else {
|
|
if ($('#txtEditAfterPackaging').val() == '') {
|
|
alert('Please Enter the Packaging value');
|
|
$('#EditPackagingType').focus();
|
|
$('#txtEditExciseDuty').val('');
|
|
return false;
|
|
} else {
|
|
var AfterPackaging = parseFloat($('#txtEditAfterPackaging').val());
|
|
AfterExciseDuty = <?php echo EXCISE_ONBASIC_PACKAGING; ?>;
|
|
}
|
|
}
|
|
var ExciseVal = parseFloat(AfterExciseDuty).toFixed(2);
|
|
|
|
$('#txtEditAfterExciseDuty').val(ExciseVal);
|
|
} else {
|
|
$('#txtEditAfterExciseDuty').val("0.00");
|
|
}
|
|
|
|
}
|
|
|
|
calculateEditTotalValue();
|
|
}
|
|
|
|
}
|
|
|
|
function calculateVat(isEdit) {
|
|
if (isEdit == '0') {
|
|
if ($('#MaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtVat').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
|
|
alert('Please Enter the Rate value');
|
|
$('#Rate').focus();
|
|
$('#txtVat').val('');
|
|
return false;
|
|
} else if ($('#txtAfterDiscount').val() == '') {
|
|
|
|
// alert('Please Enter the Rate value');
|
|
$('#txtDiscount').focus();
|
|
$('#txtVat').val('');
|
|
return false;
|
|
} else if ($('#txtAfterPackaging').val() == '') {
|
|
|
|
//alert('Please Enter the Rate value');
|
|
$('#txtPackaging').focus();
|
|
$('#txtVat').val('');
|
|
return false;
|
|
} else if ($('#txtAfterExciseDuty').val() == '') {
|
|
|
|
//alert('Please Enter the Rate value');
|
|
$('#txtExciseDuty').focus();
|
|
$('#txtVat').val('');
|
|
return false;
|
|
} else {
|
|
|
|
var basicValue = parseFloat($('#txtBasicValue').val());
|
|
var AfterVat = 0.0;
|
|
|
|
if (VatCalculation != 0 && $('#txtVat').val() != '') {
|
|
|
|
if ($('#txtAfterExciseDuty').val() == '') {
|
|
|
|
alert('Please Enter the Excise value');
|
|
$('#txtExciseDuty').focus();
|
|
$('#txtVat').val('');
|
|
return false;
|
|
} else {
|
|
|
|
var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
|
|
vatValue = parseFloat($('#txtVat').val());
|
|
|
|
var discountValue = parseFloat($('#txtAfterDiscount').val());
|
|
var packageValue = parseFloat($('#txtAfterPackaging').val());
|
|
AfterVat = <?php echo VAT_ONEXICSEVALUE; ?>;
|
|
|
|
var Vatval = parseFloat(AfterVat).toFixed(2);
|
|
|
|
$('#txtAfterVat').val(Vatval);
|
|
}
|
|
} else if (VatCalculation == 0 && $('#txtVat').val() != '') {
|
|
|
|
var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
|
|
vatValue = parseFloat($('#txtVat').val());
|
|
|
|
var discountValue = parseFloat($('#txtAfterDiscount').val());
|
|
var packageValue = parseFloat($('#txtAfterPackaging').val());
|
|
|
|
AfterVat = <?php echo VAT_ONEXICSEVALUE; ?>;
|
|
|
|
|
|
var Vatval = parseFloat(AfterVat).toFixed(2);
|
|
|
|
$('#txtAfterVat').val(Vatval);
|
|
} else {
|
|
|
|
$('#txtAfterVat').val("0.00");
|
|
}
|
|
|
|
calculateTotalValue();
|
|
}
|
|
|
|
} else {
|
|
if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
$('#txtEditVat').val('');
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRevenueRate').focus();
|
|
$('#txtEditVat').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
|
|
var discountValue = parseFloat($('#txtEditAfterDiscount').val());
|
|
var packageValue = parseFloat($('#txtEditAfterPackaging').val());
|
|
|
|
var AfterVat = 0.0;
|
|
if (VatCalculation != 0 && $('#txtEditVat').val() != '') {
|
|
|
|
if ($('#txtEditAfterExciseDuty').val() == '') {
|
|
alert('Please Enter the Excise value');
|
|
$('#txtEditAfterExciseDuty').focus();
|
|
$('#txtEditVat').val('');
|
|
return false;
|
|
} else {
|
|
var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val());
|
|
vatValue = parseFloat($('#txtEditVat').val());
|
|
AfterVat = <?php echo VAT_ONEXICSEVALUE; ?>;
|
|
var Vatval = parseFloat(AfterVat).toFixed(2);
|
|
|
|
$('#txtEditAfterVat').val(Vatval);
|
|
}
|
|
} else if (VatCalculation == 0 && $('#txtEditVat').val() != '') {
|
|
var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val());
|
|
vatValue = parseFloat($('#txtEditVat').val());
|
|
AfterVat = <?php echo VAT_ONEXICSEVALUE; ?>;
|
|
var Vatval = parseFloat(AfterVat).toFixed(2);
|
|
|
|
$('#txtEditAfterVat').val(Vatval);
|
|
} else {
|
|
$('#txtEditAfterVat').val("0.00");
|
|
}
|
|
|
|
calculateEditTotalValue();
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
function calculateCST(isEdit) {
|
|
if (isEdit == '0') {
|
|
|
|
if ($('#MaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtCST').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#Rate').focus();
|
|
$('#txtCST').val('');
|
|
return false;
|
|
} else if ($('#txtAfterDiscount').val() == '') {
|
|
|
|
// alert('Please Enter the Rate value');
|
|
$('#txtDiscount').focus();
|
|
$('#txtCST').val('');
|
|
return false;
|
|
} else if ($('#txtAfterPackaging').val() == '') {
|
|
|
|
//alert('Please Enter the Rate value');
|
|
$('#txtPackaging').focus();
|
|
$('#txtCST').val('');
|
|
return false;
|
|
} else if ($('#txtAfterExciseDuty').val() == '') {
|
|
|
|
//alert('Please Enter the Rate value');
|
|
$('#txtExciseDuty').focus();
|
|
$('#txtCST').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#txtBasicValue').val());
|
|
var discountValue = parseFloat($('#txtAfterDiscount').val());
|
|
var packageValue = parseFloat($('#txtAfterPackaging').val());
|
|
var AfterCST = 0.0;
|
|
if (CSTCalculation != 0 && $('#txtCST').val() != '') {
|
|
|
|
if ($('#txtAfterExciseDuty').val() == '') {
|
|
alert('Please Enter the Excise value');
|
|
$('#txtExciseDuty').focus();
|
|
$('#txtAfterCST').val('');
|
|
return false;
|
|
} else {
|
|
var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
|
|
var CSTValue = parseFloat($('#txtCST').val());
|
|
AfterCST = <?php echo CST_ONEXICSEVALUE; ?>;
|
|
|
|
var Vatval = parseFloat(AfterCST).toFixed(2);
|
|
|
|
$('#txtAfterCST').val(Vatval);
|
|
}
|
|
} else if (CSTCalculation == 0 && $('#txtCST').val() != '') {
|
|
|
|
var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
|
|
var CSTValue = parseFloat($('#txtCST').val());
|
|
|
|
AfterCST = <?php echo CST_ONEXICSEVALUE; ?>;
|
|
var Vatval = parseFloat(AfterCST).toFixed(2);
|
|
|
|
$('#txtAfterCST').val(Vatval);
|
|
} else {
|
|
$('#txtAfterCST').val("0.00");
|
|
}
|
|
calculateTotalValue();
|
|
}
|
|
|
|
} else {
|
|
if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
$('#txtEditCST').val('');
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRevenueRate').focus();
|
|
$('#txtEditCST').val('');
|
|
return false;
|
|
} else {
|
|
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
var discountValue = parseFloat($('#txtEditAfterDiscount').val());
|
|
var packageValue = parseFloat($('#txtEditAfterPackaging').val());
|
|
var AfterCST = 0.0;
|
|
if (CSTCalculation != 0 && $('#txtEditCST').val() != '') {
|
|
|
|
if ($('#txtEditAfterExciseDuty').val() == '') {
|
|
alert('Please Enter the Excise value');
|
|
$('#txtEditAfterExciseDuty').focus();
|
|
$('#txtEditCST').val('');
|
|
return false;
|
|
} else {
|
|
var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val());
|
|
var CSTValue = parseFloat($('#txtEditCST').val());
|
|
AfterCST = <?php echo CST_ONEXICSEVALUE; ?>;
|
|
var Vatval = parseFloat(AfterCST).toFixed(2);
|
|
|
|
$('#txtEditAfterCST').val(Vatval);
|
|
}
|
|
} else if (CSTCalculation == 0 && $('#txtEditCST').val() != '') {
|
|
var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val());
|
|
var CSTValue = parseFloat($('#txtEditCST').val());
|
|
AfterCST = <?php echo CST_ONEXICSEVALUE; ?>;
|
|
var Vatval = parseFloat(AfterCST).toFixed(2);
|
|
|
|
$('#txtEditAfterCST').val(Vatval);
|
|
} else {
|
|
$('#txtEditAfterCST').val("0.00");
|
|
}
|
|
|
|
calculateEditTotalValue();
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
function calculateGST(isEdit) {
|
|
if (isEdit == '0') {
|
|
if ($('#MaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtGST').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#Rate').focus();
|
|
$('#txtGST').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#txtBasicValue').val());
|
|
|
|
if ($('#txtGST').val() != "0" && $('#txtGST').val() != '') {
|
|
var GSTValue = parseFloat($('#txtGST').val());
|
|
|
|
var AfterGST = 0.0;
|
|
AfterGST = <?php echo GSTTAX; ?>;
|
|
|
|
var GSTval = parseFloat(AfterGST).toFixed(2);
|
|
|
|
$('#txtAfterGST').val(GSTval);
|
|
} else {
|
|
$('#txtAfterGST').val("0.00");
|
|
}
|
|
|
|
}
|
|
calculateTotalValue();
|
|
} else {
|
|
if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
$('#txtEditGST').val('');
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRevenueRate').focus();
|
|
$('#txtEditGST').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
|
|
if ($('#txtEditGST').val() != "0" && $('#txtEditGST').val() != '') {
|
|
var GSTValue = parseFloat($('#txtEditGST').val());
|
|
|
|
var AfterGST = 0.0;
|
|
AfterGST = <?php echo GSTTAX; ?>;
|
|
|
|
var GSTval = parseFloat(AfterGST).toFixed(2);
|
|
|
|
$('#txtEditAfterGST').val(GSTval);
|
|
} else {
|
|
$('#txtEditAfterGST').val("0.00");
|
|
}
|
|
|
|
}
|
|
calculateEditTotalValue();
|
|
|
|
}
|
|
}
|
|
|
|
function calculateOtherTaxes(isEdit) {
|
|
if (isEdit == '0') {
|
|
if ($('#MaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtOtherTax').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#Rate').focus();
|
|
$('#txtOtherTax').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#txtBasicValue').val());
|
|
|
|
|
|
if ($('#txtOtherTax').val() != "0" && $('#txtOtherTax').val() != '') {
|
|
var OtherTaxValue = parseFloat($('#txtOtherTax').val());
|
|
|
|
var AfterOtherTaxes = 0.0;
|
|
AfterOtherTaxes = <?php echo OTHERTAX; ?>;
|
|
|
|
var Otherval = parseFloat(AfterOtherTaxes).toFixed(2);
|
|
|
|
$('#txtAfterOtherTax').val(Otherval);
|
|
} else {
|
|
$('#txtAfterOtherTax').val("0.00");
|
|
}
|
|
calculateTotalValue();
|
|
|
|
}
|
|
} else {
|
|
if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
$('#txtEditOtherTax').val('');
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRevenueRate').focus();
|
|
$('#txtEditOtherTax').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
|
|
|
|
if ($('#txtEditOtherTax').val() != "0" && $('#txtEditOtherTax').val() != '') {
|
|
var OtherTaxValue = parseFloat($('#txtEditOtherTax').val());
|
|
|
|
var AfterOtherTaxes = 0.0;
|
|
AfterOtherTaxes = <?php echo OTHERTAX; ?>;
|
|
|
|
var Otherval = parseFloat(AfterOtherTaxes).toFixed(2);
|
|
|
|
$('#txtEditAfterOtherTax').val(Otherval);
|
|
} else {
|
|
$('#txtEditAfterOtherTax').val("0.00");
|
|
}
|
|
calculateEditTotalValue();
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
function calculateFreight(isEdit) {
|
|
if (isEdit == '0') {
|
|
if ($('#MaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
$('#txtFreight').val('');
|
|
return false;
|
|
} else if ($('#Rate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#Rate').focus();
|
|
$('#txtFreight').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#txtBasicValue').val());
|
|
var FreightType = $("#drpFreight").val();
|
|
|
|
if (FreightType == "0") {
|
|
alert('Please select Freight Type');
|
|
$('#txtFreight').val('');
|
|
$("#drpFreight").focus();
|
|
} else if ($('#txtFreight').val() != "0" && $('#txtFreight').val() != '') {
|
|
var FreightValue = parseFloat($('#txtFreight').val());
|
|
var UOM = parseFloat($('#UOM').val());
|
|
var Quantity = parseFloat($('#Quantity').val());
|
|
//alert(FreightType);
|
|
var AfterFreight = 0.0;
|
|
// if(FreightType == PercentageType)
|
|
// {
|
|
// AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
|
// }
|
|
if (FreightType == PercentageType) {
|
|
if ($(freightCalculation != 0 && '#txtAfterDiscount').val() == '') {
|
|
alert('Please Enter the Discount value');
|
|
$('#txtFreight').val('');
|
|
$('#DiscountType').focus();
|
|
|
|
return false;
|
|
} else {
|
|
var AfterDiscount = parseFloat($('#txtAfterDiscount').val());
|
|
AfterFreight = freightCalculation == 0 ? <?php echo FREIGHT_PERCENTAGE; ?> : <?php echo FREIGHT_PERCENTAGE_AFTER; ?>;
|
|
}
|
|
} else if (FreightType == NilType) {
|
|
AfterFreight = 0.0;
|
|
|
|
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
|
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
|
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
|
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
|
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
|
if ($('#NOOfTrips').val() == '') {
|
|
alert('Please Enter No of Trip');
|
|
|
|
$("#NOOfTrips").focus();
|
|
$('#txtFreight').val(0)
|
|
AfterFreight = 0;
|
|
$('#txtAfterFreight').val("0.00");
|
|
return false;
|
|
} else {
|
|
var noOftrip = $("#NOOfTrips").val();
|
|
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
|
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
|
}
|
|
|
|
|
|
} else {
|
|
AfterFreight = $("#txtFreight").val();
|
|
}
|
|
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
|
|
|
|
$('#txtAfterFreight').val(AfterFreightval);
|
|
|
|
} else {
|
|
$('#txtAfterFreight').val("0.00");
|
|
}
|
|
|
|
}
|
|
|
|
|
|
calculateTotalValue();
|
|
} else {
|
|
if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please Select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
$('#txtEditFreight').val('');
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate value');
|
|
$('#EditRevenueRate').focus();
|
|
$('#txtEditFreight').val('');
|
|
return false;
|
|
} else {
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
var FreightType = $("#drpEditFreight").val();
|
|
if (FreightType == "0") {
|
|
alert('Please select Freight Type');
|
|
$('#txtEditFreight').val('');
|
|
$("#drpEditFreight").focus();
|
|
} else if ($('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '') {
|
|
var FreightValue = parseFloat($('#txtEditFreight').val());
|
|
var UOM = parseFloat($('#EditRevenueUOM').val());
|
|
var Quantity = parseFloat($('#EditRevenueQuantity').val());
|
|
//alert(FreightType);
|
|
var AfterFreight = 0.0;
|
|
// if(FreightType == PercentageType)
|
|
// {
|
|
// AfterFreight = <?php echo FREIGHT_PERCENTAGE; ?>;
|
|
// }
|
|
if (FreightType == PercentageType) {
|
|
if ($(freightCalculation != 0 && '#txtEditAfterDiscount').val() == '') {
|
|
alert('Please Enter the Discount value');
|
|
$('#txtEditFreight').val('');
|
|
$('#DiscountType').focus();
|
|
|
|
return false;
|
|
} else {
|
|
var AfterDiscount = parseFloat($('#txtEditAfterDiscount').val());
|
|
AfterFreight = freightCalculation == 0 ? <?php echo FREIGHT_PERCENTAGE; ?> : <?php echo FREIGHT_PERCENTAGE_AFTER; ?>;
|
|
}
|
|
} else if (FreightType == NilType) {
|
|
AfterFreight = 0.0;
|
|
} else if (FreightType == '<?php echo LUMPSUM; ?>') {
|
|
AfterFreight = <?php echo FREIGHT_LUMPSUM; ?>;
|
|
} else if (FreightType == '<?php echo PERUOM; ?>') {
|
|
AfterFreight = <?php echo FREIGHT_PERUOM; ?>;
|
|
} else if (FreightType == '<?php echo PERTRIP; ?>') {
|
|
if ($('#EditNOOfTrips').val() == '') {
|
|
alert('Please Enter No of Trip');
|
|
|
|
$("#EditNOOfTrips").focus();
|
|
$('#txtEditFreight').val(0)
|
|
AfterFreight = 0;
|
|
$('#txtEditAfterFreight').val("0.00");
|
|
return false;
|
|
} else {
|
|
var noOftrip = $("#EditNOOfTrips").val();
|
|
AfterFreight = <?php echo FREIGHT_PERTRIP; ?>;
|
|
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
|
|
}
|
|
} else {
|
|
AfterFreight = $("#txtEditFreight").val();
|
|
}
|
|
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
|
|
|
|
$('#txtEditAfterFreight').val(AfterFreightval);
|
|
//Editchange();
|
|
} else {
|
|
$('#txtEditAfterFreight').val("0.00");
|
|
}
|
|
|
|
}
|
|
calculateEditTotalValue();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function SpecialPOcheck() {
|
|
|
|
// alert('splpo')
|
|
//$('#content').loader('show');
|
|
POcheck = $("input:radio[name='Quality']:checked").val();
|
|
|
|
console.log(POcheck);
|
|
|
|
var splrow = $('#splrow').val();
|
|
var row = $('#txtRowCount1').val();
|
|
var PO = $('#POType').val();
|
|
|
|
// $('#hideconstants').val(counterConstants);
|
|
var file1 = $('#images1' + counterConstants).val()
|
|
var file = $('#imag' + counterConstant).val()
|
|
|
|
// if(splrow!=row)
|
|
// {
|
|
// alert("You havent add all the material details")
|
|
// return false;
|
|
// }
|
|
|
|
// else
|
|
// {
|
|
if (PO == 'REVENUE') {
|
|
|
|
var images = $('#imag').val();
|
|
|
|
$('#content').loader('show');
|
|
|
|
if (POcheck == 0) {
|
|
$('#txtSpecial').val(1);
|
|
$('#txtQuality').val(1);
|
|
// addtable();
|
|
RevenueSave(3);
|
|
} else if (POcheck == 1) {
|
|
|
|
$('#txtSpecial').val(2);
|
|
$('#txtQuality').val(0);
|
|
RevenueSave(4);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (PO = 'SERVICE') {
|
|
|
|
$('#txtSpecialservice').val(1);
|
|
Save(2)
|
|
|
|
}
|
|
//}
|
|
}
|
|
|
|
/* Set the Packaging calculation option for calculating Packaging */
|
|
function submitoption() {
|
|
submitoptionvalue = $("input:radio[name='optsubmit']:checked").val();
|
|
|
|
var PO = $('#POType').val();
|
|
if (PO == 'REVENUE') {
|
|
|
|
$('#submitmodel').modal('hide');
|
|
if (submitoptionvalue == 0) {
|
|
|
|
//alert('normalemergency');
|
|
$('#txtSpecial').val(0);
|
|
$('#content').loader('show');
|
|
RevenueSave(1)
|
|
} else {
|
|
//window.location.href ="<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder";
|
|
$('#filemodel').modal('show');
|
|
}
|
|
|
|
} else if (PO == 'SERVICE') {
|
|
|
|
$('#submitmodel').modal('hide');
|
|
if (submitoptionvalue == 0) {
|
|
|
|
///alert('normal SERVICE emergency');
|
|
$('#txtSpecialservice').val(0);
|
|
Save(1)
|
|
} else {
|
|
//window.location.href ="<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder";
|
|
$('#servicemodel').modal('show');
|
|
|
|
//$('#txtSpecialservice').val(1);
|
|
//Save(2)
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// function ServiceCheck()
|
|
// {
|
|
// submitoptionvalue = $("input:radio[name='optsubmit']:checked").val();
|
|
// //alert(submitoptionvalue);
|
|
// $('#submitmodel').modal('hide');
|
|
// if(submitoptionvalue==0)
|
|
// {
|
|
|
|
// alert('normal Service emergency');
|
|
// $('#txtSpecialservice').val(0);
|
|
// Save(1)
|
|
// }
|
|
// else
|
|
// {
|
|
// //window.location.href ="<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder";
|
|
// $('#filemodel').modal('show');
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
function qualitycheckoption() {
|
|
qualityoptionvalue = $("input:radio[name='Quality']:checked").val();
|
|
//alert(submitoptionvalue);
|
|
$('#submitmodel').modal('hide');
|
|
if (qualityoptionvalue == 0) {
|
|
|
|
alert('Igr');
|
|
} else {
|
|
//window.location.href ="<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder";
|
|
alert('Billing');
|
|
}
|
|
}
|
|
|
|
function SetPackagingOption() {
|
|
PackagingCalculation = $("input:radio[name='optPackaging']:checked").val();
|
|
$('#packagingcalmodel').modal('hide');
|
|
}
|
|
|
|
function setfreightOption() {
|
|
freightCalculation = $("input:radio[name='optfreight']:checked").val();
|
|
$('#freightmodel').modal('hide');
|
|
}
|
|
/* Set the Packaging calculation option for calculating Packaging */
|
|
function SetExciseCalculation() {
|
|
ExciseCalculation = $("input:radio[name='optExcise']:checked").val();
|
|
|
|
$('#ExciseDutyCalModel').modal('hide');
|
|
|
|
calculateExcise($('#isEdit').val());
|
|
}
|
|
|
|
function SetExciseCalculationCancel() {
|
|
|
|
|
|
$('#txtExciseDuty').val('');
|
|
$('#txtAfterExciseDuty').val('');
|
|
|
|
}
|
|
/* Set the Packaging calculation option for calculating Packaging */
|
|
function SetVatorCST() {
|
|
StateTaxCheck = $("input:radio[name='Range']:checked").val();
|
|
$('#txtPoRange').val(StateTaxCheck);
|
|
//alert('Radio clicke:'+StateTaxCheck);
|
|
if (StateTaxCheck == "0") {
|
|
// style="display:none;"
|
|
$('#Vat').removeAttr("style");
|
|
$('#TotVat').removeAttr("style");
|
|
$('#CST').attr("style", "display:none;");
|
|
$('#TotCST').attr("style", "display:none;");
|
|
|
|
} else {
|
|
$('#CST').removeAttr("style");
|
|
$('#TotCST').removeAttr("style");
|
|
$('#Vat').attr("style", "display:none;");
|
|
$('#TotVat').attr("style", "display:none;");
|
|
|
|
}
|
|
}
|
|
|
|
function SetVatCalculation() {
|
|
VatCalculation = $("input:radio[name='optVat']:checked").val();
|
|
$('#VatCalModel').modal('hide');
|
|
calculateVat($('#isEdit').val());
|
|
}
|
|
|
|
function SetCSTCalculation() {
|
|
CSTCalculation = $("input:radio[name='optCST']:checked").val();
|
|
$('#CSTCalModel').modal('hide');
|
|
calculateCST($('#isEdit').val());
|
|
}
|
|
|
|
function Editchange() {
|
|
|
|
var isEdit = 1;
|
|
// ExceedEditQuantityCheck();
|
|
if ($('#EditRevenueQuantity').val() != '' && $('#EditRevenueRate').val() != '') {
|
|
var txtQuantity = parseFloat($('#EditRevenueQuantity').val());
|
|
var txtUnitPrice = parseFloat($('#EditRevenueRate').val());
|
|
var Tot = txtQuantity * txtUnitPrice
|
|
$('#txtEditRevenueBasicValue').val(Tot);
|
|
if ($("#EditDiscountType").val() != 0) {
|
|
calculateDiscount(isEdit);
|
|
}
|
|
|
|
|
|
|
|
if ($("#EditPackagingType").val() != 0) {
|
|
calculatePackaging(1);
|
|
}
|
|
if ($("#drpEditFreight").val() != 0) {
|
|
calculateFreight(1);
|
|
}
|
|
var discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
|
|
var basic = $('#txtEditRevenueBasicValue').val() == '' ? '0.00' : $('#txtEditRevenueBasicValue').val();
|
|
var basicValue1 = parseFloat(basic - discount);
|
|
//alert(basicValue1);
|
|
var packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
|
|
//alert(packaging);
|
|
var freight = $('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val();
|
|
//alert(freight);
|
|
var packfreight = parseFloat(packaging) + parseFloat(freight);
|
|
var basicValue = parseFloat(basicValue1 + packfreight);
|
|
//alert(basicValue);
|
|
|
|
if ($("#RevenueEditCgst").val() != '') {
|
|
|
|
$('#RevenueEditAfterCgst').val(calculateCgstTax(basicValue, $('#RevenueEditCgst').val()));
|
|
} else {
|
|
$('#RevenueEditAfterCgst').val(0.00);
|
|
}
|
|
if ($("#RevenueEditSgst").val() != '') {
|
|
|
|
$('#RevenueEditAfterSgst').val(calculateSgstTax(basicValue, $('#RevenueEditSgst').val()));
|
|
} else {
|
|
$('#RevenueEditAfterSgst').val(0.00);
|
|
}
|
|
if ($("#RevenueEditIgst").val() != '') {
|
|
|
|
$('#RevenueEditAfterIgst').val(calculateIgstTax(basicValue, $('#RevenueEditIgst').val()));
|
|
} else {
|
|
$('#RevenueEditAfterIgst').val(0.00);
|
|
}
|
|
|
|
calculateEditTotalValue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function RevenueChangeSgst() {
|
|
|
|
var getTypeOfTax = $("input:radio[name='Range']:checked").val();
|
|
|
|
if (getTypeOfTax == 0) {
|
|
|
|
$('#RevenueSgst').val($('#RevenueCgst').val());
|
|
change();
|
|
}
|
|
|
|
}
|
|
|
|
function RevenueChangeEditSgst() {
|
|
var getEditTypeOfTax = $("input:radio[name='Range']:checked").val();
|
|
if (getEditTypeOfTax == 0) {
|
|
$('#RevenueEditSgst').val($('#RevenueEditCgst').val());
|
|
Editchange();
|
|
}
|
|
}
|
|
|
|
function change() {
|
|
|
|
var isEdit = 0;
|
|
//ExceedEditQuantityCheck();
|
|
if ($('#Quantity').val() != '' && $('#Rate').val() != '') {
|
|
var txtQuantity = parseFloat($('#Quantity').val());
|
|
var txtUnitPrice = parseFloat($('#Rate').val());
|
|
var Tot = txtQuantity * txtUnitPrice
|
|
$('#txtBasicValue').val(parseFloat(Tot).toFixed(2));
|
|
|
|
if ($("#DiscountType").val() != 0) {
|
|
calculateDiscount(isEdit);
|
|
}
|
|
if ($("#PackagingType").val() != 0) {
|
|
calculatePackaging(isEdit);
|
|
}
|
|
if ($("#drpFreight").val() != 0) {
|
|
calculateFreight(isEdit);
|
|
|
|
|
|
}
|
|
|
|
|
|
var discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
|
var basic = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val();
|
|
var basicValue1 = parseFloat(basic - discount);
|
|
var packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
|
|
var freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
|
var packfreight = parseFloat(packaging) + parseFloat(freight);
|
|
var basicValue = parseFloat(basicValue1 + packfreight);
|
|
//alert(basicValue);
|
|
if ($("#RevenueCgst").val() != '') {
|
|
|
|
$('#RevenueAfterCgst').val(calculateCgstTax(basicValue, $('#RevenueCgst').val()));
|
|
} else {
|
|
$('#RevenueAfterCgst').val(0.00);
|
|
}
|
|
if ($("#RevenueSgst").val() != '') {
|
|
|
|
$('#RevenueAfterSgst').val(calculateSgstTax(basicValue, $('#RevenueSgst').val()));
|
|
} else {
|
|
$('#RevenueAfterSgst').val(0.00);
|
|
}
|
|
if ($("#RevenueIgst").val() != '') {
|
|
|
|
$('#RevenueAfterIgst').val(calculateIgstTax(basicValue, $('#RevenueIgst').val()));
|
|
} else {
|
|
$('#RevenueAfterIgst').val(0.00);
|
|
}
|
|
calculateTotalValue($('#isEdit').val());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function ExceedQuantityCheck() {
|
|
// RequistQuantity
|
|
var EnterQuantity = $("#Quantity").val() == '' ? "0.00" : parseFloat($("#Quantity").val());
|
|
var ReqQuantity = parseFloat(RequistQuantity);
|
|
if (EnterQuantity > ReqQuantity) {
|
|
alert('Your exceeding the Quantity from the Requisition Quantity:' + RequistQuantity + '.Please adjust the Quantity to proceed further.');
|
|
//$('#Quantity').val(RequistQuantity);
|
|
$('#Quantity').focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function calculateEditTotalValue() {
|
|
var Packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
|
|
var Cgst = $('#RevenueEditAfterCgst').val() == '' ? '0.00' : $('#RevenueEditAfterCgst').val();
|
|
var Sgst = $('#RevenueEditAfterSgst').val() == '' ? '0.00' : $('#RevenueEditAfterSgst').val();
|
|
var Igst = $('#RevenueEditAfterIgst').val() == '' ? '0.00' : $('#RevenueEditAfterIgst').val();
|
|
|
|
var Freight = $('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val();
|
|
var Insurance = $('#txtEditInsurance').val() == '' ? '0.00' : $('#txtEditInsurance').val();
|
|
var Discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
|
|
var BasicVal = $('#txtEditRevenueBasicValue').val() == '' ? '0.00' : $('#txtEditRevenueBasicValue').val();
|
|
|
|
|
|
var totvalue = (parseFloat(BasicVal) + parseFloat(Packaging) + parseFloat(Cgst) + parseFloat(Sgst) + parseFloat(Igst) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
|
|
|
|
var tot = parseFloat(totvalue).toFixed(2);
|
|
|
|
$('#txtEditRevenueTotalOrderValue').val(tot);
|
|
}
|
|
// calculate vat rate
|
|
|
|
function calculateEditVatValue() {
|
|
var basicValue = parseFloat($('#txtEditRevenueBasicValue').val());
|
|
|
|
var discountValue = parseFloat($('#txtEditAfterDiscount').val());
|
|
var packageValue = parseFloat($('#txtEditAfterPackaging').val());
|
|
|
|
|
|
var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val());
|
|
vatValue = parseFloat($('#txtEditVat').val());
|
|
AfterVat = <?php echo VAT_ONEXICSEVALUE; ?>;
|
|
var Vatval = parseFloat(AfterVat).toFixed(2);
|
|
|
|
$('#txtEditAfterVat').val(Vatval);
|
|
|
|
|
|
}
|
|
// To Reset the Tax calculation
|
|
function resetTaxField() {
|
|
|
|
$("#ItemName").val('');
|
|
$("#UOM").val('');
|
|
$("#Quantity").val('');
|
|
$("#Rate").val('');
|
|
$("#DiscountType").val("0");
|
|
$("#txtDiscount").val('');
|
|
$('#txtAfterDiscount').val('');
|
|
$("#PackagingType").val("0")
|
|
$("#txtPackaging").val('');
|
|
$('#txtAfterPackaging').val('');
|
|
$("#txtExciseDuty").val('');
|
|
$('#txtAfterExciseDuty').val('');
|
|
$("#txtVat").val('');
|
|
$('#txtAfterVat').val('');
|
|
$("#txtCST").val('');
|
|
$('#txtAfterCST').val('');
|
|
$("#txtGST").val('');
|
|
$('#txtAfterGST').val('');
|
|
$("#txtOtherTax").val('');
|
|
$('#txtAfterOtherTax').val('');
|
|
$("#drpFreight").val("0")
|
|
$("#txtFreight").val('');
|
|
$('#txtAfterFreight').val('');
|
|
$('#txtInsurance').val('');
|
|
$('#txtTotalOrderValue').val('');
|
|
ExciseCalculation = '';
|
|
PackagingCalculation = '';
|
|
freightCalculation = '';
|
|
VatCalculation = '';
|
|
CSTCalculation = '';
|
|
}
|
|
|
|
|
|
function showsubmit() {
|
|
var isChecked = $('#IsOpenOrder').is(':checked');
|
|
// alert("isChecked: " + isChecked);
|
|
var PO = $('#POType').val();
|
|
|
|
if (isChecked) {
|
|
if (PO == 'REVENUE') {
|
|
//alert('normalemergency');
|
|
$('#txtSpecial').val(0);
|
|
$('#content').loader('show');
|
|
RevenueSave(1)
|
|
} else if (PO == 'SERVICE') {
|
|
///alert('normal SERVICE emergency');
|
|
$('#txtSpecialservice').val(0);
|
|
Save(1)
|
|
}
|
|
}else{
|
|
$('#submitmodel').modal('show');
|
|
}
|
|
}
|
|
|
|
function showmodel() {
|
|
|
|
|
|
var input = document.getElementById('purpose').value;
|
|
var getLocal = document.getElementById('Local').value;
|
|
StateTaxCheck = $("input:radio[name='Range']:checked").val();
|
|
var radioValue = $("input[name='DateRange']:checked").val();
|
|
var isChecked = $('#IsOpenOrder').is(':checked');
|
|
// $('#txtPoRange').val(StateTaxCheck) ;
|
|
//alert('Radio clicke:'+StateTaxCheck);
|
|
|
|
if (input == -1) {
|
|
alert("Select Request Type");
|
|
}
|
|
else if ($('#drpSupplier').val() == "0") {
|
|
alert('Please Select the Supplier details');
|
|
$('#drpSupplier').focus();
|
|
return false;
|
|
} else if ($('#PoTypeOptions').val() == "0") {
|
|
alert('Please Select POType');
|
|
$('#PoTypeOptions').focus();
|
|
return false;
|
|
|
|
} else if ($('#BudgetType').val() == "0") {
|
|
alert('Please Select Budget Type');
|
|
$('#BudgetType').focus();
|
|
return false;
|
|
|
|
} else if (input == 'REVENUE' && $('#Deliverydate').val() == '' && radioValue == 0) {
|
|
alert('Please Select the Delivery Date');
|
|
$('#Deliverydate').focus();
|
|
return false;
|
|
} else if (input == 'REVENUE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) {
|
|
alert('Please Enter the Schedule By');
|
|
$('#Scheduleby').focus();
|
|
return false;
|
|
|
|
}
|
|
else {
|
|
$("#" + input).modal('show');
|
|
$('#isEdit').val(0);
|
|
if (StateTaxCheck == "0") {
|
|
// style="display:none;"
|
|
// $('#Vat').removeAttr("style");
|
|
// $('#TotVat').removeAttr("style");
|
|
// $('#CST').attr("style","display:none;");
|
|
// $('#TotCST').attr("style","display:none;");
|
|
$('#Vat').show();
|
|
$('#CST').hide();
|
|
|
|
} else {
|
|
// $('#CST').removeAttr("style");
|
|
// $('#TotCST').removeAttr("style");
|
|
// $('#Vat').attr("style","display:none;");
|
|
// $('#TotVat').attr("style","display:none;");
|
|
$('#Vat').hide();
|
|
$('#CST').show();
|
|
|
|
}
|
|
}
|
|
}
|
|
$(document).ready(function() {
|
|
|
|
$("#PaymentMethod").select2();
|
|
|
|
//Initialize Select2 Elements
|
|
$("#purpose").select2();
|
|
$("#DepartmentName").select2();
|
|
$("#CostCenterName").select2();
|
|
|
|
$("#EditMaterialCode").select2();
|
|
$("#EditRevenueMaterialCode").select2();
|
|
$("#MaterialCode").select2();
|
|
$("#ServiceMaterialCode").select2();
|
|
});
|
|
|
|
|
|
$("#emergency_itemcode").select2();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function DeleteRevenueRow(rowid) {
|
|
var DelRows = $('#txtDeletedRow1').val();
|
|
|
|
//alertMaterialListrowid);
|
|
|
|
var answer = confirm(" Do you want to delete the Item from the List?")
|
|
if (answer) {
|
|
var td = document.getElementById(rowid);
|
|
td.parentNode.removeChild(td);
|
|
var materialCode = $('#materialCode' + rowid).val();
|
|
var removeItem = $('#materialCode' + rowid).val();
|
|
|
|
|
|
//This function is used to add material list after delete
|
|
$.each(JSON.parse(materialData), function(index, value) {
|
|
if (value.MaterialCode == materialCode) {
|
|
$("#MaterialCode").append($('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName));
|
|
}
|
|
});
|
|
|
|
SelectedMaterialCode.splice(SelectedMaterialCode.indexOf('removeItem'), 1);
|
|
|
|
|
|
if (DelRows != '') {
|
|
DelRows = DelRows + ":" + rowid;
|
|
} else {
|
|
DelRows = "0" + ":" + rowid;
|
|
}
|
|
|
|
$('#txtDeletedRow1').val(DelRows);
|
|
populateValueMainFormForDeleteItem(rowid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function populateValueMainFormForDeleteItem(rowid) {
|
|
|
|
|
|
// alert(rows);
|
|
var totBasicAmt = $('#txtTotBasicAmountRevenue').val();
|
|
var totDiscountAmt = $('#txtTotalDiscount').val();
|
|
var totPackagingAmt = $('#txtTotalPackaing').val();
|
|
|
|
var totCgst = $('#txtTotalCGST').val();
|
|
var totSgst = $('#txtTotalSGST').val();
|
|
var totIgst = $('#txtTotalIGST').val();
|
|
|
|
var totFreightAmt = $('#txtTotalFreight').val();
|
|
var totInsuranceAmt = $('#txtTotalInsurance').val();
|
|
var totOrderSummaryAmt = $('#txtTotalOrderValueSummary').val();
|
|
|
|
|
|
var Packaging = $('#AfterPackVal' + rowid).val() == '' ? '0.00' : $('#AfterPackVal' + rowid).val();
|
|
|
|
var Cgst = $('#RevenueAfterCgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterCgst' + rowid).val();
|
|
var Sgst = $('#RevenueAfterSgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterSgst' + rowid).val();
|
|
var Igst = $('#RevenueAfterIgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterIgst' + rowid).val();
|
|
|
|
var Freight = $('#AfterFreightVal' + rowid).val() == '' ? '0.00' : $('#AfterFreightVal' + rowid).val();
|
|
var Insurance = $('#Insval' + rowid).val() == '' ? '0.00' : $('#Insval' + rowid).val();
|
|
var Discount = $('#AfterDisVal' + rowid).val() == '' ? '0.00' : $('#AfterDisVal' + rowid).val();
|
|
var BasicVal = $('#basicval' + rowid).val() == '' ? '0.00' : $('#basicval' + rowid).val();
|
|
var TotalVal = $('#TotalOrderValue' + rowid).val() == '' ? '0.00' : $('#TotalOrderValue' + rowid).val();
|
|
//alert(TotalVal);
|
|
|
|
|
|
totBasicAmt = parseFloat(totBasicAmt) - parseFloat(BasicVal);
|
|
totDiscountAmt = parseFloat(totDiscountAmt) - parseFloat(Discount);
|
|
totPackagingAmt = parseFloat(totPackagingAmt) - parseFloat(Packaging);
|
|
|
|
totCgst = parseFloat(totCgst) - parseFloat(Cgst);
|
|
totSgst = parseFloat(totSgst) - parseFloat(Sgst);
|
|
totIgst = parseFloat(totIgst) - parseFloat(Igst);
|
|
|
|
totFreightAmt = parseFloat(totFreightAmt) - parseFloat(Freight);
|
|
totInsuranceAmt = parseFloat(totInsuranceAmt) - parseFloat(Insurance);
|
|
totOrderSummaryAmt = parseFloat(totOrderSummaryAmt) - parseFloat(TotalVal);
|
|
|
|
|
|
|
|
|
|
$('#txtTotBasicAmountRevenue').val(parseFloat(totBasicAmt).toFixed(2));
|
|
$('#txtTotalDiscount').val(parseFloat(totDiscountAmt).toFixed(2));
|
|
$('#txtTotalPackaing').val(parseFloat(totPackagingAmt).toFixed(2));
|
|
|
|
$('#txtTotalCGST').val(parseFloat(totCgst).toFixed(2));
|
|
$('#txtTotalSGST').val(parseFloat(totSgst).toFixed(2));
|
|
$('#txtTotalIGST').val(parseFloat(totIgst).toFixed(2));
|
|
|
|
$('#txtTotalFreight').val(parseFloat(totFreightAmt).toFixed(2));
|
|
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2));
|
|
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2));
|
|
|
|
}
|
|
</script>
|
|
<style>
|
|
.num {
|
|
text-align: right;
|
|
}
|
|
</style>
|
|
|
|
<div class="content-wrapper">
|
|
<?php
|
|
$attributes = array('class' => 'form-label-left CreatealterPO ', 'name' => 'CreatealterPO', 'id' => 'CreatealterPO');
|
|
|
|
echo form_open(base_url() . '/purchaseorder/addalterPO/', $attributes); ?>
|
|
|
|
<section class="content">
|
|
<div style="border:2px solid #333">
|
|
<div id="content"></div>
|
|
<div>
|
|
<center><b>
|
|
<h2>Emergency Purchase Order</h2>
|
|
</b></center>
|
|
</div>
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<label>Request Type <span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<?php
|
|
$options = array("-1" => 'Select Request Type');
|
|
|
|
if (!empty($RequestType)) {
|
|
|
|
foreach ($RequestType as $RID) :
|
|
if ($RID->ConfigValue == "SERVICE" || $RID->ConfigValue == "REVENUE") {
|
|
$options[$RID->ConfigValue] = $RID->ConfigValue;
|
|
}
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('RequestType', $options, set_value('ConfigValue'), 'id="purpose"', 'class = "form-control select2"', 'required="true"');
|
|
|
|
?>
|
|
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Purchase Order Date</label>
|
|
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'PODate', 'value' => set_value('PODate', $CurrentDate), 'id' => 'PODate', 'class' => 'form-control', 'required' => 'true', 'onkeypress'=>'return false;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Purchase Order Type</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'POType', 'value' => set_value('POType', $ReqType), 'id' => 'POType', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2" style='display:none;' id='workstatus'>
|
|
<label>Work Status<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<?php
|
|
if (!empty($WorkStatus)) {
|
|
//$options4 = array("0"=>'Selected Work Status');
|
|
foreach ($WorkStatus as $WSID) :
|
|
$options4[$WSID->StatusCode] = $WSID->StatusName;
|
|
endforeach;
|
|
}
|
|
echo form_dropdown('workstatus', $options4, set_value('workstatus'), 'id="workstatusValue"', 'required="true"', 'class="form-control select2');
|
|
?>
|
|
</div>
|
|
<!-- <div class="col-md-3" id="selectdeliveryby" style="display:none;"> -->
|
|
<div class="col-md-3">
|
|
<b><u>Select Delivery By<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></u></b><br />
|
|
<tr>
|
|
<td>
|
|
<?php echo form_label('Date', 'Date') . " " . form_radio(array("name" => "DateRange", "id" => "Date", "value" => "0", 'checked' => set_radio('DateRange', '0', true))); ?>
|
|
</td>
|
|
<td>
|
|
<?php echo form_label('Schedule', 'Schedule') . " " . form_radio(array("name" => "DateRange", "id" => "Schedule", "value" => "1", 'checked' => set_radio('DateRange', '1', false))); ?>
|
|
</td>
|
|
</tr>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<label>Supplier<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Select Supplier');
|
|
//print_r( $options);
|
|
|
|
if (!empty($Suplist)) {
|
|
foreach ($Suplist as $SID) :
|
|
$options[$SID->SupplierID] = $SID->SupplierID . ' ' . ' - ' . ' ' . $SID->SupplierName;
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSupplier"', 'required="true"', 'class="form-control select2"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Address</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'SupAddress', 'value' => set_value('SupAddress'), 'id' => 'SupAddress', 'class' => 'form-control', 'readonly' => 'true', 'rows' => '3', 'cols' => '40');
|
|
echo Form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Delivery Address</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'DeliveryAddr', 'value' => set_value('DeliveryAddr', $CompanyAddress), 'id' => 'DeliveryAddr', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40');
|
|
echo Form_textarea($data);
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" id="Deliveryby" style="padding: 0px;">
|
|
|
|
<div class="col-md-12" id="Schedulediv">
|
|
<label>Schedule By<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
|
|
<?php
|
|
$data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby'), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
|
|
echo form_textarea($data);
|
|
?>
|
|
|
|
</div>
|
|
<div class="col-md-12" id="Deliverydtdiv" style="display:none;">
|
|
<label>Delivery Date<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<?php
|
|
$data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $CurrentDate), 'id' => 'Deliverydt', 'class' => 'form-control', 'required' => 'true', 'onkeypress'=>'return false;');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<label>Department Name<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div>
|
|
<?php
|
|
$options1 = array("0" => 'Select Department Name');
|
|
|
|
if (!empty($DeptList)) {
|
|
|
|
foreach ($DeptList as $DID) :
|
|
|
|
$options1[$DID->DEPCode] = $DID->DEPCode . ' ' . ' - ' . ' ' . $DID->DepartmentName;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('drpDepartment', $options1, set_value('drpDepartment'), 'id="DepartmentName"', 'class = "form-control select2"', 'required="true"', 'disabled="disabled"');
|
|
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Cost Center Name<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div>
|
|
<?php
|
|
$options2 = array("0" => 'Cost Center Name');
|
|
|
|
|
|
if (!empty($CostList)) {
|
|
|
|
foreach ($CostList as $cost) :
|
|
|
|
|
|
$options2[$cost['CostCenterCode']] = $cost['CostCenterCode'] . ' ' . ' - ' . ' ' . $cost['CostCenterName'];
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('CostCenterName', $options2, set_value('CostCenterName'), 'id="CostCenterName"', 'class="form-control select2"', 'required="true"', 'multiple="true"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" style="display:none;">
|
|
<label>Available Budget <?php echo "($INRSYM)" ?></label><img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="25px" style="display:none;" />
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AvalBuget', 'value' => set_value('AvalBuget'), 'id' => 'AvalBuget', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_hidden($data);
|
|
// echo form_input($data);
|
|
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" style='display:none;' id='txtPoRange'>
|
|
<b><u>Select Tax Range<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></u></b><br />
|
|
<tr>
|
|
<td>
|
|
<?php echo form_label('Local', 'Local') . " " . form_radio(array("name" => "Range", "id" => "Local", "value" => "0", 'checked' => set_radio('Range', '0', TRUE))); ?> </td>
|
|
<td>
|
|
<?php echo form_label('Inter state', 'Inter state') . " " . form_radio(array("name" => "Range", "id" => "Inter_state", "value" => "1", 'checked' => set_radio('Range', '1', FALSE))); ?>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</div>
|
|
<div class="col-md-3" id="currencyexchange" style='display:none;'>
|
|
<div class="col-md-6">
|
|
<label>Currency Type<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
|
|
<?php
|
|
$data = array('name' => 'txtcurrencytype', 'value' => set_value('txtcurrencytype'), 'id' => 'txtcurrencytype', 'class' => 'form-control', 'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label>Exchange Rate</label>
|
|
|
|
<?php
|
|
$data = array('name' => 'txtexachangerate', 'value' => set_value('txtexachangerate'), 'id' => 'txtexachangerate', 'class' => 'form-control', 'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<a href="http://www.xe.com/" target="_blank"><u>To check Today's Foreign Exchange value</u></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12" style="padding: 0px;">
|
|
<div class="col-md-3" id="DisplayScheduleDiv" style="display:none;">
|
|
<label>Select Service Schedule Type</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$Schdule = array("One Time", "Recurring");
|
|
if (!empty($Schdule)) {
|
|
foreach ($Schdule as $Sch) :
|
|
$SchType[$Sch] = $Sch;
|
|
endforeach;
|
|
}
|
|
echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType"', 'class = "form-control"');
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" id="ServicePeriodOption" style="display:none;">
|
|
<label>Select Service Period Option</label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
|
|
|
|
if (!empty($ServiceOption)) {
|
|
foreach ($ServiceOption as $SerOption) :
|
|
|
|
|
|
$ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue;
|
|
endforeach;
|
|
}
|
|
echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" id="NoServices" style="display:none;">
|
|
<label>Number of Services</label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
$data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo', 1), 'id' => 'ServiceNo', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!--start new fields 1 sep-->
|
|
<div class="row">
|
|
<div class="col-md-12" style="padding: 0px;">
|
|
<div class="col-md-3">
|
|
<div class="col-md-12" style="padding: 0px;">
|
|
|
|
|
|
<label>Mode Of Shipment</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'emergmodeofshipment', 'value' => set_value('emergmodeofshipment'), 'id' => 'emergmodeofshipment', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-9" style="padding:0px;">
|
|
<div class="col-md-4" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<label>Contact Reference</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'emergsupplierreference', 'value' => set_value('emergsupplierreference'), 'id' => 'emergsupplierreference', 'class' => 'form-control', 'maxlength' => '40');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<label>Supplier's Offer No</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'emergsupplierofferno', 'value' => set_value('emergsupplierofferno'), 'id' => 'emergsupplierofferno', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" style="padding:0px;">
|
|
<div class="col-md-6" style="padding-right:0px;">
|
|
|
|
<label>Our Reference(S)</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'emergotherreference', 'value' => set_value('emergotherreference'), 'id' => 'emergotherreference', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label>Fincap</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'emergfincap', 'value' => set_value('emergfincap'), 'id' => 'emergfincap', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div><!--End new fields 1 sep-->
|
|
|
|
</div>
|
|
<!--start new fields 1 sep-->
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<div class="col-md-6" style="padding: 0px;">
|
|
<label id="typeOptions">Service Type Options</label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
$optionsPO = array("0" => 'Select');
|
|
|
|
if (!empty($PoTypeOptions)) {
|
|
foreach ($PoTypeOptions as $POpt) :
|
|
|
|
|
|
$optionsPO[$POpt->ConfigValue] = $POpt->ConfigValue;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('PoTypeOptions', $optionsPO, set_value('PoTypeOptions'), 'id="PoTypeOptions"', 'required="true"', 'class="form-control select2');
|
|
|
|
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="col-md-6" style="padding-right: 0px;">
|
|
<label>Insurance Options</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
|
|
if (!empty($insuranceStatus)) {
|
|
foreach ($insuranceStatus as $INS) :
|
|
|
|
|
|
$optionsInsurance[$INS['value']] = $INS['name'];
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus"', 'required="true"', 'class="form-control select2');
|
|
|
|
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-9" style="padding:0px;">
|
|
|
|
<div class="col-md-4" id="insuranceTxtDiv" style="display:block;">
|
|
<label>Insurance No / Insurance Details<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'InsuranceNumber', 'value' => set_value('InsuranceNumber'), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="payablefrom">Payable Terms</label>
|
|
<?php
|
|
$options1 = array("0" => 'Select Payment method');
|
|
//print_r( $options);
|
|
if (!empty($Payment)) {
|
|
foreach ($Payment as $payment) :
|
|
|
|
|
|
$options1[$payment->PaymentID] = $payment->PaymentTerms;
|
|
|
|
endforeach;
|
|
}
|
|
echo form_dropdown('PaymentMethod', $options1, set_value('PaymentMethod'), 'id="PaymentMethod"', 'class="form-control"');
|
|
?>
|
|
</div>
|
|
|
|
<div class="col-md-4" id="otheroptiondiv" style="display:none;">
|
|
<label>Description of Payable Terms<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-2" style="padding-right: 0px;">
|
|
<label for="BudgetType">Budget Type</label>
|
|
<?php
|
|
$optionsnew = array('0' => 'Select', '1' => 'REVENUE', '2' => 'CAPITAL');
|
|
echo form_dropdown('BudgetType', $optionsnew, set_value('BudgetType'), 'id="BudgetType"', 'required="true"', 'class="form-control select2');
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div><!--End new fields 1 sep-->
|
|
|
|
<div class="col-md-12" style="padding:0px;"></div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-3 col-md-offset-7" align="right" style="padding:10px">
|
|
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT
|
|
</div>
|
|
<div class="col-md-1" align="right">
|
|
<a data-toggle="modal" onclick="showmodel();" class=" btn btn-success"> Select Line Item </a>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- Modal for Packing Calculation -->
|
|
<div id="packagingcalmodel" class="modal fade" data-backdrop-limit="1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="modal-title">Packing Calculation On</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
|
|
<div class="radio">
|
|
<label><input type="radio" name="optPackaging" checked="checked" value='0' id="optPackaging"> Basic Amount</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optPackaging" id="optPackaging" value='1'> After Discount Amount</label>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
|
|
<a class="btn btn-success" ID="PackagingOption" onclick="SetPackagingOption();" style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div id="packagingcalmodel" class="modal fade" data-backdrop-limit="1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">Packing Calculation On</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
|
|
<div class="radio">
|
|
<label><input type="radio" name="optPackaging" checked="checked" value='0' id="optPackaging"> Basic Amount</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optPackaging" id="optPackaging" value='1'> After Discount Amount</label>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
|
|
<a class="btn btn-success" ID="PackagingOption" onclick="SetPackagingOption();" style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div id="submitmodel" class="modal fade" data-backdrop-limit="1" role="dialog" aria-labelledby="myModalLabel">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">Material has been Received</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
|
|
<div class="radio">
|
|
<label><input type="radio" name="optsubmit" id="optsubmit" value='1'>YES</label>
|
|
</div>
|
|
|
|
<div class="radio">
|
|
<label><input type="radio" name="optsubmit" checked="checked" value='0' id="optsubmit">NO</label>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<a class="btn btn-success" ID="PackagingOption" onclick="submitoption();dropdownselect();" style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="filemodel" class="modal fade" data-backdrop-limit="1" role="dialog" aria-labelledby="myModalLabel">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content" style="width:950px;">
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">Add Bill Details</h4>
|
|
</div>
|
|
<div class="modal-body" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<!-- <div class="col-md-4 pad"><strong>Select Item Code</strong>
|
|
<select id="emergencyitemcode" name="emergencyitemcode" class = "form-control select2">
|
|
<!-- <option value="1"> select material code</option>
|
|
</select>
|
|
|
|
</div>-->
|
|
<div class="col-md-4 pad"><strong>Delivery Challan /Inv No</strong>
|
|
<input type="text" name="ChallanInvNo" id="ChallanInvNo" maxlength="12" class="form-control" value="" required onkeypress="return isNumberKey(event)">
|
|
</div>
|
|
<div class="col-md-4 pad"><strong>Delivery Challan /Inv Date</strong>
|
|
<!-- <input type="Date" name="Date1" onkeypress="return onlyAlphabets(event);" maxlength="100" id="Date1" class="form-control" required value="2"> -->
|
|
<?php
|
|
$data = array('name' => 'Date1', 'value' => set_value('Date1', $CurrentDate), 'id' => 'Date1', 'class' => 'form-control num', 'required' => 'true');
|
|
echo form_input($data); ?>
|
|
</div>
|
|
<div class="col-md-4 pad"> <strong>Material Received Date</strong>
|
|
<?php
|
|
$data = array('name' => 'MRC', 'value' => set_value('MRC', $CurrentDate), 'id' => 'MRC', 'class' => 'form-control num', 'required' => 'true');
|
|
echo form_input($data); ?>
|
|
|
|
|
|
|
|
</div>
|
|
<!-- <div class="col-md-4 pad"><strong>Advise Quantity</strong>
|
|
<input type="text" name="AQuantity" id="AQuantity" maxlength="12" class="form-control" value="" required>
|
|
</div> -->
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
|
|
|
<input type="hidden" id="tablevalues" value="sample" name="tablevalues" />
|
|
|
|
<input type="hidden" id="splrow" value="sample" name="splrow" />
|
|
|
|
<div class="col-md-4 pad"><strong>Vehicle No</strong>
|
|
<input type="text" name="VehicleNo" id="VehicleNo" maxlength="13" class="form-control" value="" required>
|
|
</div>
|
|
<div class="col-md-4 pad"><strong>Courier No</strong>
|
|
<input type="text" name="CourierNo" id="CourierNo" maxlength="12" class="form-control" value="" required>
|
|
</div>
|
|
|
|
<div class="col-md-4" id="QualityChecked"><strong>Is Quality Check Required</strong>
|
|
<div class="radio">
|
|
<label><input type="radio" name="Quality" checked="checked" value='0' id="Quality">Yes</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="Quality" id="Quality" value='1'>No</label>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-md-12">
|
|
<!-- <div class="col-md-5">
|
|
<input type = "file" size = "20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();"/>
|
|
|
|
|
|
|
|
|
|
|
|
<label for="images">Select file<br/><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
|
|
</div> -->
|
|
<div class="col-md-10">
|
|
|
|
<!-- <legend>Multiple File</legend> -->
|
|
<div class="col-md-offset-10 col-md-1">
|
|
<input type="button" class="btn btn-success" id="addmorebutton" value=" + ADD FILES..">
|
|
</div>
|
|
|
|
|
|
<div id="newdiv"></div><!-- this div for add more section-->
|
|
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
|
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
|
|
<table id="specialtable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;">
|
|
|
|
|
|
<!--<thead>
|
|
<tr>
|
|
<th>MaterialCode1</th>
|
|
<th>DeliveryChallanDate</th>
|
|
<th>DeliveryChallanNo</th>
|
|
<th>VehicleNo</th>
|
|
<th>CourierNo</th>
|
|
<th>Quantity12</th>
|
|
<th>File</th>
|
|
</tr>
|
|
</thead>-->
|
|
|
|
<tbody id="specialappend">
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<div class="col-md-12 text-right">
|
|
<!-- <div class="col-md-4">
|
|
<a class="btn btn-success Add" onclick="addtable();"><span class="bold">Add table</span></a>
|
|
</div> -->
|
|
|
|
|
|
<div class="col-md-4 col-md-offset-8">
|
|
<a class="btn btn-success ok" ID="ExciseOption12" onclick="rfilealert();"> <span class="bold">Submit</span></a>
|
|
|
|
<a class="btn btn-success" data-dismiss="modal" onclick="SetExciseCalculationCancel();" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- </form> -->
|
|
</div>
|
|
|
|
|
|
<div id="servicemodel" class="modal fade" data-backdrop-limit="1" role="dialog" aria-labelledby="myModalLabel">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content" style="width:950px;">
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">SERVICE Bill Details</h4>
|
|
</div>
|
|
<div class="modal-body" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
|
|
|
|
<!-- <div class="col-md-4">
|
|
<input type = "file" size = "20" input accept=".docx,.pdx,.doc.JPG,.PNG,.jpg" id="images1" name="images1" onChange="sfilecheck();"/>
|
|
<label for="images">Select Company file<br/><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
|
|
</div>
|
|
|
|
</div> -->
|
|
|
|
|
|
<!-- <div class="col-md-10"> -->
|
|
|
|
<!-- <legend>Multiple File</legend> -->
|
|
<div class="col-md-offset-0 col-md-1">
|
|
<input type="button" class="btn btn-success" id="addemorebutton" value=" + ADD FILES..">
|
|
</div>
|
|
|
|
|
|
<div id="newsdiv"></div><!-- this div for add more section-->
|
|
<input type="hidden" name="hidecounters" id="hidecounters" value="0" />
|
|
<input type="hidden" name="hideconstants" id="hideconstants" value="0" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-footer">
|
|
<div class="col-md-12 text-right">
|
|
|
|
<div class="col-md-4 col-md-offset-8">
|
|
<a class="btn btn-success ok" ID="ExciseOption12" onclick="sfilealert();"> <span class="bold">Submit</span></a>
|
|
|
|
<a class="btn btn-success" data-dismiss="modal" onclick="SetExciseCalculationCancel();" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="freightmodel" class="modal fade" data-backdrop-limit="1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">Freight Calculation On</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
|
|
<div class="radio">
|
|
<label><input type="radio" name="optfreight" checked="checked" value='0' id="optfreight"> Basic Amount</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optfreight" id="optfreight" value='1'> After Discount Amount</label>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
|
|
<a class="btn btn-success" ID="freightOption" onclick="setfreightOption();" style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal for Excise Duty Calculation-->
|
|
<div class="modal fade" id="ExciseDutyCalModel" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">Excise Duty Calculation On</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optExcise" checked="checked" value="0" id="optExcise">From Basic Amount</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optExcise" value="1" id="optExcise">Basic Amount - Discount Amount</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optExcise" value="2" id="optExcise">(Basic Amount - Discount Amount ) + Packing Cost</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optExcise" value="3" id="optExcise">Basic Amount + Packing Cost</label>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a class="btn btn-success" ID="ExciseOption" onclick="SetExciseCalculation();" style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" onclick="SetExciseCalculationCancel();" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Modal for Vat Calculation -->
|
|
<div class="modal fade" id="VatCalModel" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">Vat Calculation On</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
|
|
<div class="radio">
|
|
<label><input type="radio" name="optVat" checked="checked" value="0" id="optVat">Basic Amount</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optVat" value="1" id="optVat">Excise Duty</label>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a class="btn btn-success" ID="VatOption" onclick="SetVatCalculation();" style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<!-- Modal for CST Calculation -->
|
|
<div class="modal fade" id="CSTCalModel" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal for CST Calculation-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title">CST Calculation On</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
|
|
<div class="radio">
|
|
<label><input type="radio" name="optCST" checked="checked" value="0" id="optCST">Basic Amount</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label><input type="radio" name="optCST" value="1" id="optCST">Excise Duty</label>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a class="btn btn-success" ID="CSTOption" onclick="SetCSTCalculation();" style="margin-top: -24px;"> <span class="bold">Ok</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" style="margin-top: -24px;" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<!-- Edit Service Modal content-->
|
|
<div class="modal fade" id="EDITSERVICE" role="dialog" style="overflow-y:scroll !important">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:1000px;">
|
|
<div class="modal-header">
|
|
|
|
<center>
|
|
<h4>Edit Service Purchase Order Item </h4>
|
|
</center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Req No<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div>
|
|
<?php
|
|
|
|
$data = array('name' => 'EditReqNo', 'value' => set_value('EditReqNo'), 'id' => 'EditReqNo', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Department Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditdeptName', 'value' => set_value('EditdeptName'), 'id' => 'EditdeptName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Cost Center Code</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditCostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" style="display:none;">
|
|
<label>Available Budget Amount</label><img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="25px" style="display:none;" />
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditAvlBudAmt', 'value' => set_value('EditAvlBudAmt'), 'id' => 'EditAvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_hidden($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Item Code<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Item Code');
|
|
//print_r( $options);
|
|
|
|
echo form_dropdown('EditMaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Item Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditItemName', 'value' => set_value('EditItemName'), 'id' => 'EditItemName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>UOM</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditUOM', 'value' => set_value('EditUOM'), 'id' => 'EditUOM', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Frequency</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'EditFrequencyChange', 'value' => set_value('EditFrequencyChange'), 'id' => 'EditFrequencyChange', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- <div class="col-md-12">
|
|
<div class="col-md-4" id="EditDisplayScheduleDiv" style="display:none;">
|
|
<label>Select Service Schedule Type</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$Schdule = array("One Time", "Recurring");
|
|
|
|
|
|
if (!empty($Schdule)) {
|
|
foreach ($Schdule as $Sch) :
|
|
|
|
$SchType[$Sch] = $Sch;
|
|
|
|
endforeach;
|
|
}
|
|
echo form_dropdown('EditScheduleType', $SchType, set_value('EditScheduleType'), 'id="EditScheduleType"', 'class = "form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" id="EditServicePeriodOption" style="display:none;">
|
|
<label>Select Service Period Option</label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
|
|
|
|
if (!empty($ServiceOption)) {
|
|
foreach ($ServiceOption as $SerOption) :
|
|
|
|
|
|
$ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue;
|
|
endforeach;
|
|
}
|
|
echo form_dropdown('EditServiceOptions', $ServiceOptions, set_value('EditServiceOptions'), 'id="EditServiceOptions"', 'class = "form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" id="EditNoServices" style="display:none;">
|
|
<label>Number of Services</label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
$data = array('name' => 'EditServiceNo', 'value' => set_value('EditServiceNo'), 'id' => 'EditServiceNo', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
<div class="col-md-12">
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Quantity<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label><?php echo "Rate ($INRSYM)"; ?><span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Per</label> <?php
|
|
$data = array('name' => 'EditEmergPer', 'value' => set_value('EditEmergPer'), 'id' => 'EditEmergPer', 'class' => 'form-control');
|
|
echo form_input($data); ?>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label><?php echo "Basic Amount In ($INRSYM)"; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditBasicValue', 'value' => set_value('txtEditBasicValue'), 'id' => 'txtEditBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-6" align="right">
|
|
|
|
CGST In %
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'EditCgst', 'value' => set_value('EditCgst', 0), 'id' => 'EditCgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'onchange' => 'EditRatechange();ChangeEditSgst();', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'EditAfterCgst', 'value' => set_value('EditAfterCgst', 0), 'id' => 'EditAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-6" align="right">
|
|
|
|
SGST In %
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'EditSgst', 'value' => set_value('EditSgst', 0), 'id' => 'EditSgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'EditAfterSgst', 'value' => set_value('EditAfterSgst', 0), 'id' => 'EditAfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-6" align="right">
|
|
|
|
IGST In %
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'EditIgst', 'value' => set_value('EditIgst', 0), 'id' => 'EditIgst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'EditAfterIgst', 'value' => set_value('EditAfterIgst', 0), 'id' => 'EditAfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
<input type="hidden" name="EditFrequencyNo" id="EditFrequencyNo" value="EditFrequencyNo" />
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-5 col-md-offset-4" align="right">
|
|
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditOtherAllowances', 'value' => set_value('EditOtherAllowances', 0), 'id' => 'EditOtherAllowances', 'class' => 'form-control num', 'onchange' => 'EditRatechange()', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-5 col-md-offset-4" align="right">
|
|
<label> <?php echo "Total Order Amount In ($INRSYM)"; ?></label>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditTotalOrderValue', 'value' => set_value('EditTotalOrderValue'), 'id' => 'EditTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12" style="padding: 0px 30px 10px 30px;">
|
|
<label>Service Description<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label> <?php
|
|
$data = array('name' => 'EdittxtSpcialInstructionSingle', 'value' => set_value('EdittxtSpcialInstructionSingle'), 'id' => 'EdittxtSpcialInstructionSingle', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
|
echo form_textarea($data); ?>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<div class="col-md-12">
|
|
<a class="btn btn-success font EditService" ID="Edit"> <span class="bold">Update Service</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Edit Revenue Modal -->
|
|
<div id="EDITREVENUE" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="overflow-y:scroll !important">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:1150px;">
|
|
<div class="modal-header">
|
|
<center>
|
|
<h4>Edit Revenue Purchase Order Line Item </h4>
|
|
</center>
|
|
</div>
|
|
<div align="left">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Req No<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div>
|
|
<?php
|
|
|
|
$data = array('name' => 'EditRevenueReqNo', 'value' => set_value('EditReqNo'), 'id' => 'EditRevenueReqNo', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Department Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRevenuedeptName', 'value' => set_value('EditdeptName'), 'id' => 'EditRevenuedeptName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Cost Center Code</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRevenueCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditRevenueCostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" style="display:none;">
|
|
<label>Avl Bud Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRevenueAvlBudAmt', 'value' => set_value('EditAvlBudAmt'), 'id' => 'EditRevenueAvlBudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_hidden($data);
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-2">
|
|
<label>Item Code<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Item Code');
|
|
|
|
|
|
echo form_dropdown('EditRevenueMaterialCode', $options, set_value('EditMaterialCode'), 'id="EditRevenueMaterialCode"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Item Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRevenueItemName', 'value' => set_value('EditItemName'), 'id' => 'EditRevenueItemName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>UOM</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRevenueUOM', 'value' => set_value('EditUOM'), 'id' => 'EditRevenueUOM', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6" style="padding: 0px;">
|
|
<div class="col-md-2" style="padding-right:0px;">
|
|
<label>Quantity<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRevenueQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditRevenueQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2" style="padding-right: 0px;">
|
|
<label><?php echo "Rate ($INRSYM)"; ?><span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditRevenueRate', 'value' => set_value('EditRate'), 'id' => 'EditRevenueRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Per</label> <?php
|
|
$data = array('name' => 'editrevenueEmergPer', 'value' => set_value('editrevenueEmergPer'), 'id' => 'editrevenueEmergPer', 'class' => 'form-control');
|
|
echo form_input($data); ?>
|
|
</div>
|
|
<div class="col-md-2" style="padding: 0px;">
|
|
<label><?php echo "Basic Amt ($INRSYM)"; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditRevenueBasicValue', 'value' => set_value('txtEditBasicValue'), 'id' => 'txtEditRevenueBasicValue', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<label>Discount Type </label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Select Discount Type');
|
|
//print_r( $options);
|
|
|
|
if (!empty($TaxType)) {
|
|
foreach ($TaxType as $SID) :
|
|
|
|
|
|
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('EditDiscountType', $options, set_value('EditDiscountType'), 'id="EditDiscountType"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Discount Rate </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditDiscount', 'value' => set_value('txtEditDiscount'), 'id' => 'txtEditDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();calculateDiscount(1);', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Discounted Amt <?php echo "($INRSYM)" ?> </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditAfterDiscount', 'value' => set_value('txtEditAfterDiscount'), 'id' => 'txtEditAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-2">
|
|
<label>CGST in %</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueEditCgst', 'value' => set_value('RevenueEditCgst', 0), 'id' => 'RevenueEditCgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueEditAfterCgst', 'value' => set_value('RevenueEditAfterCgst', 0), 'id' => 'RevenueEditAfterCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12" style="text-align:left;">
|
|
<div class="col-md-4">
|
|
<label>Packaging Type </label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Select Packaging Type');
|
|
//print_r( $options);
|
|
|
|
if (!empty($TaxType)) {
|
|
foreach ($TaxType as $SID) :
|
|
|
|
|
|
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('EditPackagingType', $options, set_value('EditPackagingType'), 'id="EditPackagingType"', 'class="form-control "');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Packaging Rate </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditPackaging', 'value' => set_value('txtEditPackaging'), 'id' => 'txtEditPackaging', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Packaging Amt <?php echo "($INRSYM)" ?> </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditAfterPackaging', 'value' => set_value('txtEditAfterPackaging'), 'id' => 'txtEditAfterPackaging', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div id="SGSTEditModel">
|
|
<div class="col-md-2">
|
|
<label>SGST in %</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueEditSgst', 'value' => set_value('RevenueEditSgst', 0), 'id' => 'RevenueEditSgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueEditAfterSgst', 'value' => set_value('RevenueEditAfterSgst', 0), 'id' => 'RevenueEditAfterSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="IGSTEditModel">
|
|
<div class="col-md-2">
|
|
<label>IGST in %</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueEditIgst', 'value' => set_value('RevenueEditIgst', 0), 'id' => 'RevenueEditIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueEditAfterIgst', 'value' => set_value('RevenueEditAfterIgst', 0), 'id' => 'RevenueEditAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-2">
|
|
<label>Freight Type </label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Select Freight Type');
|
|
//print_r( $options);
|
|
|
|
if (!empty($FreightType)) {
|
|
foreach ($FreightType as $SID) :
|
|
|
|
|
|
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('drpEditFreight', $options, set_value('drpEditFreight'), 'id="drpEditFreight"', 'class="form-control "');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2" id="EditTripsValue" style="display:none;">
|
|
<label>NO Of Trips</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditNOOfTrips', 'value' => set_value('EditNOOfTrips'), 'id' => 'EditNOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(1);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Freight Rate </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditFreight', 'value' => set_value('txtEditFreight'), 'id' => 'txtEditFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Freight Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditAfterFreight', 'value' => set_value('txtEditAfterFreight'), 'id' => 'txtEditAfterFreight', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-4">
|
|
<label> Insurance Amt <?php echo "($INRSYM)" ?> (if Any)</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtEditInsurance', 'value' => set_value('txtEditInsurance'), 'id' => 'txtEditInsurance', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateEditTotalValue(1);', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
|
|
<?php
|
|
$data = array('name' => 'txtEditRevenueTotalOrderValue', 'value' => set_value('txtEditTotalOrderValue'), 'id' => 'txtEditRevenueTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label><?php echo "Revenue Description"; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Edit_Service_Description', 'value' => set_value('Edit_Service_Description'), 'id' => 'Edit_Service_Description', 'class' => 'form-control', 'rows' => '2', 'cols' => '100');
|
|
echo form_textarea($data);;
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-offset-9 col-md-3">
|
|
|
|
<a class="btn btn-success EditRevenue" ID="EditRevenue"> <span class="bold">Edit Revenue</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- footer for revenue po -->
|
|
<div class="modal-footer">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="container-fluid">
|
|
<table class="table table-bordered">
|
|
<div align="right" style="padding-right:10px">
|
|
|
|
<!-- Model for revenue PO -->
|
|
<div id="REVENUE" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:1060px;">
|
|
<div class="modal-header">
|
|
<center>
|
|
<h4>Select Revenue Purchase Order Line Item </h4>
|
|
</center>
|
|
</div>
|
|
<div align="left">
|
|
<div class="col-md-12">
|
|
<div class="col-md-2">
|
|
<label>Item Code<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Item Code');
|
|
|
|
|
|
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Item Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ItemName', 'value' => set_value('ItemName'), 'id' => 'ItemName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>UOM</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-3">
|
|
<label>Quantity<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label><?php echo "Rate ($INRSYM)"; ?><span class="badge" style="color:red;text-align:right;background-color: #fff ;"></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Rate', 'value' => set_value('Rate'), 'id' => 'Rate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Per</label> <?php
|
|
$data = array('name' => 'addrevenueEmergPer', 'value' => set_value('addrevenueEmergPer'), 'id' => 'addrevenueEmergPer', 'class' => 'form-control');
|
|
echo form_input($data); ?>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label><?php echo "Basic Amt ($INRSYM)"; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtBasicValue', 'value' => set_value('txtBasicValue'), 'id' => 'txtBasicValue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-12" style="padding:0px;">
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<label>Discount Type <span class="badge" style="color:red;text-align:right;background-color: #fff ;"></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Select Discount Type');
|
|
//print_r( $options);
|
|
|
|
if (!empty($TaxType)) {
|
|
foreach ($TaxType as $SID) :
|
|
|
|
|
|
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('DiscountType', $options, set_value('DiscountType'), 'id="DiscountType"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Discount Rate<span class="badge" style="color:red;text-align:right;background-color: #fff ;"> </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtDiscount', 'value' => set_value('txtDiscount'), 'id' => 'txtDiscount', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();calculateDiscount(0);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Discounted Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtAfterDiscount', 'value' => set_value('txtAfterDiscount'), 'id' => 'txtAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>CGST In %</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueCgst', 'value' => set_value('RevenueCgst', 0), 'id' => 'RevenueCgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change();RevenueChangeSgst();');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueAfterCgst', 'value' => set_value('RevenueAfterCgst', 0), 'id' => 'RevenueAfterCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-12" style="text-align:left;">
|
|
<div class="col-md-4">
|
|
<label>Packaging Type <span class="badge" style="color:red;text-align:right;background-color: #fff ;"></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Select Packaging Type');
|
|
//print_r( $options);
|
|
|
|
if (!empty($TaxType)) {
|
|
foreach ($TaxType as $SID) :
|
|
|
|
|
|
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('PackagingType', $options, set_value('PackagingType'), 'id="PackagingType"', 'class="form-control "');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Packaging Rate <span class="badge" style="color:red;text-align:right;background-color: #fff ;"></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtPackaging', 'value' => set_value('txtPackaging'), 'id' => 'txtPackaging', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculatePackaging(0);change();');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Packaging Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtAfterPackaging', 'value' => set_value('txtAfterPackaging'), 'id' => 'txtAfterPackaging', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div id="SGSTAddModel">
|
|
<div class="col-md-2">
|
|
<label>SGST In %</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueSgst', 'value' => set_value('RevenueSgst', 0), 'id' => 'RevenueSgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueAfterSgst', 'value' => set_value('RevenueAfterSgst', 0), 'id' => 'RevenueAfterSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="IGSTAddModel" style="display:none;">
|
|
<div class="col-md-2">
|
|
<label>IGST In %</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueIgst', 'value' => set_value('RevenueIgst', 0), 'id' => 'RevenueIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'change()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RevenueAfterIgst', 'value' => set_value('RevenueAfterIgst', 0), 'id' => 'RevenueAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-2">
|
|
<label>Freight Type <span class="badge" style="color:red;text-align:right;background-color: #fff ;"></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Select Freight Type');
|
|
//print_r( $options);
|
|
|
|
if (!empty($FreightType)) {
|
|
foreach ($FreightType as $SID) :
|
|
|
|
|
|
$options[$SID->ConfigValue] = $SID->ConfigValue;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('drpFreight', $options, set_value('drpFreight'), 'id="drpFreight"', 'class="form-control "');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2" id="TripsValue" style="display:none;">
|
|
<label>NO Of Trips<span class="badge" style="color:red;text-align:right;background-color: #fff ;"></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'NOOfTrips', 'value' => set_value('NOOfTrips'), 'id' => 'NOOfTrips', 'class' => 'form-control num', 'onchange' => 'calculateFreight(0);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Freight Rate <span class="badge" style="color:red;text-align:right;background-color: #fff ;"></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtFreight', 'value' => set_value('txtFreight'), 'id' => 'txtFreight', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreight(0);change();');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Freight Amt <?php echo "($INRSYM)" ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtAfterFreight', 'value' => set_value('txtAfterFreight'), 'id' => 'txtAfterFreight', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label> Insurance <?php echo "($INRSYM)" ?> (if Any)</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtInsurance', 'value' => set_value('txtInsurance'), 'id' => 'txtInsurance', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateTotalValue(0);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-4 ">
|
|
<label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'txtTotalOrderValue', 'value' => set_value('txtTotalOrderValue'), 'id' => 'txtTotalOrderValue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label><?php echo "Revenue Description"; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Add_Service_Description', 'value' => set_value('Add_Service_Description'), 'id' => 'Add_Service_Description', 'class' => 'form-control', 'rows' => '2', 'cols' => '100');
|
|
echo form_textarea($data);;
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-offset-9 col-md-3">
|
|
|
|
<a class="btn btn-success font AddRevenue" ID="AddRevenue"> <span class="bold">Add Revenue</span></a>
|
|
|
|
|
|
<a class="btn btn-success" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- footer for revenue po -->
|
|
<div class="modal-footer"></div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Model for service PO -->
|
|
<div class="modal fade" id="SERVICE" role="dialog">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:1000px;">
|
|
<div class="modal-header">
|
|
<center>
|
|
<h4>Add Service Purchase Order Item </h4>
|
|
</center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Item Code<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Item Code');
|
|
//print_r( $options);
|
|
|
|
if (!empty($MaterialList)) {
|
|
foreach ($MaterialList as $SID) :
|
|
|
|
|
|
$options[$SID->MaterialCode] = $SID->MaterialCode . ' ' . ' - ' . ' ' . $SID->MaterialName;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('ServiceMaterialCode', $options, set_value('ServiceMaterialCode'), 'id="ServiceMaterialCode"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Item Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ServiceDescription', 'value' => set_value('ServiceDescription'), 'id' => 'ServiceDescription', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>UOM</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ServiceUOM', 'value' => set_value('ServiceUOM'), 'id' => 'ServiceUOM', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Frequency</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'FrequencyChange', 'value' => set_value('FrequencyChange'), 'id' => 'FrequencyChange', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- <div class="col-md-12">
|
|
<div class="col-md-4" id="DisplayScheduleDiv" style="display:none;">
|
|
<label>Select Service Schedule Type</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$Schdule = array("One Time", "Recurring");
|
|
|
|
|
|
if (!empty($Schdule)) {
|
|
foreach ($Schdule as $Sch) :
|
|
|
|
$SchType[$Sch] = $Sch;
|
|
|
|
endforeach;
|
|
}
|
|
echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType"', 'class = "form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" id="ServicePeriodOption" style="display:none;">
|
|
<label>Select Service Period Option</label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
|
|
|
|
if (!empty($ServiceOption)) {
|
|
foreach ($ServiceOption as $SerOption) :
|
|
|
|
|
|
$ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue;
|
|
endforeach;
|
|
}
|
|
echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" id="NoServices" style="display:none;">
|
|
<label>Number of Services</label>
|
|
<div class="form-group">
|
|
<?php
|
|
|
|
$data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo', 1), 'id' => 'ServiceNo', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Quantity<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ServiceQuantity', 'value' => set_value('ServiceQuantity'), 'id' => 'ServiceQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label><?php echo "Rate ($INRSYM)"; ?><span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ServiceRate', 'value' => set_value('ServiceRate'), 'id' => 'ServiceRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange()');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Per</label> <?php
|
|
$data = array('name' => 'AddEmergPer', 'value' => set_value('AddEmergPer'), 'id' => 'AddEmergPer', 'class' => 'form-control');
|
|
echo form_input($data); ?>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label><?php echo "Basic Amount In ($INRSYM)"; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ServiceBasAmt', 'value' => set_value('ServiceBasAmt'), 'id' => 'ServiceBasAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-12" style="padding:0px;">
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-6" align="right">
|
|
|
|
CGST In %
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'Cgst', 'value' => set_value('Cgst', 0), 'id' => 'Cgst', 'class' => 'form-control num', 'placeholder' => 'CGST TAX PERCENTAGE', 'onchange' => 'Ratechange();ChangeSgst();', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'AfterCgst', 'value' => set_value('AfterCgst', 0), 'id' => 'AfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-6" align="right">
|
|
|
|
SGST In %
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'Sgst', 'value' => set_value('Sgst', 0), 'id' => 'Sgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'Ratechange()', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'AfterSgst', 'value' => set_value('AfterSgst', 0), 'id' => 'AfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-6" align="right">
|
|
|
|
IGST In %
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'Igst', 'value' => set_value('Igst', 0), 'id' => 'Igst', 'class' => 'form-control num', 'placeholder' => 'IGST TAX PERCENTAGE', 'onchange' => 'Ratechange()', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'AfterIgst', 'value' => set_value('AfterIgst', 0), 'id' => 'AfterIgst', 'class' => 'form-control num', 'placeholder' => 'After IGST', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-8" align="right">
|
|
|
|
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'OtherAllowances', 'value' => set_value('OtherAllowances', 0), 'id' => 'OtherAllowances', 'class' => 'form-control num', 'placeholder' => 'Other Allowances', 'onchange' => 'Ratechange()', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-8" align="right">
|
|
|
|
<label><?php echo "Total Order Amount In ($INRSYM)"; ?></label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'TotalOrderValue', 'value' => set_value('TotalOrderValue'), 'id' => 'TotalOrderValue', 'class' => 'form-control num', 'placeholder' => 'Total value', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12" style="padding: 0px 30px 10px 30px;">
|
|
<label>Service Description<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</span></label> <?php
|
|
$data = array('name' => 'txtSpcialInstructionSingle', 'value' => set_value('txtSpcialInstructionSingle'), 'id' => 'txtSpcialInstructionSingle', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
|
echo form_textarea($data); ?>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="modal-footer">
|
|
<div class="col-md-12">
|
|
<a class="btn btn-success font AddService" ID="AddService"> <span class="bold">Add Service</span></a>
|
|
<a class="btn btn-success" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- model for import PO -->
|
|
|
|
<div class="modal fade" id="IMPORT" role="dialog">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:900px;">
|
|
<div class="modal-header">
|
|
|
|
<center>
|
|
<h4>Add Import Purchase Order Item </h4>
|
|
</center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Req No</label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Req No');
|
|
echo form_dropdown('ImportMaterialCode', $options, set_value('ImportMaterialCode'), 'id="ImportMaterialCode"', 'class="form-control required"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Department Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ImportDepartmentName', 'value' => set_value('ImportDepartmentName'), 'id' => 'ImportDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Cost Center Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$options = array("0" => 'Select Cost Center');
|
|
|
|
echo form_dropdown('ImportCostCenter', $options, set_value('ImportCostCenter'), 'id="ImportCostCenter"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3" style="display:none;">
|
|
<label>Available Budget Amount</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'importbudAmt', 'value' => set_value('importbudAmt'), 'id' => 'importbudAmt', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_hidden($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-2">
|
|
<label>Item Code</label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Item Code');
|
|
|
|
if (!empty($MaterialList)) {
|
|
foreach ($MaterialList as $SID) :
|
|
|
|
|
|
$options[$SID->MaterialCode] = $SID->MaterialCode . ' ' . ' - ' . ' ' . $SID->MaterialName;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('ImportMaterialCode', $options, set_value('ImportMaterialCode'), 'id="ImportMaterialCode"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Item Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ImportItemName', 'value' => set_value('ImportItemName'), 'id' => 'ImportItemName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>UOM</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ImUOM', 'value' => set_value('ImUOM'), 'id' => 'ImUOM', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Quantity</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imQuantity', 'value' => set_value('imQuantity'), 'id' => 'imQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label><?php echo "Rate ($INRSYM)"; ?> </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imRate', 'value' => set_value('imRate'), 'id' => 'imRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label><?php echo "Basic Amount In ($INRSYM)"; ?></label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imTotalAmount', 'value' => set_value('imTotalAmount'), 'id' => 'imTotalAmount', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3">
|
|
|
|
Basic Price in US $ per Ton :
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imBasicPrice', 'value' => set_value('imBasicPrice'), 'id' => 'imBasicPrice', 'class' => 'form-control num', 'placeholder ' => 'basic price', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
Exchange Rate :
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExchangeRt', 'value' => set_value('ExchangeRt'), 'id' => 'ExchangeRt', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
Basic value <?php echo "($INRSYM)" ?> :
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'INRBasicvalue', 'value' => set_value('INRBasicvalue'), 'id' => 'INRBasicvalue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<!--<div class="col-md-3">
|
|
<a href="http://www.xe.com/" target="_blank"><u>Click nere to check Today's Foreign Exchange value</u></a>
|
|
</div>-->
|
|
|
|
<div class="col-md-12" style="border:1px solid #000;padding:0px;">
|
|
<br />
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Basic Price:
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'BasicPriceTax', 'value' => set_value('BasicPriceTax'), 'id' => 'BasicPriceTax', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterBasicPriceTax', 'value' => set_value('AfterBasicPriceTax'), 'id' => 'AfterBasicPriceTax', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Landing charge
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'LandingCharge', 'value' => set_value('LandingCharge'), 'id' => 'LandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterLandingCharge', 'value' => set_value('AfterLandingCharge'), 'id' => 'AfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
High seas sales charge
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Highseas ', 'value' => set_value('Highseas'), 'id' => 'Highseas', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterHighseas', 'value' => set_value('AfterHighseas'), 'id' => 'AfterHighseas', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Custom duty : (a)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Customduty', 'value' => set_value('Customduty'), 'id' => 'Customduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomduty', 'value' => set_value('AfterCustomduty'), 'id' => 'AfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Excise duty : (b)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExcisedutyTax', 'value' => set_value('ExcisedutyTax'), 'id' => 'ExcisedutyTax', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterExcisedutyTax', 'value' => set_value('AfterExcisedutyTax'), 'id' => 'AfterExcisedutyTax', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Excise duty ED_cess : (C)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExcisedutyEDcess', 'value' => set_value('ExcisedutyEDcess'), 'id' => 'ExcisedutyEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterExcisedutyEDcess', 'value' => set_value('AfterExcisedutyEDcess'), 'id' => 'AfterExcisedutyEDcess', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Excise duty S & H cess :(d)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExcisedutySHcess', 'value' => set_value('ExcisedutySHcess'), 'id' => 'ExcisedutySHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterExcisedutySHcess', 'value' => set_value('AfterExcisedutySHcess'), 'id' => 'AfterExcisedutySHcess', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Custom ED_cess : (e)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomEDcess', 'value' => set_value('CustomEDcess'), 'id' => 'CustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomEDcess', 'value' => set_value('AfterCustomEDcess'), 'id' => 'AfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Custom S & H cess : (f)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomSHcess', 'value' => set_value('CustomSHcess'), 'id' => 'CustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomSHcess', 'value' => set_value('AfterCustomSHcess'), 'id' => 'AfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Additional Excise duty : (g)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AdditionalExciseduty ', 'value' => set_value('AdditionalExciseduty'), 'id' => 'AdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterAdditionalExciseduty', 'value' => set_value('AfterAdditionalExciseduty'), 'id' => 'AfterAdditionalExciseduty', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-8">
|
|
Gross duty payable
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Grossdutypayable ', 'value' => set_value('Grossdutypayable'), 'id' => 'Grossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-8">
|
|
Available Modvat set-off on import :
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AvailableModvat', 'value' => set_value('AvailableModvat'), 'id' => 'AvailableModvat', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?> (b + c + d + g)
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-8">
|
|
Gross expenses due to custom duty:
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Grossexpenses', 'value' => set_value('Grossexpenses'), 'id' => 'Grossexpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
<center> <label>Cost of the product Per KG</label></center>
|
|
<hr />
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
purchase rate [Basic]
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'purchaserate', 'value' => set_value('purchaserate'), 'id' => 'purchaserate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" style="margin-top: -4.8%">
|
|
<span>Quantity</span>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'PurQuantity', 'value' => set_value('PurQuantity'), 'id' => 'PurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-4">
|
|
Custom Duty Expenses
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomDutyExpenses ', 'value' => set_value('CustomDutyExpenses'), 'id' => 'CustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
RMC Including Customers
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RMCIncludingCustomers', 'value' => set_value('RMCIncludingCustomers'), 'id' => 'RMCIncludingCustomers', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a class="btn btn-info font AddImport" ID="AddImport"> <span class="bold">Add Import</span></a>
|
|
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Model for Capital PO -->
|
|
<div class="modal fade" id="CAPITAL" role="dialog">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:900px;">
|
|
<div class="modal-header">
|
|
|
|
<center>
|
|
<h4>Add Capital Purchase Order Item </h4>
|
|
</center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-2">
|
|
<label>Item Code</label>
|
|
<div>
|
|
<?php
|
|
$options = array("0" => 'Item Code');
|
|
|
|
if (!empty($MaterialList)) {
|
|
foreach ($MaterialList as $SID) :
|
|
|
|
|
|
$options[$SID->MaterialCode] = $SID->MaterialCode . ' ' . ' - ' . ' ' . $SID->MaterialName;
|
|
|
|
endforeach;
|
|
}
|
|
|
|
echo form_dropdown('ImportMaterialCode', $options, set_value('ImportMaterialCode'), 'id="ImportMaterialCode"', 'class="form-control"');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
<label>Item Name</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ImportItemName', 'value' => set_value('ImportItemName'), 'id' => 'ImportItemName', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>UOM</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ImUOM', 'value' => set_value('ImUOM'), 'id' => 'ImUOM', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Quantity</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imQuantity', 'value' => set_value('imQuantity'), 'id' => 'imQuantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label><?php echo "Rate ($INRSYM)"; ?> </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imRate', 'value' => set_value('imRate'), 'id' => 'imRate', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label><?php echo "Basic Amount In ($INRSYM)"; ?> </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imTotalAmount', 'value' => set_value('imTotalAmount'), 'id' => 'imTotalAmount', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3">
|
|
|
|
Basic Price in US $ per Ton :
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'imBasicPrice', 'value' => set_value('imBasicPrice'), 'id' => 'imBasicPrice', 'class' => 'form-control', 'placeholder ' => 'basic price', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
Exchange Rate :
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExchangeRt', 'value' => set_value('ExchangeRt'), 'id' => 'ExchangeRt', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
Basic value <?php echo "($INRSYM)" ?> :
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'INRBasicvalue', 'value' => set_value('INRBasicvalue'), 'id' => 'INRBasicvalue', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<!--<div class="col-md-3">
|
|
<a href="http://www.xe.com/" target="_blank"><u>Click nere to check Today's Foreign Exchange value</u></a>
|
|
</div>-->
|
|
|
|
<div class="col-md-12" style="border:1px solid #000;padding:0px;">
|
|
<br />
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Basic Price:
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'BasicPriceTax', 'value' => set_value('BasicPriceTax'), 'id' => 'BasicPriceTax', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterBasicPriceTax', 'value' => set_value('AfterBasicPriceTax'), 'id' => 'AfterBasicPriceTax', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Landing charge
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'LandingCharge', 'value' => set_value('LandingCharge'), 'id' => 'LandingCharge', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterLandingCharge', 'value' => set_value('AfterLandingCharge'), 'id' => 'AfterLandingCharge', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
High seas sales charge
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Highseas ', 'value' => set_value('Highseas'), 'id' => 'Highseas', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterHighseas', 'value' => set_value('AfterHighseas'), 'id' => 'AfterHighseas', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Custom duty : (a)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Customduty', 'value' => set_value('Customduty'), 'id' => 'Customduty', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomduty', 'value' => set_value('AfterCustomduty'), 'id' => 'AfterCustomduty', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Excise duty : (b)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExcisedutyTax', 'value' => set_value('ExcisedutyTax'), 'id' => 'ExcisedutyTax', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterExcisedutyTax', 'value' => set_value('AfterExcisedutyTax'), 'id' => 'AfterExcisedutyTax', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Excise duty ED_cess : (C)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExcisedutyEDcess', 'value' => set_value('ExcisedutyEDcess'), 'id' => 'ExcisedutyEDcess', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterExcisedutyEDcess', 'value' => set_value('AfterExcisedutyEDcess'), 'id' => 'AfterExcisedutyEDcess', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Excise duty S & H cess :(d)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ExcisedutySHcess', 'value' => set_value('ExcisedutySHcess'), 'id' => 'ExcisedutySHcess', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterExcisedutySHcess', 'value' => set_value('AfterExcisedutySHcess'), 'id' => 'AfterExcisedutySHcess', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Custom ED_cess : (e)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomEDcess', 'value' => set_value('CustomEDcess'), 'id' => 'CustomEDcess', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomEDcess', 'value' => set_value('AfterCustomEDcess'), 'id' => 'AfterCustomEDcess', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Custom S & H cess : (f)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomSHcess', 'value' => set_value('CustomSHcess'), 'id' => 'CustomSHcess', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterCustomSHcess', 'value' => set_value('AfterCustomSHcess'), 'id' => 'AfterCustomSHcess', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
Additional Excise duty : (g)
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AdditionalExciseduty ', 'value' => set_value('AdditionalExciseduty'), 'id' => 'AdditionalExciseduty', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AfterAdditionalExciseduty', 'value' => set_value('AfterAdditionalExciseduty'), 'id' => 'AfterAdditionalExciseduty', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-8">
|
|
Gross duty payable
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Grossdutypayable ', 'value' => set_value('Grossdutypayable'), 'id' => 'Grossdutypayable', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-8">
|
|
Available Modvat set-off on import :
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'AvailableModvat', 'value' => set_value('AvailableModvat'), 'id' => 'AvailableModvat', 'class' => 'form-control', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?> (b + c + d + g)
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-8">
|
|
Gross expenses due to custom duty:
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Grossexpenses', 'value' => set_value('Grossexpenses'), 'id' => 'Grossexpenses', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
<center> <label>Cost of the product Per KG</label></center>
|
|
<hr />
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
purchase rate [Basic]
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'purchaserate', 'value' => set_value('purchaserate'), 'id' => 'purchaserate', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4" style="margin-top: -4.8%">
|
|
<span>Quantity</span>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'PurQuantity', 'value' => set_value('PurQuantity'), 'id' => 'PurQuantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-4">
|
|
Custom Duty Expenses
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CustomDutyExpenses ', 'value' => set_value('CustomDutyExpenses'), 'id' => 'CustomDutyExpenses', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
RMC Including Customers
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RMCIncludingCustomers', 'value' => set_value('RMCIncludingCustomers'), 'id' => 'RMCIncludingCustomers', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a class="btn btn-info font AddImport" ID="AddImport"> <span class="bold">Add Capital</span></a>
|
|
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<br />
|
|
</div>
|
|
|
|
|
|
<div class="box-body">
|
|
<table id="serviceTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px">
|
|
<thead style="background-color: #ddd;">
|
|
<tr>
|
|
<th>SNo</th>
|
|
<th>Requisition No</th>
|
|
<th>Item Code</th>
|
|
<th>Item Description</th>
|
|
<th>Quantity</th>
|
|
<th>UOM</th>
|
|
<th>Rate<?php echo "($INRSYM)" ?></th>
|
|
<th>Basic Amount<?php echo "($INRSYM)" ?></th>
|
|
<th>Tax Amount<?php echo "($INRSYM)" ?></th>
|
|
<th>Total Order Amount<?php echo "($INRSYM)" ?></th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="ServiceAppend"></tbody>
|
|
<tbody id="RevenueAppend"></tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- /.box-body -->
|
|
</div>
|
|
|
|
</table>
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
<!-- Revenue po taxes -->
|
|
<div class="col-md-12" style='border : 1px solid; display:none;' id="revenuepotaxes">
|
|
<br />
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Basic Amount <?php echo "($INRSYM)" ?> </label>
|
|
<?php
|
|
$data = array('name' => 'txtTotBasicAmountRevenue', 'value' => set_value('txtTotBasicAmountRevenue'), 'id' => 'txtTotBasicAmountRevenue', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Total Discount <?php echo "($INRSYM)" ?> </label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalDiscount', 'value' => set_value('txtTotalDiscount'), 'id' => 'txtTotalDiscount', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>CGST <?php echo "($INRSYM)" ?> </label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalCGST', 'value' => set_value('txtTotalCGST'), 'id' => 'txtTotalCGST', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
<div class="col-md-3" id="displaySGST">
|
|
<label>SGST <?php echo "($INRSYM)" ?> </label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalSGST', 'value' => set_value('txtTotalSGST'), 'id' => 'txtTotalSGST', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-3" id="displayIGST" style="display:none;">
|
|
<label> IGST <?php echo "($INRSYM)" ?> </label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalIGST', 'value' => set_value('txtTotalIGST'), 'id' => 'txtTotalIGST', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Total Packaging <?php echo "($INRSYM)" ?> </label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalPackaing', 'value' => set_value('txtTotalPackaing'), 'id' => 'txtTotalPackaing', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Total Insurance <?php echo "($INRSYM)" ?> </label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalInsurance', 'value' => set_value('txtTotalInsurance'), 'id' => 'txtTotalInsurance', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Total Freight <?php echo "($INRSYM)" ?></label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalFreight', 'value' => set_value('txtTotalFreight'), 'id' => 'txtTotalFreight', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Total Order Value <?php echo "($INRSYM)" ?></label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalOrderValueSummary', 'value' => set_value('txtTotalOrderValueSummary'), 'id' => 'txtTotalOrderValueSummary', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-12">
|
|
<label>Special Instructions </label>
|
|
<?php
|
|
$data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction'), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '8');
|
|
echo form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-3 col-md-offset-9"><br />
|
|
<input type="hidden" name="txtPoRange" id="txtPoRange" />
|
|
<input type="hidden" name="isEdit" id="isEdit" value="0" />
|
|
<input type="hidden" name="txtStatus1" id="txtStatus1" />
|
|
<input type="hidden" name="txtRowCount1" id="txtRowCount1" />
|
|
<input type="hidden" name="txtDeletedRow1" id="txtDeletedRow1" />
|
|
<input type="hidden" name="CheckLocalInter" id="CheckLocalInter" />
|
|
<input type="hidden" name="Budget" id="Budget" />
|
|
<input type="hidden" name="txtSpecial" id="txtSpecial" />
|
|
<input type="hidden" name="txtQuality" id="txtQuality" />
|
|
<!-- <a class="btn btn-success Save" ID="Save" onclick="Save()" > <span class="bold">Save</span></a> -->
|
|
|
|
<a class="btn btn-success Submit" ID="Submit" onclick="showsubmit()"> <span class="bold">Submit</span></a>
|
|
<a class="btn btn-success Save" ID="Cancel" href="<?php echo base_url() . 'EmergencyPO'; ?>"> <span class="bold">Reset</span></a>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12" style="padding:0px;"><br />
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Service po taxes -->
|
|
<div class="col-md-12" style="border : 1px solid; display:none;" id="servicepotaxes">
|
|
<div class="col-md-12" style="padding:0px;">
|
|
|
|
<div class="col-md-2">
|
|
<label>Basic Amount <?php echo "($INRSYM)" ?></label>
|
|
<?php
|
|
$data = array('name' => 'txtTotBasicAmount', 'value' => set_value('txtTotBasicAmount'), 'id' => 'txtTotBasicAmount', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>CGST <?php echo "($INRSYM)" ?></label>
|
|
<?php
|
|
$data = array('name' => 'txtTotCgst', 'value' => set_value('txtTotCgst'), 'id' => 'txtTotCgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-2">
|
|
<label>SGST <?php echo "($INRSYM)" ?></label>
|
|
<?php
|
|
$data = array('name' => 'txtTotSgst', 'value' => set_value('txtTotSgst'), 'id' => 'txtTotSgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>IGST <?php echo "($INRSYM)" ?> </label>
|
|
<?php
|
|
$data = array('name' => 'txtTotIgst', 'value' => set_value('txtTotIgst'), 'id' => 'txtTotIgst', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
|
|
<?php
|
|
$data = array('name' => 'txtTotOtherAllo', 'value' => set_value('txtTotOtherAllo'), 'id' => 'txtTotOtherAllo', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-2">
|
|
|
|
<label>Total Order Value <?php echo "($INRSYM)" ?></label>
|
|
<?php
|
|
$data = array('name' => 'txtTotalOrderValueSummaryService', 'value' => set_value('txtTotalOrderValueSummaryService'), 'id' => 'txtTotalOrderValueSummaryService', 'class' => 'form-control num', 'readonly' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<!--start new fields 1 sep-->
|
|
<div class="col-md-12" id="emergdescofpoDiv" style="display:none;">
|
|
<label>Description Of Service<span class="badge" style="color:red;text-align:right;background-color: #fff ;">*</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'emergdescofpo', 'value' => set_value('emergdescofpo'), 'id' => 'emergdescofpo', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
|
|
echo form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div><!--end new fields 1 sep-->
|
|
<div class="col-md-12" style="padding:0px;">
|
|
<div class="col-md-12">
|
|
<label>Scope Of Work</label> <?php
|
|
$data = array('name' => 'ScopeOfWork', 'value' => set_value('ScopeOfWork'), 'id' => 'ScopeOfWork', 'class' => 'form-control', 'rows' => '8');
|
|
echo form_textarea($data); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
<div class="row">
|
|
<br />
|
|
<div align="right" style="padding-right:10px">
|
|
<input type="hidden" name="txtStatus" id="txtStatus" />
|
|
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
|
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
|
<input type="hidden" name="SpcialInstruction" id="SpcialInstruction">
|
|
<input type="hidden" name="txtDeliveryAddress" id="txtDeliveryAddress">
|
|
|
|
|
|
<input type="hidden" name="txtSpecialservice" id="txtSpecialservice" />
|
|
|
|
<input type="hidden" name="txtworkstatus" id="txtworkstatus" />
|
|
|
|
<a class="btn btn-success Submit" ID="Submit" onclick="showsubmit()"> <span class="bold">Submit</span></a>
|
|
<a class="btn btn-success Save" ID="Cancel" href="<?php echo base_url() . 'EmergencyPO'; ?>"> <span class="bold">Reset</span></a>
|
|
</div><br />
|
|
</div>
|
|
</div>
|
|
<br />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<script type="text/html" id="RevenueList">
|
|
<tr id="<%=index%>">
|
|
<td align="left"><%=index%></td>
|
|
<td align="left"><%=ReqNo%></td>
|
|
<td align="left"><%=MaterialCode%></td>
|
|
<td align="left"><%=MaterialName%></td>
|
|
<td align="left"><%=Quantity%></td>
|
|
<td align="left"><%=UOM%></td>
|
|
<td align="left"><%=Rate%></td>
|
|
<td align="left"><%=BasicAmount%></td>
|
|
<td align="left"><%=Taxvalue%></td>
|
|
<td align="left"><%=TotalValue%></td>
|
|
|
|
<td>
|
|
<a data-target='#EDITREVENUE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i> </a> <a href='#' onclick="DeleteRevenueRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</script>
|
|
<script>
|
|
var index = '1';
|
|
var userid = '';
|
|
|
|
|
|
|
|
|
|
$("#BudgetType").change(function() {
|
|
|
|
var aa = $("#BudgetType option:selected").text();
|
|
|
|
$('#Budget').val(aa);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.AddRevenue').click(function() {
|
|
|
|
tinyMCE.triggerSave();
|
|
var basic = $('#txtBasicValue').val();
|
|
var discount = $('#txtAfterDiscount').val();
|
|
var finalbasic = basic - discount;
|
|
//alert(basic+'-'+discount+'-'+finalbasic);
|
|
if (validateAddRevenueTax()) {
|
|
|
|
|
|
var temp = index;
|
|
var Reqnumber = $('#purpose').val();
|
|
var departmentName = $('#DepartmentName').val();
|
|
var AvilBudget = $('#AvalBuget').val();
|
|
var costCode = $('#CostCenterName').val();
|
|
var materialCode = $('#MaterialCode').val();
|
|
var materialName = $("#ItemName").val();
|
|
var uom = $("#UOM").val();
|
|
var quantity = parseFloat($("#Quantity").val()).toFixed(2);
|
|
var itemRate = parseFloat($("#Rate").val()).toFixed(2);
|
|
var PER = $("#addrevenueEmergPer").val()
|
|
if (PER == '') {
|
|
PER = $("#UOM").val();
|
|
}
|
|
var DisType = $("#DiscountType").val();
|
|
var DisVal = $("#txtDiscount").val();
|
|
var AfterDisVal = $("#txtAfterDiscount").val();
|
|
|
|
var PackOption = PackagingCalculation;
|
|
var Frioption = freightCalculation;
|
|
var PackType = $("#PackagingType").val();
|
|
var PackVal = $("#txtPackaging").val();
|
|
var AfterPackVal = $("#txtAfterPackaging").val();
|
|
|
|
|
|
|
|
var Cgst = $("#RevenueCgst").val();
|
|
var AfterCgst = $("#RevenueAfterCgst").val();
|
|
var Sgst = $("#RevenueSgst").val();
|
|
var AfterSgst = $("#RevenueAfterSgst").val();
|
|
var Igst = $("#RevenueIgst").val();
|
|
var AfterIgst = $("#RevenueAfterIgst").val();
|
|
|
|
|
|
var FreightType = $("#drpFreight").val();
|
|
var FreightVal = $("#txtFreight").val();
|
|
var AfterFreightVal = $("#txtAfterFreight").val();
|
|
var NoOfTrip = $("#NOOfTrips").val();
|
|
var basicval = $("#txtBasicValue").val();
|
|
var Insval = $("#txtInsurance").val();
|
|
var TotalOrderValue = $("#txtTotalOrderValue").val();
|
|
var CheckLocalInter = $("input:radio[name='Range']:checked").val();
|
|
var servicedescription = $("#Add_Service_Description").val();
|
|
|
|
|
|
var TotalTaxValue = calculateRevenueTaxValue();
|
|
|
|
// $('#ReqNo').val(Reqnumber).remove();
|
|
// $('#ReqNo option[value='+Reqnumber+']').remove();
|
|
$('#MaterialCode option[value=' + materialCode + ']').remove();
|
|
|
|
|
|
populateValueMainFormForRevenue();
|
|
|
|
|
|
|
|
index = parseInt(index) + 1;
|
|
|
|
var template = jQuery("#RevenueList").html();
|
|
|
|
|
|
$('#RevenueAppend').append(_.template(template, {
|
|
index: temp,
|
|
ReqNo: Reqnumber,
|
|
MaterialCode: materialCode,
|
|
MaterialName: materialName,
|
|
Quantity: quantity,
|
|
UOM: uom,
|
|
Rate: itemRate,
|
|
BasicAmount: basicval,
|
|
Taxvalue: TotalTaxValue,
|
|
TotalValue: TotalOrderValue
|
|
}));
|
|
|
|
|
|
var theForm = $(".CreatealterPO");
|
|
|
|
addHidden(theForm, "Reqnumber" + temp, Reqnumber);
|
|
addHidden(theForm, "departmentName" + temp, departmentName);
|
|
addHidden(theForm, "AvilBudget" + temp, (AvilBudget?AvilBudget:0));
|
|
addHidden(theForm, "costCode" + temp, costCode);
|
|
addHidden(theForm, "materialCode" + temp, materialCode);
|
|
addHidden(theForm, "materialName" + temp, materialName);
|
|
addHidden(theForm, "uom" + temp, uom);
|
|
addHidden(theForm, "quantity" + temp, quantity);
|
|
addHidden(theForm, "itemRate" + temp, itemRate);
|
|
addHidden(theForm, "per" + temp, PER);
|
|
addHidden(theForm, "DisType" + temp, DisType);
|
|
addHidden(theForm, "DisVal" + temp, DisVal);
|
|
addHidden(theForm, "AfterDisVal" + temp, AfterDisVal);
|
|
addHidden(theForm, "PackOption" + temp, PackOption);
|
|
addHidden(theForm, "PackType" + temp, PackType);
|
|
addHidden(theForm, "PackVal" + temp, PackVal);
|
|
addHidden(theForm, "AfterPackVal" + temp, AfterPackVal);
|
|
|
|
addHidden(theForm, "FreightType" + temp, FreightType);
|
|
addHidden(theForm, "FreightVal" + temp, FreightVal);
|
|
addHidden(theForm, "AfterFreightVal" + temp, AfterFreightVal);
|
|
addHidden(theForm, "NoOfTrip" + temp, NoOfTrip);
|
|
addHidden(theForm, "basicval" + temp, basicval);
|
|
addHidden(theForm, "Insval" + temp, Insval);
|
|
|
|
addHidden(theForm, "service_description" + temp, servicedescription);
|
|
addHidden(theForm, "TotalOrderValue" + temp, TotalOrderValue);
|
|
addHidden(theForm, "CheckLocalInter" + temp, CheckLocalInter);
|
|
addHidden(theForm, "RevenueCgst" + temp, Cgst);
|
|
addHidden(theForm, "RevenueAfterCgst" + temp, AfterCgst);
|
|
addHidden(theForm, "RevenueSgst" + temp, Sgst);
|
|
addHidden(theForm, "RevenueAfterSgst" + temp, AfterSgst);
|
|
addHidden(theForm, "RevenueIgst" + temp, Igst);
|
|
addHidden(theForm, "RevenueAfterIgst" + temp, AfterIgst);
|
|
$('#txtRowCount1').val(temp);
|
|
clearRevenueModalFields();
|
|
// $('#REVENUE').modal('hide');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
function addHidden(theForm, key, value) {
|
|
// Create a hidden input element, and append it to the form:
|
|
var input = document.createElement('input');
|
|
input.type = 'hidden';
|
|
input.name = key;
|
|
'name-as-seen-at-the-server';
|
|
input.id = key;
|
|
'name-as-seen-at-the-server';
|
|
input.value = value;
|
|
theForm.append(input);
|
|
}
|
|
|
|
function populateValueMainFormForRevenue() {
|
|
var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
|
|
|
|
var Cgst = $('#RevenueAfterCgst').val() == '' ? '0.00' : $('#RevenueAfterCgst').val();
|
|
var Sgst = $('#RevenueAfterSgst').val() == '' ? '0.00' : $('#RevenueAfterSgst').val();
|
|
var Igst = $('#RevenueAfterIgst').val() == '' ? '0.00' : $('#RevenueAfterIgst').val();
|
|
|
|
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
|
var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
|
|
var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
|
|
|
var BasicVal = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val();
|
|
var TotalVal = $('#txtTotalOrderValue').val() == '' ? '0.00' : $('#txtTotalOrderValue').val();
|
|
var TotalOrderValueSummary = $('#txtTotalOrderValueSummary').val() == '' ? '0.00' : $('#txtTotalOrderValueSummary').val();
|
|
var totBasicAmt = $('#txtTotBasicAmountRevenue').val() == '' ? '0.00' : $('#txtTotBasicAmountRevenue').val();
|
|
var totDiscountAmt = $('#txtTotalDiscount').val() == '' ? '0.00' : $('#txtTotalDiscount').val();
|
|
var totPackagingAmt = $('#txtTotalPackaing').val() == '' ? '0.00' : $('#txtTotalPackaing').val();
|
|
|
|
var txtTotalCGST = $('#txtTotalCGST').val() == '' ? '0.00' : $('#txtTotalCGST').val();
|
|
var txtTotalSGST = $('#txtTotalSGST').val() == '' ? '0.00' : $('#txtTotalSGST').val();
|
|
var txtTotalIGST = $('#txtTotalIGST').val() == '' ? '0.00' : $('#txtTotalIGST').val();
|
|
|
|
var totFreightAmt = $('#txtTotalFreight').val() == '' ? '0.00' : $('#txtTotalFreight').val();
|
|
var totInsuranceAmt = $('#txtTotalInsurance').val() == '' ? '0.00' : $('#txtTotalInsurance').val();
|
|
var totOrderSummaryAmt = $('#txtTotalOrderValueSummary').val() == '' ? '0.00' : $('#txtTotalOrderValueSummary').val();
|
|
$('#txtTotBasicAmountRevenue').val((parseFloat(totBasicAmt) + parseFloat(BasicVal)).toFixed(2));
|
|
$('#txtTotalDiscount').val((parseFloat(totDiscountAmt) + parseFloat(Discount)).toFixed(2));
|
|
$('#txtTotalPackaing').val((parseFloat(totPackagingAmt) + parseFloat(Packaging)).toFixed(2));
|
|
|
|
$('#txtTotalCGST').val((parseFloat(txtTotalCGST) + parseFloat(Cgst)).toFixed(2));
|
|
$('#txtTotalSGST').val((parseFloat(txtTotalSGST) + parseFloat(Sgst)).toFixed(2));
|
|
$('#txtTotalIGST').val((parseFloat(txtTotalIGST) + parseFloat(Igst)).toFixed(2));
|
|
|
|
$('#txtTotalFreight').val((parseFloat(totFreightAmt) + parseFloat(Freight)).toFixed(2));
|
|
$('#txtTotalInsurance').val((parseFloat(totInsuranceAmt) + parseFloat(Insurance)).toFixed(2));
|
|
$('#txtTotalOrderValueSummary').val((parseFloat(totOrderSummaryAmt) + parseFloat(TotalVal)).toFixed(2));
|
|
|
|
}
|
|
|
|
function clearRevenueModalFields() {
|
|
// To reset the Modal controls
|
|
var isChecked = $('#IsOpenOrder').is(':checked');
|
|
isChecked ? $('#Quantity').val(0).prop('readonly', true).prop('required', false)
|
|
: $('#Quantity').val('').prop('readonly', false).prop('required', true);
|
|
|
|
$('#ReqNo').val('0');
|
|
$('#deptName').val('');
|
|
$('#CostCenter').val("0");
|
|
$('#AvlBudAmt').val(0);
|
|
$('#MaterialCode').val('');
|
|
$("#ItemName").val('');
|
|
$('#UOM').val('');
|
|
$("#Rate").val('');
|
|
$("#addrevenueEmergPer").val('');
|
|
|
|
$("#DiscountType").val('0');
|
|
$("#txtDiscount").val('');
|
|
$("#txtAfterDiscount").val('');
|
|
|
|
|
|
$("#PackagingType").val('0');
|
|
$("#txtPackaging").val('');
|
|
$("#txtAfterPackaging").val('');
|
|
|
|
$("#RevenueCgst").val(0);
|
|
$("#RevenueAfterCgst").val(0);
|
|
$("#RevenueSgst").val(0);
|
|
$("#RevenueAfterSgst").val(0);
|
|
$("#RevenueIgst").val(0);
|
|
$("#RevenueAfterIgst").val(0);
|
|
|
|
|
|
|
|
|
|
$("#drpFreight").val('0');
|
|
$("#txtFreight").val('');
|
|
$("#txtAfterFreight").val('');
|
|
$("#NOOfTrips").val('');
|
|
$("#txtBasicValue").val('');
|
|
$("#txtInsurance").val('');
|
|
$("#txtTotalOrderValue").val('');
|
|
tinyMCE.get('Add_Service_Description').setContent('');
|
|
|
|
|
|
}
|
|
</script>
|
|
<script>
|
|
var SelectedMaterialCode = [];
|
|
var CollIndex = 0;
|
|
|
|
function Save() {
|
|
$('#txtStatus').val('<?php echo PO_DRAFT; ?>');
|
|
if (validate()) {
|
|
$('#content').loader('show');
|
|
$.ajax({
|
|
data: $('.CreatePO').serialize(),
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder",
|
|
success: function(data) {
|
|
if (data) {
|
|
$('#content').loader('hide');
|
|
alert(data);
|
|
//$('#txtRowCount').val('');
|
|
//$('#txtDeletedRow').val('');
|
|
|
|
//window.location = "Requisition";
|
|
|
|
} else {
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
$(function() {
|
|
|
|
$('#TaxesTabel').DataTable({
|
|
"paging": false,
|
|
"lengthChange": false,
|
|
"searching": false,
|
|
"ordering": false,
|
|
"info": false,
|
|
"autoWidth": false
|
|
});
|
|
});
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
|
|
Inputmask("A{2,3} 9{1,2} A{1,2} 9{4}").mask($("#VehicleNo"));
|
|
|
|
|
|
$("#ChallanInvDate").datepicker({
|
|
|
|
maxDate: 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '-100:+0'
|
|
});
|
|
|
|
|
|
|
|
$('#purpose').on('change', function() {
|
|
if (this.value == 'REVENUE') //Revenue po
|
|
{
|
|
|
|
$("#QualityChecked").show();
|
|
$("#revenuepotaxes").show();
|
|
$("#currencyexchange").hide();
|
|
$("#servicepotaxes").hide();
|
|
$("#workstatus").hide();
|
|
$('#DisplayScheduleDiv').hide();
|
|
$('#EditDisplayScheduleDiv').hide();
|
|
$('#ServicePeriodOption').hide();
|
|
//$('#NoServices').hide();
|
|
$("#Deliveryby").show();
|
|
// $("#selectdeliveryby").show();
|
|
$("#txtPoRange").show();
|
|
$("#emergdescofpoDiv").hide();
|
|
$('#typeOptions').html('Revenue Type Options');
|
|
} else if (this.value == 'SERVICE') // Service po
|
|
{
|
|
$("#QualityChecked").hide();
|
|
$("#servicepotaxes").show();
|
|
$("#Deliveryby").show();
|
|
$("#workstatus").show();
|
|
$("#currencyexchange").hide();
|
|
// $("#selectdeliveryby").hide();
|
|
$("#revenuepotaxes").hide();
|
|
$('#DisplayScheduleDiv').show();
|
|
$('#EditDisplayScheduleDiv').show();
|
|
$("#txtPoRange").hide();
|
|
$("#emergdescofpoDiv").show();
|
|
$('#typeOptions').html('Service Type Options');
|
|
|
|
} else if (this.value == 'IMPORT') // Import po
|
|
{
|
|
$("#currencyexchange").show();
|
|
|
|
$("#revenuepotaxes").hide();
|
|
$("#servicepotaxes").hide();
|
|
$("#workstatus").hide();
|
|
$('#typeOptions').html('Import Type Options');
|
|
} else if (this.value == 'CAPITAL') // Capital po
|
|
{
|
|
$("#currencyexchange").show();
|
|
|
|
$("#revenuepotaxes").hide();
|
|
$("#servicepotaxes").hide();
|
|
$("#workstatus").hide();
|
|
$('#typeOptions').html('Capital Type Options');
|
|
} else // Default
|
|
{
|
|
$("#currencyexchange").hide();
|
|
|
|
$("#revenuepotaxes").hide();
|
|
$("#servicepotaxes").hide();
|
|
$("#workstatus").hide();
|
|
}
|
|
});
|
|
clearTotalItemValues();
|
|
});
|
|
$(document).ready(function() {
|
|
$('#Local').click(function() {
|
|
//for local tax range selection
|
|
$('#displayIGST').hide();
|
|
$('#displaySGST').show();
|
|
$('#IGSTAddModel').hide();
|
|
$('#SGSTAddModel').show();
|
|
$('#IGSTEditModel').hide();
|
|
$('#SGSTEditModel').show();
|
|
|
|
|
|
});
|
|
$('#Inter_state').click(function() {
|
|
//for inter state tax range selection
|
|
$('#SGSTAddModel').hide();
|
|
$('#displaySGST').hide();
|
|
$('#displayIGST').show();
|
|
$('#IGSTAddModel').show();
|
|
$('#IGSTEditModel').show();
|
|
$('#SGSTEditModel').hide();
|
|
|
|
});
|
|
});
|
|
$(document).ready(function() {
|
|
$('#Date').click(function() {
|
|
//for Date range selection
|
|
$('#Schedulediv').hide();
|
|
$('#Deliverydtdiv').show();
|
|
});
|
|
$('#Schedule').click(function() {
|
|
//for schedule range selection
|
|
$('#Deliverydtdiv').hide();
|
|
$('#Schedulediv').show();
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$('#PoTypeOptions').change(function() {
|
|
|
|
var potypeval = $('#PoTypeOptions').val();
|
|
var poopt = <?php echo json_encode($PoTypeOptions, JSON_PRETTY_PRINT) ?>;
|
|
var config = poopt[0].ConfigValue;
|
|
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
|
var default1 = Payment[4].PaymentTerms;
|
|
|
|
|
|
if (potypeval == config) {
|
|
$('#PaymentMethod').empty();
|
|
$.each(Payment, function(idx, obj) {
|
|
if (obj.PaymentID == 'PT05') {
|
|
// console.log(obj.PaymentID);
|
|
// console.log(obj.PaymentTerms)
|
|
$("#PaymentMethod").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$.each(Payment, function(idx, obj) {
|
|
if (obj.PaymentID == 'PT05') {
|
|
|
|
|
|
|
|
} else {
|
|
$("#PaymentMethod").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#drpSupplier').change(function() {
|
|
|
|
var id = $('#drpSupplier').val();
|
|
$("#SupAddress").val('');
|
|
|
|
if (id != '0') {
|
|
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
|
|
var supPaymentTerms = '';
|
|
$.each(y, function(idx, obj) {
|
|
if (obj.SupplierID === id) {
|
|
$("#SupAddress").val(obj.Address);
|
|
supPaymentTerms = obj.PaymentID;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
if (supPaymentTerms != 'PT08') {
|
|
$('#otheroptiondiv').hide();
|
|
$('#Otherpayment').val('');
|
|
} else if (supPaymentTerms == 'PT08') {
|
|
$('#otheroptiondiv').show();
|
|
|
|
}
|
|
$('#PaymentMethod').empty();
|
|
var paymentList = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
|
|
|
$.each(paymentList, function(idx1, obj1) {
|
|
|
|
|
|
if (obj1.PaymentID == supPaymentTerms) {
|
|
$("#PaymentMethod").append($('<option></option>').val(obj1.PaymentID).html(obj1.PaymentTerms));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
$.each(paymentList, function(idx, obj) {
|
|
|
|
|
|
if (obj.PaymentID != supPaymentTerms) {
|
|
$("#PaymentMethod").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
alert('Please select the SupplierID');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
/*get cost center name using department*/
|
|
var CostArray = '';
|
|
$('#DepartmentName').change(function() {
|
|
$("#AvalBuget").val('');
|
|
$('#AlertImg').attr("style", "display:none;");
|
|
CostArray = '';
|
|
var id = $('#DepartmentName').val();
|
|
if (id != '0') {
|
|
$('#content').loader('show');
|
|
|
|
|
|
$.ajax({
|
|
data: {
|
|
id: id
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>emergencypurchaseorder/getCostCenterName",
|
|
success: function(data) {
|
|
if (data) {
|
|
CostArray = data;
|
|
$('#CostCenterName').empty();
|
|
$("#CostCenterName").append($('<option></option>').val("0").html("Select Cost Center"));
|
|
|
|
$.each(JSON.parse(data), function(index, value) {
|
|
|
|
$("#CostCenterName").append($('<option></option>').val(value.CostCenterCode).html(value.CostCenterCode + "-" + value.CostCenterName));
|
|
|
|
|
|
});
|
|
$('#content').loader('hide');
|
|
|
|
|
|
} else {
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
|
alert('Please select the Department');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
/**
|
|
* update available budget calculation using regNo and cost center
|
|
*/
|
|
$(document).ready(function() {
|
|
var id = $('#CostCenterName').val();
|
|
$("#AvlBudAmt").val(0);
|
|
var ReqType = $('#purpose').val();
|
|
|
|
if (id != '0' && ReqType != '-1') {
|
|
|
|
$('#content').loader('show');
|
|
$.ajax({
|
|
data: {
|
|
id: id,
|
|
type: ReqType
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>serviceAvilBudgetAmount",
|
|
success: function(data) {
|
|
if (data) {
|
|
$('#content').loader('hide');
|
|
$("#AvalBuget").val(parseFloat(data).toFixed(2));
|
|
} else {
|
|
$('#content').loader('hide');
|
|
// alert("Error");
|
|
}
|
|
|
|
}
|
|
});
|
|
} else {
|
|
// alert('Please select the Request Type ');
|
|
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('#CostCenterName').change(function() {
|
|
|
|
var id = $('#CostCenterName').val();
|
|
$("#AvlBudAmt").val(0);
|
|
var ReqType = $('#purpose').val();
|
|
if (id != '0' && ReqType != '-1') {
|
|
|
|
|
|
$('#content').loader('show');
|
|
$.ajax({
|
|
data: {
|
|
id: id,
|
|
type: ReqType
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>serviceAvilBudgetAmount",
|
|
success: function(data) {
|
|
if (data) {
|
|
$('#content').loader('hide');
|
|
$("#AvalBuget").val(data?parseFloat(data).toFixed(2):0);
|
|
} else {
|
|
$('#content').loader('hide');
|
|
// alert("Error");
|
|
}
|
|
|
|
}
|
|
});
|
|
} else {
|
|
alert('Please select Request Type');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
/**
|
|
* getting item name and uom using global variable materialData each change
|
|
*/
|
|
$('#ServiceMaterialCode').change(function() {
|
|
var selectedMaterialCode = '';
|
|
selectedMaterialCode = $("#ServiceMaterialCode").val();
|
|
$.each(JSON.parse(materialData), function(index, value) {
|
|
if (selectedMaterialCode == value.MaterialCode) {
|
|
$("#ServiceDescription").val(value.MaterialName);
|
|
$("#ServiceUOM").val(value.UOM);
|
|
if ($('#ScheduleType').val().trim() != 'Recurring') {
|
|
$('#FrequencyChange').val('One Time');
|
|
|
|
|
|
|
|
$('#ServiceNo').val(1);
|
|
} else {
|
|
$('#FrequencyChange').val($('#ScheduleType').val());
|
|
|
|
}
|
|
}
|
|
|
|
});
|
|
var d = $('#drpSupplier').val();
|
|
$.ajax({
|
|
url:"<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
|
type: 'POST',
|
|
data: {supplierid : d, materialcode: selectedMaterialCode },
|
|
success: function(response) {
|
|
if(response) alert(response);
|
|
}
|
|
});
|
|
|
|
});
|
|
/**
|
|
* getting item name and uom using global variable materialData each change in revenue
|
|
*/
|
|
$('#MaterialCode').change(function() {
|
|
var selectedRevenueMaterialCode = '';
|
|
selectedRevenueMaterialCode = $("#MaterialCode").val();
|
|
$.each(JSON.parse(materialData), function(index, value) {
|
|
if (selectedRevenueMaterialCode == value.MaterialCode) {
|
|
$("#ItemName").val(value.MaterialName);
|
|
$("#UOM").val(value.UOM);
|
|
|
|
}
|
|
|
|
});
|
|
var d = $('#drpSupplier').val();
|
|
$.ajax({
|
|
url:"<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
|
type: 'POST',
|
|
data: {supplierid : d, materialcode: selectedRevenueMaterialCode },
|
|
success: function(response) {
|
|
if(response) alert(response);
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
/**
|
|
* get material list when selecting the request type
|
|
*/
|
|
var materialData;
|
|
|
|
$('#purpose').change(function() {
|
|
var input = '';
|
|
input = $("#purpose").val();
|
|
if (input == -1) {
|
|
$("#POType").val('');
|
|
|
|
} else {
|
|
$("#POType").val(input);
|
|
// $('#content').loader('show');
|
|
$.ajax({
|
|
data: {
|
|
input: input
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>emergencypurchaseorder/getMaterialCode",
|
|
success: function(data) {
|
|
|
|
if (data) {
|
|
materialData = data;
|
|
if (input == 'SERVICE') {
|
|
|
|
$('#ServiceMaterialCode').empty();
|
|
$("#ServiceMaterialCode").append($('<option></option>').val("0").html("Select Item Code"));
|
|
|
|
$.each(JSON.parse(data), function(index, value) {
|
|
$("#ServiceMaterialCode").append($('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName));
|
|
|
|
|
|
});
|
|
} else if (input == 'REVENUE') {
|
|
$('#MaterialCode').empty();
|
|
$("#MaterialCode").append($('<option></option>').val("0").html("Select Item Code"));
|
|
|
|
$.each(JSON.parse(data), function(index, value) {
|
|
$("#MaterialCode").append($('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName));
|
|
|
|
|
|
});
|
|
} else {
|
|
|
|
}
|
|
|
|
$('#content').loader('hide');
|
|
|
|
}
|
|
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
var id = $('#CostCenterName').val();
|
|
$("#AvlBudAmt").val(0);
|
|
var ReqType = $('#purpose').val();
|
|
if (id != '0' && ReqType != '-1') {
|
|
|
|
|
|
$('#content').loader('show');
|
|
$.ajax({
|
|
data: {
|
|
id: id,
|
|
type: ReqType
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>serviceAvilBudgetAmount",
|
|
success: function(data) {
|
|
if (data) {
|
|
$('#content').loader('hide');
|
|
$("#AvalBuget").val(data ? parseFloat(data).toFixed(2) : 0);
|
|
} else {
|
|
$('#content').loader('hide');
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
});
|
|
} else {
|
|
// alert('Please select Request Type');
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
/**
|
|
used to update cgst % to sgst
|
|
*/
|
|
|
|
function ChangeSgst() {
|
|
|
|
$('#Sgst').val($('#Cgst').val());
|
|
Ratechange();
|
|
}
|
|
|
|
function ChangeEditSgst() {
|
|
|
|
$('#EditSgst').val($('#EditCgst').val());
|
|
EditRatechange();
|
|
}
|
|
/**
|
|
* calculating taxes using quanty and rate
|
|
*/
|
|
function Ratechange() {
|
|
if ($('#ServiceMaterialCode').val() == "0") {
|
|
alert('Please Select Item Code ');
|
|
$('#ServiceMaterialCode').focus();
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
if ($('#ServiceQuantity').val() != '' && $('#ServiceRate').val() != '') {
|
|
var txtQuantity = parseFloat($('#ServiceQuantity').val());
|
|
var txtUnitPrice = parseFloat($('#ServiceRate').val());
|
|
var requencyValue = parseFloat($('#ServiceNo').val());
|
|
var Tot = txtQuantity * txtUnitPrice * requencyValue
|
|
$('#ServiceBasAmt').val(parseFloat(Tot).toFixed(2));
|
|
|
|
//Service Tax calculation
|
|
|
|
$('#AfterCgst').val(calculateCgstTax($('#ServiceBasAmt').val(), $("#Cgst").val() == '' ? "0.00" : $('#Cgst').val()));
|
|
$('#AfterSgst').val(calculateSgstTax($('#ServiceBasAmt').val(), $("#Sgst").val() == '' ? "0.00" : $('#Sgst').val()));
|
|
$('#AfterIgst').val(calculateIgstTax($('#ServiceBasAmt').val(), $("#Igst").val() == '' ? "0.00" : $('#Igst').val()));
|
|
calculateTotalOrdervalue();
|
|
}
|
|
|
|
}
|
|
|
|
function calculateCgstTax(varBasicValue, Cgst) {
|
|
|
|
var basicValue = parseFloat(varBasicValue);
|
|
// alert(basicValue);
|
|
|
|
var Cgst = parseFloat(Cgst);
|
|
// alert(Cgst);
|
|
var ServiceTaxValue = 0.0;
|
|
|
|
ServiceTaxValue = <?php echo SERVICETAX_CGST; ?>;
|
|
// alert("Tax"+ ServiceTaxValue );
|
|
|
|
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
|
|
|
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
|
|
|
}
|
|
|
|
function calculateSgstTax(varBasicValue, Sgst) {
|
|
|
|
var basicValue = parseFloat(varBasicValue);
|
|
var Sgst = parseFloat(Sgst);
|
|
var ServiceTaxValue = 0.0;
|
|
|
|
ServiceTaxValue = <?php echo SERVICETAX_SGST; ?>;
|
|
|
|
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
|
|
|
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
|
|
|
}
|
|
|
|
function calculateIgstTax(varBasicValue, Igst) {
|
|
|
|
var basicValue = parseFloat(varBasicValue);
|
|
var Igst = parseFloat(Igst);
|
|
var ServiceTaxValue = 0.0;
|
|
|
|
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
|
|
|
|
var TAXval = parseFloat(ServiceTaxValue).toFixed(2);
|
|
|
|
return TAXval; // $('#AfterServiceTax').val(TAXval);
|
|
|
|
}
|
|
|
|
function calculateTotalOrdervalue() {
|
|
var basicValue = parseFloat($('#ServiceBasAmt').val());
|
|
var Cgst = parseFloat($('#AfterCgst').val());
|
|
var Sgst = parseFloat($('#AfterSgst').val());
|
|
var Igst = parseFloat($('#AfterIgst').val());
|
|
var OtherAmt = parseFloat($("#OtherAllowances").val() == '' ? "0.00" : $('#OtherAllowances').val());
|
|
|
|
var TotAmt = basicValue + Cgst + Sgst + Igst + OtherAmt;
|
|
$('#TotalOrderValue').val(parseFloat(TotAmt).toFixed(2));
|
|
|
|
}
|
|
|
|
/**
|
|
* This function is used when clicking add service button that time store the info for submit
|
|
*/
|
|
|
|
$('.AddService').click(function() {
|
|
tinyMCE.triggerSave();
|
|
if (validateServiceTax()) {
|
|
// alert('inside Addservice');
|
|
var temp = index;
|
|
var Reqnumber = $('#purpose').val();
|
|
var departmentName = $('#DepartmentName').val();
|
|
var AvilBudget = $('#AvalBuget').val();
|
|
var costCode = $('#CostCenterName').val();
|
|
var materialCode = $('#ServiceMaterialCode').val();
|
|
var materialName = $("#ServiceDescription").val();
|
|
var uom = $("#ServiceUOM").val();
|
|
var addPer = '';
|
|
if ($("#AddEmergPer").val().trim() == '') {
|
|
addPer = $("#ServiceUOM").val();
|
|
} else {
|
|
addPer = $("#AddEmergPer").val();
|
|
}
|
|
var quantity = $("#ServiceQuantity").val();
|
|
var itemRate = parseFloat($("#ServiceRate").val()).toFixed(2);
|
|
|
|
var Cgst = $("#Cgst").val();
|
|
var AfterCgst = $("#AfterCgst").val();
|
|
var Sgst = $("#Sgst").val();
|
|
var AfterSgst = $("#AfterSgst").val();
|
|
var Igst = $("#Igst").val();
|
|
var AfterIgst = $("#AfterIgst").val();
|
|
var FrequencyValue = $("#ServiceNo").val();
|
|
|
|
var Frequency = $("#ServiceOptions").val();
|
|
|
|
var FrequencySchedule = $("#ScheduleType").val();
|
|
var OtherAmt = parseFloat($("#OtherAllowances").val()).toFixed(2);
|
|
var ItemServiceDescription = $("#txtSpcialInstructionSingle").val();
|
|
|
|
var TotalOrderValue = $("#TotalOrderValue ").val();
|
|
|
|
|
|
var basicval = $("#ServiceBasAmt").val();
|
|
|
|
|
|
var TotalTaxValue = calculateTaxValue();
|
|
|
|
// $('#ServiceMaterialCode option[value='+materialCode+']').remove();
|
|
|
|
SelectedMaterialCode[CollIndex] = materialCode;
|
|
CollIndex = CollIndex + 1;
|
|
|
|
populateValueMainFormForServiceTax();
|
|
|
|
|
|
index = parseInt(index) + 1;
|
|
|
|
var template = jQuery("#ServiceList").html();
|
|
|
|
|
|
$('#ServiceAppend').append(_.template(template, {
|
|
index: temp,
|
|
ReqNo: Reqnumber,
|
|
MaterialCode: materialCode,
|
|
MaterialName: ItemServiceDescription,
|
|
Quantity: quantity,
|
|
UOM: uom,
|
|
Rate: itemRate,
|
|
BasicAmount: basicval,
|
|
Taxvalue: TotalTaxValue,
|
|
TotalValue: TotalOrderValue
|
|
}));
|
|
|
|
clearServiceModalFields();
|
|
|
|
var theForm = $(".CreatealterPO");
|
|
|
|
addHidden(theForm, "Reqnumber" + temp, Reqnumber);
|
|
addHidden(theForm, "departmentName" + temp, departmentName);
|
|
addHidden(theForm, "AvilBudget" + temp, (AvilBudget?AvilBudget:0));
|
|
addHidden(theForm, "costCode" + temp, costCode);
|
|
addHidden(theForm, "materialCode" + temp, materialCode);
|
|
addHidden(theForm, "materialName" + temp, materialName);
|
|
addHidden(theForm, "uom" + temp, uom);
|
|
addHidden(theForm, "Serviceper" + temp, addPer);
|
|
addHidden(theForm, "quantity" + temp, quantity);
|
|
addHidden(theForm, "itemRate" + temp, itemRate);
|
|
addHidden(theForm, "Cgst" + temp, Cgst);
|
|
addHidden(theForm, "AfterCgst" + temp, AfterCgst);
|
|
addHidden(theForm, "Sgst" + temp, Sgst);
|
|
addHidden(theForm, "AfterSgst" + temp, AfterSgst);
|
|
addHidden(theForm, "Igst" + temp, Igst);
|
|
addHidden(theForm, "AfterIgst" + temp, AfterIgst);
|
|
addHidden(theForm, "Frequency" + temp, Frequency);
|
|
addHidden(theForm, "FrequencyValue" + temp, FrequencyValue);
|
|
addHidden(theForm, "OtherAmt" + temp, OtherAmt);
|
|
addHidden(theForm, "ItemServiceDescription" + temp, ItemServiceDescription);
|
|
addHidden(theForm, "TotalOrderValue" + temp, TotalOrderValue);
|
|
|
|
addHidden(theForm, "FrequencySchedule" + temp, FrequencySchedule);
|
|
|
|
$('#txtRowCount').val(temp);
|
|
|
|
}
|
|
|
|
});
|
|
/**
|
|
* validate fields when clicking add service button
|
|
*/
|
|
function validateServiceTax() {
|
|
var isChecked = $('#IsOpenOrder').is(':checked');
|
|
|
|
if ($('#ServiceMaterialCode').val() == "0") {
|
|
alert('Please select the Material Code');
|
|
$('#ServiceMaterialCode').focus();
|
|
return false;
|
|
} else if ($('#ServiceQuantity').val() == '') {
|
|
alert('Please Enter the Quantity value');
|
|
$('#ServiceQuantity').focus();
|
|
return false;
|
|
} else if (isChecked == false && $('#ServiceQuantity').val() == 0) {
|
|
alert('Please Enter the Valid Quantity value');
|
|
$('#ServiceQuantity').focus();
|
|
return false;
|
|
} else if ($('#ServiceRate').val() == '') {
|
|
alert('Please Enter the Rate of the Item');
|
|
$('#ServiceRate').focus();
|
|
return false;
|
|
} else if (isChecked == false && $('#ServiceRate').val() == 0) {
|
|
alert('Please Enter the Valid Rate of the Item');
|
|
$('#ServiceRate').focus();
|
|
return false;
|
|
} else if ($('#txtSpcialInstructionSingle').val() == '') {
|
|
alert('Please Enter the Service Description');
|
|
$('#txtSpcialInstructionSingle').focus();
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
function populateValueMainFormForServiceTax() {
|
|
var AfterCgst = $('#AfterCgst').val() == '' ? '0.00' : $('#AfterCgst').val();
|
|
var AfterSgst = $('#AfterSgst').val() == '' ? '0.00' : $('#AfterSgst').val();
|
|
var AfterIgst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
|
|
var TotalVal = $('#TotalOrderValue ').val() == '' ? '0.00' : $('#TotalOrderValue').val();
|
|
var BasicVal = $('#ServiceBasAmt').val() == '' ? '0.00' : $('#ServiceBasAmt').val();
|
|
var otherAmt = $('#OtherAllowances').val() == '' ? '0.00' : $('#OtherAllowances').val();
|
|
var TotalOrderValueSummary = $('#txtTotalOrderValueSummaryService').val() == '' ? '0.00' : $('#txtTotalOrderValueSummaryService').val();
|
|
|
|
var totBasicAmt = $('#txtTotBasicAmount').val() == '' ? '0.00' : $('#txtTotBasicAmount').val();
|
|
var TotalCgst = $('#txtTotCgst').val() == '' ? '0.00' : $('#txtTotCgst').val();
|
|
var TotalSgst = $('#txtTotSgst').val() == '' ? '0.00' : $('#txtTotSgst').val();
|
|
var TotalIgst = $('#txtTotIgst').val() == '' ? '0.00' : $('#txtTotIgst').val();
|
|
var TotalAllowance = $('#txtTotOtherAllo').val() == '' ? '0.00' : $('#txtTotOtherAllo').val();
|
|
$('#txtTotBasicAmount').val((parseFloat(totBasicAmt) + parseFloat(BasicVal)).toFixed(2));
|
|
$('#txtTotCgst').val((parseFloat(TotalCgst) + parseFloat(AfterCgst)).toFixed(2));
|
|
$('#txtTotSgst').val((parseFloat(TotalSgst) + parseFloat(AfterSgst)).toFixed(2));
|
|
$('#txtTotIgst').val((parseFloat(TotalIgst) + parseFloat(AfterIgst)).toFixed(2));
|
|
$('#txtTotOtherAllo').val((parseFloat(TotalAllowance) + parseFloat(otherAmt)).toFixed(2));
|
|
$('#txtTotalOrderValueSummaryService').val((parseFloat(TotalOrderValueSummary) + parseFloat(TotalVal)).toFixed(2));
|
|
|
|
}
|
|
|
|
function calculateTaxValue() {
|
|
var Cgst = parseFloat($('#AfterCgst').val());
|
|
var Sgst = parseFloat($('#AfterSgst').val());
|
|
var Igst = parseFloat($('#AfterIgst').val());
|
|
|
|
var TottaxAmt = Cgst + Sgst + Igst;
|
|
|
|
return parseFloat(TottaxAmt).toFixed(2);
|
|
}
|
|
/*
|
|
$(function () {
|
|
$('#serviceTax').DataTable({
|
|
"paging": true,
|
|
"lengthChange": true,
|
|
"searching": false,
|
|
//"ordering": true,
|
|
// "info": true,
|
|
"autoWidth": true
|
|
|
|
});
|
|
});
|
|
|
|
* clear the seleted fields after clicking add service
|
|
*/
|
|
function clearServiceModalFields() {
|
|
|
|
// To reset the Modal controls
|
|
|
|
var isChecked = $('#IsOpenOrder').is(':checked');
|
|
isChecked ? $('#ServiceQuantity').val(0).prop('readonly', true).prop('required', false) : $('#ServiceQuantity').val('').prop('readonly', false).prop('required', true);
|
|
|
|
$('#ServiceMaterialCode').val("0");
|
|
$("#ServiceDescription").val('');
|
|
$('#ServiceUOM').val('');
|
|
$("#ServiceRate").val('');
|
|
$("#ServiceBasAmt").val('');
|
|
$("#AfterCgst").val(0);
|
|
$("#AfterSgst").val(0);
|
|
$("#AfterIgst").val(0);
|
|
$("#Cgst").val(0);
|
|
$("#Sgst").val(0);
|
|
$("#Igst").val(0);
|
|
$("#TotalOrderValue ").val('');
|
|
tinyMCE.get('txtSpcialInstructionSingle').setContent('');
|
|
$('#AddEmergPer').val('');
|
|
$("#OtherAllowances ").val(0);
|
|
|
|
}
|
|
/**
|
|
* This function is used to edit the service seleted po
|
|
*/
|
|
var EditGetMaterialData;
|
|
|
|
$("#EDITSERVICE").on("shown.bs.modal", function(e) {
|
|
tinyMCE.triggerSave();
|
|
|
|
EditGetMaterialData = '';
|
|
|
|
userid = $(e.relatedTarget).data('userid');
|
|
var tr = document.getElementById(userid);
|
|
var cellval = tr.cells;
|
|
var id = $('#Reqnumber' + userid).val();
|
|
$('#EditReqNo').val($('#Reqnumber' + userid).val());
|
|
$('#EditdeptName').val($('#departmentName' + userid).val());
|
|
$('#EditCostCenter').val($('#costCode' + userid).val());
|
|
|
|
$('#EditAvlBudAmt').val($('#AvilBudget' + userid).val() ? $('#AvilBudget' + userid).val() : 0);
|
|
|
|
$('#EditItemName').val($('#materialName' + userid).val());
|
|
$('#EditUOM').val($('#uom' + userid).val());
|
|
$('#EditEmergPer').val($('#Serviceper' + userid).val());
|
|
$('#EditQuantity').val($('#quantity' + userid).val());
|
|
$('#EditRate').val($('#itemRate' + userid).val());
|
|
$('#txtEditBasicValue').val(cellval[7].innerHTML);
|
|
$('#EditAfterCgst').val($('#AfterCgst' + userid).val());
|
|
$('#EditAfterSgst').val($('#AfterSgst' + userid).val());
|
|
$('#EditAfterIgst').val($('#AfterIgst' + userid).val());
|
|
$('#EditCgst').val($('#Cgst' + userid).val());
|
|
$('#EditSgst').val($('#Sgst' + userid).val());
|
|
$('#EditIgst').val($('#Igst' + userid).val());
|
|
//$('#EditFrequencyNo').val($('#FrequencyValue'+userid).val());
|
|
//$('#EditFrequency').val($('#Frequency'+userid).val());
|
|
$('#EditTotalOrderValue').val(cellval[9].innerHTML);
|
|
$('#EditOtherAllowances').val($('#OtherAmt' + userid).val());
|
|
|
|
tinyMCE.get('EdittxtSpcialInstructionSingle').setContent($('#ItemServiceDescription' + userid).val());
|
|
if ($('#FrequencySchedule' + userid).val() != 'Recurring') {
|
|
$('#EditFrequencyChange').val('One time');
|
|
|
|
|
|
} else {
|
|
$('#EditFrequencyChange').val($('#FrequencySchedule' + userid).val());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#EditMaterialCode").empty();
|
|
|
|
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
|
$.each(JSON.parse(materialData), function(index, value) {
|
|
|
|
|
|
if ($('#materialCode' + userid).val() != value.MaterialCode) {
|
|
|
|
$("#EditMaterialCode").append($('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName));
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*get Material list while editing
|
|
|
|
var EditPoType=$('#Reqnumber'+userid).val();
|
|
|
|
$.ajax({
|
|
data:{input:EditPoType},
|
|
type:"POST",
|
|
url:"<?php echo base_url() ?>emergencypurchaseorder/getMaterialCode",
|
|
success:function(data) {
|
|
$('#content').loader('hide');
|
|
if(data)
|
|
{
|
|
EditGetMaterialData=data;
|
|
|
|
$("#EditMaterialCode").empty();
|
|
|
|
$("#EditMaterialCode").append( $('<option></option>').val($('#materialCode'+userid).val()).html($('#materialCode'+userid).val() + "-" + $('#materialName'+userid).val()) );
|
|
$.each(JSON.parse(data), function (index, value) {
|
|
|
|
|
|
if($('#materialCode'+userid).val() != value.MaterialCode)
|
|
{
|
|
|
|
$("#EditMaterialCode").append( $('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName) );
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
}
|
|
});*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
/**
|
|
* edit emenergency service po validations
|
|
*/
|
|
|
|
function EditRatechange() {
|
|
|
|
|
|
if ($('#EditQuantity').val() != '' && $('#EditRate').val() != '') {
|
|
var txtQuantity = parseFloat($('#EditQuantity').val());
|
|
var txtUnitPrice = parseFloat($('#EditRate').val());
|
|
var requencyValue = parseFloat($('#ServiceNo').val());
|
|
|
|
var Tot = txtQuantity * txtUnitPrice * requencyValue
|
|
$('#txtEditBasicValue').val(parseFloat(Tot).toFixed(2));
|
|
$('#EditAfterCgst').val(calculateCgstTax($('#txtEditBasicValue').val(), $("#EditCgst").val() == '' ? "0.00" : $('#EditCgst').val()));
|
|
$('#EditAfterSgst').val(calculateSgstTax($('#txtEditBasicValue').val(), $("#EditSgst").val() == '' ? "0.00" : $('#EditSgst').val()));
|
|
$('#EditAfterIgst').val(calculateIgstTax($('#txtEditBasicValue').val(), $("#EditIgst").val() == '' ? "0.00" : $('#EditIgst').val()));
|
|
|
|
calculateTotalEditOrdervalue();
|
|
}
|
|
|
|
}
|
|
/**
|
|
* calculate total edit order value
|
|
*/
|
|
function calculateTotalEditOrdervalue() {
|
|
var basicValue = parseFloat($('#txtEditBasicValue').val());
|
|
var Cgst = parseFloat($('#EditAfterCgst').val());
|
|
var Sgst = parseFloat($('#EditAfterSgst').val());
|
|
var Igst = parseFloat($('#EditAfterIgst').val());
|
|
var OtherAmt = parseFloat($("#EditOtherAllowances").val() == '' ? "0.00" : $('#EditOtherAllowances').val());
|
|
|
|
var TotAmt = basicValue + Cgst + Sgst + Igst + OtherAmt;
|
|
|
|
$('#EditTotalOrderValue').val(parseFloat(TotAmt).toFixed(2));
|
|
|
|
}
|
|
/**
|
|
* This function is used for update service
|
|
*/
|
|
$('.EditService').click(function() {
|
|
tinyMCE.triggerSave();
|
|
if (validateEditServiceTax()) {
|
|
|
|
var CostCode = $("#EditCostCenter").val();
|
|
var AvilBudget = $('#EditAvlBudAmt').val();
|
|
var editMaterialCode = $("#EditMaterialCode").val();
|
|
|
|
var editDescription = $("#EditItemName").val();
|
|
var ItemServiceDescription = $("#EdittxtSpcialInstructionSingle").val();
|
|
var OtherAmt = parseFloat($("#EditOtherAllowances").val()).toFixed(2);
|
|
var editUOM = $('#EditUOM').val();
|
|
var editPer = '';
|
|
if ($("#EditEmergPer").val().trim() == '') {
|
|
editPer = $("#EditUOM").val();
|
|
} else {
|
|
editPer = $("#EditEmergPer").val();
|
|
}
|
|
var editQuantity = $('#EditQuantity').val();
|
|
|
|
var itemRate = $("#EditRate").val();
|
|
|
|
var Cgst = $("#EditCgst").val();
|
|
var AfterCgst = $("#EditAfterCgst").val();
|
|
var Sgst = $("#EditSgst").val();
|
|
var AfterSgst = $("#EditAfterSgst").val();
|
|
var Igst = $("#EditIgst").val();
|
|
var AfterIgst = $("#EditAfterIgst").val();
|
|
var FrequencyValue = $("#ServiceNo").val();
|
|
|
|
var Frequency = $("#ServiceOptions").val();
|
|
|
|
var FrequencySchedule = $("#ScheduleType").val();
|
|
|
|
|
|
var TotalOrderValue = $("#EditTotalOrderValue ").val();
|
|
|
|
|
|
var basicval = $("#txtEditBasicValue").val();
|
|
|
|
var TotalTaxValue = calculateEditTaxValue();
|
|
|
|
|
|
|
|
var tr = document.getElementById(userid);
|
|
var cellval = tr.cells;
|
|
cellval[3].innerHTML = editMaterialCode;
|
|
cellval[3].innerHTML = ItemServiceDescription;
|
|
cellval[4].innerHTML = editQuantity;
|
|
cellval[5].innerHTML = editUOM;
|
|
cellval[6].innerHTML = itemRate;
|
|
cellval[7].innerHTML = basicval;
|
|
cellval[8].innerHTML = TotalTaxValue;
|
|
cellval[9].innerHTML = TotalOrderValue;
|
|
|
|
|
|
$('#materialCode' + userid).val(editMaterialCode);
|
|
$('#materialName' + userid).val(editDescription);
|
|
$('#uom' + userid).val(editUOM);
|
|
$('#Serviceper' + userid).val(editPer);
|
|
$('#quantity' + userid).val(editQuantity);
|
|
$('#itemRate' + userid).val(itemRate);
|
|
$('#Cgst' + userid).val(Cgst);
|
|
$('#AfterCgst' + userid).val(AfterCgst);
|
|
$('#Sgst' + userid).val(Sgst);
|
|
$('#AfterSgst' + userid).val(AfterSgst);
|
|
$('#Igst' + userid).val(Igst);
|
|
$('#AfterIgst' + userid).val(AfterIgst);
|
|
$('#TotalOrderValue' + userid).val(TotalOrderValue);
|
|
$('#Frequency' + userid).val(Frequency);
|
|
$('#Frequency' + userid).val(Frequency);
|
|
$('#FrequencyValue' + userid).val(FrequencyValue);
|
|
$('#FrequencySchedule' + userid).val(FrequencySchedule);
|
|
$('#ItemServiceDescription' + userid).val(ItemServiceDescription);
|
|
$('#OtherAmt' + userid).val(OtherAmt);
|
|
|
|
populateValueMainFormForEditServiceTax();
|
|
|
|
}
|
|
|
|
});
|
|
/**
|
|
* This function is used for validate while update
|
|
*/
|
|
function validateEditServiceTax() {
|
|
var isChecked = $('#IsOpenOrder').is(':checked');
|
|
|
|
if ($('#EditQuantity').val() == '') {
|
|
alert('Please Enter the Quantity value');
|
|
$('#EditQuantity').focus();
|
|
return false;
|
|
} else if (isChecked == false && $('#EditQuantity').val() == 0) {
|
|
alert('Please Enter the Valid Quantity value');
|
|
$('#EditQuantity').focus();
|
|
return false;
|
|
} else if ($('#EditRate').val() == '') {
|
|
alert('Please Enter the Rate of the Item');
|
|
$('#EditRate').focus();
|
|
return false;
|
|
} else if (isChecked == false && $('#EditRate').val() == 0) {
|
|
alert('Please Enter the Valid Rate of the Item');
|
|
$('#EditRate').focus();
|
|
return false;
|
|
} else if ($('#EdittxtSpcialInstructionSingle').val() == '') {
|
|
alert('Please Enter the Service Description');
|
|
$('#EdittxtSpcialInstructionSingle').focus();
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
function calculateEditTaxValue() {
|
|
var Cgst = parseFloat($('#EditAfterCgst').val());
|
|
var Sgst = parseFloat($('#EditAfterSgst').val());
|
|
var Igst = parseFloat($('#EditAfterIgst').val());
|
|
|
|
|
|
var TottaxAmt = Cgst + Sgst + Igst;
|
|
return parseFloat(TottaxAmt).toFixed(2);
|
|
}
|
|
|
|
function populateValueMainFormForEditServiceTax() {
|
|
|
|
var rows = document.getElementById('serviceTax').rows.length;
|
|
var TotCgst = 0;
|
|
var TotSgst = 0;
|
|
var TotIgst = 0;
|
|
var TotOther = 0;
|
|
var TotSummary = 0;
|
|
var TotBasicAmout = 0;
|
|
for (i = 1; i < rows; i++) {
|
|
|
|
var AfterCgst = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
|
|
var AfterSgst = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
|
|
var AfterIgst = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
|
|
var OtherAmt = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
|
|
var TotalVal = $('#TotalOrderValue' + i).val() == '' ? '0.00' : $('#TotalOrderValue' + i).val();
|
|
var Quantity = $('#quantity' + i).val() == '' ? '0.00' : $('#quantity' + i).val();
|
|
var ItemRate = $('#itemRate' + i).val() == '' ? '0.00' : $('#itemRate' + i).val();
|
|
var frequencyValue = $('#FrequencyValue' + i).val() == '' ? '1.00' : $('#FrequencyValue' + i).val();
|
|
var BasicVal = parseFloat(Quantity) * parseFloat(ItemRate) * parseFloat(frequencyValue);
|
|
|
|
TotCgst = parseFloat(TotCgst) + parseFloat(AfterCgst);
|
|
TotSgst = parseFloat(TotSgst) + parseFloat(AfterSgst);
|
|
TotIgst = parseFloat(TotIgst) + parseFloat(AfterIgst);
|
|
TotOther = parseFloat(TotOther) + parseFloat(OtherAmt);
|
|
TotSummary = parseFloat(TotSummary) + parseFloat(TotalVal);
|
|
TotBasicAmout = parseFloat(TotBasicAmout) + parseFloat(BasicVal);
|
|
|
|
}
|
|
|
|
|
|
$('#txtTotBasicAmount').val(parseFloat(TotBasicAmout).toFixed(2));
|
|
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
|
|
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
|
|
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
|
|
$('#txtTotOtherAllo').val((parseFloat(TotOther)).toFixed(2));
|
|
$('#txtTotalOrderValueSummaryService').val(parseFloat(TotSummary).toFixed(2));
|
|
|
|
|
|
}
|
|
/**
|
|
* This function is used for delete list of tem from selected list
|
|
*/
|
|
function DeleteRow(rowid) {
|
|
var DelRows = $('#txtDeletedRow').val();
|
|
|
|
var answer = confirm(" Do you want to delete the Item from the List?")
|
|
if (answer) {
|
|
var td = document.getElementById(rowid);
|
|
td.parentNode.removeChild(td);
|
|
|
|
var materialCode = $('#materialCode' + rowid).val();
|
|
|
|
var removeItem = $('#materialCode' + rowid).val();
|
|
|
|
|
|
$.each(JSON.parse(materialData), function(index, value) {
|
|
if (value.MaterialCode == materialCode) {
|
|
// $("#ServiceMaterialCode").append( $('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName) );
|
|
}
|
|
|
|
|
|
|
|
});
|
|
SelectedMaterialCode.splice(SelectedMaterialCode.indexOf('removeItem'), 1);
|
|
|
|
if (DelRows != '') {
|
|
DelRows = DelRows + ":" + rowid;
|
|
populateValueMainFormForDeleteServiceTax(rowid);
|
|
} else {
|
|
DelRows = "0" + ":" + rowid;
|
|
populateValueMainFormForDeleteServiceTax(rowid);
|
|
|
|
}
|
|
$('#txtDeletedRow').val(DelRows);
|
|
}
|
|
|
|
}
|
|
/**
|
|
* This function is used to submit and save the emergency service Po list
|
|
*/
|
|
function Save(status) {
|
|
|
|
// alert('Save fn');
|
|
|
|
if (status == '0') {
|
|
stat = '<?php echo PO_DRAFT; ?>';
|
|
} else if (status == '1') {
|
|
stat = '<?php echo REQITEM_Emergency_PO_CREATED; ?>';
|
|
} else if (status == '2') {
|
|
stat = '<?php echo SPECIAL_PO; ?>';
|
|
}
|
|
|
|
tinyMCE.triggerSave();
|
|
var splinstr = $('#ScopeOfWork').val();
|
|
$('#ScopeOfWork').val(splinstr);
|
|
|
|
var deladd = $('#DeliveryAddr').val();
|
|
$('#SpcialInstruction').val(splinstr);
|
|
$('#txtDeliveryAddress').val(deladd);
|
|
$('#txtStatus').val(stat);
|
|
var TextRowCount = $('#txtRowCount').val();
|
|
var TextDeletedRowCount = $('#txtDeletedRow').val();
|
|
var TextTotalOrderValueSummaryService = $('#txtTotalOrderValueSummaryService').val();
|
|
var TextSpcialInstruction = $('#ScopeOfWork').val();
|
|
var TextStatus = stat;
|
|
var PaymentMethod = $('#PaymentMethod').val();
|
|
|
|
|
|
var workStatus = $('#workstatusValue').val();
|
|
|
|
$('#txtworkstatus').val(workStatus);
|
|
|
|
|
|
if (validate()) {
|
|
|
|
if (document.getElementById('serviceTax').rows.length < 2) {
|
|
alert('Please Select Line item to Create PO');
|
|
$('#Deliverydt').focus();
|
|
return false;
|
|
}
|
|
|
|
|
|
// else if(parseInt($('#AvalBuget').val()) < parseInt(TextTotalOrderValueSummaryService)) {
|
|
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
|
|
|
// return false;
|
|
// }
|
|
else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
|
|
alert('Please Enter Other Payable Terms Description');
|
|
$('#Otherpayment').focus();
|
|
return false;
|
|
} else if ($('#emergdescofpo').val().trim() == '') {
|
|
alert('Please Enter Description Of Service');
|
|
$('#emergdescofpo').focus();
|
|
return false;
|
|
} else if ($('#PoTypeOptions').val() == "0") {
|
|
alert('Please Select POType');
|
|
$('#PoTypeOptions').focus();
|
|
return false;
|
|
|
|
} else {
|
|
|
|
//alert('Save fn');
|
|
// $('#content').loader('show');
|
|
// $.ajax({
|
|
// data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextStatus="+TextStatus+"&PaymentMethod="+PaymentMethod+"&workStatus="+workStatus,
|
|
// type:"POST",
|
|
// url:"<?php echo base_url() ?>emergencypurchaseorder/addNewServicePurchaseOrder",
|
|
// success:function(data) {
|
|
// if(data)
|
|
// {
|
|
// $('#content').loader('hide');
|
|
// alert(data);
|
|
// $('#txtRowCount').val('');
|
|
// $('#txtDeletedRow').val('');
|
|
// $('#SpcialInstruction').val('');
|
|
// $('#txtDeliveryAddress').val('');
|
|
// window.location = "purchaseorderListing";
|
|
|
|
// }
|
|
// else
|
|
// {
|
|
// $('#content').loader('hide');
|
|
// alert("Error");
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
$('#content').loader('show');
|
|
$("#CreatealterPO").attr("method", "post");
|
|
$("#CreatealterPO").attr("enctype", "multipart/form-data");
|
|
$("#CreatealterPO").attr("action", "emergencypurchaseorder/addNewServicePurchaseOrder");
|
|
$('#CreatealterPO').submit();
|
|
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* This function is used to submit and save the emergency Revenue Po list
|
|
*/
|
|
function RevenueSave(status) {
|
|
if (status == '0') {
|
|
stat = '<?php echo PO_DRAFT; ?>';
|
|
} else if (status == '3') {
|
|
stat = '<?php echo SPECIAL_PO; ?>';
|
|
} else if (status == '4') {
|
|
stat = '<?php echo SPECIAL_PO; ?>';
|
|
} else {
|
|
stat = '<?php echo REQITEM_Emergency_PO_CREATED; ?>';
|
|
}
|
|
|
|
|
|
tinyMCE.triggerSave();
|
|
var splinstr = $('#txtSpcialInstruction').val();
|
|
$('#SpcialInstruction').val(splinstr);
|
|
var deladd = $('#DeliveryAddr').val();
|
|
|
|
$('#txtDeliveryAddress').val(deladd);
|
|
$('#txtStatus1').val(stat);
|
|
var TextRowCount = $('#txtRowCount1').val();
|
|
var TextDeletedRowCount = $('#txtDeletedRow1').val();
|
|
var txtTotBasicAmountRevenue = $('#txtTotBasicAmountRevenue').val();
|
|
var txtTotalDiscount = $('#txtTotalDiscount').val();
|
|
var finalbasicamtrate = txtTotBasicAmountRevenue - txtTotalDiscount;
|
|
var TextSpcialInstruction = $('#txtSpcialInstruction').val();
|
|
var TextStatus = stat;
|
|
var PaymentMethod = $('#PaymentMethod').val();
|
|
|
|
|
|
if (validate()) {
|
|
if (document.getElementById('serviceTax').rows.length < 2) {
|
|
alert('Please Select Line item to Create PO');
|
|
$('#Deliverydt').focus();
|
|
return false;
|
|
}
|
|
else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') {
|
|
alert('Please Enter Insurance Number..!');
|
|
|
|
return false;
|
|
} else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') {
|
|
alert('Please Enter Other Payment Description..!');
|
|
|
|
return false;
|
|
}
|
|
|
|
|
|
// else if($('#PoTypeOptions').val()== "0")
|
|
// {
|
|
// alert('Please Select POType');
|
|
// $('#PoTypeOptions').focus();
|
|
// return false;
|
|
|
|
// }
|
|
else {
|
|
// $('#content').loader('show');
|
|
// $.ajax({
|
|
// data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&TextStatus="+TextStatus,
|
|
// type:"POST",
|
|
// url:"<?php echo base_url() ?>emergencypurchaseorder/addNewRevenuePurchaseOrder",
|
|
// success:function(data) {
|
|
// if(data)
|
|
// {
|
|
// $('#content').loader('hide');
|
|
// alert(data);
|
|
// $('#txtRowCount').val('');
|
|
// $('#txtDeletedRow').val('');
|
|
// $('#SpcialInstruction').val('');
|
|
// $('#txtDeliveryAddress').val('');
|
|
// window.location = "purchaseorderListing";
|
|
|
|
// }
|
|
// else
|
|
// {
|
|
// $('#content').loader('hide');
|
|
// alert("Error");
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
//alert("else");
|
|
var tablevalue = $('#specialtable').tableToJSON(); // Convert the table into a javascript object
|
|
var jsondata = JSON.stringify(tablevalue);
|
|
$('#tablevalues').val(jsondata);
|
|
$("#CreatealterPO").attr("method", "post");
|
|
$("#CreatealterPO").attr("enctype", "multipart/form-data");
|
|
$("#CreatealterPO").attr("action", "emergencypurchaseorder/addNewRevenuePurchaseOrder");
|
|
$('#CreatealterPO').submit();
|
|
}
|
|
|
|
}
|
|
}
|
|
/**
|
|
* This function is used to calculate the total amounts after delete the row
|
|
*/
|
|
function populateValueMainFormForDeleteServiceTax(deletedRow) {
|
|
|
|
var rows = document.getElementById('serviceTax').rows.length;
|
|
var TotCgst = 0;
|
|
var TotSgst = 0;
|
|
var TotIgst = 0;
|
|
var TotOther = 0;
|
|
var TotSummary = 0;
|
|
var TotBasicAmout = 0;
|
|
for (var i = 1; i <= rows; i++) {
|
|
|
|
if (deletedRow == i) {
|
|
$('#AfterCgst' + i).val('');
|
|
$('#AfterSgst' + i).val('');
|
|
$('#AfterIgst' + i).val('');
|
|
$('#OtherAmt' + i).val('');
|
|
$('#TotalOrderValue' + i).val('');
|
|
$('#quantity' + i).val('');
|
|
$('#itemRate' + i).val('');
|
|
|
|
var AfterCgst = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
|
|
var AfterSgst = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
|
|
var AfterIgst = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
|
|
var OtherAmt = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
|
|
var TotalVal = $('#TotalOrderValue' + i).val() == '' ? '0.00' : $('#TotalOrderValue' + i).val();
|
|
|
|
var Quantity = $('#quantity' + i).val() == '' ? '0.00' : $('#quantity' + i).val();
|
|
var ItemRate = $('#itemRate' + i).val() == '' ? '0.00' : $('#itemRate' + i).val();
|
|
var BasicVal = parseFloat(Quantity) * parseFloat(ItemRate);
|
|
|
|
TotCgst = parseFloat(TotCgst) + parseFloat(AfterCgst);
|
|
TotSgst = parseFloat(TotSgst) + parseFloat(AfterSgst);
|
|
TotIgst = parseFloat(TotIgst) + parseFloat(AfterIgst);
|
|
TotOther = parseFloat(TotOther) + parseFloat(OtherAmt);
|
|
TotSummary = parseFloat(TotSummary) + parseFloat(TotalVal);
|
|
TotBasicAmout = parseFloat(TotBasicAmout) + parseFloat(BasicVal);
|
|
} else if (deletedRow != i) {
|
|
var AfterCgst = $('#AfterCgst' + i).val() == '' ? '0.00' : $('#AfterCgst' + i).val();
|
|
var AfterSgst = $('#AfterSgst' + i).val() == '' ? '0.00' : $('#AfterSgst' + i).val();
|
|
var AfterIgst = $('#AfterIgst' + i).val() == '' ? '0.00' : $('#AfterIgst' + i).val();
|
|
var TotalVal = $('#TotalOrderValue' + i).val() == '' ? '0.00' : $('#TotalOrderValue' + i).val();
|
|
var OtherAmt = $('#OtherAmt' + i).val() == '' ? '0.00' : $('#OtherAmt' + i).val();
|
|
var Quantity = $('#quantity' + i).val() == '' ? '0.00' : $('#quantity' + i).val();
|
|
var ItemRate = $('#itemRate' + i).val() == '' ? '0.00' : $('#itemRate' + i).val();
|
|
var frequency = $('#FrequencyValue' + i).val() == '' ? '0.00' : $('#FrequencyValue' + i).val();
|
|
var BasicVal = parseFloat(Quantity) * parseFloat(ItemRate) * parseFloat(frequency);
|
|
if (AfterCgst != undefined) {
|
|
TotCgst = parseFloat(TotCgst) + parseFloat(AfterCgst);
|
|
TotSgst = parseFloat(TotSgst) + parseFloat(AfterSgst);
|
|
TotIgst = parseFloat(TotIgst) + parseFloat(AfterIgst);
|
|
TotOther = parseFloat(TotOther) + parseFloat(OtherAmt);
|
|
TotSummary = parseFloat(TotSummary) + parseFloat(TotalVal);
|
|
TotBasicAmout = parseFloat(TotBasicAmout) + parseFloat(BasicVal);
|
|
}
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
$('#txtTotBasicAmount').val(parseFloat(TotBasicAmout).toFixed(2));
|
|
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2));
|
|
$('#txtTotSgst').val(parseFloat(TotSgst).toFixed(2));
|
|
$('#txtTotIgst').val(parseFloat(TotIgst).toFixed(2));
|
|
$('#txtTotOtherAllo').val(parseFloat(TotOther).toFixed(2));
|
|
$('#txtTotalOrderValueSummaryService').val(parseFloat(TotSummary).toFixed(2));
|
|
|
|
|
|
}
|
|
/**
|
|
* update available budget calculation using regNo and cost center while editing
|
|
*/
|
|
$('#EditCostCenter').change(function() {
|
|
|
|
var getCostId = $('#EditCostCenter').val();
|
|
$("#EditAvlBudAmt").val(0);
|
|
var EditReqType = $('#EditReqNo').val();
|
|
if (getCostId != '0') {
|
|
|
|
$('#content').loader('show');
|
|
$.ajax({
|
|
data: {
|
|
id: getCostId,
|
|
type: EditReqType
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>serviceAvilBudgetAmount",
|
|
success: function(data) {
|
|
if (data) {
|
|
$('#content').loader('hide');
|
|
$("#EditAvlBudAmt").val(data ? data : 0);
|
|
} else {
|
|
$('#content').loader('hide');
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
});
|
|
} else {
|
|
alert('Please select the MaterialCode');
|
|
return false;
|
|
}
|
|
|
|
});
|
|
/**
|
|
* getting item name and uom using global variable materialData each change ehile editing
|
|
*/
|
|
$('#EditMaterialCode').change(function() {
|
|
|
|
var editselectedMaterialCode = '';
|
|
editselectedMaterialCode = $("#EditMaterialCode").val();
|
|
|
|
$.each(JSON.parse(materialData), function(index, value) {
|
|
if (editselectedMaterialCode == value.MaterialCode) {
|
|
$("#EditMaterialCode").val(value.MaterialCode);
|
|
$("#EditItemName").val(value.MaterialName);
|
|
$("#EditItemUOM").val(value.UOM);
|
|
|
|
}
|
|
|
|
});
|
|
var d = $('#drpSupplier').val();
|
|
$.ajax({
|
|
url:"<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
|
type: 'POST',
|
|
data: {supplierid : d, materialcode: editselectedMaterialCode },
|
|
success: function(response) {
|
|
if(response) alert(response);
|
|
}
|
|
});
|
|
});
|
|
$("#EDITREVENUE").on("shown.bs.modal", function(e) {
|
|
|
|
|
|
|
|
userid = $(e.relatedTarget).data('userid');
|
|
|
|
var CheckLocalInter = $('#CheckLocalInter' + userid).val();
|
|
if (CheckLocalInter == "0") {
|
|
|
|
$('#SGSTEditModel').show();
|
|
$('#IGSTEditModel').hide();
|
|
|
|
} else {
|
|
|
|
$('#SGSTEditModel').hide();
|
|
$('#IGSTEditModel').show();
|
|
|
|
}
|
|
|
|
$('#isEdit').val(1);
|
|
//alert(userid);
|
|
var tr = document.getElementById(userid);
|
|
|
|
var cellval = tr.cells;
|
|
|
|
var id = $('#Reqnumber' + userid).val();
|
|
|
|
$('#EditRevenueReqNo').val($('#Reqnumber' + userid).val());
|
|
$('#EditRevenuedeptName').val($('#departmentName' + userid).val());
|
|
$("#EditRevenueCostCenter").val($('#costCode' + userid).val());
|
|
$('#EditRevenueAvlBudAmt').val($('#AvilBudget' + userid).val() ? $('#AvilBudget' + userid).val() : 0);
|
|
$('#EditRevenueItemName').val($('#materialName' + userid).val());
|
|
$('#EditRevenueUOM').val($('#uom' + userid).val());
|
|
$('#EditRevenueQuantity').val($('#quantity' + userid).val());
|
|
$('#EditRevenueRate').val($('#itemRate' + userid).val());
|
|
$('#editrevenueEmergPer').val($('#per' + userid).val());
|
|
$('#txtEditRevenueBasicValue').val(cellval[7].innerHTML);
|
|
RequistQuantity = $('#quantity' + userid).val();
|
|
$('#txtEditDiscount').val($('#DisVal' + userid).val());
|
|
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
|
|
|
|
$('#txtEditPackaging').val($('#PackVal' + userid).val());
|
|
$('#txtEditAfterPackaging').val($('#AfterPackVal' + userid).val());
|
|
|
|
$('#txtEditFreight').val($('#FreightVal' + userid).val());
|
|
$('#txtEditAfterFreight').val($('#AfterFreightVal' + userid).val());
|
|
|
|
$('#EditNOOfTrips').val($('#NoOfTrip' + userid).val());
|
|
|
|
|
|
var FreightType = $('#FreightType' + userid).val();
|
|
|
|
if (FreightType == "PER TRIP") {
|
|
$('#EditTripsValue').show();
|
|
} else {
|
|
$('#EditTripsValue').hide();
|
|
}
|
|
$('#txtEditInsurance').val($('#Insval' + userid).val());
|
|
$('#RevenueEditAfterCgst').val($('#RevenueAfterCgst' + userid).val());
|
|
$('#RevenueEditAfterSgst').val($('#RevenueAfterSgst' + userid).val());
|
|
$('#RevenueEditAfterIgst').val($('#RevenueAfterIgst' + userid).val());
|
|
$('#RevenueEditCgst').val($('#RevenueCgst' + userid).val());
|
|
$('#RevenueEditSgst').val($('#RevenueSgst' + userid).val());
|
|
$('#RevenueEditIgst').val($('#RevenueIgst' + userid).val());
|
|
$('#txtEditRevenueTotalOrderValue').val($('#TotalOrderValue' + userid).val());
|
|
tinyMCE.get('Edit_Service_Description').setContent($('#service_description' + userid).val());
|
|
|
|
|
|
|
|
$("#EditRevenueMaterialCode").empty();
|
|
|
|
$("#EditRevenueMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
|
$.each(JSON.parse(materialData), function(index, value) {
|
|
|
|
|
|
if ($('#materialCode' + userid).val() != value.MaterialCode) {
|
|
|
|
$("#EditRevenueMaterialCode").append($('<option></option>').val(value.MaterialCode).html(value.MaterialCode + "-" + value.MaterialName));
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("#EditDiscountType").val($('#DisType' + userid).val());
|
|
$("#drpEditFreight").val($('#FreightType' + userid).val());
|
|
$("#EditPackagingType").val($('#PackType' + userid).val())
|
|
|
|
|
|
|
|
|
|
});
|
|
$('#EditRevenueMaterialCode').change(function() {
|
|
|
|
var editselectedMaterialCode = '';
|
|
editselectedMaterialCode = $("#EditRevenueMaterialCode").val();
|
|
|
|
$.each(JSON.parse(materialData), function(index, value) {
|
|
if (editselectedMaterialCode == value.MaterialCode) {
|
|
$("#EditRevenueMaterialCode").val(value.MaterialCode);
|
|
$("#EditRevenueItemName").val(value.MaterialName);
|
|
$("#EditRevenueUOM").val(value.UOM);
|
|
|
|
}
|
|
|
|
});
|
|
var d = $('#drpSupplier').val();
|
|
$.ajax({
|
|
url:"<?php echo base_url() ?>VerifyWithSupplierForPendingPO",
|
|
type: 'POST',
|
|
data: {supplierid : d, materialcode: editselectedMaterialCode },
|
|
success: function(response) {
|
|
if(response) alert(response);
|
|
}
|
|
});
|
|
|
|
});
|
|
$('.EditRevenue').click(function() {
|
|
|
|
tinyMCE.triggerSave();
|
|
if (validateEditRevenueTax()) {
|
|
//alert('inside Add');
|
|
var CostCode = $("#EditRevenueCostCenter").val();
|
|
var AvilBudget = $('#EditRevenueAvlBudAmt').val();
|
|
var editMaterialCode = $("#EditRevenueMaterialCode").val();
|
|
var editDescription = $("#EditRevenueItemName").val();
|
|
var editUOM = $('#EditRevenueUOM').val();
|
|
var editQuantity = $('#EditRevenueQuantity').val();
|
|
|
|
var itemRate = $("#EditRevenueRate").val();
|
|
var PER = $("#editrevenueEmergPer").val();
|
|
if (PER == '') {
|
|
PER = $('#EditRevenueUOM').val();
|
|
}
|
|
|
|
var DisType = $("#EditDiscountType").val();
|
|
var DisVal = $("#txtEditDiscount").val();
|
|
var AfterDisVal = $("#txtEditAfterDiscount").val();
|
|
|
|
var PackOption = PackagingCalculation;
|
|
var Frioption = freightCalculation;
|
|
var PackType = $("#EditPackagingType").val();
|
|
var PackVal = $("#txtEditPackaging").val();
|
|
var AfterPackVal = $("#txtEditAfterPackaging").val();
|
|
|
|
var FreightType = $("#drpEditFreight").val();
|
|
var FreightVal = $("#txtEditFreight").val();
|
|
var AfterFreightVal = $("#txtEditAfterFreight").val();
|
|
var NoOfTrip = $("#EditNOOfTrips").val();
|
|
var basicval = $("#txtEditRevenueBasicValue").val();
|
|
var Insval = $("#txtEditInsurance").val();
|
|
|
|
|
|
var Cgst = $("#RevenueEditCgst").val();
|
|
var AfterCgst = $("#RevenueEditAfterCgst").val();
|
|
var Sgst = $("#RevenueEditSgst").val();
|
|
var AfterSgst = $("#RevenueEditAfterSgst").val();
|
|
var Igst = $("#RevenueEditIgst").val();
|
|
var AfterIgst = $("#RevenueEditAfterIgst").val();
|
|
var TotalOrderValue = $("#txtEditRevenueTotalOrderValue").val();
|
|
var servicedescription = $("#Edit_Service_Description").val();
|
|
var TotalTaxValue = calculateRevenueEditTaxValue();
|
|
|
|
|
|
var tr = document.getElementById(userid);
|
|
var cellval = tr.cells;
|
|
cellval[3].innerHTML = editMaterialCode;
|
|
cellval[3].innerHTML = editDescription;
|
|
cellval[4].innerHTML = parseFloat(editQuantity).toFixed(2);
|
|
cellval[5].innerHTML = editUOM;
|
|
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);
|
|
cellval[7].innerHTML = parseFloat(basicval).toFixed(2);
|
|
cellval[8].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
|
|
cellval[9].innerHTML = parseFloat(TotalOrderValue).toFixed(2);
|
|
|
|
|
|
$('#materialCode' + userid).val(editMaterialCode);
|
|
$('#materialName' + userid).val(editDescription);
|
|
$('#uom' + userid).val(editUOM);
|
|
$('#quantity' + userid).val(editQuantity);
|
|
$('#itemRate' + userid).val(itemRate);
|
|
$('#per' + userid).val(PER);
|
|
$('#DisType' + userid).val(DisType);
|
|
$('#DisVal' + userid).val(DisVal);
|
|
$('#AfterDisVal' + userid).val(AfterDisVal);
|
|
$('#PackOption' + userid).val(PackOption);
|
|
$('#PackType' + userid).val(PackType);
|
|
$('#PackVal' + userid).val(PackVal);
|
|
$('#AfterPackVal' + userid).val(AfterPackVal);
|
|
|
|
$('#FreightType' + userid).val(FreightType);
|
|
$('#FreightVal' + userid).val(FreightVal);
|
|
$('#AfterFreightVal' + userid).val(AfterFreightVal);
|
|
$('#NoOfTrip' + userid).val(NoOfTrip);
|
|
$('#basicval' + userid).val(basicval);
|
|
$('#Insval' + userid).val(Insval);
|
|
$('#RevenueCgst' + userid).val(Cgst);
|
|
$('#RevenueAfterCgst' + userid).val(AfterCgst);
|
|
$('#RevenueAfterSgst' + userid).val(AfterSgst);
|
|
$('#RevenueSgst' + userid).val(Sgst);
|
|
$('#RevenueIgst' + userid).val(Igst);
|
|
$('#RevenueAfterIgst' + userid).val(AfterIgst);
|
|
|
|
$('#service_description' + userid).val(servicedescription);
|
|
$('#TotalOrderValue' + userid).val(TotalOrderValue);
|
|
populateValueMainFormForEditRevenueTax();
|
|
}
|
|
|
|
});
|
|
|
|
function validateAddRevenueTax()
|
|
{
|
|
var isChecked = $('#IsOpenOrder').is(':checked');
|
|
if($('#ReqNo').val() == "0")
|
|
{
|
|
alert('Please select the Requisition Number');
|
|
$('#ReqNo').focus();
|
|
return false;
|
|
}
|
|
else if($('#CostCenter').val() == "0")
|
|
{
|
|
alert('Please select the Cost center');
|
|
$('#CostCenter').focus();
|
|
return false;
|
|
}
|
|
else if($('#MaterialCode').val() == "0")
|
|
{
|
|
alert('Please select the Material Code');
|
|
$('#MaterialCode').focus();
|
|
return false;
|
|
}
|
|
else if($('#Quantity').val() == '')
|
|
{
|
|
alert('Please Enter the Quantity value');
|
|
$('#Quantity').focus();
|
|
return false;
|
|
}
|
|
else if(isChecked == false && $('#Quantity').val() == "0")
|
|
{
|
|
alert('Please Enter the Valid Quantity value');
|
|
$('#Quantity').focus();
|
|
return false;
|
|
}
|
|
else if($('#Rate').val() == '')
|
|
{
|
|
alert('Please Enter the Rate of the Item');
|
|
$('#Rate').focus();
|
|
return false;
|
|
}
|
|
else if(isChecked == false && $('#Rate').val() == "0")
|
|
{
|
|
alert('Please Enter the Valid Rate of the Item');
|
|
$('#Rate').focus();
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
function validateEditRevenueTax() {
|
|
var isChecked = $('#IsOpenOrder').is(':checked');
|
|
|
|
if ($('#EditRevenueCostCenter').val() == "0") {
|
|
alert('Please select the Cost center');
|
|
$('#EditRevenueCostCenter').focus();
|
|
return false;
|
|
} else if ($('#EditRevenueMaterialCode').val() == "0") {
|
|
alert('Please select the Material Code');
|
|
$('#EditRevenueMaterialCode').focus();
|
|
return false;
|
|
} else if ($('#EditRevenueQuantity').val() == '') {
|
|
alert('Please Enter the Quantity value');
|
|
$('#EditRevenueQuantity').focus();
|
|
return false;
|
|
} else if (isChecked == false && $('#EditRevenueQuantity').val() == 0) {
|
|
alert('Please Enter the Quantity value');
|
|
$('#EditRevenueQuantity').focus();
|
|
return false;
|
|
} else if ($('#EditRevenueRate').val() == '') {
|
|
alert('Please Enter the Rate of the Item');
|
|
$('#EditRevenueRate').focus();
|
|
return false;
|
|
}
|
|
// else if($('#EditRevenueRate').val() == 0)
|
|
// {
|
|
// alert('Please Enter the Valid Rate of the Item');
|
|
// $('#EditRevenueRate').focus();
|
|
// return false;
|
|
// }
|
|
else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function populateValueMainFormForEditRevenueTax() {
|
|
|
|
var rows = document.getElementById('serviceTax').rows.length;
|
|
//alert(rows);
|
|
var totBasicAmt = 0;
|
|
var totDiscountAmt = 0;
|
|
var totPackagingAmt = 0;
|
|
|
|
var totCgst = 0;
|
|
var totSgst = 0;
|
|
var totIgst = 0;
|
|
var totFreightAmt = 0;
|
|
var totInsuranceAmt = 0;
|
|
var totOrderSummaryAmt = 0;
|
|
var i = 0;
|
|
do {
|
|
i += 1;
|
|
|
|
|
|
var tr = document.getElementById(i);
|
|
//alert(tr);
|
|
if (tr != null) {
|
|
cells = tr.getElementsByTagName('td');
|
|
|
|
|
|
var rowid = cells[0].innerHTML;
|
|
// alert(rowid);
|
|
var Packaging = $('#AfterPackVal' + rowid).val() == '' ? '0.00' : $('#AfterPackVal' + rowid).val();
|
|
|
|
var Freight = $('#AfterFreightVal' + rowid).val() == '' ? '0.00' : $('#AfterFreightVal' + rowid).val();
|
|
var Insurance = $('#Insval' + rowid).val() == '' ? '0.00' : $('#Insval' + rowid).val();
|
|
var Discount = $('#AfterDisVal' + rowid).val() == '' ? '0.00' : $('#AfterDisVal' + rowid).val();
|
|
var BasicVal = $('#basicval' + rowid).val() == '' ? '0.00' : $('#basicval' + rowid).val();
|
|
//alert('FROM LINE'+BasicVal);
|
|
var Cgst = $('#RevenueAfterCgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterCgst' + rowid).val();
|
|
var Sgst = $('#RevenueAfterSgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterSgst' + rowid).val();
|
|
var Igst = $('#RevenueAfterIgst' + rowid).val() == '' ? '0.00' : $('#RevenueAfterIgst' + rowid).val();
|
|
var TotalVal = $('#TotalOrderValue' + rowid).val() == '' ? '0.00' : $('#TotalOrderValue' + rowid).val();
|
|
//alert(TotalVal);
|
|
|
|
|
|
totBasicAmt = parseFloat(totBasicAmt) + parseFloat(BasicVal);
|
|
//alert('TOTAL ADD'+totBasicAmt);
|
|
totDiscountAmt = parseFloat(totDiscountAmt) + parseFloat(Discount);
|
|
totPackagingAmt = parseFloat(totPackagingAmt) + parseFloat(Packaging);
|
|
|
|
totFreightAmt = parseFloat(totFreightAmt) + parseFloat(Freight);
|
|
totInsuranceAmt = parseFloat(totInsuranceAmt) + parseFloat(Insurance);
|
|
totCgst = parseFloat(totCgst) + parseFloat(Cgst);
|
|
totSgst = parseFloat(totSgst) + parseFloat(Sgst);
|
|
totIgst = parseFloat(totIgst) + parseFloat(Igst);
|
|
totOrderSummaryAmt = parseFloat(totOrderSummaryAmt) + parseFloat(TotalVal);
|
|
}
|
|
|
|
} while (i < rows);
|
|
|
|
|
|
$('#txtTotBasicAmountRevenue').val(parseFloat(totBasicAmt).toFixed(2));
|
|
$('#txtTotalDiscount').val(parseFloat(totDiscountAmt).toFixed(2));
|
|
$('#txtTotalPackaing').val(parseFloat(totPackagingAmt).toFixed(2));
|
|
|
|
$('#txtTotalCGST').val(parseFloat(totCgst).toFixed(2));
|
|
$('#txtTotalSGST').val(parseFloat(totSgst).toFixed(2));
|
|
$('#txtTotalIGST').val(parseFloat(totIgst).toFixed(2));
|
|
|
|
$('#txtTotalFreight').val(parseFloat(totFreightAmt).toFixed(2));
|
|
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2));
|
|
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2));
|
|
|
|
}
|
|
// this function is used to clear data changing schedule option
|
|
$('#Scheduleby').change(function() {
|
|
|
|
$("#Deliverydt").datepicker({
|
|
minDate: 'now',
|
|
dateFormat: 'mm/dd/yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '0:+10'
|
|
});
|
|
|
|
});
|
|
|
|
$('#Deliverydt').change(function() {
|
|
|
|
$('#Scheduleby').val('');
|
|
|
|
});
|
|
|
|
function calculateTotalValue() {
|
|
|
|
var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
|
|
|
|
var Cgst = $('#RevenueAfterCgst').val() == '' ? '0.00' : $('#RevenueAfterCgst').val();
|
|
var Sgst = $('#RevenueAfterSgst').val() == '' ? '0.00' : $('#RevenueAfterSgst').val();
|
|
var Igst = $('#RevenueAfterIgst').val() == '' ? '0.00' : $('#RevenueAfterIgst').val();
|
|
|
|
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
|
var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
|
|
var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
|
|
var BasicVal = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val();
|
|
|
|
|
|
|
|
var totvalue = (parseFloat(BasicVal) + parseFloat(Packaging) + parseFloat(Cgst) + parseFloat(Sgst) + parseFloat(Igst) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
|
|
|
|
|
|
var tot = parseFloat(totvalue).toFixed(2);
|
|
|
|
$('#txtTotalOrderValue').val(tot);
|
|
|
|
// validateExceedLimit();
|
|
// ExceedQuantityCheck();
|
|
}
|
|
|
|
$("#ScheduleType").change(function() {
|
|
if ($('#ScheduleType').val().trim() != 'Recurring') {
|
|
document.getElementById('ServicePeriodOption').style.display = 'none';
|
|
document.getElementById('NoServices').style.display = 'none';
|
|
//$('#Frequency').val('One Time');
|
|
//$('#FrequencyNo').val(1);
|
|
|
|
$('#ServiceNo').val(1);
|
|
} else {
|
|
document.getElementById('ServicePeriodOption').style.display = 'none';
|
|
document.getElementById('NoServices').style.display = 'none';
|
|
document.getElementById('ServiceNo').value = 1;
|
|
//$('#Frequency').val($('#ServiceOptions').val()+' - ' + $('#ServiceNo').val());
|
|
//$('#FrequencyNo').val($('#ServiceNo').val());
|
|
}
|
|
|
|
});
|
|
$("#EditScheduleType").change(function() {
|
|
if ($('#EditScheduleType').val().trim() != 'Recurring') {
|
|
document.getElementById('EditServicePeriodOption').style.display = 'none';
|
|
document.getElementById('EditNoServices').style.display = 'none';
|
|
document.getElementById('EditServiceNo').value = 1;
|
|
//$('#EditFrequency').val('One Time');
|
|
//$('#EditFrequencyNo').val(1);
|
|
|
|
//$('#EditServiceNo').val('');
|
|
} else {
|
|
document.getElementById('EditServicePeriodOption').style.display = 'block';
|
|
document.getElementById('EditNoServices').style.display = 'block';
|
|
|
|
//$('#EditFrequency').val($('#EditServiceOptions').val()+' - ' + $('#ServiceNo').val());
|
|
//$('#FrequencyNo').val($('#EditServiceNo').val());
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
function calculateRevenueTaxValue() {
|
|
var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
|
|
|
|
var Cgst = $('#RevenueAfterCgst').val() == '' ? '0.00' : $('#RevenueAfterCgst').val();
|
|
var Sgst = $('#RevenueAfterSgst').val() == '' ? '0.00' : $('#RevenueAfterSgst').val();
|
|
var Igst = $('#RevenueAfterIgst').val() == '' ? '0.00' : $('#RevenueAfterIgst').val();
|
|
|
|
var Freight = $('#txtAfterFreight').val() == '' ? '0.00' : $('#txtAfterFreight').val();
|
|
var Insurance = $('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val();
|
|
|
|
|
|
|
|
var totvalue = parseFloat(Cgst) + parseFloat(Sgst) + parseFloat(Igst);
|
|
|
|
var tot = parseFloat(totvalue).toFixed(2);
|
|
|
|
return tot;
|
|
}
|
|
|
|
function calculateRevenueEditTaxValue() {
|
|
var Packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
|
|
|
|
var Cgst = $('#RevenueEditAfterCgst').val() == '' ? '0.00' : $('#RevenueEditAfterCgst').val();
|
|
var Sgst = $('#RevenueEditAfterSgst').val() == '' ? '0.00' : $('#RevenueEditAfterSgst').val();
|
|
var Igst = $('#RevenueEditAfterIgst').val() == '' ? '0.00' : $('#RevenueEditAfterIgst').val();
|
|
|
|
var Freight = $('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val();
|
|
var Insurance = $('#txtEditInsurance').val() == '' ? '0.00' : $('#txtEditInsurance').val();
|
|
|
|
|
|
|
|
var totvalue = parseFloat(Cgst) + parseFloat(Sgst) + parseFloat(Igst);
|
|
|
|
var tot = parseFloat(totvalue).toFixed(2);
|
|
|
|
return tot;
|
|
}
|
|
|
|
|
|
//If others is the payment terms to display mandatory field
|
|
$("#PaymentMethod").change(function() {
|
|
|
|
if ($('#PaymentMethod').val().trim() == 'PT08') {
|
|
$('#otheroptiondiv').show();
|
|
} else {
|
|
$('#otheroptiondiv').hide();
|
|
$('#Otherpayment').val('');
|
|
}
|
|
});
|
|
|
|
// set default null value
|
|
function clearTotalItemValues() {
|
|
|
|
$('#txtTotBasicAmount').val('');
|
|
$('#txtTotCgst').val('');
|
|
$('#txtTotSgst').val('');
|
|
$('#txtTotIgst').val('');
|
|
$('#txtTotOtherAllo').val('');
|
|
$('#txtTotalOrderValueSummaryService').val('');
|
|
$('#txtTotBasicAmountRevenue').val('');
|
|
$('#txtTotalDiscount').val('');
|
|
$('#txtTotalPackaing').val('');
|
|
|
|
$('#txtTotalCGST').val('');
|
|
$('#txtTotalSGST').val('');
|
|
$('#txtTotalIGST').val('');
|
|
|
|
$('#txtTotalFreight').val('');
|
|
$('#txtTotalInsurance').val('');
|
|
$('#txtTotalOrderValueSummary').val('');
|
|
|
|
}
|
|
$('#insuranceTxtDiv').hide();
|
|
$("#insuranceStatus").change(function() {
|
|
|
|
if ($("#insuranceStatus").val() == "1") {
|
|
$('#insuranceTxtDiv').show();
|
|
$('#InsuranceNumber').val('Yes');
|
|
|
|
} else {
|
|
$('#insuranceTxtDiv').hide();
|
|
$('#InsuranceNumber').val('');
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function dropdownselect() {
|
|
|
|
var itemvalue = new Array();
|
|
var itemname = new Array();
|
|
var servalue = new Array();
|
|
var sername = new Array();
|
|
var reqType = $('#purpose').val();
|
|
var x = 0;
|
|
var y = 0;
|
|
var z = $('#RevenueAppend tr').length;
|
|
var zz = $('#ServiceAppend tr').length;
|
|
var options = '';
|
|
// alert(z);
|
|
// var values = array(0,15,30,45);
|
|
// var name =array(zero,five,three,four);
|
|
// for(var j=1;j<x;j++)
|
|
// {
|
|
// options += '<option value="' + itemvalue[j] + '">' + itemvalue[j] + '-' + itemname[j] + '</option>';
|
|
|
|
// }
|
|
if (reqType == 'REVENUE') {
|
|
$("#serviceTax tr:gt(0) td:nth-child(3)").each(function() {
|
|
var temp = $(this).html();
|
|
if ($.inArray(temp, itemvalue) < 0) {
|
|
itemvalue[x] = temp;
|
|
x++;
|
|
|
|
}
|
|
});
|
|
|
|
$("#serviceTax tr:gt(0) td:nth-child(4)").each(function() {
|
|
var temp2 = $(this).html();
|
|
if ($.inArray(temp2, itemname) < 0) {
|
|
itemname[y] = temp2;
|
|
y++;
|
|
|
|
}
|
|
});
|
|
|
|
//alert(x);
|
|
|
|
for (var i = 0; i < z; i++) {
|
|
options += '<option value="' + itemvalue[i] + '">' + itemvalue[i] + ' - ' + itemname[i] + '</option>';
|
|
}
|
|
|
|
//$("#emergency_itemcode").append( $('<option></option>').val(options).html(option));
|
|
$("#emergencyitemcode").html(options);
|
|
} else if (reqType == 'SERVICE') {
|
|
|
|
$("#serviceTax tr:gt(0) td:nth-child(3)").each(function() {
|
|
var temp3 = $(this).html();
|
|
if ($.inArray(temp3, itemvalue) < 0) {
|
|
itemvalue[x] = temp3;
|
|
x++;
|
|
|
|
}
|
|
});
|
|
|
|
for (var j = 0; j < zz; j++) {
|
|
options += '<option value="' + itemvalue[j] + '">' + itemvalue[j] + '</option>';
|
|
}
|
|
|
|
$("#serviceitemcode").html(options);
|
|
|
|
} else {}
|
|
}
|
|
</script>
|
|
<script type="text/html" id="addList">
|
|
<tr id="<%=index%>">
|
|
<td style="width: 15%;" align="left"><%=MaterialCode1%></td>
|
|
<td style="width: 15%;" align="left"><%=DeliveryChallanDate%></td>
|
|
<td style="width: 15%;" align="left"><%=DeliveryChallanNo%></td>
|
|
<td style="width: 15%;" align="left"><%=VehicleNo%></td>
|
|
<td style="width: 15%;" align="left"><%=CourierNo%></td>
|
|
<td style="width: 15%;" align="left"><%=AdvisedQuantity%></td>
|
|
<td style="width: 15%;" align="left"><%=File%></td>
|
|
</tr>
|
|
</script>
|
|
|
|
</script>
|
|
<script type="text/html" id="addservice">
|
|
<tr id="<%=index%>">
|
|
<td style="width: 15%;" align="left"><%=MaterialCode%></td>
|
|
<td style="width: 15%;" align="left"><%=Description%></td>
|
|
<td style="width: 15%;" align="left"><%=File1%></td>
|
|
|
|
</tr>
|
|
</script>
|
|
<script>
|
|
//table append for file uploading
|
|
var index = '1';
|
|
var specialrow = 0;
|
|
|
|
function addtable() {
|
|
//alert("addonclick");
|
|
var temp = index;
|
|
var emergencyitemcode = $('#emergencyitemcode').val();
|
|
var ChallanInvno = $('#ChallanInvNo').val();
|
|
var ChallanInvDate = $('#Date1').val();
|
|
var VehicleNo1 = $('#VehicleNo').val();
|
|
var CourierNo1 = $('#CourierNo').val();
|
|
var Quantity123 = $('#AQuantity').val();
|
|
var images = $('#imag').val();
|
|
|
|
//var actqty=$('#quantity'+temp);
|
|
|
|
// console.log(actqty);
|
|
|
|
|
|
|
|
if (emergencyitemcode != '' || ChallanInvno != '' || ChallanInvDate != '' || VehicleNo1 != '' || CourierNo1 != '' || Quantity123 != '' || images != '') {
|
|
//alert('hai'+Quantity123+CourierNo1);
|
|
//alert('both insert and update operation evaluated');
|
|
if (emergencyitemcode == '') {
|
|
alert("Please Enter Material Code");
|
|
$("#emergencyitemcode").focus();
|
|
return false;
|
|
|
|
|
|
|
|
} else if (ChallanInvno == '') {
|
|
alert("Please Enter Challan No");
|
|
$('#ChallanInvNo').focus();
|
|
return false;
|
|
|
|
|
|
} else if (ChallanInvDate == '') {
|
|
alert("Please Enter Invoice Date");
|
|
$('#ChallanInvDate').focus();
|
|
return false;
|
|
|
|
|
|
}
|
|
// else if (VehicleNo1 == ''){
|
|
// alert("Please Enter Vehicle No");
|
|
// $('#VehicleNo').focus();
|
|
// return false;
|
|
|
|
|
|
|
|
// }
|
|
// else if (CourierNo1 == ''){
|
|
// alert("Please Enter Courier No");
|
|
// $('#CourierNo').focus();
|
|
// return false;
|
|
|
|
|
|
// }
|
|
else if (AQuantity == '') {
|
|
alert("Please Enter Advised Quantity");
|
|
$('#AQuantity').focus();
|
|
return false;
|
|
|
|
|
|
} else if (images == '') {
|
|
alert("Please Upload File to be saved");
|
|
$('#imag').focus();
|
|
|
|
return false;
|
|
|
|
|
|
} else {
|
|
var template = jQuery("#addList").html();
|
|
index = parseInt(index) + 1;
|
|
$('#specialappend').append(_.template(template, {
|
|
index: temp,
|
|
MaterialCode1: emergencyitemcode,
|
|
DeliveryChallanDate: ChallanInvDate,
|
|
DeliveryChallanNo: ChallanInvno,
|
|
VehicleNo: VehicleNo1,
|
|
CourierNo: CourierNo1,
|
|
AdvisedQuantity: Quantity123,
|
|
File: images
|
|
}));
|
|
|
|
var theForm = $(".CreatealterPO");
|
|
|
|
addHidden(theForm, "emergencyitemcode" + temp, emergencyitemcode);
|
|
addHidden(theForm, "imag" + temp, images);
|
|
|
|
|
|
$('#AQuantity').val('');
|
|
|
|
specialrow++;
|
|
|
|
$('#splrow').val(specialrow);
|
|
// $('input[name="Quality"]').attr('checked', false);
|
|
// $('#images').val('');
|
|
} //else closed
|
|
} //if closed
|
|
|
|
|
|
|
|
} //add click function closed
|
|
|
|
|
|
//var index1 = '1';
|
|
var specialservicerow = 0;
|
|
|
|
function servicetable() {
|
|
alert("addonclick");
|
|
var temp = index;
|
|
var serviceitemcode = $('#serviceitemcode').val();
|
|
var description = $('#description').val();
|
|
|
|
var images12 = $('#images1').val();
|
|
console.log(serviceitemcode);
|
|
console.log(description);
|
|
console.log(images12);
|
|
console.log(temp);
|
|
//var actqty=$('#quantity'+temp);
|
|
|
|
//console.log(actqty);
|
|
|
|
|
|
|
|
if (images12 == '' || description == '' || serviceitemcode == '') {
|
|
//alert('hai'+Quantity123+CourierNo1);
|
|
//alert('both insert and update operation evaluated');
|
|
if (serviceitemcode == '') {
|
|
alert("Please Enter Material Code");
|
|
$("#serviceitemcode").focus();
|
|
} else if (description == '') {
|
|
alert("Please Enter description");
|
|
$('#description').focus();
|
|
return false;
|
|
} else if (images12 == '') {
|
|
alert("Please select your file");
|
|
$('#images1').focus();
|
|
return false;
|
|
}
|
|
} //validation if closed
|
|
else {
|
|
var template = jQuery("#addservice").html();
|
|
index = parseInt(index) + 1;
|
|
$('#specialserviceappend').append(_.template(template, {
|
|
index: temp,
|
|
MaterialCode: serviceitemcode,
|
|
Description: description,
|
|
File1: images12
|
|
}));
|
|
|
|
var theForm = $(".CreatealterPO");
|
|
|
|
addHidden(theForm, "serviceitemcode" + temp, emergencyitemcode);
|
|
addHidden(theForm, "images1" + temp, images);
|
|
|
|
|
|
|
|
// specialservicerow++;
|
|
// $('#splrow').val(specialrow);
|
|
// var a=$('#emergencyitemcode'+temp).val();
|
|
// var b=$('#images'+temp).val();
|
|
//console.log(a);
|
|
// console.log(b);
|
|
// addHidden(theForm,"VehicleNo"+temp,Reqnumber );
|
|
// addHidden(theForm,"CourierNo"+temp,Reqnumber );
|
|
// addHidden(theForm,"AQuantity"+temp,Reqnumber );
|
|
|
|
//$('#emergencyitemcode').val('');
|
|
// $('#ChallanInvNo').val('');
|
|
// $('#ChallanInvDate').val('');
|
|
// $('#VehicleNo').val('');
|
|
// $('#CourierNo').val('');
|
|
|
|
|
|
|
|
// $('input[name="Quality"]').attr('checked', false);
|
|
// $('#images').val('');
|
|
} //else closed
|
|
//if closed
|
|
// var tablevalue = $('#specialtable').tableToJSON(); // Convert the table into a javascript object
|
|
// var jsondata = JSON.stringify(tablevalue);
|
|
//alert(jsondata);
|
|
// $("#tablevalues").val(jsondata);
|
|
// $("#tablevalues").val(jsondata);
|
|
|
|
|
|
}
|
|
</script>
|
|
|
|
|
|
<!-- Multiple file Upload Script -->
|
|
<script>
|
|
var counter = 0;
|
|
var counterConstant = 0;
|
|
|
|
|
|
|
|
|
|
|
|
$("#addmorebutton").click(function() {
|
|
|
|
|
|
|
|
|
|
//alert('sda');
|
|
|
|
if (counter > 4) {
|
|
alert("You have to upload five files only"); //this allows only 5 files;
|
|
return false;
|
|
} else {
|
|
|
|
counter++;
|
|
counterConstant++;
|
|
|
|
var div = document.createElement('div');
|
|
div.id = "divid" + counter;
|
|
div.className = "row";
|
|
div.innerHTML = '<div class="col-md-12">' +
|
|
|
|
'<div class="col-md-4">' +
|
|
'<label><br></label>' +
|
|
'<input type="file" name="browseFiles' + counterConstant + '" id="imag" onchange="Copyfilename(this.name); "><br>' +
|
|
'</div>' +
|
|
|
|
|
|
'<div class="col-md-1" style="margin-top:-3%;">' +
|
|
'<label><br><br></label>' +
|
|
'<button class="btn btn-success" type="button" onclick="addRow(' + counter + ')"id="addbtn1" ><i class="fa fa-plus-square"></i></button></div>' +
|
|
|
|
'<div class="col-md-1" style="margin-top:-3%;">' +
|
|
'<label><br><br></label>' +
|
|
'<button class="btn btn-danger remove remove_this" id="removebtn' + counter + '" onclick="removeRow(this.id)"><i class="fa fa-minus-square"></i> </button></div>' +
|
|
|
|
|
|
'</div>';
|
|
$('#newdiv').append(div);
|
|
|
|
|
|
$('#hidecounter').val(counter);
|
|
$('#hideconstant').val(counterConstant);
|
|
|
|
if (counter > 1) {
|
|
alert("Add button click here"); //this allows only 5 files;
|
|
return false;
|
|
} else {
|
|
|
|
$('#addmorebutton').hide();
|
|
|
|
}
|
|
|
|
|
|
// if(counter > 1){
|
|
// alert("Add button click here");//this allows only 5 files;
|
|
// return false;
|
|
// }
|
|
// else {
|
|
|
|
// $('#addemorebutton').hide();
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
// var count = 0;
|
|
// var countConstant = 0;
|
|
|
|
function addRow(input) {
|
|
if (input < 5) {
|
|
if (input == 0) {
|
|
input = input + 1;
|
|
$("#addbtn" + input).hide();
|
|
$("#removebtn" + input).hide();
|
|
} else {
|
|
$("#addbtn" + input).hide();
|
|
$("#removebtn" + input).hide();
|
|
}
|
|
} else {
|
|
$("#addbtn" + input).show();
|
|
$("#removebtn" + input).show();
|
|
}
|
|
// alert(s);
|
|
if (counter > 4) {
|
|
alert("No more files to add"); //this allows only 5 files;
|
|
return false;
|
|
} else {
|
|
counter++;
|
|
counterConstant++;
|
|
//alert("count"+counterConstants);
|
|
var div = document.createElement('div');
|
|
div.id = "divid" + counter;
|
|
div.className = "row";
|
|
div.innerHTML = '<div class="col-md-12">' +
|
|
|
|
'<div class="col-md-4">' +
|
|
'<label><br></label>' +
|
|
'<input type="file" name="browseFiles' + counterConstant + '" id="imag" onchange="Copyfilename(this.name); "><br>' +
|
|
'</div>' +
|
|
|
|
|
|
|
|
'<div class="col-md-1" style="margin-top:-3%;">' +
|
|
'<label><br><br></label>' +
|
|
'<button class="btn btn-success" type="button" id="addbtn' + counter + '" onclick="addRow(' + counter + ')"><i class="fa fa-plus-square"></i></button></div>' +
|
|
|
|
'<div class="col-md-1" style="margin-top:-3%;">' +
|
|
'<label><br><br></label>' +
|
|
'<button class="btn btn-danger remove remove_this" id="removebtn' + counter + '" onclick="removeRow(this.id)"><i class="fa fa-minus-square"></i> </button></div>' +
|
|
'</div>' +
|
|
|
|
|
|
|
|
'</div>';
|
|
$('#newdiv').append(div);
|
|
|
|
|
|
$('#hidecounter').val(counter);
|
|
$('#hideconstant').val(counterConstant);
|
|
|
|
|
|
if (counter > 1) {
|
|
//alert("Next File choose + button click here");//this allows only 5 files;
|
|
//return false;
|
|
$('#addbtn').hide();
|
|
$("#removebtn").hide();
|
|
} else {
|
|
|
|
$('#addmorebutton').hide();
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function rfilealert() {
|
|
//alert(counterConstant);
|
|
|
|
var file = $('#imag').val();
|
|
//var file = $('#imag').val();
|
|
|
|
// alert(file);
|
|
|
|
if (file == '') {
|
|
alert('File not found');
|
|
SpecialPOcheck();
|
|
// addtable();
|
|
|
|
|
|
|
|
} else {
|
|
SpecialPOcheck();
|
|
// addtable();
|
|
}
|
|
}
|
|
|
|
function Copyfilename(id) {
|
|
|
|
var size = $('input[name=' + id + ']')[0].files[0].size;
|
|
|
|
var number = id.replace(/[^0-9]+/ig, "");
|
|
|
|
if (size > 2100000) {
|
|
//alert(id);
|
|
alert('Sorry Your File is Large To 2MB');
|
|
removeRow(id);
|
|
//$('input[name = browseFiles'+number+']').val(' ');
|
|
} else {
|
|
var name = $('input[name=' + id + ']')[0].files[0].name;
|
|
//alert(name);
|
|
$("#maint_filename" + number).val(name);
|
|
}
|
|
}
|
|
|
|
|
|
function removeRow(input) {
|
|
// alert(input);
|
|
var number = input.replace(/[^0-9]+/ig, "");
|
|
//alert(number);
|
|
if (counter >= 1) {
|
|
counter--;
|
|
|
|
$("#divid" + number).remove();
|
|
$('#hidecounter').val(counter);
|
|
}
|
|
|
|
var rm_count = $("#hideconstant").val();
|
|
if (counter != 0) {
|
|
if (number != rm_count) {
|
|
// alert("if");
|
|
$("#addbtn" + counter).show();
|
|
$("#removebtn" + counter).show();
|
|
} else {
|
|
//alert('else');
|
|
$("#addbtn" + counter).show();
|
|
$("#removebtn" + counter).show();
|
|
}
|
|
} else {
|
|
$("#addmorebutton").show();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//this script used to multiple file upoads in service//
|
|
|
|
|
|
|
|
|
|
|
|
var counters = 0;
|
|
var counterConstants = 0;
|
|
|
|
$("#addemorebutton").click(function() {
|
|
|
|
//alert('sda');
|
|
|
|
if (counters > 4) {
|
|
alert("You have to upload five files only"); //this allows only 5 files;
|
|
return false;
|
|
} else {
|
|
|
|
counters++;
|
|
counterConstants++;
|
|
|
|
var div = document.createElement('div');
|
|
div.id = "divid" + counters;
|
|
div.className = "row";
|
|
div.innerHTML = '<div class="col-md-12">' +
|
|
|
|
'<div class="col-md-4" >' +
|
|
'<label><br></label>' +
|
|
'<input type="file" id="images1" name="browseFiles' + counterConstants + '" onchange="Copyfilenames(this.name);"><br>' +
|
|
'</div>' +
|
|
|
|
|
|
'<div class="col-md-1" >' +
|
|
'<label><br><br></label>' +
|
|
'<button class="btn btn-success" type="button" onclick="addRows(' + counters + ')"id="addbtns1" ><i class="fa fa-plus-square"></i></button></div>' +
|
|
|
|
'<div class="col-md-1" >' +
|
|
'<label><br><br></label>' +
|
|
'<button class="btn btn-danger remove remove_this" id="removebtns' + counters + '" onclick="removeRows(this.id)"><i class="fa fa-minus-square"></i></button></div>' +
|
|
|
|
'</div>';
|
|
$('#newsdiv').append(div);
|
|
|
|
|
|
|
|
$('#hidecounters').val(counters);
|
|
$('#hideconstants').val(counterConstants);
|
|
|
|
if (counters > 1) {
|
|
alert("Add button click here"); //this allows only 5 files;
|
|
return false;
|
|
} else {
|
|
|
|
$('#addemorebutton').hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
// document.write("browseFiles"+length);
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
function addRows(inputs) {
|
|
if (inputs < 5) {
|
|
if (inputs == 0) {
|
|
inputs = inputs + 1;
|
|
$("#addbtns" + inputs).hide();
|
|
$("#removebtns" + inputs).hide();
|
|
} else {
|
|
$("#addbtns" + inputs).hide();
|
|
$("#removebtns" + inputs).hide();
|
|
}
|
|
} else {
|
|
$("#addbtns" + inputs).show();
|
|
$("#removebtns" + inputs).show();
|
|
}
|
|
// alert(s);
|
|
if (counters > 4) {
|
|
alert("No more files to add"); //this allows only 5 files;
|
|
return false;
|
|
} else {
|
|
counters++;
|
|
counterConstants++;
|
|
//alert("count"+counterConstants);
|
|
var div = document.createElement('div');
|
|
div.id = "divid" + counters;
|
|
div.className = "row";
|
|
div.innerHTML = '<div class="col-md-12">' +
|
|
|
|
'<div class="col-md-4">' +
|
|
'<label><br></label>' +
|
|
'<input type="file" name="browseFiles' + counterConstants + '" id="images1" onchange="Copyfilename(this.name); "><br>' +
|
|
'</div>' +
|
|
// '<div class="col-md-2">'+
|
|
// '<label><br><br></label>'+
|
|
// '<button class="btn btn-danger remove remove_this" id="removebtns'+counters+'" onclick="removeRows(this.id)"><i class="fa fa-"></i>-</button></div>'+
|
|
// '</div>'+
|
|
|
|
|
|
'<div class="col-md-1" >' +
|
|
'<label><br><br></label>' +
|
|
'<button class="btn btn-success" type="button" id="addbtns' + counters + '" onclick="addRows(' + counters + ')"><i class="fa fa-plus-square"></i></button></div>' +
|
|
|
|
'<div class="col-md-1" >' +
|
|
'<label><br><br></label>' +
|
|
'<button class="btn btn-danger remove remove_this" id="removebtns' + counters + '" onclick="removeRows(this.id)"><i class="fa fa-minus-square"></i></button></div>' +
|
|
'</div>' +
|
|
|
|
|
|
'</div>';
|
|
$('#newsdiv').append(div);
|
|
|
|
|
|
$('#hidecounters').val(counters);
|
|
$('#hideconstants').val(counterConstants);
|
|
|
|
|
|
if (counters > 1) {
|
|
//alert("Next File choose + button click here");//this allows only 5 files;
|
|
//return false;
|
|
$('#addbtns').hide();
|
|
$("#removebtns").hide();
|
|
} else {
|
|
|
|
$('#addemorebutton').hide();
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function sfilealert() {
|
|
//alert(counterConstants);
|
|
var file1 = $('#images1').val();
|
|
//$('input[name='+id+']')[0].files[0].size;
|
|
if (file1 == '') {
|
|
alert('File not found');
|
|
SpecialPOcheck();
|
|
} else {
|
|
SpecialPOcheck();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function Copyfilenames(id) {
|
|
|
|
var size = $('input[name=' + id + ']')[0].files[0].size;
|
|
|
|
var number = id.replace(/[^0-9]+/ig, "");
|
|
|
|
if (size > 2100000) {
|
|
//alert(id);
|
|
alert('Sorry Your File is Large To 2MB');
|
|
removeRows(id);
|
|
//$('input[name = browseFiles'+number+']').val(' ');
|
|
} else {
|
|
var name = $('input[name=' + id + ']')[0].files[0].name;
|
|
//alert(name);
|
|
//$("#maint_filename"+number).val(name);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// function removeRows(input) {
|
|
|
|
// var number = input.replace(/[^0-9]+/ig,"");
|
|
|
|
// if(counters>= 1){
|
|
// counters --;
|
|
|
|
// $("#divid"+number).remove();
|
|
// $('#hidecounters').val(counters);
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
function removeRows(inputs) {
|
|
// alert(input);
|
|
var number = inputs.replace(/[^0-9]+/ig, "");
|
|
//alert(number);
|
|
if (counters >= 1) {
|
|
counters--;
|
|
|
|
$("#divid" + number).remove();
|
|
$('#hidecounters').val(counters);
|
|
}
|
|
|
|
var rm_count = $("#hideconstants").val();
|
|
if (counters != 0) {
|
|
if (number != rm_count) {
|
|
// alert("if");
|
|
$("#addbtns" + counters).show();
|
|
$("#removebtns" + counters).show();
|
|
} else {
|
|
//alert('else');
|
|
$("#addbtns" + counters).show();
|
|
$("#removebtns" + counters).show();
|
|
|
|
}
|
|
} else {
|
|
$("#addemorebutton").show();
|
|
}
|
|
}
|
|
</script>
|
|
<script>
|
|
$('#IsOpenOrder').change(function() {
|
|
var input = document.getElementById('purpose').value;
|
|
// alert("IsOpenOrder");
|
|
if (this.checked) {
|
|
|
|
if (input == 'REVENUE') {
|
|
$('#Quantity').val(0);
|
|
$('#Quantity').removeAttr('required');
|
|
$('#Quantity').attr('readonly', true);
|
|
}
|
|
if( input == 'SERVICE')
|
|
{
|
|
$('#ServiceQuantity').val(0);
|
|
$('#ServiceQuantity').removeAttr('required');
|
|
$('#ServiceQuantity').attr('readonly', true);
|
|
}
|
|
} else {
|
|
if (input == 'REVENUE') {
|
|
$('#Quantity').val('');
|
|
$('#Quantity').removeAttr('readonly');
|
|
$('#Quantity').attr('required', true);
|
|
}
|
|
if( input == 'SERVICE'){
|
|
$('#ServiceQuantity').val('');
|
|
$('#ServiceQuantity').removeAttr('readonly');
|
|
$('#ServiceQuantity').attr('required', true);
|
|
}
|
|
}
|
|
});
|
|
</script>
|