code merged

This commit is contained in:
venbatechnologies@gmail.com 2018-06-22 11:24:04 +05:30
parent 175ec7e1b8
commit 34cbd1536c
12 changed files with 6810 additions and 6800 deletions

View File

@ -42,7 +42,6 @@ class emergencypurchaseorder extends BaseController
$data['DeptList'] = $this->purchaseorder_model->getDepartmentListForAllReq();
$data['stList'] = $this->purchaseorder_model->getStatusListforAllReq();
$data['ReqList'] = $this->purchaseorder_model->getRequistionListbySearch();
//$this->global['pageTitle'] = 'Resico : Create PO from Requisition List';
$this->global['pageTitle'] = $this->CompanyName.' : Create Purchase Order from Requistion';
$this->loadViews("createPOfromRequistion", $this->global, $data,Null);
}
@ -70,8 +69,6 @@ class emergencypurchaseorder extends BaseController
$data['ServiceOption'] = $this->requistion_model->getConfigValue('C022');
$data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026');
$this->loadViews("alterpurchaseorder", $this->global, $data, Null);
@ -101,97 +98,82 @@ class emergencypurchaseorder extends BaseController
/**
* To add file for inward po
*/
function addfile()
function addfile($pathname)
{
$file = '';
//Check whether user upload picture
if(!empty($_FILES['images']['name']))
$picture = '';
if(!empty($_FILES[$pathname]['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
$config['file_name'] = $_FILES['images']['name'];
$config['allowed_types'] = '*';
$config['file_name'] = str_replace(" ","",$_FILES[$pathname]['name']);
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('images'))
if($this->upload->do_upload($pathname))
{
// echo "uploadif";
$uploadData = $this->upload->data();
$file = $uploadData['file_name'];
$picture = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
$file = '';
$picture = '';
}
}
else
{
$file = '';
$picture = '';
}
return $file ;
return $picture ;
}
function addfile1()
/*----------------------------------special po file upload service----------------------------------*/
function add($pathname)
{
$file = '';
//Check whether user upload picture
if(!empty($_FILES['images1']['name']))
$picture = '';
if(!empty($_FILES[$pathname]['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
$config['file_name'] = $_FILES['images1']['name'];
$config['allowed_types'] = '*';
$config['file_name'] = str_replace(" ","",$_FILES[$pathname]['name']);
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('images1'))
if($this->upload->do_upload($pathname))
{
$uploadData = $this->upload->data();
$file = $uploadData['file_name'];
$picture = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
$file = '';
$picture = '';
}
}
else
{
$file = '';
$picture = '';
}
return $file ;
return $picture ;
}
/**
* To Create Service Purchase Order
*/
function addNewServicePurchaseOrder()
{
$txtRowCount=$this->input->post('txtRowCount');
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
$DeliveryAddr = $this->input->post('DeliveryAddr');
$CostCenterName = $this->input->post('CostCenterName');
$DeliveryOption = $this->input->post('DateRange');
$DeliverySchedule='';
@ -211,24 +193,18 @@ class emergencypurchaseorder extends BaseController
$POType = $this->input->post('POType');
$SpcialInstruction = $this->input->post('ScopeOfWork');
$RequistionComments = "Created Emergency Service PO";
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummaryService');
$CreateBy = $this->session->userdata ('userId');
$RequestedBy = $this->input->post('drpDepartment');
$ReqStatus = REQITEM_Emergency_PO_CREATED;
$RowCount = $this->input->post('txtRowCount');
$DeletedRow = $this->input->post('txtDeletedRow1');
$comma_separated = explode(':', $DeletedRow);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$BudgetType = $this->input->post('Budget');
$createddt = $dt->format('Y-m-d H:i:s');
$PaymentTerms=$this->input->post('PaymentMethod');
$OtherPayment=$this->input->post('Otherpayment');
if($POStatus==SPECIAL_PO)
{
$ServiceWorkStatus=SERVICE_COMPLETED;
@ -237,7 +213,6 @@ class emergencypurchaseorder extends BaseController
{
$ServiceWorkStatus=$this->input->post('txtworkstatus');
}
$ServiceScheduleType = $this->input->post('ScheduleType');
$ServiceScheduleOptions = $this->input->post('ScheduleType');
$ServiceServiceNo = 1;
@ -251,7 +226,7 @@ class emergencypurchaseorder extends BaseController
$ServiceTypeOptions=$this->input->post('PoTypeOptions');
$DescriptionOfPo = $this->input->post('emergdescofpo');
//create T_Requestion_Master
$Request = array('ReqType'=>$POType, 'RequestedDept'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$RequistionComments,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy,'Schedule_Type'=>$ServiceScheduleType,'NumberOfService'=>$ServiceServiceNo,'Service_Period'=>$ServiceScheduleOptions);
$Req = $this->requistion_model->addRequistion($Request);
@ -263,8 +238,7 @@ class emergencypurchaseorder extends BaseController
}
// 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'=>$ServiceWorkStatus,'POType'=>$POType,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions);
$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'=>$ServiceWorkStatus,'POType'=>$POType,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'BudgetType'=>$BudgetType);
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$ServiceTypeOptions);
$PONO = '';
if(count($POMaster)>0)
@ -292,7 +266,6 @@ class emergencypurchaseorder extends BaseController
$AfterIgst = $this->input->post('AfterIgst'.$i);
$OtherAmt = $this->input->post('OtherAmt'.$i);
$CostCenter = $this->input->post('costCode'.$i);
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
$ServiceFrequency=$this->input->post('Frequency'.$i).' - '.$this->input->post('FrequencyValue'.$i);
$ServiceMaterialDescription = $this->input->post('ItemServiceDescription'.$i);
@ -335,13 +308,61 @@ class emergencypurchaseorder extends BaseController
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
}
}
else {}
}
if($POStatus==SPECIAL_PO){
$count = $this->input->post('hidecounters');
$constant = $this->input->post('hideconstants');
$arr = [];
$prefile =array();
$file =$this->addfile1();
$myfile = array('FilePath'=>$file,'MaterialCode'=>$MaterialCode,'PONO'=>$PONO);
$result= $this->purchaseorder_model->fileupload($myfile);
for($i=1;$i<=$constant;$i++)
{
$pathname = 'browseFiles'.$i;
if(!empty($_FILES[$pathname]['name']))
{
$files = str_replace(" ","",$_FILES[$pathname]['name']);
$fcount = 0;
foreach ($prefile as $value)
{
if($value == $files)
{
$fcount++;
}
}
if($fcount == 0)
{
$Picture = $this->add($pathname);
$arr[] = array($Picture);
}
$prefile[] = $files;
}
}
if(!empty($arr))
{
foreach($arr as $ma){
$index = 0;
foreach($ma as $key=>$value){
$index++;
if($index == 1){
$filename = $value;
}
}
if(!empty($filename))
{
$myfile = array('FilePath'=>$filename,'PONO'=>$PONO);
$this->purchaseorder_model->fileupload($myfile);
}
}
}
}
if($POStatus == REQ_DRAFT)
@ -354,9 +375,7 @@ class emergencypurchaseorder extends BaseController
{
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
redirect('purchaseorder/PurchaseOrderList','refresh');
}
}
/**
@ -364,8 +383,6 @@ class emergencypurchaseorder extends BaseController
**/
function addNewRevenuePurchaseOrder()
{
$txtspl=$this->input->post('txtSpecial');
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
@ -389,6 +406,7 @@ class emergencypurchaseorder extends BaseController
$fincap=$this->input->post('emergfincap');
$revenuetype=$this->input->post('PoTypeOptions');
$insurancestatus=$this->input->post('insuranceStatus');
if($insurancestatus == 1){
$insuranceno=$this->input->post('insuranceNo');
}else{
@ -414,9 +432,9 @@ class emergencypurchaseorder extends BaseController
$RequestedBy = $this->input->post('drpDepartment');
$CreateBy = $this->session->userdata ( 'userId' );
$RowCount=$this->input->post('txtRowCount1');
$BudgetType = $this->input->post('Budget');
$DeletedRow = $this->input->post('txtDeletedRow1');
$splRow = $this->input->post('splrow');
$ReqStatus = REQITEM_Emergency_PO_CREATED;
$Local_Interstate=$this->input->post('Range');
@ -430,13 +448,11 @@ class emergencypurchaseorder extends BaseController
if($POStatus==SPECIAL_PO)
{
$Qualitycheck=$this->input->post('txtQuality');
}
else
}else
{
$Qualitycheck=1;
}
//add requistion
$Request = array('ReqType'=>$POType, 'RequestedDept'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$RequistionComments,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy);
$Req = $this->requistion_model->addRequistion($Request);
@ -446,8 +462,9 @@ class emergencypurchaseorder extends BaseController
{
$RegNo = $Req[0]['ReqNo'];
}
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Supplier_Reference'=>$supplierreference,'Other_Reference'=>$otherreference,'InsuranceNumber'=>$insuranceno,'InsuranceStatus'=>$insurancestatus,'Fincap'=>$fincap,'POSubType'=>$revenuetype,'IsQualityChkReqired'=>$Qualitycheck);
// PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Supplier_Reference'=>$supplierreference,'Other_Reference'=>$otherreference,'InsuranceNumber'=>$insuranceno,'InsuranceStatus'=>$insurancestatus,'Fincap'=>$fincap,'POSubType'=>$revenuetype,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType);
//print_r($POList);
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$revenuetype);
$PONO = '';
@ -505,12 +522,13 @@ class emergencypurchaseorder extends BaseController
}
if($SkipInsert == "False")
{
//add requistion details
$ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt);
$ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails);
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'Per'=>$per,'ServiceMaterialDescription'=>$revenuedescription);
//print_r($POLineItemList);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
$LineItemNo = '';
@ -519,12 +537,13 @@ class emergencypurchaseorder extends BaseController
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
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,'NoOfTrip'=>$NOOfTrip);
//print_r($RevenueTaxList);
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
//echo 'Revenue tax Success';
}
}
}
@ -532,7 +551,6 @@ class emergencypurchaseorder extends BaseController
{
$PONOigr = $PONO;
$DeliveryChellanInvoiceNo=$this->input->post('ChallanInvNo');
$DeliveryChellan = $this->input->post('ChallanInvDate');
@ -554,7 +572,7 @@ class emergencypurchaseorder extends BaseController
$IGRStatus = IGR_CREATED;
$igr = array();
$igr = array('PONO'=>$PONO,'VehicleNo'=>$Vehicle,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'CourierNo'=>$Courier,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt,'MaterialRcvdDate'=>$MaterialReceivedate);
$igr = array('PONO'=>$PONO,'VehicleNo'=>$Vehicle,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$DeliveryChellanDate,'CourierNo'=>$Courier,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt,'MaterialRcvdDate'=>$MaterialReceivedate);
$igrM = $this->inwardgateregister_model->addigrM($igr);
$IGRNO = '';
if(count($igrM)>0)
@ -569,12 +587,11 @@ class emergencypurchaseorder extends BaseController
$mrirmastervalues = array('MRIRStatus'=>MRIR_APPROVED,'IGRNO'=>$IGRNO,'PONO'=>$PONO,'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt,'Remarks'=>$Remarksmrir);
$mrirmaster = $this->mrir_model->master_mrir($mrirmastervalues);
$MRIRNO = '';
if(count($mrirmaster)>0)
{
foreach ($mrirmaster as $key ) {
$MRIRNO=$key->MRIRNo;
}
$MRIRNO=$key->MRIRNo; }
}
@ -590,7 +607,6 @@ class emergencypurchaseorder extends BaseController
$mrirdetailvalues = array('MRIRNO'=>$MRIRNO,'MaterialCode'=>$MaterialCode,'ActualQuantityReceived'=>$Quantity,'Remarks'=>$Remarked,'MRIRStatus'=>$MRIRStatus);
$mrirdetails = $this->mrir_model->detail_mrir($mrirdetailvalues);
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim($MaterialCode));
if(count($getAvailableqty)>0)
@ -641,6 +657,20 @@ class emergencypurchaseorder extends BaseController
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt);
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
$IGRItemNo = '';
foreach($igrD as $value)
{
$IGRItemNo = $value->IGRItemNo;
}
$MaterialstockHistoryadd= array('Ref_No'=>$IGRItemNo,'MaterialCode'=>$MaterialCode,'Transaction_type'=>'Add','Ref_Type'=>'IGR','SupplierID'=>$SupplierID,'Quantity'=>$QuantityAsPerInvoice,'ItemValue'=>$itemRate,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
$this->inwardgateregister_model->addMaterialStockHistory($MaterialstockHistoryadd);
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO,$MaterialCode);
$ReceivedQuantity = 0.00;
if(count($Recqty)>0)
@ -655,19 +685,89 @@ class emergencypurchaseorder extends BaseController
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
}
}
$counts = $this->input->post('hidecounter');
$constants = $this->input->post('hideconstant');
$arr = [];
$prefile =array();
for($i=1;$i<=$constants;$i++)
{
$pathname = 'browseFiles'.$i;
if(!empty($_FILES[$pathname]['name']))
{
$files = str_replace(" ","",$_FILES[$pathname]['name']);
$fcount = 0;
foreach ($prefile as $value)
{
if($value == $files)
{
$fcount++;
}
}
$file =$this->addfile();
$emergencyitemcode = $this->input->post('materialCode'.$i);
$myfile = array('FilePath'=>$file,'MaterialCode'=>$emergencyitemcode,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
$result= $this->purchaseorder_model->fileupload($myfile);
if($fcount == 0)
{
$Picture = $this->addfile($pathname);
//echo $Picture;
$arr[] = array($Picture);
}
$prefile[] = $files;
}
}
if(!empty($arr))
{
foreach($arr as $ma)
{
$index = 0;
$filename = null;
foreach($ma as $key=>$value)
{
$index++;
if($index == 1){
$filename = $value;
}
}
if(!empty($filename))
{
$myfile = array('FilePath'=>$filename,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
$this->purchaseorder_model->fileupload($myfile);
}
}
}
}
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
redirect('purchaseorder/PurchaseOrderList','refresh');
}
/**
* To load the purchaseorder list
*/
@ -711,7 +811,6 @@ class emergencypurchaseorder extends BaseController
function CreatePurchaseOrder()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate');
@ -796,37 +895,31 @@ class emergencypurchaseorder extends BaseController
$data['ReqList'] = $Req ;
$result = array();
$ReqArray = array();
foreach ($Req as $SID):
$ReqArray[] = $SID->ReqNo ;
$result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo);
endforeach;
$data['MaterialList'] = $result;
$data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray);
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
$data['RequistionDetails'] = $this->purchaseorder_model->getRequistDetails($ReqArray);
$data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO);
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
if($ReqType == SERVICE)
{
$data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO);
//$this->global['pageTitle'] = 'Resico : Edit Service Purchase order form';
$this->global['pageTitle'] = $this->CompanyName.' : Edit Service Purchase Order ';
$this->global['pageTitle'] = $this->CompanyName.' : Edit Service Purchase order form';
$this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL);
}
else if($ReqType == REVENUE)
{
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO);
//$this->global['pageTitle'] = 'Resico : Edit Revenue Purchase order form';
$this->global['pageTitle'] = $this->CompanyName.' : Edit Revenue Purchase Order';
$this->global['pageTitle'] = $this->CompanyName.' : Edit Revenue Purchase order form';
$this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL);
}
}
/**
* To get the Material value based on the MaterialCode
**/
@ -897,17 +990,14 @@ class emergencypurchaseorder extends BaseController
function AvilBudgetAmount()
{
$SearchFilter= $this->input->post('id');
$CostCode = $SearchFilter[0];
$ReqType = $SearchFilter[1];
print_r($SearchFilter);
$CostCode= $this->input->post('id');
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$Year = $dt->format('Y');
$this->load->model('purchaseorder_model');
$result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType);
$AvilBudAmt = '';
if(count($result)>0)
{
@ -1005,7 +1095,6 @@ class emergencypurchaseorder extends BaseController
<td align='left'>".$UOM."</td>
<td align='left'>".$Quantity."</td>
</tr>";
}
$CostCenter = "<option value='-1'>Select Cost center</option>";
@ -1121,7 +1210,6 @@ class emergencypurchaseorder extends BaseController
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
if(trim($POType) == REVENUE )
{
@ -1136,7 +1224,6 @@ class emergencypurchaseorder extends BaseController
echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ;
}
/**
* This used to Edit the Revenue Purchase Order
**/
@ -1146,6 +1233,14 @@ class emergencypurchaseorder extends BaseController
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
$newsup=$this->input->post('newsup');
$newSupId = split("[ - ]+", $newsup);
$b4supplier=$this->input->post('b4supplier');
$b4date=$this->input->post('b4podate');
$b4podate = $this->getDateformat($b4date);
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
$dt = $this->input->post('Deliverydt');
$Deliverydt = $this->getDateformat($dt);
@ -1171,6 +1266,25 @@ class emergencypurchaseorder extends BaseController
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
$LineItemStatus = REQITEM_NEW;
if($PODate != $b4podate )
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>'-','UpdateBy'=>$updatedBy,'OldValue'=>$b4podate,'NewValue'=>$PODate,'Entity'=>'PO DateChanged');
$this->purchaseorder_model->insertlogpo($logpo);
}
if(!empty($newSupId[0] ))
{
if($newSupId[0] != $b4supplier)
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>'-','UpdateBy'=>$updatedBy,'OldValue'=>$b4supplier,'NewValue'=>$newsup,'Entity'=>'Supplier Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
}
for ($i = 1; $i <= $RowCount; $i++)
{
@ -1178,7 +1292,8 @@ class emergencypurchaseorder extends BaseController
$Quantity = $this->input->post('quantity'.$i);
$Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i);
$b4qty=$this->input->post('b4qty'.$i);
$b4rate=$this->input->post('b4rate'.$i);
$DiscountType = $this->input->post('DisType'.$i);
$DiscountValue = $this->input->post('DisVal'.$i);
$AfterDiscount = $this->input->post('AfterDisVal'.$i);
@ -1208,6 +1323,22 @@ class emergencypurchaseorder extends BaseController
$CostCenter = $this->input->post('costCode'.$i);
$LineItemNo = '';
if($Quantity != $b4qty)
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4qty,'NewValue'=>$Quantity,'Entity'=>'Quantity Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
if($itemRate != $b4rate)
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4rate,'NewValue'=>$itemRate,'Entity'=>'Rate Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
$SkipInsert = "False";
if( count($comma_separated) > 0)
@ -1265,7 +1396,6 @@ class emergencypurchaseorder extends BaseController
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ;
}
/**
* To load pagenotfound view
*/
@ -1314,7 +1444,6 @@ class emergencypurchaseorder extends BaseController
public function servicepoprint($PONO)
{
// $this->load->view('includes/pdfheader');
// Load the pdf page with multiviews
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
@ -1339,7 +1468,6 @@ class emergencypurchaseorder extends BaseController
}
/**
* To load the Delete the Requistion Items
*/
@ -1358,7 +1486,6 @@ class emergencypurchaseorder extends BaseController
$MaterialCode = $ReqList[2];
$POType = $ReqList[3];
}
if($POType == REVENUE)
{
$this->purchaseorder_model->DeletePORevenueTax($LineItemNo);

View File

@ -334,7 +334,7 @@ class purchaseorder extends BaseController
$result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo);
endforeach;
$data['MaterialList'] = $result;
$data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray);
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
$data['Payment']=$this->purchaseorder_model->getPaymentTermsDetails();
@ -387,7 +387,6 @@ class purchaseorder extends BaseController
/* End Here */
$data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO);
foreach ($data['POMaster'] as $Exc)
{
$exRate=$Exc->ExchangeRate;
@ -397,8 +396,8 @@ class purchaseorder extends BaseController
$PAYTERM=$TER->PaymentTerms;
}
$data['getdata'] = $this->purchaseorder_model->getfunction($PONO);
//$data['billfile'] = $this->purchaseorder_model->getbillfiesr($PONO);
$data['getdata'] = $this->purchaseorder_model->getfunctionr($PONO);
$data['billfile'] = $this->purchaseorder_model->getbillfiesr($PONO);
$data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate();
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
@ -407,11 +406,10 @@ class purchaseorder extends BaseController
$data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO);
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
$data['getdata'] = $this->purchaseorder_model->getfunction($PONO);
$data['getlogpodtl']=$this->purchaseorder_model->getlogpodtl($PONO);
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
$data['WorkStatus']=$this->purchaseorder_model->getStatus(7);
//$this->global['pageTitle'] = 'Resico : Edit Service Purchase order form';
$this->global['pageTitle'] = $this->CompanyName.' : Edit Service Purchase order form';
$this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL);
}
@ -420,12 +418,10 @@ class purchaseorder extends BaseController
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO);
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
$data['WorkStatus']=$this->purchaseorder_model->getStatus(7);
$data['getlogpodtl']=$this->purchaseorder_model->getlogpodtl($PONO);
//$this->global['pageTitle'] = 'Resico : Edit Revenue Purchase order form';
$data['WorkStatus']=$this->purchaseorder_model->getStatus(7);
$this->global['pageTitle'] = $this->CompanyName.' : Edit Revenue Purchase order form';
$this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL);
}
else if($ReqType == IMPORT)
{
@ -450,6 +446,7 @@ class purchaseorder extends BaseController
$data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO);
$data['getlogpodtl']=$this->purchaseorder_model->getlogpodtl($PONO);
$unicode ='';
foreach ($data['CurrencyDetail'] as $Detail)
{
@ -462,7 +459,6 @@ class purchaseorder extends BaseController
$data['unicode']=$unicode;
$data['currencycode']=$currencycode;
//$this->global['pageTitle'] = 'Resico : Edit Import Purchase order form';
$this->global['pageTitle'] = $this->CompanyName.' : Edit Import Purchase order form';
$this->loadViews("editimportpo", $this->global, $data, NULL);
}
@ -489,8 +485,6 @@ class purchaseorder extends BaseController
$data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO);
$data['getlogpodtl']=$this->purchaseorder_model->getlogpodtl($PONO);
foreach($data['POItem'] as $Rate)
{
$exRate=$Rate->ExchangeRate;
@ -514,7 +508,6 @@ class purchaseorder extends BaseController
}
// $this->global['pageTitle'] = 'Resico : Edit Capital Purchase order form';
$this->global['pageTitle'] = $this->CompanyName.' : Edit Capital Purchase order form';
$this->loadViews("editCapitalPo", $this->global, $data, NULL);
}
@ -925,9 +918,6 @@ class purchaseorder extends BaseController
*/
function addNewPurchaseOrder()
{
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
@ -943,11 +933,8 @@ class purchaseorder extends BaseController
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
$POType = $this->input->post('POType');
$BudgetType = $this->input->post('Budget');
$Modeofshipment=$this->input->post('addmodeofshipment');
$supplierreference=$this->input->post('addsupplierreference');
$supplieroffno=$this->input->post('addsupplierofferno');
@ -982,8 +969,6 @@ class purchaseorder extends BaseController
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$revenuetype);
$PONO = '';
@ -1044,7 +1029,6 @@ class purchaseorder extends BaseController
if($SkipInsert == "False")
{
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Per'=>$per,'ServiceMaterialDescription'=>$revenuedescription,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
$LineItemNo = '';
@ -1053,7 +1037,6 @@ class purchaseorder extends BaseController
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
if(trim($POType) == REVENUE )
{
@ -1068,7 +1051,6 @@ class purchaseorder extends BaseController
echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ;
}
/**
* To stored new values after edited Revenue datas.
*/
@ -1119,11 +1101,11 @@ class purchaseorder extends BaseController
$SpcialInstruction = $this->input->post('SpcialInstruction');
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
$POStatus = $this->input->post('txtStatus');
$updatedBy = $this->session->userdata ( 'userId' );
$updatedBy = $this->session->userdata('userId');
$RowCount = $this->input->post('txtRowCount');
$DeletedRow = $this->input->post('txtDeletedRow');
$comma_separated = explode(':', $DeletedRow);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$updateddt = $dt->format('Y-m-d H:i:s');
@ -1136,6 +1118,7 @@ class purchaseorder extends BaseController
// PO Master
$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,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType);
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
$LineItemStatus = REQITEM_NEW;
@ -1151,7 +1134,7 @@ class purchaseorder extends BaseController
{
if($newSupId[0] != $b4supplier)
{
//echo $b4supplier.'-'.$newSupId[0];die;
$logpo =array('PONO'=>$PONO,'LineItemNo'=>'-','UpdateBy'=>$updatedBy,'OldValue'=>$b4supplier,'NewValue'=>$newsup,'Entity'=>'Supplier Changed');
@ -1159,6 +1142,7 @@ class purchaseorder extends BaseController
}
}
for ($i = 1; $i <= $RowCount; $i++)
{
@ -1199,7 +1183,6 @@ class purchaseorder extends BaseController
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4qty,'NewValue'=>$Quantity,'Entity'=>'Quantity Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
@ -1233,7 +1216,6 @@ class purchaseorder extends BaseController
$this->purchaseorder_model->updateReqDetails($Reqnumber,$MaterialCode,$ReqDetails);
$recqty=0;
if($POStatus == SPECIAL_PO)
@ -1243,61 +1225,32 @@ class purchaseorder extends BaseController
$IGRD= $this->purchaseorder_model->getIGRDetails($PONO);
$j = $i-1;
$IGRDs = array('QuantityAsPerInvoice'=>$Quantity,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt);
$this->purchaseorder_model->updateIGR($IGRD[$j]['IGRItemNo'],$IGRDs);
//$MaterialstockHistoryupdate= array('SupplierID'=>$SupplierID,'Quantity'=>$Quantity,'ItemValue'=>$itemRate,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt);
//$itemNo = $IGRD[$j]['IGRItemNo'];
//$this->purchaseorder_model->updateMatStock($itemNo,$MaterialstockHistoryupdate);
}
if($SkipInsert == "False")
{
//if(strlen($POLineItemNo) == 0)
//{
// $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Per'=>$per,'ServiceMaterialDescription'=>$revenuedescription,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter);
// $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
// if(count($POLineItem)>0)
// {
// $LineItemNo = $POLineItem[0]['LineItemNo'];
// }
//}
//else
//{
$LineItemNo = $POLineItemNo;
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'ReceivedQuantity'=>$recqty,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter);
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList);
//}
$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,'NoOfTrip'=>$NOOfTrip);
// $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,'NoOfTrip'=>$NOOfTrip);
$this->purchaseorder_model->updateRevenueTax($LineItemNo,$RevenueTaxList);
// }
}
}
@ -1324,8 +1277,6 @@ class purchaseorder extends BaseController
// Load all views as normal
$PoStatus='';
$data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO);
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF();
@ -1338,7 +1289,8 @@ class purchaseorder extends BaseController
$Currencycode='';
$TotalOrderValue=$data['POItem'][0]->TotalOrderValue;
$AdvanceAmount=0.00;
$AdvanceAmount=0.00;
foreach ($data['POItem'] as $POI)
{
$AdvanceAmount=$POI->AdvanceAmount;
@ -1350,15 +1302,10 @@ $AdvanceAmount=0.00;
$TotaltoPay=$TotalOrderValue-$AdvanceAmount;
$totalAmt=sprintf("%.2f", $TotalOrderValue);
$data['TotalAmountInWords']= $this->convertNumber($totalAmt);
$data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO);
$mpdf=new mPDF('utf-8','A4-P',7, 10,10, 10, 82, 38, 4, 6);
@ -1674,9 +1621,8 @@ public function importpoprint($PONO)
/**
* To store the new import PO datas into DB
*/
function addNewImportPurchaseOrder()
function addNewImportPurchaseOrder()
{
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
@ -1694,8 +1640,6 @@ function addNewImportPurchaseOrder()
$Dispatch='';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else
{
$Dispatch = $this->input->post('Dispatch');
@ -1706,7 +1650,6 @@ function addNewImportPurchaseOrder()
$TotalOrder = $this->input->post('txtToatlOrder');
$POStatus = $this->input->post('textStatus');
$BudgetType = $this->input->post('Budget');
$CreateBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('txtRowCount');
@ -1727,7 +1670,6 @@ function addNewImportPurchaseOrder()
$OtherPayment=$this->input->post('Otherpayment');
$Palaceoforigin=$this->input->post('PlaceOforigin');
$Shipmentmode=$this->input->post('addmodeofshipment');
$SupplierRef=$this->input->post('addsupplierreference');
$SupplierOffer=$this->input->post('addsupplierofferno');
@ -1752,9 +1694,8 @@ function addNewImportPurchaseOrder()
$Qualitycheck=1;
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$Insurance,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$Insurance,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption);
// ,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$importoption);
@ -1763,7 +1704,9 @@ function addNewImportPurchaseOrder()
{
$PONO = $POMaster[0]['PONO'];
}
$LineItemStatus = REQITEM_NEW;
for ($i = 1; $i <= $RowCount; $i++)
{
@ -1864,7 +1807,7 @@ function addNewImportPurchaseOrder()
}
echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ;
}
}
/**
* To stored new values after edited import po.
@ -1935,7 +1878,6 @@ function addNewImportPurchaseOrder()
$PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment');
$Palaceoforigin=$this->input->post('PlaceOforigin');
$Shipmentmode=$this->input->post('editmodeofshipment');
$SupplierRef=$this->input->post('editsupplierreference');
$SupplierOffer=$this->input->post('editsupplierofferno');
@ -1959,7 +1901,6 @@ function addNewImportPurchaseOrder()
$Insurancenumber='';
$insurestatus='0';
}
// $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms);
$Qualitycheck=1;
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$insurestatus,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType);
@ -1988,7 +1929,6 @@ function addNewImportPurchaseOrder()
}
for ($i = 1; $i <= $RowCount; $i++)
{
@ -2073,11 +2013,10 @@ function addNewImportPurchaseOrder()
$per=$this->input->post('Per'.$i);
$LineItemNo = '';
if($Quantity != $b4qty)
if($Quantity != $b4qty)
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$CreateBy,'OldValue'=>$b4qty,'NewValue'=>$Quantity,'Entity'=>'Quantity Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
@ -2136,20 +2075,15 @@ if($Quantity != $b4qty)
}
$isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo);
if(count($isExists) == 0)
{
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'CreatedBy'=>$CreateBy,'UpdatedOn'=>$updateddt,'Grossdutypayable'=>$Grossdutypayable,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem,'FreightType'=>$FreightType,'NoOfTrip'=>$Nosoftrip,'FreightValue'=>$FreightRate,'AfterFreightValue'=>$FreightAmount,'AssessableValue'=>$AssessableValue,'SubTotal'=>$Subtotal,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'DutyImpact'=>$Dutyimpact,'ClearingCharge'=>$Clearingcharge,'NetValue'=>$Nettvalue);
$ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList);
}
else
{
$ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'CreatedBy'=>$CreateBy,'UpdatedOn'=>$updateddt,'Grossdutypayable'=>$Grossdutypayable,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem,'FreightType'=>$FreightType,'NoOfTrip'=>$Nosoftrip,'FreightValue'=>$FreightRate,'AfterFreightValue'=>$FreightAmount,'AssessableValue'=>$AssessableValue,'SubTotal'=>$Subtotal,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'DutyImpact'=>$Dutyimpact,'ClearingCharge'=>$Clearingcharge,'NetValue'=>$Nettvalue);
$this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList);
@ -2358,7 +2292,6 @@ if($Quantity != $b4qty)
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
$TotalOrder = $this->input->post('CapitalToatlOrder');
$POStatus = $this->input->post('txtStatus');
@ -2375,7 +2308,6 @@ if($Quantity != $b4qty)
$createddt = $dt->format('Y-m-d H:i:s');
$currencytypeID = $this->input->post('currencytype');
$Qualitycheck=1;
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType);
@ -2532,7 +2464,7 @@ if($Quantity != $b4qty)
/**
/**
* To store the new Capital PO datas into DB
*/
function EditCapitalPurchaseOrder()
@ -2555,7 +2487,6 @@ if($Quantity != $b4qty)
$POType = $this->input->post('POType');
$PoRange = $this->input->post('txtPoRange');
$b4supplier=$this->input->post('b4supplier');
$b4date=$this->input->post('b4podate');
$b4podate = $this->getDateformat($b4date);
@ -2767,8 +2698,6 @@ if($Quantity != $b4qty)
$this->purchaseorder_model->insertlogpo($logpo);
}
$SkipInsert = "False";
if( count($comma_separated) > 0)
{
@ -2785,11 +2714,11 @@ if($Quantity != $b4qty)
}
}
$ReqDetails = array('Quantity'=>$Quantity,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber,$MaterialCode,$ReqDetails);
if($SkipInsert == "False")
{
if(strlen($POLineItemNo) == 0)
@ -2970,14 +2899,6 @@ if($Quantity != $b4qty)
}
/**
* To convert amount(digit) into words
* */
@ -3205,8 +3126,179 @@ if($advance > 0)
}
function addloadfile()
{
$pono= $this->input->post('PONO');
$igr= $this->input->post('igr');
$new_file_name =$_FILES['file']['name'];
$new_file_name = str_replace(" ","",$new_file_name);
$files = $this->purchaseorder_model->getfies($pono);
$fcount = 0;
foreach ($files as $value)
{
$lastfile = $value->FilePath;
if($lastfile == $new_file_name)
{
$fcount ++;
}
}
if($fcount == 0)
{
if(!empty($new_file_name))
{ $Picture = $this->addfile();
$filelist =array('PONO'=>$pono,'IGRNO'=>$igr,'FilePath'=>$Picture);
$uploadfiles = $this->purchaseorder_model->insertfile($filelist);
}
}
if($uploadfiles > 0){
echo "file updated successfully!";
}
else
{
echo "No File Choose or File name already Exist";
}
}
function splpodata()
{
$invno= $this->input->post('param1');
$invdate= $this->input->post('param2');
$VehicleNo= $this->input->post('param3');
$CourierNo= $this->input->post('param4');
$MaterialRcvdDate =$this->input->post('param5');
$PONO =$this->input->post('param6');
$IGRNO =$this->input->post('param7');
$invdate = date('Y-m-d',strtotime($invdate));
$MaterialRcvdDate =date('Y-m-d',strtotime($MaterialRcvdDate));
$CreatedBy = $this->session->userdata('userId');
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$igrMaster = array('VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$invno,'DeliveryChellanDate'=>$invdate, 'MaterialRcvdDate'=>$MaterialRcvdDate,'CourierNo'=>$CourierNo,'UpdateBY'=>$CreatedBy,'UpdatedOn' =>$createddt);
$igrM = $this->purchaseorder_model->updateigrM($PONO,$IGRNO,$igrMaster);
if($igrM > 0){
echo "Updated successfully!";
}
else{
echo " Not Updated successfully!";
}
}
function uploadfile()
{
$bill= $this->input->post('param1');
$oldfile = $this->input->post('param2');
$newfile =$this->input->post('file');
$newfile = str_replace(" ","",$newfile);
if(!empty($_FILES['file']['name']))
{
$Picture = $this->add();
}else{
$Picture = $oldfile ;
}
$uploadfile = $this->purchaseorder_model->updatefile($bill,$Picture,$oldfile);
echo "Updated Successfully!";
}
// function addfile($pathname)
// {
// $picture = '';
// if(!empty($_FILES[$pathname]['name']))
// {
// $config['upload_path'] = 'uploads/BillFiles/';
// $config['allowed_types'] = '*';
// $config['file_name'] = $_FILES[$pathname]['name'];
// //Load upload library and initialize configuration
// $this->load->library('upload',$config);
// $this->upload->initialize($config);
// if($this->upload->do_upload($pathname))
// {
// $uploadData = $this->upload->data();
// $picture = $uploadData['file_name'];
// }
// else
// {
// $error = array('error' => $this->upload->display_errors());
// $picture = '';
// }
// }
// else
// {
// $picture = '';
// }
// return $picture ;
// }
//function adfile()
function addfile()
{
$picture = '';
if(!empty($_FILES['file']['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
$config['file_name'] = str_replace(" ","",$_FILES['file']['name']);
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('file'))
{
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
$picture = '';
}
}
else
{
$picture = '';
}
return $picture ;
}
}
?>

View File

@ -93,7 +93,6 @@ class servicepurchaseorder extends BaseController
<td align='left'>".$UOM."</td>
<td align='left'>".$Quantity."</td>
<td align='left'>".$Rate."</td>
<td align='left'>".$Workstatus."</td>
</tr>";
}
@ -233,13 +232,11 @@ class servicepurchaseorder extends BaseController
$DescriptionOfPo = $this->input->post('descofpo');
$PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment');
$POType = $this->input->post('POType');
$BudgetType = $this->input->post('Budget');
$SpcialInstruction = $this->input->post('ScopeOfWork');
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
$POStatus = $this->input->post('txtStatus');
$CreateBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('txtRowCount');
$DeletedRow = $this->input->post('txtDeletedRow');
@ -251,7 +248,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,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions);
$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,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'BudgetType'=>$BudgetType);
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$ServiceTypeOptions);
@ -320,7 +317,6 @@ class servicepurchaseorder extends BaseController
{
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
//echo $LineItemNo;
if(trim($POType) == SERVICE )
{
@ -336,14 +332,22 @@ 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');
//echo $PONO;
$newsup=$this->input->post('newsup');
// $newSupId = split("[ - ]+", $newsup);
$newSupId = preg_split('[-]',$newsup);
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$b4supplier=$this->input->post('b4supplier');
$b4date=$this->input->post('b4podate');
$b4podate = $this->getDateformat($b4date);
$SupplierID = $this->input->post('drpSupplier');
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
$dt = $this->input->post('Deliverydt');
@ -373,6 +377,8 @@ class servicepurchaseorder extends BaseController
$POType = $this->input->post('POType');
$BudgetType = $this->input->post('Budget');
$SpcialInstruction = $this->input->post('ScopeofWork');
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
$POStatus = $this->input->post('txtStatus');
@ -388,16 +394,37 @@ 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,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions);
$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,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'BudgetType'=>$BudgetType);
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
$LineItemStatus = REQITEM_NEW;
if($PODate != $b4podate )
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>'-','UpdateBy'=>$updatedBy,'OldValue'=>$b4podate,'NewValue'=>$PODate,'Entity'=>'PO DateChanged');
$this->purchaseorder_model->insertlogpo($logpo);
}
if(!empty($newSupId[0] ))
{
if($newSupId[0] != $b4supplier)
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>'-','UpdateBy'=>$updatedBy,'OldValue'=>$b4supplier,'NewValue'=>$newsup,'Entity'=>'Supplier Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
}
for ($i = 1; $i <= $RowCount; $i++)
{
$MaterialCode = $this->input->post('materialCode'.$i);
$Quantity = $this->input->post('quantity'.$i);
$b4qty=$this->input->post('b4qty'.$i);
$b4rate=$this->input->post('b4rate'.$i);
$Reqnumber = $this->input->post('Reqnumber'.$i);
$itemRate = $this->input->post('itemRate'.$i);
$Cgst = $this->input->post('Cgst'.$i);
@ -414,6 +441,22 @@ class servicepurchaseorder extends BaseController
$OtherAmt = $this->input->post('OtherAmt'.$i);
$Per = $this->input->post('per'.$i);
$ReqDetails = array('Quantity'=>$Quantity,'UpdatedBy'=>$updatedBy,'UpdatedOn'=>$updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber,$MaterialCode,$ReqDetails);
if($Quantity != $b4qty)
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4qty,'NewValue'=>$Quantity,'Entity'=>'Quantity Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
if($itemRate != $b4rate)
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4rate,'NewValue'=>$itemRate,'Entity'=>'Rate Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
$POLineItem = array();
$LineItemNo = '';
$SkipInsert = "False";
@ -490,9 +533,142 @@ class servicepurchaseorder extends BaseController
}
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO;
}
function pageNotFound()
function uploadfile()
{
$bill= $this->input->post('param1');
$oldfile= $this->input->post('param2');
// $new_file_name =$_FILES['file']['name'];
$new_file_name =$_FILES['file']['name'];
$new_file_name = str_replace(" ","",$new_file_name);
if(!empty($new_file_name))
{
$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
$Picture = $this->add();
}
$uploadfile = $this->purchaseorder_model->updatefile($bill,$Picture,$oldfile);
if($uploadfile > 0){
echo "file updated successfully!";
}
else{
echo "file not updated!";
}
}
function add()
{
$picture = '';
if(!empty($_FILES['file']['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
//$config['file_name'] = $_FILES['file']['name'];
$config['file_name'] = str_replace(" ","",$_FILES['file']['name']);
//print_r($config) ;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('file'))
{
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
$picture = '';
}
}
else
{
$picture = '';
}
return $picture ;
}
/*-----------------------------------*/
function addfileuplod()
{
$pono= $this->input->post('PONO');
$new_file_name =$_FILES['file']['name'];
$new_file_name = str_replace(" ","",$new_file_name);
$files = $this->purchaseorder_model->getfies($pono);
$fcount = 0;
foreach ($files as $value)
{
$lastfile = $value->FilePath;
if($lastfile == $new_file_name)
{
$fcount++;
}
}
$upfile='';
if($fcount == 0)
{
if(!empty($new_file_name))
{
$Picture = $this->adfile();
$filelist =array('PONO'=>$pono,'FilePath'=>$Picture);
$upfile = $this->purchaseorder_model->insertfile($filelist);
}
}
if($upfile > 0){
echo "file updated successfully!";
}
else{
echo " No File Choose or File name already Exist";
}
}
function adfile()
{
$picture = '';
if(!empty($_FILES['file']['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = 'docx|pdf|doc|png|jpg';
// $config['file_name'] = $_FILES['file']['name'];
$config['file_name'] = str_replace(" ","",$_FILES['file']['name']);
//print_r($config);die;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if($this->upload->do_upload('file'))
{
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
$picture = '';
}
}
else
{
$picture = '';
}
return $picture ;
}
function pageNotFound()
{
//$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
$this->global['pageTitle'] = $this->CompanyName.' : Edit Service Purchase order form';
$this->loadViews("404", $this->global, NULL, NULL);

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
<?php
$insuranceStatus = array( array("name"=>"NO","value"=>"0"),array("name"=>"YES","value"=>"1") );
$insuranceStatus = array(
array("name"=>"NO","value"=>"0"),array("name"=>"YES","value"=>"1")
);
$DeliverOption='';
$SupId = '';
$SupName = '';
@ -39,9 +41,11 @@
if(!empty($INRSYMBOL))
{
foreach($INRSYMBOL as $INRS)
{
$INRSYM=$INRS->FontCode2000;
}
}
@ -53,7 +57,6 @@ if(!empty($MaxPODate))
}
}
if(!empty($POMaster))
{
foreach ($POMaster as $Req)
@ -73,7 +76,6 @@ if(!empty($POMaster))
$PONOStatus = $Req->StatusCode;
$PONO = $Req->PONO;
$ServiceDescription = $Req->ServiceDescription;
$WrkStatus=$Req->ServiceWorkStatus;
$StatusName=$Req->StatusName;
$otherPayment = $Req->PaymentOtherDescription;
@ -119,10 +121,10 @@ foreach ($PaymentTerms as $TER)
if(!empty($getlogpodtl ))
{
foreach ($getlogpodtl as $values )
{
foreach ($getlogpodtl as $values )
{
$update=$values->FirstName;
}
}
}
// foreach ($POSTATUS as $PST )
@ -167,52 +169,52 @@ if(!empty($getlogpodtl ))
statusbar: false,
toolbar: false
});
</script>
</script>
<script type="text/javascript">
$('#otherdescription').hide();
var insuranceOpt = '<?php echo $InsuranceOptions; ?>';
$('#otherdescription').hide();
var insuranceOpt = '<?php echo $InsuranceOptions; ?>';
var DelOpt = '<?php echo $DeliverOption; ?>';
var SchName = '<?php echo $DeliverSchedule; ?>';
var DelDt = '<?php echo $Deliverydt; ?>';
var DelDt = '<?php echo $Deliverydt; ?>';
var statuscheck='<?php echo $PONOStatus;?>';
var statuscheck='<?php echo $PONOStatus;?>';
$(document).ready(function () {
if(statuscheck=="<?php echo SPECIAL_PO;?>" )//|| statuscheck=="<?php echo PO_AWAITING_RELEASE;?>" )
{
if(statuscheck=="<?php echo SPECIAL_PO;?>" )//|| statuscheck=="<?php echo PO_AWAITING_RELEASE;?>" )
{
$('#splpodiv').show();
}
else
{
}
else
{
$('#splpodiv').hide();
}
}
var update = '<?php echo json_encode($update)?>';
var update = '<?php echo json_encode($update)?>';
if(update !='null')
{
if(update !='null')
{
$('#editpodiv').show();
}
else
{
}
else
{
$('#editpodiv').hide();
}
}
$('#PoTypeOptions').attr("style", "pointer-events: none;");
if(insuranceOpt=="1"){}
else{
$('#insuranceTxtDiv').hide();
}
$('#PoTypeOptions').attr("style", "pointer-events: none;");
if(insuranceOpt=="1"){}
else{
$('#insuranceTxtDiv').hide();
}
if(DelOpt=="0"){
if(DelOpt=="0"){
$('#Deliverydtdiv').show();
$('#Schedulediv').hide();
$('#Deliverydt').val(DelDt);
@ -222,17 +224,17 @@ $(document).ready(function () {
$('#Schedulediv').show();
$('#Deliverydt').val('');
$('#Scheduleby').val(SchName);
}
var PaymentOther = '<?php echo $otherPayment; ?>';
var PayTerms = '<?php echo $Terms; ?>';
if(PayTerms=='PT08'){
}
var PaymentOther = '<?php echo $otherPayment; ?>';
var PayTerms = '<?php echo $Terms; ?>';
if(PayTerms=='PT08'){
$('#otheroptiondiv').show();
$('#Otherpayment').val(PaymentOther);
}
else{
$('#otheroptiondiv').hide();
}
else{
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
}
});
</script>
<script>
@ -240,9 +242,9 @@ $(document).ready(function () {
var RequistQuantity = '';
var AvilBudAmt = '';
var POMaxDate = '<?php echo $MaxPoDate;?>';
var d = new Date(POMaxDate);
var SelectedMaterialList = {
var POMaxDate = '<?php echo $MaxPoDate;?>';
var d = new Date(POMaxDate);
var SelectedMaterialList = {
Mat: []
};
@ -262,7 +264,6 @@ $("#Deliverydt").datepicker({
maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
}); */
$('#drpSupplier').change(function() {
var cd = $("#drpSupplier option:selected").text();
@ -285,10 +286,7 @@ $('#drpSupplier').change(function() {
$("#SupAddress").val(obj.Address);
PaymentID = obj.PaymentID;
}
});
if(PaymentID!='PT08'){
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
@ -297,7 +295,6 @@ $('#drpSupplier').change(function() {
$('#otheroptiondiv').show();
$('#Otherpayment').val(PaymentOtherData);
}
$.each(Payment, function(pay, payobj) {
if(payobj.PaymentID == PaymentID)
{
@ -306,8 +303,7 @@ $('#drpSupplier').change(function() {
});
$.each(Payment, function(pay, payobj) {
if(payobj.PaymentID == PaymentID)
{}
if(payobj.PaymentID == PaymentID){}
else{
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
}
@ -373,10 +369,10 @@ $('#EditMaterialCode').change(function() {
var id = $('#EditMaterialCode').val();
$("#EditItemName").val('');
$("#EditUOM").val('');
$("#EditQuantity").val('');
//$("#EditRate").val('');
//$("#txtEditBasicValue").val('');
$("#EditUOM").val('');
$("#EditQuantity").val('');
//$("#EditRate").val('');
//$("#txtEditBasicValue").val('');
RequistQuantity = '';
//clearEditTaxField();
if(id != '0')
@ -406,12 +402,12 @@ $('#EditMaterialCode').change(function() {
});
});
function ChangeSgst(){
$('#Sgst').val($('#Cgst').val());
Ratechange();
$('#Sgst').val($('#Cgst').val());
Ratechange();
}
function ChangeEditSgst(){
$('#EditSgst').val($('#EditCgst').val());
EditRatechange();
$('#EditSgst').val($('#EditCgst').val());
EditRatechange();
}
function Ratechange(){
@ -444,7 +440,6 @@ function Ratechange(){
var Tot = txtQuantity * frequencyValue * txtUnitPrice;
$('#txtBasicValue').val(parseFloat(Tot).toFixed(2));
//Service Tax calculation
$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(),$("#Cgst").val()== '' ? "0.00" : $('#Cgst').val()));
$('#AfterSgst').val(calculateSgstTax($('#txtBasicValue').val(),$("#Sgst").val()== '' ? "0.00" : $('#Sgst').val()));
@ -508,10 +503,8 @@ function ExceedQuantityCheck()
}
function EditExceedQuantityCheck()
{
var EnterQuantity = $("#EditQuantity").val()== '' ? "0.00" : parseFloat($("#EditQuantity").val());
var ReqQuantity = parseFloat(RequistQuantity);
//if(EnterQuantity != ReqQuantity)
//{
// swal('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
@ -735,7 +728,7 @@ $(document).ready(function () {
<?php
$data = array('name' => 'PODate','value' => set_value('PODate',$PODate),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true','onkeypress'=>'return false;');
echo form_input($data);
?>
?> <input type="hidden" name="b4podate" id="b4podate" value="<?php echo $PODate;?>">
</div>
</div>
@ -759,12 +752,10 @@ $(document).ready(function () {
echo form_dropdown('drpSupplier', $options,set_value('drpSupplier',$SupId ),'id="drpSupplier"' ,'required="true"' ,'class="form-control select2');
?>
?> <input type="hidden" name="b4supplier" id="b4supplier" value="<?php echo $SupId;?>">
</div>
<input type="hidden" name="b4podate" id="b4podate" value="<?php echo $PODate;?>">
<input type="hidden" name="b4supplier" id="b4supplier" value="<?php echo $SupId;?>">
<input type="hidden" name="newsup" id="changeSup">
</div>
<div class="col-md-12"><br/>
<label>Address</label>
<div class="form-group">
@ -1095,7 +1086,6 @@ $(document).ready(function () {
<option value=<?php echo $opt1;?>><?php echo $opt1;?></option>
<option value=<?php echo $opt2;?>><?php echo $opt2;?></option>
</select>
</div>
</div>
</div><!--End new fields 1 sep-->
@ -1132,7 +1122,7 @@ $(document).ready(function () {
<!-- Modal content-->
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-header" style="background-color:#5d0411;color:#fff;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<center><h4>Add Service Purchase Order Item </h4></center>
</div>
<div align="left">
@ -1425,7 +1415,7 @@ $(document).ready(function () {
<!-- Modal content-->
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-header" style="background-color:#5d0411;color:#fff;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<center><h4>Edit Service Purchase Order Item </h4></center>
</div>
<div align="left">
@ -1714,7 +1704,7 @@ $(document).ready(function () {
<!-- Modal content-->
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-header" style="background-color:#5d0411;color:#fff;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<center><h4>View Service Purchase Order Item </h4></center>
</div>
<div align="left">
@ -1996,7 +1986,6 @@ $(document).ready(function () {
</div>
</div>
<br/>
<div class="box-body" style="margin-top: -2%;">
<table id="ServiceTable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
@ -2078,11 +2067,10 @@ $(document).ready(function () {
<input type="hidden" name="<?php echo 'per'.$index ?>" id="<?php echo 'per'.$index ?>" value="<?php echo $record->Per ; ?>" />
<input 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 'b4qty'.$index ?>" id="<?php echo 'b4qty'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4qty'.$index ?>" id="<?php echo 'b4qty'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input 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 'b4rate'.$index ?>" id="<?php echo 'b4rate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<input type="hidden" name="<?php echo 'Cgst'.$index ?>" id="<?php echo 'Cgst'.$index ?>" value="<?php echo $record->CGST ; ?>" />
@ -2111,6 +2099,7 @@ $(document).ready(function () {
<input type="hidden" name="<?php echo 'OtherServiceDescription'.$index ?>" id="<?php echo 'OtherServiceDescription'.$index ?>" value="<?php echo $record->MaterialDescription ; ?>" />
<?php
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED ||$PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus==PO_APPROVED || $PONOStatus== SPECIAL_PO)
@ -2163,7 +2152,7 @@ $(document).ready(function () {
<div class="col-md-2">
<label>SGST In INR</label>
<label>CGST <?php echo "($INRSYM)"?></label>
<?php
$data = array('name' => 'txtTotSgst','value' => set_value('txtTotSgst',number_format($TotalSgst, 2, '.', '')),'id'=>'txtTotSgst', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
@ -2222,21 +2211,17 @@ $(document).ready(function () {
<div class="col-md-12" id="splpodiv">
<div class="col-md-12"><label>Special po Table List</label>
</br>
<div class="col-md-12">
<div class="col-md-12"><label>Special po Table List</label>
<table id="table2" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<div class="col-md-12">
<!-- <div class="col-md-offset-10 col-md-8" >
<div class="col-md-offset-10 col-md-8" >
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" ADD FILES..">
</div> -->
<!-- <div id="newdiv"></div> -->
<!-- <input type="hidden" name="hidecounter" id="hidecounter" value="0" /> -->
<!-- <input type="hidden" name="hideconstant" id="hideconstant" value="0" /> -->
</div>
<table id="table2" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
</div>
<div id="newdiv"></div>
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
</div>
<thead style="background-color:#ddf">
<tr>
<th>Bill No </th>
@ -2256,8 +2241,7 @@ $(document).ready(function () {
<tr id="lastvalue">
<td><?php echo $gd->BillNo ?></td>
<input type="hidden" id="billnos<?= $row?>" value="<?= $gd->BillNo?>">
<input type="hidden" id="file<?=$row?>" value="<?=$gd->FilePath?>">
<input type="hidden" id="file<?=$row?>" value="<?=$gd->FilePath?>">
<td><?php echo (!empty($gd->FilePath))?$gd->FilePath:"No File"; ?></td>
<td><span onclick="openmodel(<?=$row?>);"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
<?php if(!empty($gd->FilePath)) { ?>
@ -2272,14 +2256,13 @@ $(document).ready(function () {
</tbody>
</table>
</div>
</div>
</div>
<?php if(!empty($update)){?>
<?php if(!empty($update)){?>
<div class="col-md-12" id="editpodiv">
<div class="col-md-12"><label>Editable POScreen</label>
<table id="edittable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<thead style="background-color:#ddf">
<tr>
<th>Sno</th>
@ -2290,7 +2273,6 @@ $(document).ready(function () {
<th>NewValue</th>
<th>UpdatedBy</th>
<th>UpdateOn</th>
</tr>
</thead>
@ -2336,21 +2318,19 @@ $(document).ready(function () {
<?php } else {}?>
</table>
</div>
</div>
</div>
<!-- Service Special PO Modal Starts Here -->
<div id="EditServiceSplPOModel" class="modal fade" data-backdrop-limit="1" role="dialog" aria-labelledby="myModalLabel" >
<div class="modal-dialog">
<div class="modal-content" style="width:950px;">
<div class="modal-header">
<h4 class="modal-title">Update Bill <span id="bill"><span> Details</h4>
<h4 class="modal-title">Update Bill <!-- <?php echo $getdata[0]->BillNo ?> --> <span id="bill"><span> Details</h4>
</div>
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data" >
<div class="modal-body" style="padding:0px;">
<div class="col-md-12">
<div class="col-md-5">
@ -2380,11 +2360,9 @@ $(document).ready(function () {
</div><!-- /.modal content -->
</div><!-- /.modal dialog -->
</div><!-- /#filemodal -->
<!-- Service Special PO Modal Ends Here -->
<!-- Revenue Special PO Modal Ends Here -->
<div class="col-md-12">
<div class="col-md-12">
<div align="right"><br/>
<input type="hidden" name="txtPONO" id="txtPONO" value="<?php echo $PONO; ?>"/>
@ -2431,7 +2409,7 @@ $(document).ready(function () {
</div>
<script type="text/html" id="ServiceList">
<tr id="<%=index%>">
<td align="left"><%=index%></td>
<td align="left"><%=index%></td>
<td align="left"><%=ReqNo%></td>
<td align="left"><%=MaterialCode%></td>
<td align="left"><%=MaterialName%></td>
@ -2441,17 +2419,16 @@ $(document).ready(function () {
<td align="left"><%=BasicAmount%></td>
<td align="left"><%=Taxvalue%></td>
<td align="left"><%=TotalValue%></td>
<td align="left"><%=ActualQuantity%></td>
<td align="left"><%=ReceivedQuantity%></td>
<td align="left"><%=PendingQuantity%></td>
<td><a data-target='#EDITSERVICE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITSERVICE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
</td>
<td align="left"><%=ActualQuantity%></td>
<td align="left"><%=ReceivedQuantity%></td>
<td align="left"><%=PendingQuantity%></td>
<td><a data-target='#EDITSERVICE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITSERVICE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
</tr>
</script>
<script>
var index = <?php echo $index; ?>;
var userid = '';
var index = <?php echo $index; ?>;
var userid = '';
var SelectedMaterialCode = [];
var CollIndex = 0;
var SelectedMaterialList = {
@ -2523,7 +2500,6 @@ $('.AddService').click(function(){
"ReqNo" : Reqnumber,
});
populateValueMainFormForServiceTax();
index = parseInt(index)+1;
@ -2565,19 +2541,18 @@ $('.AddService').click(function(){
});
function openmodel(i){
//swal(i);
var file = $("#file"+i).val();
//swal(file);
var Billno = $("#billnos"+i).val();
//swal(Billno);
$("#EditServiceSplPOModel").modal("show");
$(".oldimage").text(file);
$("#hideoldfile").val(file);
$("#hidebillno").val(Billno);
$("#bill").text(Billno);
}
$('.EditService').click(function(){
$('.EditService').click(function(){
tinyMCE.triggerSave();
if( validateEditServiceTax())
@ -2599,6 +2574,7 @@ $('.EditService').click(function(){
var itemRate = $("#EditRate").val();
var Cgst = $("#EditCgst").val();
var AfterCgst = $("#EditAfterCgst").val();
var Sgst = $("#EditSgst").val();
@ -2612,10 +2588,13 @@ $('.EditService').click(function(){
var OtherAmt = $('#EditOtherAllowances').val();
var TotalOrderValue = $("#EditTotalOrderValue ").val();
var basicval = $("#txtEditBasicValue").val();
var TotalTaxValue = calculateEditTaxValue();
var tr= document.getElementById(userid);
var cellval = tr.cells;
@ -2649,7 +2628,6 @@ $('.EditService').click(function(){
}
});
function addHidden(theForm, key, value) {
// Create a hidden input element, and append it to the form:
var input = document.createElement('input');
@ -2667,14 +2645,17 @@ function populateValueMainFormForServiceTax()
var AfterIgst = $('#AfterIgst').val() == '' ? '0.00' : $('#AfterIgst').val();
var OtherAmt = $('#OtherAllowances').val() == '' ? '0.00' : $('#OtherAllowances').val();
var TotalVal = $('#TotalOrderValue ').val() == '' ? '0.00' : $('#TotalOrderValue').val();
var BasicVal = $('#txtBasicValue').val() == '' ? '0.00' : $('#txtBasicValue').val();
var TotalOrderValueSummary = $('#txtTotalOrderValueSummary').val() == '' ? '0.00' : $('#txtTotalOrderValueSummary').val();
var totBasicAmt = $('#txtTotBasicAmount').val() == '' ? '0.00' : $('#txtTotBasicAmount').val();
var TotalCgst = $('#txtTotCgst').val() == '' ? '0.00' : $('#txtTotCgst').val();
var TotSgst = $('#txtTotSgst').val() == '' ? '0.00' : $('#txtTotSgst').val();
var TotalIgst = $('#txtTotIgst').val() == '' ? '0.00' : $('#txtTotIgst').val();
var TotalAllowance = $('#ToatalOtherAllowances').val() == '' ? '0.00' : $('#ToatalOtherAllowances').val();
$('#txtTotBasicAmount').val((parseFloat(totBasicAmt) + parseFloat(BasicVal)).toFixed(2) );
$('#txtTotCgst').val((parseFloat(TotalCgst) + parseFloat(AfterCgst)).toFixed(2) );
$('#txtTotSgst').val((parseFloat(TotSgst) + parseFloat(AfterSgst)).toFixed(2) );
@ -2695,7 +2676,6 @@ function populateValueMainFormForEditServiceTax()
var TotSummary = 0;
var TotBasicAmout = 0;
var i = 0;
do {
i += 1;
var tr= document.getElementById(i);
@ -2725,7 +2705,7 @@ function populateValueMainFormForEditServiceTax()
}
}while (i < editrow);
} while (i < editrow);
$('#txtTotBasicAmount').val(parseFloat(TotBasicAmout).toFixed(2) );
$('#txtTotCgst').val(parseFloat(TotCgst).toFixed(2) );
@ -2913,7 +2893,6 @@ function populateValueMainFormForDeleteItem(rowid)
var FrequencyValue = $('#FrequencyValue'+rowid).val() == '' ? '1.00' : $('#FrequencyValue'+rowid).val();
var BasicVal = parseFloat(Quantity) * parseFloat(ItemRate) * parseFloat(FrequencyValue);
TotCgst = parseFloat(TotCgst) - parseFloat(AfterCgst);
TotSgst = parseFloat(TotSgst) - parseFloat(AfterSgst);
TotIgst = parseFloat(TotIgst) - parseFloat(AfterIgst);
@ -3056,7 +3035,7 @@ function validateServiceTax()
}
}
//
</script>
<script>
@ -3722,8 +3701,7 @@ $("#addmorebutton").click(function(){
var bill = <?php echo json_encode($getdata)?>;
if(bill.length>=5){
swal("No more files to add");//this allows only 5 files;
swal("You have to upload five files only");//this allows only 5 files;
return false;
}
else{
@ -3769,10 +3747,9 @@ div.innerHTML='<div class="col-md-12">'+
function addRow()
{
var file = $('#images'+counter).val();
var file = $('#images').val();
if (file=='')
if (file == '')
{
swal('File not found');
@ -3790,10 +3767,8 @@ function Copyfilename(id)
var number = id.replace(/[^0-9]+/ig,"");
if(size > 2100000){
swal('Sorry Your File is Large To 2MB');
removeRow(id);
//$('input[name = browseFiles'+number+']').val(' ');
}else {
var name = $('input[name='+id+']')[0].files[0].name;
@ -3801,7 +3776,3 @@ function Copyfilename(id)
}
}
</script>

View File

@ -193,141 +193,10 @@ if(!empty($INRSYMBOL))
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
var SelectedMaterialList = {
Mat: []
};
/* $('#drpSupplier').change(function() {
var id = $('#drpSupplier').val();
$("#SupAddress").val('');
if(id != '0')
{
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
if(obj.SupplierID === id)
{
$("#SupAddress").val(obj.Address);
}
});
}
else
{
swal('Please select the SupplierID');
return false;
}
});
$('#ReqNo').change(function() {
var id = $('#ReqNo').val();
$("#deptName").val('');
$("#CostCenter").empty();
$("#MaterialCode").empty();
resetTaxField();
if(id != '0')
{
var y = <?php echo json_encode($RequistionDetails, JSON_PRETTY_PRINT) ?>;
var cost = <?php echo json_encode($CostList, JSON_PRETTY_PRINT) ?>;
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
// For Binding DepartmentName
$.each(y, function(idx, obj) {
if(obj.ReqNo === id)
{
$("#deptName").val(obj.DepartmentName);
}
});
// For Binding Cost center for the selected department
$("#CostCenter").append( $('<option></option>').val("0").html("Select Cost Center") );
$.each(cost, function(idx, obj) {
if(obj.ReqNo === id)
{
$("#CostCenter").append( $('<option></option>').val(obj.CostCenterCode).html(obj.CostCenterCode + "-" + obj.CostCenterName) );
}
});
// For Binding Material list center for the selected Requistion Number
$("#MaterialCode").append( $('<option></option>').val("0").html("Select Material Code") );
$.each(Material, function(idx, obj) {
if(obj.ReqNo === id)
{
$("#MaterialCode").append( $('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName) );
}
});
}
else
{
swal('Please select the Requisition Number');
return false;
}
});
$('#MaterialCode').change(function() {
var id = $('#MaterialCode').val();
RequistQuantity = '';
resetTaxField();
if(id != '0')
{
var y = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
if(obj.MaterialCode === id)
{
$("#ItemName").val(obj.MaterialName);
$("#UOM").val(obj.UOM);
$("#Quantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
}
});
}
else
{
swal('Please select the MaterialCode');
return false;
}
});
$('#CostCenter').change(function() {
var id = $('#CostCenter').val();
$("#AvlBudAmt").val('');
if(id != '0')
{
var cost = <?php echo json_encode($CostList, JSON_PRETTY_PRINT) ?>;
$.each(cost, function(idx, obj) {
if(obj.CostCenterCode === id)
{
$("#AvlBudAmt").val(obj.BudgetAmount);
}
});
}
else
{
swal('Please select the MaterialCode');
return false;
}
}); */
/* Revenue Tax calcualation */
$('#DiscountType').change(function() {
@ -803,7 +672,7 @@ function calculatePackaging(isEdit)
else if(PackagingType == NilType )
{
AfterPackaging = "0.00";
// $('#txtEditAfterPackaging').val(AfterPackaging);
//RevenueChangeSgst();
}
else
@ -1732,33 +1601,6 @@ function calculatePackaging(isEdit)
}
}
function rfilealert()
{
var file = $('#imag').val();
if (file=='')
{
swal('File not found');
SpecialPOcheck();
}
else{
SpecialPOcheck();
}
}
function sfilealert()
{
var file1 = $('#images1').val();
if (file1=='')
{
swal('File not found');
SpecialPOcheck();
}
else{
SpecialPOcheck();
}
}
function SpecialPOcheck()
@ -1774,18 +1616,15 @@ function SpecialPOcheck()
var row=$('#txtRowCount1').val();
var PO=$('#POType').val();
// if(splrow!=row)
// {
// swal("You havent add all the material details")
// return false;
// }
// else
// {
var file1 = $('#images1'+counterConstants).val()
var file = $('#imag'+counterConstant).val()
if(PO=='REVENUE')
{
var images = $('#images').val();
var images = $('#imag').val();
$('#content').loader('show');
@ -1793,7 +1632,7 @@ function SpecialPOcheck()
{
$('#txtSpecial').val(1);
$('#txtQuality').val(1);
//addtable();
// addtable();
RevenueSave(3);
}
@ -1821,7 +1660,7 @@ function SpecialPOcheck()
Save(2)
}
//}
}
/* Set the Packaging calculation option for calculating Packaging */
@ -1879,30 +1718,6 @@ function SpecialPOcheck()
}
// function ServiceCheck()
// {
// submitoptionvalue = $("input:radio[name='optsubmit']:checked").val();
// //swal(submitoptionvalue);
// $('#submitmodel').modal('hide');
// if(submitoptionvalue==0)
// {
// swal('normal Service emergency');
// $('#txtSpecialservice').val(0);
// Save(1)
// }
// else
// {
// //window.location.href ="<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder";
// $('#filemodel').modal('show');
// }
// }
function qualitycheckoption()
{
qualityoptionvalue = $("input:radio[name='Quality']:checked").val();
@ -2280,21 +2095,12 @@ Editchange();
$('#isEdit').val(0);
if(StateTaxCheck == "0")
{
// style="display:none;"
// $('#Vat').removeAttr("style");
// $('#TotVat').removeAttr("style");
// $('#CST').attr("style","display:none;");
// $('#TotCST').attr("style","display:none;");
$('#Vat').show();
$('#CST').hide();
}
else
{
// $('#CST').removeAttr("style");
// $('#TotCST').removeAttr("style");
// $('#Vat').attr("style","display:none;");
// $('#TotVat').attr("style","display:none;");
$('#Vat').hide();
$('#CST').show();
@ -2442,9 +2248,7 @@ function populateValueMainFormForDeleteItem(rowid)
<div style="border:2px solid #333">
<div id="content"></div>
<div>
<!-- <center><b><h2>Resico Industries - Emergency Purchase Order</h2></b></center> -->
<center><b><h2><?php echo $pageTitle?></h2></b></center>
</div>
<div class="container-fluid">
<div class="row">
@ -3069,17 +2873,11 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
<div class="modal-body" style="padding:0px;">
<div class="col-md-12">
<!-- <div class="col-md-4 pad"><strong>Select Item Code</strong>
<select id="emergencyitemcode" name="emergencyitemcode" class = "form-control select2">
<!-- <option value="1"> select material code</option>
</select>
</div>-->
<div class="col-md-4 pad"><strong>Delivery Challan /Inv No</strong>
<input type="text" name="ChallanInvNo" id="ChallanInvNo" maxlength="12" class="form-control" value="" required onkeypress="return isNumberKey(event)">
</div>
<div class="col-md-4 pad"><strong>Delivery Challan /Inv Date</strong>
<!-- <input type="Date" name="Date1" onkeypress="return onlyAlphabets(event);" maxlength="100" id="Date1" class="form-control" required value="2"> -->
<?php
$data = array('name' => 'Date1','value' => set_value('Date1',$CurrentDate),'id'=>'Date1', 'class' => 'form-control num' ,'required' => 'true');
echo form_input($data);?>
@ -3087,12 +2885,8 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-4 pad"> <strong>Material Received Date</strong>
<?php
$data = array('name' => 'MRC','value' => set_value('MRC',$CurrentDate),'id'=>'MRC', 'class' => 'form-control num' ,'required' => 'true');
echo form_input($data);
?>
echo form_input($data);?>
</div>
<!-- <div class="col-md-4 pad"><strong>Advise Quantity</strong>
<input type="text" name="AQuantity" id="AQuantity" maxlength="12" class="form-control" value="" required>
</div> -->
</div>
<div class="col-md-12">
@ -3122,16 +2916,23 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-12">
<div class="col-md-5">
<input type = "file" size = "20" input accept=".docx,.pdf,.doc.JPG,.PNG" id="imag" name="images" onChange="filecheck();"/>
<label for="images">Select file<br/><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
</div>
<div class="col-md-10">
<!-- <legend>Multiple File</legend> -->
<div class="col-md-offset-10 col-md-1" >
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" + ADD FILES..">
</div>
<div id="newdiv"></div><!-- this div for add more section-->
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
</div>
</div>
</div>
<div class="col-md-12">
<table id="specialtable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
@ -3157,11 +2958,8 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="modal-footer">
<div class="col-md-12 text-right">
<!-- <div class="col-md-4">
<a class="btn btn-primary Add" onclick="addtable();"><span class="bold">Add table</span></a>
</div> -->
<div class="col-md-4 col-md-offset-8">
<a class="btn btn-primary ok" ID="ExciseOption12" onclick="rfilealert();" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-primary ok" ID="ExciseOption12" onclick="rfileswal();" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-primary" data-dismiss="modal" onclick="SetExciseCalculationCancel();" value="Cancel">Cancel</a>
</div>
@ -3187,10 +2985,15 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-12">
<div class="col-md-4">
<input type = "file" size = "20" input accept=".docx,.pdx,.doc.JPG,.PNG" id="images1" name="images1" onChange="sfilecheck();"/>
<label for="images">Select Company file<br/><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
</div>
<div class="col-md-offset-0 col-md-1" >
<input type="button" class="btn btn-primary" id ="addemorebutton" value=" + ADD FILES..">
</div>
<div id="newsdiv"></div><!-- this div for add more section-->
<input type="hidden" name="hidecounters" id="hidecounters" value="0" />
<input type="hidden" name="hideconstants" id="hideconstants" value="0" />
</div>
@ -3204,7 +3007,7 @@ function populateValueMainFormForDeleteItem(rowid)
<div class="col-md-12 text-right">
<div class="col-md-4 col-md-offset-8">
<a class="btn btn-primary ok" ID="ExciseOption12" onclick="sfilealert();" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-primary ok" ID="ExciseOption12" onclick="sfileswal();" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-primary" data-dismiss="modal" onclick="SetExciseCalculationCancel();" value="Cancel">Cancel</a>
</div>
@ -3351,7 +3154,7 @@ function populateValueMainFormForDeleteItem(rowid)
<!-- Modal content-->
<form>
<div class="modal-content" style="width:1000px;">
<div class="modal-header" style="background-color: #3c;color:#fff;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<center><h4>Edit Service Purchase Order Item </h4></center>
</div>
@ -3674,7 +3477,7 @@ function populateValueMainFormForDeleteItem(rowid)
<!-- Modal content-->
<form>
<div class="modal-content" style="width:1150px;">
<div class="modal-header" style="background-color: #3c;color:#fff;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<center><h4>Edit Revenue Purchase Order Line Item </h4></center>
</div>
<div align="left">
@ -7571,34 +7374,6 @@ $('#content').loader('hide');
else
{
//swal('Save fn');
// $('#content').loader('show');
// $.ajax({
// data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextStatus="+TextStatus+"&PaymentMethod="+PaymentMethod+"&workStatus="+workStatus,
// type:"POST",
// url:"<?php echo base_url() ?>emergencypurchaseorder/addNewServicePurchaseOrder",
// success:function(data) {
// if(data)
// {
// $('#content').loader('hide');
// swal(data);
// $('#txtRowCount').val('');
// $('#txtDeletedRow').val('');
// $('#SpcialInstruction').val('');
// $('#txtDeliveryAddress').val('');
// window.location = "purchaseorderListing";
// }
// else
// {
// $('#content').loader('hide');
// swal("Error");
// }
// }
// });
$('#content').loader('show');
$("#CreatealterPO").attr("method", "post");
$("#CreatealterPO").attr("enctype", "multipart/form-data");
@ -7677,45 +7452,8 @@ $('#content').loader('hide');
return false;
}
// else if($('#PoTypeOptions').val()== "0")
// {
// swal('Please Select POType');
// $('#PoTypeOptions').focus();
// return false;
// }
else
{
// $('#content').loader('show');
// $.ajax({
// data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeletedRowCount="+TextDeletedRowCount+"&TextStatus="+TextStatus,
// type:"POST",
// url:"<?php echo base_url() ?>emergencypurchaseorder/addNewRevenuePurchaseOrder",
// success:function(data) {
// if(data)
// {
// $('#content').loader('hide');
// swal(data);
// $('#txtRowCount').val('');
// $('#txtDeletedRow').val('');
// $('#SpcialInstruction').val('');
// $('#txtDeliveryAddress').val('');
// window.location = "purchaseorderListing";
// }
// else
// {
// $('#content').loader('hide');
// swal("Error");
// }
// }
// });
//swal("else");
var tablevalue = $('#specialtable').tableToJSON(); // Convert the table into a javascript object
var jsondata = JSON.stringify(tablevalue);
$('#tablevalues').val(jsondata);
@ -8117,12 +7855,6 @@ $('.EditRevenue').click(function(){
$('#EditRevenueRate').focus();
return false;
}
// else if($('#EditRevenueRate').val() == 0)
// {
// swal('Please Enter the Valid Rate of the Item');
// $('#EditRevenueRate').focus();
// return false;
// }
else
{
return true;
@ -8407,14 +8139,6 @@ $("#PaymentMethod").change(function() {
var z = $('#RevenueAppend tr').length;
var zz = $('#ServiceAppend tr').length;
var options='';
// swal(z);
// var values = array(0,15,30,45);
// var name =array(zero,five,three,four);
// for(var j=1;j<x;j++)
// {
// options += '<option value="' + itemvalue[j] + '">' + itemvalue[j] + '-' + itemname[j] + '</option>';
// }
if( reqType == 'REVENUE')
{
$("#serviceTax tr:gt(0) td:nth-child(3)").each(function(){
@ -8509,18 +8233,11 @@ var specialrow=0;
var VehicleNo1 = $('#VehicleNo').val();
var CourierNo1 = $('#CourierNo').val();
var Quantity123 = $('#AQuantity').val();
var images = $('#images').val();
//var actqty=$('#quantity'+temp);
// console.log(actqty);
var images = $('#imag').val();
if(emergencyitemcode != '' || ChallanInvno != '' || ChallanInvDate != '' || VehicleNo1 != '' ||CourierNo1 != ''|| Quantity123 !='' ||images !='')
{
//swal('hai'+Quantity123+CourierNo1);
//swal('both insert and update operation evaluated');
if(emergencyitemcode == ''){
swal("Please Enter Material Code");
$("#emergencyitemcode").focus();
@ -8567,7 +8284,7 @@ var specialrow=0;
}
else if (images == ''){
swal("Please Upload File to be saved");
$('#images').focus();
$('#imag').focus();
return false;
@ -8582,35 +8299,17 @@ var specialrow=0;
var theForm=$(".CreatealterPO");
addHidden(theForm,"emergencyitemcode"+temp,emergencyitemcode );
addHidden(theForm,"images"+temp,images );
addHidden(theForm,"imag"+temp,images );
// var a=$('#emergencyitemcode'+temp).val();
// var b=$('#images'+temp).val();
//console.log(a);
// console.log(b);
// addHidden(theForm,"VehicleNo"+temp,Reqnumber );
// addHidden(theForm,"CourierNo"+temp,Reqnumber );
// addHidden(theForm,"AQuantity"+temp,Reqnumber );
//$('#emergencyitemcode').val('');
// $('#ChallanInvNo').val('');
// $('#ChallanInvDate').val('');
// $('#VehicleNo').val('');
// $('#CourierNo').val('');
$('#AQuantity').val('');
specialrow++;
$('#splrow').val(specialrow);
// $('input[name="Quality"]').attr('checked', false);
// $('#images').val('');
}//else closed
}//if closed
// var tablevalue = $('#specialtable').tableToJSON(); // Convert the table into a javascript object
// var jsondata = JSON.stringify(tablevalue);
//swal(jsondata);
// $("#tablevalues").val(jsondata);
// $("#tablevalues").val(jsondata);
}//add click function closed
@ -8627,20 +8326,14 @@ var specialservicerow=0;
var description = $('#description').val();
var images12 = $('#images1').val();
console.log(serviceitemcode);
console.log(description);
console.log(images12);
console.log(temp);
//var actqty=$('#quantity'+temp);
//console.log(actqty);
// console.log(serviceitemcode);
// console.log(description);
// console.log(images12);
// console.log(temp);
if(images12 == ''||description == '' || serviceitemcode=='')
{
//swal('hai'+Quantity123+CourierNo1);
//swal('both insert and update operation evaluated');
if(serviceitemcode == ''){
swal("Please Enter Material Code");
$("#serviceitemcode").focus();
@ -8667,64 +8360,201 @@ var specialservicerow=0;
addHidden(theForm,"serviceitemcode"+temp,emergencyitemcode );
addHidden(theForm,"images1"+temp,images );
// specialservicerow++;
// $('#splrow').val(specialrow);
// var a=$('#emergencyitemcode'+temp).val();
// var b=$('#images'+temp).val();
//console.log(a);
// console.log(b);
// addHidden(theForm,"VehicleNo"+temp,Reqnumber );
// addHidden(theForm,"CourierNo"+temp,Reqnumber );
// addHidden(theForm,"AQuantity"+temp,Reqnumber );
//$('#emergencyitemcode').val('');
// $('#ChallanInvNo').val('');
// $('#ChallanInvDate').val('');
// $('#VehicleNo').val('');
// $('#CourierNo').val('');
// $('input[name="Quality"]').attr('checked', false);
// $('#images').val('');
}//else closed
//if closed
// var tablevalue = $('#specialtable').tableToJSON(); // Convert the table into a javascript object
// var jsondata = JSON.stringify(tablevalue);
//swal(jsondata);
// $("#tablevalues").val(jsondata);
// $("#tablevalues").val(jsondata);
}//add click function closed
function filecheck()
{
//$('#content').loader('show');
var file = $('#imag').val();
swal(file);
if(file!='')
{
swal('Your file added successfully');
}
}
function sfilecheck()
{
//$('#content').loader('show');
var file1 = $('#images1').val();
if(file1!='')
{
swal('Your file added successfully');
}
}
</script>
<!-- Multiple file Upload Script -->
<script>
var counter = 0;
var counterConstant = 0;
$("#addmorebutton").click(function(){
//swal('sda');
if(counter>4){
swal("You have to upload five files only");//this allows only 5 files;
return false;
}
else{
counter++;
counterConstant++;
var div = document.createElement('div');
div.id = "divid"+counterConstant;
div.className="row";
div.innerHTML='<div class="col-md-15">'+
// '<div class="col-md-3">'+
// '<label>File Name</label>'+
// '<input type="text" id="maint_filename'+counterConstant+'" name="filename'+counterConstant+'" class="form-control" onkeypress="return false;" readonly/>'+
// '</div>'+
'<div class="col-md-4">'+
'<label><br></label>'+
'<input type="file" name="browseFiles'+counterConstant+'" id="imag" onchange="Copyfilename(this.name); "><br>'+
'</div>'+
'<div class="col-md-3">'+
'<label><br><br></label>'+
'<button class="btn btn-danger remove remove_this" id="removebtn'+counterConstant+'" onclick="removeRow(this.id)"><i class="fa fa-trash"></i> Remove</button></div>'+
'</div>'+
'</div>';
$('#newdiv').append(div);
$('#hidecounter').val(counter);
$('#hideconstant').val(counterConstant);
}
});
function rfileswal()
{
//var file = $('#imag').val();
var file = $('#imag'+counterConstant).val();
if (file=='')
{
swal('File not found');
SpecialPOcheck();
// addtable();
}
else{
SpecialPOcheck();
// addtable();
}
}
function Copyfilename(id)
{
var size = $('input[name='+id+']')[0].files[0].size;
var number = id.replace(/[^0-9]+/ig,"");
if(size > 2100000){
//swal(id);
swal('Sorry Your File is Large To 2MB');
removeRow(id);
//$('input[name = browseFiles'+number+']').val(' ');
}else {
var name = $('input[name='+id+']')[0].files[0].name;
//swal(name);
$("#maint_filename"+number).val(name);
}
}
function removeRow(input) {
var number = input.replace(/[^0-9]+/ig,"");
if(counter >= 1){
counter--;
$("#divid"+number).remove();
$('#hidecounter').val(counter);
}
}
var counters = 0;
var counterConstants = 0;
$("#addemorebutton").click(function(){
//swal('sda');
if(counters>4){
swal("You have to upload five files only");//this allows only 5 files;
return false;
}
else{
counters++;
counterConstants++;
var div = document.createElement('div');
div.id = "divid"+counterConstants;
div.className="row";
div.innerHTML='<div class="col-md-12">'+
'<div class="col-md-4">'+
'<label><br></label>'+
'<input type="file" id="images1" name="browseFiles'+counterConstants+'" onchange="Copyfilenames(this.name);"><br>'+
'</div>'+
'<div class="col-md-3">'+
'<label><br><br></label>'+
'<button class="btn btn-danger remove remove_this" id="removebtn'+counterConstants+'" onclick="removeRows(this.id)"><i class="fa fa-trash"></i> Remove</button></div>'+
'</div>'+
'</div>';
$('#newsdiv').append(div);
$('#hidecounters').val(counters);
$('#hideconstants').val(counterConstants);
}
});
function sfileswal()
{
var file1 = $('#images1'+counterConstants).val();
if (file1=='')
{
swal('File not found');
SpecialPOcheck();
}
else{
SpecialPOcheck();
}
}
function Copyfilenames(id)
{
var size = $('input[name='+id+']')[0].files[0].size;
var number = id.replace(/[^0-9]+/ig,"");
if(size > 2100000){
//swal(id);
swal('Sorry Your File is Large To 2MB');
removeRows(id);
//$('input[name = browseFiles'+number+']').val(' ');
}else {
var name = $('input[name='+id+']')[0].files[0].name;
}
}
function removeRows(input) {
var number = input.replace(/[^0-9]+/ig,"");
if(counters>= 1){
counters --;
$("#divid"+number).remove();
$('#hidecounters').val(counters);
}
}
</script>

View File

@ -471,12 +471,8 @@ $("#PaymentMethod").select2();
<div style="border:2px solid #333">
<div class="col-md-12">
<!-- <center><b><h2>Resico Industries - Edit Capital Purchase Order- <?php echo $PONO;?></h2></b></center> -->
<center><b><h2><?php echo $pageTitle . '-' . $PONO;?></h2></b></center>
<!-- <div class="col-md-1"><br/>
<a class="btn btn-primary" href="<?php echo base_url(); ?>purchaseorder/CreatecapitalPOPrint" target="_blank">Print</a>
</div> -->
</div>
<div class="container-fluid">
<div class="row">
@ -3803,8 +3799,7 @@ $("#PaymentMethod").select2();
<!--################################################################## -->
<?php if(!empty($update)){?>
<?php if(!empty($update)){?>
<div class="col-md-12" id="editpodiv">
<div class="col-md-12"><label>Editable POScreen</label>
<table id="edittable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
@ -3812,8 +3807,6 @@ $("#PaymentMethod").select2();
<tr>
<th>Sno</th>
<th>PONO</th>
<!-- <th>Material</th> -->
<!-- <th>Date</th> -->
<th>LineItemNo</th>
<th>Entity</th>
<th>OldValue</th>
@ -3829,7 +3822,7 @@ $("#PaymentMethod").select2();
<?php
if(!empty($getlogpodtl))
{
//print_r($getlogpodtl); die;
$inde = 0;
foreach($getlogpodtl as $oldpo)
{
@ -3842,14 +3835,14 @@ $("#PaymentMethod").select2();
<td><?php echo $oldpo->LineItemNo;?></td>
<td><?php echo $oldpo->Entity?></td>
<?php if($oldpo->entity =='PO DateChanged'){
<?php if($oldpo->Entity =='PO DateChanged'){
$oldValue = date('d-m-Y',strtotime($oldpo->OldValue));
}else{
$oldValue = $oldpo->OldValue;
}?>
<td><?php if(!empty($oldpo->SupplierName)){echo $oldValue.'-'.$oldpo->SupplierName;}else{echo $oldValue;} ?></td>
<?php if($oldpo->entity =='PO DateChanged'){
<?php if($oldpo->Entity =='PO DateChanged'){
$newValue = date('d-m-Y',strtotime($oldpo->NewValue));
}else{
$newValue = $oldpo->NewValue;

View File

@ -103,28 +103,19 @@ $otherPayment = $Req->PaymentOtherDescription;
$insurencestatus = $Req->InsuranceStatus;
$insurenceno = $Req->InsuranceNumber;
$BudgetType = $Req->BudgetType;
$IGRNO = $Req->IGRNO;
}
}
//echo $BudgetType;
if(!empty($RequistionDetails))
{
foreach ($RequistionDetails as $ReqDet)
{
$Reqonn=new DateTime($ReqDet->ReqDate);
$Reqon=$Reqonn->format('d-m-Y');
// $Pdt = new DateTime($Req->PODate);
// $PODate = $Pdt->format('Y-m-d');
$Requestedby=$ReqDet->Requestedby;
$RequesterName=$ReqDet->FirstName;
//$Status=$ReqDet->Status;
}
}
// foreach ($POSTATUS as $PST )
// {
// $POStatus=$PST->StatusName;
// }
if(!empty($getlogpodtl ))
{
foreach ($getlogpodtl as $values )
@ -135,7 +126,7 @@ $update=$values->FirstName;
?>
<style>
#packagingcalmodel {
#packagingcalmodel {
margin-top:200px;
z-index: 1080 !important;
}
@ -200,37 +191,17 @@ var DelDt = '<?php echo $Deliverydt; ?>';
var insurancestatus = '<?php echo $insurencestatus;?>';
var budgettype='<?php echo $BudgetType;?>';
// if(budgettype == 'CAPITAL')
// {
// document.getElementById('BudgetType').text = 2;
// document.getElementById('BudgetType').value = 'player';
// $('[name=BudgetType]').val(budgettype);
//}
//else
//{
//document.getElementById('BudgetType').text = 1;
// document.getElementById('BudgetType').value = 'player';
//}
var insuranceno = '<?php echo $insurenceno;?>';
var statuscheck='<?php echo $PONOStatus;?>';
$(document).ready(function () {
if(statuscheck=="<?php echo SPECIAL_PO;?>")
{
$('#splpodiv').show();
// var js_array =<?php echo json_encode($billfile);?>;
// if(js_array.length === 0) {
// $('#table3').hide();
// }
}
else
{
$('#splpodiv').hide();
}
/*****************************/
var update = '<?php echo json_encode($update)?>';
if(update !='null')
{
@ -2210,8 +2181,7 @@ return tot;
<div style="border:2px solid #333">
<div id="content"></div>
<div>
<!-- <center><b><h2>Resico Industries - Edit Revenue Purchase Order - <?php echo $PONO;?></h2></b></center></div> -->
<center><b><h2><?php echo $pageTitle . '-' . $PONO;?></h2></b></center>
<center><b><h2><?php echo $pageTitle . '-' . $PONO;?></h2></b></center></div>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
@ -4019,27 +3989,7 @@ return tot;
<div class="col-md-12" id="splpodiv">
<div class="col-md-12"><label>Special po Table List</label>
<table id="table2" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" > <div class="col-md-12">
<div class="col-md-offset-10 col-md-8" >
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" ADD FILES..">
</div>
<div id="newdiv"></div>
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
</div>
<table id="table2" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<thead style="background-color:#ddf">
<tr>
<!-- <th>Bill No </th> -->
@ -4096,6 +4046,17 @@ return tot;
<div class="col-md-12"><!-- <label>Special po Table List</label> -->
<table id="table3" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<div class="col-md-12">
<div class="col-md-offset-10 col-md-8" >
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" ADD FILES..">
</div>
<div id="newdiv"></div>
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
<input type ="hidden" name ="hiddenIGRNO" id="hiddenIGRNO" value ="<?php echo $IGRNO;?>" />
</div>
<thead style="background-color:#ddf">
<tr>
<th>Bill No </th>
@ -4118,7 +4079,7 @@ return tot;
<td><?php echo $gd->BillNo ?></td>
<td ><?php echo (!empty($gd->FilePath))?$gd->FilePath:"No File"; ?></td>
<input type="hidden" id="hiddenigrno" value="<?= $gd->IGRNO?>">
<!-- <input type="hidden" id="hiddenigrno" value="<?php $gd->IGRNO?>"> -->
<input type="hidden" id="billnos<?=$index?>" value="<?= $gd->BillNo?>">
<input type="hidden" id="file<?=$index?>" name ='file' value="<?=$gd->FilePath?>">
@ -4191,7 +4152,7 @@ return tot;
$oldValue = $oldpo->OldValue;
}?>
<td><?php if(!empty($oldpo->SupplierName)){echo $oldValue.'-'.$oldpo->SupplierName;}else{echo $oldValue;} ?></td>
<?php if($oldpo->entity =='PO DateChanged'){
<?php if($oldpo->Entity =='PO DateChanged'){
$newValue = date('d-m-Y',strtotime($oldpo->NewValue));
}else{
$newValue = $oldpo->NewValue;
@ -4623,8 +4584,8 @@ return tot;
$('#RevenueSgst'+userid).val(0);
}
$('#RevenueAfterCgst'+userid).val(AfterCgst);
//$('#RevenueAfterSgst'+userid).val(AfterSgst);
//$('#RevenueSgst'+userid).val(Sgst);
$('#RevenueAfterSgst'+userid).val(AfterSgst);
$('#RevenueSgst'+userid).val(Sgst);
$('#RevenueIgst'+userid).val(Igst);
$('#RevenueAfterIgst'+userid).val(AfterIgst);
$('#FreightType'+userid).val(FreightType);
@ -5704,7 +5665,7 @@ return tot;
var PONO =$('#txtPONO').val();
var igr =$('#hiddenigrno').val();
var igr =$('#hiddenIGRNO').val();
formData.append('file',file);
formData.append('PONO',PONO);
@ -5763,10 +5724,9 @@ return tot;
var bill = <?php echo json_encode($billfile)?>;
if(bill.length>=5){
swal("No more files to add");//this allows only 5 files;
swal("You have to upload five files only");//this allows only 5 files;
return false;
}
else{
@ -5815,7 +5775,8 @@ else{
//var file = $('#imag').val();
var file = $('#images').val();
if (file=='')
if (file == '')
{
swal('File not found');

View File

@ -63,10 +63,6 @@ if(!empty($INRSYMBOL))
$INR=$INR->FontCode2000;
}
}
//echo $INR;
//echo "$CompanyAddress";
//$Exchangerate=$ExchangeRate;
$index = 0;
$SupId = '';
@ -364,13 +360,7 @@ else
<div style="border:2px solid #333">
<div class="col-md-12">
<div class="col-md-11">
<?php if ($parentPO == '') { ?>
<!-- <center><b><h2>Resico Industries - Edit Import Purchase Order-<?php echo $PONO?></h2></b></center> -->
<center><b><h2><?php echo $pageTitle . '-' . $PONO;?></h2></b></center>
<?php } else {?>
<!-- <center><b><h2>Resico Industries - Amended Purchase Order-<?php echo $PONO?></h2></b></center> -->
<center><b><h2><?php echo $pageTitle . '-' . $PONO;?></h2></b></center>
<?php } ?>
</div>
<!--<div class="col-md-1"><br/>
<a class="btn btn-primary" href="<?php echo base_url(); ?>purchaseorder/CreateimportPOPrint" target="_blank">Print</a>
@ -3110,7 +3100,7 @@ echo form_textarea($data);
}?>
<td><?php if(!empty($oldpo->SupplierName)){echo $oldValue.'-'.$oldpo->SupplierName;}else{echo $oldValue;} ?></td>
<?php if($oldpo->entity =='PO DateChanged'){
<?php if($oldpo->Entity =='PO DateChanged'){
$newValue = date('d-m-Y',strtotime($oldpo->NewValue));
}else{
$newValue = $oldpo->NewValue;

View File

@ -346,7 +346,7 @@ if(!empty($ReqPOType))
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Edit Line Item </h4></center>
</div>

View File

@ -38,27 +38,20 @@ if(!empty($INRSYMBOL))
}
}
//echo "$INRSYM";
?>
<style>
#packagingcalmodel {
#packagingcalmodel {
margin-top:200px;
z-index: 1080 !important;
}
#freightcalmodel {
#freightcalmodel {
margin-top:200px;
z-index: 1080 !important;
}
#ExciseDutyCalModel {
#ExciseDutyCalModel {
margin-top:200px;
z-index: 1080 !important;
}
@ -75,7 +68,7 @@ if(!empty($INRSYMBOL))
padding-right:30% ! important;
}
</style>
</style>
<!-- Rich text -->
<script src="<?php echo base_url()?>assets/tinymce/js/tinymce/tinymce.min.js"></script>
@ -122,7 +115,7 @@ if(!empty($INRSYMBOL))
function openModal()
function openModal()
{
if(vaildateBeforeOpenModal())
{
@ -173,8 +166,7 @@ function vaildateBeforeOpenModal()
$('#Deliverydate').focus();
return false;
}
else if($('#PoTypeOptions').val()==0)
else if($('#PoTypeOptions').val()=="0")
{
swal('Please Select POType');
$('#PoTypeOptions').focus();
@ -185,9 +177,7 @@ function vaildateBeforeOpenModal()
swal('Please Select Budget Type');
$('#BudgetType').focus();
return false;
}
else
{
return true;
@ -219,16 +209,14 @@ $(function()
minDate : d,
maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
});
$("#Deliverydt").datepicker({
minDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
});
$('#PoTypeOptions').change(function()
{
$('#PoTypeOptions').change(function()
{
var potypeval=$('#PoTypeOptions').val();
var poopt= <?php echo json_encode($PoTypeOptions, JSON_PRETTY_PRINT) ?>;
var config=poopt[0].ConfigValue;
@ -251,12 +239,7 @@ $('#PoTypeOptions').change(function()
$.each(Payment,function(idx,obj)
{
if(obj.PaymentID=='PT05')
{
}
if(obj.PaymentID=='PT05'){}
else
{
$("#PaymentTerms").append( $('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
@ -267,9 +250,6 @@ $('#PoTypeOptions').change(function()
}
});
$('#drpSupplier').change(function() {
var id = $('#drpSupplier').val();
@ -621,77 +601,6 @@ $('#EditPackagingType').change(function() {
});
//for freight type//
// $('#drpFreight').change(function() {
// if($('#Rate').val() != '' && $('#MaterialCode').val() != "0" )
// {
// swal();
// $('#txtFreight').val('');
// $('#txtAfterFreight').val('');
// selValue = $("#drpFreight").val() ;
// if(selValue == PercentageType)
// {
// var PackagingCalculation = '';
// $('#freightcalmodel').modal('show');
// //$('#freightcalmodel').modal('blur');
// $('#txtFreight').removeAttr( 'readonly','true' );
// }
// else
// {
// if (selValue == NilType)
// {
// $('#txtFreight').attr('readonly', 'true');
// $('#txtFreight').val('0.00');
// }
// else
// {
// $('#txtFreight').removeAttr( 'readonly','true' );
// }
// }
// }
// else
// {
// swal('Please Select MaterialCode and Rate Field Value');
// $('#drpFreight').val("0");
// $('#Rate').focus();
// }
// calculateFreight(0);
//});
//for edit freight type//
// $('#drpEditFreight').change(function() {
// $('#txtEditFreight').val('');
// $('#txtEditAfterFreight').val('');
// selValue = $("#drpEditFreight").val() ;
// if(selValue == PercentageType)
// {
// var PackagingCalculation = '';
// // $('#freight').modal('show');
// $('#freightcalmodel').modal('show');
// $('#txtEditFreight').removeAttr( 'readonly','true' );
// }
// else
// {
// if (selValue == NilType)
// {
// $('#txtEditFreight').attr('readonly', 'true');
// $('#txtEditFreight').val('0.00');
// }
// else
// {
// $('#txtEditFreight').removeAttr( 'readonly','true' );
// }
// }
// //calculatePackaging(1);
// });
$('#txtExciseDuty').change(function() {
if($('#Rate').val() != '' && $('#MaterialCode').val() != "0" )
@ -2129,22 +2038,11 @@ return true;
function validateEditExceedLimit()
{
//swal(" Edit Budget Check");
var avalbudAmt = parseFloat($('#EditAvlBudAmt').val());
var basicAmountRate = parseFloat($('#txtEditBasicValue').val());
//swal(basicAmountRate);
// var totalAmount = parseFloat($('#txtEditTotalOrderValue').val());
// if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt)
// {
// swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
// $('#EditRate').focus();
// return false;
// }
// else
// {
return true;
// }
}
function calculateEditTotalValue()
@ -2224,13 +2122,11 @@ function calculateEditTaxValue()
<div style="border:2px solid #333">
<div id="content"></div>
<div>
<!-- <center><b><h2>Resico Industries - Revenue Purchase Order</h2></b></center></div> -->
<center><b><h2><?php echo $pageTitle .' (Revenue)'; ?></h2></b></center></div>
<div class="col-md-12 text-right" style="padding-bottom:6px; padding-right:29px;">
<a href="<?php echo base_url() ?>CreatePO" class="btn btn-primary" id="back" value="Back">Back</a>
</div>
<div class="container-fluid">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
@ -2292,7 +2188,7 @@ function calculateEditTaxValue()
</div>
<div class="col-md-2" style="padding: 0px;">
<div id="div1" style="display:block;font-size:11px;">
<div id="div1" style="display:block;">
<b><u>Select Tax Range</u></b><br/>
<tr>
<td>
@ -2441,7 +2337,6 @@ function calculateEditTaxValue()
<div class="col-md-6" style="padding: 0px;">
<label>Revenue Type Options</label>
<!-- <label>Revenue Options<span class="badge" style="color:red;text-align:right;background-color: #fff;">*</span></label> -->
<div class="form-group">
<?php
@ -2524,7 +2419,7 @@ function calculateEditTaxValue()
</div>
<div class="col-md-2" style="padding-right: 0px;">
<div class="col-md-2" style="padding-right: 0px;">
<label for="BudgetType">Budget Type</label>
<?php
@ -3660,9 +3555,9 @@ $("#insurance").change(function(){
});
$("#BudgetType").change(function(){
var aa = $("#BudgetType option:selected").text();
var aa = $("#BudgetType option:selected").text();
$('#Budget').val(aa);
$('#Budget').val(aa);
});
@ -4184,7 +4079,6 @@ function validateEditRevenueTax()
function DeleteRow(rowid)
{
var DelRows = $('#txtDeletedRow').val();
//alertMaterialListrowid);
var answer = confirm(" Do you want to delete the Item from the List?")
if (answer)
@ -4300,11 +4194,6 @@ var AvlBudAmt = '<?php echo $AvlAmount ?>';
$('#Deliverydt').focus();
return false;
}
// else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) {
// swal('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
swal('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
@ -4315,19 +4204,14 @@ var AvlBudAmt = '<?php echo $AvlAmount ?>';
$('#insurance').focus();
return false;
}
else if($('#PoTypeOptions').val()=="0")
{
alert('Please Select POType');
swal('Please Select POType');
$('#PoTypeOptions').focus();
return false;
}
else
{
$('#content').loader('show');
$.ajax({
data:$('.CreatePO').serialize(),
@ -4337,7 +4221,7 @@ var AvlBudAmt = '<?php echo $AvlAmount ?>';
if(data)
{
$('#content').loader('hide');
alert(data);
swal(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
//$('#SpcialInstruction').val('');
@ -4347,7 +4231,7 @@ var AvlBudAmt = '<?php echo $AvlAmount ?>';
}
else
{
alert("Error");
swal("Error");
}
}
@ -4430,7 +4314,6 @@ function change(){
$('#AfterCgst').val(calculateCgstTax($('#txtBasicValue').val(),$('#Cgst').val(),$('#txtAfterDiscount').val ()== '' ? '0.00' : $('#txtAfterDiscount').val(),$('#txtAfterPackaging').val() == '' ? '0.00' :$('#txtAfterPackaging').val(),$('#txtAfterFreight').val() == '' ? '0.00' :$('#txtAfterFreight').val()));
}
//alert($('#Cgst').val());
if($("#Sgst").val()!=''){
$('#AfterSgst').val(calculateCgstTax($('#txtBasicValue').val(),$('#Sgst').val(),$('#txtAfterDiscount').val ()== '' ? '0.00' : $('#txtAfterDiscount').val(),$('#txtAfterPackaging').val() == '' ? '0.00' :$('#txtAfterPackaging').val(),$('#txtAfterFreight').val() == '' ? '0.00' :$('#txtAfterFreight').val()));
@ -4471,18 +4354,16 @@ function calculateTotalValue()
function calculateCgstTax(varBasicValue,Cgst,discount,pack,freight)
{
//alert('hai');
var discount = discount;
var packaging = pack;
var freight = freight;
var packfreight =parseFloat(packaging)+parseFloat(freight);
// alert( packfreight);
var basicValue1 = parseFloat(varBasicValue-discount);
// alert("basicValue1:"+basicValue1);
var basicValue =parseFloat(basicValue1+packfreight);
var Cgst = parseFloat(Cgst);
// alert("Cgst:"+Cgst);
// alert ("basicValue:"+basicValue);
var ServiceTaxValue = 0.0;
@ -4499,7 +4380,7 @@ function calculateTotalValue()
var packaging = pack;
var freight = freight;
var packfreight =parseFloat(packaging)+parseFloat(freight);
// alert( packfreight);
var basicValue1 = parseFloat(varBasicValue-discount);
var basicValue =parseFloat(basicValue1+packfreight)
var Sgst = parseFloat(Sgst);
@ -4515,19 +4396,19 @@ function calculateTotalValue()
function calculateIgstTax(varBasicValue,Igst,discount,pack1,freight1)
{
var discount = discount;
// alert(discount);
var packaging=parseFloat(pack1);
//alert(packaging);
var freight=parseFloat(freight1);
//alert(freight);
var packfreight=parseFloat(packaging)+parseFloat(freight);
//alert(packfreight);
var basicValue1 = parseFloat(varBasicValue-discount);
// alert(basicValue1);
var basicValue =parseFloat(basicValue1+packfreight)
// alert(basicValue);
var Igst = parseFloat(Igst);
//alert(Igst);
var ServiceTaxValue = 0.0;
ServiceTaxValue = <?php echo SERVICETAX_IGST; ?>;
@ -4554,7 +4435,7 @@ function calculateTotalValue()
var totvalue = parseFloat(AfterCgst)+ parseFloat(AfterSgst) + parseFloat(AfterIgst) ;
var tot = parseFloat(totvalue).toFixed(2);
//alert('tot:'+tot);
return tot;
}
@ -4592,6 +4473,3 @@ location.reload();
}
</script>

View File

@ -289,7 +289,7 @@ if(!empty($Emp))
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Edit Line Item </h4></center>
</div>