REVENUE PO,PDF,PAYROLL ISSUES

This commit is contained in:
velz2020 2017-09-14 20:36:19 +05:30
parent 9c7e56fcaf
commit 25248c4300
10 changed files with 528 additions and 212 deletions

View File

@ -44,16 +44,7 @@ class emppaydate extends BaseController
$this->load->model('emppaydate_model');
$searchText = $this->input->post('searchText');
$data['searchText'] = $searchText;
$this->load->library('pagination');
$count = $this->emppaydate_model->emppayListingCount($searchText);
$returns = $this->paginationCompress ( "emppayListing", $count ,5);
$data['userRecords'] = $this->emppaydate_model->emppayListing($searchText, $returns["page"], $returns["segment"]);
$data['userRecords'] = $this->emppaydate_model->emppayListing();
$this->global['pageTitle'] = 'Siddharth : Employee Pay List';

View File

@ -44,16 +44,7 @@ class monthlypay extends BaseController
$this->load->model('monthlypay_model');
$searchText = $this->input->post('searchText');
$data['searchText'] = $searchText;
$this->load->library('pagination');
$count = $this->monthlypay_model->monthlyListingCount($searchText);
$returns = $this->paginationCompress ( "monthlyListing", $count ,5);
$data['userRecords'] = $this->monthlypay_model->monthlyListing($searchText, $returns["page"], $returns["segment"]);
$data['userRecords'] = $this->monthlypay_model->monthlyListing();
$this->global['pageTitle'] = 'Siddharth : Monthly Pay List';

View File

@ -375,15 +375,13 @@ function getEmployee()
*/
function uploadExcel2(){
// $FNAME = $this->input->post('FileName');
// echo "HI" . $FNAME . "-";
// echo realpath($FNAME);die();
$PayrollFileName = '';
//Check whether user upload picture
if(!empty($_FILES['userfile']['name']))
{
//echo 'inside if';
$pathinfo = pathinfo($_FILES['userfile']['name']);
$config['upload_path'] = 'uploads/files/';
$config['allowed_types'] = 'xls|xlsx|csv';
@ -485,10 +483,7 @@ function getEmployee()
if ($FileDataExists=='' || $FileDataExists==0)
{
//$FileDetails = array('PayOn'=>$PayOn,'TotalNoofDays'=>$Totaldays,'FileName'=>$PayrollFileName,'CreatedBy'=>$createdby);
// $result = $this->payroll_model->UploadFileName($FileDetails);
// $result = $this->payroll_model->UploadFileName($FileDetails);
@ -523,17 +518,18 @@ function getEmployee()
}
$data['Success'] = "<script>alert('File Uploaded Successfully!');</script>";
// $data['Success'] = "<script>alert('File Uploaded Successfully!');</script>";
// echo "<script>alert('File Uploaded Successfully!');</script>";
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
// $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
$this->loadViews("payslipupload2", $this->global, $data , NULL);
// $this->loadViews("payslipupload2", $this->global, $data , NULL);
}
// $data['Fail'] = "<script>alert('Duplicate Data Found!');</script>";
//$data['Fail'] = "<script>alert('Duplicate Data Found!');</script>";
// $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
@ -553,6 +549,7 @@ function getEmployee()
//$data['success'] = "<script>alert($fail + 'Duplicate Data Found!');</script>";
//echo "DONE";
echo "<script>alert('File Uploaded Successfully!');</script>";
echo "<script> alert($success +' Data Uploaded sucessfully and ' + $fail + ' Duplicate Data Found'); </script>";
echo "<script>alert($Unknowncount+'-data invalid, and data are'+'$Unknown'+'found at rows'+'$row');</script>";
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
@ -567,20 +564,20 @@ function getEmployee()
//$data['Fail'] = "<script>alert('Please select valid Excel file to Upload!');</script>";
//echo "<script>alert('Please select valid Excel file to Upload!');</script>";
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2';
// $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2';
$this->loadViews("payslipupload2", $this->global, $data , NULL);
// $this->loadViews("payslipupload2", $this->global, $data , NULL);
}
}
else
{
//$data['Fail'] = "<script>alert('Please select Excel file to Upload!');</script>";
//echo "<script>alert('Please select Excel file to Upload!');</script>";
$PayrollFileName = '';
// $PayrollFileName = '';
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2';
// $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2';
$this->loadViews("payslipupload2", $this->global, NULL , NULL);
// $this->loadViews("payslipupload2", $this->global, NULL , NULL);
}

View File

