reorder and link creation for suppler
This commit is contained in:
parent
46cb57b1d9
commit
e4847e4918
@ -331,5 +331,5 @@ $route['qualityreportlistinward'] = "quality/reportListInward";
|
||||
|
||||
/* End of file routes.php */
|
||||
/* Location: ./application/config/routes.php */
|
||||
|
||||
$route['shortagematerialListing'] = 'rawmaterialdetails/shortagematerialListing';
|
||||
|
||||
|
||||
@ -17,7 +17,8 @@ class batchcard extends BaseController
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('batchcard_model');
|
||||
$this->load->model('batchcard_model');
|
||||
$this->load->model('inwardgateregister_model');
|
||||
$this->isLoggedIn();
|
||||
$this->load->helper(array('form','url'));
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
@ -217,8 +218,44 @@ class batchcard extends BaseController
|
||||
|
||||
$historyadd = $this->batchcard_model->AddMaterialHistory($historytable);
|
||||
|
||||
$get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($materialcode);
|
||||
$av_qty=0;
|
||||
if(!empty($get_pre_qty))
|
||||
{
|
||||
foreach($get_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
if((count($materialadjust)>0) &&(count($historyadd)))
|
||||
|
||||
|
||||
if($status == 'Add')
|
||||
{
|
||||
$currentav_qty=$av_qty+$absaluteQty;
|
||||
|
||||
}
|
||||
|
||||
else if($status == 'Reduce')
|
||||
{
|
||||
|
||||
$currentav_qty=$av_qty-$absaluteQty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$materialcode);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if((count($materialadjust)>0) &&(count($historyadd)))
|
||||
{
|
||||
echo "Material Details Added Successfully";
|
||||
}
|
||||
@ -288,10 +325,29 @@ class batchcard extends BaseController
|
||||
$rawarray =array('FPId'=>$final_product_id,'MaterialCode'=>$rawmaterial,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'Price'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
|
||||
$rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
|
||||
//$rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($rawmaterialhistory);
|
||||
|
||||
// print_r($rawarray);
|
||||
|
||||
$rawget_pre_qty= $this->inwardgateregister_model->get_CurrentQty($rawmaterial);
|
||||
$av_qty=0;
|
||||
if(!empty($rawget_pre_qty))
|
||||
{
|
||||
foreach($rawget_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
$currentav_qty=$av_qty-$rawqty;
|
||||
|
||||
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$rawmaterial);
|
||||
//print_r($rawarray); // print_r($rawarray);
|
||||
|
||||
// print_r($rawmaterialhistory);
|
||||
|
||||
$this->batchcard_model->save_finalraw($rawarray);
|
||||
@ -310,6 +366,22 @@ class batchcard extends BaseController
|
||||
$consuhistory= array('MaterialCode'=>$conmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$consupplier,'Quantity'=>$conqty,'ItemValue'=>$convalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
|
||||
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($consuhistory);
|
||||
$conget_pre_qty= $this->inwardgateregister_model->get_CurrentQty($conmaterial);
|
||||
$conav_qty=0;
|
||||
if(!empty($conget_pre_qty))
|
||||
{
|
||||
foreach($conget_pre_qty as $gt)
|
||||
{
|
||||
$conav_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
$concurrentav_qty=$conav_qty-$conqty;
|
||||
|
||||
|
||||
$concurrent_qty= array('Current_stock'=>$concurrentav_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($concurrent_qty,$conmaterial);
|
||||
|
||||
$this->batchcard_model->save_finalcon($conarray);
|
||||
}
|
||||
@ -327,6 +399,23 @@ class batchcard extends BaseController
|
||||
$packmathistory= array('MaterialCode'=>$packmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$final_product_id,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'ItemValue'=>$packvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
|
||||
|
||||
$this->batchcard_model->save_rawmaterialto_materialHistory($packmathistory);
|
||||
$pacget_pre_qty= $this->inwardgateregister_model->get_CurrentQty($packmaterial);
|
||||
$pacav_qty=0;
|
||||
if(!empty($pacget_pre_qty))
|
||||
{
|
||||
foreach($pacget_pre_qty as $gt)
|
||||
{
|
||||
$pacav_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
$paccurrentav_qty=$pacav_qty-$packqty;
|
||||
|
||||
|
||||
$paccurrent_qty= array('Current_stock'=>$paccurrentav_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($paccurrent_qty,$packmaterial);
|
||||
|
||||
|
||||
$this->batchcard_model->save_finalpacking($packarray);
|
||||
}
|
||||
@ -407,7 +496,7 @@ class batchcard extends BaseController
|
||||
$rawqty = $this->input->post('rawQty'.$i);
|
||||
$rawvalue = $this->input->post('rawprice'.$i);
|
||||
$rawilneno = $this->input->post('RawId'.$i);
|
||||
//echo $rawilneno;
|
||||
$beforawqty = $this->input->post('beforerawQty'.$i); //echo $rawilneno;
|
||||
if($rawmaterial == '' && $rawsupplier == '' & $rawqty == '')
|
||||
{
|
||||
|
||||
@ -417,16 +506,55 @@ class batchcard extends BaseController
|
||||
{
|
||||
|
||||
$rawarray =array('FPId'=>$FPID,'MaterialCode'=>$rawmaterial,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'Price'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedDate'=>$createddt);
|
||||
$rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
|
||||
$checkrawid=$this->batchcard_model->GetRawid($rawilneno);
|
||||
|
||||
$checkrawhistory = $this->batchcard_model->GetRawCheck($rawmaterial,$FPID);
|
||||
|
||||
|
||||
$rawget_pre_qty= $this->inwardgateregister_model->get_CurrentQty($rawmaterial);
|
||||
$av_qty=0;
|
||||
if(!empty($rawget_pre_qty))
|
||||
{
|
||||
foreach($rawget_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
// echo $av_qty;
|
||||
// die();
|
||||
$qty_dif= $rawqty - $beforawqty;
|
||||
//echo $qty_dif;
|
||||
|
||||
// if($qty_dif >0)
|
||||
// {
|
||||
// echo 'if';
|
||||
// $currentav_qty=$av_qty+$qty_dif;
|
||||
// }
|
||||
|
||||
// else
|
||||
// {
|
||||
// echo 'else';
|
||||
$currentav_qty=$av_qty-$qty_dif;
|
||||
// }
|
||||
|
||||
//echo $currentav_qty;
|
||||
//die();
|
||||
|
||||
|
||||
|
||||
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
|
||||
|
||||
$rawmaterialhistory= array('MaterialCode'=>$rawmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$rawsupplier,'Quantity'=>$rawqty,'ItemValue'=>$rawvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
|
||||
//print($current_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$rawmaterial);
|
||||
// $checkrawid=$this->batchcard_model->GetRawid($rawilneno);
|
||||
|
||||
$checkrawid=$this->batchcard_model->GetRawid($rawilneno);
|
||||
|
||||
$checkrawhistory = $this->batchcard_model->GetRawCheck($rawmaterial,$FPID);
|
||||
// $checkrawhistory = $this->batchcard_model->GetRawCheck($rawmaterial,$FPID);
|
||||
|
||||
// echo $checkrawhistory;
|
||||
|
||||
@ -458,7 +586,7 @@ class batchcard extends BaseController
|
||||
$conqty = $this->input->post('consumeQty'.$i);
|
||||
$convalue = $this->input->post('consumeprice'.$i);
|
||||
$consuline = $this->input->post('Consumable'.$i);
|
||||
|
||||
$beforeconqty = $this->input->post('beforeconsumeQty'.$i);
|
||||
if($conmaterial == '' && $consupplier == '' & $conqty == '')
|
||||
{
|
||||
|
||||
@ -473,6 +601,39 @@ class batchcard extends BaseController
|
||||
|
||||
|
||||
$checkconsuid=$this->batchcard_model->Getconsuid($consuline);
|
||||
$conget_pre_qty= $this->inwardgateregister_model->get_CurrentQty($conmaterial);
|
||||
$conav_qty=0;
|
||||
if(!empty($conget_pre_qty))
|
||||
{
|
||||
foreach($conget_pre_qty as $gt)
|
||||
{
|
||||
$conav_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$conqty_dif= $conqty - $beforeconqty;
|
||||
|
||||
// if($conqty_dif >0)
|
||||
// {
|
||||
// $concurrentav_qty=$conav_qty+$conqty_dif;
|
||||
// }
|
||||
|
||||
// else
|
||||
// {
|
||||
$concurrentav_qty=$conav_qty-$conqty_dif;
|
||||
//}
|
||||
|
||||
|
||||
// $concurrentav_qty=$conav_qty-$conqty;
|
||||
|
||||
|
||||
$concurrent_qty= array('Current_stock'=>$concurrentav_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($concurrent_qty,$conmaterial);
|
||||
|
||||
|
||||
|
||||
if(count($checkconsuid)>0)
|
||||
{
|
||||
@ -500,7 +661,7 @@ class batchcard extends BaseController
|
||||
$packqty = $this->input->post('packQty'.$i);
|
||||
$packvalue = $this->input->post('packprice'.$i);
|
||||
$packlineId = $this->input->post('packId'.$i);
|
||||
|
||||
$beforepacqty = $this->input->post('beforepackQty'.$i);
|
||||
if($packmaterial == '' && $packsupplier == '' & $packqty == '')
|
||||
{
|
||||
|
||||
@ -514,7 +675,39 @@ class batchcard extends BaseController
|
||||
$packmathistory= array('MaterialCode'=>$packmaterial,'Transaction_type'=>'Reduce','Ref_Type'=>'Final Product','Ref_No'=>$FPID,'SupplierID'=>$packsupplier,'Quantity'=>$packqty,'ItemValue'=>$packvalue,'CreatedBy'=>$createdby,'CreatedOn'=>$createddt);
|
||||
|
||||
$checkpackid=$this->batchcard_model->Getpackid($packlineId);
|
||||
|
||||
$pacget_pre_qty= $this->inwardgateregister_model->get_CurrentQty($packmaterial);
|
||||
$pacav_qty=0;
|
||||
if(!empty($pacget_pre_qty))
|
||||
{
|
||||
foreach($pacget_pre_qty as $gt)
|
||||
{
|
||||
$pacav_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
$pacqty_dif= $packqty - $beforepacqty;
|
||||
|
||||
// if($pacqty_dif >0)
|
||||
// {
|
||||
// $paccurrentav_qty=$pacav_qty+$pacqty_dif;
|
||||
// }
|
||||
|
||||
// else
|
||||
// {
|
||||
$paccurrentav_qty=$pacav_qty-$pacqty_dif;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
// $paccurrentav_qty=$pacav_qty-$packqty;
|
||||
|
||||
|
||||
$paccurrent_qty= array('Current_stock'=>$paccurrentav_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($paccurrent_qty,$packmaterial);
|
||||
|
||||
|
||||
|
||||
if(count($checkpackid)>0)
|
||||
{
|
||||
$this->batchcard_model->update_finalpacking($packarray,$packlineId);
|
||||
|
||||
@ -2285,7 +2285,39 @@ class cashbook extends BaseController
|
||||
|
||||
}
|
||||
|
||||
public function addNewSupplierCash()
|
||||
{
|
||||
$this->load->model('supplier_model');
|
||||
$suppliername = $this->input->post('suppliername');
|
||||
$contact = $this->input->post('contact');
|
||||
$alternatecont = $this->input->post('alternatecont');
|
||||
$email = $this->input->post('email');
|
||||
$Address = $this->input->post('Address');
|
||||
|
||||
$suparray = array('suppliername'=>$suppliername,'Address'=>$Address,'ContactNumber'=>$contact,'AlternateContactNumber'=>$alternatecont,'EmailAddress'=>$email );
|
||||
|
||||
$result = $this->supplier_model->addNewsupplier($suparray);
|
||||
if($result > 0)
|
||||
{
|
||||
|
||||
echo "New Supplier Created successfully!";
|
||||
redirect('addnewIncomeExpense','refresh');
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
echo "Supplier Record Not Created!";
|
||||
redirect('addnewIncomeExpense','refresh');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getAllSupplier()
|
||||
{
|
||||
$suplist = $this->cashbook_model->getsupplier();
|
||||
echo json_encode($suplist);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -612,7 +612,24 @@ $RequestedBy = $this->input->post('drpDepartment');
|
||||
|
||||
$MaterialstockHistoryadd= array('Ref_No'=>$IGRItemNo,'MaterialCode'=>$MaterialCode,'Transaction_type'=>'Add','Ref_Type'=>'IGR','SupplierID'=>$SupplierID,'Quantity'=>$QuantityAsPerInvoice,'ItemValue'=>$itemRate,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
$this->inwardgateregister_model->addMaterialStockHistory($MaterialstockHistoryadd);
|
||||
|
||||
$get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
$av_qty=0;
|
||||
if(!empty($get_pre_qty))
|
||||
{
|
||||
foreach($get_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
$currentav_qty= $QuantityAsPerInvoice+$av_qty;
|
||||
|
||||
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$MaterialCode);
|
||||
|
||||
|
||||
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO,$MaterialCode);
|
||||
$ReceivedQuantity = 0.00;
|
||||
if(count($Recqty)>0)
|
||||
|
||||
@ -470,22 +470,22 @@ $prefile =array();
|
||||
|
||||
$this->inwardgateregister_model->addmaterialhistory($historydetails);
|
||||
|
||||
// $get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
// $av_qty=0;
|
||||
// if(!empty($get_pre_qty))
|
||||
// {
|
||||
// foreach($get_pre_qty as $gt)
|
||||
// {
|
||||
// $av_qty=$gt->Current_stock;
|
||||
// }
|
||||
// }
|
||||
$get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
$av_qty=0;
|
||||
if(!empty($get_pre_qty))
|
||||
{
|
||||
foreach($get_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
// $currentav_qty= $QuantityAsPerInvoice+$av_qty;
|
||||
$currentav_qty= $QuantityAsPerInvoice+$av_qty;
|
||||
|
||||
|
||||
// $current_qty= array('Current_stock'=>$currentav_qty);
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
|
||||
// $this->inwardgateregister_model->addmaterialmaster($current_qty,$MaterialCode);
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$MaterialCode);
|
||||
|
||||
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO,$MaterialCode);
|
||||
$ReceivedQuantity = 0.00;
|
||||
@ -805,7 +805,7 @@ $prefile =array();
|
||||
|
||||
if(count($addogrmaster)>0)
|
||||
{
|
||||
$ogrlinearray= $this->inwardgateregister_model->getlastogrline();
|
||||
$ogrlinearray= $this->inwardgateregister_model->getlastogrline();
|
||||
|
||||
foreach($ogrlinearray as $og)
|
||||
{
|
||||
@ -830,6 +830,25 @@ $prefile =array();
|
||||
$this->inwardgateregister_model->addmaterialhistory($historydetails);
|
||||
|
||||
|
||||
$get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
$av_qty=0;
|
||||
if(!empty($get_pre_qty))
|
||||
{
|
||||
foreach($get_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
$currentav_qty=$av_qty-$Outwardtotal;
|
||||
|
||||
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$MaterialCode);
|
||||
|
||||
|
||||
|
||||
|
||||
$this->inwardgateregister_model->UpdateOGRMasterOGRStatus($OGRNO);
|
||||
|
||||
|
||||
@ -1310,7 +1310,33 @@ class purchaseorder extends BaseController
|
||||
|
||||
|
||||
|
||||
|
||||
$rawget_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
$av_qty=0;
|
||||
if(!empty($rawget_pre_qty))
|
||||
{
|
||||
foreach($rawget_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
// echo $av_qty;
|
||||
// die();
|
||||
$qty_dif= $Quantity - $b4qty;
|
||||
|
||||
$currentav_qty=$av_qty-$qty_dif;
|
||||
|
||||
|
||||
//echo $currentav_qty;
|
||||
//die();
|
||||
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
|
||||
|
||||
//echo $current_qty;
|
||||
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$rawmaterial);
|
||||
|
||||
}
|
||||
|
||||
if($SkipInsert == "False")
|
||||
|
||||
@ -53,7 +53,18 @@ class rawmaterialdetails extends BaseController
|
||||
$this->loadViews("rawmaterialListing", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
|
||||
function shortagematerialListing()
|
||||
{
|
||||
|
||||
$this->load->model('rawmaterialdetails_model');
|
||||
|
||||
|
||||
$data['Records'] = $this->rawmaterialdetails_model->reOrderListing();
|
||||
$this->global['pageTitle'] = $this->CompanyName.': ReOrderLevel Listing';
|
||||
|
||||
$this->loadViews("shortagematerialListing", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
/**
|
||||
* To load the add new material details
|
||||
*/
|
||||
@ -130,7 +141,7 @@ class rawmaterialdetails extends BaseController
|
||||
$TempArr = [];
|
||||
$this->form_validation->set_rules('MaterialName','Material Name','trim|required|');
|
||||
$this->form_validation->set_rules('MaterialType','MaterialType','trim|callback_MaterialType_validate');
|
||||
// $this->form_validation->set_rules('MaterialCategory','MaterialCategory','trim|callback_materialcategory_validate');
|
||||
$this->form_validation->set_rules('MaterialCategory','MaterialCategory','trim|callback_materialcategory_validate');
|
||||
$this->form_validation->set_rules('UOM','UOM','trim|callback_UOM_validate');
|
||||
|
||||
if($this->form_validation->run() == FALSE)
|
||||
@ -170,17 +181,58 @@ else
|
||||
$HSN = $this->input->post('HSNcode');//print_r($HSNcode);
|
||||
$stock = $this->input->post('openstock');
|
||||
$reorder = $this->input->post('reorder');
|
||||
$stockdate = $this->input->post('Date');
|
||||
if (empty($stockdate))
|
||||
$stockdate = $this->input->post('Date');
|
||||
|
||||
$currentstock = '';
|
||||
$today_dt = date('Y-m-d');
|
||||
|
||||
if (empty($stockdate))
|
||||
{
|
||||
$stockdate = NULL;
|
||||
//$stockdate = NULL;
|
||||
$stockdate = date("Y-m-d");
|
||||
$currentstock = $stock;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stockdate = strtotime( $stockdate);
|
||||
$stockdate = date("Y-m-d ", $stockdate);
|
||||
}
|
||||
// }
|
||||
$todaydateyear = date('Y', strtotime($today_dt));
|
||||
$todaydatemonth = date('m', strtotime($today_dt));
|
||||
$todaydatedate = date('d', strtotime($today_dt));
|
||||
|
||||
$openstockdateyear = date('Y', strtotime($stockdate));
|
||||
$parts = explode('-',$stockdate);
|
||||
$openstockdatemonth = $parts[1];
|
||||
$openstockdatedate = $parts[2];
|
||||
|
||||
if($openstockdateyear==$todaydateyear)
|
||||
{
|
||||
if($openstockdatemonth<=03)
|
||||
{
|
||||
$currentstock= 0;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$currentstock = $stock;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if($openstockdateyear<$todaydateyear)
|
||||
{
|
||||
//$total= $y;
|
||||
$currentstock= 0;
|
||||
}
|
||||
|
||||
else if($openstockdateyear>$todaydateyear)
|
||||
{
|
||||
$currentstock = $stock;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
|
||||
$chked = $this->input->post('isactive');
|
||||
@ -227,7 +279,7 @@ else
|
||||
$IsActive = '0';
|
||||
}
|
||||
|
||||
$RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'UOM'=>$UOM,'Category'=>$MaterialCategory, 'CreatedBy'=>$CreatedBy,'IsActive' => $IsActive,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'HSNCODE'=>$HSNcode ,'stock'=>$stock,'stockdate'=>$stockdate,'reorder'=>$reorder);
|
||||
$RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'UOM'=>$UOM,'Category'=>$MaterialCategory, 'CreatedBy'=>$CreatedBy,'IsActive' => $IsActive,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'HSNCODE'=>$HSNcode ,'stock'=>$stock,'stockdate'=>$stockdate,'reorder'=>$reorder,'Current_stock'=>$currentstock);
|
||||
$result = $this->rawmaterialdetails_model->addNewRawMaterial($RawMaterial);
|
||||
|
||||
if($result > 0)
|
||||
@ -391,7 +443,7 @@ else
|
||||
}
|
||||
|
||||
$RawMaterial = array();
|
||||
$RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType,'UpdatedBy'=>$UpdatedBy, 'UOM'=>$UOM,'IsActive' => $IsActive,'Category'=>$MaterialCategory,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'HSNCODE'=>$HSNcode);
|
||||
//$RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType,'UpdatedBy'=>$UpdatedBy, 'UOM'=>$UOM,'IsActive' => $IsActive,'Category'=>$MaterialCategory,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'HSNCODE'=>$HSNcode);
|
||||
$RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType,'UpdatedBy'=>$UpdatedBy, 'UOM'=>$UOM,'IsActive' => $IsActive,'Category'=>$MaterialCategory,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'HSNCODE'=>$HSNcode,'stock'=>$stock,'stockdate'=>$stockdate,'reorder'=>$reorder);//,'RMCode'=>$rmcode);
|
||||
$result = $this->rawmaterialdetails_model->editRawmaterial($RawMaterial, $MaterialCode);
|
||||
|
||||
@ -434,20 +486,7 @@ function insertvalueintoconfig(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* To Check and display the already existing material list
|
||||
*/
|
||||
function checkmaterial()
|
||||
{
|
||||
$material = $this->input->post('id');
|
||||
$this->load->model('rawmaterialdetails_model');
|
||||
$query = $this->rawmaterialdetails_model->checkMaterialExists($material);
|
||||
echo json_encode($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* To export report of material details in excel
|
||||
*/
|
||||
|
||||
function export_material(){
|
||||
|
||||
|
||||
@ -562,6 +601,21 @@ function insertvalueintoconfig(){
|
||||
|
||||
$this->loadViews("404", $this->global, NULL, NULL);
|
||||
}
|
||||
/**
|
||||
* To Check and display the already existing material list
|
||||
*/
|
||||
function checkmaterial()
|
||||
{
|
||||
$material = $this->input->post('id');
|
||||
$this->load->model('rawmaterialdetails_model');
|
||||
$query = $this->rawmaterialdetails_model->checkMaterialExists($material);
|
||||
//print_r($query);
|
||||
echo json_encode($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* To export report of material details in excel
|
||||
*/
|
||||
}
|
||||
|
||||
?>
|
||||
@ -60,4 +60,19 @@ function get_fav($user)
|
||||
|
||||
}
|
||||
|
||||
function reOrderListing()
|
||||
{
|
||||
$CI = &get_instance();
|
||||
$CI->load->database();
|
||||
|
||||
$CI->db->reconnect();
|
||||
$subQuery='SELECT * from T_MaterialMaster where Current_stock < reorder?';
|
||||
|
||||
$query=$CI->db->query($subQuery,array());
|
||||
//print_r($this->db->last_query());
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -269,7 +269,24 @@ class inwardgateregister_model extends CI_Model
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function addmaterialmaster($current_qty,$MaterialCode)
|
||||
{
|
||||
$this->db->where('MaterialCode',$MaterialCode);
|
||||
$this->db->update('T_MaterialMaster',$current_qty);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function get_CurrentQty($MaterialCode)
|
||||
{
|
||||
$this->db->select('Current_stock');
|
||||
$this->db->from('T_MaterialMaster');
|
||||
$this->db->where('T_MaterialMaster.MaterialCode',$MaterialCode);
|
||||
$query = $this->db->get();
|
||||
// print_r( $this->db->last_query());
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
function getitemvalue($pono,$MaterialCode)
|
||||
{
|
||||
$this->db->select('Rate,SupplierID');
|
||||
|
||||
@ -97,7 +97,7 @@ class rawmaterialdetails_model extends CI_Model
|
||||
$this->db->insert('T_MaterialMaster', $RawMaterial);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function used to get user information by id
|
||||
* @param number $userId : This is user id
|
||||
@ -196,7 +196,7 @@ class rawmaterialdetails_model extends CI_Model
|
||||
$this->db->join('T_Employee_Details as emp1', 'emp1.empid=tbl1.empid','left');
|
||||
return $this->db->get('T_MaterialMaster as det')->result_array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkMaterialExists($material)
|
||||
{
|
||||
@ -246,5 +246,15 @@ class rawmaterialdetails_model extends CI_Model
|
||||
$temp['suggestions'] = $temparr;
|
||||
return $temp;
|
||||
}
|
||||
function reOrderListing()
|
||||
{
|
||||
|
||||
$subQuery='SELECT * from T_MaterialMaster where Current_stock < reorder?';
|
||||
|
||||
$query=$this->db->query($subQuery,array());
|
||||
//print_r($this->db->last_query());
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -2052,7 +2052,7 @@ var stock_date_date = '';
|
||||
stock_date_date = split[2];
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
if(((materialcode != 0)&&(supplier != 0)))
|
||||
{
|
||||
@ -2198,7 +2198,7 @@ var stock_date_date = '';
|
||||
stock_date_date = split[2];
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
if(((materialcode != 0)&&(supplier != 0)))
|
||||
{
|
||||
|
||||
@ -227,7 +227,7 @@ $(function() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
<div class="box-footer" style="text-align:right">
|
||||
@ -238,7 +238,36 @@ $(function() {
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?php
|
||||
$this->load->helper('form');
|
||||
$error = $this->session->flashdata('error');
|
||||
if($error)
|
||||
{
|
||||
?>
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo $this->session->flashdata('error'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
$success = $this->session->flashdata('success');
|
||||
if($success)
|
||||
{
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo $this->session->flashdata('success'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
@ -417,4 +446,32 @@ $('#content').loader('show');
|
||||
});
|
||||
});
|
||||
|
||||
function Validate()
|
||||
{
|
||||
if($("#MaterialName").val().length < 1)
|
||||
{
|
||||
alert('Please Enter MaterialName');
|
||||
$("#MaterialName").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("option:selected", $("#UOM")).val() == "")
|
||||
{
|
||||
alert('Please Select UOM ');
|
||||
$("#UOM").focus();
|
||||
return false;
|
||||
}
|
||||
if($("option:selected", $("#MaterialCategory")).val() == "")
|
||||
{
|
||||
alert('Please Select Material Category');
|
||||
$("#MaterialCategory").focus();
|
||||
return false;
|
||||
}
|
||||
if($("option:selected", $("#MaterialType")).val() == "")
|
||||
{
|
||||
alert('Please Select Material Type');
|
||||
$("#MaterialType").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -8,7 +8,10 @@
|
||||
background-color:#A1887F;
|
||||
|
||||
}
|
||||
|
||||
.modalfooter
|
||||
{
|
||||
background-color:white; !important
|
||||
}
|
||||
/* Style the buttons inside the tab */
|
||||
.tab button {
|
||||
background-color: inherit;
|
||||
@ -43,6 +46,29 @@
|
||||
background-color:skyblue;
|
||||
/* background-color: darkgrey; */
|
||||
outline: 1px solid slategrey;
|
||||
}
|
||||
.modal
|
||||
{
|
||||
padding-right:25% ! important;
|
||||
}
|
||||
.dataTables_paginate
|
||||
{
|
||||
margin-top: -5%;
|
||||
}
|
||||
.dataTables_wrapper {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.badge
|
||||
{
|
||||
color:red; background-color:#fff;
|
||||
}
|
||||
|
||||
legend{
|
||||
color:#00c0ef ! important;
|
||||
}
|
||||
|
||||
.content {
|
||||
Padding:0% ! important;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper" style="min-height: 537px;">
|
||||
@ -101,15 +127,24 @@
|
||||
<input type="text" class="form-control required" id="towhome" name="towhome">
|
||||
</div></div>
|
||||
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
||||
<select class="form-control select2 required" id="supplier" name="supplier">
|
||||
<option value="-1">Select Supplier</option>
|
||||
</select>
|
||||
</div></div>
|
||||
|
||||
<a data-target='#Addsup' data-toggle="modal" href="#Addsup">Add New Supplier</a>
|
||||
</div><!--/ col-md -12-->
|
||||
|
||||
|
||||
</div><!-- /row -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
@ -218,7 +253,7 @@
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
<div class="box-footer" style="text-align:right">
|
||||
<input type="button" onclick="validate();"class="btn btn-primary" value="Submit" />
|
||||
<input type="button" onclick="validate();" class="btn btn-primary" value="Submit" />
|
||||
<input type="reset" class="btn btn-primary" value="Reset" />
|
||||
</div>
|
||||
|
||||
@ -258,7 +293,7 @@
|
||||
<option value="-1">Select Supplier</option>
|
||||
</select>
|
||||
</div></div>
|
||||
|
||||
<a data-target='#Addsup' data-toggle="modal" href="#Addsup">Add New Supplier</a>
|
||||
|
||||
</div>
|
||||
|
||||
@ -381,6 +416,70 @@
|
||||
</div><!-- row div-->
|
||||
</div><!-- tabcontent-->
|
||||
</section><!-- content section -->
|
||||
|
||||
<div>
|
||||
<div align="right">
|
||||
|
||||
<div id="Addsup" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<form>
|
||||
<div class="modal-content" style="width:1030px;font-size:12px;">
|
||||
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
|
||||
<center><h4> New Supplier Details</h4></center>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-1"><br/>
|
||||
<div class="box-body">
|
||||
<div align="left">
|
||||
<legend>Supplier Information</legend>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<span for="SupplierName">Supplier Name</span><span class="badge">*</span>
|
||||
<input type="text" name="SupplierName" onkeypress="return onlyAlphabets(event);" maxlength="100" id="supplierName" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="ContactNumber">Contact Number</span><span class="badge">*</span>
|
||||
<input type="text" name="ContactNumber" onchange="return getContactNumberValidation();" id="ContactNumber" required maxlength="13" class="form-control" title="Please Enter Mobile Number (or) Telephone Number" onkeypress="return isNumberKey(event)">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="AlternateContactNumber">Alternate Contact Number</span>
|
||||
<input type="text" name="AlternateContactNumber" id="AlternateContactNumber" maxlength="13" class="form-control" title="Please Enter Mobile Number (or) Telephone Number" onkeypress="return isNumberKey(event)">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="EmailAddress">Email ID</span><span class="badge">*</span>
|
||||
<input type="email" name="emailid" id="emailid" required maxlength="100" class="form-control">
|
||||
</div>
|
||||
|
||||
<legend>Address Details</legend>
|
||||
<!-- Text input-->
|
||||
<div class="col-md-12" >
|
||||
<div class="col-md-12"><span for="Address2">Address</span><span class="badge">*</span>
|
||||
<input type="text" class="form-control required" id="Address" name="Address" maxlength="500" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer modalfooter" style="text-align:right" >
|
||||
<a class="btn btn-primary font AddSupplier" ID="AddSupplier" > <span class="bold">Save</span></a>
|
||||
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- content-wrapper div-->
|
||||
|
||||
<script>
|
||||
@ -1091,4 +1190,212 @@ function valid(){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$('#supplier').change(function() {
|
||||
|
||||
var drpval = $('#supplier').val();
|
||||
if(drpval == 1)
|
||||
{
|
||||
//alert()
|
||||
$('#Addsup').modal('show');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
function onlyAlphabets(evt)
|
||||
{
|
||||
var charCode;
|
||||
if (window.event)
|
||||
charCode = window.event.keyCode; //for IE
|
||||
else
|
||||
charCode = evt.which; //for firefox
|
||||
if (charCode == 32) //for <space> symbol
|
||||
return true;
|
||||
if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table
|
||||
return false;
|
||||
if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table
|
||||
return false;
|
||||
if (charCode > 122) //for characters beyond 'z' in ASCII Table
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function getContactNumberValidation()
|
||||
{
|
||||
|
||||
var contactNumber = $('#ContactNumber').val();
|
||||
var telephone =/^[0-9]{3,4}\s[0-9]{8,9}$/.test(contactNumber);
|
||||
var regex = /^[0-9]{4,6}\s[0-9]{5,7}$/.test(contactNumber);
|
||||
var mobilephone = /^[0-9]{10,12}$/.test(contactNumber);
|
||||
|
||||
if(contactNumber!='')
|
||||
{
|
||||
|
||||
if(telephone)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else if(regex)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(mobilephone)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
alert('please correct format of contact number');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function isNumberKey(evt)
|
||||
{
|
||||
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||||
if (charCode != 46 && charCode != 32 && charCode >= 33
|
||||
&& (charCode < 48 || charCode > 57))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function validateEmail() {
|
||||
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
|
||||
var email = $('#emailid').val();
|
||||
|
||||
if(email != '')
|
||||
{
|
||||
if (reg.test(email) == false)
|
||||
{
|
||||
alert('Please Enter Valid Email Address');
|
||||
return (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please Enter email id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function validatesup()
|
||||
{
|
||||
// var a= $('#supplierName').val();
|
||||
// alert(a);
|
||||
|
||||
if($("#supplierName").val().length < 1)
|
||||
{
|
||||
alert('Please Enter Supplier Name');
|
||||
$("#supplierName").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!getContactNumberValidation())
|
||||
{
|
||||
$("#ContactNumber").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!validateEmail())
|
||||
{
|
||||
$('#emailid').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#Address").val().length < 1)
|
||||
{
|
||||
alert('Please Enter Address');
|
||||
$("#Address").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('.AddSupplier').click(function()
|
||||
{
|
||||
if(validatesup())
|
||||
{
|
||||
var suppliername = $('#supplierName').val();
|
||||
var contact = $('#ContactNumber').val();
|
||||
var alternatecont = $('#AlternateContactNumber').val();
|
||||
var email = $('#emailid').val();
|
||||
var Address = $('#Address').val();
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
|
||||
data:{suppliername:suppliername,contact:contact,alternatecont:alternatecont,email:email,Address:Address},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/addNewSupplierCash",
|
||||
|
||||
success:function(data)
|
||||
{
|
||||
// $('#content').loader('hide');
|
||||
// alert(data);
|
||||
var alertdata=data;
|
||||
|
||||
$.ajax({
|
||||
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/getAllSupplier",
|
||||
success:function(data)
|
||||
{
|
||||
var html = '';
|
||||
$('#supplier').find('option:not(:first)').remove();
|
||||
|
||||
$.each(JSON.parse(data), function (supDet, supobj)
|
||||
{
|
||||
|
||||
// html +="<option value="+supobj.SupplierID+">"+supobj.SupplierName+"</option>";
|
||||
|
||||
$("#supplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
|
||||
|
||||
});
|
||||
|
||||
//$("#supplier").append(html);
|
||||
alert(alertdata);
|
||||
$('#content').loader('hide');
|
||||
$('#Addsup').modal('hide');
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@ -286,10 +286,35 @@ $('#Paymentmerchant').autocomplete({
|
||||
/* background-color: darkgrey; */
|
||||
outline: 1px solid slategrey;
|
||||
}
|
||||
|
||||
.modal
|
||||
{
|
||||
padding-right:25% ! important;
|
||||
}
|
||||
.dataTables_paginate
|
||||
{
|
||||
margin-top: -5%;
|
||||
}
|
||||
.dataTables_wrapper {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.badge
|
||||
{
|
||||
color:red; background-color:#fff;
|
||||
}
|
||||
|
||||
legend{
|
||||
color:#00c0ef ! important;
|
||||
}
|
||||
|
||||
.content {
|
||||
Padding:0% ! important;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper" style="min-height: 537px;">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content">
|
||||
<div id="content"></div>
|
||||
<div style="text-align:right;">
|
||||
<a href="<?php base_url() ?>Bankingstatement" class="btn btn-primary" value="Back"/>Back</a>
|
||||
</div>
|
||||
@ -360,6 +385,7 @@ $('#Paymentmerchant').autocomplete({
|
||||
<b><span for="Accountname">Account Name Select:</span> </b><span style="color:red">*</span></br></br>
|
||||
<select class="form-control required " required id="Recepitaccode" required name="accode">
|
||||
<option value="-1">Account Name Select</option>
|
||||
|
||||
</select>
|
||||
</div></div>
|
||||
<div class="col-md-3"><div class="form-group">
|
||||
@ -375,8 +401,100 @@ $('#Paymentmerchant').autocomplete({
|
||||
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
||||
<select class="form-control select2 required" id="supplier" name="supplier">
|
||||
<option value="-1">Select Supplier</option>
|
||||
<option value="1">Create New Supplier</option>
|
||||
</select>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a data-target='#Addsup' data-toggle="modal" href="#Addsup">Add New Supplier</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<div align="right">
|
||||
<a data-toggle="modal" class="btn btn-primary" data-dismiss="modal">Add Line Item </a>
|
||||
<div id="Addsup" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<form>
|
||||
<div class="modal-content" style="width:1030px;font-size:12px;">
|
||||
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
||||
<center><h4>Siddharth Industries - New Supplier Details</h4></center>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-1"><br/>
|
||||
<div class="box-body">
|
||||
<div align="left">
|
||||
<legend>Supplier Information</legend>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<span for="SupplierName">Supplier Name</span><span class="badge">*</span>
|
||||
<input type="text" name="SupplierName" onkeypress="return onlyAlphabets(event);" maxlength="100" id="supplierName" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="ContactNumber">Contact Number</span><span class="badge">*</span>
|
||||
<input type="text" name="ContactNumber" onchange="return getContactNumberValidation();" id="ContactNumber" required maxlength="13" class="form-control" title="Please Enter Mobile Number (or) Telephone Number" onkeypress="return isNumberKey(event)">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="AlternateContactNumber">Alternate Contact Number</span>
|
||||
<input type="text" name="AlternateContactNumber" onchange="return getValidAlternateNumber();" id="AlternateContactNumber" maxlength="13" class="form-control" title="Please Enter Mobile Number (or) Telephone Number" onkeypress="return isNumberKey(event)">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="EmailAddress">Email ID</span><span class="badge">*</span>
|
||||
<input type="email" name="emailid" id="emailid" required maxlength="100" class="form-control">
|
||||
</div>
|
||||
|
||||
<legend>Address Details</legend>
|
||||
<!-- Text input-->
|
||||
<div class="col-md-12" >
|
||||
<div class="col-md-12"><span for="Address2">Address</span><span class="badge">*</span>
|
||||
<input type="text" class="form-control required" id="Address" name="Address" maxlength="500" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer" style="text-align:right">
|
||||
<a class="btn btn-primary font AddSupplier" ID="AddSupplier" > <span class="bold">Save</span></a>
|
||||
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<b><span for="Total">Total Amount:</span></b><span style="color:red">*</span></br></br>
|
||||
|
||||
<input type="text" class="form-control" id="totalamount" name="totalamount" onkeypress="return isNumberKey(event)" style="text-align:right;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<b><span for="Description">Description:</span></b></br></br>
|
||||
|
||||
<textarea class="form-control" id="description" name="description" >
|
||||
</textarea>
|
||||
</div>
|
||||
|
||||
</div><!--/ col-md -12-->
|
||||
</div><!-- /row -->
|
||||
@ -541,6 +659,7 @@ $('#Paymentmerchant').autocomplete({
|
||||
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
||||
<select class="form-control select2 required" id="Paymentsupplier" name="Paymentsupplier">
|
||||
<option value="-1">Select Supplier</option>
|
||||
|
||||
</select>
|
||||
</div></div>
|
||||
|
||||
@ -1174,6 +1293,216 @@ $('#addPayment').submit();
|
||||
|
||||
}
|
||||
|
||||
$('#supplier').change(function() {
|
||||
|
||||
var drpval = $('#supplier').val();
|
||||
if(drpval == 1)
|
||||
{
|
||||
//alert()
|
||||
$('#Addsup').modal('show');
|
||||
}
|
||||
|
||||
});
|
||||
function onlyAlphabets(evt)
|
||||
{
|
||||
var charCode;
|
||||
if (window.event)
|
||||
charCode = window.event.keyCode; //for IE
|
||||
else
|
||||
charCode = evt.which; //for firefox
|
||||
if (charCode == 32) //for <space> symbol
|
||||
return true;
|
||||
if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table
|
||||
return false;
|
||||
if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table
|
||||
return false;
|
||||
if (charCode > 122) //for characters beyond 'z' in ASCII Table
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function getContactNumberValidation()
|
||||
{
|
||||
|
||||
var contactNumber = $('#ContactNumber').val();
|
||||
var telephone =/^[0-9]{3,4}\s[0-9]{8,9}$/.test(contactNumber);
|
||||
var regex = /^[0-9]{4,6}\s[0-9]{5,7}$/.test(contactNumber);
|
||||
var mobilephone = /^[0-9]{10,12}$/.test(contactNumber);
|
||||
|
||||
if(contactNumber!='')
|
||||
{
|
||||
|
||||
if(telephone)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else if(regex)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(mobilephone)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
alert('please correct format of contact number');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function isNumberKey(evt)
|
||||
{
|
||||
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||||
if (charCode != 46 && charCode != 32 && charCode >= 33
|
||||
&& (charCode < 48 || charCode > 57))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function validateEmail() {
|
||||
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
|
||||
var email = $('#emailid').val();
|
||||
|
||||
if(email != '')
|
||||
{
|
||||
if (reg.test(email) == false)
|
||||
{
|
||||
alert('Please Enter Valid Email Address');
|
||||
return (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please Enter email id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function validatesup()
|
||||
{
|
||||
// var a= $('#supplierName').val();
|
||||
// alert(a);
|
||||
|
||||
if($("#supplierName").val().length < 1)
|
||||
{
|
||||
alert('Please Enter Supplier Name');
|
||||
$("#supplierName").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!getContactNumberValidation())
|
||||
{
|
||||
$("#ContactNumber").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!validateEmail())
|
||||
{
|
||||
$('#emailid').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#Address").val().length < 1)
|
||||
{
|
||||
alert('Please Enter Address');
|
||||
$("#Address").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('.AddSupplier').click(function()
|
||||
{
|
||||
if(validatesup())
|
||||
{
|
||||
var suppliername = $('#supplierName').val();
|
||||
var contact = $('#ContactNumber').val();
|
||||
var alternatecont = $('#AlternateContactNumber').val();
|
||||
var email = $('#emailid').val();
|
||||
var Address = $('#Address').val();
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
|
||||
data:{suppliername:suppliername,contact:contact,alternatecont:alternatecont,email:email,Address:Address},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/addNewSupplierCash",
|
||||
|
||||
success:function(data)
|
||||
{
|
||||
// $('#content').loader('hide');
|
||||
// alert(data);
|
||||
// location.reload();
|
||||
|
||||
|
||||
var alertdata=data;
|
||||
|
||||
$.ajax({
|
||||
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/getAllSupplier",
|
||||
success:function(data)
|
||||
{
|
||||
var html = '';
|
||||
$('#supplier').find('option:not(:first)').remove();
|
||||
|
||||
$.each(JSON.parse(data), function (supDet, supobj)
|
||||
{
|
||||
|
||||
// html +="<option value="+supobj.SupplierID+">"+supobj.SupplierName+"</option>";
|
||||
|
||||
$("#supplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
|
||||
|
||||
});
|
||||
|
||||
//$("#supplier").append(html);
|
||||
alert(alertdata);
|
||||
// $('#supplier option[value="<?php echo $supplier?>"]').prop('selected', true);
|
||||
$('#content').loader('hide');
|
||||
$('#Addsup').modal('hide');
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -434,6 +434,8 @@ $(function() {
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'rawQty'.$index ?>" id="<?php echo 'rawQty'.$index ?>" value="<?php echo $raw->Quantity ; ?>" readonly/>
|
||||
<input type="hidden" name="<?php echo 'beforerawQty'.$index ?>" id="<?php echo 'beforerawQty'.$index ?>" value="<?php echo $raw->Quantity ; ?>" readonly/>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'rawprice'.$index ?>" id="<?php echo 'rawprice'.$index ?>" value="<?php echo $raw->Price ; ?>" readonly/>
|
||||
@ -698,8 +700,10 @@ $(function() {
|
||||
|
||||
<input type="hidden" name="<?php echo 'consumeQty'.$inde ?>" id="<?php echo 'consumeQty'.$inde ?>" value="<?php echo $cou->Quantity ; ?>" />
|
||||
|
||||
|
||||
<input type="hidden" name="<?php echo 'beforeconsumeQty'.$inde ?>" id="<?php echo 'beforeconsumeQty'.$inde ?>" value="<?php echo $cou->Quantity ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'consumeprice'.$inde ?>" id="<?php echo 'consumeprice'.$inde ?>" value="<?php echo $cou->Price ; ?>" />
|
||||
|
||||
|
||||
<?php }}?>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -950,7 +954,7 @@ $(function() {
|
||||
<input type="hidden" name="<?php echo 'packSupplierID'.$intt ?>" id="<?php echo 'packSupplierID'.$intt ?>" value="<?php echo $pac->SupplierID ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'packQty'.$intt ?>" id="<?php echo 'packQty'.$intt ?>" value="<?php echo $pac->Quantity ; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'beforepackQty'.$intt ?>" id="<?php echo 'beforepackQty'.$intt ?>" value="<?php echo $pac->Quantity ; ?>" />
|
||||
<input type="hidden" name="<?php echo 'packprice'.$intt ?>" id="<?php echo 'packprice'.$intt ?>" value="<?php echo $pac->Price ; ?>" />
|
||||
|
||||
<?php }}?>
|
||||
@ -1914,7 +1918,7 @@ function ResultantQty(materialtype)
|
||||
//console.log(openqty);
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
// alert("add"+materialcode);
|
||||
// alert("add"+supplier);
|
||||
|
||||
@ -2071,7 +2075,7 @@ var stock_date = '';
|
||||
stock_date_date = split[2];
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
if(((materialcode != 0)&&(supplier != 0)))
|
||||
{
|
||||
|
||||
@ -2134,7 +2138,7 @@ var stock_date = '';
|
||||
}
|
||||
});
|
||||
|
||||
var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
||||
// var resultantqty = parseFloat(addqty)- parseFloat(reduceqty);
|
||||
if(stock_date_year==today_year)
|
||||
{
|
||||
|
||||
@ -2217,7 +2221,7 @@ var stock_date_date = '';
|
||||
stock_date_date = split[2];
|
||||
}
|
||||
|
||||
});
|
||||
})
|
||||
if(((materialcode != 0)&&(supplier != 0)))
|
||||
{
|
||||
|
||||
|
||||
@ -93,6 +93,35 @@ if(!empty($PaymentMultiple))
|
||||
}}
|
||||
|
||||
?>
|
||||
<style>
|
||||
.modal
|
||||
{
|
||||
padding-right:25% ! important;
|
||||
}
|
||||
.dataTables_paginate
|
||||
{
|
||||
margin-top: -5%;
|
||||
}
|
||||
.dataTables_wrapper {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.modalfooter
|
||||
{
|
||||
background-color:white; !important
|
||||
}
|
||||
.badge
|
||||
{
|
||||
color:red; background-color:#fff;
|
||||
}
|
||||
|
||||
legend{
|
||||
color:#00c0ef ! important;
|
||||
}
|
||||
|
||||
.content {
|
||||
Padding:0% ! important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="content-wrapper" style="min-height: 537px;">
|
||||
<!-- Content Header (Page header) -->
|
||||
@ -170,11 +199,16 @@ if(!empty($PaymentMultiple))
|
||||
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
||||
<select class="form-control select2 required" id="supplier" name="supplier">
|
||||
<option value="-1">Select Supplier</option>
|
||||
<!-- <option value="1">Create New Supplier</option> -->
|
||||
</select>
|
||||
</div></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a data-target='#Addsup' data-toggle="modal" href="#Addsup">Add New Supplier</a>
|
||||
</div><!-- row -->
|
||||
</div><!-- 12-md-->
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12"><div class="col-md-3">
|
||||
<input type="checkbox" id="gst" name="gsttoggle" <?php echo $checked;?> > GST
|
||||
@ -325,6 +359,7 @@ if(!empty($PaymentMultiple))
|
||||
<option value="-1">Select Supplier</option>
|
||||
</select>
|
||||
</div></div>
|
||||
<a data-target='#Addsup' data-toggle="modal" href="#Addsup">Add New Supplier</a>
|
||||
</div>
|
||||
|
||||
|
||||
@ -539,6 +574,72 @@ if(!empty($PaymentMultiple))
|
||||
</div><!-- tabcontent-->
|
||||
<?php } ?>
|
||||
</section><!-- content section -->
|
||||
|
||||
<div>
|
||||
<div align="right">
|
||||
<a data-toggle="modal" class="btn btn-primary" data-dismiss="modal">Add Line Item </a>
|
||||
<div id="Addsup" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<!-- <form> -->
|
||||
<div class="modal-content" style="width:1030px;font-size:12px;">
|
||||
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
|
||||
<center><h4> New Supplier Details</h4></center>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-10 col-md-offset-1"><br/>
|
||||
<div class="box-body">
|
||||
<div align="left">
|
||||
<legend>Supplier Information</legend>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<span for="SupplierName">Supplier Name</span><span class="badge">*</span>
|
||||
<input type="text" name="SupplierName" onkeypress="return onlyAlphabets(event);" maxlength="100" id="supplierName" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="ContactNumber">Contact Number</span><span class="badge">*</span>
|
||||
<input type="text" name="ContactNumber" onchange="return getContactNumberValidation();" id="ContactNumber" required maxlength="13" class="form-control" title="Please Enter Mobile Number (or) Telephone Number" onkeypress="return isNumberKey(event)">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="AlternateContactNumber">Alternate Contact Number</span>
|
||||
<input type="text" name="AlternateContactNumber" id="AlternateContactNumber" maxlength="13" class="form-control" title="Please Enter Mobile Number (or) Telephone Number" onkeypress="return isNumberKey(event)">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<span for="EmailAddress">Email ID</span><span class="badge">*</span>
|
||||
<input type="email" name="emailid" id="emailid" required maxlength="100" class="form-control">
|
||||
</div>
|
||||
|
||||
<legend>Address Details</legend>
|
||||
<!-- Text input-->
|
||||
<div class="col-md-12" >
|
||||
|
||||
<div class="col-md-12"><span for="Address2">Address</span><span class="badge">*</span>
|
||||
<input type="text" class="form-control required" id="Address" name="Address" maxlength="500" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer modalfooter" style="text-align:right">
|
||||
<a class="btn btn-primary font AddSupplier" ID="AddSupplier" > <span class="bold">Save</span></a>
|
||||
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- content-wrapper div-->
|
||||
<script>
|
||||
//var drop=$("input[type=radio][name='range']:checked").val()
|
||||
@ -841,6 +942,7 @@ function loadAccountType(id)
|
||||
|
||||
</script>
|
||||
<!-- old sript above -->
|
||||
|
||||
<script>
|
||||
|
||||
function validate()
|
||||
@ -1325,4 +1427,215 @@ function valid(){
|
||||
|
||||
}
|
||||
|
||||
$('#supplier').change(function() {
|
||||
|
||||
var drpval = $('#supplier').val();
|
||||
if(drpval == 1)
|
||||
{
|
||||
//alert()
|
||||
$('#Addsup').modal('show');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
function onlyAlphabets(evt)
|
||||
{
|
||||
var charCode;
|
||||
if (window.event)
|
||||
charCode = window.event.keyCode; //for IE
|
||||
else
|
||||
charCode = evt.which; //for firefox
|
||||
if (charCode == 32) //for <space> symbol
|
||||
return true;
|
||||
if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table
|
||||
return false;
|
||||
if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table
|
||||
return false;
|
||||
if (charCode > 122) //for characters beyond 'z' in ASCII Table
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function getContactNumberValidation()
|
||||
{
|
||||
|
||||
var contactNumber = $('#ContactNumber').val();
|
||||
var telephone =/^[0-9]{3,4}\s[0-9]{8,9}$/.test(contactNumber);
|
||||
var regex = /^[0-9]{4,6}\s[0-9]{5,7}$/.test(contactNumber);
|
||||
var mobilephone = /^[0-9]{10,12}$/.test(contactNumber);
|
||||
|
||||
if(contactNumber!='')
|
||||
{
|
||||
|
||||
if(telephone)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else if(regex)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(mobilephone)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
alert('please correct format of contact number');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function isNumberKey(evt)
|
||||
{
|
||||
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||||
if (charCode != 46 && charCode != 32 && charCode >= 33
|
||||
&& (charCode < 48 || charCode > 57))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function validateEmail() {
|
||||
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
|
||||
var email = $('#emailid').val();
|
||||
|
||||
if(email != '')
|
||||
{
|
||||
if (reg.test(email) == false)
|
||||
{
|
||||
alert('Please Enter Valid Email Address');
|
||||
return (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please Enter email id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function validatesup()
|
||||
{
|
||||
// var a= $('#supplierName').val();
|
||||
// alert(a);
|
||||
|
||||
if($("#supplierName").val().length < 1)
|
||||
{
|
||||
alert('Please Enter Supplier Name');
|
||||
$("#supplierName").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!getContactNumberValidation())
|
||||
{
|
||||
$("#ContactNumber").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!validateEmail())
|
||||
{
|
||||
$('#emailid').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#Address").val().length < 1)
|
||||
{
|
||||
alert('Please Enter Address');
|
||||
$("#Address").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$('.AddSupplier').click(function()
|
||||
{
|
||||
if(validatesup())
|
||||
{
|
||||
var suppliername = $('#supplierName').val();
|
||||
var contact = $('#ContactNumber').val();
|
||||
var alternatecont = $('#AlternateContactNumber').val();
|
||||
var email = $('#emailid').val();
|
||||
var Address = $('#Address').val();
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
|
||||
data:{suppliername:suppliername,contact:contact,alternatecont:alternatecont,email:email,Address:Address},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/addNewSupplierCash",
|
||||
|
||||
success:function(data)
|
||||
{
|
||||
// $('#content').loader('hide');
|
||||
// alert(data);
|
||||
// location.reload();
|
||||
|
||||
var alertdata=data;
|
||||
|
||||
$.ajax({
|
||||
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/getAllSupplier",
|
||||
success:function(data)
|
||||
{
|
||||
var html = '';
|
||||
$('#supplier').find('option:not(:first)').remove();
|
||||
|
||||
$.each(JSON.parse(data), function (supDet, supobj)
|
||||
{
|
||||
|
||||
// html +="<option value="+supobj.SupplierID+">"+supobj.SupplierName+"</option>";
|
||||
|
||||
$("#supplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
|
||||
|
||||
});
|
||||
|
||||
//$("#supplier").append(html);
|
||||
alert(alertdata);
|
||||
$('#supplier option[value="<?php echo $supplier?>"]').prop('selected', true);
|
||||
$('#content').loader('hide');
|
||||
$('#Addsup').modal('hide');
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
90
application/views/shortagematerialListing.php
Normal file
90
application/views/shortagematerialListing.php
Normal file
@ -0,0 +1,90 @@
|
||||
|
||||
<style>
|
||||
.pagination {
|
||||
margin:0px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<!-- <center><h3 class="box-title">Siddharth Industries - ReOrder Level List</h3></center> -->
|
||||
|
||||
<center><h3 class="box-title"><?php echo $pageTitle?></h3></center>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<!-- <table id="dataTableHistoriek" class="table table-bordered table-hover editableTable" style="font-size:12px;">
|
||||
<thead>
|
||||
<tr style="background-color:#ddf"> -->
|
||||
<table id="dataTableHistoriek" class="table table-hover table-bordered editableTable" style="background-color:#fff;font-size:12px;" >
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th style="text-align:center">Material Code</th>
|
||||
<th style="text-align:center">Material Name</th>
|
||||
<th style="text-align:center">Available Quantity</th>
|
||||
<th style="text-align:center">Reorder Level</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><?php
|
||||
if(!empty($Records))
|
||||
{
|
||||
$index = 0;
|
||||
foreach($Records as $index=>$re)
|
||||
{
|
||||
$index = $index + 1;
|
||||
?>
|
||||
<tr id="<?php echo $index ; ?>">
|
||||
<td align="left"><?php echo $index ; ?></td>
|
||||
<td style="text-align:center"><span><?php echo $re->MaterialCode;?></span></td>
|
||||
<td style="text-align:center"><span><?php echo $re->MaterialName;?></span></td>
|
||||
<td style="text-align:center"><span><?php echo $re->Current_stock;?></span></td>
|
||||
<td style="text-align:center"><span><?php echo $re->reorder;?></span></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
$('#dataTableHistoriek').DataTable({
|
||||
"paging" : true,
|
||||
"ordering" : true,
|
||||
"scrollCollapse" : true,
|
||||
"aaSorting": [[ 3, "desc" ]],
|
||||
"searching" : true,
|
||||
|
||||
//"columnDefs" : [{"targets":3, "type":"date"}],
|
||||
|
||||
"bInfo": true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user