i just added console .log
This commit is contained in:
parent
81b3e4b84f
commit
e6ac28e89a
File diff suppressed because it is too large
Load Diff
|
|
@ -131,7 +131,7 @@ const CameraModal = ({
|
|||
setImage(imageData);
|
||||
stopCamera();
|
||||
};
|
||||
|
||||
console.log('image state:', image)
|
||||
const retake = () => {
|
||||
setImage(null);
|
||||
startCamera();
|
||||
|
|
@ -878,7 +878,7 @@ const InvoiceImageExtractorModal = ({
|
|||
extractedText,
|
||||
products: productTableData,
|
||||
supplierSuggestions: supplierSuggestions,
|
||||
TotalAmtData: TotalAmtData,
|
||||
TotalAmtData: parseFloat(TotalAmtData)?.toFixed(2),
|
||||
});
|
||||
handleClose({ submit: true });
|
||||
message.success('Applied to purchase form!');
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ import {
|
|||
getsingleQrcodeData,
|
||||
productTypeDataSelector,
|
||||
getProductTypeData,
|
||||
bulkpostdata,
|
||||
} from '../../Features/ProductPage/ProductPage.js';
|
||||
import { postConfiguration } from '../../Features/ConfigMasterPage/ConfigMasterPage.js';
|
||||
import SupplierProductMappingForm from '../SupplierProductMapping/SuplierProductMappingForm.jsx';
|
||||
|
|
@ -687,7 +688,8 @@ const StockForm = ({ formType }) => {
|
|||
const allSupplierProducts = response?.data?.data || [];
|
||||
|
||||
const matchingProdIds = [];
|
||||
|
||||
const NewImageProducts = [];
|
||||
console.log(unmatchedProducts, 'unmatchedProductsunmatchedProducts');
|
||||
// check if the unmatched products exists in our products list
|
||||
unmatchedProducts.forEach((item) => {
|
||||
const match = allSupplierProducts?.[0]?.ProductDetails.find(
|
||||
|
|
@ -698,8 +700,90 @@ const StockForm = ({ formType }) => {
|
|||
if (match) {
|
||||
matchingProdIds.push(match.ProdId);
|
||||
}
|
||||
else{
|
||||
NewImageProducts.push(item?.parsedData);
|
||||
}
|
||||
});
|
||||
console.log(NewImageProducts, 'NewImageProductsNewImageProducts');
|
||||
// Bulk upload new image products
|
||||
if (NewImageProducts.length > 0) {
|
||||
const newProductsData = NewImageProducts.map(product => ({
|
||||
AppId: AppId || 0,
|
||||
CompId: CompId || "",
|
||||
BranchId: BranchId || "",
|
||||
CreatedBy: UserId || 0,
|
||||
ProdName: product.description?.trim() || "",
|
||||
ProdVariantName: "",
|
||||
Size: 1 || "",
|
||||
UOM: product.unit || "",
|
||||
MRP: parseFloat(product.rate) || 0,
|
||||
WhSalePrice: 0,
|
||||
SellPrice: parseFloat(product.rate) || 0,
|
||||
ProdCat: "General",
|
||||
ProdSubCat: "",
|
||||
Brand: "",
|
||||
AutoGenerateQr: "",
|
||||
QRCode: "",
|
||||
StockAvailable: 'No',
|
||||
TaxId: "",
|
||||
HSNCode: "",
|
||||
PartNumber: "",
|
||||
Rack: 0,
|
||||
ManufDate: "",
|
||||
ExpDate: "",
|
||||
AvailableFrom: "",
|
||||
AvailableTo: "",
|
||||
ProdLogo: "",
|
||||
OnePcsAvailable: "No",
|
||||
AutoGenerateSingleQr:'No',
|
||||
TaxId: 'NIL - 0%',
|
||||
OnePcQR: "",
|
||||
TokenAvailable: 'No',
|
||||
OpeningQty: 0,
|
||||
QtyBasedPrice: "",
|
||||
InwardDate: "",
|
||||
SuppId: suppId || "",
|
||||
Reference: "",
|
||||
ReceivedQty: 0,
|
||||
AcceptedQty: 0,
|
||||
RejectedQty: 0,
|
||||
RejectionReason: "",
|
||||
IssuedQty: 0,
|
||||
BalanceQty: 0,
|
||||
InwardPrice: 0,
|
||||
OfferPrice: 0,
|
||||
SpecialPrice: 0,
|
||||
Cess: 0,
|
||||
}));
|
||||
|
||||
const bulkResponse = await dispatch(bulkpostdata({ ProdDetails: newProductsData })).unwrap();
|
||||
|
||||
if (bulkResponse?.data?.statusCode === 1) {
|
||||
// After successful bulk upload, check the condition again
|
||||
const updatedResponse = await dispatch(
|
||||
getSupplaierIdBasedProducts({ CompId, AppId, BranchId, SuppId: suppId })
|
||||
).unwrap();
|
||||
if (updatedResponse?.data?.statusCode === 1) {
|
||||
const updatedAllSupplierProducts = updatedResponse?.data?.data || [];
|
||||
const updatedMatchingProdIds = [];
|
||||
|
||||
unmatchedProducts.forEach((item) => {
|
||||
const match = updatedAllSupplierProducts?.[0]?.ProductDetails.find(
|
||||
(supp) =>
|
||||
supp?.ProdName?.toLowerCase() ===
|
||||
item?.parsedData?.description?.toLowerCase()
|
||||
);
|
||||
if (match) {
|
||||
updatedMatchingProdIds.push(match.ProdId);
|
||||
}
|
||||
});
|
||||
|
||||
if (updatedMatchingProdIds.length > 0) {
|
||||
matchingProdIds.push(...updatedMatchingProdIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if there is matching products, map them to the supplier
|
||||
if (matchingProdIds.length > 0) {
|
||||
setLoadingText('Mapping products to supplier...');
|
||||
|
|
@ -1003,7 +1087,9 @@ const StockForm = ({ formType }) => {
|
|||
};
|
||||
|
||||
const handleSuppInvoiceNoChange = (e) => {
|
||||
formProductRef.current?.setFieldsValue({ SuppInvoiceNo: e.target.value });
|
||||
const value = e.target.value;
|
||||
formRef.current?.setFieldsValue({ SuppInvoiceNo: value });
|
||||
setExtractorData(prev => prev ? { ...prev, invoiceNo: value } : null);
|
||||
};
|
||||
|
||||
const handleInvoiceTypeChange = (value) => {
|
||||
|
|
@ -1032,9 +1118,12 @@ const StockForm = ({ formType }) => {
|
|||
formRef?.current?.getFieldsValue(),
|
||||
'formRefformRefformRefformRef'
|
||||
);
|
||||
if(extractorData?.invoiceNo !== null && extractorData?.invoiceNo !== ""){
|
||||
formRef?.current?.setFieldsValue({
|
||||
SuppInvoiceNo: extractorData?.invoiceNo,
|
||||
});
|
||||
SuppInvoiceNo: extractorData?.invoiceNo,
|
||||
});
|
||||
}
|
||||
|
||||
formRef?.current?.setFieldsValue({
|
||||
PaymentAmount: extractorData?.TotalAmtData,
|
||||
});
|
||||
|
|
@ -3854,7 +3943,7 @@ const StockForm = ({ formType }) => {
|
|||
{PurchaseData.reduce(
|
||||
(acc, data) => acc + data?.Amount,
|
||||
0
|
||||
)}
|
||||
)?.toFixed(2)}
|
||||
</div>
|
||||
</div>
|
||||
{!orderType && (
|
||||
|
|
|
|||
1282
src/check.jsx
1282
src/check.jsx
File diff suppressed because it is too large
Load Diff
|
|
@ -267,7 +267,7 @@ const fetchComponent = async () => {
|
|||
sessionStore('userName', 'Karthiga');
|
||||
sessionStorage.setItem(
|
||||
'auth',
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzY5NTQwNDg2LCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.dk6WOA7_jjKUv94Ni9RjMxHGgZRdpGj2QqXyyQMcFpo'
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzY5NjI2NTY5LCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.ikZ6LFjteZT4wKe2mvKTPe2-gmk3JdymxLl2fQ71o54'
|
||||
);
|
||||
|
||||
const AppId = getSession('AppId');
|
||||
|
|
@ -372,7 +372,7 @@ const fetchHomeComponent = async () => {
|
|||
sessionStore('userName', 'Karthiga');
|
||||
sessionStorage.setItem(
|
||||
'auth',
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzY5NTQwNDg2LCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.dk6WOA7_jjKUv94Ni9RjMxHGgZRdpGj2QqXyyQMcFpo'
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzY5NjI2NTY5LCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.ikZ6LFjteZT4wKe2mvKTPe2-gmk3JdymxLl2fQ71o54'
|
||||
);
|
||||
const AppId = getSession('AppId');
|
||||
if (AppId) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue