Updated Code on 15th march 2021 : ps

This commit is contained in:
VENBA-emp-10 sanjeev 2022-03-15 20:05:54 +05:30
parent 2cab15d825
commit 33f10dbfab
7 changed files with 81 additions and 85 deletions

View File

@ -48,15 +48,15 @@
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'kasiram9_SiddharthIndustries';
// $db['default']['hostname'] = 'localhost';
// $db['default']['username'] = 'root';
// $db['default']['password'] = '';
// $db['default']['database'] = 'kasiram9_SiddharthIndustries';
// $db['default']['hostname'] = '35.213.153.5';
// $db['default']['username'] = 'kasiram9_prod';
// $db['default']['password'] = 'sia!1234';
// $db['default']['database'] = 'kasiram9_SIAPROD';
$db['default']['hostname'] = 'sidharthindustries.com';
$db['default']['username'] = 'kasiram9_prod';
$db['default']['password'] = 'sia!1234';
$db['default']['database'] = 'kasiram9_SIAPROD';
// $db['default']['username'] = 'kasiram9_Siddh';
// $db['default']['password'] = 'sidh@1234';
// $db['default']['database'] = 'kasiram9_SIADEV';

View File

@ -246,7 +246,6 @@ class cashbook extends BaseController
$fs = $this->uploadFile1();
// $this->function_alert($fs);
// echo "uploadFile1()".$fs;die();
$document = $path.$fs;
$created_by = $this->session->userdata('userId');
@ -272,12 +271,14 @@ class cashbook extends BaseController
if($x == 21){
$openingbalance=$sheet->getCell('H'.$x)->getValue();
// $openingbalance=$sheet->getCell('H'.$x)->getValue();
$openingbalance=preg_replace('/\D/', '', $sheet->getCell('H'.$highestRow4)->getValue());
}
if($x == $highestRow4){
$closingbalance=$sheet->getCell('H'.$highestRow4)->getValue();
// $closingbalance=$sheet->getCell('H'.$highestRow4)->getValue();
$closingbalance=preg_replace('/\D/', '', $sheet->getCell('H'.$highestRow4)->getValue());
}
@ -315,12 +316,12 @@ class cashbook extends BaseController
}
$chqno = $sheet->getCell('C'.$x)->getValue();
$chqno = (($sheet->getCell('C'.$x)->getValue() == '') || ($sheet->getCell('C'.$x)->getValue() == null)) ? $sheet->getCell('C'.$x)->getValue() : "-" ;
$narration = $sheet->getCell('D'.$x)->getValue();
$cod =$sheet->getCell('E'.$x)->getValue();
$debit =$sheet->getCell('F'.$x)->getValue();
$credit=$sheet->getCell('G'.$x)->getValue();
$balance=$sheet->getCell('H'.$x)->getValue();
$cod =(($sheet->getCell('E'.$x)->getValue() == '') || ($sheet->getCell('E'.$x)->getValue() == null)) ? $sheet->getCell('E'.$x)->getValue() : 0 ;
$debit = (($sheet->getCell('F'.$x)->getValue() == '') || ($sheet->getCell('F'.$x)->getValue() == null)) ? $sheet->getCell('F'.$x)->getValue() : 0 ;
$credit=(($sheet->getCell('G'.$x)->getValue() == '') || ($sheet->getCell('G'.$x)->getValue() == null)) ? $sheet->getCell('G'.$x)->getValue() : 0 ;
$balance=(($sheet->getCell('H'.$x)->getValue() == '') || ($sheet->getCell('H'.$x)->getValue() == null)) ? $sheet->getCell('H'.$x)->getValue() : 0 ;
if($debit==0)
{
$Status='';
@ -357,7 +358,7 @@ class cashbook extends BaseController
{
echo "<script>alert('Saved unsuccessfully!');window.location.href='Bankingstatement';</script>";
}
}
}
}
function addIncomeExpense()
@ -602,17 +603,15 @@ class cashbook extends BaseController
function uploadFile1()
{
// echo "I am Here INSIDE UPLOAD";
// die();
//$this->load->library('upload')
$pathinfo = pathinfo($_FILES['userfile']['name']);
$config['upload_path'] = 'uploads/banking/';
// $config['allowed_types'] = 'png|jpg|jpeg|xlsx';
$config['allowed_types'] = 'xlsx|csv|xls';
// $config['allowed_types'] = 'xlsx|csv|xls';
$config['allowed_types'] = '*';
$config['file_name'] = $_FILES['userfile']['name'];
$config['overwrite'] = true;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);

View File

