code merged upload option in spl po

This commit is contained in:
venbatechnologies@gmail.com 2018-06-22 17:03:51 +05:30
parent 34cbd1536c
commit 291b612779
2 changed files with 239 additions and 318 deletions

View File

@ -42,20 +42,14 @@ 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'] = $this->CompanyName.' : Create Purchase Order from Requistion';
$this->global['pageTitle'] = $this->CompanyName.' : Create PO from Requisition List';
$this->loadViews("createPOfromRequistion", $this->global, $data,Null);
}
/**
* To create new emergency po
*/
function CreateEmergencyPO()
{
$RequestedBy = $this->session->userdata ('EmpID');
//$this->global['pageTitle'] = 'Resico : Create Emergency Purchase Order';
$this->global['pageTitle'] = $this->CompanyName.' : Emergency Purchase Order';
$this->global['pageTitle'] = $this->CompanyName.' : Create Emergency Purchase Order';
$data['RequestType'] = $this->requistion_model->getConfigValue('C004');
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
$data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR');
@ -69,24 +63,23 @@ 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);
}
/**
* For get all material code using request type
* To used for get all material code using request type
*/
function getMaterialCode(){
$reqType = $this->input->post('input');
$materialList = $this->requistion_model->GetMaterialCode($reqType);
echo json_encode($materialList);
}
/**
* For get cost center list using department code
*/
/*This function is used for get cost center list using department code*/
function getCostCenterName(){
$CostList='';
$DeptCode = $this->input->post('id');
@ -95,9 +88,6 @@ class emergencypurchaseorder extends BaseController
}
/**
* To add file for inward po
*/
function addfile($pathname)
{
@ -113,7 +103,6 @@ class emergencypurchaseorder extends BaseController
$this->upload->initialize($config);
if($this->upload->do_upload($pathname))
{
// echo "uploadif";
$uploadData = $this->upload->data();
$picture = $uploadData['file_name'];
}
@ -132,41 +121,6 @@ class emergencypurchaseorder extends BaseController
}
/*----------------------------------special po file upload service----------------------------------*/
function add($pathname)
{
$picture = '';
if(!empty($_FILES[$pathname]['name']))
{
$config['upload_path'] = 'uploads/BillFiles/';
$config['allowed_types'] = '*';
$config['file_name'] = str_replace(" ","",$_FILES[$pathname]['name']);
$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 ;
}
/**
* To Create Service Purchase Order
*/
function addNewServicePurchaseOrder()
{
$txtRowCount=$this->input->post('txtRowCount');
@ -330,14 +284,12 @@ class emergencypurchaseorder extends BaseController
{
if($value == $files)
{
$fcount++;
}
}
if($fcount == 0)
{
$Picture = $this->add($pathname);
$Picture = $this->addfile($pathname);
$arr[] = array($Picture);
}
@ -378,9 +330,6 @@ class emergencypurchaseorder extends BaseController
}
}
/**
* To Create Revenue Emergency Purchase Order
**/
function addNewRevenuePurchaseOrder()
{
$txtspl=$this->input->post('txtSpecial');
@ -406,7 +355,6 @@ 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{
@ -452,7 +400,6 @@ class emergencypurchaseorder extends BaseController
{
$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);
@ -656,8 +603,6 @@ 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)
{
@ -666,11 +611,6 @@ class emergencypurchaseorder extends BaseController
}
$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)
@ -779,20 +719,13 @@ $prefile =array();
$returns = $this->paginationCompress ( "purchaseorderListing/", $count, 5 );
$this->purchaseorder_model->UpdateRequistionStatus();
$data['POData'] = $this->purchaseorder_model->purchaseorderListing();
//$this->global['pageTitle'] = 'Resico : Purchase Orders';
$this->global['pageTitle'] = $this->CompanyName.' : Purchase Orders Details';
$this->global['pageTitle'] = $this->CompanyName.' : Purchase Orders';
$this->loadViews("POlist", $this->global, $data, NULL);
}
/**
*Validation for dropdown
*/
function Req_validate($selectValue)
{
if(strlen($selectValue) == 0)
{
$this->form_validation->set_message('Req_validate', 'Please Select Requisition Number to Create PO.');
@ -823,7 +756,6 @@ $prefile =array();
else
{
//$this->global['pageTitle'] = 'Resico : Purchase order form';
$this->global['pageTitle'] = $this->CompanyName.' : Purchase order form';
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
@ -845,13 +777,12 @@ $prefile =array();
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$Year = $dt->format('Y');
$data['CostList'] = $this->purchaseorder_model->getCostCenterbyRequist('',$Year,$ReqType);
$data['MaterialList'] = $result;
$data['MaterialList'] = $result; //$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray);
$data['RequistionDetails'] = $this->purchaseorder_model->getRequistDetails($ReqArray);
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
$ViewName = '';
if($ReqType == REVENUE)
{
$ViewName = 'Purchaseorder';
@ -860,7 +791,6 @@ $prefile =array();
{
$ViewName = 'servicePurchaseorder';
}
$this->loadViews($ViewName, $this->global,$data, NULL);
}
}
@ -881,9 +811,7 @@ $prefile =array();
}
}
/**
* To View/Update Emergency Purchase Order
**/
function EditPurchaseOrder()
{
$PONO = $_GET['PONO'];
@ -920,9 +848,8 @@ $prefile =array();
}
}
/**
* To get the Material value based on the MaterialCode
**/
// To get the Material value based on the MaterialCode
function getDetailsforReq()
{
$SearchFilter= $this->input->post('id');
@ -961,9 +888,7 @@ $prefile =array();
die(json_encode(array('MatDetail' =>$HTML1,'Cost'=> $HTML)));
}
/**
* This method to get the status based on the Department selection in th
/* This method to get the status based on the Department selection in th
*/
function getStatusByDepartment()
{
@ -984,9 +909,7 @@ $prefile =array();
die(json_encode(array('depStaus' => $HTML)));
}
/**
* To get the available Budget Amount
**/
// To get the available Budget Amount
function AvilBudgetAmount()
{
$SearchFilter= $this->input->post('id');
@ -1008,25 +931,23 @@ $prefile =array();
}
/**
* To Convert the dateformat (date with time) and stored into DB
*/
function getDateformat($Val)
{
$date = new DateTime($Val,new DateTimeZone('Asia/Kolkata'));
$retDate = $date->format('Y-m-d H:i:s');
return $retDate;
}
/* Method to get the Requistion list based on the search filter*/
/**
* Method to get the Requistion list based on the search filter
**/
function SearchListofRequistion()
{
$SearchFilter= $this->input->post('id');
$DEPCode = $SearchFilter[0];
$Status = $SearchFilter[1];
$rng = $SearchFilter[2];
$FromDate ='';
$ToDate = '';
@ -1039,8 +960,10 @@ $prefile =array();
$FromDate = $this->getDateformat($FDate);
$ToDate = $this->getDateformat($TDate);
}
$result = $this->purchaseorder_model->getRequistionListbySearch($DEPCode,$Status,$FromDate,$ToDate);
$HTML="";
for ($i = 0; $i < count($result); $i++)
{
@ -1068,9 +991,6 @@ $prefile =array();
}
/**
* To View the request details
**/
function ListPORequistion()
{
$ReqNo= $this->input->post('id');
@ -1110,9 +1030,7 @@ $prefile =array();
die(json_encode(array('Items' =>$HTML,'Requist'=>$ReqList,'Cost'=>$CostCenter)));
}
/**
* To Create Revenue Purchase Order
**/
function addNewPurchaseOrder()
{
$POdt =$this->input->post('PODate');
@ -1224,6 +1142,7 @@ $prefile =array();
echo 'Purchase Order Created Successfully! PO Number Is: '.$PONO ;
}
/**
* This used to Edit the Revenue Purchase Order
**/
@ -1236,7 +1155,6 @@ $prefile =array();
$newsup=$this->input->post('newsup');
$newSupId = split("[ - ]+", $newsup);
$b4supplier=$this->input->post('b4supplier');
$b4date=$this->input->post('b4podate');
$b4podate = $this->getDateformat($b4date);
@ -1292,8 +1210,10 @@ $prefile =array();
$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);
@ -1336,7 +1256,6 @@ $prefile =array();
{
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4rate,'NewValue'=>$itemRate,'Entity'=>'Rate Changed');
$this->purchaseorder_model->insertlogpo($logpo);
}
@ -1396,12 +1315,12 @@ $prefile =array();
echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ;
}
/**
* To load pagenotfound view
*/
function pageNotFound()
{
//$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
$this->global['pageTitle'] = $this->CompanyName.': 404 - Page Not Found';
$this->loadViews("404", $this->global, NULL, NULL);
}
@ -1444,6 +1363,7 @@ $prefile =array();
public function servicepoprint($PONO)
{
// $this->load->view('includes/pdfheader');
// Load the pdf page with multiviews
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation();

View File

@ -5388,6 +5388,7 @@ var spclins=$.trim(tinymce.get('edittxtInstruction').getContent());
function populateValueMainFormForEditImportTax()
{
var rows =document.getElementById('ImportTax').rows.length;
var editrow = parseFloat(rows)-1;
var TotalLanding=0;
var TotalCustom=0;
@ -5460,7 +5461,7 @@ TotalIgst=parseFloat(TotalIgst)+parseFloat(Igst);
}
}while (i < rows);
}while (i < editrow);
$('#txttotallanding').val(parseFloat(TotalLanding).toFixed(2));