QR Code Fast Scan with Auto Quantity
This commit is contained in:
commit
88db80edcb
File diff suppressed because it is too large
Load Diff
|
|
@ -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,13 +1118,16 @@ 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,
|
||||
});
|
||||
setPaymentAmount(extractorData?.TotalAmtData);
|
||||
setPaymentAmount((extractorData?.TotalAmtData));
|
||||
onSuppInvoiceDateChange(
|
||||
extractorData?.date,
|
||||
extractorData?.date?.format('DD-MM-YYYY') || ''
|
||||
|
|
@ -3854,7 +3943,7 @@ const StockForm = ({ formType }) => {
|
|||
{PurchaseData.reduce(
|
||||
(acc, data) => acc + data?.Amount,
|
||||
0
|
||||
)}
|
||||
)?.toFixed(2)}
|
||||
</div>
|
||||
</div>
|
||||
{!orderType && (
|
||||
|
|
|
|||
|
|
@ -14,6 +14,38 @@
|
|||
border-radius: 3px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.product_primary_Button {
|
||||
background-color: var(--ERROR_COLOR);
|
||||
color: #fff;
|
||||
padding: 15px;
|
||||
|
||||
|
||||
|
||||
border: 1px solid;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
|
||||
width: 170px;
|
||||
height: 45px;
|
||||
background-color: var(--PRIMARY_BUTTON_BG_COLOR) !important;
|
||||
color: #fff;
|
||||
font-family: var(--HEADING_FONT_FAMILY);
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
letter-spacing: 0.5px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
z-index: 2;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.Counter-Category-mapping {
|
||||
|
|
@ -191,6 +223,7 @@
|
|||
}
|
||||
|
||||
.address-type-section {
|
||||
|
||||
// padding: 12px;
|
||||
// background-color: #f8fafc;
|
||||
// border-radius: 8px;
|
||||
|
|
@ -453,6 +486,7 @@
|
|||
.ant-table-thead {
|
||||
z-index: 150 !important;
|
||||
}
|
||||
|
||||
.ant-table-cell {
|
||||
padding: 4px !important;
|
||||
}
|
||||
|
|
@ -558,12 +592,12 @@
|
|||
outline: none;
|
||||
}
|
||||
|
||||
> button:nth-child(1) {
|
||||
>button:nth-child(1) {
|
||||
background-color: #daecfd;
|
||||
color: #1292ee;
|
||||
}
|
||||
|
||||
> button:nth-child(2) {
|
||||
>button:nth-child(2) {
|
||||
background-color: #ffdcdc;
|
||||
color: #ee3333;
|
||||
}
|
||||
|
|
@ -582,7 +616,7 @@
|
|||
flex-direction: column;
|
||||
margin-bottom: 5px;
|
||||
|
||||
> div:nth-child(2) {
|
||||
>div:nth-child(2) {
|
||||
width: max-content;
|
||||
font-size: 12px !important;
|
||||
height: max-content;
|
||||
|
|
@ -601,11 +635,13 @@
|
|||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.lowStock-SaveButton:hover {
|
||||
background-color: #13c12a;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.lowStock-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -630,6 +666,7 @@
|
|||
transform: translateY(0);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.add-slot-header {
|
||||
font-size: 25px;
|
||||
font-weight: 600;
|
||||
|
|
@ -678,15 +715,18 @@
|
|||
.StorekitchenlistTable {
|
||||
scrollbar-width: thin;
|
||||
padding-right: 8px;
|
||||
@media (max-width: 600px) {
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {}
|
||||
|
||||
.ant-table-thead {
|
||||
&:hover {
|
||||
background-color: #bad4f9 !important;
|
||||
}
|
||||
|
||||
tr:hover {
|
||||
background-color: #bad4f9 !important;
|
||||
}
|
||||
|
||||
.ant-table-cell {
|
||||
color: #ffffff;
|
||||
font-weight: 500;
|
||||
|
|
@ -700,11 +740,13 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.StoreRecipeinputForm {
|
||||
.ant-form-item-explain-error {
|
||||
top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.incenbtivepayBTN {
|
||||
.ant-btn {
|
||||
font-size: 16px !important;
|
||||
|
|
@ -733,10 +775,12 @@
|
|||
height: 45px !important;
|
||||
width: 180px !important;
|
||||
font-size: 14px !important;
|
||||
|
||||
&:hover {
|
||||
background-color: #d37305 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.smart_scan_Button {
|
||||
position: unset !important;
|
||||
left: unset !important;
|
||||
|
|
@ -765,6 +809,7 @@
|
|||
border-spacing: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.pricechangeTable {
|
||||
.ant-input {
|
||||
padding: 4px 11px 4px 11px !important;
|
||||
|
|
@ -838,6 +883,7 @@
|
|||
flex-direction: row;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.CommmasterPageHeader {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
|
@ -848,9 +894,11 @@
|
|||
|
||||
.comboProductList {
|
||||
width: 100%;
|
||||
|
||||
.ant-table-thead,
|
||||
.ant-table-cell {
|
||||
white-space: nowrap;
|
||||
|
||||
th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
|
@ -863,6 +911,7 @@ table {
|
|||
font-family: 'Gilroy' !important;
|
||||
}
|
||||
}
|
||||
|
||||
tbody {
|
||||
td {
|
||||
font-family: 'Poppins' !important;
|
||||
|
|
@ -988,7 +1037,7 @@ table {
|
|||
border: 1px solid #dadada;
|
||||
border-radius: 4px;
|
||||
|
||||
> img {
|
||||
>img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
|
|
@ -1113,7 +1162,7 @@ table {
|
|||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
> img {
|
||||
>img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
|
|
@ -1140,7 +1189,7 @@ table {
|
|||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
> img {
|
||||
>img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
|
|
@ -1176,7 +1225,7 @@ table {
|
|||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
> img {
|
||||
>img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
|
|
@ -1203,7 +1252,7 @@ table {
|
|||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
> img {
|
||||
>img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
|
|
@ -1231,7 +1280,7 @@ table {
|
|||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
> img {
|
||||
>img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
|
|
@ -1287,3 +1336,149 @@ table {
|
|||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ProductList-pwiseQrcode {
|
||||
height: max-content !important;
|
||||
max-height: 70vh;
|
||||
overflow: auto;
|
||||
scrollbar-width: thin !important;
|
||||
}
|
||||
|
||||
.inputpwiseQR {
|
||||
width: 150px;
|
||||
height: 40px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #e0e0e0;
|
||||
background-color: #ffffff;
|
||||
font-family: "Poppins";
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.indicationInfo {
|
||||
font-size: 12px;
|
||||
color: #555555;
|
||||
margin: 12px 0 6px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
|
||||
p {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
background-color: #C00000;
|
||||
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
font-family: "Poppins";
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.AddStockMinatain {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
background-color: #1292EE;
|
||||
color: #fff;
|
||||
font-family: "Poppins";
|
||||
font-weight: 500;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.printtabs {
|
||||
display: flex;
|
||||
border-bottom: 2px solid #f0f0f0;
|
||||
margin-bottom: 1rem;
|
||||
gap: 0;
|
||||
|
||||
.tab-item {
|
||||
padding: 6px 12px !important;
|
||||
}
|
||||
|
||||
.print-tabs {
|
||||
display: flex;
|
||||
border-bottom: 2px solid #f0f0f0;
|
||||
margin-bottom: 1rem;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.count {
|
||||
margin-left: 6px;
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
display: flex;
|
||||
padding: 12px 24px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-bottom: none;
|
||||
background: #fafafa;
|
||||
color: #666;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
border-radius: 6px 6px 0 0;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.tab-item:first-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.tab-item:hover {
|
||||
background: #f5f5f5;
|
||||
color: #901D77;
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
color: #901D77;
|
||||
border-color: #901D77;
|
||||
border-bottom: 2px solid #fff;
|
||||
margin-bottom: -2px;
|
||||
z-index: 1;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.tab-item.active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 2px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.ProductList-pwiseQrcode {
|
||||
height: 70vh;
|
||||
overflow-y: auto;
|
||||
scrollbar-width: thin;
|
||||
/* Firefox */
|
||||
scroll-behavior: auto;
|
||||
}
|
||||
|
||||
.row-red {
|
||||
background-color: #ffe6e6 !important;
|
||||
}
|
||||
|
||||
.row-red td {
|
||||
color: #c00000;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue