import React from 'react';
import { useDispatch, useSelector } from 'react-redux';
import QrImg from '../../../../Images/qrcode.jpg';
import {
extractLastNumber,
extractLastNumberOrderId,
} from '../../../../Services/Others';
import {
GlobalprintSlNo,
GlobalprintItem,
GlobalprintMRP,
GlobalprintDiscount,
GlobalprintQuantity,
GlobalprintRate,
GlobalprintAmount,
GlobalprintHsnCode,
GlobalprintQrcodet,
GlobalPritdummyData,
GloabalFieldDetails,
changeReprintDataFound,
GlobalprintSignature,
GlobalprinttermsAndConditions,
GlobalSignatureImage,
Globalnotes,
GlobalthemeFormat,
GlobalBillName,
GlobalprintCashierName,
GlobalprintLogo,
GlobalprintCredit,
GlobalprintTax,
GlobalSelectedPrintHeaderColor,
} from '../../../../Features/ThemeChange/ThemeChange';
import {
GlobalUpiIDprint,
PreferenceData,
} from '../../../../Features/BookingScreen/BookingData/BookingData';
import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle5.scss';
import QRCode from 'react-qr-code';
import signature from '../../../../Images/signatureimage.jpg';
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin';
import { isMobile } from 'react-device-detect';
import { settingDataSelector } from '../../../../Features/PreferenceMaster/PreferenceMaster';
import Logo from '../../../../Images/Logo.jpg';
const PrintStyle5 = ({
index,
ExtraChargeTotal,
totalQuantityFilter,
Date1,
CashierName,
totalQuantity,
OrderDetailGST,
OrderDetailIGST,
OrderDetailVAT,
table2Data,
PaymentStatus,
PrintGreeting,
printDatas,
base64Image,
PrintLogo,
isPdf,
sportsAppPreference,
SalesModePref,
MembershipApplied = null,
}) => {
console.log(table2Data, 'table2Data');
const dispatch = useDispatch();
const GlobalUpiID = useSelector(GlobalUpiIDprint);
const FieldDetails = useSelector(GloabalFieldDetails);
const SLNO = FieldDetails?.['Sl.No'];
const Item = FieldDetails?.['Item'];
const MRP = FieldDetails?.['MRP'];
const Discount = FieldDetails?.['Discount'];
const Tax = FieldDetails?.['Tax'];
const Quantity = FieldDetails?.['Quantity'];
const Rate = FieldDetails?.['Rate'];
const Amount = FieldDetails?.['Amount'];
const HsnCode = FieldDetails?.['HsnCode'];
const Qrcodet = FieldDetails?.['Qrcode'];
const CashierNameField = FieldDetails?.['CashierName'];
const LogoField = FieldDetails?.['Logo'];
const CreditDetails = FieldDetails?.['Credit details'];
const WeightasKg = FieldDetails?.['Weight'];
const GlobalSlNo = useSelector(GlobalprintSlNo);
const GlobalItem = useSelector(GlobalprintItem);
const GlobalMRP = useSelector(GlobalprintMRP);
const GlobalDiscount = useSelector(GlobalprintDiscount);
const GlobalTax = useSelector(GlobalprintTax);
const GlobalQuantity = useSelector(GlobalprintQuantity);
const GlobalRate = useSelector(GlobalprintRate);
const GlobalAmount = useSelector(GlobalprintAmount);
const GlobalHsnCode = useSelector(GlobalprintHsnCode);
const GlobalQrcodet = useSelector(GlobalprintQrcodet);
const GlobaldummyData = useSelector(GlobalPritdummyData);
const GlobalSignature = useSelector(GlobalprintSignature);
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
const GlobalIsnotes = useSelector(Globalnotes);
const GlobalthemeFormatr = useSelector(GlobalthemeFormat);
const GlobalBilltext = useSelector(GlobalBillName);
const appPreferences = useSelector(ApplicationPreferences);
const SettingData = useSelector(PreferenceData);
const GlobalCashierName = useSelector(GlobalprintCashierName);
const GlobalLogo = useSelector(GlobalprintLogo);
const GlobalCredit = useSelector(GlobalprintCredit);
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
(i) => i.SettingIdName === 'PrintUom'
)?.[0];
const estimatePrintHeader =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimateprintheader'
)?.SettingValue === 'Y';
const estimateTitle =
SettingData?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
)?.SettingValue === 'Y';
const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails;
const dinePreference = bookingTypePreference?.find(
(type) =>
type?.PreferredSubCatName?.toLowerCase() === 'dine in' &&
type?.PreferredStatus === 'Y'
);
const takeAwayPreference = bookingTypePreference?.find(
(type) =>
type?.PreferredSubCatName?.toLowerCase() === 'take away' &&
type?.PreferredStatus === 'Y'
);
const paymentTypeUPI = PaymentStatus?.find(
(ps) => ps.PaymentTypeName === 'UPI'
);
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
console.log(GlobalDiscount, Discount, 'Discount');
let TermsAndConditions = printDatas?.TermsandConditions;
let SignatureImg = printDatas?.Signature;
let Notestext = printDatas?.Notes;
let BillName = printDatas?.PrintHdrName;
let FormatTheme = printDatas?.PrintType == 'S' ? true : false;
let PageSize = printDatas?.PageSize;
const Signature = FieldDetails?.['signature'];
const TermsnAdCondition = FieldDetails?.['terms&conditions'];
let PaymentStatusSuccess = PaymentStatus?.filter(
(ps) => ps.PaymentStatus === 'S'
);
const isEditedBill = PaymentStatus?.some(payment => {
const type = payment?.AdjustmentType?.toLowerCase();
return (
(type === 'extra' || type === 'refund') &&
payment?.BeforeAdjustment != null &&
payment?.AfterAdjustment != null
);
});
const lastTransaction = PaymentStatus?.find(
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
)
const keysLength = Object.keys(table2Data ?? {}).length;
if (keysLength > 0) {
dispatch(changeReprintDataFound(true));
}
const currentDate = new Date();
const day = currentDate.getDate().toString().padStart(2, '0');
const monthNames = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec',
];
const monthIndex = currentDate.getMonth();
const year = currentDate.getFullYear().toString().slice(-2);
const formattedDate = `${day}-${monthNames[monthIndex]}-${year}`;
const TakeawayData = table2Data?.productDetails?.filter(
(item) => item.BookingTypeName?.toLowerCase() === 'takeaway'
);
const DineInData = table2Data?.productDetails?.filter(
(item) => item.BookingTypeName?.toLowerCase() === 'dine in'
);
const TakeawayTotal = TakeawayData?.reduce(
(accumulator, currentValue) => accumulator + currentValue.TotalAmt,
0
);
const DineInTotal = DineInData?.reduce(
(accumulator, currentValue) => accumulator + currentValue.TotalAmt,
0
);
const PackageDetails = table2Data?.PackageDtl;
const aggregatedPayments = PaymentStatusSuccess?.reduce(
(acc, paymentdata) => {
const paymentType = paymentdata?.PaymentTypeName;
const amount = Number(paymentdata?.Amount);
if (acc[paymentType]) {
acc[paymentType] += amount;
} else {
acc[paymentType] = amount;
}
return acc;
},
{}
);
const productsData = table2Data?.productDetails || [];
const offers = table2Data?.OrderOfferDetails || [];
let TotalOfferAmount = 0;
// Calculate SalesWiseOffers total amount
offers.forEach((offer) => {
if (offer.TableName === 'SalesWiseOffers') {
TotalOfferAmount += offer.OfferAmount;
}
});
const hasMappedOffer = offers.some((offer) =>
['ItemWiseOffers', 'BundleOffers', 'QuantityWiseOffers'].includes(
offer.TableName
)
);
if (hasMappedOffer) {
const productTotal = productsData?.reduce(
(acc, item) =>
acc + (item?.Type != 'C' ? item.OfferAmt : item.OfferValue || 0),
0
);
TotalOfferAmount += productTotal;
} else {
const Combothere = productsData?.filter((item) => item?.Type == 'C');
const CombothereTotal = Combothere?.reduce(
(acc, item) => acc + (item.OfferValue || 0),
0
);
TotalOfferAmount += CombothereTotal;
}
const products = [
{
ProdName: 'ITEM 1',
Rate: 88.0,
SalesQty: 2,
MRP: 100,
TotalAmt: 176,
discount: 0,
HSN: '01',
Size: 250,
UomName: 'g',
ProdTaxPercentage: 5,
},
{
ProdName: 'ITEM 2',
Rate: 300.0,
SalesQty: 1,
MRP: 350,
TotalAmt: 300,
discount: 0,
HSN: '02',
Size: 250,
UomName: 'g',
ProdTaxPercentage: 5,
},
{
ProdName: 'ITEM 3',
Rate: 200.0,
SalesQty: 1,
MRP: 250,
TotalAmt: 200,
discount: 0,
HSN: '03',
Size: 250,
UomName: 'g',
ProdTaxPercentage: 0,
},
{
ProdName: 'ITEM 4',
Rate: 30.0,
SalesQty: 1,
MRP: 50,
TotalAmt: 30,
discount: 0,
HSN: '04',
Size: 250,
UomName: 'g',
ProdTaxPercentage: 18,
},
];
const chunkSize = PageSize == 'A5' ? 5 : 9;
let dataSource = [];
if (GlobaldummyData || TakeawayData?.length > 0) {
dataSource = GlobaldummyData ? products : TakeawayData;
} else if (DineInData?.length > 0) {
dataSource = DineInData;
}
// Paginate the data
const paginatedChunks = [];
for (let i = 0; i < dataSource.length; i += chunkSize) {
paginatedChunks.push(dataSource.slice(i, i + chunkSize));
}
const lastChunkRows =
paginatedChunks.length > 0
? paginatedChunks[paginatedChunks.length - 1].length
: 0;
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 2 : 7);
return (
<>
{FormatTheme ? (
{paginatedChunks.map((dataChunk, chunkIndex) => (
0 ? ' print-page-break' : ''}`
}
style={{
display: 'flex',
flexDirection: 'column',
justifyContent:
chunkIndex === paginatedChunks.length - 1 &&
!shouldFooterBeOnNewPage &&
FormatTheme
? 'space-between'
: '',
height: isMobile
? '295mm'
: FormatTheme
? PageSize == 'A5'
? '170mm'
: '257mm'
: '',
}}
key={chunkIndex}
>
{/*
*/}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData && GlobalLogo ? (

) : null}
{base64Image &&
(PrintLogo?.SettingValue === 'Y' || LogoField) ? (

) : null}
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
Low Prices... Love the Saving...
{GlobaldummyData
? 'BranchAddress, Town- 635XXX City - State'
: (table2Data?.AddressDetails?.[0]?.Address1 || '') +
(table2Data?.AddressDetails?.[0]?.City
? (table2Data?.AddressDetails?.[0]?.Address1 &&
table2Data?.AddressDetails?.[0]?.City
? '-'
: '') + table2Data?.AddressDetails?.[0]?.City
: '') +
(table2Data?.AddressDetails?.[0]?.Zip
? (table2Data?.AddressDetails?.[0]?.City &&
table2Data?.AddressDetails?.[0]?.Zip
? '-'
: '') + table2Data?.AddressDetails?.[0]?.Zip
: '')}
{' '}
Mobile :
{GlobaldummyData
? '1234567890'
: table2Data?.BrMobile}{' '}
{table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
{table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? 'Cash'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: ''}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
{' '}
{GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' &&
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
}
{' '}
{' '}
Bill No :
{GlobaldummyData
? '553'
: table2Data?.OrderId &&
extractLastNumberOrderId(
table2Data?.OrderId,
table2Data?.FYStatus
)}{' '}
{' '}
{(TakeawayData?.length > 0 || GlobaldummyData) && (
<>
{takeAwayPreference && (
{' '}
TakeAway
)}
{GlobaldummyData
? GlobalSlNo && (
S.No
)
: SLNO && (
S.No
)}
{GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && (
{' '}
{GlobaldummyData
? GlobalItem && 'ITEM /DES /'
: 'ITEM /DES /'}{' '}
{GlobaldummyData
? GlobalQuantity && 'QTY'
: 'QTY'}{' '}
)
) : (
{' '}
{GlobaldummyData
? GlobalItem && 'ITEM /DES /'
: Item && 'ITEM /DES /'}{' '}
{GlobaldummyData
? GlobalQuantity && 'QTY'
: Quantity && WeightasKg ? 'QTY/Kg' : 'QTY'}{' '}
)}
{GlobaldummyData
? GlobalHsnCode && (
HSN
)
: HsnCode && (
HSN
)}
{GlobaldummyData
? GlobalMRP && (
MRP
)
: MRP && (
MRP
)}
{GlobaldummyData
? GlobalRate && (
RATE
)
: Rate && (
RATE
)}
{GlobaldummyData
? GlobalDiscount && (
DIS{' '}
)
: Discount && (
DIS{' '}
)}
{GlobaldummyData
? GlobalTax && (
TAX %{' '}
)
: Tax &&
table2Data?.OrderType !== 'E' && (
TAX %{' '}
)}
{GlobaldummyData
? GlobalAmount && (
{' '}
Amt{' '}
)
: Amount && (
{' '}
AMT{' '}
)}
{dataChunk?.map((item, index) => (
{GlobaldummyData
? GlobalSlNo && (
{index + 1}
)
: SLNO && (
{chunkIndex * chunkSize + index + 1}
)}
{GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && (
{GlobaldummyData ? (
GlobalItem && (
<>
{item?.ProdName}
{item?.Size + item?.UomName}
>
)
) : (
<>
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' &&
{item?.Size +
item?.UomName +
'-' +
(GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty)}
}
>
)}
)
) : (
{GlobaldummyData ? (
GlobalItem && (
<>
{item?.ProdName}
{item?.Size + item?.UomName}
>
)
) : (
<>
{(() => {
const identifiers = item?.ProductIdentifierDtls ?? [];
const packageList = (PackageDetails ?? []).filter(
pkg => pkg.ProdId === item.ProdId
);
return (
<>
{/* ๐ท Product Name */}
{item?.ProdName}
{packageList.length > 0 ? (
// ================= PACKAGE EXISTS =================
{/* ๐ฆ Package Details */}
{packageList.map((pkg, index) => (
{pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
))}
{/* ๐ข Identifiers (Serial / IMEI) */}
{identifiers.map((d, i) => {
const serial = d.SerialNumber;
const imei = [d.IMEI1, d.IMEI2].filter(Boolean).join(", ");
if (!serial && !imei) return null;
return (
{serial &&
{serial}
}
{imei &&
{imei}
}
);
})}
{/* ๐ Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}
)}
{/* ๐ข Quantity */}
{GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty}
) : (
// ================= NO PACKAGE =================
{/* ๐ Size + UOM */}
{UomPrint?.SettingValue === 'Y' && (
<>
{(item?.Size || "1")}{" "}
{item?.SinglePc === "Y"
? "PCS"
: item?.Type !== "C"
? item?.UomName
: "COMBO"}
>
)}
{/* ๐ท Brand */}
{item?.BrandName && (
{item.BrandName}
)}
{/* ๐ข Identifiers (Serial / IMEI) */}
{identifiers.map((d, i) => {
const serial = d.SerialNumber;
const imei = [d.IMEI1, d.IMEI2].filter(Boolean).join(", ");
if (!serial && !imei) return null;
return (
{serial &&
{serial}
}
{imei &&
{imei}
}
);
})}
{/* ๐ Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}
)}
{/* ๐ข Quantity */}
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty}
)}
>
);
})()}
>
)}
)}
{GlobaldummyData
? GlobalHsnCode && (
{item?.HSN}
)
: HsnCode && (
{item?.HSN}
)}
{GlobaldummyData
? GlobalMRP && (
{item?.MRP}
)
: MRP && (
{item?.SinglePc === 'Y'
? item?.Rate
: item?.MRP}
)}
{GlobaldummyData
? GlobalRate && (
{item?.Rate}
)
: Rate && (
{item?.Rate}
)}
{GlobaldummyData
? GlobalDiscount && (
{item?.discount}
)
: Discount && (
{item?.Type != 'C'
? item?.OfferAmt || 0
: item?.OfferValue || 0}
)}
{GlobaldummyData
? GlobalTax && (
{item?.ProdTaxPercentage}
)
: Tax &&
table2Data?.OrderType !== 'E' && (
{item?.ProdTaxPercentage || 0}
)}
{GlobaldummyData
? GlobalAmount && (
{item?.TotalAmt}
)
: Amount && (
{' '}
{item?.Type != 'C'
? item?.TotalAmt - item?.OfferAmt || 0
: item?.TotalAmt - item?.OfferValue || 0}
)}
))}
>
)}
{DineInData?.length > 0 && dinePreference && (
<>
{' '}
DineIn
{GlobaldummyData
? GlobalSlNo && (
S.No
)
: SLNO && (
S.No
)}
{GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && (
{' '}
{GlobaldummyData
? GlobalItem && 'ITEM /DES /'
: 'ITEM /DES /'}{' '}
{GlobaldummyData
? GlobalQuantity && 'QTY'
: 'QTY'}{' '}
)
) : (
{' '}
{GlobaldummyData
? GlobalItem && 'ITEM /DES /'
: Item && 'ITEM /DES /'}{' '}
{GlobaldummyData
? GlobalQuantity && 'QTY'
: Quantity && WeightasKg ? 'Qty/Kg' : 'Qty'}{' '}
)}
{GlobaldummyData
? GlobalHsnCode && (
HSN
)
: HsnCode && (
HSN
)}
{GlobaldummyData
? GlobalMRP && (
MRP
)
: MRP && (
MRP
)}
{GlobaldummyData
? GlobalRate && (
RATE
)
: Rate && (
RATE
)}
{GlobaldummyData
? GlobalDiscount && (
DIS{' '}
)
: Discount && (
DIS{' '}
)}
{GlobaldummyData
? GlobalTax && (
TAX %{' '}
)
: Tax &&
table2Data?.OrderType !== 'E' && (
TAX %{' '}
)}
{GlobaldummyData
? GlobalAmount && (
{' '}
Amt{' '}
)
: Amount && (
{' '}
AMT{' '}
)}
{dataChunk?.map((item, index) => (
{GlobaldummyData
? GlobalSlNo && (
{index + 1}
)
: SLNO && (
{chunkIndex * chunkSize + index + 1}
)}
{GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && (
{GlobaldummyData ? (
GlobalItem && (
<>
{item?.ProdName}
{item?.Size + item?.UomName}
>
)
) : (
<>
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' &&
{item?.Size +
item?.UomName +
'-' +
(GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty)}
}
>
)}
)
) : (
{GlobaldummyData ? (
GlobalItem && (
<>
{item?.ProdName}
{item?.Size + item?.UomName}
>
)
) : (
<>
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' &&
{(item?.Size ? item?.Size : '1') +
(item?.SinglePc == 'Y'
? 'PCS'
: item?.Type != 'C'
? item?.UomName
: 'COMBO') +
'-' +
(GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty)}
}
>
)}
)}
{GlobaldummyData
? GlobalHsnCode && (
{item?.HSN}
)
: HsnCode && (
{item?.HSN}
)}
{GlobaldummyData
? GlobalMRP && (
{item?.MRP}
)
: MRP && (
{item?.SinglePc === 'Y'
? item?.Rate
: item?.MRP}
)}
{GlobaldummyData
? GlobalRate && (
{item?.Rate}
)
: Rate && (
{item?.Rate}
)}
{GlobaldummyData
? GlobalDiscount && (
{item?.discount}
)
: Discount && (
{item?.Type != 'C'
? item?.OfferAmt || 0
: item?.OfferValue || 0}
)}
{GlobaldummyData
? GlobalTax && (
{item?.ProdTaxPercentage}
)
: Tax &&
table2Data?.OrderType !== 'E' && (
{item?.ProdTaxPercentage || 0}
)}
{GlobaldummyData
? GlobalAmount && (
{item?.TotalAmt}
)
: Amount && (
{' '}
{item?.Type != 'C'
? item?.TotalAmt - item?.OfferAmt || 0
: item?.TotalAmt - item?.OfferValue || 0}
)}
))}
>
)}
{chunkIndex === paginatedChunks.length - 1 &&
!shouldFooterBeOnNewPage &&
FormatTheme && (
<>
{table2Data?.OrderType === 'E' ? (
''
) : (
{((OrderDetailGST?.length > 0 &&
OrderDetailGST?.[0]?.TaxAmt > 0) ||
(OrderDetailIGST?.length > 0 &&
OrderDetailIGST?.[0]?.TaxAmt > 0) ||
(OrderDetailVAT?.length > 0 &&
OrderDetailVAT?.[0]?.TaxAmt > 0)) &&
table2Data?.NetAmount !== 0 && (
<>
--------- GST Breakup Details -----------
{OrderDetailGST?.length > 0 &&
OrderDetailGST?.[0]?.TaxAmt > 0 && (
|
Taxable Amount
|
CGST
|
SGST
|
Total Amount
|
{OrderDetailGST?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(
item.WithOutTaxAmount
).toFixed(2)}
|
{Number(item.CGST).toFixed(2)}
|
{Number(item.SGST).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
)}
{OrderDetailIGST?.length > 0 &&
OrderDetailIGST?.[0]?.TaxAmt > 0 && (
<>
|
Taxable Amount
|
IGST
|
Total Amount
|
{OrderDetailIGST?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(
item.WithOutTaxAmount
).toFixed(2)}
|
{Number(item.TaxAmt).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
>
)}
{OrderDetailVAT?.length > 0 &&
OrderDetailVAT?.[0]?.TaxAmt > 0 && (
<>
|
Taxable Amount
|
VAT
|
Total Amount
|
{OrderDetailVAT?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(
item.WithOutTaxAmount
).toFixed(2)}
|
{Number(item.TaxAmt).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
>
)}
>
)}
)}
{' '}
Items :
{' '}
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
{' '}
{' '}
Qty :
{' '}
{GlobaldummyData ? '9' : totalQuantity}
{' '}
{/* {ExtraChargeTotal>0 &&
Extra Charges :
{ExtraChargeTotal}
} */}
{(table2Data?.OverallDisc > 0 ||
TotalOfferAmount > 0) && (
{' '}
Off :
{' '}
{GlobaldummyData
? '100'
: Number(
TotalOfferAmount + table2Data?.OverallDisc
).toFixed(2)}
{' '}
)}
{' '}
Amount
:
{' '}
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
{' '}
{/*
*/}
{DineInData?.length > 0 && TakeawayData?.length > 0 && (
<>
{takeAwayPreference && (
Takeaway:
{Number(TakeawayTotal).toFixed(2)}
)}
{dinePreference && (
Dine In:
{Number(DineInTotal).toFixed(2)}{' '}
)}
>
)}
{/*
CARD : *********12
CARD HOLDER : CARD HOLDER NAME
*/}
{PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: 'Split'}{' '}
Payment :
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
/-{' '}
{isEditedBill && lastTransaction && (
Bill Gross Amount
{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}
{'Adjustment Amount'}
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
Net Bill Amount
{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}
)}
{GlobaldummyData
? GlobalCredit && (
Advance Amount:
Opening Balance:
)
: CreditDetails &&
table2Data?.CustomerDetails?.length > 0 && (
{/* OLD CREDIT BAL */}
{PaymentStatusSuccess?.[0]?.PaymentTypeName ===
'Credit' && (
<>
{table2Data.CustomerDetails[0]
.OldCreditBal > 0 ? (
Advance Amount:
{
table2Data.CustomerDetails[0]
.OldCreditBal
}
) : table2Data.CustomerDetails[0]
.OldCreditBal < 0 ? (
{' '}
Opening Balance:{' '}
{Math.abs(
table2Data.CustomerDetails[0]
.OldCreditBal
)}
) : null}
>
)}
{/* CURRENT CREDIT BAL */}
{table2Data.CustomerDetails[0]
.CurrentCreditBal > 0 ? (
{' '}
Current Advance Amount:{' '}
{
table2Data.CustomerDetails[0]
.CurrentCreditBal
}
) : table2Data.CustomerDetails[0]
.CurrentCreditBal < 0 ? (
{' '}
Current Balance Amount:{' '}
{Math.abs(
table2Data.CustomerDetails[0]
.CurrentCreditBal
)}
) : null}
)}
{/*
TOTAL SAVING : 10.00
*/}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobalQrcodet && (
{' '}

{' '}
Scan to Pay
{' '}
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(
2
)}
)
: Qrcodet &&
paymentTypeUPI && (
Scan to Pay
โน
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(
2
)}
)}
)}
YOUR ORDER NO:{' '}
{table2Data?.SalesId &&
extractLastNumber(table2Data?.SalesId)}
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
<>
{/*
Split Payment:
*/}
{Object.keys(aggregatedPayments).map(
(paymentType) => (
{paymentType}:{' '}
{aggregatedPayments[paymentType].toFixed(2)}
)
)}
>
)}
{GlobaldummyData && GlobalCashierName && (
{' '}
Cashier : Cashier Name
)}
{CashierName &&
CashierName !== undefined &&
CashierName !== null &&
!GlobaldummyData &&
CashierNameField && (
Cashier : {CashierName}
)}
{GlobaldummyData && (
{' '}
Customer : Customer Name
)}
{table2Data?.CustSuppName &&
table2Data?.CustSuppName !== undefined &&
table2Data?.CustSuppName !== null &&
!GlobaldummyData && (
Customer : {table2Data?.CustSuppName}
)}
{table2Data?.BookingTypeName == 'Dine In' &&
dinePreference &&
table2Data?.SalesTableLinkDetails?.[0]?.WaiterName && (
Captain :{' '}
{table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
)}
{sportsAppPreference && MembershipApplied && (
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobalIsnotes && (
Notes : 10 days Return policy
)
: Notestext && (
)}
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobaltermsAndConditions && (
Terms & Conditions
-
Once goods are sold, they are not
exchangeable or refundable.
-
Please check the product before leaving
the counter.
)
: TermsnAdCondition == true &&
TermsAndConditions?.length > 0 && (
Terms & Conditions
{TermsAndConditions?.map((item) => (
-
{item?.TermsandConditions}
))}
{/* - Please check the product before leaving the counter.
*/}
)}
{GlobaldummyData
? GlobalSignature && (
Signature
)
: Signature == true && (
Signature
)}
)}
{PrintGreeting?.SettingValue === 'Y' && (
Thank You Visit Again
)}
>
)}
))}
{shouldFooterBeOnNewPage && FormatTheme && (
<>
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{((OrderDetailGST?.length > 0 &&
OrderDetailGST?.[0]?.TaxAmt > 0) ||
(OrderDetailIGST?.length > 0 &&
OrderDetailIGST?.[0]?.TaxAmt > 0) ||
(OrderDetailVAT?.length > 0 &&
OrderDetailVAT?.[0]?.TaxAmt > 0)) &&
table2Data?.NetAmount !== 0 && (
<>
--------- GST Breakup Details -----------
{OrderDetailGST?.length > 0 &&
OrderDetailGST?.[0]?.TaxAmt > 0 && (
|
Taxable Amount
|
CGST
|
SGST
|
Total Amount
|
{OrderDetailGST?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(
item.WithOutTaxAmount
).toFixed(2)}
|
{Number(item.CGST).toFixed(2)}
|
{Number(item.SGST).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
)}
{OrderDetailIGST?.length > 0 &&
OrderDetailIGST?.[0]?.TaxAmt > 0 && (
<>
|
Taxable Amount
|
IGST
|
Total Amount
|
{OrderDetailIGST?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(
item.WithOutTaxAmount
).toFixed(2)}
|
{Number(item.TaxAmt).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
>
)}
{OrderDetailVAT?.length > 0 &&
OrderDetailVAT?.[0]?.TaxAmt > 0 && (
<>
|
Taxable Amount
|
VAT
|
Total Amount
|
{OrderDetailVAT?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(
item.WithOutTaxAmount
).toFixed(2)}
|
{Number(item.TaxAmt).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
>
)}
>
)}
)}
{' '}
Items :
{' '}
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
{' '}
{' '}
Qty :
{' '}
{GlobaldummyData ? '9' : totalQuantity}
{' '}
{/* {ExtraChargeTotal>0 &&
Extra Charges :
{ExtraChargeTotal}
} */}
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && (
{' '}
Off :
{' '}
{GlobaldummyData
? '100'
: Number(
TotalOfferAmount + table2Data?.OverallDisc
).toFixed(2)}
{' '}
)}
{' '}
Amount
:
{' '}
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
{' '}
{DineInData?.length > 0 && TakeawayData?.length > 0 && (
<>
{takeAwayPreference && (
Takeaway: {Number(TakeawayTotal).toFixed(2)}
)}
{dinePreference && (
Dine In:
{Number(DineInTotal).toFixed(2)}{' '}
)}
>
)}
{PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: 'Split'}{' '}
Payment :
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
/-{' '}
{isEditedBill && lastTransaction && (
Bill Gross Amount
{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}
{'Adjustment Amount'}
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
Net Bill Amount
{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}
)}
{GlobaldummyData
? GlobalCredit && (
Advance Amount:
Opening Balance:
)
: CreditDetails &&
table2Data?.CustomerDetails?.length > 0 && (
{/* OLD CREDIT BAL */}
{PaymentStatusSuccess?.[0]?.PaymentTypeName ===
'Credit' && (
<>
{table2Data.CustomerDetails[0].OldCreditBal >
0 ? (
Advance Amount:
{
table2Data.CustomerDetails[0]
.OldCreditBal
}
) : table2Data.CustomerDetails[0]
.OldCreditBal < 0 ? (
{' '}
Opening Balance:{' '}
{Math.abs(
table2Data.CustomerDetails[0]
.OldCreditBal
)}
) : null}
>
)}
{/* CURRENT CREDIT BAL */}
{table2Data.CustomerDetails[0].CurrentCreditBal >
0 ? (
{' '}
Current Advance Amount:{' '}
{
table2Data.CustomerDetails[0]
.CurrentCreditBal
}
) : table2Data.CustomerDetails[0]
.CurrentCreditBal < 0 ? (
{' '}
Current Balance Amount:{' '}
{Math.abs(
table2Data.CustomerDetails[0]
.CurrentCreditBal
)}
) : null}
)}
{/*
TOTAL SAVING : 10.00
*/}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobalQrcodet && (
{' '}

{' '}
Scan to Pay
{' '}
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
)
: Qrcodet &&
paymentTypeUPI && (
Scan to Pay
โน
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
)}
)}
YOUR ORDER NO:{' '}
{table2Data?.SalesId &&
extractLastNumber(table2Data?.SalesId)}
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
<>
{/*
Split Payment:
*/}
{Object.keys(aggregatedPayments).map((paymentType) => (
{paymentType}:{' '}
{aggregatedPayments[paymentType].toFixed(2)}
))}
>
)}
{GlobaldummyData && GlobalCashierName && (
{' '}
Cashier : Cashier Name
)}
{CashierName &&
CashierName !== undefined &&
CashierName !== null &&
!GlobaldummyData &&
CashierNameField && (
Cashier : {CashierName}
)}
{GlobaldummyData && (
{' '}
Customer : Customer Name
)}
{table2Data?.CustSuppName &&
table2Data?.CustSuppName !== undefined &&
table2Data?.CustSuppName !== null &&
!GlobaldummyData && (
Customer : {table2Data?.CustSuppName}
)}
{table2Data?.BookingTypeName == 'Dine In' &&
dinePreference &&
table2Data?.SalesTableLinkDetails?.[0]?.WaiterName && (
Captain :{' '}
{table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
)}
{sportsAppPreference && MembershipApplied && (
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobalIsnotes && (
Notes : 10 days Return policy
)
: Notestext && (
)}
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobaltermsAndConditions && (
Terms & Conditions
-
Once goods are sold, they are not
exchangeable or refundable.
-
Please check the product before leaving the
counter.
)
: TermsnAdCondition == true &&
TermsAndConditions?.length > 0 && (
Terms & Conditions
{TermsAndConditions?.map((item) => (
-
{item?.TermsandConditions}
))}
{/* - Please check the product before leaving the counter.
*/}
)}
{GlobaldummyData
? GlobalSignature && (
Signature
)
: Signature == true && (
Signature
)}
)}
{PrintGreeting?.SettingValue === 'Y' && (
Thank You Visit Again
)}
>
)}
) : (
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData && GlobalLogo ? (

) : null}
{base64Image &&
(PrintLogo?.SettingValue === 'Y' || LogoField) ? (

) : null}
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
Low Prices... Love the Saving...
{GlobaldummyData
? 'BranchAddress, Town- 635XXX City - State'
: (table2Data?.AddressDetails?.[0]?.Address1 || '') +
(table2Data?.AddressDetails?.[0]?.City
? (table2Data?.AddressDetails?.[0]?.Address1 &&
table2Data?.AddressDetails?.[0]?.City
? '-'
: '') + table2Data?.AddressDetails?.[0]?.City
: '') +
(table2Data?.AddressDetails?.[0]?.Zip
? (table2Data?.AddressDetails?.[0]?.City &&
table2Data?.AddressDetails?.[0]?.Zip
? '-'
: '') + table2Data?.AddressDetails?.[0]?.Zip
: '')}
{' '}
Mobile :
{GlobaldummyData ? '1234567890' : table2Data?.BrMobile}{' '}
{table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
{table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobalBilltext
? GlobalBilltext
: 'Cash' + ' Bill'
: BillName
? BillName
: PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName + ' Bill'
: ''}{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' && estimateTitle && (
Estimate{' '}
{/* {SalesModePref?.SettingValue == 'Y' &&
`(${table2Data?.SalesMode ? table2Data?.SalesMode : 'R'})`} */}
)}
{' '}
{GlobaldummyData ? formattedDate : Date1}
{SalesModePref?.SettingValue == 'Y' &&
{' '}
Name : {table2Data?.SalesMode == "R" ? "RT" : "WS"}{' '}
}
{' '}
{' '}
Bill No :
{GlobaldummyData
? '553'
: table2Data?.OrderId &&
extractLastNumberOrderId(
table2Data?.OrderId,
table2Data?.FYStatus
)}{' '}
{' '}
{(TakeawayData?.length > 0 || GlobaldummyData) && (
<>
{takeAwayPreference && (
{' '}
TakeAway
)}
{GlobaldummyData
? GlobalSlNo && (
S.No
)
: SLNO && (
S.No
)}
{GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && (
{' '}
{GlobaldummyData
? GlobalItem && 'ITEM /DES /'
: 'ITEM /DES /'}{' '}
{GlobaldummyData ? GlobalQuantity && 'QTY' : 'QTY'}{' '}
)
) : (
{' '}
{GlobaldummyData
? GlobalItem && 'ITEM /DES /'
: Item && 'ITEM /DES /'}{' '}
{GlobaldummyData
? GlobalQuantity && 'QTY'
: Quantity && WeightasKg ? 'Qty/Kg' : 'Qty'}{' '}
)}
{GlobaldummyData
? GlobalHsnCode && (
HSN
)
: HsnCode && (
HSN
)}
{GlobaldummyData
? GlobalMRP && (
MRP
)
: MRP && (
MRP
)}
{GlobaldummyData
? GlobalRate && (
RATE
)
: Rate && (
RATE
)}
{GlobaldummyData
? GlobalDiscount && (
DIS{' '}
)
: Discount && (
DIS{' '}
)}
{GlobaldummyData
? GlobalTax && (
TAX %{' '}
)
: Tax &&
table2Data?.OrderType !== 'E' && (
TAX %{' '}
)}
{GlobaldummyData
? GlobalAmount && (
{' '}
Amt{' '}
)
: Amount && (
{' '}
AMT{' '}
)}
{(GlobaldummyData ? products : TakeawayData)?.map(
(item, index) => (
{GlobaldummyData
? GlobalSlNo && (
{index + 1}
)
: SLNO && (
{index + 1}
)}
{GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && (
{GlobaldummyData ? (
GlobalItem && (
<>
{item?.ProdName}
{item?.Size + item?.UomName}
>
)
) : (
<>
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' && (
{item?.Size +
item?.UomName +
'-' +
(GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty)}
)}
>
)}
)
) : (
{GlobaldummyData ? (
GlobalItem && (
<>
{item?.ProdName}
{item?.Size + item?.UomName}
>
)
) : (
<>
{/* ๐ท Product Name */}
{item?.ProdName}
{(() => {
const packages =
(PackageDetails ?? []).filter(pkg => pkg.ProdId === item.ProdId);
const identifiers = item?.ProductIdentifierDtls ?? [];
return packages.length > 0 ? (
// ================= PACKAGE EXISTS =================
{/* ๐ฆ Package Details */}
{packages.map((pkg, index) => (
{pkg.ParcelCount} PCS {pkg.ParcelQty} PACK ({pkg.ParcelType})
))}
{/* ๐ท Brand */}
{item?.BrandName &&
{item.BrandName}
}
{/* ๐ข Serial / IMEI */}
{identifiers.map((d, i) => {
const values = [
d.SerialNumber,
d.IMEI1,
d.IMEI2
].filter(Boolean);
if (values.length === 0) return null;
return (
{values.join(", ")}
);
})}
{/* ๐ Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}
)}
{/* ๐งช Debug / Extra Text */}
ssd3
{/* ๐ข Quantity */}
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty}
) : (
// ================= NO PACKAGE =================
{/* ๐ Size + UOM */}
{UomPrint?.SettingValue === 'Y' && (
<>
{item?.Size || "1"}{" "}
{item?.SinglePc === "Y"
? "PCS"
: item?.Type !== "C"
? item?.UomName
: "COMBO"}
>
)}
{/* ๐ท Brand */}
{item?.BrandName &&
{item.BrandName}
}
{/* ๐ข Serial / IMEI */}
{identifiers.map((d, i) => {
const values = [
d.SerialNumber,
d.IMEI1,
d.IMEI2
].filter(Boolean);
if (values.length === 0) return null;
return (
{values.join(", ")}
);
})}
{/* ๐ Description from first identifier */}
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2)?.Description && (
{identifiers.find(d => d.SerialNumber || d.IMEI1 || d.IMEI2).Description}
)}
{/* ๐งช Debug / Extra Text */}
ssd4
{/* ๐ข Quantity */}
-
{GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty}
);
})()}
>
)}
)}
{GlobaldummyData
? GlobalHsnCode && (
{item?.HSN}
)
: HsnCode && (
{item?.HSN}
)}
{GlobaldummyData
? GlobalMRP && (
{item?.MRP}
)
: MRP && (
{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}
)}
{GlobaldummyData
? GlobalRate && (
{item?.Rate}
)
: Rate && (
{item?.Rate}
)}
{GlobaldummyData
? GlobalDiscount && (
{item?.discount}
)
: Discount && (
{item?.Type != 'C'
? item?.OfferAmt || 0
: item?.OfferValue || 0}
)}
{GlobaldummyData
? GlobalTax && (
{item?.ProdTaxPercentage}
)
: Tax &&
table2Data?.OrderType !== 'E' && (
{item?.ProdTaxPercentage || 0}
)}
{GlobaldummyData
? GlobalAmount && (
{item?.TotalAmt}
)
: Amount && (
{' '}
{item?.Type != 'C'
? item?.TotalAmt - item?.OfferAmt || 0
: item?.TotalAmt - item?.OfferValue || 0}
)}
)
)}
>
)}
{DineInData?.length > 0 && dinePreference && (
<>
{' '}
DineIn
{GlobaldummyData
? GlobalSlNo && (
S.No
)
: SLNO && (
S.No
)}
{GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && (
{' '}
{GlobaldummyData
? GlobalItem && 'ITEM /DES /'
: 'ITEM /DES /'}{' '}
{GlobaldummyData ? GlobalQuantity && 'QTY' : 'QTY'}{' '}
)
) : (
{' '}
{GlobaldummyData
? GlobalItem && 'ITEM /DES /'
: Item && 'ITEM /DES /'}{' '}
{GlobaldummyData
? GlobalQuantity && 'QTY'
: Quantity && WeightasKg ? 'Qty/Kg' : 'Qty'}{' '}
)}
{GlobaldummyData
? GlobalHsnCode && (
HSN
)
: HsnCode && (
HSN
)}
{GlobaldummyData
? GlobalMRP && (
MRP
)
: MRP && (
MRP
)}
{GlobaldummyData
? GlobalRate && (
RATE
)
: Rate && (
RATE
)}
{GlobaldummyData
? GlobalDiscount && (
DIS{' '}
)
: Discount && (
DIS{' '}
)}
{GlobaldummyData
? GlobalTax && (
TAX %{' '}
)
: Tax &&
table2Data?.OrderType !== 'E' && (
TAX %{' '}
)}
{GlobaldummyData
? GlobalAmount && (
{' '}
Amt{' '}
)
: Amount && (
{' '}
AMT{' '}
)}
{(GlobaldummyData ? products : DineInData)?.map(
(item, index) => (
{GlobaldummyData
? GlobalSlNo && (
{index + 1}
)
: SLNO && (
{index + 1}
)}
{GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && (
{GlobaldummyData ? (
GlobalItem && (
<>
{item?.ProdName}
{item?.Size + item?.UomName}
>
)
) : (
<>
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' &&
{item?.Size +
item?.UomName +
'-' +
(GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty)}
}
>
)}
)
) : (
{GlobaldummyData ? (
GlobalItem && (
<>
{item?.ProdName}
{item?.Size + item?.UomName}
>
)
) : (
<>
{item?.ProdName}
{UomPrint?.SettingValue === 'Y' ? ((item?.Size ? item?.Size : '1') +
(item?.SinglePc == 'Y'
? 'PCS'
: item?.Type != 'C'
? item?.UomName
: 'COMBO')) : "" +
'-' +
(GlobaldummyData
? GlobalQuantity && item?.SalesQty
: item?.SalesQty)}
>
)}
)}
{GlobaldummyData
? GlobalHsnCode && (
{item?.HSN}
)
: HsnCode && (
{item?.HSN}
)}
{GlobaldummyData
? GlobalMRP && (
{item?.MRP}
)
: MRP && (
{item?.SinglePc === 'Y' ? item?.Rate : item?.MRP}
)}
{GlobaldummyData
? GlobalRate && (
{item?.Rate}
)
: Rate && (
{item?.Rate}
)}
{GlobaldummyData
? GlobalDiscount && (
{item?.discount}
)
: Discount && (
{item?.Type != 'C'
? item?.OfferAmt || 0
: item?.OfferValue || 0}
)}
{GlobaldummyData
? GlobalTax && (
{item?.ProdTaxPercentage}
)
: Tax &&
table2Data?.OrderType !== 'E' && (
{item?.ProdTaxPercentage || 0}
)}
{GlobaldummyData
? GlobalAmount && (
{item?.TotalAmt}
)
: Amount && (
{' '}
{item?.Type != 'C'
? item?.TotalAmt - item?.OfferAmt || 0
: item?.TotalAmt - item?.OfferValue || 0}
)}
)
)}
>
)}
{table2Data?.OrderType === 'E' ? (
''
) : (
{((OrderDetailGST?.length > 0 &&
OrderDetailGST?.[0]?.TaxAmt > 0) ||
(OrderDetailIGST?.length > 0 &&
OrderDetailIGST?.[0]?.TaxAmt > 0) ||
(OrderDetailVAT?.length > 0 &&
OrderDetailVAT?.[0]?.TaxAmt > 0)) &&
table2Data?.NetAmount !== 0 && (
<>
--------- GST Breakup Details -----------
{OrderDetailGST?.length > 0 &&
OrderDetailGST?.[0]?.TaxAmt > 0 && (
|
Taxable Amount
|
CGST |
SGST |
Total Amount
|
{OrderDetailGST?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(item.WithOutTaxAmount).toFixed(2)}
|
{Number(item.CGST).toFixed(2)}
|
{Number(item.SGST).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
)}
{OrderDetailIGST?.length > 0 &&
OrderDetailIGST?.[0]?.TaxAmt > 0 && (
<>
|
Taxable Amount
|
IGST |
Total Amount
|
{OrderDetailIGST?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(item.WithOutTaxAmount).toFixed(2)}
|
{Number(item.TaxAmt).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
>
)}
{OrderDetailVAT?.length > 0 &&
OrderDetailVAT?.[0]?.TaxAmt > 0 && (
<>
|
Taxable Amount
|
VAT |
Total Amount
|
{OrderDetailVAT?.map((item) => (
|
{item?.TaxPercentage || 0}%
|
{Number(item.WithOutTaxAmount).toFixed(2)}
|
{Number(item.TaxAmt).toFixed(2)}
|
{Number(item.TotalAmt).toFixed(2)}
|
))}
>
)}
>
)}
)}
{' '}
Items :
{' '}
{GlobaldummyData ? '8' : totalQuantityFilter?.length}
{' '}
{' '}
Qty :
{' '}
{GlobaldummyData ? '9' : totalQuantity}
{' '}
{/* {ExtraChargeTotal>0 &&
Extra Charges :
{ExtraChargeTotal}
} */}
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && (
{' '}
Off :
{' '}
{GlobaldummyData
? '100'
: Number(
TotalOfferAmount + table2Data?.OverallDisc
).toFixed(2)}
{' '}
)}
{' '}
Amount
:
{' '}
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
{' '}
{/*
*/}
{/*
*/}
{DineInData?.length > 0 && TakeawayData?.length > 0 && (
<>
{takeAwayPreference && (
Takeaway: {Number(TakeawayTotal).toFixed(2)}
)}
{dinePreference && (
Dine In: {Number(DineInTotal).toFixed(2)}
)}
>
)}
{/*
CARD : *********12
CARD HOLDER : CARD HOLDER NAME
*/}
{PaymentStatusSuccess?.length === 1
? PaymentStatusSuccess?.[0]?.PaymentTypeName
: 'Split'}{' '}
Payment :
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
/-{' '}
{isEditedBill && lastTransaction && (
Bill Gross Amount
{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}
{'Adjustment Amount'}
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
{Math.abs((lastTransaction?.BeforeAdjustment ?? 0) -
(lastTransaction?.AfterAdjustment ?? 0)).toFixed(2)}
Net Bill Amount
{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}
)}
{GlobaldummyData
? GlobalCredit && (
Advance Amount:
Opening Balance:
)
: CreditDetails &&
table2Data?.CustomerDetails?.length > 0 && (
{/* OLD CREDIT BAL */}
{PaymentStatusSuccess?.[0]?.PaymentTypeName ===
'Credit' && (
<>
{table2Data.CustomerDetails[0].OldCreditBal > 0 ? (
Advance Amount:
{table2Data.CustomerDetails[0].OldCreditBal}
) : table2Data.CustomerDetails[0].OldCreditBal <
0 ? (
{' '}
Opening Balance:{' '}
{Math.abs(
table2Data.CustomerDetails[0].OldCreditBal
)}
) : null}
>
)}
{/* CURRENT CREDIT BAL */}
{table2Data.CustomerDetails[0].CurrentCreditBal > 0 ? (
{' '}
Current Advance Amount:{' '}
{table2Data.CustomerDetails[0].CurrentCreditBal}
) : table2Data.CustomerDetails[0].CurrentCreditBal <
0 ? (
{' '}
Current Balance Amount:{' '}
{Math.abs(
table2Data.CustomerDetails[0].CurrentCreditBal
)}
) : null}
)}
{/*
TOTAL SAVING : 10.00
*/}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobalQrcodet && (
{' '}

{' '}
Scan to Pay
{' '}
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
)
: Qrcodet &&
paymentTypeUPI && (
Scan to Pay
โน
{GlobaldummyData
? '1,066'
: Number(table2Data?.NetAmount).toFixed(2)}
)}
)}
YOUR ORDER NO:{' '}
{table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
<>
{/*
Split Payment:
*/}
{Object.keys(aggregatedPayments).map((paymentType) => (
{paymentType}:{' '}
{aggregatedPayments[paymentType].toFixed(2)}
))}
>
)}
{GlobaldummyData && GlobalCashierName && (
{' '}
Cashier : Cashier Name
)}
{CashierName &&
CashierName !== undefined &&
CashierName !== null &&
!GlobaldummyData &&
CashierNameField && (
Cashier : {CashierName}
)}
{GlobaldummyData && (
{' '}
Customer : Customer Name
)}
{table2Data?.CustSuppName &&
table2Data?.CustSuppName !== undefined &&
table2Data?.CustSuppName !== null &&
!GlobaldummyData && (
Customer : {table2Data?.CustSuppName}
)}
{table2Data?.BookingTypeName == 'Dine In' &&
table2Data?.SalesTableLinkDetails?.[0]?.WaiterName && (
Captain :{' '}
{table2Data?.SalesTableLinkDetails?.[0]?.WaiterName}
)}
{sportsAppPreference && MembershipApplied && (
{`*** Membership ${table2Data?.NetAmount === 0 ? 'Free Hours' : 'Discount'} Utilized - ${MembershipApplied?.Detail?.[0]?.MembershipName} ***`}
)}
********************************************************************************************************************************
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobalIsnotes && (
Notes : 10 days Return policy
)
: Notestext && (
)}
)}
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
{GlobaldummyData
? GlobaltermsAndConditions && (
Terms & Conditions
-
Once goods are sold, they are not exchangeable
or refundable.
-
Please check the product before leaving the
counter.
)
: TermsnAdCondition == true &&
TermsAndConditions?.length > 0 && (
Terms & Conditions
{TermsAndConditions?.map((item) => (
-
{item?.TermsandConditions}
))}
)}
{GlobaldummyData
? GlobalSignature && (
Signature
)
: Signature == true && (
Signature
)}
)}
{PrintGreeting?.SettingValue === 'Y' && (
Thank You Visit Again
)}
)}
>
);
};
export default PrintStyle5;