@ -224,6 +224,8 @@ function edited(){
function CreatePurchaseOrder()
{
// echo "@227 CreatePurchaseOrder"."<br>";
// echo '<pre>'.print_r($this->input->post(),true).'</pre>'."<br>";
// if( $DEPCode == PURCHASE)
// {
@ -237,21 +239,17 @@ function edited(){
}
else
{
// echo "@242 else proceed"."<br>";
$this->global['pageTitle'] = 'Siddharth : Purchase order' ;
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
$data['Suplist'] = $this->purchaseorder_model->getSupplierName();
$data['Payment']=$this->purchaseorder_model->getPaymentTermsDetails();
// print_r($data['Payment']);
$data['WorkStatus']=$this->purchaseorder_model->getStatus(7);
$data['WorkStatus']=$this->purchaseorder_model->getStatus(7);
$SelectedReq = json_decode($this->input->post('txtReqNo'));
// echo '<pre>'.print_r($SelectedReq,true).'</pre>'."<br>";
// echo "@250 SelectedReq = ".$SelectedReq."<br>";
// die;
$Req = $SelectedReq->Req;
$data['ReqList'] = $Req ;
@ -271,7 +269,7 @@ function edited(){
$data['MaterialList'] = $result;
//print_r($data['MaterialList']);
// echo '<pre>'.print_r($data['MaterialList'],true).'</pre>'."<br>";die;
/* Cost code from Requisition - Client Review Fix
Start here */
$ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray);
@ -301,7 +299,7 @@ function edited(){
foreach ($ReqDetails as $Rs):
$CostCode = $Rs->CostCenterCode;
endforeach;
$AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType);
@ -375,6 +373,8 @@ function edited(){
}
$ViewName = 'capitalpurchaseorder';
}
// echo '@376 final step '.$ViewName;
// echo '<pre>'.print_r($data,true).'</pre>'."<br>";die();
$this->loadViews($ViewName, $this->global,$data, NULL);
}
// }
@ -1042,9 +1042,8 @@ function edited(){
function addNewPurchaseOrder()
{
// print_r($this->input->post());
// echo "@1100 i have pomaster = ".'<pre>'.print_r($this->input->post(),true).'</pre>'."<br>";
$POdt =$this->input->post('PODate');
$PODate = $this->getDateformat($POdt);
$SupplierID = $this->input->post('drpSupplier');
@ -1052,22 +1051,16 @@ function edited(){
$dt = $this->input->post('Deliverydt');
$POType = $this->input->post('POType');
$DeliveryOption = $this->input->post('DateRange');
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
}
else{
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
if($DeliveryOption==1){
$Deliverydt = '';
$DeliverySchedule = $this->input->post('Scheduleby');
}else{
$Deliverydt = $this->getDateformat($dt);
$DeliverySchedule = '';
}
$POType = $this->input->post('POType');
$BudgetType = $this->input->post('Budget');
//$PoRange = $this->input->post('txtPoRange');
$Modeofshipment=$this->input->post('addmodeofshipment');
$supplierreference=$this->input->post('addsupplierreference');
$supplieroffno=$this->input->post('addsupplierofferno');
@ -1082,38 +1075,32 @@ function edited(){
}
$SpcialInstruction = $this->input->post('SpcialInstruction');
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
$POStatus = $this->input->post('txtStatus');
$CreateBy = $this->session->userdata ( 'userId' );
$POStatus = $this->input->post('txtStatus');
$CreateBy = $this->session->userdata ( 'userId' );
$RowCount = $this->input->post('txtRowCount');
$DeletedRow = $this->input->post('txtDeletedRow');
// echo "DeletedRow = ".$DeletedRow;
$comma_separated = explode(':', $DeletedRow);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$PaymentTerms=$this->input->post('PaymentTerms');
$OtherPayment=$this->input->post('Otherpayment');
$OtherPayment=$this->input->post('Otherpayment');
$Local_Interstate=$this->input->post('Range');
$Qualitycheck=1;
// PO Master
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'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);
// print_r($POList);
// die();
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$revenuetype);
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'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->addPOMaster($POList,$POType,$revenuetype);
// echo "@1100 i have pomaster = ".'<pre>'.print_r($POMaster,true).'</pre>'."<br>";die();
$PONO = '';
if(count($POMaster)>0)
{
$PONO = $POMaster[0]['PONO'];
}
// $PONO = "SIA/2021-2022/10044";
// PO Line Items
$LineItemStatus = REQITEM_NEW;
@ -1144,10 +1131,11 @@ function edited(){
$CostCenter = $this->input->post('costCode'.$i);
$Cgst = $this->input->post('RevenueCgst'.$i);
$Sgst = $this->input->post('RevenueSgst'.$i);
$Igst = $this->input->post('RevenueIgst'.$i);
$AfterCgst = $this->input->post('RevenueAfterCgst'.$i);
$AfterSgst = $this->input->post('RevenueAfterSgst'.$i);
$AfterIgst = $this->input->post('RevenueAfterIgst'.$i);
$Igst = $this->input->post('RevenueIgst'.$i);
$AfterCgst = $this->input->post('RevenueAfterCgst'.$i);
$AfterSgst = $this->input->post('RevenueAfterSgst'.$i);
$AfterIgst = $this->input->post('RevenueAfterIgst'.$i);
$SkipInsert = "False";
if( count($comma_separated) > 0)
{
@ -1166,15 +1154,19 @@ function edited(){
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);
//print_r($POLineItemList);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
// echo "@1162 i have polineitem arr ".'<pre>'.print_r($POLineItem,true).'</pre>'."<br>";
// [PONO] => SIA/2021-2022/10044
// [ReqNo] => REQ7704
// [LineItemNo] => POItem9999
// $LineItemNo = "POItem10360";
$LineItemNo = '';
if(count($POLineItem)>0)
{
$LineItemNo = $POLineItem[0]['LineItemNo'];
}
//echo $LineItemNo;
// echo $LineItemNo; die;
// echo "POType ".$POType."<br>";
/*---------*/
// $logpo =array('PONO'=>$PONO,'Date'=>$PODate,'POType'=>$POType,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'SupplierID'=>$SupplierID,'LineItemNos'=>$LineItemNo);
@ -1184,8 +1176,9 @@ function edited(){
{
// 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);
// echo "@1176 i have arr for tax ".'<pre>'.print_r($RevenueTaxList,true).'</pre>'."<br>";
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
// echo "@1183 i have after insertion ".'<pre>'.print_r($RevenueList,true).'</pre>'."<br>";
//echo 'Revenue tax Success';
}
}

View File

@ -1,4 +1,4 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class purchaseorder_model extends CI_Model
{
@ -894,8 +894,9 @@ function GetPOType($ReqNo)
// print_r($this->db->last_query());
if($insert_id>0)
{
$subQuery = 'select max(LineItemNo) as LineItemNo from T_PurchaseOrder_LineItem';
// $subQuery = 'select max(LineItemNo) as LineItemNo from T_PurchaseOrder_LineItem';
$subQuery = 'SELECT * FROM T_PurchaseOrder_LineItem where PONO = "'.$POLineItem['PONO'].'" ORDER BY LineItemNo DESC';
$query = $this->db->query($subQuery);
return $query->result_array();
@ -909,9 +910,12 @@ function GetPOType($ReqNo)
{
$this->db->trans_start();
$this->db->insert('T_Revenue_Tax', $RevenueTaxList);
$insert_id = $this->db->affected_rows();
$this->db->trans_complete();
return $insert_id;
$insert_id = $this->db->insert_id();
$aff_row = $this->db->affected_rows();
// print_r( $this->db->last_query()); die();
// echo "aff_row".$aff_row." $insert_id".$insert_id;
return $aff_row > 0 ? $this->db->insert_id() : 0;
}
/**
* This function is used to add Service Tax to the system
@ -920,9 +924,9 @@ function GetPOType($ReqNo)
{
$this->db->trans_start();
$this->db->insert('T_Service_Tax', $ServiceTaxList);
$insert_id = $this->db->affected_rows();
$this->db->trans_complete();
return $insert_id;
$insert_id = $this->db->affected_rows();
return $insert_id>0 ? $this->db->insert_id() : 0;
}
@ -933,9 +937,9 @@ function GetPOType($ReqNo)
{
$this->db->trans_start();
$this->db->insert('T_Import_Tax', $ImportTaxList);
$insert_id = $this->db->affected_rows();
$this->db->trans_complete();
return $insert_id;
$insert_id = $this->db->affected_rows();
return $insert_id>0 ? $this->db->insert_id() : 0;
}
@ -1073,7 +1077,7 @@ function GetPOType($ReqNo)
AfterIGST )) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
left join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
left join T_Employee_Details emp on Req.Requestedby = emp.EmpID
join T_DepartmentDetails Dept on Req.RequestedDept = Dept.DEPCode
@ -1096,11 +1100,11 @@ function GetPOType($ReqNo)
AfterIGST)) ,2)as Taxamount,AdvanceAmount,
TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,sup.SupplierID,sup.ContactNumber,sup.EmailAddress,sup.PAN,sup.GSTNO,LineItem.AmendedDetails as LineAmend,Payment.PaymentTerms
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
left join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
left join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO
join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID
join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms
left join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms
left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO
where LineItem.PONO =?';
@ -2538,4 +2542,4 @@ function getigrno($bill){
return $query->result_array();
}
/*** ----------------------------- */
}
}

View File

@ -33,7 +33,7 @@ if (defined('ENVIRONMENT'))
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
error_reporting(0);
break;
case 'testing':

Binary file not shown.

Binary file not shown.