capital po and ui issue fixed

This commit is contained in:
venbatechnologies@gmail.com 2017-08-07 16:49:22 +05:30
parent c076aa7f1b
commit 81f45c4202
26 changed files with 16645 additions and 1476 deletions

View File

@ -233,6 +233,15 @@ class purchaseorder extends BaseController
}
else if($ReqType == CAPITAL)
{
$CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType);
if(count($CapitalAvlBudget)>0)
{
$data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue'];
}
$ViewName = 'capitalpurchaseorder';
}
$this->loadViews($ViewName, $this->global,$data, NULL);
@ -456,13 +465,15 @@ class purchaseorder extends BaseController
{
$CapitalRange = $_GET['CapitalRange'];
$AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType);
if(count($AvlBudget)>0)
$CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType);
if(count($CapitalAvlBudget)>0)
{
$data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue'];
}
$data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue'];
}
if($CapitalRange=='0'){
$data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO);
@ -2627,16 +2638,19 @@ function addNewImportPurchaseOrder()
/*This function is used to convert amount(digit) into words*/
public function convertNumber($amt){
$ShowPaise='0';
$totalAmt=explode(".",$amt);
$number = $totalAmt[0];
$no = $number;
if(!empty($totalAmt[1])){
if(!empty($totalAmt[1]) && $totalAmt[1]!=0){
$point = $totalAmt[1];
$ShowPaise='1';
}
else{
$point=0;
$ShowPaise='0';
}
@ -2679,7 +2693,8 @@ $point=0;
" " . $words[$point / 10] . " " .
$words[$point = $point % 10] : '';
if(($point=='' || $point=='00' || $point=='0') && $points==''){
if($ShowPaise=='0'){
$amountInWords = "Rupee " . $result." Only";
}
else{
@ -2691,16 +2706,18 @@ $amountInWords = "Rupee " . $result ." Paise ". $points." Only";
return $amountInWords;
}
public function convertNumberSymbol($amt,$symbol,$name,$paise){
$ShowPaise='0';
$totalAmt=explode(".",$amt);
$number = $totalAmt[0];
$no = $number;
if(!empty($totalAmt[1])){
if(!empty($totalAmt[1]) && $totalAmt[1]!=0){
$point = $totalAmt[1];
$ShowPaise='1';
}
else{
$point=0;
$ShowPaise='0';
}
$hundred = null;
@ -2742,7 +2759,7 @@ $point=0;
" " . $words[$point / 10] . " " .
$words[$point = $point % 10] : '';
if(($point=='' || $point=='00' || $point=='0') && $points==''){
if($ShowPaise=='0'){
$amountInWords = $name." " . $result." Only";
}
else{

File diff suppressed because it is too large Load Diff

View File

@ -407,11 +407,10 @@ class supplier extends BaseController
$this->excel->getActiveSheet()->setCellValue('N1', 'Collectrate Address');
$this->excel->getActiveSheet()->setCellValue('O1', 'UANumber');
$this->excel->getActiveSheet()->setCellValue('P1', 'PaymentTerms');
$this->excel->getActiveSheet()->setCellValue('Q1', 'PaymentDays');
$this->excel->getActiveSheet()->setCellValue('R1', 'PayableAT');
$this->excel->getActiveSheet()->setCellValue('S1', 'Createdby');
$this->excel->getActiveSheet()->setCellValue('T1', 'UpdatedBy');
$this->excel->getActiveSheet()->setCellValue('U1', 'IsActive');
$this->excel->getActiveSheet()->setCellValue('Q1', 'Createdby');
$this->excel->getActiveSheet()->setCellValue('R1', 'UpdatedBy');
$this->excel->getActiveSheet()->setCellValue('S1', 'IsActive');
@ -454,10 +453,7 @@ class supplier extends BaseController
$this->excel->getActiveSheet()->getStyle('R1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('S1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('S1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('T1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('T1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('U1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('U1')->getFont()->setBold(true);
$exportData = $this->supplier_model->export_excel();
@ -483,11 +479,10 @@ class supplier extends BaseController
$this->excel->getActiveSheet()->setCellValue('N' . $i,$data['CollectrateAddress']);
$this->excel->getActiveSheet()->setCellValue('O' . $i,$data['UANumber']);
$this->excel->getActiveSheet()->setCellValue('P' . $i,$data['PaymentTerms']);
$this->excel->getActiveSheet()->setCellValue('Q' . $i,$data['PaymentDays']);
$this->excel->getActiveSheet()->setCellValue('R' . $i,$data['PayableAT']);
$this->excel->getActiveSheet()->setCellValue('S' . $i,$data['firstname']);
$this->excel->getActiveSheet()->setCellValue('T' . $i,$data['Update_by']);
$this->excel->getActiveSheet()->setCellValue('U' . $i,$data['IsActive']);
$this->excel->getActiveSheet()->setCellValue('Q' . $i,$data['firstname']);
$this->excel->getActiveSheet()->setCellValue('R' . $i,$data['Update_by']);
$this->excel->getActiveSheet()->setCellValue('S' . $i,$data['IsActive']);
$i++;
$s++;

View File

@ -0,0 +1,513 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
require APPPATH . '/libraries/BaseController.php';
/**
* Class : Supplier Controller (supplier)
* User Class to control all user related operations.
* @author : Gandhimathi
* @version : 1.1
* @since : 12 Apr 2017
*/
class supplier extends BaseController
{
/**
* This is default constructor of the class
*/
public function __construct()
{
parent::__construct();
$this->load->model('supplier_model');
$this->load->library('form_validation');
$this->load->library('pagination');
$this->load->library('Excel');
$this->isLoggedIn();
}
/**
* This function used to load the first screen of the user
*/
public function index()
{
$this->global['pageTitle'] = 'Siddharth : Supplier';
$this->loadViews("supplierListing", $this->global, NULL , NULL);
}
/**
* This function is used to load the Supplier list
*/
function supplierListing()
{
$this->load->model('supplier_model');
$data['userRecords'] = $this->supplier_model->supplierListing();
$this->global['pageTitle'] = 'Siddharth Industries : Supplier Listing';
$this->loadViews("supplierListing", $this->global, $data, NULL);
}
/**
* This function is used to load the add new supplier */
function addsupplier()
{
//$data['payment'] = $this->supplier_model->getpayment();
$data['payment'] = $this->supplier_model->getPaymentTerms();
//$data['users'] = $this->purchaseorder_model->getusers();
$this->global['pageTitle'] = 'siddharth : Add New Supplier';
$this->loadViews("addsupplier", $this->global,$data, NULL);
}
/**
* This function is used to check whether PAN already exist or not
*/
function CheckPAN()
{
$id = $this->input->post('id');
$query = $this->supplier_model->checkPAN($id );
$query = $query[0]['PAN'];
print_r($query);
}
/* To Check the Pan Number is exists in the database or not for the selected Supplier */
function checkPanValidateSupplier() {
$SupplierID = $this->input->post('SupplierID');
$PanNo = $this->input->post('panno');
// echo 'Sup'. $SupplierID ;
$query = $this->supplier_model->checkPAN($PanNo,$SupplierID);
if (count($query)> 0)
{
$this->form_validation->set_message('checkPanValidateSupplier', 'The Entered PAN Number is already exists in the Database.');
return false;
}
else
{
return true;
}
}
/* To Check the Pan Number is exists in the database or not */
function checkPanValidate()
{
// alert('validation pan');
$PanNo = $this->input->post('panno');
$query = $this->supplier_model->checkPAN($PanNo);
if (count($query)> 0)
{
$this->form_validation->set_message('checkPanValidate', 'The Entered PAN Number is already exists in the Database.');
return false;
}
else
{
return true;
}
}
function CheckGST()
{
//alert('check validation GST');
$id = $this->input->post('id');
$query = $this->supplier_model->checkGST($id);
$query = $query[0]['GSTNO'];
print_r($query);
}
/* To Check the GST Number is exists in the database or not for the selected Supplier */
function checkGstValidateSupplier() {
//alert(' gst validation GST');
$SupplierID = $this->input->post('SupplierID');
$GstNo = $this->input->post('GSTNo');
//echo 'Sup'. $SupplierID ;
$query = $this->supplier_model->checkGST($GstNo,$SupplierID);
if (count($query)> 0)
{
$this->form_validation->set_message('checkGstValidateSupplier', 'The Entered GST Number is already exists in the Database.');
return false;
}
else
{
return true;
}
}
/* To Check the GST Number is exists in the database or not */
function checkGstValidate()
{
$GstNo = $this->input->post('GSTNo');
$query = $this->supplier_model->checkGST($GstNo);
if (count($query)> 0)
{
$this->form_validation->set_message('checkGstValidate', 'The Entered GST Number is already exists in the Database.');
return false;
}
else
{
return true;
}
}
/**
* This function is used to add new Supplier to the system
*/
function addNewsupplier()
{
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
$this->form_validation->set_rules('Address','Address','trim|required|');
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
$this->form_validation->set_rules('emailid','emailid', 'valid_email|max_length[128]|required');
$this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]');
$this->form_validation->set_rules('panno', 'panno', 'trim|required|max_length[10]');//|callback_checkPanValidate');
$this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidate');
if($this->form_validation->run() == FALSE)
{
$this->addsupplier();
}
else
{
$SupplierName = $this->input->post('SupplierName');
$Address = $this->input->post('Address');
$ContactNumber = $this->input->post('ContactNumber');
$AlternateContactNumber = $this->input->post('AlternateContactNumber');
$EmailAddress = $this->input->post('emailid');
$Exiseregistration = $this->input->post('Exciseregistration');
$TIN = $this->input->post('TIN');
$PAN = strtoupper($this->input->post('panno'));
$GSTNo = strtoupper($this->input->post('GSTNo'));
$GSTRange = $this->input->post('GSTRange');
$CollectrateAddress = $this->input->post('CollectrateAddress');
$UANumber = $this->input->post('UANumber');
//$PaymentTerms = $this->input->post('paymentname');
//$Payment = $this->input->post('Payment');
//$PayableAT = $this->input->post('PayableAT');
$CSTNo = $this->input->post('CSTNo');
$CSTDt = $this->input->post('dateofCST');
if($CSTDt != '')
{
$CSTDate = $this->getDateformat($CSTDt);
}
else
{
$CSTDate = null;
}
$EMSNo = $this->input->post('EMSNo');
$TSNo = $this->input->post('TSNo');
$IMSNo = $this->input->post('IMSNo');
$ISONo = $this->input->post('ISONo');
$OSHASNo = $this->input->post('OSHASNo');
$accno = $this->input->post('accno');
$ifsc = $this->input->post('ifsc');
$branchname = $this->input->post('branchname');
$bankaddress = $this->input->post('bankaddress');
$Createdby = $this->session->userdata ( 'userId' );
$date = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddate = $date->format('Y-m-d H:i:s');
$service = $this->input->post('service');
$rawmaterial =$this->input->post('rawmaterial');
$maintenance = $this->input->post('maintanance');
$PaymentId = $this->input->post('paymentid');
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentID'=>$PaymentId,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'Cert_EMS'=>$EMSNo, 'Cert_TS'=>$TSNo, 'Cert_IMS'=>$IMSNo, 'Cert_ISO'=>$ISONo, 'Cert_OSHAS'=>$OSHASNo, 'BankAcNumber'=>$accno, 'IFSCCode'=>$ifsc, 'BranchName'=>$branchname, 'BankAddress'=>$bankaddress,'Createdby'=>$Createdby,'IsService'=>$service,'IsMaintanance'=>$maintenance,'IsRawMaterial'=>$rawmaterial); //,'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$Payment,'PayableAT'=>$PayableAT);
//print_r($supplier);die();
$result = $this->supplier_model->addNewsupplier($supplier);
if($result > 0)
{
redirect('supplierListing','refresh');
echo "<script>alert('New Supplier Created successfully!');</script>";
}
else
{
redirect('supplierListing','refresh');
echo "<script>alert('Supplier Record Not Created!');</script>";
}
}
}
function getDateformat($Val)
{
$date = new DateTime($Val);
$retDate = $date->format('Y-m-d H:i:s');
return $retDate;
}
/**
* This function is used to edit the Supplier information
*/
function editsupplier()
{
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
$this->form_validation->set_rules('Address','Address','trim|required|');
$supplierID = $this->input->post('SupplierID');
//echo 'supID' . $supplierID ;
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
$this->form_validation->set_rules('emailid','emailid','valid_email|max_length[128]|required');
$this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]');
$this->form_validation->set_rules('panno', 'panno', 'trim|required|max_length[10]|callback_checkPanValidateSupplier');
$this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidateSupplier');
if($this->form_validation->run() == FALSE)
{
$this->viewsupplier($supplierID);
}
else
{
$SupplierName = $this->input->post('SupplierName');
$Address = $this->input->post('Address');
$ContactNumber = $this->input->post('ContactNumber');
$AlternateContactNumber = $this->input->post('AlternateContactNumber');
$EmailAddress = $this->input->post('emailid');
$Exiseregistration = $this->input->post('Exciseregistration');
$TIN = $this->input->post('TIN');
$PAN = strtoupper($this->input->post('panno'));
$GSTNo = strtoupper($this->input->post('GSTNo'));
$GSTRange = $this->input->post('GSTRange');
$CollectrateAddress = $this->input->post('CollectrateAddress');
$UANumber = $this->input->post('UANumber');
$PaymentTerms = $this->input->post('paymentname');
//print_r($PaymentTerms);
$UpdatedBy = $this->session->userdata ( 'userId' );
$chked = $this->input->post('isactive');
if( $chked != '')
{
$IsActive = '1';
}
else
{
$IsActive = '0';
}
$CSTNo = $this->input->post('CSTNo');
$CSTDt = $this->input->post('dateofCST');
if($CSTDt != '')
{
$CSTDate = $this->getDateformat($CSTDt);
}
else
{
$CSTDate = null;
}
$EMSNo = $this->input->post('EMSNo');
$TSNo = $this->input->post('TSNo');
$IMSNo = $this->input->post('IMSNo');
$ISONo = $this->input->post('ISONo');
$OSHASNo = $this->input->post('OSHASNo');
$accno = $this->input->post('accno');
$ifsc = $this->input->post('ifsc');
$branchname = $this->input->post('branchname');
$bankaddress = $this->input->post('bankaddress');
$service = $this->input->post('service');
$rawmaterial =$this->input->post('rawmaterial');
$maintanance = $this->input->post('maintanance');
$PaymentId = $this->input->post('paymentid');
$supplier = array();
$supplier = array('SupplierName'=>$SupplierName, 'Address'=>$Address, 'ContactNumber'=>$ContactNumber, 'AlternateContactNumber'=> $AlternateContactNumber,'EmailAddress'=>$EmailAddress,'Exiseregistration'=>$Exiseregistration,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNo'=>$GSTNo,'GSTRange'=>$GSTRange,'CollectrateAddress'=>$CollectrateAddress,'UANumber'=>$UANumber,'PaymentID'=>$PaymentId,'CSTNo'=>$CSTNo,'CSTDate'=>$CSTDate,'Cert_EMS'=>$EMSNo, 'Cert_TS'=>$TSNo, 'Cert_IMS'=>$IMSNo, 'Cert_ISO'=>$ISONo, 'Cert_OSHAS'=>$OSHASNo, 'BankAcNumber'=>$accno, 'IFSCCode'=>$ifsc, 'BranchName'=>$branchname, 'BankAddress'=>$bankaddress,'UpdatedBy'=>$UpdatedBy,'IsActive'=>$IsActive,'IsService'=>$service,'IsMaintanance'=>$maintanance,'IsRawMaterial'=>$rawmaterial); //'PaymentTerms'=>$PaymentTerms,'PaymentDays'=>$Payment);
//SupplierID, SupplierName, Address, ContactNumber, AlternateContactNumber, EmailAddress, Exiseregistration, TIN, PAN, CSTNO, CSTDate, GSTNO, GSTRange, CollectrateAddress, UANumber, PaymentTerms, PaymentDays, PayableAT, Cert_EMS, Cert_TS, Cert_IMS, Cert_ISO, Cert_OSHAS, BankAcNumber, IFSCCode, BranchName, BankAddress, Createdby, UpdatedBy, Updatedon, CreatedOn, IsActive);
// print_r($supplier);die();
$result = $this->supplier_model->UpdateSupplier($supplier, $supplierID);
if($result == True)
{
redirect('supplierListing','refresh');
echo "<script>alert('Supplier updated successfully!');</script>";
}
else
{
redirect('supplierListing','refresh');
echo "<script>alert('Supplier Record Not updated!');</script>";
}
}
}
function viewsupplier($SID = '')
{
$Payment = '';
if($SID == '')
{
$supplierID = $_GET['SID'];
$Payment = $_GET['Payment'];
}
else
{
$supplierID = $SID;
}
$data['supplier'] = $this->supplier_model->getSupplierInfo($supplierID);
//$data['payment'] = $this->supplier_model->getpayment($Payment );
$data['payment'] = $this->supplier_model->getPaymentTerms($Payment);
$this->global['pageTitle'] = 'Siddharth : Edit Supplier';
$this->loadViews("editSupplier", $this->global,$data, NULL);
}
/** this function can be use for excel report **/
function export_supplierdetails(){
$this->load->library('excel');
$this->excel->setActiveSheetIndex(0);
$this->excel->getActiveSheet()->setTitle('supplier details');
$this->excel->getActiveSheet()->setCellValue('A1', 'SupplierID');
$this->excel->getActiveSheet()->setCellValue('B1', 'SupplierName');
$this->excel->getActiveSheet()->setCellValue('C1', 'Address');
$this->excel->getActiveSheet()->setCellValue('D1', 'ContactNumber');
$this->excel->getActiveSheet()->setCellValue('E1', 'AlternateContactNumber');
$this->excel->getActiveSheet()->setCellValue('F1', 'EmailAddress');
$this->excel->getActiveSheet()->setCellValue('G1', 'Exiseregistration');
$this->excel->getActiveSheet()->setCellValue('H1', 'TIN');
$this->excel->getActiveSheet()->setCellValue('I1', 'PAN');
$this->excel->getActiveSheet()->setCellValue('J1', 'CSTNO');
$this->excel->getActiveSheet()->setCellValue('K1', 'CST Date');
$this->excel->getActiveSheet()->setCellValue('L1', 'GST NO');
$this->excel->getActiveSheet()->setCellValue('M1', 'GST Range');
$this->excel->getActiveSheet()->setCellValue('N1', 'Collectrate Address');
$this->excel->getActiveSheet()->setCellValue('O1', 'UANumber');
$this->excel->getActiveSheet()->setCellValue('P1', 'PaymentTerms');
$this->excel->getActiveSheet()->setCellValue('Q1', 'Createdby');
$this->excel->getActiveSheet()->setCellValue('R1', 'UpdatedBy');
$this->excel->getActiveSheet()->setCellValue('S1', 'IsActive');
$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('B1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('B1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('C1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('D1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('D1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('E1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('E1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('F1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('F1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('G1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('G1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('H1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('H1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('I1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('I1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('J1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('J1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('K1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('K1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('L1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('L1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('M1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('M1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('N1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('N1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('O1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('O1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('P1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('P1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('Q1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('Q1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('R1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('R1')->getFont()->setBold(true);
$this->excel->getActiveSheet()->getStyle('S1')->getFont()->setSize(12);
$this->excel->getActiveSheet()->getStyle('S1')->getFont()->setBold(true);
$exportData = $this->supplier_model->export_excel();
if ($exportData) {
$i = 2;
$s = 1;
foreach ($exportData as $data) {
$this->excel->getActiveSheet()->setCellValue('A' . $i,$data['SupplierID']);
$this->excel->getActiveSheet()->setCellValue('B' . $i,$data['SupplierName']);
$this->excel->getActiveSheet()->setCellValue('C' . $i,$data['Address']);
$this->excel->getActiveSheet()->setCellValue('D' . $i,$data['ContactNumber']);
$this->excel->getActiveSheet()->setCellValue('E' . $i,$data['AlternateContactNumber']);
$this->excel->getActiveSheet()->setCellValue('F' . $i,$data['EmailAddress']);
$this->excel->getActiveSheet()->setCellValue('G' . $i,$data['Exiseregistration']);
$this->excel->getActiveSheet()->setCellValue('H' . $i,$data['TIN']);
$this->excel->getActiveSheet()->setCellValue('I' . $i,$data['PAN']);
$this->excel->getActiveSheet()->setCellValue('J' . $i,$data['CSTNO']);
$this->excel->getActiveSheet()->setCellValue('K' . $i,$data['CSTDate']);
$this->excel->getActiveSheet()->setCellValue('L' . $i,$data['GSTNO']);
$this->excel->getActiveSheet()->setCellValue('M' . $i,$data['GSTRange']);
$this->excel->getActiveSheet()->setCellValue('N' . $i,$data['CollectrateAddress']);
$this->excel->getActiveSheet()->setCellValue('O' . $i,$data['UANumber']);
$this->excel->getActiveSheet()->setCellValue('P' . $i,$data['PaymentTerms']);
$this->excel->getActiveSheet()->setCellValue('Q' . $i,$data['firstname']);
$this->excel->getActiveSheet()->setCellValue('R' . $i,$data['Update_by']);
$this->excel->getActiveSheet()->setCellValue('S' . $i,$data['IsActive']);
$i++;
$s++;
}
}
$filename = 'supplierdetails' .' '. '.xls'; //save our workbook as this file name
header('Content-Type: application/vnd.ms-excel'); //mime type
header('Content-Disposition: attachment;filename="' . $filename . '"'); //tell browser what's the file name
header('Cache-Control: max-age=0'); //no cache
$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');
if (ob_get_contents()) ob_end_clean();
ob_start();
$objWriter->save('php://output');
}
function pageNotFound()
{
$this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found';
$this->loadViews("404", $this->global, NULL, NULL);
}
}
?>

View File

@ -1527,4 +1527,19 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
return $query->result();
}
//get available budget for capital
function GetAvailableCapitalBudgetAmount($CostCode,$Year,$BudgetType)
{
$subQuery ='select BudgetAmount, (select ifnull(sum(IF(POMaster.ExchangeRate>0,Quantity*Rate*POMaster.ExchangeRate,Quantity*Rate)),0) as Totalvalue from
T_PurchaseOrder_LineItem Item join T_Requestion_Master mast
on mast.ReqNo = Item.ReqNo join T_PurchaseOrder_Master POMaster on POMaster.PONO=Item.PONO where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue
from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and
BudgetYear = ? and BudgetType =?';
$query = $this->db->query($subQuery,array($CostCode,$BudgetType,$CostCode,$Year,$BudgetType));
return $query->result_array();
}
}

View File

@ -2,6 +2,69 @@
class purchaseorder_model extends CI_Model
{
function GetServicePOListforStatusUpdate()
{
$this->db->distinct();
$this->db->select('PO.PONO');
$this->db->from('T_PurchaseOrder_Master PO');
$this->db->Join('T_PurchaseOrder_LineItem Line','PO.PONO = Line.PONO');
$this->db->Join('T_Requestion_Master Req','Req.ReqNo = Line.ReqNo');
$this->db->Join('T_Employee_Details Emp','Emp.EmpID= Req.Requestedby');
$this->db->where('PO.POType',SERVICE);
$this->db->where('PO.status',PO_RELEASED);
$this->db->where('Emp.Departmentcode',$this->session->userdata('DEPCode'));
$query = $this->db->get();
return $query->result();
}
function GetPODetailforBillingServicePO($PONO)
{
$subQuery ='select mast.ReqNo,mast.ReqDate,supp.SupplierName,PODate,st.StatusName as WorkStatus,ServiceWorkStatus,POMast.PaymentTerms,
POMast.ServiceWorkStatus,LineItem.*,mat.MaterialName,mat.UOM,emp.FirstName,emp.LastName,POMast.TotalOrderValue
from T_PurchaseOrder_Master POMast
join T_PurchaseOrder_LineItem LineItem on LineItem.PONO = POMast.PONO
join T_SupplierDetailsN supp on supp.SupplierID = POMast.SupplierID
join T_MaterialMaster mat on mat.MaterialCode = LineItem.MaterialCode
join T_Status Stat on Stat.StatusCode = POMast.Status
join T_Status st on st.StatusCode = POMast.ServiceWorkStatus
join T_Requestion_Master mast on mast.ReqNo = LineItem.ReqNo
join tbl_users users on users.userId = mast.CreatedBy
join T_Employee_Details emp on emp.EmpID = users.EmpID
where POMast.POType=? and POMast.PONO=?';
$query = $this->db->query($subQuery,array(SERVICE,$PONO));
return $query->result_array();
}
function GetServicePOListforBilling()
{
$subQuery ='select POMast.PONO,supp.SupplierName,PODate,POMast.PaymentTerms,POMast.ServiceWorkStatusRemarks,
LineItem.*,mat.MaterialName,mat.UOM,emp.FirstName,emp.LastName,Tax.TotalValue,Cost.CostCenterName,AdvanceAmount
,Dept.DepartmentName from T_PurchaseOrder_Master POMast
join T_PurchaseOrder_LineItem LineItem on LineItem.PONO = POMast.PONO
join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
left join T_PurchaseOrder_AdvanceRequest PUADV on POMast.PONO=PUADV.PONO
join T_SupplierDetailsN supp on supp.SupplierID = POMast.SupplierID
join T_MaterialMaster mat on mat.MaterialCode = LineItem.MaterialCode
join T_Status Stat on Stat.StatusCode = POMast.Status
join T_Requestion_Master mast on mast.ReqNo = LineItem.ReqNo
join tbl_users users on users.userId = POMast.CreatedBy
join T_Employee_Details emp on emp.EmpID = mast.Requestedby
join T_DepartmentDetails Dept on Dept.DEPCode = emp.Departmentcode
join T_CostCenter_Master Cost on Cost.CostCenterCode=LineItem.CostCenterCode
where POMast.POType=? and ServiceWorkStatus=?';
$query = $this->db->query($subQuery,array(SERVICE,SERVICE_COMPLETED));
//print_r( $this->db->last_query());
return $query->result();
}
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
@ -60,7 +123,7 @@ function purchaseorderListing($forwhat='')
*/
function getSupplierName($supID='')
{
$this->db->select('SupplierID, SupplierName,Address,PaymentTerms,PayableAT,PaymentDays');
$this->db->select('SupplierID, SupplierName,Address,PaymentID');
$this->db->from('T_SupplierDetailsN');
if($supID != '')
{
@ -183,8 +246,10 @@ function purchaseorderListing($forwhat='')
from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and
BudgetYear = ? and BudgetType =?'; */
$subQuery ='select BudgetAmount, (select ifnull(sum(Quantity*Rate),0) as Totalvalue from
T_PurchaseOrder_LineItem Item join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue
$subQuery ='select BudgetAmount, (select ifnull(sum(Quantity*Rate)-tax.AfterDiscount,0) as Totalvalue from
T_PurchaseOrder_LineItem Item join T_Requestion_Master mast
on mast.ReqNo = Item.ReqNo left join T_Revenue_Tax tax on
tax.LineItemNo = Item.LineItemNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue
from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and
BudgetYear = ? and BudgetType =?';
@ -194,7 +259,7 @@ function purchaseorderListing($forwhat='')
}
function GetAvailableImportBudgetAmount($CostCode,$Year,$BudgetType)
{
$subQuery='select BudgetAmount,(select ifnull(sum((Quantity*Rate*ExchangeRate)),0)as TValue from T_PurchaseOrder_LineItem LineItem
@ -289,7 +354,7 @@ function purchaseorderListing($forwhat='')
*/
function getRequistionNoFromPO($PONO='')
{
$this->db->distinct();
$this->db->select('ReqNo,');
$this->db->from('T_PurchaseOrder_LineItem');
if($PONO != '')
@ -468,6 +533,19 @@ function purchaseorderListing($forwhat='')
$this->db->trans_complete();
return $insert_id;
}
function addadvanceRequest($advance)
{
$this->db->trans_start();
$this->db->insert('T_PurchaseOrder_AdvanceRequest', $advance);
$insert_id = $this->db->affected_rows();
$this->db->trans_complete();
return $insert_id;
}
/**
@ -490,7 +568,7 @@ function purchaseorderListing($forwhat='')
function GetServicePurchaseOrder($PONO = '')
{
$this->db->distinct();
$this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.PaymentDays,POMast.PayableAT,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*');
$this->db->select('ReqNo,POMast.PONO,POMast.PaymentTerms,POMast.PaymentOtherDescription,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*');
$this->db->from('T_PurchaseOrder_Master POMast');
$this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID');
$this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status');
@ -511,7 +589,7 @@ function purchaseorderListing($forwhat='')
function GetServicePurchaseOrderDetails($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,ReceivedQuantity,Rate,LineItem.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((After_CGST + After_SGST + After_IGST),2)as Taxamount
$subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,ReceivedQuantity,Rate,LineItem.Status,(Quantity *Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount
,TotalValue,CGST,After_CGST,SGST,After_SGST,IGST,After_IGST,otherallowance,LineItem.CostCenterCode,LineItem.ServiceFrequency,LineItem.ServiceMaterialDescription,Req.Schedule_Type,Req.NumberOfService,Req.Service_Period
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
@ -525,13 +603,62 @@ function purchaseorderListing($forwhat='')
}
// This Method to get the Revenue PO Child Details for Edit the Item
function GetRevenuePurchaseOrderDetails($PONO = '')
// This Method to get the Service PO Child Details for Edit the Item
function GetServicePurchaseOrderDetailsForPrint($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue , ROUND(((AfterPackagingValue + AfterFreightValue + AfterExciseDuty + AfterVAT + AfterCST + AfterGST + AfterOtherTaxes + Insurance) - AfterDiscount ),2)as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName
FROM T_PurchaseOrder_LineItem LineItem
$subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.ServiceMaterialDescription,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Mat.HSNCODE,
LineItem.Quantity,LineItem.Rate,(LineItem.Quantity *LineItem.Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount
,TotalValue,CGST,SGST,IGST,After_CGST,After_SGST,After_IGST,otherallowance,LineItem.CostCenterCode,sup.SupplierName,sup.Address,POMaster.DeliveryAddress,POMaster.DeliveryDate,POMaster.Status,POMaster.PODate,POMaster.PONO,POMaster.ServiceDescription,POMaster.PaymentOtherDescription,POMaster.DeliveryOption,POMaster.DeliverySchedule,ReqMat.NumberOfService,ReqMat.Service_Period,ReqMat.Schedule_Type,Payment.PaymentID,Payment.PaymentTerms,AdvanceAmount FROM
T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_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_Requestion_Master ReqMat on ReqMat.ReqNo = LineItem.ReqNo
join T_PaymentTerms Payment on Payment.PaymentID = POMaster.PaymentTerms
left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO
where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
return $query->result();
}
function GetServicePurchaseOrderAmendDetailsforPdfprint($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.ServiceMaterialDescription,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue,POMaster.AmendedDetails,LineItem.AmendedDetails as lineamenddetails,
ROUND(( Tax.After_SGST + Tax.After_CGST + Tax.After_IGST ) ,2)as Taxamount,ReqMat.NumberOfService,ReqMat.Schedule_Type,ReqMat.Service_Period,
TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentTerms
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_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
join T_Requestion_Master ReqMat on ReqMat.ReqNo = LineItem.ReqNo
where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
return $query->result();
}
// This Method to get the Revenue PO Child Details for Edit the Item
function GetRevenuePurchaseOrderDetails($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,(Quantity *Rate) as BasicValue , ((AfterPackagingValue + AfterFreightValue + AfterSGST + AfterCGST +
AfterIGST + Insurance)) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
@ -551,15 +678,18 @@ function purchaseorderListing($forwhat='')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
ROUND(((AfterPackagingValue + AfterFreightValue + AfterExciseDuty + AfterVAT + AfterCST +
AfterGST + AfterOtherTaxes + Insurance)) ,2)as Taxamount ,
TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address
Mat.UOM,Mat.HSNCODE,Quantity,Rate,(Quantity *Rate) as BasicValue ,
(AfterPackagingValue + AfterFreightValue + AfterSGST + AfterCGST +
AfterIGST + Insurance) as Taxamount,AdvanceAmount,
TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentID,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
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_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO
where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
@ -568,7 +698,29 @@ function purchaseorderListing($forwhat='')
}
// This Method to get the Revenue PO Child Details for Edit the Item
function GetRevenuePurchaseOrderDetailsForAmendPDF($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,POMaster.PaymentOtherDescription,
Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
ROUND(((AfterPackagingValue + AfterFreightValue + AfterSGST + AfterCGST +
AfterIGST + Insurance)) ,2)as Taxamount,
TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,Payment.PaymentTerms
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
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
where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
return $query->result();
}
function GetImportPurchaseOrderDetailsForPDF($PONO = '')
{
@ -586,16 +738,20 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
$subQuery='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,
Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount ,
ProductPrice,Tax.*,LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address
ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,AdvanceAmount, Pay.PaymentTerms as Pay
FROM T_PurchaseOrder_LineItem LineItem
join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Import_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
left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO
join T_Requestion_Master ReqMast on LineItem.ReqNo=ReqMast.ReqNo
join T_PaymentTerms Pay on POMaster.PaymentTerms=Pay.PaymentID
where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
$query = $this->db->query($subQuery,array($PONO));
//print_r($this->db->last_query());
return $query->result();
@ -723,6 +879,28 @@ QuantityRejected,ROUND(ReceivedQuantity-QuantityRejected)as PendingQty,
}
function GetCapitalAmendPurchaseOrderDetailsForprintPDF($PONO = '')
{
//echo $PONO;
$subQuery ='SELECT distinct LineItem.PONO,LineItem.AmendedDetails as lineamd,LineItem.LineItemNo,SUP.SupplierName,SUP.Address,POMast.DeliveryAddress,POMast.DeliveryDate,POMast.PODate,POMast.DeliveryOption,POMast.ServiceDescription,POMast.ServiceDescription,POMast.Import_DispatchDetails,POMast.Import_PlaceofOrgin,POMast.AmendedDetails,POMast.DeliverySchedule,POMast.TotalOrderValue,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency,
Mat.UOM,Quantity,Rate,POMast.Status,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.PaymentOtherDescription,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,POMast.CurrencyType,Payment.PaymentTerms,
Req.CostCenterCode FROM T_PurchaseOrder_LineItem LineItem
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
join T_SupplierDetailsN SUP on SUP.SupplierID=POMast.SupplierID
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_Tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo
join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
join T_PaymentTerms Payment on Payment.PaymentID = POMast.PaymentTerms
join T_Employee_Details emp on Req.Requestedby = emp.EmpID where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
//print_r ($query->result());
return $query->result();
}
@ -763,7 +941,7 @@ function GetCurrencytype()
// To update Parent PO as Amended PO
function updateAmendPOMaster($PONO,$PODetail)
{
echo $PONO."from model";
//echo $PONO."from model";
$this->db->where('PONO', $PONO);
@ -1067,37 +1245,39 @@ function GetCurrencytype()
{
$this->db->distinct();
$this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,mast.POType as ReqType,bud.BudgetAmount,mast.Remarks');
$this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as ReqType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID,
(select FirstName from T_Employee_Details where EmpID=EID)as Approver');
$this->db->from('T_PurchaseOrder_Master mast');
// $this->db->order_by('mast.Status',"PO_CREATED");
$this->db->join('T_Status st', 'st.StatusCode=mast.Status');
$this->db->join('tbl_users tbl', 'mast.createdby=tbl.userid');
$this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid');
$this->db->join('T_PurchaseOrder_LineItem req', 'req.PONO= mast.PONO');
$this->db->join('T_Requestion_Master rmast','rmast.ReqNo=req.ReqNo');
$this->db->join('T_CostCenter_Budget bud','bud.CostCenterCode = req.CostCenterCode and bud.BudgetType = rmast.ReqType');
$this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode and ccm.CostCenterCode = bud.CostCenterCode');
//$this->db->join('T_CostCenter_Budget bud','bud.CostCenterCode = req.CostCenterCode and bud.BudgetType = rmast.ReqType');
$this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode');
$this->db->join('tbl_users tbl', 'rmast.createdby=tbl.userid');
$this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid');
$this->db->join('T_DepartmentDetails as Dep','Dep.DEPCode=emp.Departmentcode');
// $this->db->where('mast.Status',PO_AMENDED); // EMERGENGY PO
if($Amendment=='A'){ //A- Approved
$this->db->or_where('mast.Status',PO_CREATED);//PO CREATED
$this->db->or_where('mast.Status',PO_ONHOLD);//ON HOLD
$this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED
$this->db->or_where('mast.Status',PO_RELEASED);//PO RELEASED
$this->db->or_where('mast.Status',REQITEM_Emergency_PO_CREATED); // EMERGENGY PO
$this->db->or_where('mast.Status',REQITEM_Emergency_PO_CREATED);
$this->db->order_by('mast.Status'); // EMERGENGY PO
// $this->db->or_where('mast.Status',PO_AMENDED); // EMERGENGY PO
}
else if($Amendment=='R'){ // R -RELEASED
$this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED
$this->db->or_where('mast.Status',PO_RELEASED);
$this->db->order_by('mast.Status','asc');
}
$result=$this->db->get();
// print_r($this->db->last_query());
// print_r($this->db->last_query());
return $result->result();
}
}
function UpdatePO($store, $PONO)
@ -1126,15 +1306,14 @@ function GetCurrencytype()
function getCapitalPurchaseOrderDetails($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount
,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax,
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency,
Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,POMast.CurrencyType,
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_Tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo
join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
join T_Employee_Details emp on Req.Requestedby = emp.EmpID
@ -1150,18 +1329,18 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
}
// This Method to get the Capital PO Details for pdf
function GetCapitalPurchaseOrderDetailsForPDF($PONO = '')
function GetCapitalPurchaseOrderDetailsForPDF($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
ROUND((ServiceTax + EducessTax + SecHigherEducessTax + KrishiKalyantax + SwachhBharattax),2)as Taxamount
,TotalValue,ServiceTax,EducessTax,SecHigherEducessTax,KrishiKalyantax,SwachhBharattax,CostCenterCode , POMaster.*,sup.SupplierName,sup.Address
Mat.UOM,Mat.HSNCODE,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
LineItem.CostCenterCode , POMaster.*,sup.SupplierName,sup.Address,Payment.PaymentID,Payment.PaymentTerms
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_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
where LineItem.PONO =?';
$query = $this->db->query($subQuery,array($PONO));
@ -1187,12 +1366,12 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
// get domestic capital po list
function getDomesticCapitalPurchaseOrderDetails($PONO = '')
function getDomesticCapitalPurchaseOrderDetails($PONO = '')
{
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,
Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount
,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax,
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency,
Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST + ServiceTax.otherallowance),2) as ServiceTaxamount
,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance,
POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,ROUND((POMast.TotalOrderValue),2) as BasicINRValue,POMast.CurrencyType,
Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem
@ -1214,7 +1393,7 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
//get pdf po requistion details
function GetPdfRequistionDetails($PONO){
function GetPdfRequistionDetails($PONO){
$this->db->select('LineItem.ReqNo');
$this->db->from('T_PurchaseOrder_LineItem LineItem');
$this->db->where('LineItem.PONO',$PONO);
@ -1228,16 +1407,29 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
}
else{
$ReqNo = $res->ReqNo;
$this->db->select('ReqMast.ReqNo,ReqMast.CostCenterCode,re.FirstName,Dept.DEPCode,Dept.DepartmentName');
$this->db->select('ReqMast.ReqNo,ReqMast.CostCenterCode,ReqMast.ReqDate,ReqMast.Schedule_Type,ReqMast.NumberOfService,ReqMast.Service_Period,re.FirstName,Dept.DEPCode,Dept.DepartmentName');
$this->db->from('T_Requestion_Master ReqMast');
$this->db->join('T_Employee_Details re','re.EmpID=ReqMast.Requestedby');
$this->db->join('T_DepartmentDetails Dept', 're.Departmentcode = Dept.DEPCode');
$this->db->where('ReqMast.ReqNo',$ReqNo);
$Reqresult=$this->db->get();
$Details['RequistionNo']= $Reqresult->result()[0]->ReqNo;
$Detaisl['ReqDate']=$Reqresult->result()[0]->ReqDate;
$Details['RequestedName']= $Reqresult->result()[0]->FirstName;
$Details['RequestedDept']= $Reqresult->result()[0]->DepartmentName;
$Details['CostCenterCode']= $Reqresult->result()[0]->CostCenterCode;
$date = new DateTime($Reqresult->result()[0]->ReqDate,new DateTimeZone('Asia/Kolkata'));
$retDate = $date->format('d-m-Y');
$Details['ReqDate']= $retDate;
$ScheduleType = $Reqresult->result()[0]->Schedule_Type;
if($ScheduleType!='Recurring'){
$Details['Frequency']= $Reqresult->result()[0]->Schedule_Type;
}
else{
$Details['Frequency']= $Reqresult->result()[0]->Service_Period.' - '.$Reqresult->result()[0]->NumberOfService;
}
$ResultArray[]=$Details;
}
@ -1246,7 +1438,7 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
$RequistionDetails = $ResultArray;
return $RequistionDetails;
}
function GetLineItemReceivedQty($ParentPO,$MaterialCode)
function GetLineItemReceivedQty($ParentPO,$MaterialCode)
{
$this->db->select('ReceivedQuantity');
$this->db->from('T_PurchaseOrder_LineItem');
@ -1283,4 +1475,71 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
return $query->result();
}
}
function edit_mrir($MrirNo)
{
$this->db->distinct();
$this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.Createdon,TMD.ActualQuantityReceived,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,IGRM.CreatedDate,IGRD.QuantityAsPerInvoice,SUPP.SupplierName,SUPP.Address,POMR.PODate,POMR.DeliveryDate,POMR.ServiceDescription,TMD.MaterialCode,MM.MaterialName,MM.UOM,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName as PORasiedbyName,ED1.FirstName as MRIRRasiedbyName, ED2.FirstName as IGRRasiedbyName,TMM.MRIRStatus,TMM.Createdon as MRIRCreatedon,POLT.CostCenterCode,CostCenterName,QuantityAccepted,QuantityRejected,TMD.Remarks');
$this->db->from ('T_MRIR_Master TMM');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO = TMD.MRIRNO','left');//to get IGRNO,PONO,MRIRNO,mrirdate,
$this->db->join ('T_IGR_Master IGRM', 'IGRM.IGRNO = TMM.IGRNO','left');//to get actualquantity,deliverydate,Invoicedate,vechileno,courierno,igrdate,
$this->db->join ('T_PurchaseOrder_Master POMR ','IGRM.PONO = POMR.PONO','left');//to get podate,deliverydate,servicedescription
$this->db->join ('T_PurchaseOrder_LineItem POLT','IGRM.PONO=POLT.PONO','left');//to get receivedquantity,quantity
$this->db->join ('T_IGR_Details IGRD','IGRD.IGRNO = IGRM.IGRNO','left');//to get invoicequantity
$this->db->join ('T_MaterialMaster MM','IGRD.MaterialCode = MM.MaterialCode','left');
$this->db->join ('T_SupplierDetailsN SUPP','POMR.SupplierID = SUPP.SupplierID','left');//to get suppliername,supplieraddress
$this->db->join ('tbl_users user','user.userid = POMR.CreatedBy','left');//to get poraisedby
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID','left');
$this->db->join ('tbl_users user1','user1.userid=TMM.CreatedBy','left');//to get mrirraisedby
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left');
$this->db->join ('tbl_users user2','user2.userid=IGRM.CreatedBy','left');//to get igrraisedby
$this->db->join ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID','left');
$this->db->join('T_CostCenter_Master TCOST','POLT.CostCenterCode=TCOST.CostCenterCode');
$this->db->where('TMM.MRIRNO',$MrirNo);
$this->db->group_by('TMM.MRIRNO,TMD.MaterialCode');
$query = $this->db->get();
$result = $query->result();
//print_r( $this->db->last_query());
return $result;
}
function getadvancePONO($Status='')
{
$this->db->select ('Mast.PONO,POType,Mast.CreatedDate,Mast.ReleasedOn,Mast.TotalOrderValue,Mast.SupplierID,DeliveryDate,DeliverySchedule,DeliveryOption,Mast.PaymentTerms as Paycode,Payterm.PaymentTerms,LineItem.ReqNo,Requestedby,Departmentcode,DepartmentName,LineItem.CostCenterCode,SupDet.SupplierName,Import_DispatchDetails,CurrencyType,AdvancePercentage,AdvanceAmount,POAdv.Remarks');
$this->db->from('T_PurchaseOrder_Master Mast');
$this->db->join('T_PurchaseOrder_LineItem LineItem','Mast.PONO=LineItem.PONO');
$this->db->join('T_Requestion_Master ReqMa','LineItem.ReqNo=ReqMa.ReqNo');
$this->db->join('T_Employee_Details EmpDet','ReqMa.Requestedby=EmpDet.EmpID');
$this->db->join('T_DepartmentDetails DepDet','EmpDet.Departmentcode=DepDet.DEPCode');
$this->db->join('T_SupplierDetailsN SupDet','Mast.SupplierID=SupDet.SupplierID');
$this->db->join('T_PurchaseOrder_AdvanceRequest POAdv','Mast.PONO=POAdv.PONO','left');
$this->db->join('T_PaymentTerms Payterm','Mast.PaymentTerms=Payterm.PaymentID');
$this->db->where('Mast.Status',$Status);
$query = $this->db->get();
//print_r($this->db->last_query());
return $query->result();
}
//get available budget for capital
function GetAvailableCapitalBudgetAmount($CostCode,$Year,$BudgetType)
{
$subQuery ='select BudgetAmount, (select ifnull(sum(IF(POMaster.ExchangeRate>0,Quantity*Rate*POMaster.ExchangeRate,Quantity*Rate)),0) as Totalvalue from
T_PurchaseOrder_LineItem Item join T_Requestion_Master mast
on mast.ReqNo = Item.ReqNo join T_PurchaseOrder_Master POMaster on POMaster.PONO=Item.PONO where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue
from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and
BudgetYear = ? and BudgetType =?';
$query = $this->db->query($subQuery,array($CostCode,$BudgetType,$CostCode,$Year,$BudgetType));
return $query->result_array();
}
}

View File

@ -93,9 +93,9 @@ if(!empty($MRIRDetails))
</section>
<section class="content"><br/>
<div id ="content"></div>
<div class="row">
<div class="col-md-12">
<div class="col-md-12">
<div class="row" style="font-size:12px;">
<div class="col-md-12" style="padding:0px;">
<!--<div class="col-md-2">
<label for="MRIRNO">MRIR Number</label>
@ -107,7 +107,7 @@ if(!empty($MRIRDetails))
</div>
</div> -->
<div class="col-md-3">
<div class="col-md-2">
<label for="SupplierName">Supplier Name </label>
<div class="form-group">
<?php
@ -117,7 +117,7 @@ if(!empty($MRIRDetails))
</div>
</div>
<div class="col-md-1">
<div class="col-md-2">
<label for="MRIRDate">MRIR Date</label>
<div class="form-group">
<?php
@ -137,7 +137,7 @@ if(!empty($MRIRDetails))
</div>
</div>
<div class="col-md-2">
<div class="col-md-2" style="padding:0px;">
<label for="IGRNO">IGR Number</label>
<div class="form-group">
<?php
@ -170,8 +170,8 @@ if(!empty($MRIRDetails))
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">
<div class="col-md-12" style="padding:0px;">
<div class="col-md-2">
<label for="PONO">PO Number</label>
<div class="form-group">
<?php
@ -180,7 +180,7 @@ if(!empty($MRIRDetails))
?>
</div>
</div>
<div class="col-md-1">
<div class="col-md-2">
<label for="PODate">PO Date</label>
<div class="from-group">
<?php
@ -198,7 +198,7 @@ if(!empty($MRIRDetails))
?>
</div>
</div>
<div class="col-md-1">
<div class="col-md-1" style="padding:0.9px;">
<label for="DeliveryChellanOrInvoiceNo">DC / IN NO</label>
<div class="form-group">
<?php
@ -207,7 +207,7 @@ if(!empty($MRIRDetails))
?>
</div>
</div>
<div class="col-md-1">
<div class="col-md-1" style="padding:0.9px;">
<label for="DeliveryChellanDate">DC / IN Date </label>
<div class="form-group">
<?php
@ -236,7 +236,7 @@ if(!empty($MRIRDetails))
</div>
</div>
<div class="row" style="padding:2%;">
<div class="row" style="padding:1%;">
<div class="col-md-12">
<table id="mytable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
@ -310,8 +310,8 @@ if(!empty($MRIRDetails))
</div>
</div>
</div>
</div>
</section>
</div>
<script>

View File

@ -0,0 +1,507 @@
<?php
$MRIRNO="";
$mrirdate="";
$MRIRRasiedbyName="";
$IGRNO="";
$igrdate="";
$IGRRasiedbyName="";
$PONO="";
$podate="";
$PORasiedbyName="";
$VehicleNo="";
$CourierNo="";
$DeliveryChellanOrInvoiceNo="";
$SupplierName="";
$dcdate="";
$Address="";
$CreatedBy="";
$ServiceDescription="";
$RowCount = 0;
$MRIRStatus = '';
if(!empty($MRIRDetails))
{
foreach ($MRIRDetails as $MRIR)
{
$MRIRNO = $MRIR->MRIRNO;
$MRIRDate=$MRIR->MRIRCreatedon;
$mrir_date = strtotime( $MRIRDate );
$mrirdate = date( 'd/m/Y', $mrir_date );
$MRIRRasiedbyName=$MRIR->MRIRRasiedbyName;
$IGRNO = $MRIR->IGRNO;
$IGRDate = $MRIR->IGRCreated;
$igr_date = strtotime( $IGRDate );
$igrdate = date( 'd/m/Y', $igr_date );
$IGRRasiedbyName=$MRIR->IGRRasiedbyName;
$PONO = $MRIR->PONO;
$PODate=$MRIR->PODate;
$PORasiedbyName=$MRIR->PORasiedbyName;
$po_date = strtotime( $PODate );
$podate = date( 'd/m/Y', $po_date );
$VehicleNo = $MRIR->VehicleNo;
$CourierNo= $MRIR->CourierNo;
$DeliveryChellanOrInvoiceNo=$MRIR->DeliveryChellanOrInvoiceNo;
$SupplierName=$MRIR->SupplierName;
$DeliveryChellanDate=$MRIR->DeliveryChellanDate;
$dc_date = strtotime( $DeliveryChellanDate );
$dcdate = date( 'd/m/Y', $dc_date );
$Address=$MRIR->Address;
//$CreatedBy=$MRIR->CreatedBy;
$ServiceDescription=$MRIR->ServiceDescription;
$MRIRStatus = $MRIR->MRIRStatus;
}
}
?>
<script>
$(document).ready(function(){
//$("#IGRNO").select2();
$("#QualityIncharge").select2();
$("#plantIncharge").select2();
});//ready closed.
</script>
<style>
.modal
{
padding-right:25% ! important;
}
.select2
{
width: 100% ! important;
}
.num{
text-align:right;
}
.dataTables_wrapper {
padding-bottom: 0px;
}
</style>
<div class="content-wrapper" style="min-height:537px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - Edit Material Receipt And Inspection Report (MRIR) -<?php echo $MRIRNO ;?></center>
</h1>
<?php
$attributes = array('class' => 'form-label-left MRIR ','name' => 'MRIR','id' => 'MRIR');
echo form_open($this->config->base_url().'/MRIRcontroller/generateMRIR/',$attributes); ?>
</section>
<section class="content"><br/>
<div id ="content"></div>
<div class="row" style="font-size:12px;">
<div class="col-md-12" style="padding:0px;">
<!--<div class="col-md-2">
<label for="MRIRNO">MRIR Number</label>
<div class="form-group">
<?php
$data = array('name' => 'MRIRNO','value' => set_value('MRIRNO',$MRIRNO),'id'=>'MRIRNO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div> -->
<div class="col-md-2">
<label for="SupplierName">Supplier Name </label>
<div class="form-group">
<?php
$data = array('name' => 'SupplierName','value' => set_value('SupplierName',$SupplierName),'id'=>'SupplierName', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label for="MRIRDate">MRIR Date</label>
<div class="form-group">
<?php
$data = array('name' => 'MRIRDate','value' => set_value('MRIRDate',$mrirdate),'id'=>'MRIRDate', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label for="MRIRRasiedbyName">MRIR Created By</label>
<div class="form-group">
<?php
$data = array('name' => 'MRIRRaisedby','value' => set_value('MRIRRaisedby',$MRIRRasiedbyName),'id'=>'MRIRDate', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2" style="padding:0px;">
<label for="IGRNO">IGR Number</label>
<div class="form-group">
<?php
$data = array('name' => 'IGRNO','value' => set_value('IGRNO',$IGRNO),'id'=>'IGRNO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label for="IGRDate">IGR Date</label>
<div class="form-group">
<?php
$data = array('name' => 'IGRDate','value' => set_value('IGRDate',$igrdate),'id'=>'IGRDate', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label for="IGRRasiedbyName">IGR Created By</label>
<div class="form-group">
<?php
$data = array('name' => 'IGRRaisedBy','value' => set_value('IGRRaisedBy',$IGRRasiedbyName),'id'=>'IGRRaisedBy', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="col-md-12" style="padding:0px;">
<div class="col-md-2">
<label for="PONO">PO Number</label>
<div class="form-group">
<?php
$data = array('name' => 'PONO','value' => set_value('PONO',$PONO),'id'=>'PONO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label for="PODate">PO Date</label>
<div class="from-group">
<?php
$data = array('name' => 'PODate','value' => set_value('PODate',$podate),'id'=>'PODate', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label for="PORasiedbyName">PO Created By</label>
<div class="from-group">
<?php
$data = array('name' => 'PORasiedbyName','value' => set_value('PORasiedbyName',$PORasiedbyName),'id'=>'PORasiedbyName', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-1" style="padding:0.9px;">
<label for="DeliveryChellanOrInvoiceNo">DC / IN NO</label>
<div class="form-group">
<?php
$data = array('name' => 'DeliveryChellanOrInvoiceNo','value' => set_value('DeliveryChellanOrInvoiceNo',$DeliveryChellanOrInvoiceNo),'id'=>'DeliveryChellanOrInvoiceNo', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-1" style="padding:0.9px;">
<label for="DeliveryChellanDate">DC / IN Date </label>
<div class="form-group">
<?php
$data = array('name' => 'DeliveryChellanDate','value' => set_value('DeliveryChellanDate',$dcdate),'id'=>'DeliveryChellanDate', 'class' => 'form-control num','readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label for="VehicleNo">Vehicle Number</label>
<div class="form-group">
<?php
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo',$VehicleNo),'id'=>'VehicleNo', 'class' => 'form-control', 'readonly' => 'true','align' => 'left');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label for="CourierNo">Courier Number</label>
<div class="form-group">
<?php
$data = array('name' => 'CourierNo','value' => set_value('CourierNo',$CourierNo),'id'=>'CourierNo', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="row" style="padding:1%;">
<div class="col-md-12">
<table id="mytable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>S.NO</th>
<th>Item Code</th>
<th>Material Name</th>
<th>UOM</th>
<th>Ordered Quantity</th>
<th>Adviced Quantity</th>
<th>Actual Quantity Received</th>
<th>Accepted Quantity</th>
<th>Rejected Quantity</th >
<th>Remarks</th>
</tr>
</thead>
<tbody id="tbleAppend">
<?php $SNo = 0;
if(!empty($MRIRDetails))
{
foreach($MRIRDetails as $record)
{
$SNo =$SNo + 1;
//print_r($MRIRDetails);
?>
<tr id="<?php echo $SNo?>">
<td><?php echo $SNo?></td>
<td><?php echo $record->MaterialCode?></td>
<input type="hidden" name="<?php echo 'MaterialCode'.$SNo ?>" id="<?php echo 'MaterialCode'.$SNo ?>" value=" <?php echo $record->MaterialCode ?> "/>
<input type="hidden" name="<?php echo 'Lineitm'.$SNo ?>" id="<?php echo 'Lineitm'.$SNo ?>" value=" <?php echo $record->MRIRItemNo ?> "/>
<td><?php echo $record->MaterialName?></td>
<td><?php echo $record->UOM?></td>
<td class="num"><?php echo $record->Quantity?></td>
<td class="num"><?php echo $record->QuantityAsPerInvoice?></td>
<input type="hidden" name="<?php echo 'QuantityAsPerInvoice'.$SNo ?>" id="<?php echo 'QuantityAsPerInvoice'.$SNo ?>" />
<td class="num" id="<?php echo 'ActualQuantityReced'.$SNo ?>"><?php echo $record->ActualQuantityReceived ?></td>
<input type="hidden" name="<?php echo 'ActualQuantityReceived'.$SNo ?>" id="<?php echo 'ActualQuantityReceived'.$SNo ?>" value="<?php echo $record->ActualQuantityReceived ?>"/>
<td><input type="text" id="<?php echo 'AcceptQuantity'.$SNo;?>" name="<?php echo 'AcceptQuantity'.$SNo;?>" onchange="setaccept('<?php echo $SNo;?>');" value="<?php echo $record->QuantityAccepted?>"></td>
<input type="hidden" name="<?php echo 'QuantityAccepted'.$SNo ?>" id="<?php echo 'QuantityAccepted'.$SNo ?>" />
<td><input type="text" id="<?php echo 'RejectQuantity'.$SNo;?>" name="<?php echo 'RejectQuantity'.$SNo;?>" onchange="setreject('<?php echo $SNo;?>');" value="<?php echo $record->QuantityRejected?>"></td>
<input type="hidden" name="<?php echo 'QuantityRejected'.$SNo ?>" id="<?php echo 'QuantityRejected'.$SNo ?>" />
<td><input type="text" id="<?php echo 'Remark'.$SNo ?>" name="<?php echo 'Remark'.$SNo ?>" onchange="setremark('<?php echo $SNo;?>');"></td>
<input type="hidden" name="<?php echo 'Remarks1'.$SNo ?>" id="<?php echo 'Remarks1'.$SNo ?>" />
</tr>
<?php
// $SNo++;
}
}
$RowCount = $SNo;
?>
</tbody>
</table>
<div class="col-md-1 col-md-offset-10">
<?php if($MRIRStatus == MRIR_CREATED)
{ ?>
<a class="btn btn-primary" type="submit" onclick="updatemrir()">Update MRIR</a>
<?php } else {?>
<a class="btn btn-primary" onclick="Redirect()">OK</a>
<?php } ?>
<input type="hidden" name="RowCount" id="RowCount" value="<?php echo $RowCount ?>" />
<input type="hidden" name="MRIRNO" id="MRIRNO " value="<?php echo $MRIRNO ?>" />
<input type="hidden" name="status" id="status" />
</div>
</div>
</div>
</div>
</section>
</div>
<script>
function Redirect()
{
window.location ="ViewMRIR";
}
<!-- script for table , It works under the datatable plugin-->
$(function () {
$('#Inwardgateregistertable').DataTable({
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": false,
"info": false,
"autoWidth": false
});
});
</script>
<script>
function validate()
{
var rowcount = $("#RowCount").val();
var Noval = 0;
var isExceed = 0;
for(k=1;k<=rowcount ; k++)
{
var tr= document.getElementById(k);
var ActualQty = 0.0;
var cellval = tr.cells;
ActualQty = parseFloat(cellval[6].innerHTML);
var AcceptQuantity = parseFloat( $('#AcceptQuantity'+k).val() == '' ? '0.00' : $('#AcceptQuantity'+k).val());
var RejectedQuantity = parseFloat( $('#RejectQuantity'+k).val() == '' ? '0.00' : $('#RejectQuantity'+k).val());
if(AcceptQuantity != '0.00')
{
if(ActualQty < (AcceptQuantity+RejectedQuantity))
{
isExceed = 1;
return false;
}
Noval = 1;
}
else if(RejectedQuantity != 0)
{
if(ActualQty < (AcceptQuantity+RejectedQuantity))
{
isExceed = 1;
return false;
}
// Noval = 1;
}
}
//alert(Noval);
if (Noval == 0 )
{
alert('Accepted Quantity/ Rejected Quantity is Empty.Please Enter the value');
return false;
}
else if(isExceed == 1 ){
alert("Accept/Reject Quantity is exceeding the Actual Quantity.Please correct the value to procced further ")
return false;
}
else
{
return true;
}
}
function setaccept(rowId)
{
var accept = parseFloat($('#AcceptQuantity'+rowId).val());
var tr= document.getElementById(rowId);
var Actulqty = 0.0;
var cellval = tr.cells;
Actulqty = parseFloat(cellval[6].innerHTML);
var qtyAsperchellan = parseFloat($('#QuantityAsPerInvoice'+rowId).val());
var rejected = (Actulqty - accept);
$('#RejectQuantity'+rowId).val(rejected) ;
$('#QuantityRejected'+rowId).val(rejected) ;
$('#QuantityAccepted'+rowId).val(accept) ;
if(accept > Actulqty)
{
alert("Accept Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
$("#AcceptQuantity"+rowId).focus();
$("#AcceptQuantity"+rowId).val('');
$("#RejectQuantity"+rowId).val('');
$("#QuantityRejected"+rowId).val('');
return false;
}
else if(rejected > Actulqty )
{
alert("Reject Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
$("#RejectQuantity"+rowId).focus();
$("#RejectQuantity"+rowId).val('');
$("#QuantityRejected"+rowId).val('');
return false;
}
else
{
if(accept !='')
{
$('#status').val('<?php echo MRIR_APPROVED?>');
}
else
{
$('#status').val('<?php echo MRIR_REJECTED?>');
}
}
}
function setreject(rowId)
{
var tr= document.getElementById(rowId);
var Actulqty = 0.0;
var cellval = tr.cells;
Actulqty = parseFloat(cellval[6].innerHTML);
var reject = parseFloat($('#RejectQuantity'+rowId).val());
if(reject > Actulqty )
{
alert("Reject Quantity is exceeding the Actual Quantity.Please change the AcceptQuantity ")
$("#RejectQuantity"+rowId).focus();
$("#RejectQuantity"+rowId).val('');
$("#QuantityRejected"+rowId).val('');
return false;
}
}
function setremark(rowId)
{
var remark = ($('#Remark'+rowId).val());
}
</script>
<script>
function updatemrir()
{
if(validate())
{
$('#content').loader('show');
//alert("update function worked ");
$.ajax({
data:$('.MRIR').serialize(),
type:"POST",
url:"<?php echo base_url() ?>MRIRcontroller/updated_db",
success:function(data){
//alert("success function worked ");
if(data){
$('#content').loader('hide');
alert(data);
window.location ="ViewMRIR";
}
else
{
alert("value not updated");
}
}//success function closed
});//ajax function closed
}
}//update function closed
</script>

View File

@ -2337,7 +2337,7 @@ function populateValueMainFormForDeleteItem(rowid)
</div>
</div>
<div class="col-md-12">
<div class="col-md-1 col-md-offset-11" align="right" >
<div class="col-md-1 col-md-offset-10" align="right" >
<a data-toggle="modal" onclick="showmodel();" class=" btn btn-primary"> Select Line Item </a>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -274,7 +274,7 @@
<td style="text-align: center;" ><strong>Total Amount In Words</strong><br /><br /><em><?php echo $TotalAmountInWords.".";?></em></td>
<td style="text-align: center;" ><?php if($currencyName!='INR'){ ?>
Total Order Amount in <?php echo "$currencyName"."("."$currencyCode".")" ?><?php } else { ?><b>Total Order Amount in <?php echo "$currencyName"; ?><?php } ?> </b> <br/><?php if($currencyName!='INR'){ ?><?php echo number_format($OrderValue,2); } else {?> <?php echo number_format($OrderValue,2, '.', '');}?></td>
Total Order Amount in <?php echo "$currencyName"."("."$currencyCode".")" ?><?php } else { ?><b>Total Order Amount in <?php echo "$currencyName"; ?><?php } ?> </b> <br/><?php if($currencyName!='INR'){ ?><?php echo number_format($OrderValue,2, '.', ''); } else {?> <?php echo number_format($OrderValue,2, '.', '');}?></td>
</tr>
<tr>

View File

@ -0,0 +1,325 @@
<?php
$PONO = '';
$postatus ='';
$CompanyAddress = '';
$CompanyName = '';
$SuplierName = '';
$SuplierAddress = '';
$DeliveryAddress = '';
$Podt = '';
$DeliveryDate ='';
$postatus='';
$ServiceDescription = '';
$PaymentTerms = '';
$PaymentDays='';
$PayableAT='';
$DeliverySchedule='';
$Import_DispatchDetails='';
$Placeoforigin='';
$ExchangeRate='';
$CapitalRange='';
if(!empty($CompanyDetails))
{
foreach ($CompanyDetails as $CO)
{
$CompanyName = $CO->CompanyName;
$CompanyAddress = $CO->Address;
}
}
if(!empty($POItem))
{
foreach ($POItem as $PO)
{
$PONO = $PO->PONO;
$postatus= $PO->Status;
$SuplierName = $PO->SupplierName;
$SuplierAddress = $PO->Address;
$DeliveryAddress = $PO->DeliveryAddress;
$postatus= $PO->Status;
$dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata'));
$Podt = $dt->format('d-m-Y');
if($PO->DeliveryOption=='1'){
$DeliveryDate = '';
$DeliverySchedule = $PO->DeliverySchedule;
$Import_DispatchDetails='';
}
else{
$dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
$DeliveryDate = $dtDe->format('d-m-Y');
$DeliverySchedule = '';
$Import_DispatchDetails=$PO->Import_DispatchDetails;
}
$ServiceDescription =$PO->ServiceDescription;
if($PO->PaymentID!='PT08'){
$PaymentTerms = $PO->PaymentTerms;
}
else{
$PaymentTerms = $PO->PaymentTerms . ' ( '.$PO->PaymentOtherDescription.' ) ';
}
$Placeoforigin=$PO->Import_PlaceofOrgin;
$ExchangeRate = $PO->ExchangeRate;
$CapitalRange = $PO->CapitalRange;
}
}
$currencyName='INR';
$currencyCode ='';
if(!empty($CurrencySymbol))
{
foreach ($CurrencySymbol as $Curr)
{
$currencyCode = $Curr->FontCode2000;
$currencyName = $Curr->Currency_Code;
}
}
?>
<style>
@page { margin: 280px 50px 30px 50px; }
.header { position: fixed; left: 0px; top: -280px; right: 0px; height: 550px;text-align: center; }
.footer { position: fixed; bottom: 0px; }
.pagenum:before { content: counter(page); }
</style>
<div class="footer">Page: <span class="pagenum"></span></div>
<div class="header">
<div style="text-align:right;">
<?php
if ($postatus == 'ST026')
{}
else
{
echo '<div><b>DRAFT</b> </div>';
}
?>
</div>
<center> <span style="font-size:24px;">PURCHASE ORDER - <a style="color:#515151">PO NO:<?php echo $PONO?>/C </a></span></center>
<table style="border-collapse: collapse;font-size:12px;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="3">
<p style="color:#3c8dbc;font-size:16px;"><strong><?php echo $CompanyName; ?></strong></p>
<p> <?php echo $CompanyAddress; ?></p>
</td>
<td align="right"><img width="100" height="100" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA11JREFUeNrsnT9IHEEYxWfFw8rgpUhlo5URi2gTbIUUSrq1ui4oRLRIY9JIKrGKTQrBgJLuuutEi4CtSSOpPIuATdIEcid2YpN9C3sc8c6bf7uZmX0P7k7ultm7337zzXxvZjGaiaIfQoiqoHTUHk6eniSPUbLQUmUoebojB23dDZGBmQiQAAmQAAmQIkACJEACpAiweA3bbvDV5mb6+iKOxfTc3MDjf15dicbBQfr3591d7wBGM1H0J3l9bNLI84UFsby6mkIzFWACJMCafJ9PJyfSx29vbHQuoqJaxl34zc5O+mVtwIPi5EIcXV52IjnoLvx+by/9wXkIF8aHbq0dgYi4vOB1Q7QV2c4BXM4Z3r+RGBTAR9VqmqhVBoZnIyOdx9taTXqQGJ+YUDqXFwBV4WGU69aXRkNsr69LtyEzHfIKIKJCVl9PT3u+/63P+6bnC64SuWm3jdsYn5xkKcdamCJAAiwjQJcHAC8ATs/OBg1Qy0y4ub6WPhb1cuPwUFycn9/77OPWlvXzeQGw2QPGQ9o/PhZrS0v3IPpooFrpwgChYniidq6fnTnvrBSaA3Uc3A/1uvPuSmEA0f0uFLsyBKcZDjaisvSj8DsFW6pbcHPQpV12WQoBCHhri4taEOGwhJAXjeeBgFebn1eyp0LKi1Ym0rCsXieRqLk06HVetFqJwHmWnRz3yotHzabT9n0hpRxGZ0SjjpGKCEQkxgUtWDlbCyMfIi/qTHMgrDf7srCem5mQDS5YQNKRD2vCuQLMhCVM3bwIiK4PLIUYqrp5EXPFeGWFALO8CEdGddId7NYOHWFQUa1cUO4Fty78/fZW6tFrjx7gqfqAT0PbmWAqVCwq+bDUOxMeyokh6L8B1J1kE2BgIkACJMDyAbSx56/cACV3CoyOjfX9rNSrcrI7E/qVYYCnYhKY3LXkJECVOdx+Us51m6Nwm7HVQyUCf4UGEJuFZPMgIhC+XlYfw21WWQ/GxXJ50q09iBS1MSjYW73ww3SXMVXOobsk4MU80GQZc5DQbl5tOzWRRpS8nJqy1tUAzWZ7ecvKDdfdggWfTV0GbdnA4JB1UdhbHjo0LesAS6YWa2GaCQRIgARIESABEiABUgRIgARYRoAVYtBWBfcL/xb8hwS6av8VYADVjF2M5sTWJAAAAABJRU5ErkJggg=="></td>
</tr>
<tr>
<td>
<p><strong>Vendor Address :</strong></p>
<p><?php echo $SuplierName; ?><br /><?php echo $SuplierAddress; ?></p>
</td>
<td colspan="3">
<p><strong>Delivery To :</strong></p>
<p><?php echo $DeliveryAddress; ?></p>
</td>
</tr>
<?php if ($CapitalRange =='0') { ?>
<tr>
<td>PO DATE :&nbsp;&nbsp;<?php echo $Podt; ?></td>
<td colspan="2">DISPATCH / SCHEDULE BY :&nbsp;&nbsp;<?php echo $Import_DispatchDetails.$DeliverySchedule;?></td>
<td>PLACE OF ORIGIN:<?php echo $Placeoforigin; ?></td>
</tr><?php } else {?>
<tr>
<td>PO DATE :&nbsp;&nbsp;<?php echo $Podt; ?></td>
<td colspan="3">DELIVERY DATE/ SCHEDULE BY :&nbsp;&nbsp;<?php echo $DeliveryDate.$DeliverySchedule;?></td>
</tr><?php }?>
</tbody>
</table>
</div>
<div class="page" style="font-size:12px;">
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr bgcolor="#8c8c8c" color="#fff">
<td>Requistion Number</td>
<td>Requistion Date</td>
<td>Requested By</td>
<td>Requested Department</td>
<td>Cost Center &nbsp;</td>
</tr>
<?php
if(!empty($RequistionDetails))
{
foreach($RequistionDetails as $ReqDetails)
{
?>
<tr>
<td><?php echo $ReqDetails['RequistionNo']; ?></td>
<td><?php echo $ReqDetails['ReqDate']; ?></td><!--Requistion Date code should come from DB-->
<td><?php echo $ReqDetails['RequestedName']; ?></td>
<td><?php echo $ReqDetails['RequestedDept']; ?></td>
<td><?php echo $ReqDetails['CostCenterCode']; ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<table style="border-collapse: collapse;" border="1" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr bgcolor="#8c8c8c" color="#fff">
<th>#</th>
<th>Item Code</th>
<th>Item Name</th>
<th>HSN Code</th>
<th>Qty</th>
<th>UOM</th>
<?php if($currencyName!='INR'){ ?>
<th>Rate Per Unit in <?php echo "$currencyName"."("."$currencyCode".")"?></th>
<?php
} else{
?>
<th>Rate Per Unit in <?php echo "$currencyName";?></th><?php } ?>
<?php if($currencyName!='INR'){ ?>
<th>Total Amount in <?php echo "$currencyName"."("."$currencyCode".")"?></th>
<?php
} else{
?>
<th>Total Amount in <?php echo "$currencyName";?></th><?php } ?>
</tr>
<?php
if(!empty($POItem))
{
$index = 0;
$TotalAmount = 0;
$OrderValue = 0;
foreach($POItem as $record)
{
$index = $index + 1;
$OrderValue= $OrderValue + $record->Quantity*$record->Rate;
?>
<tr style="line-height: 1.5em;">
<td><?php echo $index ; ?></td>
<td> <?php echo $record->MaterialCode ; ?></td>
<td><?php echo $record->MaterialName ; ?></td>
<td><?php echo $record->HSNCODE ; ?></td>
<td align="right"><?php echo $record->Quantity ; ?></td>
<td align="right"><?php echo $record->UOM ; ?></td>
<td align="right"><?php echo number_format(($record->Rate),2, '.', '') ; ?></td>
<td align="right"><?php echo number_format(($record->Quantity * $record->Rate),2, '.', '');?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<p><strong>Payment Terms:</strong>&nbsp;<?php echo $PaymentTerms;?></p>
<p><strong>Special Instruction:</strong></p>
<p><?php echo $ServiceDescription;?></p>
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" border="1" width="100%">
<tbody>
<tr>
<td style="text-align: center;" ><strong>Total Amount In Words</strong><br /><br /><em><?php echo $TotalAmountInWords.".";?></em></td>
<td style="text-align: center;" ><?php if($currencyName!='INR'){ ?>
Total Order Amount in <?php echo "$currencyName"."("."$currencyCode".")" ?><?php } else { ?><b>Total Order Amount in <?php echo "$currencyName"; ?><?php } ?> </b> <br/><?php if($currencyName!='INR'){ ?><?php echo number_format($OrderValue,2, '.', ''); } else {?> <?php echo number_format($OrderValue,2, '.', '');}?></td>
</tr>
<tr>
<td>
<?php
if(!empty($releasedetails)){
$releasedOn = '';
foreach($releasedetails as $detail){
$releasedOn= new DateTime($detail->ReleasedOn, new DateTimeZone('Asia/Kolkata'));
?>
<p>&nbsp;</p>
<div align="Left"> <b>Released By : </b><?php echo $detail->FirstName;?></div>
<div align="Left"> <b>Released On : </b><?php echo $releasedOn->format('d-m-Y');?></div>
<?php
}
}
else {
?>
<?php } ?>
</td>
<td style="text-align: center;">
<p><font size="1">Certified that the particulars given above are true and correct</font></p>
<p><?php echo $CompanyName; ?></p>
<p>&nbsp;</p>
<p>Authorized Signatory</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>

View File

@ -24,7 +24,7 @@
if(!empty($AvlBudAmt))
{
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
$AvlAmount = number_format($AvlCapitalBudAmt, 2, '.', '');
}
@ -67,6 +67,9 @@ if(!empty($INRSYMBOL))
.select2{
width:100% ! important;
}
.num{
text-align:right;
}
#DomesticNOT {
margin-top:200px;
z-index: 1080 !important;
@ -85,6 +88,7 @@ if(!empty($INRSYMBOL))
toolbar: false
});
$(document).ready(function(){
$("#PaymentMethod").select2();
clearTotalItemValues();
$('#CapitalToatlOrder').val(0);
//Initialize Select2 Elements

File diff suppressed because it is too large Load Diff

View File

@ -127,7 +127,7 @@ if(!empty($POMaster))
if(!empty($AvlBudAmt))
{
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
$AvlAmount = number_format($AvlCapitalBudAmt, 2, '.', '');
}
?>
@ -146,6 +146,9 @@ if(!empty($AvlBudAmt))
.select2{
width:100% ! important;
}
.num{
text-align:right;
}
</style>
<script src="<?php echo base_url() ?>assets/tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
@ -160,6 +163,8 @@ if(!empty($AvlBudAmt))
var SchName = <?php echo json_encode($DeliverSchedule); ?>;
var DelDt = '<?php echo $Deliverydt; ?>';
$(document).ready(function () {
$("#PaymentTerms").select2();
if(DelOpt=="0"){
$('#Deliverydtdiv').hide();
$('#Schedulediv').hide();
@ -246,7 +251,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<script>
$(document).ready(function(){
$("#PaymentMethod").select2();
//Initialize Select2 Elements
$("#drpSupplier").select2();
$("#Reqnumber").select2();
@ -422,7 +427,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<div class="col-md-4">
<div class="col-md-12">
<b><u>Select Delivery By</u></b><br/>
<b><u>Select Delivery By</u></b>
<tr>
<div id="dispatchinternational" style="display:none;">
<td>
@ -441,8 +446,8 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</tr>
</div>
<div class="col-md-12" id="Schedulediv" style="display:none;"><br/>
<label >Schedule </label>
<div class="col-md-12" id="Schedulediv" style="display:none;">
<label >Schedule BY</label>
<?php
$data = array('name' => 'Scheduleby','value' => set_value('Scheduleby'),'id'=>'Scheduleby', 'class' => 'form-control' ,'required' => 'true' ,'rows' => '3', 'cols' => '40');
@ -528,7 +533,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<div class="col-md-12">
<legend>Payment Details</legend>
<!-- Text input-->
<div class="col-md-3">
<div class="col-md-4">
<label for="payablefrom">Payable Terms</label>
<?php
@ -556,7 +561,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
endforeach;
}
echo form_dropdown('PaymentMethod', $options6,set_value('PaymentMethod',$PaymentTerms),'id="PaymentMethod"' ,'required="true"' ,'class="form-control select2');
echo form_dropdown('PaymentMethod', $options6,set_value('PaymentMethod',$PaymentTerms),'id="PaymentMethod"' ,'required="true"' ,'class="form-control select2"');
?>
@ -735,7 +740,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<?php
if($POStatus == PO_DRAFT || PO_CREATED)
if($POStatus == PO_DRAFT || $POStatus == PO_CREATED)
{?>
<td> <a data-target='#EDITCAPITAL' data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-toggle="modal" href="#EDITCAPITAL"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->ReqNo ; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<?php echo $index ; ?>)" class="link" data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
<?php
@ -2736,7 +2741,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
<label >Total Order Value<?php echo "($INR)"?> </label>
<?php
$data = array('name' => 'CapitalToatlOrder','value' => set_value('CapitalToatlOrder',number_format($totalCapitalOrder, 2, '.', '')),'id'=>'CapitalToatlOrder', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:left;');
$data = array('name' => 'CapitalToatlOrder','value' => set_value('CapitalToatlOrder',number_format($totalCapitalOrder, 2, '.', '')),'id'=>'CapitalToatlOrder', 'class' => 'form-control' ,'readonly' => 'true','style'=>'text-align:right;');
echo form_input($data);
?>
</div>
@ -2748,30 +2753,41 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
echo form_textarea($data);
?>
</div>
<div class="col-md-12" style="padding:1% 0%;">
<div class="col-md-12">
<div class="col-md-8">
<div class="row" style="padding-top:1%;">
<div class="col-md-2"><label>Request On</label></div>
<div class="col-md-4">
<label>Request On</label>
<?php
$data = array('name' => 'Requeston','value' => set_value('Requeston',$UpdatedOn),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
$data = array('name' => 'Requeston','value' => set_value('Requeston',$UpdatedOn),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;','readonly' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<label>Request By</label>
</div><br/>
<div class="row">
<div class="col-md-2"><label>Request By</label></div>
<div class="col-md-4">
<?php
$data = array('name' => 'RequestBy','value' => set_value('RequestBy',$requestedBy),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true');
$data = array('name' => 'RequestBy','value' => set_value('RequestBy', $requestedBy),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<label>Status</label>
</div><br/>
<div class="row"><div class="col-md-2"><label>Status</label></div>
<div class="col-md-4">
<?php
$data = array('name' => 'Status','value' => set_value('Status',$PoStatusName),'id'=>'Status', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
$data = array('name' => 'Status','value' => set_value('Status',$PoStatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><br/>
</div>
</div>
</div>
<div align="right" style="padding:1% 0%;">
<input type="hidden" name="txtPoRange" id="txtPoRange" />
@ -2784,7 +2800,7 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
if($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED){?>
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)" >&nbsp;&nbsp;<span class="bold">Save</span></a> <?php }?>
<a class="btn btn-primary Save" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<input type="reset" class="btn btn-primary" value="Reset">
<input type="reset" class="btn btn-primary" value="Reset"/>
<?php }else {?>
<a class="btn btn-primary" ID="OK" href="<?php echo base_url().'purchaseorderListing'; ?>">&nbsp;&nbsp;<span class="bold">OK</span></a> <?php } ?>
@ -2793,9 +2809,9 @@ document.getElementById('currencyTypeDiv').style.display = 'block';
</div>
</div>
</section>
</div>
</section>
</div>
<script src="<?php echo base_url(); ?>assets/js/CreatePOValidation.js" type="text/javascript"></script>
<script type="text/html" id="CapitalList">
<tr id="<%=index%>">

File diff suppressed because it is too large Load Diff

View File

@ -216,15 +216,7 @@ $(function() {
minDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
$("#Requeston").datepicker({
//minDate : d,
maxDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
$('#drpSupplier').change(function() {
@ -3540,7 +3532,7 @@ function calculateEditTaxValue()
<div class="col-md-4">
<?php
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;','readonly' => 'true');
echo form_input($data);
?>
</div>
@ -3549,7 +3541,7 @@ function calculateEditTaxValue()
<div class="col-md-2"><label>Request By</label></div>
<div class="col-md-4">
<?php
$data = array('name' => 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true');
$data = array('name' => 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -185,11 +185,7 @@ $("#PODate").datepicker({
minDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10'
});
$("#Requeston").datepicker({
//minDate : d,
maxDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
$('#drpSupplier').change(function() {
var id = $('#drpSupplier').val();
@ -812,7 +808,8 @@ $(document).ready(function () {
</div>
<div class="col-md-4" id="otheroptiondiv" style="display:none;">
<label><span class="badge" style="color:red;">*</span></label>
<label>Description of Payable Terms<span class="badge" style="color:red;text-align:right;background-color: #ecf0f5 ;">*</span></label>
<div class="form-group">
<?php
@ -1306,37 +1303,41 @@ $(document).ready(function () {
</div>
</div>
<br/>
</div><br/>
<div class="col-md-12" style="padding:5px;">
</div><br/>
<div class="col-md-12">
<div class="col-md-8">
<div class="row">
<div class="col-md-2"><label>Request On</label></div>
<div class="col-md-4">
<span>Request On</span>
<?php
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
$data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<span>Request By</span>
</div><br/>
<div class="row">
<div class="col-md-2"><label>Request By</label></div>
<div class="col-md-4">
<?php
$data = array('name' => 'RequestBy','value' => set_value('RequestBy',$RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true');
$data = array('name' => 'RequestBy','value' => set_value('RequestBy', $RequesterName),'id'=>'RequestBy', 'class' => 'form-control' ,'required' => 'true','readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="col-md-4">
<span>Status</span>
<?php
// $options = array("0"=>'Select Status');
// echo form_dropdown('Status', $options,set_value('Status'),'id="Status"' ,'required="true"' ,'class="form-control select2')
// $options = array("0"=>$PONOStatus);
// echo form_dropdown('Status', $options,set_value('Status',$StatusName),'id="Status"' ,'required="true"' ,'class="form-control select2')
</div><br/>
<div class="row"><div class="col-md-2"><label>Status</label></div>
<div class="col-md-4">
<?php
$data = array('name' => 'Status','value' => set_value('Status',$StatusName),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><br/>
</div>
</div>
</div>
</div>
</div>
</div>
@ -1883,7 +1884,7 @@ function validateServiceTax()
}
//
</script>
// <script>
<script>
// $('#PaymentTerms').change(function() {
// var data=$('#PaymentTerms option:selected').text();
// $('#beforePaymentTermsText').val(data);

File diff suppressed because it is too large Load Diff

View File

@ -58,7 +58,7 @@ Inputmask("A{2,3} 9{1,2} A{1,2} 9{4}").mask($("#VehicleNo"));
</h1>
</section>
<section class="content"><br/>
<div class="row" style="padding-bottom:1%">
<div class="row" >
<div id="content" > </div>
<div class="col-md-12">
<div class="col-md-2">

View File

@ -0,0 +1,576 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/3.3.4/jquery.inputmask.bundle.min.js"></script>
<script>
$(document).ready(function(){
$("#PONO").select2();
$("#InvoiceDate").datepicker({
maxDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
});
//jquery for vechicle masking
$(document).ready(function(){
Inputmask("A{2,3} 9{1,2} A{1,2} 9{4}").mask($("#VehicleNo"));
});
</script>
<style>
.modal {
text-align: center;
padding: 0!important;
}
.modal:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -4px;
}
.modal-dialog {
display: inline-block;
text-align: left;
vertical-align: middle;
}
.select2 {
width: 100% ! important;
}
.num {
text-align:right;
}
.dataTables_wrapper {
padding-bottom: 0px;
}
</style>
<div class="content-wrapper" style="min-height:537px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - Inward Gate Register (IGR) Entry</center>
</h1>
</section>
<section class="content"><br/>
<div class="row" >
<div id="content" > </div>
<div class="col-md-12">
<div class="col-md-2">
<?php
$attributes = array('class' => 'form-label-left IGR ','name' => 'IGR','id' => 'IGR');
echo form_open($this->config->base_url().'/inwardgateregister/addNewigr/',$attributes); ?>
<label>Select Purchase Order NO </label>
<?php
$options = array("-1"=>'Purchase Order No');
if(!empty($PO_NO))
{
//print_r($PO_NO);
foreach ($PO_NO as $SI):
$options[$SI->PONO] = $SI->PONO .'-'. $SI->SupplierName ;
$PONO = $SI->PONO;
endforeach;
}
echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"');
?>
</div>
<div class="col-md-2">
<label>Supplier Name </label>
<div class="form-group">
<?php
$data = array('name' => 'SupplierName','value' => set_value('SupplierName'),'id'=>'Sup', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2">
<label>Delivery Challan/Invoice NO</label>
<?php
$data = array('name' => 'InvoiceNo','value' => set_value('InvoiceNo'),'id'=>'InvoiceNo', 'class' => 'form-control', 'required=>"true"' );
echo form_input($data);
?>
</div>
<div class="col-md-2">
<label>Delivery Challan/Invoice Date</label>
<?php
$data = array('name' => 'InvoiceDate','value' => set_value('InvoiceDate'),'id'=>'InvoiceDate', 'class' => 'form-control num', 'required'=>'true' );
echo form_input($data);
?>
</div>
<div class="col-md-2">
<label>Vechicle NO</label>
<?php
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo'), 'id'=>'VehicleNo', 'class' => 'form-control', );
echo form_input($data);
?>
<span pattern="" required="true"></span>
</div>
<div class="col-md-2">
<label>Courier NO</label>
<?php
$data = array('name' => 'CourierNo','value' => set_value('CourierNo'),'id'=>'CourierNo', 'class' => 'form-control' );
echo form_input($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table id="Inwardgateregistertable" class="table table-bordered table-hover editabletable IGR_Line" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>S.NO</th>
<th>Item Code</th>
<th>Material</th>
<th>UOM</th>
<th>Ordered Quantity</th>
<th>Received Quantity</th>
<th>Pending Quantity</th>
<th>Advised Quantity</th>
<th>Remarks</th>
</tr>
</thead>
<tbody id ="IGRappend">
</tbody>
</table>
<input type="hidden" name="txtRowCount" id="txtRowCount" />
</div>
<div class="col-md-1 col-md-offset-10">
<!--<a class="btn btn-primary" type="submit" id="Save" onclick="Save(0);">Generate IGR</a>-->
<a class="btn btn-primary" id='IGRLink' name='IGRLink' onclick="Save();">Generate IGR</a>
</div>
</div>
<div class="modal fade" id="generateIGR" role="dialog">
<div class="modal-dialog modal_style">
<!-- Modal content-->
<form>
<div class="modal-content">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Inward Gate Register Number</h4></center>
</div>
<div class="col-md-12"> <br/>
<center></center>
<center><label style="font-size:40px;" id="finaligr" >Default</label> <center>
</div>
<div class="modal-footer">
<center>
<button type="reset" value="Reset" onClick="window.location.reload()"> OK</button>
</center>
</div><!-- footer div closed -->
</div><!-- modal content div closed-->
</form><!-- form closed-->
</div><!-- modal content closed-->
</div><!-- modal fade closed-->
<!-- new modal ended-->
<!-- new modal ended-->
</div>
</section>
</div>
<script>
<!-- script for table , It works under the datatable plugin-->
function validate_Vechicle(){
var reg = /^^[A-Z]{2}\s[0-9]{2}\s[A-Z]{2}\s[0-9]{4}$/;
// alert();
var VehicleNo = $('#VehicleNo').val();
if(VehicleNo != "")
{
if (reg.test(VehicleNo) == false)
{
alert('Please Enter Valid Vehicle Number');
return (false);
}
else
{
return true;
}
}
}
function validate()
{
var rowcount = $("#txtRowCount").val();
var Noval = 0;
var isExceed = 0;
for(k=1;k<=rowcount ; k++)
{
var AdvisedQty = parseFloat( $('#QuantityAsPerInvoice'+k).val() == '' ? '0.00' : $('#QuantityAsPerInvoice'+k).val());
var RecQty = parseFloat( $('#txtReceivedQuantity'+k).val() == '' ? '0.00' : $('#txtReceivedQuantity'+k).val());
var OrderedQty =parseFloat($('#Quantity_1'+k).text());
if(AdvisedQty != '0.00')
{
if(OrderedQty < (AdvisedQty+RecQty))
{
isExceed = 1;
return false;
}
Noval = 1;
}
}
if($('#PONO').val()=='-1')
{
alert("Please select PurchaseOrder");
$('#PONO').focus();
return false;
}
else if($('#InvoiceNo').val() == '' )
{
alert('Please Enter Invoice Number' );
$('#InvoiceNo').focus();
return false;
}
else if($('#InvoiceDate').val() == '' )
{
alert('Please Enter Invoice Date' );
$('#InvoiceDate').focus();
return false;
}
else if (Noval == 0 )
{
alert('Advised Quantity is Empty.Please Enter the value');
return false;
}
else if($('#VehicleNo').val() == '' && $('#CourierNo').val() == '')
{
alert('Please Enter the Vechicle / Courier Number');
return false;
}
else if(isExceed == 1 ){
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
return false;
}
else
{
return true;
}
}
</script>
<script>
$(function () {
$('#Inwardgateregistertable').DataTable({
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": false,
"info": false,
"autoWidth": false
});
});
</script>
<script>
// $(function() {
function removeHidden()
{
var rowcount = $("#txtRowCount").val();
for(k=1;k<=rowcount ; k++)
{
$("#MaterialCode"+k).remove();
$("#txtQuantityAsPerInvoice"+k).remove();
$("#OrderedQuantity"+k).remove();
$("#txtReceivedQuantity"+k).remove();
$("#txtRemarks"+k).remove();
$("#txtPendingQty"+k).remove();
}
}
$('#PONO').change(function() {
removeHidden();
$("#IGRappend").empty();
$('#txtRowCount').val('');
var id = $('#PONO').val();
var status= '';
if(id != '-1')
{
$('#content').loader('show');
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
if(id == obj.PONO)
{
$("#po").val(obj.PONO);
$("#Sup").val(obj.SupplierName);
//$("#Add").val(obj.Address);
$("#del").val(obj.DeliveryDate);
//$("#ser").val(obj.ServiceDescription);
status = obj.status;
}
});
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url() ?>inwardgateregister/IGRITEM",
success:function(data) {
//alert(data);
$('#content').loader('hide');
//alert(data);
var trHTML = '';
$.each(JSON.parse(data), function (i, item) {
i=i+1;
trHTML += '<tr>' +
'<td align="right">' + i + '</td>' +
'<td name="MaterialName" id="MaterialCode" >' + item.MaterialCode + '</td>' +
'<td>' + item.MaterialName + '</td>' +
'<td name="UOM">' + item.UOM + '</td>' +
'<td name="Quantity1'+i+'" id="Quantity_1'+i+'">' + item.Quantity + '</td>' +
'<td name="ReceivedQuantity'+i+'" id="ReceivedQuantity'+i+'">'+ item.ReceivedQuantity +'</td>'+
'<td name="PendingQuantity'+i+'" id="PendingQuantity'+i+'">'+ item.PendingQty +'</td>'+
'<td data-name="sel" ><input type="text" onchange="validateReceivedQuantity('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" value="" onkeypress="return isNumberKey(event);"></td>' +
'<td><input type="text" id="Remark'+ i +'" name="Remark'+ i +'" class="form" onchange="SetRemarks('+i+')"> </td>' +
'</tr>';
$('#txtRowCount').val(i);
$('<input>').attr({
type: 'hidden',
id: 'MaterialCode'+i,
value:item.MaterialCode,
name: 'MaterialCode'+i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtQuantityAsPerInvoice'+i,
name: 'txtQuantityAsPerInvoice'+i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'OrderedQuantity'+i,
value:item.Quantity,
name: 'OrderedQuantity'+i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtReceivedQuantity'+i,
name: 'txtReceivedQuantity'+i,
value:item.ReceivedQuantity
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtRemarks'+i,
name: 'txtRemarks'+i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtPendingQty'+i,
name: 'txtPendingQty'+i,
value:item.PendingQty
}).appendTo('form');
//alert(item.PendingQty);
if(item.PendingQty == 0.00)
{
//alert('inside if');
$('#QuantityAsPerInvoice'+i).attr('readonly', 'true');
// $('#txtEditFreight').attr('readonly', 'true');
}
});
$("#IGRappend").empty();
$('#IGRappend').append(trHTML);
}
});
if(status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>' )
{
alert('The Order is completed!!');
$("#IGRLink").hide();
}
else
{
$("#IGRLink").show();
}
}
else
{
alert('Please Select the Purchase Order Number to Create IGR');
}
});
function SetRemarks(RowId)
{
var remks = $("#Remark"+RowId).val();
if( remks != '')
{
$("#txtRemarks"+RowId).val(remks);
}
}
function validateReceivedQuantity(Rowid){
//alert(Rowid);
var InvoiceQty = parseFloat( $('#QuantityAsPerInvoice'+Rowid).val() == '' ? '0.00' : $('#QuantityAsPerInvoice'+Rowid).val());
var PendingQty = parseFloat( $('#PendingQuantity'+Rowid).text() == '' ? '0.00' : $('#PendingQuantity'+Rowid).text());
var RecQty = parseFloat( $('#txtReceivedQuantity'+Rowid).val() == '' ? '0.00' : $('#txtReceivedQuantity'+Rowid).val());
var OrderedQty =parseFloat($("#Quantity_1"+Rowid).text());
var r =$("#Remark"+Rowid).val();
// alert(RecQty);
//alert(InvoiceQty);
if((InvoiceQty+RecQty) > OrderedQty){
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
$("#QuantityAsPerInvoice"+Rowid).focus();
$("#QuantityAsPerInvoice"+Rowid).val('');
return false;
}
else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){
alert("Order is completed.")
$("#QuantityAsPerInvoice"+Rowid).focus();
$('#QuantityAsPerInvoice'+Rowid).val('');
return false;
}
else {
// alert(RecQty);
$('#PendingQuantity'+Rowid).text((OrderedQty - (InvoiceQty+RecQty)).toFixed(2));
$('#txtPendingQty'+Rowid).val(OrderedQty - (InvoiceQty+RecQty));
$("#ReceivedQuantity"+Rowid).val(InvoiceQty+RecQty);
$("#txtQuantityAsPerInvoice"+Rowid).val(InvoiceQty);
// InvoiceQty
return true;
}
}
</script>
<script>
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57))
return false;
return true;
}
function Save()
{
//alert("save function worked ");
if (validate())
{
// alert($('#Inwardgateregistertable').rows.count);
//alert(" if condition validation part ");
$('#content').loader('show');
$.ajax({
data:$('.IGR').serialize(),
type:"POST",
url:"<?php echo base_url() ?>inwardgateregister/addNewigr",
success:function(data) {
if(data){
$('#content').loader('hide');
document.getElementById('finaligr').innerHTML=data;
$('#generateIGR').modal('show');
}
else
{
alert("Error");
}
}//success function closed
});//ajax closed
}//validate if closed
}//save function closed
</script>

View File

@ -87,7 +87,7 @@ if(!empty($IGRDetails))
<section class="content"><br/>
<div id="content"></div>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="col-md-12 col-sm-12">
<div class="col-md-3 col-sm-3">
<label for="IGRNO">Inward Gate Register Number</label>
@ -99,7 +99,7 @@ if(!empty($IGRDetails))
</div>
</div>
<div class="col-md-3 col-sm-3">
<div class="col-md-2 col-sm-2">
<label for="IGRNO">Inward Gate Register Date</label>
<div class="form-group">
<?php
@ -128,7 +128,7 @@ if(!empty($IGRDetails))
?>
</div>
</div>
<div class="col-md-2 col-sm-2">
<div class="col-md-3 col-sm-3">
<label for="PORasiedbyName">Purchase Order Created By</label>
<div class="from-group"><?php
$data = array('name' => 'PORasiedbyName','value' => set_value('PORasiedbyName',$PORasiedbyName),'id'=>'PORasiedbyName', 'class' => 'form-control' ,'readonly' => 'true');
@ -148,8 +148,8 @@ if(!empty($IGRDetails))
?>
</div>
</div>
<div class="col-md-3 col-sm-3">
<label for="DeliveryChellanOrInvoiceNo">Delivery Challan / Invoice Number</label>
<div class="col-md-2 col-sm-2">
<label for="DeliveryChellanOrInvoiceNo">DC / Inv Number</label>
<div class="form-group">
<?php
@ -159,7 +159,7 @@ if(!empty($IGRDetails))
</div>
</div>
<div class="col-md-2 col-sm-2">
<label for="DeliveryChellanDate">Delivery Challan / Invoice Date </label>
<label for="DeliveryChellanDate">DC / Inv Date </label>
<div class="form-group"><?php
$data = array('name' => 'DeliveryChellanDate','value' => set_value('DeliveryChellanDate',$dcdate),'id'=>'DeliveryChellanDate', 'class' => 'form-control num','readonly' => 'true');
echo form_input($data);
@ -175,7 +175,7 @@ if(!empty($IGRDetails))
?>
</div>
</div>
<div class="col-md-2 col-sm-2">
<div class="col-md-3 col-sm-3">
<label for="CourierNo">Courier Number</label>
<div class="form-group"><?php
$data = array('name' => 'CourierNo','value' => set_value('CourierNo',$CourierNo),'id'=>'CourierNo', 'class' => 'form-control','readonly' => 'true');
@ -186,12 +186,12 @@ if(!empty($IGRDetails))
</div>
</div>
</div>
<div class="row" style="padding:2%;">
<div class="row" style="padding:1%;">
<div class="col-md-12 col-sm-12">
<table id="mytable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
@ -249,7 +249,7 @@ if(!empty($IGRDetails))
</tbody>
</table>
<div id="content"></div>
<div class="col-md-1 col-md-offset-11">
<div class="col-md-1 col-md-offset-10">
<a class="btn btn-primary" type="submit" onclick="savemrir()">Generate MRIR</a>
<input type="hidden" name="RowCount" id="RowCount" value="<?php echo $RowCount ?>" />
</div>

View File

@ -0,0 +1,394 @@
<?php
$IGRNO="";
$PONO="";
$VehicleNo="";
$CourierNo="";
$DeliveryChellanOrInvoiceNo="";
$SupplierName="";
$DeliveryChellanDate="";
$dcdate="";
$Address="";
$PORasiedbyName="";
$PODate="";
$podate="";
$IGRDate="";
$igrdate="";
$ServiceDescription="";
$RowCount = 0;
if(!empty($IGRDetails))
{
foreach ($IGRDetails as $IGR)
{
$IGRNO = $IGR->IGRNO;
$PONO = $IGR->PONO;
$VehicleNo = $IGR->VehicleNo;
$CourierNo= $IGR->CourierNo;
$DeliveryChellanOrInvoiceNo=$IGR->DeliveryChellanOrInvoiceNo;
$SupplierName=$IGR->SupplierName;
//$DeliveryChellanDate=$IGR->DeliveryChellanDate;
$dc_date = new DateTime( $IGR->DeliveryChellanDate );
$dcdate = $dc_date->format('d/m/Y');;
$Address=$IGR->Address;
$PORasiedbyName=$IGR->FirstName;
$PODate=$IGR->PODate;
$po_date = strtotime( $PODate );
$podate = date( 'd/m/Y', $po_date );
$IGRDate=$IGR->CreatedDate;
$igr_date = strtotime( $IGRDate );
$igrdate = date( 'd/m/Y', $igr_date );
$ServiceDescription=$IGR->ServiceDescription;
}
}
?>
<script>
$(document).ready(function(){
$("#QualityIncharge").select2();
$("#plantIncharge").select2();
});//ready closed.
</script>
<style>
.modal
{
padding-right:25% ! important;
}
.select2
{
width: 100% ! important;
}
.num{
text-align:right;
}
.dataTables_wrapper {
padding-bottom: 0px;
}
</style>
<div class="content-wrapper" style="min-height:537px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - Material Receipt And Inspection Report (MRIR)</center>
</h1>
<?php
$attributes = array('class' => 'form-label-left MRIR ','name' => 'MRIR','id' => 'MRIR');
echo form_open($this->config->base_url().'/MRIRcontroller/generateMRIR/',$attributes); ?>
</section>
<section class="content"><br/>
<div id="content"></div>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="col-md-3 col-sm-3">
<label for="IGRNO">Inward Gate Register Number</label>
<div class="form-group">
<?php
$data = array('name' => 'IGRNO','value' => set_value('IGRNO',$IGRNO),'id'=>'IGRNO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2 col-sm-2">
<label for="IGRNO">Inward Gate Register Date</label>
<div class="form-group">
<?php
$data = array('name' => 'IGRDate','value' => set_value('IGRDate',$igrdate),'id'=>'IGRDate', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2 col-sm-2">
<label for="PONO">Purchase Order Number</label>
<div class="form-group"><?php
$data = array('name' => 'PONO','value' => set_value('PONO',$PONO),'id'=>'PONO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2 col-sm-2">
<label for="PODate">Purchase Order Date</label>
<div class="from-group">
<?php
$data = array('name' => 'PODate','value' => set_value('PODate',$podate),'id'=>'PODate', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-3 col-sm-3">
<label for="PORasiedbyName">Purchase Order Created By</label>
<div class="from-group"><?php
$data = array('name' => 'PORasiedbyName','value' => set_value('PORasiedbyName',$PORasiedbyName),'id'=>'PORasiedbyName', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="col-md-12 col-sm-12">
<div class="col-md-3 col-sm-3">
<label for="SupplierName">Supplier Name </label>
<div class="form-group">
<?php
$data = array('name' => 'SupplierName','value' => set_value('SupplierName',$SupplierName),'id'=>'SupplierName', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2 col-sm-2">
<label for="DeliveryChellanOrInvoiceNo">DC / Inv Number</label>
<div class="form-group">
<?php
$data = array('name' => 'DeliveryChellanOrInvoiceNo','value' => set_value('DeliveryChellanOrInvoiceNo',$DeliveryChellanOrInvoiceNo),'id'=>'DeliveryChellanOrInvoiceNo', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2 col-sm-2">
<label for="DeliveryChellanDate">DC / Inv Date </label>
<div class="form-group"><?php
$data = array('name' => 'DeliveryChellanDate','value' => set_value('DeliveryChellanDate',$dcdate),'id'=>'DeliveryChellanDate', 'class' => 'form-control num','readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2 col-sm-2">
<label for="VehicleNo">Vehicle Number</label>
<div class="form-group">
<?php
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo',$VehicleNo),'id'=>'VehicleNo', 'class' => 'form-control' ,'readonly' => 'true','align' => 'left');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-3 col-sm-3">
<label for="CourierNo">Courier Number</label>
<div class="form-group"><?php
$data = array('name' => 'CourierNo','value' => set_value('CourierNo',$CourierNo),'id'=>'CourierNo', 'class' => 'form-control','readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="row" style="padding:1%;">
<div class="col-md-12 col-sm-12">
<table id="mytable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>S.NO</th>
<th>Item Code</th>
<th>Material</th>
<th>UOM</th>
<th>Ordered Quantity</th>
<th>Adviced Quantity as per the Challan</th>
<th>Actual Quantity Received</th>
<!--<th>Accepted_Quantity</th>-->
<!--<th>Rejected_Quantity</th>-->
<th>Remarks</th>
</tr>
</thead>
<tbody id="tbleAppend">
<?php $SNo =0;
if(!empty($IGRDetails))
{
foreach($IGRDetails as $record)
{
$SNo =$SNo + 1;
?>
<tr id="<?php echo $SNo?>">
<td><?php echo $SNo?></td>
<td><?php echo $record->MaterialCode?></td>
<input type="hidden" name="<?php echo 'MaterialCode'.$SNo ?>" id="<?php echo 'MaterialCode'.$SNo ?>" value=" <?php echo $record->MaterialCode ?> "/>
<td><?php echo $record->MaterialName?></td>
<td><?php echo $record->UOM?></td>
<td class="num"><?php echo $record->Quantity?></td>
<td class="num"><?php echo $record->QuantityAsPerInvoice?></td>
<input type="hidden" name="<?php echo 'QuantityAsPerInvoice'.$SNo ?>" id="<?php echo 'QuantityAsPerInvoice'.$SNo ?>" />
<td><input type="text" id="<?php echo 'ActualQuantity'.$SNo;?>" name="<?php echo 'ActualQuantity'.$SNo;?>" onchange="setactual('<?php echo $SNo;?>');"></td>
<input type="hidden" name="<?php echo 'ActualQuantityReceived'.$SNo ?>" id="<?php echo 'ActualQuantityReceived'.$SNo ?>" value=""/>
<td><input type="text" id="<?php echo 'Remark'.$SNo ?>" name="<?php echo 'Remark'.$SNo ?>" onchange="setremark('<?php echo $SNo;?>');"></td>
<input type="hidden" name="<?php echo 'Remarks'.$SNo ?>" id="<?php echo 'Remarks'.$SNo ?>" />
</tr>
<?php
} //echo $SNo;
}
$RowCount = $SNo;
?>
</tbody>
</table>
<div id="content"></div>
<div class="col-md-1 col-md-offset-10">
<a class="btn btn-primary" type="submit" onclick="savemrir()">Generate MRIR</a>
<input type="hidden" name="RowCount" id="RowCount" value="<?php echo $RowCount ?>" />
</div>
</div>
</div>
</section>
</div>
<script>
<!-- script for table , It works under the datatable plugin-->
$(function () {
$('#Inwardgateregistertable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>
<script>
function validate()
{
var rowcount = $("#RowCount").val();
//alert(rowcount);
var Noval = 0;
var isExceed = 0;
for(k=1;k<=rowcount; k++)
{
var ActualQty = parseFloat( $('#ActualQuantity'+k).val() == '' ? '0.00' : $('#ActualQuantity'+k).val());
//var RecQty = parseFloat( $('#txtReceivedQuantity'+k).val() == '' ? '0.00' : $('#txtReceivedQuantity'+k).val());
//var OrderedQty =parseFloat($('#Quantity_1'+k).text());
var tr= document.getElementById(k);
var InvoiceQty = 0.0;
var cellval = tr.cells;
InvoiceQty = parseFloat(cellval[5].innerHTML);
// alert('act'+ActualQty);
if(ActualQty != '0.00')
{
// alert('inside loop');
if(ActualQty > InvoiceQty)
{
isExceed = 1;
return false;
}
Noval = 1;
}
}
//alert(Noval);
if (Noval == 0 )
{
alert('Actual Quantity is Empty.Please Enter the value');
return false;
}
else if(isExceed == 1 ){
alert("Actual Quantity is exceeding the Invoice Quantity.Please adjust for further Process ")
return false;
}
else
{
return true;
}
}
function setactual(rowId)
{
var tr= document.getElementById(rowId);
var InvoiceQty = 0.0;
var cellval = tr.cells;
InvoiceQty = parseFloat(cellval[5].innerHTML);
var actual = parseFloat($('#ActualQuantity'+rowId).val());
if(InvoiceQty < actual)
{
alert("Actual Quantity is exceeding the Invoice Quantity.Please change the Actual Quantity ")
$("#ActualQuantity"+rowId).focus();
$("#ActualQuantity"+rowId).val('');
return false;
}
}
function setremark(rowId)
{
var remark = ($('#Remark'+rowId).val());
//alert(remark);
}
</script>
<script>
function savemrir()
{
if(validate())
{
//alert("save function worked ");
$("#content").load('show');
$.ajax({
data:$('.MRIR').serialize(),
type:"POST",
url:"<?php echo base_url() ?>MRIRcontroller/stored_db",
success:function(data) {
if(data){
$("#content").load('hide');
alert(data);
window.location ="viewmaterialinspectionreport";
}
else
{
alert("Error");
}
}//success function closed
});//ajax closed
}
}//save function closed
</script>

View File

@ -10,7 +10,7 @@
</script>
<div class="content-wrapper">
<div class="content-wrapper" style="min-height:435px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
@ -93,9 +93,9 @@
</div>
<div class="col-md-1 col-md-offset-10">
<div class="col-md-2" align="right"><br/>
<input type="submit" class="btn btn-primary">
<input type="submit" value="Submit" class="btn btn-primary">
</div>
</div>
@ -106,16 +106,16 @@
<div class="row">
<div class="col-md-12">
<div class="col-md-12" style="padding:1% 2%;">
<table id="StatusTable" class="table table-bordered table-hover editabletable IGR_Line" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>S.NO</th>
<th>ReqNo</th>
<th>Reqedby</th>
<th>ReqDate</th>
<th>SupplierName</th>
<th>Req No</th>
<th>Req By</th>
<th>Req Date</th>
<th>Supplier Name</th>
<th>Item Code</th>
<th>Description</th>
<th>UOM</th>

View File

@ -0,0 +1,189 @@
<script>
$(document).ready(function(){
$("#PONO").select2();
});
</script>
<div class="content-wrapper" style="min-height:435px;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Status Of Service Purchase Order</center>
</h1>
</section>
<section class="content"><br/>
<?php
$attributes = array('class' => 'form-label-left Status ','name' => 'Status','id' => 'Status');
echo form_open($this->config->base_url().'servicepurchaseorder/UpdateServiceStatus',$attributes); ?>
<div class="row" style="padding-bottom:1%">
<div id="content" > </div>
<div class="col-md-12">
<div class="col-md-3">
<?php
/* $attributes = array('class' => 'form-label-left ','name' => 'IGR','id' => ''); */
/* echo form_open($this->config->base_url().'/inwardgateregister/addNewigr/',$attributes); */?>
<label>Select Service Purchase Order NO </label>
<div>
<?php
$options = array("-1"=>'Purchase Order No');
if(!empty($PO))
{
//print_r($PO_NO);
foreach ($PO as $SI):
$options[$SI->PONO] = $SI->PONO ;
// $PONO = $SI->PONO;
endforeach;
}
echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"');
?>
</div>
</div>
<div class="col-md-3">
<label>Work Status</label>
<div>
<?php
$options = array();
if(!empty($WorkStatus))
{
//print_r($PO_NO);
foreach ($WorkStatus as $SI):
$options[$SI->StatusCode] = $SI->StatusName ;
endforeach;
}
echo form_dropdown('WorkStatus', $options,set_value('WorkStatus'),'id="WorkStatus"' ,'class="form-control"' , 'required="true"');
?>
</div>
</div>
<div class="col-md-3">
<label>Remarks</label>
<div>
<?php
$data = array('name' => 'Remarks','value' => set_value('Remarks'),'id'=>'Remarks', 'class' => 'form-control' );
echo form_input($data);
?>
</div>
</div>
<div class="col-md-2" align="right"><br/>
<input type="submit" value="Submit" class="btn btn-primary">
</div>
</div>
<div class="row">
<div class="col-md-12" style="padding:1% 2%;">
<table id="StatusTable" class="table table-bordered table-hover editabletable IGR_Line" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>S.NO</th>
<th>Req No</th>
<th>Req By</th>
<th>Req Date</th>
<th>Supplier Name</th>
<th>Item Code</th>
<th>Description</th>
<th>UOM</th>
<th>Ordered Quantity</th>
<th>Rate</th>
<th>Work Status</th>
</tr>
</thead>
<tbody id="tblAppend">
</tbody>
</table>
<input type="hidden" name="txtRowCount" id="txtRowCount" />
</div>
</div>
<script>
$(function () {
$('#PONO').change(function() {
$("#tblAppend").empty();
var id = $('#PONO').val();
if(id != '-1')
{
$('#content').loader('show');
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url() ?>servicepurchaseorder/getPODetails",
success:function(data) {
$('#content').loader('hide');
$("#tblAppend").empty();
$('#tblAppend').append(data);
}
});
}
else
{
alert('Please Select the Purchase Order Number to change the status');
}
});
});
</script>
</section>
</div>