From 0d6b950a99986facfec808b32e6eb4cd7573cdae Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Feb 2026 12:54:08 +0530 Subject: [PATCH 1/2] added sorting in product receipt name --- .../SalesDetailsNetAmountModal.jsx | 427 +++++++ .../Template/SalesCountComponent.jsx | 447 +------ .../Template/SalesCountForStandard.jsx | 424 +------ src/Pages/StockMaster/AddAllProductGrid.jsx | 27 +- src/Pages/StockMaster/StockForm.jsx | 1121 +++++++++-------- src/Pages/StockinHand/StockinHand.jsx | 2 +- .../UtillComponents/BSNavBarComponents.scss | 21 +- 7 files changed, 1089 insertions(+), 1380 deletions(-) create mode 100644 src/Pages/BookingScreen/Components/UtillComponents/SalesDetailsNetAmountModal.jsx diff --git a/src/Pages/BookingScreen/Components/UtillComponents/SalesDetailsNetAmountModal.jsx b/src/Pages/BookingScreen/Components/UtillComponents/SalesDetailsNetAmountModal.jsx new file mode 100644 index 0000000..5f98235 --- /dev/null +++ b/src/Pages/BookingScreen/Components/UtillComponents/SalesDetailsNetAmountModal.jsx @@ -0,0 +1,427 @@ +import { DefaultModal } from "../../../../Components/Modal/DefaultModal" +import { extractLastNumberOrderId } from "../../../../Services/Others" +import '../../../../Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss'; + +const SalesDetailsModal = ({ isModalOpen = false, + setIsModalOpen = () => { }, + currentData = [], + currentPage, + totalPages, + setCurrentPage = () => { }, + startIndex +}) => { + + return ( + setIsModalOpen(false)} + handleSubmit={() => setIsModalOpen(false)} + width={700} + footer={false} + > +
+ + + + + + + + {/* */} + + + + + + + {currentData?.length > 0 ? ( + currentData?.map((item, index) => ( + + (e.currentTarget.style.backgroundColor = '#d6e4ff') + } + onMouseLeave={(e) => + (e.currentTarget.style.backgroundColor = + index % 2 === 0 ? '#f7faff' : '#e9f1ff') + } + > + + + + + {/* */} + + + + )) + ) : ( + + + + )} + +
+ S.No + + Order ID + + Customer + + Mobile + Booked By + Payment Type + + Amount (₹) +
+ {startIndex + index + 1} + + {extractLastNumberOrderId(item.OrderId)} + + {item.CustName || '—'} + + {item.CustMobile || '—'} + + {item.BookedBy || "—"} + + {item.PaymentTypeName || '—'} + + ₹{item.Amount?.toLocaleString()} +
+ No booking data available +
+ + {/* Pagination */} + {totalPages > 1 && ( +
+ {currentPage == 1 ? ( + '' + ) : ( + + )} + + + Page {currentPage} of {totalPages} + + + +
+ )} +
+
+ ) +} + +const SalesNetAmountModal = ({ + isNetAmtModalOpen = false, + setIsNetAmtModalOpen = () => { }, + orderDetails = [] +}) => { + return ( + setIsNetAmtModalOpen(false)} + handleSubmit={() => setIsNetAmtModalOpen(false)} + width={800} + footer={false} + > +
+ + + + + + + + + + + + + + + + + + + + + + + + + + {orderDetails?.map((item, index) => { + const total = + (item.CashAmount || 0) + + (item.UpiAmount || 0) + + (item.CardAmount || 0) + + (item.CreditAmount || 0); + + return ( + + (e.currentTarget.style.backgroundColor = '#e6f2ff') + } + onMouseLeave={(e) => + (e.currentTarget.style.backgroundColor = + index % 2 === 0 ? '#f7faff' : '#ffffff') + } + > + + + + + + + + + + + + + ); + })} + +
+ Cash + + UPI + + Card + + Credit + + Business UPI + + Total +
+ Count + + Amt + + Count + + Amt + + Count + + Amt + + Count + + Amt + + Count + + Amt +
+ {item.CashCount} + + {item.CashAmount} + + {item.UpiCount} + + {item.UpiAmount} + + {item.CardCount} + + {item.CardAmount} + + {item.CreditCount} + + {item.CreditAmount} + + {item.BusinessUpiCount} + + {item.BusinessUpiAmount} + + {total} +
+
+
+ ) +} + +export { SalesDetailsModal, SalesNetAmountModal }; \ No newline at end of file diff --git a/src/Pages/BookingScreen/Template/SalesCountComponent.jsx b/src/Pages/BookingScreen/Template/SalesCountComponent.jsx index 32ed2a8..2230ff8 100644 --- a/src/Pages/BookingScreen/Template/SalesCountComponent.jsx +++ b/src/Pages/BookingScreen/Template/SalesCountComponent.jsx @@ -56,6 +56,7 @@ const ShortcutKeyHelper = lazy( ); // Scss import './SalesCountComponent.scss'; +import { SalesDetailsModal, SalesNetAmountModal } from '../Components/UtillComponents/SalesDetailsNetAmountModal.jsx'; const SalesCountComponent = React.memo( ({ DineInAccess, GlobalsalesDetailData }) => { @@ -540,9 +541,9 @@ const SalesCountComponent = React.memo(
{safeRound( TakeAwayAmount + - SelfTakeAwayAmount + - PreOrderAmount - - OverAllTakeAwayOfferAmount + SelfTakeAwayAmount + + PreOrderAmount - + OverAllTakeAwayOfferAmount )}
@@ -615,8 +616,8 @@ const SalesCountComponent = React.memo(
{safeRound( DineInAmount + - SelfDineInAmount - - OverAllDineInOfferAmount + SelfDineInAmount - + OverAllDineInOfferAmount )}
@@ -628,8 +629,8 @@ const SalesCountComponent = React.memo( {safeRound( DineInAmount + - SelfDineInAmount - - OverAllDineInOfferAmount + SelfDineInAmount - + OverAllDineInOfferAmount )}

@@ -647,7 +648,7 @@ const SalesCountComponent = React.memo( SelfTakeAwayAmount + PreOrderAmount - OverAllTakeAwayOfferAmount || 0) + - (DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount) + (DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount) ) > 0 && setIsNetAmtModalOpen(true) } > @@ -658,428 +659,28 @@ const SalesCountComponent = React.memo( SelfTakeAwayAmount + PreOrderAmount - OverAllTakeAwayOfferAmount || 0) + - (DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount) + (DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount) )}

