revenue and service po changes done

This commit is contained in:
venbatechnologies@gmail.com 2017-08-01 18:46:20 +05:30
parent d926b897b4
commit 4ed9550af1
9 changed files with 635 additions and 291 deletions

View File

@ -736,9 +736,10 @@ class purchaseorder extends BaseController
$createddt = $dt->format('Y-m-d H:i:s');
$PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment');
$Local_Interstate=$this->input->post('Range');
// PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment);
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
@ -771,6 +772,7 @@ class purchaseorder extends BaseController
$FreightType = $this->input->post('FreightType'.$i);
$FreightValue = $this->input->post('FreightVal'.$i);
$AfterFreightValue = $this->input->post('AfterFreightVal'.$i);
$NOOfTrip = $this->input->post('NoOfTrip'.$i);
$InsuranceValue = $this->input->post('Insval'.$i);
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$CostCenter = $this->input->post('costCode'.$i);
@ -811,7 +813,7 @@ class purchaseorder extends BaseController
if(trim($POType) == REVENUE )
{
// echo 'Success';
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst);
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip);
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
//echo 'Revenue tax Success';
@ -834,14 +836,14 @@ class purchaseorder extends BaseController
$dt = $this->input->post('Deliverydt');
//$Deliverydt = $this->getDateformat($dt);
$DeliveryOption = $this->input->post('DateRange');
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else{
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else{
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
@ -863,18 +865,17 @@ class purchaseorder extends BaseController
$updateddt = $dt->format('Y-m-d H:i:s');
$PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment');
$Local_Interstate=$this->input->post('Range');
// PO Master
// PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment);
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
$LineItemStatus = REQITEM_NEW;
//echo $RowCount;
for ($i = 1; $i <= $RowCount; $i++)
{
@ -899,7 +900,8 @@ class purchaseorder extends BaseController
$FreightType = $this->input->post('FreightType'.$i);
$FreightValue = $this->input->post('FreightVal'.$i);
$AfterFreightValue = $this->input->post('AfterFreightVal'.$i);
$InsuranceValue = $this->input->post('Insval'.$i);
$NOOfTrip = $this->input->post('NoOfTrip'.$i);
$InsuranceValue = $this->input->post('Insval'.$i);
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$POLineItemNo = $this->input->post('LineItemNo'.$i);
$CostCenter = $this->input->post('costCode'.$i);
@ -921,10 +923,12 @@ class purchaseorder extends BaseController
}
}
if($SkipInsert == "False")
{
if(strlen($POLineItemNo) == 0)
{
{
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
if(count($POLineItem)>0)
@ -935,6 +939,7 @@ class purchaseorder extends BaseController
}
else
{
$LineItemNo = $POLineItemNo;
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter);
@ -944,14 +949,15 @@ class purchaseorder extends BaseController
$isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo);
if(count($isExists) == 0)
{
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst);
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip);
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
}
else
{
$RevenueTaxList = array('DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'CreatedBy'=>$updatedBy);
$RevenueTaxList = array('DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'CreatedBy'=>$updatedBy,'NoOfTrip'=>$NOOfTrip);
$this->purchaseorder_model->updateRevenueTax($LineItemNo,$RevenueTaxList);

View File

@ -158,7 +158,7 @@ class servicepurchaseorder extends BaseController
function addNewServicePurchaseOrder()
{
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
@ -177,7 +177,7 @@ class servicepurchaseorder extends BaseController
}
$PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment');
$POType = $this->input->post('POType');
@ -196,7 +196,7 @@ class servicepurchaseorder extends BaseController
$WorkStatus=$this->input->post('workstatus');
// PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus, 'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption, 'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus,'POType'=>$POType );
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus, 'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption, 'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus,'POType'=>$POType,'PaymentOtherDescription'=>$OtherPayment);
$POMaster = $this->purchaseorder_model->addPOMaster($POList);
@ -274,6 +274,7 @@ class servicepurchaseorder extends BaseController
echo 'Service Purchase Order Created Successfully!The PO NO Is: '.$PONO;
}
//update service po
function UpdateServicePurchaseOrder()
{
$PONO =$this->input->post('txtPONO');
@ -285,20 +286,20 @@ class servicepurchaseorder extends BaseController
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
$dt = $this->input->post('Deliverydt');
$DeliveryOption = $this->input->post('DateRange');
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else{
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else{
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
$PaymentTerms=$this->input->post('PaymentTerms');
$Payableat=$this->input->post('PayableAT');
$PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment');
$POType = $this->input->post('POType');
@ -317,7 +318,7 @@ class servicepurchaseorder extends BaseController
// PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus );
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'ServiceWorkStatus'=>$WorkStatus,'PaymentOtherDescription'=>$OtherPayment);
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);

View File

@ -354,7 +354,7 @@ function purchaseorderListing($forwhat='')
*/
function getRequistionNoFromPO($PONO='')
{
$this->db->distinct();
$this->db->select('ReqNo,');
$this->db->from('T_PurchaseOrder_LineItem');
if($PONO != '')

View File

@ -2,7 +2,7 @@
$DeliverOption='';
$SupId = '';
$SupName = '';
$SupName = '';
$Address = '';
$PODate = '';
@ -17,13 +17,14 @@ $DeliverOption='';
$TotalBasicAmount = 0.0;
$ServiceDescription = '';
$OtherAmt = 0.0;
$Deliverydt='';
$DeliverSchedule='';
$MaxPoDate = '';
$AvlAmount = 0;
$Value="&#8377;";
$Deliverydt='';
$DeliverSchedule='';
$MaxPoDate = '';
$AvlAmount = 0;
$Value="&#8377;";
$StatusName='';
$StatusName='';
if(!empty($INRSYMBOL))
@ -67,6 +68,7 @@ if(!empty($POMaster))
$WrkStatus=$Req->ServiceWorkStatus;
$StatusName=$Req->StatusName;
$otherPayment = $Req->PaymentOtherDescription;
}
}
@ -143,6 +145,16 @@ $('#Deliverydt').val('');
$('#Scheduleby').val(SchName);
}
var PaymentOther = '<?php echo $otherPayment; ?>';
var PayTerms = '<?php echo $Terms; ?>';
if(PayTerms=='PT08'){
$('#otheroptiondiv').show();
$('#Otherpayment').val(PaymentOther);
}
else{
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
</script>
<script>
@ -165,11 +177,11 @@ $("#PODate").datepicker({
minDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
$("#Requeston").datepicker({
/* $("#Requeston").datepicker({
//minDate : d,
maxDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
}); */
$('#drpSupplier').change(function() {
var id = $('#drpSupplier').val();
@ -665,6 +677,8 @@ function clearEditTaxField()
}
$(document).ready(function () {
$("#PaymentTerms").select2();
$('#Date').click(function () {
//for Date range selection
$('#Schedulediv').hide();
@ -838,7 +852,7 @@ $(document).ready(function () {
</div>
</div>
<div class="col-md-12" id="Schedulediv" style="display:none;"><br/>
<label >Schedule :</label>
<label >Schedule By</label>
<?php
$data = array('name' => 'Scheduleby','value' => set_value('Scheduleby'),'id'=>'Scheduleby', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40');
echo Form_textarea($data);
@ -886,7 +900,16 @@ $(document).ready(function () {
</div>
</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: #ecf0f5 ;">*</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>
@ -936,7 +959,7 @@ $(document).ready(function () {
</div>
</div>
<div class="col-md-3">
<label>Cost Center Name</label>
<label>Cost Center Code</label>
<div class="form-group">
<?php
$data = array('name' => 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true');
@ -1199,7 +1222,7 @@ $(document).ready(function () {
</div>
</div>
<div class="col-md-3">
<label>Cost Center Name</label>
<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');
@ -1464,7 +1487,7 @@ $(document).ready(function () {
</div>
</div>
<div class="col-md-3">
<label>Cost Center Name</label>
<label>Cost Center Code</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCostCenter','value' => set_value('ViewCostCenter'),'id'=>'ViewCostCenter', 'class' => 'form-control' ,'readonly' => 'true');
@ -1473,7 +1496,7 @@ $(document).ready(function () {
?>
</div>
</div>
<!-- <div class="col-md-3">
<div class="col-md-3">
<label>Avail Budget Amount In INR</label>
<div class="form-group">
<?php
@ -1481,7 +1504,7 @@ $(document).ready(function () {
echo form_input($data);
?>
</div>
</div>-->
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">
@ -1705,10 +1728,10 @@ $(document).ready(function () {
<th>Item Description</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate</th>
<th>Basic Amount</th>
<th>Tax Amount</th>
<th>Total Order Amount</th>
<th>Rate In INR</th>
<th>Basic Amount In INR</th>
<th>Tax Amount In INR</th>
<th>Total Order Amount In INR</th>
<th>Actual Quantity</th>
<th>Received Quantity</th>
<th>Pending Quantity</th>
@ -1783,7 +1806,7 @@ $(document).ready(function () {
<?php
if($PONOStatus == PO_DRAFT)
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED)
{?>
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-toggle="modal" href="#EDITSERVICE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->ReqNo ; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" class="link" data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
<?php
@ -1812,7 +1835,7 @@ $(document).ready(function () {
</table>
</div>
</div>
<div class="row" style="border: 1px solid">
<div class="col-md-12">
@ -1874,62 +1897,62 @@ $(document).ready(function () {
echo form_textarea($data);
?>
</div>
<!-- <div class="col-md-12">
<label>Special Instructions :</label> <?php
$data = array('name' => 'txtSpcialInstruction','value' => set_value('txtSpcialInstruction',$ServiceDescription),'id'=>'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40' );
echo form_textarea($data);
?> <input type="hidden" name="SpcialInstruction" id="SpcialInstruction" value="<?php echo $ServiceDescription;?>">
</div>-->
</div>
<div class="col-md-12">
<div class="row"><br/>
<div align="right" style="padding-right:10px">
<div align="right"><br/>
<input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>"/>
<input type="hidden" name="txtStatus" id="txtStatus" />
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<?php if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED ) {
if($PONOStatus == PO_DRAFT){?>
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED){?>
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)" >&nbsp;&nbsp;<span class="bold">Save</span></a> <?php }?>
<a class="btn btn-primary Save" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<input type="reset" class="btn btn-primary" value="Reset">
<?php }else {?>
<a class="btn btn-primary" ID="OK" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a> <?php } ?>
</div><br/>
</div>
</div>
</div>
<br/>
</div><br/>
<div class="col-md-12" style="padding:5px;">
<div class="col-md-12" style="padding:2%;">
<div class="col-md-8">
<div class="row">
<div class="col-md-2"><label>Request On</label></div>
<div class="col-md-4">
<span>Request On</span>
<?php
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
echo form_input($data);
?>
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<span>Request By</span>
</div><br/>
<div class="row">
<div class="col-md-2"><label>Request By</label></div>
<div class="col-md-4">
<?php
$data = array('name' => 'RequestBy','value' => set_value('RequestBy',$RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true');
$data = array('name' => 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<span>Status</span>
</div><br/>
<div class="row"><div class="col-md-2"><label>Status</label></div>
<div class="col-md-4">
<?php
// $options = array("0"=>'Select Status');
// echo form_dropdown('Status', $options,set_value('Status'),'id="Status"' ,'required="true"' ,'class="form-control select2')
// $options = array("0"=>$PONOStatus);
// echo form_dropdown('Status', $options,set_value('Status',$StatusName),'id="Status"' ,'required="true"' ,'class="form-control select2')
$data = array('name' => 'Status','value' => set_value('Status',$StatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><br/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -1982,6 +2005,7 @@ $("#EDITSERVICE").on("shown.bs.modal", function(e) {
$('#EditReqNo').val($('#Reqnumber'+userid).val());
$('#EditdeptName').val($('#departmentName'+userid).val());
$("#EditCostCenter").val($('#costCode'+userid).val());
$('#EditAvlBudAmt').val($('#AvilBudget'+userid).val());
$('#EditItemName').val($('#materialName'+userid).val());
@ -2071,7 +2095,7 @@ $("#VIEWSERVICE").on("shown.bs.modal", function(e) {
$('#ViewReqNo').val($('#Reqnumber'+userid).val());
$('#ViewdeptName').val($('#departmentName'+userid).val());
$("#ViewCostCenter").val($('#costCode'+userid).val());
//$('#ViewAvlBudAmt').val($('#AvilBudget'+userid).val());
$('#ViewAvlBudAmt').val($('#AvilBudget'+userid).val());
$('#ViewItemName').val($('#materialName'+userid).val());
$('#ViewUOM').val($('#uom'+userid).val());
@ -2713,6 +2737,11 @@ $('#txtDeliveryAddress').val(deladd);
$('#Deliverydt').focus();
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Other Payment Details');
$('#Otherpayment').focus();
return false;
}
else
{
$('#content').loader('show');
@ -2807,5 +2836,30 @@ function calculateIgstTax(varBasicValue,Igst)
return TAXval;// $('#AfterServiceTax').val(TAXval);
}
//If others is the payment terms to display mandatory field
$("#PaymentTerms").change(function() {
var otherPayment = '<?php echo $otherPayment; ?>';
if ($('#PaymentTerms').val().trim()=='PT08')
{
$('#otheroptiondiv').show();
$('#Otherpayment').val(otherPayment);
}
else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
<!-- script for table , It works under the datatable plugin-->
$(function () {
$('#ServiceTable').DataTable({
"paging": false,
"lengthChange": false,
"searching": false,
//"ordering": true,
// "info": true,
"autoWidth": false
});
});
</script>

View File

@ -333,8 +333,31 @@ var SelectedMaterialList = {
}
});
$('#drpEditFreight').change(function() {
var FreightType =$("#drpEditFreight").val();
alert(FreightType);
if (FreightType == "PER TRIP")
{
$('#EditTripsValue').show();
}
else {
$('#EditTripsValue').hide();
}
});
$('#drpFreight').change(function() {
var FreightType =$("#drpFreight").val();
alert(FreightType);
if (FreightType == "PER TRIP")
{
$('#TripsValue').show();
}
else {
$('#TripsValue').hide();
}
selValue = $("#drpFreight").val() ;
@ -1754,7 +1777,9 @@ function SetExciseCalculationCancel()
}
}
$(document).ready(function(){
$("#PaymentMethod").select2();
//Initialize Select2 Elements
$("#purpose").select2();
$("#DepartmentName").select2();
@ -1873,7 +1898,8 @@ function populateValueMainFormForDeleteItem(rowid)
echo form_open($this->config->base_url().'/purchaseorder/addalterPO/',$attributes); ?>
<section class="content">
<section class="content">
<div style="border:2px solid #333">
<div id="content"></div>
<div>
<center><b><h2>Siddharth Industries - Emergency Purchase Order</h2></b></center></div>
@ -2010,7 +2036,7 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-3" id="Deliveryby" style="display:none;">
<div class="col-md-12" id="Schedulediv" style="display:none;">
<label >Schedule :</label>
<label >Schedule By</label>
<?php
$data = array('name' => 'Scheduleby','value' => set_value('Scheduleby'),'id'=>'Scheduleby', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40');
@ -2079,7 +2105,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-3">
<label>Available Budget</label><img id="AlertImg" src="<?php echo base_url(); ?>assets/dist/img/red.png" alt="your image" width="25px" style="display:none;"/>
<label>Available Budget In INR</label><img id="AlertImg" src="<?php echo base_url(); ?>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' ,'required' => 'true' ,'readonly' => 'true');
@ -2193,7 +2219,7 @@ function populateValueMainFormForDeleteItem(rowid)
<legend>Payment Details</legend>
<!-- Text input-->
<div class="col-md-4">
<span for="payablefrom">Payable Terms</span>
<label for="payablefrom">Payable Terms</label>
<?php
$options1 = array("0"=>'Select Payment method');
//print_r( $options);
@ -2209,7 +2235,16 @@ function populateValueMainFormForDeleteItem(rowid)
echo form_dropdown('PaymentMethod', $options1,set_value('PaymentMethod'),'id="PaymentMethod"' ,'class="form-control"');
?>
</div>
</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: #ecf0f5 ;">*</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>
<div class="col-md-12">
@ -2225,7 +2260,7 @@ function populateValueMainFormForDeleteItem(rowid)
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Packing Calculation On</h4>
</div>
<div class="modal-body">
@ -2256,7 +2291,7 @@ function populateValueMainFormForDeleteItem(rowid)
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Excise Duty Calculation On</h4>
</div>
<div class="modal-body">
@ -2293,7 +2328,7 @@ function populateValueMainFormForDeleteItem(rowid)
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Vat Calculation On</h4>
</div>
<div class="modal-body">
@ -2322,7 +2357,7 @@ function populateValueMainFormForDeleteItem(rowid)
<!-- Modal for CST Calculation-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">CST Calculation On</h4>
</div>
<div class="modal-body">
@ -2351,7 +2386,7 @@ function populateValueMainFormForDeleteItem(rowid)
<form>
<div class="modal-content" style="width:1000px;">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Edit Service Purchase Order Item </h4></center>
</div>
<div align="left">
@ -2379,7 +2414,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-3">
<label>Cost Center Name</label>
<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');
@ -2399,7 +2434,38 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
<div class="col-md-12">
<div class="col-md-4">
<div class="col-md-3">
<label>Item Code</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">
@ -2410,11 +2476,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-8">
<label>Service Description</label> <?php
$data = array('name' => 'EdittxtSpcialInstructionSingle','value' => set_value('EdittxtSpcialInstructionSingle'),'id'=>'EdittxtSpcialInstructionSingle', 'class' => 'form-control' );
echo form_input($data); ?>
</div>
</div>
<!-- <div class="col-md-12">
@ -2472,37 +2534,11 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div> -->
<div class="col-md-12">
<div class="col-md-2">
<label>Item Code</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-2">
<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-2">
<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-6">
<label>Service Description</label> <?php
$data = array('name' => 'EdittxtSpcialInstructionSingle','value' => set_value('EdittxtSpcialInstructionSingle'),'id'=>'EdittxtSpcialInstructionSingle', 'class' => 'form-control' );
echo form_input($data); ?>
</div>
<div class="col-md-2">
<label>Quantity</label>
<div class="form-group">
@ -2692,7 +2728,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-3">
<label>Cost Center Name</label>
<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');
@ -2701,7 +2737,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-3">
<label>Avl Bud Amt</label>
<label>Avl Bud Amt In INR</label>
<div class="form-group">
<?php
$data = array('name' => 'EditRevenueAvlBudAmt','value' => set_value('EditAvlBudAmt'),'id'=>'EditRevenueAvlBudAmt', 'class' => 'form-control num' ,'readonly' => 'true');
@ -2916,7 +2952,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-12">
<div class="col-md-4">
<div class="col-md-2">
<label>Freight Type </label>
<div>
<?php
@ -2938,6 +2974,15 @@ function populateValueMainFormForDeleteItem(rowid)
?>
</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' );
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label>Freight Rate </label>
<div class="form-group">
@ -3079,7 +3124,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-12">
<div class="col-md-12" style="padding:0px;">
<div class="col-md-12">
<div class="col-md-4">
@ -3124,7 +3169,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
<div class="col-md-2" >
<label>CGST in %</label>
<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()');
@ -3187,7 +3232,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
<div id="SGSTAddModel">
<div class="col-md-2">
<label>SGST in %</label>
<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()');
@ -3207,7 +3252,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
<div id="IGSTAddModel" style="display:none;">
<div class="col-md-2">
<label>IGST in %</label>
<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()');
@ -3228,7 +3273,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
<div class="col-md-12" >
<div class="col-md-4">
<div class="col-md-2">
<label>Freight Type </label>
<div>
<?php
@ -3247,6 +3292,15 @@ function populateValueMainFormForDeleteItem(rowid)
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</label>
<div class="form-group">
<?php
$data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num' );
echo form_input($data);
?>
</div>
</div>
@ -3318,14 +3372,14 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="modal-dialog">
<!-- Modal content-->
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-content" style="width:1000px;">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<center><h4>Add Service Purchase Order Item </h4></center>
</div>
<div align="left">
<div class="col-md-12">
<div class="col-md-4">
<div class="col-md-3">
<label>Item Code</label>
<div>
<?php
@ -3348,7 +3402,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-4">
<div class="col-md-3">
<label>Item Name</label>
<div class="form-group">
<?php
@ -3357,7 +3411,7 @@ function populateValueMainFormForDeleteItem(rowid)
?>
</div>
</div>
<div class="col-md-4">
<div class="col-md-3">
<label>UOM</label>
<div class="form-group">
<?php
@ -3366,12 +3420,7 @@ function populateValueMainFormForDeleteItem(rowid)
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4">
<div class="col-md-3">
<label>Frequency</label>
<div class="form-group">
@ -3382,12 +3431,9 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-8">
<label>Service Description</label> <?php
$data = array('name' => 'txtSpcialInstructionSingle','value' => set_value('txtSpcialInstructionSingle'),'id'=>'txtSpcialInstructionSingle', 'class' => 'form-control' );
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>
@ -3436,15 +3482,20 @@ function populateValueMainFormForDeleteItem(rowid)
<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);
$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-4">
<div class="col-md-12">
<div class="col-md-6">
<label>Service Description</label> <?php
$data = array('name' => 'txtSpcialInstructionSingle','value' => set_value('txtSpcialInstructionSingle'),'id'=>'txtSpcialInstructionSingle', 'class' => 'form-control' );
echo form_input($data); ?>
</div>
<div class="col-md-2">
<label>Quantity</label>
<div class="form-group">
<?php
@ -3453,7 +3504,7 @@ function populateValueMainFormForDeleteItem(rowid)
?>
</div>
</div>
<div class="col-md-4">
<div class="col-md-2">
<label><?php echo "Rate In ($INRSYM)";?></label>
<div class="form-group">
<?php
@ -3462,7 +3513,7 @@ function populateValueMainFormForDeleteItem(rowid)
?>
</div>
</div>
<div class="col-md-4">
<div class="col-md-2">
<label><?php echo "Basic Amount In ($INRSYM)";?></label>
<div class="form-group">
<?php
@ -3617,7 +3668,7 @@ function populateValueMainFormForDeleteItem(rowid)
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Add Import Purchase Order Item </h4></center>
</div>
<div align="left">
@ -4118,7 +4169,7 @@ function populateValueMainFormForDeleteItem(rowid)
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Add Capital Purchase Order Item </h4></center>
</div>
<div align="left">
@ -4602,13 +4653,12 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
<!-- /.box-body -->
</div>
</div>
</table>
<div class="row">
<div class="container-fluid">
<div class="row">
<!-- Revenue po taxes -->
<div class="col-md-12" style='border : 1px solid; display:none;' id="revenuepotaxes">
<br/>
@ -4632,7 +4682,7 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-3">
<label >Total CGST In INR </label>
<label >CGST In INR </label>
<?php
$data = array('name' => 'txtTotalCGST','value' => set_value('txtTotalCGST'),'id'=>'txtTotalCGST', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
@ -4640,14 +4690,14 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
<div class="col-md-3" id="displaySGST">
<label >Total SGST In INR </label>
<label >SGST In INR </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 >Total IGST In INR </label>
<label > IGST In INR </label>
<?php
$data = array('name' => 'txtTotalIGST','value' => set_value('txtTotalIGST'),'id'=>'txtTotalIGST', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
@ -4698,7 +4748,7 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-12">
<label>Special Instructions </label>
<?php
$data = array('name' => 'txtSpcialInstruction','value' => set_value('txtSpcialInstruction'),'id'=>'txtSpcialInstruction', 'class' => 'form-control','rows' => '4', 'cols' => '40' );
$data = array('name' => 'txtSpcialInstruction','value' => set_value('txtSpcialInstruction'),'id'=>'txtSpcialInstruction', 'class' => 'form-control');
echo form_textarea($data);
?>
</div>
@ -4735,7 +4785,7 @@ function populateValueMainFormForDeleteItem(rowid)
?>
</div>
<div class="col-md-2">
<label>Total CGST In INR</label>
<label>CGST In INR</label>
<?php
$data = array('name' => 'txtTotCgst','value' => set_value('txtTotCgst'),'id'=>'txtTotCgst', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
@ -4744,21 +4794,21 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-2">
<label>Total SGST In INR</label>
<label>SGST In INR</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>Total IGST In INR </label>
<label>IGST In INR </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>Total Other Allowances In INR</label>
<label>Other Allowances In INR</label>
<?php
$data = array('name' => 'txtTotOtherAllo','value' => set_value('txtTotOtherAllo'),'id'=>'txtTotOtherAllo', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
@ -4781,7 +4831,7 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-12">
<div class="col-md-12">
<label>Scope Of Work</label> <?php
$data = array('name' => 'ScopeOfWork','value' => set_value('ScopeOfWork'),'id'=>'ScopeOfWork', 'class' => 'form-control num' ,'rows' => '4', 'cols' => '40' );
$data = array('name' => 'ScopeOfWork','value' => set_value('ScopeOfWork'),'id'=>'ScopeOfWork', 'class' => 'form-control num');
echo form_textarea($data); ?>
</div>
</div>
@ -4803,9 +4853,13 @@ function populateValueMainFormForDeleteItem(rowid)
<br/>
</div>
</div>
</div> </div>
</div>
</div>
</div>
</div>
</div></section> </div>
<script type="text/html" id="RevenueList">
<tr id="<%=index%>">
<td align="left"><%=index%></td>
@ -6933,5 +6987,19 @@ function calculateRevenueEditTaxValue()
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('');
}
});
</script>

View File

@ -26,7 +26,7 @@ if(!empty($CompanyDetails))
if(!empty($AvlBudAmt))
{
$AvlAmount = $AvlBudAmt;
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
}
@ -65,6 +65,7 @@ foreach ($PaymentTerms as $TER)
$ServiceDescription = '';
$CapitalRange = '';
$otherPayment='';
if(!empty($POMaster))
{
foreach ($POMaster as $Req)
@ -87,6 +88,7 @@ if(!empty($POMaster))
$ServiceDescription = $Req->ServiceDescription;
$CapitalRange = $Req->CapitalRange;
$StatusName=$Req->StatusName;
$otherPayment = $Req->PaymentOtherDescription;
}
}
@ -174,6 +176,16 @@ $('#Deliverydt').val('');
$('#Scheduleby').val(SchName);
}
var PaymentOther = '<?php echo $otherPayment; ?>';
var PayTerms = '<?php echo $Terms; ?>';
if(PayTerms=='PT08'){
$('#otheroptiondiv').show();
$('#Otherpayment').val(PaymentOther);
}
else{
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
</script>
<script>
@ -264,6 +276,8 @@ $("#AvlBudAmt").val('');
var y = <?php echo json_encode($RequistionDetails, JSON_PRETTY_PRINT) ?>;
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
var AvlBudAmt = '<?php echo $AvlAmount ?>';
// For Binding DepartmentName
$.each(y, function(idx, obj) {
@ -415,6 +429,8 @@ $("#txtEditBasicValue").val('');
$('#txtDiscount').val('');
$('#txtAfterDiscount').val('');
}
calculateDiscount(0);
});
@ -438,6 +454,8 @@ $('#EditDiscountType').change(function() {
$('#txtEditDiscount').val('');
$('#txtEditAfterDiscount').val('');
}
calculateDiscount(1);
});
@ -464,6 +482,8 @@ $('#PackagingType').change(function() {
$('#txtPackaging').removeAttr( 'readonly','true' );
}
}
calculatePackaging(0);
});
$('#EditPackagingType').change(function() {
@ -489,6 +509,8 @@ $('#EditPackagingType').change(function() {
$('#txtEditPackaging').removeAttr( 'readonly','true' );
}
}
calculatePackaging(1);
});
@ -532,7 +554,7 @@ $('#txtEditCST').change(function() {
});
$('#drpFreight').change(function() {
var FreightType =$("#drpFreight").val();
alert(FreightType);
if (FreightType == "PER TRIP")
{
@ -561,7 +583,8 @@ $('#drpFreight').change(function() {
}
calculateFreight(0);
});
/* $('#drpViewFreight').change(function() {
var FreightType =$("#drpViewFreight").val();
@ -578,7 +601,7 @@ $('#drpFreight').change(function() {
}); */
$('#drpEditFreight').change(function() {
var FreightType =$("#drpEditFreight").val();
alert(FreightType);
if (FreightType == "PER TRIP")
{
@ -605,6 +628,7 @@ $('#drpEditFreight').change(function() {
$('#txtEditFreight').removeAttr( 'readonly','true' );
$('#txtEditFreight').val('');
}
calculateFreight(1);
});
});
@ -1512,8 +1536,23 @@ function calculatePackaging(isEdit)
AfterFreight = <?php echo FREIGHT_PERUOM;?>;
}
else if(FreightType == '<?php echo PERTRIP;?>')
{
AfterFreight = <?php echo FREIGHT_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();
@ -1579,7 +1618,20 @@ function calculatePackaging(isEdit)
}
else if(FreightType == '<?php echo PERTRIP;?>')
{
AfterFreight = <?php echo FREIGHT_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();
@ -2474,7 +2526,7 @@ function calculateEditTaxValue()
<label>NO Of Trips</label>
<div class="form-group">
<?php
$data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num' );
$data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num','onchange'=>'calculateFreight(0);' );
echo form_input($data);
?>
</div>
@ -2830,7 +2882,7 @@ function calculateEditTaxValue()
<label>NO Of Trips</label>
<div class="form-group">
<?php
$data = array('name' => 'EditNOOfTrips','value' => set_value('EditNOOfTrips'),'id'=>'EditNOOfTrips', 'class' => 'form-control num' );
$data = array('name' => 'EditNOOfTrips','value' => set_value('EditNOOfTrips'),'id'=>'EditNOOfTrips', 'class' => 'form-control num' ,'onchange'=>'calculateFreight(1);');
echo form_input($data);
?>
</div>
@ -3146,15 +3198,15 @@ function calculateEditTaxValue()
?>
</div>
</div>
<!-- <div class="col-md-2" id="ViewTripsValue" style="display:none;">
<div class="col-md-2" id="ViewTripsValue" style="display:none;">
<label>NO Of Trips</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewNOOfTrips','value' => set_value('ViewNOOfTrips'),'id'=>'ViewNOOfTrips', 'class' => 'form-control num' );
$data = array('name' => 'ViewNOOfTrips','value' => set_value('ViewNOOfTrips'),'id'=>'ViewNOOfTrips', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>-->
</div>
<div class="col-md-2">
<label>Freight Rate </label>
<div class="form-group">
@ -3264,7 +3316,7 @@ function calculateEditTaxValue()
<td align="right"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td>
<input type="hidden" name="<?php echo 'Reqnumber'.$index ?>" id="<?php echo 'Reqnumber'.$index ?>" value="<?php echo $record->ReqNo ; ?>" />
<input type="hidden" name="<?php echo 'departmentName'.$index ?>" id="<?php echo 'departmentName'.$index ?>" value="<?php echo $record->DepartmentName ; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget'.$index ?>" id="<?php echo 'AvilBudget'.$index ?>" />
<input type="hidden" name="<?php echo 'AvilBudget'.$index ?>" id="<?php echo 'AvilBudget'.$index ?>" value="<?php echo $AvlAmount ; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo'.$index ?>" id="<?php echo 'LineItemNo'.$index ?>" value="<?php echo $record->LineItemNo ; ?>" />
<input type="hidden" name="<?php echo 'costCode'.$index ?>" id="<?php echo 'costCode'.$index ?>" value="<?php echo $record->CostCenterCode ; ?>" />
<input type="hidden" name="<?php echo 'materialCode'.$index ?>" id="<?php echo 'materialCode'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" />
@ -3288,6 +3340,7 @@ function calculateEditTaxValue()
<input align="right" type="hidden" name="<?php echo 'RevenueIgst'.$index ?>" id="<?php echo 'RevenueIgst'.$index ?>" value="<?php echo $record->IGST ; ?>" />
<input align="right" type="hidden" name="<?php echo 'RevenueAfterIgst'.$index ?>" id="<?php echo 'RevenueAfterIgst'.$index ?>" value="<?php echo $record->AfterIGST ; ?>" />
<input align="right" type="hidden" name="<?php echo 'FreightType'.$index ?>" id="<?php echo 'FreightType'.$index ?>" value="<?php echo $record->FreightType ; ?>" />
<input align="right" type="hidden" name="<?php echo 'NoOfTrip'.$index ?>" id="<?php echo 'NoOfTrip'.$index ?>" value="<?php echo $record->NoOfTrip ; ?>" />
<input align="right" type="hidden" name="<?php echo 'FreightVal'.$index ?>" id="<?php echo 'FreightVal'.$index ?>" value="<?php echo $record->FreightValue ; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterFreightVal'.$index ?>" id="<?php echo 'AfterFreightVal'.$index ?>" value="<?php echo $record->AfterFreightValue ; ?>" />
<input align="right"type="hidden" name="<?php echo 'basicval'.$index ?>" id="<?php echo 'basicval'.$index ?>" value="<?php echo $record->BasicValue ; ?>"/>
@ -3295,7 +3348,7 @@ function calculateEditTaxValue()
<input align="right" type="hidden" name="<?php echo 'TotalOrderValue'.$index ?>" id="<?php echo 'TotalOrderValue'.$index ?>" value="<?php echo $record->TotalValue ; ?>" />
<?php
if($PONOStatus == PO_DRAFT)
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED)
{?>
<td> <a data-target='#EDITREVENUE' data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->ReqNo ; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" class="link" data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
<?php
@ -3321,7 +3374,7 @@ function calculateEditTaxValue()
$totOrderSummaryAmt = $totOrderSummaryAmt +$record->TotalValue;
}
?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index;?>">
?>
<?php
}
@ -3436,11 +3489,11 @@ function calculateEditTaxValue()
<input type="hidden" name="txtPoRange" id="txtPoRange" />
<input type="hidden" name="isEdit" id="isEdit" value="0" />
<input type="hidden" name="txtStatus" id="txtStatus" />
<input type="hidden" name="txtRowCount" id="txtRowCount" />
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index;?>">
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>"/>
<?php if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED ) {
if($PONOStatus == PO_DRAFT){?>
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED){?>
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)" >&nbsp;&nbsp;<span class="bold">Save</span></a> <?php }?>
<a class="btn btn-primary Save" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<input type="reset" class="btn btn-primary" value="Reset">
@ -3549,6 +3602,14 @@ $("#EDITREVENUE").on("shown.bs.modal", function(e) {
$('#txtEditFreight').val($('#FreightVal'+userid).val());
$('#txtEditAfterFreight').val($('#AfterFreightVal'+userid).val());
var FreightType =$('#FreightType'+userid).val();
$('#EditNOOfTrips').val($('#NoOfTrip'+userid).val());
if (FreightType == "PER TRIP"){
$('#EditTripsValue').show();
}
else{
$('#EditTripsValue').hide();
}
$('#txtEditInsurance').val($('#Insval'+userid).val());
$('#txtEditTotalOrderValue').val($('#TotalOrderValue'+userid).val());
@ -3648,7 +3709,14 @@ $("#VIEWREVENUE").on("shown.bs.modal", function(e) {
$('#txtViewFreight').val($('#FreightVal'+userid).val());
$('#txtViewAfterFreight').val($('#AfterFreightVal'+userid).val());
$('#txtViewInsurance').val($('#Insval'+userid).val());
var FreightType =$('#FreightType'+userid).val();
$('#ViewNOOfTrips').val($('#NoOfTrip'+userid).val());
if (FreightType == "PER TRIP"){
$('#ViewTripsValue').show();
}
else{
$('#ViewTripsValue').hide();
}
$('#txtViewTotalOrderValue').val($('#TotalOrderValue'+userid).val());
$('#ViewAfterCGST').val($('#RevenueAfterCgst'+userid).val());
$('#ViewAfterSGST').val($('#RevenueAfterSgst'+userid).val());
@ -3711,7 +3779,7 @@ $('.AddRevenue').click(function(){
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();
@ -3758,6 +3826,7 @@ $('.AddRevenue').click(function(){
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,"TotalOrderValue"+temp,TotalOrderValue);
@ -3810,7 +3879,7 @@ clearRevenueModalFields();
var FreightType = $("#drpEditFreight").val();
var FreightVal = $("#txtEditFreight").val();
var AfterFreightVal = $("#txtEditAfterFreight").val();
var NoOfTrip = $("#EditNOOfTrips").val();
var basicval = $("#txtEditBasicValue").val();
var Insval = $("#txtEditInsurance").val();
var TotalOrderValue = $("#txtEditTotalOrderValue").val();
@ -3853,7 +3922,8 @@ clearRevenueModalFields();
$('#RevenueAfterIgst'+userid).val(AfterIgst);
$('#FreightType'+userid).val(FreightType);
$('#FreightVal'+userid).val(FreightVal);
$('#AfterFreightVal'+userid).val(AfterFreightVal);
$('#AfterFreightVal'+userid).val(AfterFreightVal);
$('#NoOfTrip'+userid).val(NoOfTrip);
$('#basicval'+userid).val(basicval);
$('#Insval'+userid).val(Insval);
$('#AvilBudget'+userid).val(AvilBudget);
@ -4012,7 +4082,7 @@ function clearRevenueModalFields()
$("#drpFreight").val('0');
$("#txtFreight").val('');
$("#txtAfterFreight").val('');
$("#NOOfTrips").val('');
$("#txtBasicValue").val('');
$("#txtInsurance").val('');
$("#txtTotalOrderValue").val('');
@ -4316,6 +4386,11 @@ $('#txtDeliveryAddress').val(deladd);
{
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
}
else
{
$('#content').loader('show');
@ -4333,7 +4408,7 @@ $('#txtDeliveryAddress').val(deladd);
$('#txtStatus').val('');
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('')
window.location = "purchaseorderListing";
window.location ="purchaseorderListing";
}
else
@ -4461,7 +4536,8 @@ $("#PaymentTerms").change(function() {
$('#otheroptiondiv').show();
}
else {
$('#otheroptiondiv').hide();
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
</script>

View File

@ -60,10 +60,10 @@ if(!empty($POMaster))
$PODate = $pdt->format('Y-m-d');
$DeliverOption = $Req->DeliveryOption;
$DeliverSchedule = $Req->DeliverySchedule;
echo "*" . $Req->DeliveryDate . "*";
// echo "*" . $Req->DeliveryDate . "*";
$Ddt = new DateTime($Req->DeliveryDate);
$Deliverydt = $Ddt->format('Y-m-d');
echo "-" . $Deliverydt . "-";
// echo "-" . $Deliverydt . "-";
$DeliveryAddress =$Req->DeliveryAddress;
$PONOStatus = $Req->StatusCode;
$PONO = $Req->PONO;
@ -123,11 +123,11 @@ foreach ($PaymentTerms as $TER)
tinymce.init({
selector: "textarea#txtSpcialInstruction",
selector: "textarea#ScopeofWork",
menubar: false,
statusbar: false,
toolbar: false
//plugins: "link image"
toolbar: false,
// plugins: "link image"
});
var DelOpt = '<?php echo $DeliverOption; ?>';
var SchName = '<?php echo $DeliverSchedule; ?>';
@ -148,17 +148,7 @@ $('#Scheduleby').val(SchName);
}
});
</script>
<script src="<?php echo base_url() ?>assets/tinymce/js/tinymce/tinymce.min.js"></script>
<script>
tinymce.init({
selector: "textarea#ScopeofWork",
selector: "textarea#txtSpcialInstruction",
menubar: false,
statusbar: false,
toolbar: false,
plugins: "link image"
});
</script>
@ -576,6 +566,9 @@ function clearEditTaxField()
}
$(document).ready(function () {
$("#PaymentTerms").select2();
$('#Date').click(function () {
//for Date range selection
$('#Schedulediv').hide();
@ -741,7 +734,10 @@ $(document).ready(function () {
</div>
<div class="col-md-12" id="Deliverydtdiv"><br/>
<label>Delivery Date</label>
<input type="text" name="beforeDeliverydt" value="<?php echo $Deliverydt?>">
<?php if($DeliverOption==1){
$Deliverydt=null;
}?>
<input type="hidden" name="beforeDeliverydt" value="<?php echo $Deliverydt?>">
<div class="form-group">
<?php
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt',$Deliverydt),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
@ -802,8 +798,17 @@ $(document).ready(function () {
</div>
</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: #ecf0f5 ;">*</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>
@ -848,7 +853,7 @@ $(document).ready(function () {
</div>
</div>
<div class="col-md-3">
<label>Cost Center Name</label>
<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');
@ -1209,7 +1214,38 @@ $(document).ready(function () {
</div>
<div class="row" style="border: 1px solid">
<!--<div class="col-md-12" style="padding:5px;">
<div class="col-md-4">
<span>Request On</span>
<?php
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<span>Request By</span>
<?php
$data = array('name' => 'RequestBy','value' => set_value('RequestBy',$RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<span>Status</span>
<?php
// $options = array("0"=>'Select Status');
// echo form_dropdown('Status', $options,set_value('Status'),'id="Status"' ,'required="true"' ,'class="form-control select2')
// $options = array("0"=>$PONOStatus);
// echo form_dropdown('Status', $options,set_value('Status',$StatusName),'id="Status"' ,'required="true"' ,'class="form-control select2')
$data = array('name' => 'Status','value' => set_value('Status',$StatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div> -->
</div>
</div>
<div class="row" style="border: 1px solid">
<div class="col-md-12">
<div class="col-md-2">
@ -1252,7 +1288,8 @@ $(document).ready(function () {
</div>
<div class="col-md-2">
<label >Total Order Value In INR </label>
<label >Total Order Value In INR </label>
<input type="text" name="preTotalordervalue" value="<?php echo $TotalSummary;?>">
<?php
$data = array('name' => 'txtTotalOrderValueSummary','value' => set_value('txtTotalOrderValueSummary',number_format($TotalSummary, 2, '.', '')),'id'=>'txtTotalOrderValueSummary', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
@ -1268,7 +1305,7 @@ $(document).ready(function () {
<label>Scope Of Work</label> <?php
$data = array('name' => 'ScopeofWork','value' => set_value('ScopeofWork',$ServiceDescription),'id'=>'ScopeofWork', 'class' => 'form-control', 'rows' => '10', 'cols' => '40' );
echo form_textarea($data);
?> <input type="hidden" name="beforeScopeofWork" id="beforeScopeofWork" value="<?php echo $ServiceDescription;?>">
?>
</div>
</div>
@ -1284,42 +1321,46 @@ $(document).ready(function () {
<input type="reset" class="btn btn-primary" value="Reset">
</div><br/>
</div>
</div>
</div>
<br/>
</div><br/>
<div class="col-md-12" style="padding:5px;">
<div class="col-md-12" style="padding:2%;">
<div class="col-md-8">
<div class="row">
<div class="col-md-2"><label>Request On</label></div>
<div class="col-md-4">
<span>Request On</span>
<?php
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
echo form_input($data);
?>
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<span>Request By</span>
</div><br/>
<div class="row">
<div class="col-md-2"><label>Request By</label></div>
<div class="col-md-4">
<?php
$data = array('name' => 'RequestBy','value' => set_value('RequestBy',$RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true');
$data = array('name' => 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<span>Status</span>
</div><br/>
<div class="row"><div class="col-md-2"><label>Status</label></div>
<div class="col-md-4">
<?php
// $options = array("0"=>'Select Status');
// echo form_dropdown('Status', $options,set_value('Status'),'id="Status"' ,'required="true"' ,'class="form-control select2')
// $options = array("0"=>$PONOStatus);
// echo form_dropdown('Status', $options,set_value('Status',$StatusName),'id="Status"' ,'required="true"' ,'class="form-control select2')
$data = array('name' => 'Status','value' => set_value('Status',$StatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><br/>
</div>
</div>
</div>
</div>
<br/>
</div>
</div>
</div>
@ -1865,11 +1906,12 @@ function validateServiceTax()
}
//
</script>
// <script>
<script>
// $('#PaymentTerms').change(function() {
// var data=$('#PaymentTerms option:selected').text();
// $('#beforePaymentTermsText').val(data);
// alert( data );
// });
// </script>
<script>
@ -1982,5 +2024,14 @@ function calculateIgstTax(varBasicValue,Igst)
return TAXval;// $('#AfterServiceTax').val(TAXval);
}
//If others is the payment terms to display mandatory field
$("#PaymentTerms").change(function() {
if ($('#PaymentTerms').val().trim()=='PT08')
{
$('#otheroptiondiv').show();
}
else {
$('#otheroptiondiv').hide();
}
});
</script>

View File

@ -395,6 +395,7 @@ $("#txtEditBasicValue").val('');
$('#PackagingType').val("0");
$('#Rate').focus();
}
calculateDiscount(0);
});
@ -427,6 +428,7 @@ $('#EditDiscountType').change(function() {
$('#EditDiscountType').val("0");
$('#EditRate').focus();
}
calculateDiscount(1);
});
$('#PackagingType').change(function() {
@ -462,6 +464,7 @@ $('#PackagingType').change(function() {
$('#PackagingType').val("0");
$('#Rate').focus();
}
calculatePackaging(0);
});
@ -488,6 +491,7 @@ $('#EditPackagingType').change(function() {
$('#txtEditPackaging').removeAttr( 'readonly','true' );
}
}
calculatePackaging(1);
});
@ -576,6 +580,7 @@ $('#drpFreight').change(function() {
$('#drpFreight').val("0");
$('#Rate').focus();
}
calculateFreight(0);
});
$('#drpEditFreight').change(function() {
@ -616,6 +621,7 @@ $('#drpEditFreight').change(function() {
$('#drpEditFreight').val("0");
$('#EditRate').focus();
}
calculateFreight(1);
});
});
@ -1535,7 +1541,7 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
$('#txtFreight').val('');
$("#drpFreight").focus();
}
else if( $('#txtFreight').val() != "0" && $('#txtFreight').val() != '')
else if( $('#txtFreight').val() != "0" && $('#txtFreight').val() != '')
{
var FreightValue = parseFloat($('#txtFreight').val());
var UOM = parseFloat($('#UOM').val());
@ -1559,8 +1565,23 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
AfterFreight = <?php echo FREIGHT_PERUOM;?>;
}
else if(FreightType == '<?php echo PERTRIP;?>')
{
AfterFreight = <?php echo FREIGHT_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();
@ -1603,7 +1624,7 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
$('#txtEditFreight').val('');
$("#drpEditFreight").focus();
}
else if( $('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '')
else if( $('#txtEditFreight').val() != "0" && $('#txtEditFreight').val() != '')
{
var FreightValue = parseFloat($('#txtEditFreight').val());
var UOM = parseFloat($('#EditUOM').val());
@ -1628,7 +1649,20 @@ var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val());
}
else if(FreightType == '<?php echo PERTRIP;?>')
{
AfterFreight = <?php echo FREIGHT_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();
@ -2503,7 +2537,7 @@ function calculateEditTaxValue()
<label>NO Of Trips</label>
<div class="form-group">
<?php
$data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num' );
$data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num' ,'onchange'=>'calculateFreight(0);');
echo form_input($data);
?>
</div>
@ -2856,7 +2890,7 @@ function calculateEditTaxValue()
<label>NO Of Trips</label>
<div class="form-group">
<?php
$data = array('name' => 'EditNOOfTrips','value' => set_value('EditNOOfTrips'),'id'=>'EditNOOfTrips', 'class' => 'form-control num' );
$data = array('name' => 'EditNOOfTrips','value' => set_value('EditNOOfTrips'),'id'=>'EditNOOfTrips', 'class' => 'form-control num' ,'onchange'=>'calculateFreight(1);');
echo form_input($data);
?>
</div>
@ -3131,8 +3165,17 @@ $("#EDITREVENUE").on("shown.bs.modal", function(e) {
$('#txtEditFreight').val($('#FreightVal'+userid).val());
$('#txtEditAfterFreight').val($('#AfterFreightVal'+userid).val());
$('#EditNOOfTrips').val($('#NoOfTrip'+userid).val());
$('#txtEditInsurance').val($('#Insval'+userid).val());
var FreightType =$('#FreightType'+userid).val();
if (FreightType == "PER TRIP"){
$('#EditTripsValue').show();
}
else{
$('#EditTripsValue').hide();
}
$('#txtEditTotalOrderValue').val($('#TotalOrderValue'+userid).val());
$('#EditAfterCgst').val($('#RevenueAfterCgst'+userid).val());
$('#EditAfterSgst').val($('#RevenueAfterSgst'+userid).val());
@ -3225,10 +3268,10 @@ $('.AddRevenue').click(function(){
var FreightType = $("#drpFreight").val();
var FreightType = $("#drpFreight").val();
var FreightVal = $("#txtFreight").val();
var AfterFreightVal = $("#txtAfterFreight").val();
var NoOfTrip = $("#NOOfTrips").val();
var basicval = $("#txtBasicValue").val();
var Insval = parseFloat($('#txtInsurance').val() == '' ? '0.00' : $('#txtInsurance').val()).toFixed(2);
@ -3295,6 +3338,8 @@ $('.AddRevenue').click(function(){
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,"TotalOrderValue"+temp,TotalOrderValue);
@ -3337,7 +3382,7 @@ $('.AddRevenue').click(function(){
var FreightType = $("#drpEditFreight").val();
var FreightVal = $("#txtEditFreight").val();
var AfterFreightVal = $("#txtEditAfterFreight").val();
var NoOfTrip = $("#EditNOOfTrips").val();
var basicval = $("#txtEditBasicValue").val();
var Insval = $("#txtEditInsurance").val();
var TotalOrderValue = $("#txtEditTotalOrderValue").val();
@ -3376,7 +3421,9 @@ $('.AddRevenue').click(function(){
$('#RevenueIgst'+userid).val(Igst);
$('#RevenueAfterIgst'+userid).val(AfterIgst);
$('#FreightType'+userid).val(FreightType);
$('#FreightVal'+userid).val(FreightVal);
$('#FreightVal'+userid).val(FreightVal);
$('#NoOfTrip'+userid).val(NoOfTrip);
$('#AfterFreightVal'+userid).val(AfterFreightVal);
$('#basicval'+userid).val(basicval);
$('#Insval'+userid).val(Insval);
@ -3540,7 +3587,7 @@ function clearRevenueModalFields()
$("#drpFreight").val('0');
$("#txtFreight").val('');
$("#txtAfterFreight").val('');
$("#NOOfTrips").val('');
$("#txtBasicValue").val('');
$("#txtInsurance").val('');
$("#txtTotalOrderValue").val('');
@ -3692,6 +3739,11 @@ $('#SpcialInstruction').val(splinstr);
$('#Deliverydt').focus();
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
}
else
{
@ -3885,7 +3937,8 @@ $("#PaymentTerms").change(function() {
$('#otheroptiondiv').show();
}
else {
$('#otheroptiondiv').hide();
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});

View File

@ -487,6 +487,9 @@ function clearEditTaxField()
}
$(document).ready(function () {
$("#PaymentTerms").select2();
$('#Date').click(function () {
//for Date range selection
$('#Schedulediv').hide();
@ -497,7 +500,9 @@ function clearEditTaxField()
$('#Deliverydtdiv').hide();
$('#Schedulediv').show();
});
clearTotalItemValues();
});
</script>
<style>
.modal
@ -704,7 +709,15 @@ function clearEditTaxField()
</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: #ecf0f5 ;">*</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>
@ -718,7 +731,6 @@ function clearEditTaxField()
<a data-toggle="modal" ><button type="submit" onclick="openModal();" class="btn btn-primary" id="abcd" >Select Line Item</button> </a>
<!-- Model for Add servicepo -->
<div class="modal fade" id="SERVICE" role="dialog">
<div class="modal-dialog">
@ -759,7 +771,7 @@ function clearEditTaxField()
</div>
</div>
<div class="col-md-3">
<label>Cost Center Name</label>
<label>Cost Center Code</label>
<div class="form-group">
<?php
$data = array('name' => 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true');
@ -958,7 +970,7 @@ function clearEditTaxField()
</div>
<div class="col-md-12">
<div class="col-md-5 col-md-offset-4" align="right">
<label><?php echo "Total Order value ($INRSYM)";?></label>
<label><?php echo "Total Order Value ($INRSYM)";?></label>
</div>
<div class="col-md-3">
<div class="form-group">
@ -994,7 +1006,7 @@ function clearEditTaxField()
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<!-- <button type="button" class="close" data-dismiss="modal">&times;</button> -->
<center><h4>Edit Service Purchase Order Item </h4></center>
</div>
<div align="left">
@ -1022,7 +1034,7 @@ function clearEditTaxField()
</div>
</div>
<div class="col-md-3">
<label>Cost Center Name</label>
<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');
@ -1100,7 +1112,7 @@ function clearEditTaxField()
</div>
</div>
<div class="col-md-2">
<label><?php echo "Rate($INRSYM)";?></label>
<label><?php echo "Rate ($INRSYM)";?></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()' );
@ -1220,7 +1232,7 @@ function clearEditTaxField()
</div>
<div class="col-md-12">
<div class="col-md-5 col-md-offset-4" align="right">
<label><?php echo "Total Order value ($INRSYM)";?></label>
<label><?php echo "Total Order Value ($INRSYM)";?></label>
</div>
<div class="col-md-3">
<div class="form-group">
@ -1249,9 +1261,7 @@ function clearEditTaxField()
</div>
<!-- End of Model for EDIT servicepo -->
</div>
<br/>
<div class="box-body">
<table id="serviceTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
@ -1262,10 +1272,10 @@ function clearEditTaxField()
<th>Item Description</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate</th>
<th>Basic Amount</th>
<th>Tax Amount</th>
<th>Total Order Amount</th>
<th>Rate In INR</th>
<th>Basic Amount In INR</th>
<th>Tax Amount In INR</th>
<th>Total Order Amount In INR</th>
<th>Action</th>
</tr>
</thead>
@ -1356,7 +1366,7 @@ function clearEditTaxField()
</div>
</div>
<br/>
</div><br/>
</div>
</div>
</div>
@ -1978,6 +1988,11 @@ $('#txtStatus').val(stat);
$('#Deliverydt').focus();
return false;
}
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
alert('Please Enter Other Payment Details');
$('#Otherpayment').focus();
return false;
}
else
{
$('#content').loader('show');
@ -2011,17 +2026,17 @@ $('#txtStatus').val(stat);
}
}
<!-- script for table , It works under the datatable plugin-->
/* $(function () {
$(function () {
$('#serviceTax').DataTable({
"paging": true,
"lengthChange": true,
"paging": false,
"lengthChange": false,
"searching": false,
//"ordering": true,
// "info": true,
"autoWidth": true
"autoWidth": false
});
}); */
});
var Detail = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
@ -2133,6 +2148,26 @@ function calculateIgstTax(varBasicValue,Igst)
}
function clearTotalItemValues()
{
$('#txtTotBasicAmount').val('');
$('#txtTotCgst').val('');
$('#txtTotSgst').val('');
$('#txtTotIgst').val('');
$('#TotalOtherAllowances').val('');
$('#txtTotalOrderValueSummary').val('');
}
//If others is the payment terms to display mandatory field
$("#PaymentTerms").change(function() {
if ($('#PaymentTerms').val().trim()=='PT08')
{
$('#otheroptiondiv').show();
}
else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
</script>
</script>