@ -978,7 +978,8 @@ class purchaseorder extends BaseController
//This used to Edit the Revenue Purchase Order
function EditRevenuePurchaseOrder()
{
//echo "EDIT REBEIE";
//die();
$PONO =$this->input->post('txtPONO');
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
@ -998,7 +999,18 @@ class purchaseorder extends BaseController
$Modeofshipment=$this->input->post('editmodeofshipment');
$supplierreference=$this->input->post('editsupplierreference');
$supplieroffno=$this->input->post('editsupplierofferno');
$otherreference=$this->input->post('editotherreference');
$fincap=$this->input->post('editfincap');
$revenuetype=$this->input->post('PoTypeOptions');
$insurancestatus=$this->input->post('insurancestatus');
if($insurancestatus == 1){
$insuranceno=$this->input->post('insuranceno');
}else{
$insuranceno="";
}
$POType = $this->input->post('POType');
$PoRange = $this->input->post('txtPoRange');
@ -1010,7 +1022,8 @@ class purchaseorder extends BaseController
$updatedBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('txtRowCount');
$DeletedRow = $this->input->post('txtDeletedRow');
//echo $RowCount . "-" . $DeletedRow;
//die();
$comma_separated = explode(':', $DeletedRow);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$updateddt = $dt->format('Y-m-d H:i:s');
@ -1020,21 +1033,22 @@ class purchaseorder extends BaseController
$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,'PaymentOtherDescription'=>$OtherPayment);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno);
//print_r($POList);
//die();
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
$LineItemStatus = REQITEM_NEW;
//echo "OUT";
for ($i = 1; $i <= $RowCount; $i++)
{
//echo "IN";
$MaterialCode = $this->input->post('materialCode'.$i);
$Quantity = $this->input->post('quantity'.$i);
$Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i);
$per=$this->input->post('per'.$i);
$DiscountType = $this->input->post('DisType'.$i);
$DiscountValue = $this->input->post('DisVal'.$i);
$AfterDiscount = $this->input->post('AfterDisVal'.$i);
@ -1042,7 +1056,7 @@ class purchaseorder extends BaseController
$PackagingType = $this->input->post('PackType'.$i);
$PackagingValue = $this->input->post('PackVal'.$i);
$AfterPackagingValue = $this->input->post('AfterPackVal'.$i);
$Cgst = $this->input->post('RevenueCgst'.$i);
$Cgst = $this->input->post('RevenueCgst'.$i);
$Sgst = $this->input->post('RevenueSgst'.$i);
$Igst = $this->input->post('RevenueIgst'.$i);
$AfterCgst = $this->input->post('RevenueAfterCgst'.$i);
@ -1052,7 +1066,7 @@ class purchaseorder extends BaseController
$FreightValue = $this->input->post('FreightVal'.$i);
$AfterFreightValue = $this->input->post('AfterFreightVal'.$i);
$NOOfTrip = $this->input->post('NoOfTrip'.$i);
$InsuranceValue = $this->input->post('Insval'.$i);
$revenuedescription = $this->input->post('service_description'.$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);
@ -1080,7 +1094,8 @@ class purchaseorder extends BaseController
if(strlen($POLineItemNo) == 0)
{
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter);
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Per'=>$per,'ServiceMaterialDescription'=>$revenuedescription,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter);
//print_r($POLineItemList);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
if(count($POLineItem)>0)
{
@ -1094,6 +1109,7 @@ class purchaseorder extends BaseController
$LineItemNo = $POLineItemNo;
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter);
//print_r($POLineItemList);
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList);
}
@ -1101,7 +1117,7 @@ class purchaseorder extends BaseController
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,'NoOfTrip'=>$NOOfTrip);
//print_r($RevenueTaxList);
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
}
@ -1109,7 +1125,7 @@ class purchaseorder extends BaseController
{
$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);
//print_r($RevenueTaxList);
$this->purchaseorder_model->updateRevenueTax($LineItemNo,$RevenueTaxList);
}
@ -1137,7 +1153,7 @@ class purchaseorder extends BaseController
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO);
$data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO);
$data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
$data['reveuetax']=$this->purchaseorder_model->getRevenueTaxinforforpdf($PONO);
$Currencycode='';
$TotalOrderValue=$data['POItem'][0]->TotalOrderValue;

View File