{Customisebillno && } {/* Modal with table for multiple bookings */} - setIsModalOpen(false)} - handleSubmit={() => setIsModalOpen(false)} - width={700} - footer={false} - > -
- - - - - - - - {/* */} - - - - - - - {currentData?.length > 0 ? ( - currentData?.map((item, index) => ( - - (e.currentTarget.style.backgroundColor = '#d6e4ff') - } - onMouseLeave={(e) => - (e.currentTarget.style.backgroundColor = - index % 2 === 0 ? '#f7faff' : '#e9f1ff') - } - > - - - - - {/* */} - - - - )) - ) : ( - - - - )} - -
- S.No - - Order ID - - Customer - - Mobile - Booked By - Payment Type - - Amount (₹) -
- {startIndex + index + 1} - - {extractLastNumberOrderId(item.OrderId)} - - {item.CustName || '—'} - - {item.CustMobile || '—'} - - {item.BookedBy || "—"} - - {item.PaymentTypeName || '—'} - - ₹{item.Amount?.toLocaleString()} -
- No booking data available -
- - {/* Pagination */} - {totalPages > 1 && ( -
- {currentPage == 1 ? ( - '' - ) : ( - - )} - - - Page {currentPage} of {totalPages} - - - -
- )} -
-
+ {/* Modal with table for multiple Net Amt */} - setIsNetAmtModalOpen(false)} - handleSubmit={() => setIsNetAmtModalOpen(false)} - width={800} - footer={false} - > -
- - - - - - - - - - - - - - - - - - - - - - - - - - {orderDetails?.map((item, index) => { - const total = - (item.CashAmount || 0) + - (item.UpiAmount || 0) + - (item.CardAmount || 0) + - (item.CreditAmount || 0); - - return ( - - (e.currentTarget.style.backgroundColor = '#e6f2ff') - } - onMouseLeave={(e) => - (e.currentTarget.style.backgroundColor = - index % 2 === 0 ? '#f7faff' : '#ffffff') - } - > - - - - - - - - - - - - - ); - })} - -
- Cash - - UPI - - Card - - Credit - - Business UPI - - Total -
- Count - - Amt - - Count - - Amt - - Count - - Amt - - Count - - Amt - - Count - - Amt -
- {item.CashCount} - - {item.CashAmount} - - {item.UpiCount} - - {item.UpiAmount} - - {item.CardCount} - - {item.CardAmount} - - {item.CreditCount} - - {item.CreditAmount} - - {item.BusinessUpiCount} - - {item.BusinessUpiAmount} - - {total} -
-
-
+ {TableData?.length > 0 && AutoReceiveStock && ( - )} - - - Page {currentPage} of {totalPages} - - - - - )} - - + {/* Modal with table for multiple Net Amt */} - setIsNetAmtModalOpen(false)} - handleSubmit={() => setIsNetAmtModalOpen(false)} - width={800} - footer={false} - > -
- - - - - - - - - - - - - - - - - - - - - - - - - - {orderDetails?.map((item, index) => { - const total = - (item.CashAmount || 0) + - (item.UpiAmount || 0) + - (item.CardAmount || 0) + - (item.CreditAmount || 0); - - return ( - - (e.currentTarget.style.backgroundColor = '#e6f2ff') - } - onMouseLeave={(e) => - (e.currentTarget.style.backgroundColor = - index % 2 === 0 ? '#f7faff' : '#ffffff') - } - > - - - - - - - - - - - - - ); - })} - -
- Cash - - UPI - - Card - - Credit - - Business UPI - - Total -
- Count - - Amt - - Count - - Amt - - Count - - Amt - - Count - - Amt - - Count - - Amt -
- {item.CashCount} - - {item.CashAmount} - - {item.UpiCount} - - {item.UpiAmount} - - {item.CardCount} - - {item.CardAmount} - - {item.CreditCount} - - {item.CreditAmount} - - {item.BusinessUpiCount} - - {item.BusinessUpiAmount} - - {total} -
-
-
+ { // This function just returns a prepared product object, no state changes - const [messageType, setMessageType] = useState(null); - const [messageData, setMessageData] = useState(null); - + const [messageType, setMessageType] = useState(null); + const [messageData, setMessageData] = useState(null); + const ProductDropDownChange = async ( VariantName, ProdId, @@ -51,6 +51,7 @@ const AddAllProductsButton = ({ MRP: ProductData1.MRP, ProdName: ProductData1.ProdName, UomName: ProductData1.UomName, + Size: ProductData1.Size, SellPrice: ProductData1.SellPrice, StockAvailable: ProductData1.StockAvailable, OnePcsAvailable: ProductData1.OnePcsAvailable, @@ -89,7 +90,7 @@ const AddAllProductsButton = ({ if (productsToAdd.length === 0) { setMessageData('All products are already added'); - setMessageType('warning'); + setMessageType('warning'); return; } @@ -149,18 +150,18 @@ const AddAllProductsButton = ({ setLoadingText(''); } }; - const onComplete = useCallback(() => { - setMessageData(null); - setMessageType(null); - }, []); + const onComplete = useCallback(() => { + setMessageData(null); + setMessageType(null); + }, []); return ( - + diff --git a/src/Pages/StockMaster/StockForm.jsx b/src/Pages/StockMaster/StockForm.jsx index d6190cc..005b835 100644 --- a/src/Pages/StockMaster/StockForm.jsx +++ b/src/Pages/StockMaster/StockForm.jsx @@ -12,6 +12,8 @@ import { ArrowRightOutlined, PlusCircleOutlined, SearchOutlined, + SortAscendingOutlined, + SortDescendingOutlined, } from '@ant-design/icons'; import { Form, @@ -230,6 +232,7 @@ const StockForm = ({ formType }) => { const [SelectedPurchaseType, setSelectedPurchaseType] = useState(null); const [SelectedPurcTaxType, setSelectedPurcTaxType] = useState(null); const [PurchaseData, setPurchaseData] = useState([]); + console.log(PurchaseData, "PurchaseData") const [additionalInfoModal, setAdditionalInfoModal] = useState(false); const [selectedRowIndex, setSelectedRowIndex] = useState(null); const [selectedRowRecord, setSelectedRowRecord] = useState({}); @@ -280,6 +283,7 @@ const StockForm = ({ formType }) => { const [searchValue, setSearchValue] = useState(''); const isSearching = Boolean(searchValue?.trim()); const [showAllSuppliers, setShowAllSuppliers] = useState(false); + const [nameSortOrder, setNameSortOrder] = useState(null); const SelInvoiceAmount = useMemo(() => { const total = PurchaseData?.reduce( @@ -1137,6 +1141,7 @@ const StockForm = ({ formType }) => { extractedItem, existingProducts ) => { + setProductSearchText(''); setSelectedProductName(option?.label ? option?.label : ''); formRef?.current?.resetFields(['VarProdId']); @@ -1172,6 +1177,7 @@ const StockForm = ({ formType }) => { MRP: ProductData1?.MRP, ProdName: ProductData1?.ProdName, UomName: ProductData1?.UomName, + Size: ProductData1?.Size, SellPrice: ProductData1?.SellPrice, StockAvailable: ProductData1?.StockAvailable, OnePcsAvailable: ProductData1?.OnePcsAvailable, @@ -1253,6 +1259,7 @@ const StockForm = ({ formType }) => { ProdName: product.ProdName, ProdVariantName: product.ProdVariantName, UomName: product.UomName, + Size: product.Size, MRP: product.MRP, SellPrice: product.SellPrice, OnePcsPrice: product.OnePcsPrice, @@ -1416,47 +1423,47 @@ const StockForm = ({ formType }) => { const localId = record.localId; const values = Delete ? { - [`BalanceQty${localId}`]: undefined, - [`ReceivedQty${localId}`]: undefined, - [`AcceptedQty${localId}`]: undefined, - [`RejectedQty${localId}`]: undefined, - [`Amount${localId}`]: undefined, - [`Freeqty${localId}`]: undefined, - [`InwardPrice${localId}`]: undefined, - [`MRP${localId}`]: undefined, - [`PurcDisc${localId}`]: undefined, - [`SellPrice${localId}`]: undefined, - [`WhSalePrice${localId}`]: undefined, - [`offerSalePrice${localId}`]: undefined, - [`splSalePrice${localId}`]: undefined, - [`NumberofPieceinside${localId}`]: undefined, - [`AmountPerPiece${localId}`]: undefined, - [`PurcDiscType${localId}`]: undefined, - [`ManufDate${localId}`]: undefined, - [`ExpDate${localId}`]: undefined, - [`OnePcsPrice${localId}`]: undefined, - [`NoOfPcs${localId}`]: undefined, - } + [`BalanceQty${localId}`]: undefined, + [`ReceivedQty${localId}`]: undefined, + [`AcceptedQty${localId}`]: undefined, + [`RejectedQty${localId}`]: undefined, + [`Amount${localId}`]: undefined, + [`Freeqty${localId}`]: undefined, + [`InwardPrice${localId}`]: undefined, + [`MRP${localId}`]: undefined, + [`PurcDisc${localId}`]: undefined, + [`SellPrice${localId}`]: undefined, + [`WhSalePrice${localId}`]: undefined, + [`offerSalePrice${localId}`]: undefined, + [`splSalePrice${localId}`]: undefined, + [`NumberofPieceinside${localId}`]: undefined, + [`AmountPerPiece${localId}`]: undefined, + [`PurcDiscType${localId}`]: undefined, + [`ManufDate${localId}`]: undefined, + [`ExpDate${localId}`]: undefined, + [`OnePcsPrice${localId}`]: undefined, + [`NoOfPcs${localId}`]: undefined, + } : { - [`BalanceQty${localId}`]: record.BalanceQty, - [`ReceivedQty${localId}`]: record.ReceivedQty, - [`AcceptedQty${localId}`]: record.AcceptedQty, - [`RejectedQty${localId}`]: record.RejectedQty, - [`Freeqty${localId}`]: record.FreeItem, - [`MRP${localId}`]: record.MRP, - [`ManufDate${localId}`]: record.ManufDate, - [`ExpDate${localId}`]: record.ExpDate, - [`SellPrice${localId}`]: record.SellPrice, - [`WhSalePrice${localId}`]: record.WhSalePrice, - [`PurcDiscType${localId}`]: record.PurcDiscType, - [`Amount${localId}`]: record.Amount, - [`InwardPrice${localId}`]: record.InwardPrice, - [`PurcDisc${localId}`]: record.PurcDisc, - [`offerSalePrice${localId}`]: record.OfferPrice, - [`splSalePrice${localId}`]: record.SpecialPrice, - [`OnePcsPrice${localId}`]: record.OnePcsPrice, - [`NoOfPcs${localId}`]: record.NoOfPcs, - }; + [`BalanceQty${localId}`]: record.BalanceQty, + [`ReceivedQty${localId}`]: record.ReceivedQty, + [`AcceptedQty${localId}`]: record.AcceptedQty, + [`RejectedQty${localId}`]: record.RejectedQty, + [`Freeqty${localId}`]: record.FreeItem, + [`MRP${localId}`]: record.MRP, + [`ManufDate${localId}`]: record.ManufDate, + [`ExpDate${localId}`]: record.ExpDate, + [`SellPrice${localId}`]: record.SellPrice, + [`WhSalePrice${localId}`]: record.WhSalePrice, + [`PurcDiscType${localId}`]: record.PurcDiscType, + [`Amount${localId}`]: record.Amount, + [`InwardPrice${localId}`]: record.InwardPrice, + [`PurcDisc${localId}`]: record.PurcDisc, + [`offerSalePrice${localId}`]: record.OfferPrice, + [`splSalePrice${localId}`]: record.SpecialPrice, + [`OnePcsPrice${localId}`]: record.OnePcsPrice, + [`NoOfPcs${localId}`]: record.NoOfPcs, + }; if (!Delete && applicationRestrictedFields.BatchAndModelDetails) { values[`BatchRef${localId}`] = record.BatchRef; @@ -1547,6 +1554,23 @@ const StockForm = ({ formType }) => { [`${key}${localId}`]: value, }); }; + + const handleNameSort = () => { + const newOrder = nameSortOrder === 'asc' ? 'desc' : 'asc'; + + const sorted = [...PurchaseData].sort((a, b) => { + const nameA = a.ProdName?.trim() || ''; + const nameB = b.ProdName?.trim() || ''; + + return newOrder === 'asc' + ? nameA.localeCompare(nameB) + : nameB.localeCompare(nameA); + }); + + setPurchaseData(sorted); + setNameSortOrder(newOrder); + }; + const columns = useMemo(() => { const baseColumns = [ { @@ -1559,7 +1583,33 @@ const StockForm = ({ formType }) => { ), }, { - title: 'Name', + title: ( +
+ Name + + {nameSortOrder === 'asc' ? ( + + ) : ( + + )} + +
+ ), dataIndex: 'ProdName', key: 'ProdName', align: 'left', @@ -1584,6 +1634,9 @@ const StockForm = ({ formType }) => { key: 'UOMName', align: 'center', width: 100, + render: (text, record, index) => ( + {record?.Size + ' ' + record?.UomName} + ), }, { title: 'Qty', @@ -1673,29 +1726,29 @@ const StockForm = ({ formType }) => { }, ...(selectedAdditionalColumn.includes('Mrp') ? [ - { - title: 'MRP', - dataIndex: 'MRP', - key: 'MRP', - editable: true, - width: 100, - align: 'center', - render: (_, record) => { - return ( - edit(record)} - placeholder="MRP" - value={record?.MRP ?? ''} - maxLength={10} - inputMode="decimal" - onChange={(e) => handleMRPChange(e, record)} - onBlur={(e) => handleMRPBlur(e, record)} - onPressEnter={(e) => handleKeyPress(e, record)} - /> - ); - }, + { + title: 'MRP', + dataIndex: 'MRP', + key: 'MRP', + editable: true, + width: 100, + align: 'center', + render: (_, record) => { + return ( + edit(record)} + placeholder="MRP" + value={record?.MRP ?? ''} + maxLength={10} + inputMode="decimal" + onChange={(e) => handleMRPChange(e, record)} + onBlur={(e) => handleMRPBlur(e, record)} + onPressEnter={(e) => handleKeyPress(e, record)} + /> + ); }, - ] + }, + ] : []), { title: ( @@ -1727,399 +1780,399 @@ const StockForm = ({ formType }) => { ...(selectedAdditionalColumn.includes('Amount Per Piece') ? [ - { - title: 'Amount per piece', - dataIndex: 'OnePcsPrice', - key: 'OnePcsPrice', - width: 125, - editable: true, - render: (_, record, index) => { - return ( - edit(record)} - onFocus={(e) => e.stopPropagation()} - disabled={record?.OnePcsAvailable === 'N'} - placeholder="OnePcsPrice" - value={record?.OnePcsPrice ?? ''} - maxLength={10} - inputMode="decimal" - onChange={(e) => handleOnePcsChange(e, record)} - onBlur={(e) => handleOnePcsBlur(e, record)} - onPressEnter={() => handleKeyPress(e, record)} - onInput={(e) => { - let v = e.target.value.replace(/[^0-9.]/g, ''); - if (v.startsWith('.')) v = '0' + v; - const parts = v.split('.'); - e.target.value = - parts.length > 2 - ? `${parts[0]}.${parts.slice(1).join('')}` - : v; - }} - /> - ); - }, + { + title: 'Amount per piece', + dataIndex: 'OnePcsPrice', + key: 'OnePcsPrice', + width: 125, + editable: true, + render: (_, record, index) => { + return ( + edit(record)} + onFocus={(e) => e.stopPropagation()} + disabled={record?.OnePcsAvailable === 'N'} + placeholder="OnePcsPrice" + value={record?.OnePcsPrice ?? ''} + maxLength={10} + inputMode="decimal" + onChange={(e) => handleOnePcsChange(e, record)} + onBlur={(e) => handleOnePcsBlur(e, record)} + onPressEnter={() => handleKeyPress(e, record)} + onInput={(e) => { + let v = e.target.value.replace(/[^0-9.]/g, ''); + if (v.startsWith('.')) v = '0' + v; + const parts = v.split('.'); + e.target.value = + parts.length > 2 + ? `${parts[0]}.${parts.slice(1).join('')}` + : v; + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Amount Per Piece') ? [ - { - title: 'Number of piece', - dataIndex: 'NoOfPcs', - key: 'NoOfPcs', - width: 125, - editable: true, - render: (_, record, index) => { - return ( - edit(record)} - onFocus={(e) => e.stopPropagation()} - disabled={record?.OnePcsAvailable === 'N'} - placeholder="NoOfPcs" - value={record.NoOfPcs ?? ''} - maxLength={5} - inputMode="numeric" - onChange={(e) => handleNoOfPcsChange(e, record)} - onBlur={(e) => handleNoOfPcsBlur(e, record)} - onPressEnter={() => handleKeyPress(e, record)} - onInput={(e) => { - // remove invalid characters & leading zeros - let val = e.target.value.replace(/[^0-9]/g, ''); - val = val.replace(/^0+(?=\d)/, ''); // removes leading zeros but keeps single 0 - e.target.value = val; - }} - /> - ); - }, + { + title: 'Number of piece', + dataIndex: 'NoOfPcs', + key: 'NoOfPcs', + width: 125, + editable: true, + render: (_, record, index) => { + return ( + edit(record)} + onFocus={(e) => e.stopPropagation()} + disabled={record?.OnePcsAvailable === 'N'} + placeholder="NoOfPcs" + value={record.NoOfPcs ?? ''} + maxLength={5} + inputMode="numeric" + onChange={(e) => handleNoOfPcsChange(e, record)} + onBlur={(e) => handleNoOfPcsBlur(e, record)} + onPressEnter={() => handleKeyPress(e, record)} + onInput={(e) => { + // remove invalid characters & leading zeros + let val = e.target.value.replace(/[^0-9]/g, ''); + val = val.replace(/^0+(?=\d)/, ''); // removes leading zeros but keeps single 0 + e.target.value = val; + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Wholesale Price') ? [ - { - title: 'Wholesale price', - dataIndex: 'WhSalePrice', - key: 'WhSalePrice', - width: 125, - editable: true, - render: (_, record) => { - return ( - edit(record)} - onFocus={(e) => e.stopPropagation()} - placeholder="WhSalePrice" - value={record.WhSalePrice ?? ''} - inputMode="decimal" - maxLength={10} - onChange={(e) => handleWhSalePriceChange(e, record)} - onBlur={(e) => handleWhSalePriceBlur(e, record)} - onPressEnter={() => handleKeyPress(record)} - onInput={(e) => { - let val = e.target.value.replace(/[^0-9.]/g, ''); // remove invalid chars - if (val.startsWith('.')) val = '0' + val; // leading dot fix - const parts = val.split('.'); - if (parts.length > 2) - val = `${parts[0]}.${parts.slice(1).join('')}`; // max one dot - val = val.replace(/^0+(?=\d)/, ''); // remove leading zeros - e.target.value = val; - }} - /> - ); - }, + { + title: 'Wholesale price', + dataIndex: 'WhSalePrice', + key: 'WhSalePrice', + width: 125, + editable: true, + render: (_, record) => { + return ( + edit(record)} + onFocus={(e) => e.stopPropagation()} + placeholder="WhSalePrice" + value={record.WhSalePrice ?? ''} + inputMode="decimal" + maxLength={10} + onChange={(e) => handleWhSalePriceChange(e, record)} + onBlur={(e) => handleWhSalePriceBlur(e, record)} + onPressEnter={() => handleKeyPress(record)} + onInput={(e) => { + let val = e.target.value.replace(/[^0-9.]/g, ''); // remove invalid chars + if (val.startsWith('.')) val = '0' + val; // leading dot fix + const parts = val.split('.'); + if (parts.length > 2) + val = `${parts[0]}.${parts.slice(1).join('')}`; // max one dot + val = val.replace(/^0+(?=\d)/, ''); // remove leading zeros + e.target.value = val; + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Manufacture Date') ? [ - { - title: 'Manuf.Date', - dataIndex: 'ManufDate', - key: 'ManufDate', - editable: true, - width: 100, - render: (text, record, index) => { - return ( - { - // Format date to your preferred format - const formattedDate = dateString - ? moment(dateString, ['DD-MM-YYYY']).format( - 'YYYY-MM-DDTHH:mm:ss' - ) - : undefined; + { + title: 'Manuf.Date', + dataIndex: 'ManufDate', + key: 'ManufDate', + editable: true, + width: 100, + render: (text, record, index) => { + return ( + { + // Format date to your preferred format + const formattedDate = dateString + ? moment(dateString, ['DD-MM-YYYY']).format( + 'YYYY-MM-DDTHH:mm:ss' + ) + : undefined; - // Update the row data immutably - const newData = PurchaseData.map((item) => - item.localId === record.localId - ? { ...item, ManufDate: formattedDate } - : item - ); - setPurchaseData(newData); - }} - /> - ); - }, + // Update the row data immutably + const newData = PurchaseData.map((item) => + item.localId === record.localId + ? { ...item, ManufDate: formattedDate } + : item + ); + setPurchaseData(newData); + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Expiry Date') ? [ - { - title: 'Exp.Date', - dataIndex: 'ExpDate', - key: 'ExpDate', - editable: true, - width: 100, - render: (text, record, index) => { - return ( - - handleExpDateChange(dateString, record) - } - /> - ); - }, + { + title: 'Exp.Date', + dataIndex: 'ExpDate', + key: 'ExpDate', + editable: true, + width: 100, + render: (text, record, index) => { + return ( + + handleExpDateChange(dateString, record) + } + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Hsn') ? [ - { - title: 'Hsn', - dataIndex: 'Hsn', - key: 'Hsn', - editable: true, - width: 100, - align: 'center', - render: (text, record, index) => { - return ( - edit(record)} - onFocus={(e) => e.stopPropagation()} - onPressEnter={() => handleKeyPress(record)} - onChange={(e) => { - const value = e.target.value; - setPurchaseData((prev) => - prev.map((item) => - item.localId === record.localId - ? { ...item, PurchaseHSNCode: value } - : item - ) - ); - }} - /> - ); - }, + { + title: 'Hsn', + dataIndex: 'Hsn', + key: 'Hsn', + editable: true, + width: 100, + align: 'center', + render: (text, record, index) => { + return ( + edit(record)} + onFocus={(e) => e.stopPropagation()} + onPressEnter={() => handleKeyPress(record)} + onChange={(e) => { + const value = e.target.value; + setPurchaseData((prev) => + prev.map((item) => + item.localId === record.localId + ? { ...item, PurchaseHSNCode: value } + : item + ) + ); + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Model No') ? [ - { - title: 'Model', - dataIndex: 'Model', - key: 'Model', - editable: true, - width: 100, - align: 'center', - render: (text, record, index) => { - return ( - edit(record)} - onFocus={(e) => e.stopPropagation()} - onPressEnter={() => handleKeyPress(record)} - onChange={(e) => { - const value = e.target.value; - setPurchaseData((prev) => - prev.map((item) => - item.localId === record.localId - ? { ...item, ModelNumber: value } - : item - ) - ); - }} - /> - ); - }, + { + title: 'Model', + dataIndex: 'Model', + key: 'Model', + editable: true, + width: 100, + align: 'center', + render: (text, record, index) => { + return ( + edit(record)} + onFocus={(e) => e.stopPropagation()} + onPressEnter={() => handleKeyPress(record)} + onChange={(e) => { + const value = e.target.value; + setPurchaseData((prev) => + prev.map((item) => + item.localId === record.localId + ? { ...item, ModelNumber: value } + : item + ) + ); + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Batch No') ? [ - { - title: 'Batch', - dataIndex: 'Batch', - key: 'Batch', - width: 100, - align: 'center', - editable: true, - render: (text, record, index) => { - return ( - edit(record)} - onFocus={(e) => e.stopPropagation()} - onPressEnter={() => handleKeyPress(record, index)} - onChange={(e) => { - const value = e.target.value; - setPurchaseData((prev) => - prev.map((item) => - item.localId === record.localId - ? { ...item, BatchRef: value } - : item - ) - ); - }} - /> - ); - }, + { + title: 'Batch', + dataIndex: 'Batch', + key: 'Batch', + width: 100, + align: 'center', + editable: true, + render: (text, record, index) => { + return ( + edit(record)} + onFocus={(e) => e.stopPropagation()} + onPressEnter={() => handleKeyPress(record, index)} + onChange={(e) => { + const value = e.target.value; + setPurchaseData((prev) => + prev.map((item) => + item.localId === record.localId + ? { ...item, BatchRef: value } + : item + ) + ); + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Rejected Qty') ? [ - { - title: 'Rejected Qty', - dataIndex: 'RejectedQty', - key: 'RejectedQty', - editable: true, - width: 100, - align: 'center', - render: (text, record, index) => { - return ( - edit(record)} - onFocus={(e) => e.stopPropagation()} - onPressEnter={() => handleKeyPress(record, index)} - onChange={(e) => { - let inputValue = e.target.value.replace(/[^0-9.]/g, ''); // allow only numbers - if (inputValue.startsWith('0') && inputValue.length > 1) { - inputValue = inputValue.replace(/^0+/, ''); // remove leading zeros - } + { + title: 'Rejected Qty', + dataIndex: 'RejectedQty', + key: 'RejectedQty', + editable: true, + width: 100, + align: 'center', + render: (text, record, index) => { + return ( + edit(record)} + onFocus={(e) => e.stopPropagation()} + onPressEnter={() => handleKeyPress(record, index)} + onChange={(e) => { + let inputValue = e.target.value.replace(/[^0-9.]/g, ''); // allow only numbers + if (inputValue.startsWith('0') && inputValue.length > 1) { + inputValue = inputValue.replace(/^0+/, ''); // remove leading zeros + } - const rejectedQty = parseFloat(inputValue) || 0; - const receivedQty = parseFloat(record.ReceivedQty) || 0; + const rejectedQty = parseFloat(inputValue) || 0; + const receivedQty = parseFloat(record.ReceivedQty) || 0; - // validation - if (rejectedQty >= receivedQty) { - setMessageType('error'); - setMessageData( - 'Rejected Qty cannot be greater than or equal to Received Qty' - ); - return; - } - - const acceptedQty = receivedQty - rejectedQty; - const price = parseFloat(record.InwardPrice) || 0; - const amount = acceptedQty * price; - - setPurchaseData((prev) => - prev.map((item) => - item.localId === record.localId - ? { - ...item, - RejectedQty: rejectedQty, - AcceptedQty: acceptedQty, - Amount: amount, - } - : item - ) + // validation + if (rejectedQty >= receivedQty) { + setMessageType('error'); + setMessageData( + 'Rejected Qty cannot be greater than or equal to Received Qty' ); - }} - /> - ); - }, + return; + } + + const acceptedQty = receivedQty - rejectedQty; + const price = parseFloat(record.InwardPrice) || 0; + const amount = acceptedQty * price; + + setPurchaseData((prev) => + prev.map((item) => + item.localId === record.localId + ? { + ...item, + RejectedQty: rejectedQty, + AcceptedQty: acceptedQty, + Amount: amount, + } + : item + ) + ); + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('Free Qty') ? [ - { - title: 'Free Qty', - dataIndex: 'Freeqty', - key: 'Freeqty', - editable: true, - width: 100, - align: 'center', - render: (text, record) => { - return ( - edit(record)} - onFocus={(e) => e.stopPropagation()} - onPressEnter={() => handleKeyPress(record)} - onChange={(e) => { - let value = e.target.value.replace(/[^0-9]/g, ''); // only digits - if (value.startsWith('0') && value.length > 1) { - value = value.replace(/^0+/, ''); // remove leading zeros - } + { + title: 'Free Qty', + dataIndex: 'Freeqty', + key: 'Freeqty', + editable: true, + width: 100, + align: 'center', + render: (text, record) => { + return ( + edit(record)} + onFocus={(e) => e.stopPropagation()} + onPressEnter={() => handleKeyPress(record)} + onChange={(e) => { + let value = e.target.value.replace(/[^0-9]/g, ''); // only digits + if (value.startsWith('0') && value.length > 1) { + value = value.replace(/^0+/, ''); // remove leading zeros + } - updateRowValue(record.localId, 'Freeqty', value); - }} - /> - ); - }, + updateRowValue(record.localId, 'Freeqty', value); + }} + /> + ); }, - ] + }, + ] : []), ...(selectedAdditionalColumn.includes('IMEI') ? [ - { - title: 'IMEI', - dataIndex: 'AdditionalInfo', - key: 'AdditionalInfo', - width: 120, - align: 'center', - render: (text, record, index) => { - const receivedQty = parseFloat(record?.ReceivedQty) || 0; - const isClickable = receivedQty > 0; + { + title: 'IMEI', + dataIndex: 'AdditionalInfo', + key: 'AdditionalInfo', + width: 120, + align: 'center', + render: (text, record, index) => { + const receivedQty = parseFloat(record?.ReceivedQty) || 0; + const isClickable = receivedQty > 0; - return ( - { - if (!isClickable) { - setMessageType('error'); - setMessageData('Please Enter Qty'); - return; - } - setSelectedRowIndex(index); - handleModelDataOpen(record); - }} - className="shape-preview" - /> - ); - }, + return ( + { + if (!isClickable) { + setMessageType('error'); + setMessageData('Please Enter Qty'); + return; + } + setSelectedRowIndex(index); + handleModelDataOpen(record); + }} + className="shape-preview" + /> + ); }, - ] + }, + ] : []), { title: 'Action', @@ -2144,7 +2197,7 @@ const StockForm = ({ formType }) => { }, ]; return baseColumns; - }, [editingKey, editingQty, selectedAdditionalColumn]); + }, [editingKey, editingQty, selectedAdditionalColumn, PurchaseData]); const statusFormatters = (record) => { const localId = record?.localId; @@ -2196,18 +2249,18 @@ const StockForm = ({ formType }) => { prev.map((item) => item.localId === localId ? { - ...item, - BalanceQty: qty, - ReceivedQty: qty, - AcceptedQty: qty, - RejectedQty: 0, - PurcDisc: 0, - Amount: - isNaN(item.InwardPrice) || isNaN(qty) - ? 0 - : item.InwardPrice * qty, - ProductIdentifierDtls: [], - } + ...item, + BalanceQty: qty, + ReceivedQty: qty, + AcceptedQty: qty, + RejectedQty: 0, + PurcDisc: 0, + Amount: + isNaN(item.InwardPrice) || isNaN(qty) + ? 0 + : item.InwardPrice * qty, + ProductIdentifierDtls: [], + } : item ) ); @@ -2244,10 +2297,10 @@ const StockForm = ({ formType }) => { prev.map((item) => item.localId === record.localId ? { - ...item, - MRP: value, - SellPrice: value, - } + ...item, + MRP: value, + SellPrice: value, + } : item ) ); @@ -2261,10 +2314,10 @@ const StockForm = ({ formType }) => { prev.map((item) => item.localId === record.localId ? { - ...item, - MRP: normalized, - SellPrice: normalized, - } + ...item, + MRP: normalized, + SellPrice: normalized, + } : item ) ); @@ -2674,7 +2727,7 @@ const StockForm = ({ formType }) => { // =============================== if (invalidRowNumbers.length > 0) { Modal.confirm({ - title: '⚠️ Incomplete Product Rows', + title: 'Incomplete Product Rows', width: 520, centered: true, content: ( @@ -2891,6 +2944,7 @@ const StockForm = ({ formType }) => { }; const handleInvoiceSelect = async (value) => { + if (value === selectedInvoice) return; const invoiceParts = value?.split('-'); @@ -2955,6 +3009,7 @@ const StockForm = ({ formType }) => { MRP: orderedProduct?.MRP, ProdName: orderedProduct?.ProdName, UomName: orderedProduct?.UomName, + Size: orderedProduct?.Size, SellPrice: orderedProduct?.SellPrice, StockAvailable: orderedProduct?.StockAvailable, OnePcsAvailable: orderedProduct?.OnePcsAvailable, @@ -3412,19 +3467,19 @@ const StockForm = ({ formType }) => { options={ SupplierData ? SupplierData.filter( - (obj, index, self) => - index === - self.findIndex( - (t) => t.SuppId === obj.SuppId - ) // remove dup SuppId - ).map((option) => ({ - key: `${option.SuppId}-${option.Type}`, // 👈 unique key - value: option.SuppId, - label: - option.Type === 'Branch' - ? `${option.SuppName} (${option.Type}) [${option.SuppId}]` - : `${option.SuppName} (${option.Type})`, - })) + (obj, index, self) => + index === + self.findIndex( + (t) => t.SuppId === obj.SuppId + ) // remove dup SuppId + ).map((option) => ({ + key: `${option.SuppId}-${option.Type}`, // 👈 unique key + value: option.SuppId, + label: + option.Type === 'Branch' + ? `${option.SuppName} (${option.Type}) [${option.SuppId}]` + : `${option.SuppName} (${option.Type})`, + })) : [] } label={ @@ -3656,88 +3711,88 @@ const StockForm = ({ formType }) => { item.ConfigId === SelectedPurchaseType && item.ConfigName === 'Cash' ) && ( - <> - - ({ - value: mode.ModeId, - label: mode.ModeName, - }))} - label={ - - } - className="field-DropDown" - onChangeFunction={handlePaymentModeChange} - valueData={selectedPaymentMode} - /> - - { - if ( - value === undefined || - value === null || - value === '' - ) { - return Promise.resolve(); - } - if (Number(value) === 0) { - return Promise.reject( - 'Payment Amount cannot be 0' - ); - } - if ( - isNaN(value) || - Number(value) < 0 - ) { - return Promise.reject( - 'Payment Amount cannot be less than 0' - ); - } - return Promise.resolve(); + <> + - - Payment Amount - - } - inputMode="decimal" - disable={!payAmountDisable} - isOnChange={paymentAmount ? true : false} - min={0} - type="number" - value={paymentAmount} - onChange={(e) => { - formRef?.current?.setFieldsValue({ - PaymentAmount: e?.target?.value, - }); - setPaymentAmount(e?.target?.value); - }} - /> - - - )} + ]} + > + ({ + value: mode.ModeId, + label: mode.ModeName, + }))} + label={ + + } + className="field-DropDown" + onChangeFunction={handlePaymentModeChange} + valueData={selectedPaymentMode} + /> + + { + if ( + value === undefined || + value === null || + value === '' + ) { + return Promise.resolve(); + } + if (Number(value) === 0) { + return Promise.reject( + 'Payment Amount cannot be 0' + ); + } + if ( + isNaN(value) || + Number(value) < 0 + ) { + return Promise.reject( + 'Payment Amount cannot be less than 0' + ); + } + return Promise.resolve(); + }, + }, + ]} + > + + Payment Amount + + } + inputMode="decimal" + disable={!payAmountDisable} + isOnChange={paymentAmount ? true : false} + min={0} + type="number" + value={paymentAmount} + onChange={(e) => { + formRef?.current?.setFieldsValue({ + PaymentAmount: e?.target?.value, + }); + setPaymentAmount(e?.target?.value); + }} + /> + + + )}
@@ -3771,7 +3826,7 @@ const StockForm = ({ formType }) => { (p) => p.ProdId === prodId && (p.ProdVariantName || 'Variant1') === - variantName + variantName ); const nameMatch = option.label ?.toLowerCase() @@ -3784,9 +3839,9 @@ const StockForm = ({ formType }) => { options={ !scanner ? productData?.map((option) => ({ - value: `${option.ProdId}_${option.ProdVariantName}`, - label: `${option.ProdName} (${option.Size} ${option.UomName})${option?.BrandName ? ` - ${option?.BrandName}` : ''} - ${option.ProdVariantName}`, - })) + value: `${option.ProdId}_${option.ProdVariantName}`, + label: `${option.ProdName} (${option.Size} ${option.UomName})${option?.BrandName ? ` - ${option?.BrandName}` : ''} - ${option.ProdVariantName}`, + })) : [] } // onSelect={async (value, option) => { @@ -4113,7 +4168,7 @@ const StockForm = ({ formType }) => { autoComplete="off" label="GST No" autocapitalize="on" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} />
@@ -4135,10 +4190,10 @@ const StockForm = ({ formType }) => { // isOnChange={formType == 'edit' ? true : false} inputMode="numeric" onInput={(e) => - (e.target.value = e.target.value?.replace( - /[^0-9]/g, - '' - )) + (e.target.value = e.target.value?.replace( + /[^0-9]/g, + '' + )) } /> @@ -4150,7 +4205,7 @@ const StockForm = ({ formType }) => { MailId} autocomplete="off" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> @@ -4177,7 +4232,7 @@ const StockForm = ({ formType }) => { Point of Contact} autocomplete="off" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> @@ -4199,7 +4254,7 @@ const StockForm = ({ formType }) => { label={} autocomplete="off" maxLength="10" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> @@ -4210,7 +4265,7 @@ const StockForm = ({ formType }) => { POC MailId} autocomplete="off" - // isOnChange={formType == 'edit' ? true : false} + // isOnChange={formType == 'edit' ? true : false} /> diff --git a/src/Pages/StockinHand/StockinHand.jsx b/src/Pages/StockinHand/StockinHand.jsx index 3726de8..8c6467d 100644 --- a/src/Pages/StockinHand/StockinHand.jsx +++ b/src/Pages/StockinHand/StockinHand.jsx @@ -502,7 +502,7 @@ const StockInhand = () => { Sl.No Name Variant - Qty + Balance Qty Batch Barcode IMEI 1 diff --git a/src/Styles/BookingScreen/Components/UtillComponents/BSNavBarComponents.scss b/src/Styles/BookingScreen/Components/UtillComponents/BSNavBarComponents.scss index 7b04919..8068cc8 100644 --- a/src/Styles/BookingScreen/Components/UtillComponents/BSNavBarComponents.scss +++ b/src/Styles/BookingScreen/Components/UtillComponents/BSNavBarComponents.scss @@ -159,6 +159,7 @@ color: var(--SELECTED_COLOR); cursor: pointer; } + .BSBillingNav-icon-table-inner { height: 35px; width: 23px; @@ -295,7 +296,7 @@ font-size: 25px; } -.BSC1Payment-Tablediv .ant-table-wrapper .ant-table-thead > tr > th { +.BSC1Payment-Tablediv .ant-table-wrapper .ant-table-thead>tr>th { color: rgb(255, 255, 255) !important; font-weight: 600 !important; font-size: 14px; @@ -378,6 +379,8 @@ padding: 4px; border-radius: 4px; cursor: pointer; + font-family: 'Poppins', sans-serif; + font-size: 12px; } .EstPopupContent { @@ -400,8 +403,10 @@ .barcode-container { width: 90vw; display: flex; - justify-content: center; /* Center horizontally */ - align-items: center; /* Center vertically */ + justify-content: center; + /* Center horizontally */ + align-items: center; + /* Center vertically */ padding: 12px; height: 200px; background-color: #f9f9f9; @@ -411,14 +416,18 @@ cursor: pointer; transition: background-color 0.3s ease; } + .barcode-icon1 { // width: 90vw; - font-size: 100px; /* size of the icon */ - color: #52c41a; /* blue color */ + font-size: 100px; + /* size of the icon */ + color: #52c41a; + /* blue color */ transition: transform 0.2s ease, color 0.2s ease; } + //// .search-container-code { display: flex; @@ -480,4 +489,4 @@ right: 4px !important; top: 35% !important; } -} +} \ No newline at end of file From d1381c3c9bace5240b8dbebbc5242058ca34a9e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 26 Feb 2026 14:07:50 +0530 Subject: [PATCH 2/2] product receipt field setting --- .../StockMaster/SettingsIconWithModal.jsx | 6 +- src/Pages/StockMaster/StockForm.jsx | 83 ++++++++++--------- 2 files changed, 47 insertions(+), 42 deletions(-) diff --git a/src/Pages/StockMaster/SettingsIconWithModal.jsx b/src/Pages/StockMaster/SettingsIconWithModal.jsx index 2b673c9..70368ce 100644 --- a/src/Pages/StockMaster/SettingsIconWithModal.jsx +++ b/src/Pages/StockMaster/SettingsIconWithModal.jsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Tooltip } from '@mui/material'; +import { Tooltip } from 'antd'; import { IoSettingsOutline } from 'react-icons/io5'; import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx'; @@ -45,9 +45,9 @@ const SettingsIconWithModal = ({ return ( <> {/* ⚙️ ICON ONLY */} - + diff --git a/src/Pages/StockMaster/StockForm.jsx b/src/Pages/StockMaster/StockForm.jsx index 005b835..cdecef7 100644 --- a/src/Pages/StockMaster/StockForm.jsx +++ b/src/Pages/StockMaster/StockForm.jsx @@ -1571,6 +1571,41 @@ const StockForm = ({ formType }) => { setNameSortOrder(newOrder); }; + const handleFieldSetupSubmit = async ({ + selectedFields, + tempSelectedColumns, + closeModal, + resetTemp, + }) => { + const postData = { + AppId, + CompId, + BranchId, + Type: 'PE', + FormType: 'Purchase Entry', + TypeId: categoryId, + ConfigDtl: selectedFields.map((field) => ({ + ConfigId: field, + Access: 'Y', + })), + CreatedBy: UserId, + }; + + const response = await dispatch(postFieldSetup(postData))?.unwrap(); + + if (response?.data?.statusCode === 1) { + setSelectedAdditionalColumn([...tempSelectedColumns]); + closeModal(); + resetTemp(); + setMessageType('success'); + setMessageData(response?.data?.response); + await getFieldSetup(); + } else { + setMessageType('error'); + setMessageData('Failed to set up fields'); + } + }; + const columns = useMemo(() => { const baseColumns = [ { @@ -2175,7 +2210,14 @@ const StockForm = ({ formType }) => { ] : []), { - title: 'Action', + title: (
+
Action
+ +
), dataIndex: 'Action', key: 'Action', align: 'center', @@ -3220,40 +3262,7 @@ const StockForm = ({ formType }) => { ); setPurchaseData(newData); }; - const handleFieldSetupSubmit = async ({ - selectedFields, - tempSelectedColumns, - closeModal, - resetTemp, - }) => { - const postData = { - AppId, - CompId, - BranchId, - Type: 'PE', - FormType: 'Purchase Entry', - TypeId: categoryId, - ConfigDtl: selectedFields.map((field) => ({ - ConfigId: field, - Access: 'Y', - })), - CreatedBy: UserId, - }; - const response = await dispatch(postFieldSetup(postData))?.unwrap(); - - if (response?.data?.statusCode === 1) { - setSelectedAdditionalColumn([...tempSelectedColumns]); - closeModal(); - resetTemp(); - setMessageType('success'); - setMessageData(response?.data?.response); - await getFieldSetup(); - } else { - setMessageType('error'); - setMessageData('Failed to set up fields'); - } - }; const handleModalSubmited = () => { setIsModalOpen(false); }; @@ -3958,11 +3967,7 @@ const StockForm = ({ formType }) => { )}
- +