Compare commits
10 Commits
361150a09b
...
9d7d72cd84
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d7d72cd84 | ||
|
|
c85386f7d2 | ||
|
|
f6943f5a9e | ||
|
|
db3bc89ff0 | ||
|
|
6efba5bf7b | ||
|
|
eeb8c342d7 | ||
|
|
1a2dbf2a05 | ||
|
|
6e04ecbdd6 | ||
|
|
7195d6d56f | ||
|
|
3de16bc920 |
@ -320,7 +320,7 @@ class Amendmentpurchaseorder extends BaseController
|
|||||||
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
|
$AmendmentNewPoNo = generate_amendment_po_number($PONO);
|
||||||
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $Local_Interstate, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $changeStatus , 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult,'CapitalRange' => $Local_Interstate,'BudgetType' => $BudgetType, 'IsOpenOrder'=>$IsOpenOrder); // not
|
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $Local_Interstate, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $changeStatus , 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult,'CapitalRange' => $Local_Interstate,'BudgetType' => $BudgetType, 'IsOpenOrder'=>$IsOpenOrder); // not
|
||||||
$file = $this->request->getFile('POFile');
|
$file = $this->request->getFile('POFile');
|
||||||
$requestfilename = $file->getName();
|
$requestfilename = $file ? $file->getName() : null;
|
||||||
$PrePOFile = $this->request->getPost('PrePOFile');
|
$PrePOFile = $this->request->getPost('PrePOFile');
|
||||||
if (!empty($requestfilename)) {
|
if (!empty($requestfilename)) {
|
||||||
if ($file && $file->isValid() && !$file->hasMoved()) {
|
if ($file && $file->isValid() && !$file->hasMoved()) {
|
||||||
@ -1415,7 +1415,7 @@ class Amendmentpurchaseorder extends BaseController
|
|||||||
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $changeStatus , 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'AmendedDetails' => $MAD, 'PaymentOtherDescription' => $OtherPayment, 'InsuranceStatus' => $insurestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $qtycheckresult);
|
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'TotalOrderValue' => $TotalOrder, 'PODate' => $PODate, 'Status' => $changeStatus , 'PORange' => $PoRange, 'ServiceDescription' => $SpcialInstruction, 'CreatedBy' => $CreateBy, 'DeliveryAddress' => $DeliveryAddr, 'Import_DispatchDetails' => $Dispatch, 'CreatedDate' => $createddt, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ExchangeRate' => $Exchangerate, 'ExchangeRateCalculatedon' => $ExchangeRateCalculatedon, 'CurrencyType' => $CurrencyType, 'PaymentTerms' => $PaymentTerms, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'Import_PlaceofOrgin' => $Palaceoforigin, 'Mode_Of_Shipment' => $Shipmentmode, 'Supplier_Reference' => $SupplierRef, 'Supplier_Offer_No' => $SupplierOffer, 'Other_Reference' => $otherRef, 'Fincap' => $finCap, 'AmendedDetails' => $MAD, 'PaymentOtherDescription' => $OtherPayment, 'InsuranceStatus' => $insurestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $importoption, 'IsQualityChkReqired' => $qtycheckresult);
|
||||||
|
|
||||||
$file = $this->request->getFile('POFile');
|
$file = $this->request->getFile('POFile');
|
||||||
$requestfilename = $file->getName();
|
$requestfilename = $file ? $file->getName() : null;
|
||||||
$PrePOFile = $this->request->getPost('PrePOFile');
|
$PrePOFile = $this->request->getPost('PrePOFile');
|
||||||
|
|
||||||
if (!empty($requestfilename)) {
|
if (!empty($requestfilename)) {
|
||||||
|
|||||||
@ -423,9 +423,9 @@ class Inwardgateregister extends BaseController
|
|||||||
$MasterRemarks = $this->request->getPost('MasterRemarks');
|
$MasterRemarks = $this->request->getPost('MasterRemarks');
|
||||||
$createddt = get_current_date_time();
|
$createddt = get_current_date_time();
|
||||||
//$IGRStatus = IGR_CREATED;//old
|
//$IGRStatus = IGR_CREATED;//old
|
||||||
$PreIGRStatus = (int)$this->request->getPost('hideIGRStatus') == 1 ? IGR_CREATED : IGR_DRAFT;
|
$changedIgrStatus = (int)$this->request->getPost('hideIGRStatus') == 1 ? IGR_CREATED : IGR_DRAFT;
|
||||||
// $IGRStatus = ((int)$IsThisOpenOrderPO == 1) ? IGR_DRAFT : $PreIGRStatus;
|
// $IGRStatus = ((int)$IsThisOpenOrderPO == 1) ? IGR_DRAFT : $changedIgrStatus;
|
||||||
$IGRStatus = $PreIGRStatus;
|
$IGRStatus = $changedIgrStatus;
|
||||||
$igr = array(); // For IGR Master
|
$igr = array(); // For IGR Master
|
||||||
$paymentstatus = NO_PAIDIGR;
|
$paymentstatus = NO_PAIDIGR;
|
||||||
|
|
||||||
@ -612,19 +612,23 @@ class Inwardgateregister extends BaseController
|
|||||||
$totalReceivedqty = 0 ;
|
$totalReceivedqty = 0 ;
|
||||||
|
|
||||||
|
|
||||||
if(!$IsThisOpenOrderPO && $PreIGRStatus == "ST027"){
|
if(!$IsThisOpenOrderPO && $changedIgrStatus == "ST027"){
|
||||||
|
|
||||||
// $quantitiesReceived = $this->inwardgateregister_model->getOldIgrReceivedQty($MaterialCode,$PONO_array);
|
log_message('info','Inside Updation of POLineItem in SaveIgr ');
|
||||||
|
|
||||||
$oldQuantityReceived = 0 ;
|
$currentPoRecievedQuantity = $this->inwardgateregister_model->getCurrentPOreceivedQty($MaterialCode,$PONO);
|
||||||
|
|
||||||
$newQuantitiesReceived = $QuantityAsPerInvoice;
|
$currentIgrPreviousQty = 0 ;
|
||||||
|
|
||||||
$changeInQuantities = $newQuantitiesReceived - $oldQuantityReceived;
|
$currentIgrCurrentQty = $QuantityAsPerInvoice;
|
||||||
|
|
||||||
$quantityToBeUpdated = $changeInQuantities;
|
$changeInQty = $currentIgrCurrentQty - $currentIgrPreviousQty;
|
||||||
|
|
||||||
|
$quantityToBeUpdated = $changeInQty;
|
||||||
|
|
||||||
$totalReceivedqty = $oldQuantityReceived + $quantityToBeUpdated;
|
$totalReceivedqty = $currentPoRecievedQuantity + $quantityToBeUpdated;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
||||||
|
|
||||||
@ -636,17 +640,23 @@ class Inwardgateregister extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus);
|
|
||||||
|
|
||||||
#Step 9 Updating Pending Quantity IN PO Master amd Line Item Details.
|
|
||||||
if ((int)$IsThisOpenOrderPO != 1) {
|
|
||||||
if ($TotalPendingQty == 0.00) {
|
|
||||||
$Newstatus = array('Status' => $IGRStatus);
|
|
||||||
$this->inwardgateregister_model->POLineItemsupdatestatus($PONO, $Newstatus);
|
|
||||||
$this->inwardgateregister_model->pomasterupdatestatus($PONO, $Newstatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// $this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus);
|
||||||
|
|
||||||
|
// #Step 9 Updating Pending Quantity IN PO Master amd Line Item Details.
|
||||||
|
// if ((int)$IsThisOpenOrderPO != 1) {
|
||||||
|
// if ($TotalPendingQty == 0.00) {
|
||||||
|
// $Newstatus = array('Status' => $IGRStatus);
|
||||||
|
// $this->inwardgateregister_model->POLineItemsupdatestatus($PONO, $Newstatus);
|
||||||
|
// $this->inwardgateregister_model->pomasterupdatestatus($PONO, $Newstatus);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#finally
|
#finally
|
||||||
$finalstatement = "Successfully Created IGR Number: $IGRNO \n";
|
$finalstatement = "Successfully Created IGR Number: $IGRNO \n";
|
||||||
|
|
||||||
@ -832,10 +842,13 @@ function viewIGRDetails()
|
|||||||
$DriverName = $this->request->getPost('driver');
|
$DriverName = $this->request->getPost('driver');
|
||||||
$DriverMobileNumber = $this->request->getPost('driver_mobile');
|
$DriverMobileNumber = $this->request->getPost('driver_mobile');
|
||||||
|
|
||||||
$PreIGRStatus = (int)$this->request->getPost('status') == 1 ? IGR_CREATED : IGR_DRAFT;
|
$changedIgrStatus = (int)$this->request->getPost('status') == 1 ? IGR_CREATED : IGR_DRAFT;
|
||||||
$IsThisOpenOrderPO = $this->request->getPost('isOpenOrder');
|
$IsThisOpenOrderPO = $this->request->getPost('isOpenOrder');
|
||||||
// $IGRStatus = ((int)$IsThisOpenOrderPO == 1) ? IGR_DRAFT : $PreIGRStatus;
|
// $IGRStatus = ((int)$IsThisOpenOrderPO == 1) ? IGR_DRAFT : $changedIgrStatus;
|
||||||
$IGRStatus = $PreIGRStatus;
|
$IGRStatus = $changedIgrStatus;
|
||||||
|
|
||||||
|
$getigrstatus = $this->inwardgateregister_model->getigrstatus($IGRNo);
|
||||||
|
$previousIgrStatus = $getigrstatus->IGRStatus;
|
||||||
|
|
||||||
# Here decode the tableData for IGRLineitem
|
# Here decode the tableData for IGRLineitem
|
||||||
$tableData = $this->request->getPost('tableData');
|
$tableData = $this->request->getPost('tableData');
|
||||||
@ -967,22 +980,25 @@ function viewIGRDetails()
|
|||||||
|
|
||||||
# Step 4.3 : IGRlineitem affectedRow have value and MaterialCode have value means
|
# Step 4.3 : IGRlineitem affectedRow have value and MaterialCode have value means
|
||||||
# : updated the polineitem Qty
|
# : updated the polineitem Qty
|
||||||
if(!$IsThisOpenOrderPO && $PreIGRStatus == "ST027"){
|
if(!$IsThisOpenOrderPO && $changedIgrStatus == "ST027"){
|
||||||
|
|
||||||
|
log_message('info','Inside Updation of POLineItem in UpdateIGR ');
|
||||||
|
|
||||||
// $quantitiesReceived = $this->inwardgateregister_model->getOldIgrReceivedQty($MaterialCode,$PONO_array);d
|
$currentPoRecievedQuantity = $this->inwardgateregister_model->getCurrentPOreceivedQty($MaterialCode,$PONo);
|
||||||
|
|
||||||
$oldQuantityReceived = $this->inwardgateregister_model->getOldIgrReceivedIndividualQty($IGRNo , $MaterialCode );
|
$currentIgrPreviousQty = $previousIgrStatus == "ST074"
|
||||||
|
? 0
|
||||||
|
: $this->inwardgateregister_model->currentIgrPreviousQty($IGRNo , $MaterialCode);
|
||||||
|
|
||||||
$newQuantitiesReceived = $quantityAsPerInvoice;
|
$currentIgrCurrentQty = $quantityAsPerInvoice;
|
||||||
|
|
||||||
$changeInQuantities = $newQuantitiesReceived - $oldQuantityReceived;
|
$changeInQty = $currentIgrCurrentQty - $currentIgrPreviousQty;
|
||||||
|
|
||||||
$quantityToBeUpdated = $oldQuantityReceived + $changeInQuantities;
|
$quantityToBeUpdated = $changeInQty;
|
||||||
|
|
||||||
$totalReceivedqty = $quantityToBeUpdated;
|
$totalReceivedqty = $currentPoRecievedQuantity + $quantityToBeUpdated;
|
||||||
|
|
||||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty);
|
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty);
|
||||||
|
|
||||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
||||||
|
|
||||||
@ -1179,19 +1195,16 @@ function viewIGRDetails()
|
|||||||
$updateby = $this->session->get('userId');
|
$updateby = $this->session->get('userId');
|
||||||
$igrarr = array('IGRStatus' => $IGRStatus,'UpdateBY' => $updateby);
|
$igrarr = array('IGRStatus' => $IGRStatus,'UpdateBY' => $updateby);
|
||||||
|
|
||||||
|
$getigrstatus = $this->inwardgateregister_model->getigrstatus($IGRNo);
|
||||||
|
$previousIgrStatus = $getigrstatus->IGRStatus;
|
||||||
|
|
||||||
# Step 2 : Here decode the tableData for IGRLineitem
|
# Step 2 : Here decode the tableData for IGRLineitem
|
||||||
$tableData = $this->request->getPost('tableData');
|
$tableData = $this->request->getPost('tableData');
|
||||||
if (is_string($tableData)) {
|
if (is_string($tableData)) {
|
||||||
$tableData = json_decode($tableData, true);
|
$tableData = json_decode($tableData, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Step 3 : inserting IGR History
|
# Step 3 : loop starts here for IGRlineitem to save
|
||||||
$this->saveIGRMasterHistory(array('IGRStatus' => $IGRStatus),$IGRNo);
|
|
||||||
|
|
||||||
# Step 4 : Updating IGR master
|
|
||||||
$updateigrmaster = $this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
|
||||||
|
|
||||||
# Step 5 : loop starts here for IGRlineitem to save
|
|
||||||
if(!empty($tableData )){
|
if(!empty($tableData )){
|
||||||
|
|
||||||
foreach ($tableData as $row) {
|
foreach ($tableData as $row) {
|
||||||
@ -1199,37 +1212,43 @@ function viewIGRDetails()
|
|||||||
$quantityAsPerInvoice = $row['QuantityAsPerInvoice']; // is also known as inward quantity
|
$quantityAsPerInvoice = $row['QuantityAsPerInvoice']; // is also known as inward quantity
|
||||||
$igrItemNo = $row['IGRItemNo'];
|
$igrItemNo = $row['IGRItemNo'];
|
||||||
|
|
||||||
# Step 5.0 : IGR Lineitem And History Array Formation
|
# Step 3.0 : IGRlineitem affectedRow have value and MaterialCode have value means
|
||||||
$igrline = array(
|
|
||||||
'QuantityAsPerInvoice' => 0,
|
|
||||||
'UpdateBY' => $updateby,
|
|
||||||
'mIGRStatus' => IGR_CANCELLED
|
|
||||||
);
|
|
||||||
|
|
||||||
# Step 5.1 : Save IGRlineitem History
|
|
||||||
$this->saveIGRLineitemHistory(array('QuantityAsPerInvoice'=>0,'mIGRStatus' => $IGRStatus), $IGRNo,$igrItemNo);
|
|
||||||
|
|
||||||
# Step 5.2 : IGRlineitem affectedRow have value and MaterialCode have value means
|
|
||||||
# : updated the polineitem Qty
|
# : updated the polineitem Qty
|
||||||
|
|
||||||
if ($MaterialCode != '') {
|
if ($MaterialCode != '' && $previousIgrStatus == "ST027" ) {
|
||||||
|
|
||||||
|
log_message('info','Inside Updation of POLineItem in CancelIGR ');
|
||||||
|
|
||||||
$PolineitemQty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONo, $MaterialCode);
|
$currentPoRecievedQuantity = $this->inwardgateregister_model->getCurrentPOreceivedQty($MaterialCode,$PONo);
|
||||||
$ReceivedQuantity = 0.00;
|
|
||||||
if (count($PolineitemQty) > 0) {
|
$currentIgrPreviousQty = $this->inwardgateregister_model->currentIgrPreviousQty($IGRNo , $MaterialCode);
|
||||||
foreach ($PolineitemQty as $key) {
|
|
||||||
$ReceivedQuantity = $key->ReceivedQuantity;
|
$currentIgrCurrentQty = 0 ;
|
||||||
}
|
|
||||||
}
|
$changeInQty = $currentIgrCurrentQty - $currentIgrPreviousQty;
|
||||||
|
|
||||||
$totalReceivedqty = ($ReceivedQuantity-$quantityAsPerInvoice);
|
$quantityToBeUpdated = $changeInQty;
|
||||||
$POLineItem = array('ReceivedQuantity' => ($totalReceivedqty > 0) ? $totalReceivedqty : 0 );
|
|
||||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
$totalReceivedqty = $currentPoRecievedQuantity + $quantityToBeUpdated ;
|
||||||
$POMasterStatus = array('Status' => PO_RELEASED);
|
|
||||||
$this->inwardgateregister_model->UpdatePOMasterStatus($PONo, $POMasterStatus);
|
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty );
|
||||||
|
|
||||||
|
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Step 5.3 : Updating IGRlineitem
|
# Step 3.1 : IGR Lineitem And History Array Formation
|
||||||
|
$igrline = array(
|
||||||
|
'QuantityAsPerInvoice' => 0,
|
||||||
|
'UpdateBY' => $updateby,
|
||||||
|
'mIGRStatus' => IGR_CANCELLED
|
||||||
|
);
|
||||||
|
|
||||||
|
# Step 3.2 : Save IGRlineitem History
|
||||||
|
$this->saveIGRLineitemHistory(array('QuantityAsPerInvoice'=>0,'mIGRStatus' => $IGRStatus), $IGRNo,$igrItemNo);
|
||||||
|
|
||||||
|
|
||||||
|
# Step 3.3 : Updating IGRlineitem
|
||||||
$updateigrlineitem = $this->inwardgateregister_model->updateIGRLineItem($igrline, $igrItemNo);
|
$updateigrlineitem = $this->inwardgateregister_model->updateIGRLineItem($igrline, $igrItemNo);
|
||||||
log_message('error', "lineitem updated successfully: " . $updateigrlineitem);
|
log_message('error', "lineitem updated successfully: " . $updateigrlineitem);
|
||||||
log_message('error', 'UpdateIGR updateigrlineitem: ' . json_encode($igrline));
|
log_message('error', 'UpdateIGR updateigrlineitem: ' . json_encode($igrline));
|
||||||
@ -1238,7 +1257,13 @@ function viewIGRDetails()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Successfully Cancelled IGR Number: $IGRNo \n";
|
# Step 4 : inserting IGR History
|
||||||
|
$this->saveIGRMasterHistory(array('IGRStatus' => $IGRStatus),$IGRNo);
|
||||||
|
|
||||||
|
# Step 5 : Updating IGR master
|
||||||
|
$this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
||||||
|
|
||||||
|
echo "Successfully Cancelled IGR Number: $IGRNo \n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -291,15 +291,8 @@ class Supplier extends BaseController
|
|||||||
|
|
||||||
if($PAN){ $supplier['PAN'] = $PAN;}
|
if($PAN){ $supplier['PAN'] = $PAN;}
|
||||||
if($GSTNo){ $supplier['GSTNO'] = $GSTNo;}
|
if($GSTNo){ $supplier['GSTNO'] = $GSTNo;}
|
||||||
if ($file2 && $file2->isValid() && !$file2->hasMoved()) {
|
|
||||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
/********************** File Insertion - MSME **************************/
|
||||||
$GST_DOC = $file2->getName();
|
|
||||||
$file2->move($path,$GST_DOC);
|
|
||||||
$supplier['Cert_GST'] = $GST_DOC;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$supplier['Cert_GST'] = $this->request->getPost('hidden_Cert_GST') ? $this->request->getPost('hidden_Cert_GST') : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($file1 && $file1->isValid() && !$file1->hasMoved()) {
|
if ($file1 && $file1->isValid() && !$file1->hasMoved()) {
|
||||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||||
@ -311,6 +304,18 @@ class Supplier extends BaseController
|
|||||||
$supplier['Cert_MSME'] = $this->request->getPost('hidden_Cert_MSME') ? $this->request->getPost('hidden_Cert_MSME') : NULL;
|
$supplier['Cert_MSME'] = $this->request->getPost('hidden_Cert_MSME') ? $this->request->getPost('hidden_Cert_MSME') : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************** GST *******************************************/
|
||||||
|
if ($file2 && $file2->isValid() && !$file2->hasMoved()) {
|
||||||
|
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||||
|
$GST_DOC = $file2->getName();
|
||||||
|
$file2->move($path,$GST_DOC);
|
||||||
|
$supplier['Cert_GST'] = $GST_DOC;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$supplier['Cert_GST'] = $this->request->getPost('hidden_Cert_GST') ? $this->request->getPost('hidden_Cert_GST') : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/********************** BANK *******************************************/
|
||||||
if ($file3 && $file3->isValid() && !$file3->hasMoved()) {
|
if ($file3 && $file3->isValid() && !$file3->hasMoved()) {
|
||||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||||
$BANK_DOC = $file3->getName();
|
$BANK_DOC = $file3->getName();
|
||||||
@ -321,6 +326,7 @@ class Supplier extends BaseController
|
|||||||
$supplier['Cert_BANK'] = $this->request->getPost('hidden_Cert_BANK') ? $this->request->getPost('hidden_Cert_BANK') : NULL;
|
$supplier['Cert_BANK'] = $this->request->getPost('hidden_Cert_BANK') ? $this->request->getPost('hidden_Cert_BANK') : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************** PAN *******************************************/
|
||||||
if ($file4 && $file4->isValid() && !$file4->hasMoved()) {
|
if ($file4 && $file4->isValid() && !$file4->hasMoved()) {
|
||||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||||
$PAN_DOC = $file4->getName();
|
$PAN_DOC = $file4->getName();
|
||||||
@ -331,6 +337,8 @@ class Supplier extends BaseController
|
|||||||
$supplier['Cert_PAN'] = $this->request->getPost('hidden_Cert_PAN') ? $this->request->getPost('hidden_Cert_PAN') : NULL;
|
$supplier['Cert_PAN'] = $this->request->getPost('hidden_Cert_PAN') ? $this->request->getPost('hidden_Cert_PAN') : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************** End Of File Insertion *************************/
|
||||||
|
|
||||||
$result = $this->supplier_model->UpdateSupplier($supplier, $SupplierID);
|
$result = $this->supplier_model->UpdateSupplier($supplier, $SupplierID);
|
||||||
|
|
||||||
if ($result == True) {
|
if ($result == True) {
|
||||||
|
|||||||
@ -3285,7 +3285,7 @@ function daybeforetotal($yesterday){
|
|||||||
SUM(CASE WHEN date = '$startDate' THEN opening ELSE 0 END) + SUM(receipt) as total,
|
SUM(CASE WHEN date = '$startDate' THEN opening ELSE 0 END) + SUM(receipt) as total,
|
||||||
SUM(used) as used,
|
SUM(used) as used,
|
||||||
SUM(CASE WHEN date = '$startDate' THEN opening ELSE 0 END) + SUM(receipt) - SUM(used) as closing
|
SUM(CASE WHEN date = '$startDate' THEN opening ELSE 0 END) + SUM(receipt) - SUM(used) as closing
|
||||||
FROM t_resinStockDetails tbg
|
FROM t_resinstockdetails tbg
|
||||||
INNER JOIN t_materialmaster tmm ON tmm.MaterialCode = tbg.materialCode
|
INNER JOIN t_materialmaster tmm ON tmm.MaterialCode = tbg.materialCode
|
||||||
INNER JOIN t_igr_details tigrd ON tigrd.MaterialCode = tbg.materialCode AND Date(tigrd.CreatedDate) >= '$startDate' AND Date(tigrd.CreatedDate) <= '$endDate'
|
INNER JOIN t_igr_details tigrd ON tigrd.MaterialCode = tbg.materialCode AND Date(tigrd.CreatedDate) >= '$startDate' AND Date(tigrd.CreatedDate) <= '$endDate'
|
||||||
INNER JOIN t_igr_master tigrm ON tigrd.IGRNO = tigrm.IGRNO
|
INNER JOIN t_igr_master tigrm ON tigrd.IGRNO = tigrm.IGRNO
|
||||||
|
|||||||
@ -754,26 +754,24 @@ class Inwardgateregister_model extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getOldIgrReceivedQty( $MaterialCode, $PONO_array) {
|
function getCurrentPOreceivedQty( $MaterialCode, $PONO) {
|
||||||
|
|
||||||
|
|
||||||
$builder = $this->db->table('t_igr_details tigrd')
|
$builder = $this->db->table('t_purchaseorder_lineitem tpol')
|
||||||
->selectSum('tigrd.QuantityAsPerInvoice')
|
->selectSum('tpol.ReceivedQuantity')
|
||||||
->join('t_igr_master tigrm', 'tigrm.IGRNO = tigrd.IGRNO', 'inner')
|
->where('tpol.PONO',$PONO)
|
||||||
->whereIn('tigrm.PONO', $PONO_array)
|
->where('tpol.MaterialCode', $MaterialCode)
|
||||||
->where('tigrm.IGRStatus', 'ST027')
|
->groupBy('PONO,MaterialCode');
|
||||||
->where('tigrd.MaterialCode', $MaterialCode)
|
|
||||||
->groupBy('tigrd.MaterialCode');
|
|
||||||
|
|
||||||
$result = $builder->get()->getRow();
|
$result = $builder->get()->getRow();
|
||||||
|
|
||||||
log_message('info', 'getOldIgrReceivedQty Second Query: ' . $this->db->getLastQuery()->getQuery());
|
log_message('info', 'getCurrentPOreceivedQty Query: ' . $this->db->getLastQuery()->getQuery());
|
||||||
|
|
||||||
// Return the sum or 0 if no result from the second query
|
// Return the sum or 0 if no result from the second query
|
||||||
return $result ? $result->QuantityAsPerInvoice : 0;
|
return $result ? $result->ReceivedQuantity : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOldIgrReceivedIndividualQty($IGRNo , $MaterialCode){
|
function currentIgrPreviousQty($IGRNo , $MaterialCode){
|
||||||
|
|
||||||
$builder = $this->db->table('t_igr_details tigrd')
|
$builder = $this->db->table('t_igr_details tigrd')
|
||||||
->selectSum('tigrd.QuantityAsPerInvoice')
|
->selectSum('tigrd.QuantityAsPerInvoice')
|
||||||
@ -784,7 +782,7 @@ class Inwardgateregister_model extends Model
|
|||||||
|
|
||||||
$result = $builder->get()->getRow();
|
$result = $builder->get()->getRow();
|
||||||
|
|
||||||
log_message('info', 'getOldIgrReceivedIndividualQty Query: ' . $this->db->getLastQuery()->getQuery());
|
log_message('info', 'currentIgrPreviousQty Query: ' . $this->db->getLastQuery()->getQuery());
|
||||||
|
|
||||||
// Return the sum or 0 if no result from the second query
|
// Return the sum or 0 if no result from the second query
|
||||||
return $result ? $result->QuantityAsPerInvoice : 0;
|
return $result ? $result->QuantityAsPerInvoice : 0;
|
||||||
|
|||||||
@ -645,7 +645,7 @@ class Ipinvoice_model extends Model
|
|||||||
/************************************************************* Resin ****************************************************************/
|
/************************************************************* Resin ****************************************************************/
|
||||||
case "resin":
|
case "resin":
|
||||||
|
|
||||||
$builder = $this->db->table('t_resinStockDetails trd')
|
$builder = $this->db->table('t_resinstockdetails trd')
|
||||||
->select('trd.balanceStock, tmm.MaterialName ,tmm.MaterialCode ,tmm.UOM')
|
->select('trd.balanceStock, tmm.MaterialName ,tmm.MaterialCode ,tmm.UOM')
|
||||||
->join('t_materialmaster tmm', 'tmm.MaterialCode = trd.materialCode')
|
->join('t_materialmaster tmm', 'tmm.MaterialCode = trd.materialCode')
|
||||||
->where('trd.date', $lastDateOfCurrentMonth)
|
->where('trd.date', $lastDateOfCurrentMonth)
|
||||||
@ -679,7 +679,7 @@ class Ipinvoice_model extends Model
|
|||||||
default:
|
default:
|
||||||
|
|
||||||
|
|
||||||
$builder = $this->db->table('t_resinStockDetails trd')
|
$builder = $this->db->table('t_resinstockdetails trd')
|
||||||
->select('trd.balanceStock, tmm.MaterialName ,tmm.MaterialCode , tmm.UOM')
|
->select('trd.balanceStock, tmm.MaterialName ,tmm.MaterialCode , tmm.UOM')
|
||||||
->join('t_materialmaster tmm', 'tmm.MaterialCode = trd.materialCode')
|
->join('t_materialmaster tmm', 'tmm.MaterialCode = trd.materialCode')
|
||||||
->where('trd.date', $lastDateOfCurrentMonth)
|
->where('trd.date', $lastDateOfCurrentMonth)
|
||||||
|
|||||||
@ -6,7 +6,7 @@ use CodeIgniter\Model;
|
|||||||
|
|
||||||
class ResinStockModel extends Model
|
class ResinStockModel extends Model
|
||||||
{
|
{
|
||||||
protected $table = 't_resinStockDetails';
|
protected $table = 't_resinstockdetails';
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $useAutoIncrement = true;
|
protected $useAutoIncrement = true;
|
||||||
protected $returnType = 'array';
|
protected $returnType = 'array';
|
||||||
|
|||||||
@ -209,7 +209,7 @@ class Supplier_model extends Model
|
|||||||
$builder = $builder->select('SupplierID, SupplierName, Address, IsActive');
|
$builder = $builder->select('SupplierID, SupplierName, Address, IsActive');
|
||||||
|
|
||||||
if(!empty($supp_id)){
|
if(!empty($supp_id)){
|
||||||
$builder = $builder->where('SupplierID !=' , $supp_id);
|
$builder = $builder->where('SupplierID <>' , $supp_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$builder = $builder->where('REPLACE(SupplierName, " ", "") ',$supp_name);
|
$builder = $builder->where('REPLACE(SupplierName, " ", "") ',$supp_name);
|
||||||
|
|||||||
@ -3340,10 +3340,11 @@ if (!empty($INRSYMBOL)) {
|
|||||||
/* This is used add capital po line item */
|
/* This is used add capital po line item */
|
||||||
$('.AddCapital').click(function() {
|
$('.AddCapital').click(function() {
|
||||||
|
|
||||||
let CPRate = $('#CPRate').val();
|
|
||||||
|
let CPRate = $('#CPRate').val().trim();
|
||||||
|
|
||||||
|
|
||||||
if (parseFloat(CPRate) === 0 || CPRate.trim() === "") {
|
if (CPRate === "" || CPRate === "0" || CPRate === "0.00" || parseFloat(CPRate) === 0) {
|
||||||
alert("Rate Cannot be Empty Or Zero ..!!")
|
alert("Rate Cannot be Empty Or Zero ..!!")
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -4774,6 +4775,15 @@ if (!empty($INRSYMBOL)) {
|
|||||||
* This function is used for Edit Capital
|
* This function is used for Edit Capital
|
||||||
*/
|
*/
|
||||||
$('.EditCapital').click(function() {
|
$('.EditCapital').click(function() {
|
||||||
|
|
||||||
|
let rate = $('#EditCPRate').val().trim();
|
||||||
|
|
||||||
|
if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) {
|
||||||
|
alert("Rate cannot be empty or zero..!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
if (validateEditCapitalTax() && EditExceedQuantityCheck() && validateEditExceedLimit()) {
|
if (validateEditCapitalTax() && EditExceedQuantityCheck() && validateEditExceedLimit()) {
|
||||||
|
|
||||||
|
|||||||
@ -3440,6 +3440,13 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
|||||||
|
|
||||||
$('.AddImport').click(function() {
|
$('.AddImport').click(function() {
|
||||||
|
|
||||||
|
let rate = $('#Rate').val().trim();
|
||||||
|
|
||||||
|
if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) {
|
||||||
|
alert("Rate cannot be empty or zero..!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// alert('out');
|
// alert('out');
|
||||||
if (validateImport() && ExceedQuantityCheck() && validateExceedLimit() && QtyZerocheck()) {
|
if (validateImport() && ExceedQuantityCheck() && validateExceedLimit() && QtyZerocheck()) {
|
||||||
//alert('in');
|
//alert('in');
|
||||||
@ -3844,6 +3851,14 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('.EditImport').click(function() {
|
$('.EditImport').click(function() {
|
||||||
|
|
||||||
|
let rate = $('#EditRate').val().trim();
|
||||||
|
|
||||||
|
if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) {
|
||||||
|
alert("Rate cannot be empty or zero..!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (validateEditExceedLimit() && ExceedEditQuantityCheck() && EditQtyZerocheck()) {
|
if (validateEditExceedLimit() && ExceedEditQuantityCheck() && EditQtyZerocheck()) {
|
||||||
var CostCode = $("#EditCostCenter").val();
|
var CostCode = $("#EditCostCenter").val();
|
||||||
var AvilBudget = $('#EditAvlBudAmt').val();
|
var AvilBudget = $('#EditAvlBudAmt').val();
|
||||||
|
|||||||
@ -612,8 +612,13 @@
|
|||||||
echo "xxx";
|
echo "xxx";
|
||||||
} ?>
|
} ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right no-border"><?php echo number_alignment($item->Rate); ?></td>
|
<td class="text-right no-border"><?php
|
||||||
<td class="text-right no-border"><?php echo number_alignment(abs($item->BasicValue)); ?></td>
|
if ($POType == 'IMPORT') {
|
||||||
|
echo $item->Rate;
|
||||||
|
} else {
|
||||||
|
echo number_alignment($item->Rate);
|
||||||
|
}
|
||||||
|
?></td> <td class="text-right no-border"><?php echo number_alignment(abs($item->BasicValue)); ?></td>
|
||||||
<td class="text-right no-border"><?php if(isset($item->CGST) && $item->CGST != '' ){ _htmlsc($item->CGST); }else{ echo 0; } ?></td>
|
<td class="text-right no-border"><?php if(isset($item->CGST) && $item->CGST != '' ){ _htmlsc($item->CGST); }else{ echo 0; } ?></td>
|
||||||
<td class="text-right no-border"><?php if (isset($item->AfterCGST) && $item->AfterCGST != '') {
|
<td class="text-right no-border"><?php if (isset($item->AfterCGST) && $item->AfterCGST != '') {
|
||||||
echo number_alignment(abs($item->AfterCGST));
|
echo number_alignment(abs($item->AfterCGST));
|
||||||
|
|||||||
@ -3408,6 +3408,14 @@ if (!empty($INRSYMBOL)) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('.AddRevenue').click(function() {
|
$('.AddRevenue').click(function() {
|
||||||
|
|
||||||
|
let rate = $('#Rate').val().trim();
|
||||||
|
|
||||||
|
if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) {
|
||||||
|
alert("Rate cannot be empty or zero..!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
if (validateRevenueTax() && ExceedQuantityCheck()) {
|
if (validateRevenueTax() && ExceedQuantityCheck()) {
|
||||||
// console.log(index);
|
// console.log(index);
|
||||||
@ -3580,6 +3588,14 @@ if (!empty($INRSYMBOL)) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
$('.EditRevenue').click(function() {
|
$('.EditRevenue').click(function() {
|
||||||
|
|
||||||
|
let rate = $('#EditRate').val().trim();
|
||||||
|
|
||||||
|
if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) {
|
||||||
|
alert("Rate cannot be empty or zero..!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
if (validateEditRevenueTax() && validateEditExceedLimit() && ExceedEditQuantityCheck()) {
|
if (validateEditRevenueTax() && validateEditExceedLimit() && ExceedEditQuantityCheck()) {
|
||||||
var CostCode = $("#EditCostCenter").val();
|
var CostCode = $("#EditCostCenter").val();
|
||||||
|
|||||||
@ -210,20 +210,31 @@ if (!empty($Emp)) {
|
|||||||
<div class="modal-body p-4">
|
<div class="modal-body p-4">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
<label for="MaterialCode" class="control-label">Material Code</label>
|
<label for="MaterialCode" class="control-label">Material Code</label>
|
||||||
<?php
|
<?php
|
||||||
$options = array("0" => 'Material Code');
|
$options = array("0" => 'Material Code');
|
||||||
//print_r( $options);
|
|
||||||
if (!empty($MaterialList)) {
|
|
||||||
foreach ($MaterialList as $MID) :
|
|
||||||
$options[$MID->MaterialCode] = $MID->HSNCODE . ' ' . ' - ' . ' ' . $MID->MaterialName.' ( '.$MID->MaterialCode.' )';
|
|
||||||
endforeach;
|
|
||||||
}
|
|
||||||
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode" class="form-control searchabledropdown" ');
|
|
||||||
|
|
||||||
|
if (!empty($MaterialList)) {
|
||||||
|
foreach ($MaterialList as $MID) :
|
||||||
|
$hsn = isset($MID->HSNCODE) ? $MID->HSNCODE : '';
|
||||||
|
$label = esc($hsn . ' - ' . $MID->MaterialName . ' ( ' . $MID->MaterialCode . ' )');
|
||||||
|
$options[$MID->MaterialCode] = $label;
|
||||||
|
endforeach;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo form_dropdown(
|
||||||
|
'MaterialCode',
|
||||||
|
$options,
|
||||||
|
set_value('MaterialCode'),
|
||||||
|
'id="MaterialCode" class="form-control searchabledropdown"'
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -112,12 +112,12 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xl-12 col-md-12">
|
<div class="col-xl-6 col-md-6">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body" style="min-height: 460px;">
|
||||||
<h4 class="header-title">This Month Stock Closing</h4>
|
<h4 class="header-title">This Month Stock Closing</h4>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between align-items-center w-50">
|
<div class="d-flex justify-content-between align-items-center ">
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-primary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=resin">Resin</a>
|
<a class="btn btn-primary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=resin">Resin</a>
|
||||||
<a class="btn btn-secondary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=bag">Bag</a>
|
<a class="btn btn-secondary btn-sm px-2" href="<?php echo base_url(); ?>sales_dashboard?stock=bag">Bag</a>
|
||||||
@ -152,7 +152,7 @@
|
|||||||
}
|
}
|
||||||
}?>
|
}?>
|
||||||
|
|
||||||
<table align="left" id="stockClosing" class="table dt-responsive nowrap w-50">
|
<table align="left" id="stockClosing" class="table dt-responsive nowrap ">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
||||||
<?php if (is_array($stock[0]['header'])) { ?>
|
<?php if (is_array($stock[0]['header'])) { ?>
|
||||||
@ -224,7 +224,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
<div class="col-xl-6 col-md-6">
|
||||||
|
<div class="card" style="min-height: 460px;">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="header-title">This Month Stock Chart</h4>
|
||||||
|
<canvas id="stockChart" height="170"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -414,6 +426,72 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const stockLabels = <?php echo json_encode(is_array($stock[0]['header']) ? $stock[0]['header'] : [$stock[0]['header']]); ?>;
|
||||||
|
const stockData = <?php echo json_encode(is_array($stock[0]['header']) ? $stock[2]['body'] : [$stock[1]['body']]); ?>;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const stockCtx = document.getElementById('stockChart').getContext('2d');
|
||||||
|
|
||||||
|
const stockChart = new Chart(stockCtx, {
|
||||||
|
type: 'bar', // or 'line', 'doughnut', etc.
|
||||||
|
|
||||||
|
data: {
|
||||||
|
labels: stockLabels,
|
||||||
|
datasets: [{
|
||||||
|
label: 'Closing Stock',
|
||||||
|
data: stockData,
|
||||||
|
backgroundColor: 'rgba(54, 162, 235, 0.5)',
|
||||||
|
borderColor: 'rgba(54, 162, 235, 1)',
|
||||||
|
borderWidth: 1
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
position: 'top',
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
callbacks: {
|
||||||
|
label: function(context) {
|
||||||
|
return ` ${context.parsed.y} units`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
y: {
|
||||||
|
beginAtZero: true,
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Stock Quantity'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
x: {
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Material'
|
||||||
|
},
|
||||||
|
ticks: {
|
||||||
|
callback: function(value, index, ticks) {
|
||||||
|
const label = this.getLabelForValue(value);
|
||||||
|
return label.length > 12 ? label.substr(0, 12) + '...' : label;
|
||||||
|
},
|
||||||
|
font: {
|
||||||
|
size: 10
|
||||||
|
},
|
||||||
|
maxRotation: 45,
|
||||||
|
minRotation: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|||||||
@ -677,10 +677,14 @@ if (!empty($INRSYMBOL)) {
|
|||||||
clearTotalItemValues();
|
clearTotalItemValues();
|
||||||
|
|
||||||
$('.EditService').click(function(){
|
$('.EditService').click(function(){
|
||||||
console.log("1111111111111111111");
|
|
||||||
|
|
||||||
// tinyMCE.triggerSave();
|
let rate = $('#Edit').val().trim();
|
||||||
console.log("2222222222222222");
|
|
||||||
|
if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) {
|
||||||
|
alert("Rate cannot be empty or zero..!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (validateEditServiceTax()) {
|
if (validateEditServiceTax()) {
|
||||||
var CostCode = $("#EditCostCenter").val();
|
var CostCode = $("#EditCostCenter").val();
|
||||||
@ -1925,6 +1929,13 @@ console.log($('#ItemDescription' + userid).val());
|
|||||||
|
|
||||||
$('.AddService').click(function() {
|
$('.AddService').click(function() {
|
||||||
|
|
||||||
|
let rate = $('#Rate').val().trim();
|
||||||
|
|
||||||
|
if (rate === "" || rate === "0" || rate === "0.00" || parseFloat(rate) === 0) {
|
||||||
|
alert("Rate cannot be empty or zero..!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
if (validateServiceTax()) {
|
if (validateServiceTax()) {
|
||||||
var temp = index;
|
var temp = index;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user