@ -2,43 +2,10 @@
class emppaydate_model extends CI_Model
{
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
* @return number $count : This is row count
*/
function emppayListingCount($searchText = ''){
$this->db->select('*');
$this->db->from('T_Emp_Pay_Data');
if(!empty($searchText)) {
$likeCriteria = "(Pay_Data_ID LIKE '%".$searchText."%'
OR EmpID LIKE '%".$searchText."%'
OR Basic_Pay LIKE '%".$searchText."%'
OR HRA_Rate LIKE '%".$searchText."%'
OR OT_Rate LIKE '%".$searchText."%'
OR Allowances LIKE '%".$searchText."%'
OR PF_Rate LIKE '%".$searchText."%'
OR ESI_Rate LIKE '%".$searchText."%'
OR is_Active LIKE '%".$searchText."%'
OR Loan_Amount LIKE '%".$searchText."%'
OR Loan_Issued_Date LIKE '%".$searchText."%'
OR Monthly_Due LIKE '%".$searchText."%'
OR Monthly_Due LIKE '%".$searchText."%'
OR Due_Start_Date LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
}
//$this->db->where('BaseT.userId !=', 1);
$query = $this->db->get();
return count($query->result());
}
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
@ -48,37 +15,12 @@ class emppaydate_model extends CI_Model
*/
function emppayListing($searchText = '', $page, $segment)
function emppayListing()
{
$this->db->select('T_Emp_Pay_Data.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
$this->db->from('T_Emp_Pay_Data');
$this->db->join('T_Employee_Details','T_Emp_Pay_Data.EmpID=T_Employee_Details.EmpID');
if(!empty($searchText)) {
$likeCriteria = "(Pay_Data_ID LIKE '%".$searchText."%'
OR EmpID LIKE '%".$searchText."%'
OR Basic_Pay LIKE '%".$searchText."%'
OR HRA_Rate LIKE '%".$searchText."%'
OR OT_Rate LIKE '%".$searchText."%'
OR Allowances LIKE '%".$searchText."%'
OR PF_Rate LIKE '%".$searchText."%'
OR ESI_Rate LIKE '%".$searchText."%'
OR is_Active LIKE '%".$searchText."%'
OR Food_Allowances LIKE '%".$searchText."%'
OR Loan_Amount LIKE '%".$searchText."%'
OR Loan_Issued_Date LIKE '%".$searchText."%'
OR Monthly_Due LIKE '%".$searchText."%'
OR Monthly_Due LIKE '%".$searchText."%'
OR Due_Start_Date LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
}
$this->db->limit($page, $segment);
$query = $this->db->get();
$result = $query->result();
return $result;
}

View File

@ -2,36 +2,7 @@
class monthlypay_model extends CI_Model
{
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
* @return number $count : This is row count
*/
function monthlyListingCount($searchText = ''){
$this->db->select('*');
$this->db->from('T_Monthly_Pay_Inputs');
if(!empty($searchText)) {
$likeCriteria = "(Month_Year LIKE '%".$searchText."%'
OR EmpID LIKE '%".$searchText."%'
OR LOP_Days LIKE '%".$searchText."%'
OR OT_Hrs_Worked LIKE '%".$searchText."%'
OR Loan_Recovered LIKE '%".$searchText."%'
OR Incentives LIKE '%".$searchText."%'
OR Other_Deductions LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
}
//$this->db->where('BaseT.userId !=', 1);
$query = $this->db->get();
return count($query->result());
}
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
@ -39,30 +10,13 @@ class monthlypay_model extends CI_Model
* @param number $segment : This is pagination limit
* @return array $result : This is result
*/
function monthlyListing($searchText = '', $page, $segment)
function monthlyListing()
{
$this->db->select('T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
$this->db->from('T_Monthly_Pay_Inputs');
$this->db->join('T_Employee_Details','T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID');
//$this->db->where('month.EmpID=mast.EmpID');
$this->db->order_by("Month_Year", "desc");
if(!empty($searchText)) {
$likeCriteria = "(Month_Year LIKE '%".$searchText."%'
OR EmpID LIKE '%".$searchText."%'
OR LOP_Days LIKE '%".$searchText."%'
OR OT_Hrs_Worked LIKE '%".$searchText."%'
OR Loan_Recovered LIKE '%".$searchText."%'
OR Incentives LIKE '%".$searchText."%'
OR Other_Deductions LIKE '%".$searchText."%'
)";
$this->db->where('T_Monthly_Pay_Inputs.EmpID',$likeCriteria);
}
$this->db->limit($page, $segment);
$query = $this->db->get();
$result = $query->result();

View File

@ -683,8 +683,8 @@ function GetPOType($ReqNo)
function GetRevenuePurchaseOrderDetails($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,(Quantity *Rate) as BasicValue , ((AfterPackagingValue + AfterFreightValue + AfterSGST + AfterCGST +
AfterIGST + Insurance)) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Per,ServiceMaterialDescription,ReceivedQuantity,Rate,Req.Status,(Quantity *Rate) as BasicValue , (( AfterSGST + AfterCGST +
AfterIGST )) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
@ -704,10 +704,10 @@ function GetPOType($ReqNo)
function GetRevenuePurchaseOrderDetailsForPDF($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,POMaster.PaymentOtherDescription,
Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
ROUND(((AfterPackagingValue + AfterFreightValue + AfterSGST + AfterCGST +
AfterIGST + Insurance)) ,2)as Taxamount,AdvanceAmount,
$subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.Per,ReqNo,Mat.MaterialCode,Mat.MaterialName,POMaster.PaymentOtherDescription,
Mat.UOM,Mat.HSNCODE,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
ROUND(((AfterSGST + AfterCGST +
AfterIGST)) ,2)as Taxamount,AdvanceAmount,
TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,Payment.PaymentTerms
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
@ -723,6 +723,24 @@ function GetPOType($ReqNo)
return $query->result();
}
function getRevenueTaxinforforpdf($PONO)
{
$subQuery ='SELECT group_concat(pl.MaterialCode ORDER BY pl.MaterialCode ASC) as Itemcode,rt.CGST,rt.SGST,rt.IGST,rt.FreightValue,rt.PackagingValue,rt.DiscountValue FROM kasiram9_SIADEV.T_Revenue_Tax rt
join T_PurchaseOrder_LineItem pl on pl.LineItemNo=rt.LineItemNo
join T_PurchaseOrder_Master pm on pm.PONO=pl.PONO
where pm.POType=? and pm.PONO=?
group by rt.CGST,rt.SGST,rt.IGST,rt.FreightValue,rt.PackagingValue ORDER BY rt.LineItemNo ASC';
$query = $this->db->query($subQuery,array("REVENUE",$PONO));
return $query->result();
}
// This Method to get the Revenue PO Child Details for Edit the Item

View File

@ -7,6 +7,14 @@ $AvlAmount = 0;
$DeliverSchedule='';
$DeliverOption='';
$StatusName='';
$modeofshipment='';
$supplierref='';
$suppofferno='';
$otherref='';
$fincap='';
$revenuesubtype='';
$insurencestatus='';
$insurenceno='';
if(!empty($MaxPODate))
{
@ -67,6 +75,8 @@ foreach ($PaymentTerms as $TER)
$otherPayment='';
if(!empty($POMaster))
{
//print_r($POMaster);
//print_r($POItem);
foreach ($POMaster as $Req)
{
$SupId = $Req->SupplierID;
@ -88,6 +98,16 @@ if(!empty($POMaster))
$CapitalRange = $Req->CapitalRange;
$StatusName=$Req->StatusName;
$otherPayment = $Req->PaymentOtherDescription;
$modeofshipment = $Req->Mode_Of_Shipment;
$supplierref = $Req->Supplier_Reference;
$suppofferno = $Req->Supplier_Offer_No;
$otherref = $Req->Other_Reference;
$fincap = $Req->Fincap;
$revenuesubtype = $Req->POSubType;
$insurencestatus = $Req->InsuranceStatus;
$insurenceno = $Req->InsuranceNumber;
// echo $insurenceno;
// echo $otherPayment;
}
}
@ -151,6 +171,27 @@ if(!empty($RequistionDetails))
statusbar: false,
toolbar: false
});
tinymce.init({
selector: "textarea#Add_Service_Description",
menubar: false,
statusbar: false,
toolbar: false
});
tinymce.init({
selector: "textarea#Edit_Service_Description",
menubar: false,
statusbar: false,
toolbar: false
});
tinymce.init({
selector: "textarea#View_Service_Description",
menubar: false,
statusbar: false,
toolbar: false,
readonly : 1
});
</script>
<script type="text/javascript">
@ -158,6 +199,8 @@ if(!empty($RequistionDetails))
var DelOpt = '<?php echo $DeliverOption; ?>';
var SchName = <?php echo json_encode($DeliverSchedule); ?>;
var DelDt = '<?php echo $Deliverydt; ?>';
var insurancestatus = '<?php echo $insurencestatus;?>';
var insuranceno = '<?php echo $insurenceno;?>';
$(document).ready(function () {
if(DelOpt=="0"){
@ -165,6 +208,8 @@ $(document).ready(function () {
$('#Deliverydtdiv').show();
$('#Schedulediv').hide();
$('#Deliverydt').val(DelDt);
}
else if(DelOpt=="1"){
@ -179,12 +224,32 @@ var PaymentOther = '<?php echo $otherPayment; ?>';
var PayTerms = '<?php echo $Terms; ?>';
if(PayTerms=='PT08'){
$('#otheroptiondiv').show();
$('#Otherpayment').val(PaymentOther);
$('#Otherpayment').val(PaymentOther);
}
else{
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
$('#Otherpayment').val('');
}
// var insurancestatus = <?php echo $insurencestatus;?>;
// var insuranceno = <?php echo $insurenceno;?>;
if(insurancestatus == 1)
{
$('#insurancestatus').val(insurancestatus);
$("#insurancenodiv").show();
$('#insuranceno').val(insuranceno);
}
else
{
$('#insurancestatus').val(insurancestatus);
$('#insuranceno').val("");
$("#insurancenodiv").hide();
}
});
</script>
<script>
@ -244,6 +309,10 @@ $('#drpSupplier').change(function() {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
else if(PaymentID=='PT08')
{
$('#otheroptiondiv').show();
}
$.each(Payment, function(pay, payobj) {
if(payobj.PaymentID == PaymentID)
{
@ -570,6 +639,39 @@ $('#drpEditFreight').change(function() {
}
calculateFreight(1);
});
$('#drpViewFreight').change(function() {
var FreightType =$("#drpViewFreight").val();
if (FreightType == "PER TRIP")
{
$('#ViewTripsValue').show();
}
else {
$('#ViewTripsValue').hide();
}
selValue = $("#drpEditFreight").val() ;
$('#txtViewFreight').val('');
$('#txtViewAfterFreight').val('');
if (selValue == NilType)
{
$('#txtViewFreight').attr('readonly', 'true');
$('#txtViewFreight').val('0.00');
}
else
{
$('#txtViewFreight').removeAttr( 'readonly','true' );
$('#txtViewFreight').val('');
}
calculateFreight(2);
});
});
@ -1509,7 +1611,7 @@ function calculatePackaging(isEdit)
}
calculateTotalValue();
}
else
else if(isEdit == '1')
{
if($('#EditMaterialCode').val() == "0")
{
@ -1588,7 +1690,89 @@ function calculatePackaging(isEdit)
}
calculateEditTotalValue();
}else if(isEdit == '2')// for view model freight calculation
{
//alert("Working");
if($('#ViewMaterialCode').val() == "0")
{
alert('Please Select the Material Code');
$('#ViewMaterialCode').focus();
return false;
}
else if($('#ViewRate').val() == '')
{
alert('Please Enter the Rate value');
$('#ViewRate').focus();
return false;
}
else
{
var basicValue = parseFloat($('#txtViewBasicValue').val());
var FreightType =$("#drpViewFreight").val();
if(FreightType == "0")
{
alert('Please select Freight Type');
$('#txtViewFreight').val('');
$("#drpViewFreight").focus();
}
else if( $('#txtViewFreight').val() != "0" && $('#txtViewFreight').val() != '')
{
var FreightValue = parseFloat($('#txtViewFreight').val());
var UOM = parseFloat($('#ViewUOM').val());
var Quantity = parseFloat($('#ViewQuantity').val());
//alert(FreightType);
var AfterFreight = 0.0;
if(FreightType == PercentageType)
{
AfterFreight = <?php echo FREIGHT_PERCENTAGE;?>;
}
else if(FreightType == NilType)
{
AfterFreight = 0.0;
$('#txtViewFreight').val("0.00");
}
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($('#ViewNOOfTrips').val()==''){
alert('Please Enter No of Trip');
$("#ViewNOOfTrips").focus();
$('#txtViewFreight').val(0)
AfterFreight=0;
$('#txtViewAfterFreight').val("0.00");
return false;
}
else{
var noOftrip = $("#ViewNOOfTrips").val();
AfterFreight = <?php echo FREIGHT_PERTRIP;?>;
AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2);
}
}
else {
AfterFreight = $("#txtViewFreight").val();
}
var AfterFreightval = parseFloat(AfterFreight).toFixed(2);
$('#txtViewAfterFreight').val(AfterFreightval);
}
else
{
$('#txtViewAfterFreight').val("0.00");
}
}
calculateViewTotalValue();
}
}
/* Set the Packaging calculation option for calculating Packaging */
@ -1781,7 +1965,7 @@ function validateEditExceedLimit()
var basicAmountRate = parseFloat($('#txtEditBasicValue').val());
var totalAmount = parseFloat($('#txtEditTotalOrderValue').val());
if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt)
{
alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
$('#EditRate').focus();
@ -1814,6 +1998,28 @@ function validateEditExceedLimit()
//validateEditExceedLimit();
//ExceedEditQuantityCheck();
}
function calculateViewTotalValue()
{
var Packaging = $('#txtViewPackaging').val() == '' ? '0.00' : $('#txtViewPackaging').val();
var AfterCgst = $("#ViewAfterCGST").val();
var AfterSgst = $("#ViewAfterSGST").val();
var AfterIgst = $("#ViewAfterIGST").val();
var Freight = $('#txtViewAfterFreight').val() == '' ? '0.00' : $('#txtViewAfterFreight').val();
var Insurance = $('#txtViewInsurance').val() == '' ? '0.00' : $('#txtViewInsurance').val();
var Discount = $('#txtViewAfterDiscount').val() == '' ? '0.00' : $('#txtViewAfterDiscount').val();
var BasicVal = $('#txtViewBasicValue').val() == '' ? '0.00' : $('#txtViewBasicValue').val();
var totvalue = ( parseFloat(BasicVal) + parseFloat(Packaging)+ parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount);
var tot = parseFloat(totvalue).toFixed(2);
$('#txtViewTotalOrderValue').val(tot);
//validateEditExceedLimit();
//ExceedEditQuantityCheck();
}
function calculateEditTaxValue()
{
var Packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val();
@ -1827,7 +2033,7 @@ function calculateEditTaxValue()
var Discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val();
var totvalue = parseFloat(Packaging)+ parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(Freight) + parseFloat(Insurance) ;
var totvalue = parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst);
var tot = parseFloat(totvalue).toFixed(2);
//alert('tot:'+tot);
@ -2004,7 +2210,7 @@ function calculateEditTaxValue()
<div class="form-group">
<?php
$data = array('name' => 'editmodeofshipment','value' => set_value('editmodeofshipment'),'id'=>'editmodeofshipment', 'class' => 'form-control');
$data = array('name' => 'editmodeofshipment','value' => set_value('editmodeofshipment',$modeofshipment),'id'=>'editmodeofshipment', 'class' => 'form-control');
echo form_input($data);
?>
</div>
@ -2020,7 +2226,7 @@ function calculateEditTaxValue()
<div class="form-group">
<?php
$data = array('name' => 'editsupplierreference','value' => set_value('editsupplierreference'),'id'=>'editsupplierreference', 'class' => 'form-control');
$data = array('name' => 'editsupplierreference','value' => set_value('editsupplierreference',$supplierref),'id'=>'editsupplierreference', 'class' => 'form-control');
echo form_input($data);
?>
</div>
@ -2036,7 +2242,7 @@ function calculateEditTaxValue()
<div class="form-group">
<?php
$data = array('name' => 'editsupplierofferno','value' => set_value('editsupplierofferno'),'id'=>'editsupplierofferno', 'class' => 'form-control');
$data = array('name' => 'editsupplierofferno','value' => set_value('editsupplierofferno',$suppofferno),'id'=>'editsupplierofferno', 'class' => 'form-control');
echo form_input($data);
?>
</div>
@ -2050,7 +2256,7 @@ function calculateEditTaxValue()
<div class="form-group">
<?php
$data = array('name' => 'editotherreference','value' => set_value('editotherreference'),'id'=>'editotherreference', 'class' => 'form-control');
$data = array('name' => 'editotherreference','value' => set_value('editotherreference',$otherref),'id'=>'editotherreference', 'class' => 'form-control');
echo form_input($data);
?>
</div>
@ -2060,7 +2266,7 @@ function calculateEditTaxValue()
<div class="form-group">
<?php
$data = array('name' => 'editfincap','value' => set_value('editfincap'),'id'=>'editfincap', 'class' => 'form-control');
$data = array('name' => 'editfincap','value' => set_value('editfincap',$fincap),'id'=>'editfincap', 'class' => 'form-control');
echo form_input($data);
?>
</div>
@ -2069,6 +2275,61 @@ function calculateEditTaxValue()
</div>
</div>
</div><!--End new fields 1 sep-->
<!--start new fields 1 sep-->
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<div class="col-md-12" style="padding: 0px;">
<label>Revenue Type Options</label>
<div class="form-group">
<?php
//$optionsWork = array("0"=>'Select Work Status');
if(!empty($PoTypeOptions))
{
foreach ($PoTypeOptions as $POpt):
$optionsPO[$POpt->ConfigValue] = $POpt->ConfigValue;
endforeach;
}
echo form_dropdown('PoTypeOptions', $optionsPO,$revenuesubtype,set_value('PoTypeOptions'),'id="PoTypeOptions"' ,'required="true"' ,'class="form-control select2');
?>
</div>
</div>
</div>
<div class="col-md-1">
<label for="insurance">Insurance</label>
<?php
$optionsnew=array('1'=>'Yes','0'=>'No');
echo form_dropdown('insurancestatus', $optionsnew,set_value('insurancestatus'),'id="insurancestatus"' ,'required="true"' ,'class="form-control select2');
?>
</div>
<div class="col-md-3" id="insurancenodiv" style="display:block;">
<label>Insurance No<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5 ;">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'insuranceno','insuranceno' => set_value('insuranceno',$insurenceno),'id'=>'insuranceno', 'class' => 'form-control' ,'required' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
@ -2598,6 +2859,16 @@ function calculateEditTaxValue()
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4 ">
<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-4 col-md-offset-4"><br/>
<a class="btn btn-primary font AddRevenue" ID="AddRevenue">&nbsp;&nbsp;<span class="bold">Add Revenue</span></a> &nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
@ -2737,6 +3008,7 @@ function calculateEditTaxValue()
?>
</div>
</div>
</div>
</div>
</div><br/>
@ -2962,6 +3234,16 @@ function calculateEditTaxValue()
?>
</div>
</div>
<div class="col-md-4 ">
<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-4 col-md-offset-4"><br/>
<a class="btn btn-primary EditRevenue" ID="EditRevenue">&nbsp;&nbsp;<span class="bold">Edit Revenue</span></a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
@ -3085,7 +3367,7 @@ function calculateEditTaxValue()
</div>
<div class="col-md-3">
<label>Per</label> <?php
$data = array('name' => 'ViewPer','value' => set_value('ViewPer'),'id'=>'ViewPer', 'class' => 'form-control');
$data = array('name' => 'ViewPer','value' => set_value('ViewPer'),'id'=>'ViewPer', 'class' => 'form-control','readonly' => 'true');
echo form_input($data); ?>
</div>
<div class="col-md-3">
@ -3136,7 +3418,7 @@ function calculateEditTaxValue()
<label>CGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewCGST','value' => set_value('tViewCGST'),'id'=>'ViewCGST', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateCST(0);');
$data = array('name' => 'ViewCGST','value' => set_value('tViewCGST'),'id'=>'ViewCGST', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateCST(0);','readonly' => 'true',);
echo form_input($data);
?>
</div>
@ -3187,7 +3469,7 @@ function calculateEditTaxValue()
<label>SGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewSGST','value' => set_value('ViewSGST'),'id'=>'ViewSGST', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>' calculateGST(0);');
$data = array('name' => 'ViewSGST','value' => set_value('ViewSGST'),'id'=>'ViewSGST', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>' calculateGST(0);','readonly' => 'true');
echo form_input($data);
?>
</div>
@ -3207,7 +3489,7 @@ function calculateEditTaxValue()
<label>IGST In %</label>
<div class="form-group">
<?php
$data = array('name' => 'ViewIGST','value' => set_value('tViewIGST'),'id'=>'ViewIGST', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>' calculateGST(0);');
$data = array('name' => 'ViewIGST','value' => set_value('tViewIGST'),'id'=>'ViewIGST', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>' calculateGST(0);','readonly' => 'true',);
echo form_input($data);
?>
</div>
@ -3227,20 +3509,32 @@ function calculateEditTaxValue()
<div class="col-md-12" >
<div class="col-md-4">
<label>Freight Type </label>
<div>
<?php
$data = array('name' => 'drpViewFreight','value' => set_value('drpViewFreight'),'id'=>'drpViewFreight', 'class' => 'form-control num' ,'readonly' => 'true','style'=>'text-align:right;');
echo form_input($data);
?>
</div>
</div>
<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('drpViewFreight', $options,set_value('drpViewFreight'),'id="drpViewFreight"' ,'class="form-control "');
?>
</div>
</div>
<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' ,'readonly' => 'true');
$data = array('name' => 'ViewNOOfTrips','value' => set_value('ViewNOOfTrips'),'id'=>'ViewNOOfTrips', 'class' => 'form-control num','onchange'=>'calculateFreight(2);' );
echo form_input($data);
?>
</div>
@ -3249,7 +3543,7 @@ function calculateEditTaxValue()
<label>Freight Rate </label>
<div class="form-group">
<?php
$data = array('name' => 'txtViewFreight','value' => set_value('txtViewFreight'),'id'=>'txtViewFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','style'=>'text-align:right;','readonly' => 'true');
$data = array('name' => 'txtViewFreight','value' => set_value('txtViewFreight'),'id'=>'txtViewFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','style'=>'text-align:right;','onchange'=>'calculateFreight(2);');
echo form_input($data);
?>
</div>
@ -3286,9 +3580,19 @@ function calculateEditTaxValue()
?>
</div>
</div>
<div class="col-md-4 ">
<label><?php echo "Revenue Description";?></label>
<div class="form-group">
<?php
$data = array('name' => 'View_Service_Description','value' => set_value('View_Service_Description'),'id'=>'View_Service_Description', 'class' => 'form-control','rows'=>'2','cols'=>'100','readonly'=>'true');
echo form_textarea($data);
?>
</div>
</div>
<div class="col-md-2 col-md-offset-6"><br/>
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-primary ViewRevenue" ID="ViewRevenue">&nbsp;&nbsp;<span class="bold">Edit Revenue</span></a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div>
</div>
@ -3362,8 +3666,9 @@ function calculateEditTaxValue()
<input type="hidden" name="<?php echo 'materialName'.$index ?>" id="<?php echo 'materialName'.$index ?>" value="<?php echo htmlentities($record->MaterialName);?>" />
<input type="hidden" name="<?php echo 'uom'.$index ?>" id="<?php echo 'uom'.$index ?>" value="<?php echo $record->UOM ; ?>" />
<input align="right" type="hidden" name="<?php echo 'quantity'.$index ?>" id="<?php echo 'quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input align="right" type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<input align="right" type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<input align="right" type="hidden" name="<?php echo 'per'.$index ?>" id="<?php echo 'per'.$index ?>" value="<?php echo $record->Per ; ?>" />
<input align="right" type="hidden" name="<?php echo 'service_description'.$index ?>" id="<?php echo 'service_description'.$index ?>" value="<?php echo $record->ServiceMaterialDescription ; ?>" />
<input align="right" type="hidden" name="<?php echo 'DisType'.$index ?>" id="<?php echo 'DisType'.$index ?>" value="<?php echo $record->DiscountType ; ?>" />
<input align="right" type="hidden" name="<?php echo 'DisVal'.$index ?>" id="<?php echo 'DisVal'.$index ?>" value="<?php echo $record->DiscountValue ; ?>" />
@ -3537,7 +3842,8 @@ function calculateEditTaxValue()
<a class="btn btn-primary Save" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-primary Save" ID="Cancel" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">Cancel</span></a>
<?php }else {?>
<a class="btn btn-primary" ID="OK" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a> <?php } ?>
<a class="btn btn-primary" ID="Viewsave" onclick="Save(2)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-primary" ID="OK" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a> <?php } ?>
@ -3585,7 +3891,7 @@ $("#REVENUE").on("shown.bs.modal", function(e) {
});
$('.AddRevenue').click(function(){
tinyMCE.triggerSave();
if(validateRevenueTax() && validateExceedLimit() && ExceedQuantityCheck())
{
var temp = parseInt(index)+1;
@ -3598,7 +3904,12 @@ $('.AddRevenue').click(function(){
var uom = $("#UOM").val();
var quantity = parseFloat($("#Quantity").val()).toFixed(2);
var itemRate = parseFloat($("#Rate").val()).toFixed(2);
var PER = $("#AddPer").val();
//alert(PER);
if(PER == '')
{
PER = $("#UOM").val();
}
var DisType = $("#DiscountType").val();
var DisVal = $("#txtDiscount").val();
var AfterDisVal = $("#txtAfterDiscount").val();
@ -3622,9 +3933,11 @@ $('.AddRevenue').click(function(){
var basicval = $("#txtBasicValue").val();
var Insval = $("#txtInsurance").val();
var TotalOrderValue = $("#txtTotalOrderValue").val();
var service_description = $("#Add_Service_Description").val();
//alert(service_description);
var TotalTaxValue = calculateTaxValue();
// $('#ReqNo').val(Reqnumber).remove();
// $('#ReqNo option[value='+Reqnumber+']').remove();
$('#MaterialCode option[value='+materialCode+']').remove();
@ -3640,7 +3953,7 @@ $('.AddRevenue').click(function(){
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,ActualQuantity:quantity,ReceivedQuantity:0,PendingQuantity:quantity}));
$('#RevenueAppend').append(_.template(template,{index:temp,ReqNo:Reqnumber,MaterialCode:materialCode,MaterialName:materialName,Quantity:quantity,UOM:uom,Rate:itemRate,AddPer:PER,Add_Service_Description:service_description,BasicAmount:basicval,Taxvalue:TotalTaxValue,TotalValue:TotalOrderValue,ActualQuantity:quantity,ReceivedQuantity:0,PendingQuantity:quantity}));
var theForm = $(".CreatePO");
@ -3676,6 +3989,8 @@ $('.AddRevenue').click(function(){
addHidden(theForm,"RevenueIgst"+temp,Igst);
addHidden(theForm,"RevenueAfterIgst"+temp,AfterIgst);
addHidden(theForm,"LineItemNo"+temp,'');
addHidden(theForm,"per"+temp,PER);
addHidden(theForm,"service_description"+temp,service_description);
$('#txtRowCount').val(temp);
// $('#REVENUE').modal('hide');
populateValueMainFormForRevenue();
@ -3683,9 +3998,12 @@ clearRevenueModalFields();
}
});
$('.EditRevenue').click(function(){
tinyMCE.triggerSave();
if(validateEditRevenueTax() && validateEditExceedLimit() && ExceedEditQuantityCheck())
{
//alert('inside Add');
@ -3697,7 +4015,11 @@ clearRevenueModalFields();
var editQuantity = $('#EditQuantity').val();
var itemRate = $("#EditRate").val();
var per = $("#EditPer").val();
if(per == '')
{
per = $('#EditUOM').val();
}
var DisType = $("#EditDiscountType").val();
var DisVal = $("#txtEditDiscount").val();
@ -3722,7 +4044,7 @@ clearRevenueModalFields();
var basicval = $("#txtEditBasicValue").val();
var Insval = $("#txtEditInsurance").val();
var TotalOrderValue = $("#txtEditTotalOrderValue").val();
var Service_Description=$("#Edit_Service_Description").val();
var TotalTaxValue = calculateEditTaxValue();
@ -3744,6 +4066,7 @@ clearRevenueModalFields();
$('#materialCode'+userid).val(editMaterialCode);
$('#materialName'+userid).val(editDescription);
$('#uom'+userid).val(editUOM);
$('#per'+userid).val(per);
$('#quantity'+userid).val(editQuantity);
$('#itemRate'+userid).val(itemRate);
$('#DisType'+userid).val(DisType);
@ -3768,11 +4091,53 @@ clearRevenueModalFields();
$('#AvilBudget'+userid).val(AvilBudget);
$('#costCode'+userid).val(CostCode);
$('#TotalOrderValue'+userid).val(TotalOrderValue);
$('#service_description'+userid).val(Service_Description);
populateValueMainFormForEditRevenueTax();
}
});
$('.ViewRevenue').click(function(){
//alert("Working");
var FreightType = $("#drpViewFreight").val();
var FreightVal = $("#txtViewFreight").val();
var AfterFreightVal = $("#txtViewAfterFreight").val();
var NoOfTrip = $("#ViewNOOfTrips").val();
if(FreightType != 'PER TRIP'){
NoOfTrip=0;
}
var TotalOrderValue = $("#txtViewTotalOrderValue").val();
//alert(FreightType+'-'+FreightVal+'-'+AfterFreightVal+'-'+NoOfTrip+'-'+TotalOrderValue);
var tr= document.getElementById(userid);
var cellval = tr.cells;
cellval[9].innerHTML =TotalOrderValue;
$('#FreightType'+userid).val(FreightType);
$('#FreightVal'+userid).val(FreightVal);
$('#AfterFreightVal'+userid).val(AfterFreightVal);
$('#NoOfTrip'+userid).val(NoOfTrip);
$('#TotalOrderValue'+userid).val(TotalOrderValue);
populateValueMainFormForEditRevenueTax();
// }
});
function addHidden(theForm, key, value) {
// Create a hidden input element, and append it to the form:
@ -3783,6 +4148,9 @@ clearRevenueModalFields();
input.value = value;
theForm.append(input);
}
function populateValueMainFormForRevenue()
{
var Packaging = $('#txtAfterPackaging').val() == '' ? '0.00' : $('#txtAfterPackaging').val();
@ -3894,6 +4262,7 @@ function clearRevenueModalFields()
$('#MaterialCode').val("0") ;
$("#ItemName").val('');
$('#UOM').val('');
$('#AddPer').val('');
$('#Quantity').val('');
$("#Rate").val('');
@ -3925,6 +4294,7 @@ function clearRevenueModalFields()
$("#txtBasicValue").val('');
$("#txtInsurance").val('');
$("#txtTotalOrderValue").val('');
tinyMCE.activeEditor.setContent('');
}
function validateEditRevenueTax()
{
@ -4198,11 +4568,14 @@ if(status == '0')
{
stat = '<?php echo PO_DRAFT; ?>';
}
else
else if(status == '1')
{
stat = '<?php echo PO_CREATED; ?>';
}
else
{
stat = '<?php echo $PONOStatus;?>';
}
var deladd = $('#DeliveryAddr').val();
$('#txtStatus').val(stat);
tinyMCE.triggerSave();
@ -4211,7 +4584,10 @@ $('#SpcialInstruction').val(splinstr);
$('#txtDeliveryAddress').val(deladd);
var AvlBudAmt = '<?php echo number_format($AvlAmount+$totBasicAmt-$totDiscountAmt, 2, '.', '') ?>';
var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
var txtTotalbasicamount = $('#txtTotBasicAmount').val();
var totaldiscount = $('#txtTotalDiscount').val();
//alert(txtTotalbasicamount+'-'+totaldiscount);
//alert(txtTotalbasicamount-totaldiscount);
if(validate())
{
@ -4225,7 +4601,7 @@ var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
//{
// return false;
//}
else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
else if(parseInt(AvlBudAmt) < (parseInt(txtTotalbasicamount)- parseInt(totaldiscount))){
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
@ -4236,6 +4612,11 @@ var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val();
$('#Otherpayment').focus();
return false;
}
else if($('#insurancestatus').val() == 1 && $('#insuranceno').val() == ''){
alert('Please Enter Insurance No..!');
$('#insurance').focus();
return false;
}
else
{
$('#content').loader('show');
@ -4296,6 +4677,9 @@ $('#Scheduleby').change(function(){
});
});
function RevenueChangeSgst(){
var getTypeOfTax= $("input:radio[name='Range']:checked").val();
@ -4384,7 +4768,7 @@ function calculateTaxValue()
var Discount = $('#txtAfterDiscount').val() == '' ? '0.00' : $('#txtAfterDiscount').val();
var totvalue = parseFloat(Packaging)+ parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(Freight) + parseFloat(Insurance) ;
var totvalue = parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst) ;
var tot = parseFloat(totvalue).toFixed(2);
//alert('tot:'+tot);
@ -4504,7 +4888,14 @@ $("#EDITREVENUE").on("shown.bs.modal", function(e) {
$('#EditItemName').val($('#materialName'+userid).val());
$('#EditUOM').val($('#uom'+userid).val());
$('#EditQuantity').val($('#quantity'+userid).val());
tinyMCE.get('Edit_Service_Description').setContent($('#service_description'+userid).val());
$('#EditRate').val($('#itemRate'+userid).val());
var per=$('#per'+userid).val()
if(per == ''){
$('#EditPer').val($('#uom'+userid).val());
}else{
$('#EditPer').val($('#per'+userid).val());
}
$('#txtEditBasicValue').val(cellval[7].innerHTML);
RequistQuantity = $('#quantity'+userid).val();
$('#txtEditDiscount').val($('#DisVal'+userid).val());
@ -4612,12 +5003,13 @@ $("#VIEWREVENUE").on("shown.bs.modal", function(e) {
$('#ViewUOM').val($('#uom'+userid).val());
$('#ViewQuantity').val($('#quantity'+userid).val());
$('#ViewRate').val($('#itemRate'+userid).val());
$('#ViewPer').val($('#per'+userid).val());
$('#txtViewBasicValue').val(cellval[7].innerHTML);
RequistQuantity = $('#quantity'+userid).val();
$('#txtViewDiscount').val($('#DisVal'+userid).val());
$('#txtViewAfterDiscount').val($('#AfterDisVal'+userid).val());
tinyMCE.get('View_Service_Description').setContent($('#service_description'+userid).val());
$('#txtViewPackaging').val($('#PackVal'+userid).val());
$('#txtViewAfterPackaging').val($('#AfterPackVal'+userid).val());
@ -4661,4 +5053,17 @@ $("#VIEWREVENUE").on("shown.bs.modal", function(e) {
});
</script>
<script>
$('#insurancestatus').change(function(){
var ans=$("#insurancestatus").val();
//alert(ans);
if(ans == 0){
$("#insurancenodiv").hide();
//$("#insuranceno").val("");
}
else {
$("#insurancenodiv").show();}
});
</script>

View File

@ -54,6 +54,7 @@
<?php
if(!empty($userRecords))
{
//print_r($userRecords);
foreach($userRecords as $record)
{
?>
@ -81,7 +82,7 @@
</div><!-- /.box-body -->
<!-- <div class="box-footer clearfix">
<?php echo $this->pagination->create_links(); ?>
<?php //echo $this->pagination->create_links(); ?>
</div> -->
</div><!-- /.box -->
</div>

View File

@ -60,7 +60,7 @@ speed:500
<th>OT Hours Worked in Hrs</th>
<th>Loan Recovered in </th>
<!-- <th>Loan Balance</th> -->
<th>Incentives in Rs</th>
<th>Incentives in </th>
<th>Other Deductions in </th>
<th>Action</th>
</tr>
@ -70,6 +70,7 @@ speed:500
<?php
if(!empty($userRecords))
{
//print_r($userRecords);
foreach($userRecords as $record)
{
?>
@ -101,7 +102,7 @@ speed:500
</div><!-- /.box-body -->
<!-- <div class="box-footer clearfix">
<?php echo $this->pagination->create_links(); ?>
<?php //echo $this->pagination->create_links(); ?>
</div> -->
</div><!-- /.box -->
</div>