Subversion Repositories SmartDukaan

Rev

Rev 22068 | Rev 22351 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21686 ashik.ali 1
package com.spice.profitmandi.common.util;
2
 
3
 
4
import java.io.OutputStream;
5
import java.time.LocalDateTime;
21915 ashik.ali 6
import java.util.Locale;
21686 ashik.ali 7
import java.util.Set;
8
 
9
import org.slf4j.Logger;
10
import org.slf4j.LoggerFactory;
22068 ashik.ali 11
import org.springframework.util.StringUtils;
21686 ashik.ali 12
 
21915 ashik.ali 13
import com.ibm.icu.text.RuleBasedNumberFormat;
21686 ashik.ali 14
import com.itextpdf.text.Chunk;
15
import com.itextpdf.text.Document;
16
import com.itextpdf.text.DocumentException;
17
import com.itextpdf.text.Element;
18
import com.itextpdf.text.Font;
19
import com.itextpdf.text.Paragraph;
20
import com.itextpdf.text.Rectangle;
21
import com.itextpdf.text.pdf.PdfPCell;
22
import com.itextpdf.text.pdf.PdfPTable;
23
import com.itextpdf.text.pdf.PdfWriter;
24
import com.spice.profitmandi.common.model.CustomCustomer;
25
import com.spice.profitmandi.common.model.CustomFofoOrderItem;
22215 ashik.ali 26
import com.spice.profitmandi.common.model.CustomInsurancePolicy;
21686 ashik.ali 27
import com.spice.profitmandi.common.model.CustomRetailer;
28
import com.spice.profitmandi.common.model.PdfModel;
29
 
30
public class PdfUtils {
31
 
32
	private static final Font FONT_TITLE = new Font(Font.FontFamily.HELVETICA  , 18, Font.BOLD);
21965 ashik.ali 33
	private static Font FONT_NORMAL = new Font(Font.FontFamily.TIMES_ROMAN, 10, Font.NORMAL);
34
	private static Font FONT_BOLD = new Font(Font.FontFamily.TIMES_ROMAN, 10, Font.BOLD);
21686 ashik.ali 35
	//private static Font fontTableHeader = new Font(Font.FontFamily.TIMES_ROMAN, 14, Font.BOLD);
21926 ashik.ali 36
	private static final String INVOICE_TITLE = "INVOICE";
21686 ashik.ali 37
 
21915 ashik.ali 38
	private static final Locale indianLocale = Locale.getDefault();
39
 
21686 ashik.ali 40
	private static final Logger LOGGER = LoggerFactory.getLogger(PdfUtils.class);
41
 
42
	public static void generateAndWrite(PdfModel pdfModel, OutputStream outputStream){
43
		Document document = new Document();
21926 ashik.ali 44
		document.setMargins(0, 0, 25, 0);
21686 ashik.ali 45
        try {
46
        	CustomCustomer customer = pdfModel.getCustomer();
47
        	CustomRetailer retailer = pdfModel.getRetailer();
21901 ashik.ali 48
        	boolean gstWithInState = false;
49
        	String customerAddressStateCode = "", retailerAddressStateCode = "";
50
        	if(customer.getAddress().getState().equals(retailer.getAddress().getState())){
51
        		gstWithInState = true;
52
        		customerAddressStateCode = Utils.getStateCode(customer.getAddress().getState());
53
        	}else{
54
        		customerAddressStateCode = Utils.getStateCode(customer.getAddress().getState());
55
        		retailerAddressStateCode = Utils.getStateCode(retailer.getAddress().getState());
56
        	}
21686 ashik.ali 57
        	Set<CustomFofoOrderItem> orderItems = pdfModel.getOrderItems();
58
 
59
            PdfWriter.getInstance(document,outputStream);
60
 
61
            document.open();
62
            document.addTitle(pdfModel.getTitle());
63
            document.addAuthor(pdfModel.getAuther());
64
 
65
            Paragraph paragraphTitle = new Paragraph(INVOICE_TITLE, FONT_TITLE);
66
            paragraphTitle.setAlignment(Element.ALIGN_CENTER);
67
 
68
            PdfPCell blankCell = new PdfPCell();
69
            blankCell.setBorder(Rectangle.NO_BORDER);
70
            PdfPTable tableCustomerRetailer = new PdfPTable(3);
22025 ashik.ali 71
            tableCustomerRetailer.setWidthPercentage(90);
21686 ashik.ali 72
            tableCustomerRetailer.getDefaultCell().setBorder(Rectangle.NO_BORDER);
73
            PdfPCell columnCustomerInfo = new PdfPCell();
22215 ashik.ali 74
            columnCustomerInfo.addElement(new Paragraph(StringUtils.capitalize(customer.getFirstName() + " " + customer.getLastName()), FONT_NORMAL));
22068 ashik.ali 75
            columnCustomerInfo.addElement(new Paragraph(StringUtils.capitalize(customer.getAddress().getLine1()) + ", " + StringUtils.capitalize(customer.getAddress().getLine2()), FONT_NORMAL));
76
            columnCustomerInfo.addElement(new Paragraph(StringUtils.capitalize(customer.getAddress().getCity()) + ", " + StringUtils.capitalize(customer.getAddress().getState()) + "(" + customerAddressStateCode + ")" + "\n" + customer.getAddress().getPinCode(), FONT_NORMAL));
21686 ashik.ali 77
            columnCustomerInfo.addElement(new Paragraph(customer.getMobileNumber(), FONT_NORMAL));
78
            columnCustomerInfo.setBorder(Rectangle.NO_BORDER);
79
            PdfPCell columnRetailerInfo = new PdfPCell();
80
            //columnRetailerInfo.addElement(new Paragraph("Invoice No:"));
22068 ashik.ali 81
            columnRetailerInfo.addElement(new Paragraph(StringUtils.capitalize(retailer.getBusinessName()), FONT_BOLD));
21686 ashik.ali 82
           // columnRetailerInfo.addElement(new Paragraph("Plot No. 485, Udyog Vihar Phase V, Gurgoan-122016", FONT_BOLD));
22068 ashik.ali 83
            columnRetailerInfo.addElement(new Paragraph(StringUtils.capitalize(retailer.getAddress().getLine1()) + ", " + StringUtils.capitalize(retailer.getAddress().getLine2()) + ", " + StringUtils.capitalize(retailer.getAddress().getCity()) + "-" + retailer.getAddress().getPinCode() + ", " + retailer.getAddress().getState() + "(" + (gstWithInState? customerAddressStateCode : retailerAddressStateCode) + ")", FONT_BOLD));
21686 ashik.ali 84
            columnRetailerInfo.addElement(new Paragraph("Contact No.- "+retailer.getMobileNumber(), FONT_BOLD));
85
            columnRetailerInfo.addElement(new Paragraph("TIN NO. " + retailer.getTinNumber(), FONT_BOLD));
86
            columnRetailerInfo.setBorder(Rectangle.NO_BORDER);
87
            PdfPTable tableInvoiceDateRetailer = new PdfPTable(1);
88
            tableInvoiceDateRetailer.getDefaultCell().setBorder(Rectangle.NO_BORDER);
89
            PdfPTable tableInvoiceDate = new PdfPTable(2);
90
            tableInvoiceDate.getDefaultCell().setBorder(Rectangle.NO_BORDER);
91
            PdfPCell invoiceNumberKey = new PdfPCell(new Paragraph("Invoice No:", FONT_NORMAL));
92
            invoiceNumberKey.setBorder(Rectangle.NO_BORDER);
93
            PdfPCell invoiceNumberValue = new PdfPCell(new Paragraph(pdfModel.getInvoiceNumber(), FONT_NORMAL));
94
            invoiceNumberValue.setBorder(Rectangle.NO_BORDER);
95
            PdfPCell dateKey = new PdfPCell(new Paragraph("Date:", FONT_NORMAL));
96
            dateKey.setBorder(Rectangle.NO_BORDER);
97
            LocalDateTime now = LocalDateTime.now();
98
            //PdfPCell dateValue = new PdfPCell(new Paragraph("May 22, 2017", FONT_NORMAL));
99
            PdfPCell dateValue = new PdfPCell(new Paragraph(now.getMonth().name() + now.getDayOfMonth() + ", " + now.getYear(), FONT_NORMAL));
100
            dateValue.setBorder(Rectangle.NO_BORDER);
101
            tableInvoiceDate.addCell(invoiceNumberKey);
102
            //tableInvoiceDate.addCell(blankCell);
103
            tableInvoiceDate.addCell(invoiceNumberValue);
104
            tableInvoiceDate.addCell(dateKey);
105
            //tableInvoiceDate.addCell(blankCell);
106
            tableInvoiceDate.addCell(dateValue);
107
            tableInvoiceDateRetailer.addCell(tableInvoiceDate);
108
            tableInvoiceDateRetailer.addCell(columnRetailerInfo);
109
 
110
            tableCustomerRetailer.addCell(columnCustomerInfo);
111
            tableCustomerRetailer.addCell(blankCell);
112
            tableCustomerRetailer.addCell(tableInvoiceDateRetailer);
113
 
21901 ashik.ali 114
            PdfPTable orders = null;
22068 ashik.ali 115
            if(!gstWithInState){
21915 ashik.ali 116
            	orders = new PdfPTable(8);
21901 ashik.ali 117
            }else{
21915 ashik.ali 118
            	orders = new PdfPTable(10);
21901 ashik.ali 119
            }
22025 ashik.ali 120
            orders.setWidthPercentage(90);
21686 ashik.ali 121
            //PdfPCell orderDetail = new PdfPCell(new Paragraph("Order Details:"));
122
            /*PdfPTable ordersTable = new PdfPTable(8);
123
            PdfPCell srNo = new PdfPCell(new Paragraph("Sr No"));
124
            PdfPCell description = new PdfPCell(new Paragraph("Description"));
125
            PdfPCell quantity = new PdfPCell(new Paragraph("Quantity"));
126
            PdfPCell rate = new PdfPCell(new Paragraph("Rate (Rs)"));
127
            PdfPCell amount = new PdfPCell(new Paragraph("Amount (Rs)"));
128
            PdfPCell taxRate = new PdfPCell(new Paragraph("Tax Rate%"));
129
            PdfPCell tax = new PdfPCell(new Paragraph("Tax (Rs)"));
130
            PdfPCell itemTotal = new PdfPCell(new Paragraph("Item Total (Rs)"));
131
            srNo.setBorder(Rectangle.NO_BORDER);
132
            description.setBorder(Rectangle.NO_BORDER);
133
            quantity.setBorder(Rectangle.NO_BORDER);
134
            rate.setBorder(Rectangle.NO_BORDER);
135
            amount.setBorder(Rectangle.NO_BORDER);
136
            taxRate.setBorder(Rectangle.NO_BORDER);
137
            tax.setBorder(Rectangle.NO_BORDER);
138
            itemTotal.setBorder(Rectangle.NO_BORDER);*/
139
            orders.addCell(new Paragraph("Sr No", FONT_BOLD));
140
            orders.addCell(new Paragraph("Description", FONT_BOLD));
21901 ashik.ali 141
            orders.addCell(new Paragraph("HSN Code", FONT_BOLD));
22025 ashik.ali 142
            orders.addCell(new Paragraph("Qty", FONT_BOLD));
21686 ashik.ali 143
            orders.addCell(new Paragraph("Rate (Rs)", FONT_BOLD));
144
            orders.addCell(new Paragraph("Amount (Rs)", FONT_BOLD));
22068 ashik.ali 145
            if(!gstWithInState){
21901 ashik.ali 146
            	orders.addCell(new Paragraph("IGST Rate%", FONT_BOLD));
147
                orders.addCell(new Paragraph("IGST Amount", FONT_BOLD));
22025 ashik.ali 148
                //orders.setWidths(new float[]{1, 3, 1, 1, 1, 1, 1, 1});
149
                orders.setWidths(new float[]{.7f, 3, 1.2f, .7f, 1.1f, 1.1f, .9f, .9f});
21901 ashik.ali 150
            }else{
151
            	orders.addCell(new Paragraph("CGST Rate%", FONT_BOLD));
152
                orders.addCell(new Paragraph("CGST Amount", FONT_BOLD));
153
                orders.addCell(new Paragraph("SGST Rate%", FONT_BOLD));
154
                orders.addCell(new Paragraph("SGST Amount", FONT_BOLD));
22025 ashik.ali 155
                //orders.setWidths(new float[]{1, 3, 1, 1, 1, 1, 1, 1, 1, 1});
156
                orders.setWidths(new float[]{.7f, 3, 1.2f, .7f, 1.1f, 1.1f, .9f, .9f, .9f, .9f});
21901 ashik.ali 157
            }
158
 
159
            //orders.addCell(new Paragraph("Item Total (Rs)", FONT_BOLD));
160
 
21686 ashik.ali 161
            orders.setHeaderRows(1);
162
            //orders.setSkipFirstHeader(true);
21901 ashik.ali 163
 
21926 ashik.ali 164
            float igstTotalAmount = 0, cgstTotalAmount = 0, sgstTotalAmount = 0;
21686 ashik.ali 165
            int index = 1;
166
        	for(CustomFofoOrderItem orderItem : orderItems){
167
            	orders.addCell(new Paragraph(String.valueOf(index++), FONT_NORMAL));
168
            	orders.addCell(new Paragraph(orderItem.getDescription(), FONT_NORMAL));
21901 ashik.ali 169
            	orders.addCell(new Paragraph(orderItem.getHsnCode(), FONT_NORMAL));
21686 ashik.ali 170
            	orders.addCell(new Paragraph(String.valueOf(orderItem.getQuantity()), FONT_NORMAL));
22025 ashik.ali 171
            	orders.addCell(new Paragraph(String.format("%.2f", orderItem.getRate()), FONT_NORMAL));
21926 ashik.ali 172
            	orders.addCell(new Paragraph(String.format("%.2f", orderItem.getAmount()), FONT_NORMAL));
22068 ashik.ali 173
            	if(!gstWithInState){
21926 ashik.ali 174
            		orders.addCell(new Paragraph(String.format("%.2f", orderItem.getIgstRate()), FONT_NORMAL));
175
            		orders.addCell(new Paragraph(String.format("%.2f", orderItem.getIgstAmount()), FONT_NORMAL));
176
            		igstTotalAmount = igstTotalAmount + orderItem.getIgstAmount();
21901 ashik.ali 177
            	}else{
21926 ashik.ali 178
            		orders.addCell(new Paragraph(String.format("%.2f", orderItem.getCgstRate()), FONT_NORMAL));
179
            		orders.addCell(new Paragraph(String.format("%.2f", orderItem.getCgstAmount()), FONT_NORMAL));
180
            		orders.addCell(new Paragraph(String.format("%.2f", orderItem.getSgstRate()), FONT_NORMAL));
181
            		orders.addCell(new Paragraph(String.format("%.2f", orderItem.getSgstAmount()), FONT_NORMAL));
182
            		cgstTotalAmount = cgstTotalAmount + orderItem.getCgstAmount();
183
            		sgstTotalAmount = sgstTotalAmount + orderItem.getSgstAmount();
21901 ashik.ali 184
            	}
22025 ashik.ali 185
            	//orders.addCell(new Paragraph(String.format("%.2f", orderItem.getItemTotal()), FONT_NORMAL));
21686 ashik.ali 186
            }
22215 ashik.ali 187
 
188
        	for(CustomInsurancePolicy insurancePolicy : pdfModel.getInsurancePolicies()){
189
        		orders.addCell(new Paragraph(String.valueOf(index++), FONT_NORMAL));
190
            	orders.addCell(new Paragraph(insurancePolicy.getDescription(), FONT_NORMAL));
191
            	orders.addCell(new Paragraph(insurancePolicy.getHsnCode(), FONT_NORMAL));
192
            	orders.addCell(new Paragraph("1", FONT_NORMAL));
193
            	orders.addCell(new Paragraph(String.format("%.2f", insurancePolicy.getRate()), FONT_NORMAL));
194
            	orders.addCell(new Paragraph(String.format("%.2f", insurancePolicy.getRate()), FONT_NORMAL));
195
            	if(!gstWithInState){
196
            		orders.addCell(new Paragraph(String.format("%.2f", insurancePolicy.getIgstRate()), FONT_NORMAL));
197
            		orders.addCell(new Paragraph(String.format("%.2f", insurancePolicy.getIgstAmount()), FONT_NORMAL));
198
            		igstTotalAmount = igstTotalAmount + insurancePolicy.getIgstAmount();
199
            	}else{
200
            		orders.addCell(new Paragraph(String.format("%.2f", insurancePolicy.getCgstRate()), FONT_NORMAL));
201
            		orders.addCell(new Paragraph(String.format("%.2f", insurancePolicy.getCgstAmount()), FONT_NORMAL));
202
            		orders.addCell(new Paragraph(String.format("%.2f", insurancePolicy.getSgstRate()), FONT_NORMAL));
203
            		orders.addCell(new Paragraph(String.format("%.2f", insurancePolicy.getSgstAmount()), FONT_NORMAL));
204
            		cgstTotalAmount = cgstTotalAmount + insurancePolicy.getCgstAmount();
205
            		sgstTotalAmount = sgstTotalAmount + insurancePolicy.getSgstAmount();
206
            	}
207
        	}
21686 ashik.ali 208
            //orders.addCell("1");
209
            //orders.addCell("Sansui X71Activ Ta2s");
210
            //orders.setHeaderRows(1);
211
            //orders.getDefaultCell().setBorder(Rectangle.NO_BORDER);
212
            //orders.addCell(orderDetail);
213
            //orders.addCell(ordersTable);
214
            document.add(paragraphTitle);
215
            document.add(Chunk.NEWLINE);
216
            document.add(Chunk.NEWLINE);
217
            //document.add(paragraphRetailerName);
218
            document.add(tableCustomerRetailer);
219
 
21965 ashik.ali 220
            //document.add(Chunk.NEWLINE);
221
            //document.add(Chunk.NEWLINE);
21686 ashik.ali 222
            document.add(Chunk.NEWLINE);
223
            document.add(orders);
21926 ashik.ali 224
 
225
 
226
 
227
 
228
            PdfPTable gstTotalTable = null;
22068 ashik.ali 229
            if(!gstWithInState){
21926 ashik.ali 230
            	gstTotalTable = new PdfPTable(3);
22025 ashik.ali 231
            	gstTotalTable.setWidths(new float[]{8, .9f, .9f});
21926 ashik.ali 232
            }else{
233
            	gstTotalTable = new PdfPTable(5);
22025 ashik.ali 234
            	gstTotalTable.setWidths(new float[]{8, .9f, .9f, .9f, .9f});
21926 ashik.ali 235
            }
22025 ashik.ali 236
            gstTotalTable.setWidthPercentage(90);
21926 ashik.ali 237
            /*for(int i = 0; i < 6; i++){
238
            	grandTotalTable.addCell(new Paragraph());
239
            }*/
240
            //PdfPCell grandTotalCell = new PdfPCell(new Paragraph("Grand total", fontBold));
241
            //grandTotalCell.setVerticalAlignment(Element.ALIGN_RIGHT);
242
            Paragraph gstTotalParagraph = new Paragraph("Gst Total", FONT_BOLD);
243
            gstTotalParagraph.setIndentationRight(20);
244
            gstTotalTable.addCell(gstTotalParagraph);
22068 ashik.ali 245
            if(!gstWithInState){
21926 ashik.ali 246
            	gstTotalTable.addCell(new Paragraph("IGST", FONT_BOLD));
247
            	gstTotalTable.addCell(new Paragraph(String.format("%.2f", igstTotalAmount), FONT_BOLD));
248
            }else{
249
            	gstTotalTable.addCell(new Paragraph("CGST", FONT_BOLD));
250
            	gstTotalTable.addCell(new Paragraph(String.format("%.2f", cgstTotalAmount), FONT_BOLD));
251
            	gstTotalTable.addCell(new Paragraph("SGST", FONT_BOLD));
252
            	gstTotalTable.addCell(new Paragraph(String.format("%.2f", sgstTotalAmount), FONT_BOLD));
253
            }
254
 
255
            //grandTotalCell.setColspan(6);
256
            document.add(gstTotalTable);
257
 
21965 ashik.ali 258
            PdfPTable grandTotalTable = new PdfPTable(3);
22068 ashik.ali 259
            if(!gstWithInState){
22025 ashik.ali 260
            	grandTotalTable.setWidths(new float[]{8, .9f, .9f});
21901 ashik.ali 261
            }else{
22025 ashik.ali 262
            	grandTotalTable.setWidths(new float[]{10, .9f, .9f});
21901 ashik.ali 263
            }
22025 ashik.ali 264
            grandTotalTable.setWidthPercentage(90);
21901 ashik.ali 265
 
21686 ashik.ali 266
            Paragraph grandTotalParagraph = new Paragraph("Grand total", FONT_BOLD);
267
            grandTotalParagraph.setIndentationRight(20);
268
            grandTotalTable.addCell(grandTotalParagraph);
269
            Paragraph rsParagraph = new Paragraph("Rs.", FONT_BOLD);
270
            grandTotalTable.addCell(rsParagraph);
21926 ashik.ali 271
            Paragraph amountParagraph = new Paragraph(String.format("%.2f", pdfModel.getTotalAmount()), FONT_BOLD);
21686 ashik.ali 272
            grandTotalTable.addCell(amountParagraph);
273
 
21926 ashik.ali 274
 
21686 ashik.ali 275
            document.add(grandTotalTable);
276
 
277
            PdfPTable amountInWordsTable = new PdfPTable(3);
22068 ashik.ali 278
            if(!gstWithInState){
22025 ashik.ali 279
            	amountInWordsTable.setWidths(new float[]{2, 5, 2.7f});
21965 ashik.ali 280
            }else{
22025 ashik.ali 281
            	amountInWordsTable.setWidths(new float[]{2, 7, 2.7f});
21965 ashik.ali 282
            }
22025 ashik.ali 283
            amountInWordsTable.setWidthPercentage(90);
21686 ashik.ali 284
            amountInWordsTable.addCell(new Paragraph("Amount in Words:", FONT_BOLD));
21915 ashik.ali 285
 
286
            String amountInWords = toAmountInWords(pdfModel.getTotalAmount());
287
           	amountInWordsTable.addCell(new Paragraph(amountInWords.toString(), FONT_BOLD));
21686 ashik.ali 288
            amountInWordsTable.addCell(new Paragraph("E & O.E", FONT_NORMAL));
21915 ashik.ali 289
            document.add(amountInWordsTable);            
21686 ashik.ali 290
 
21965 ashik.ali 291
            Paragraph warningParagraph = new Paragraph("Goods once sold will not be taken back.\nThis is a Computer Generated Invoice.", FONT_NORMAL);
22025 ashik.ali 292
            warningParagraph.setIndentationLeft(40);
21686 ashik.ali 293
            document.add(Chunk.NEWLINE);
294
            document.add(warningParagraph);
295
            document.add(Chunk.NEWLINE);
296
            document.add(Chunk.NEWLINE);
297
 
298
            PdfPTable itemSerialNumbers = new PdfPTable(2);
22025 ashik.ali 299
            itemSerialNumbers.setWidthPercentage(90);
21686 ashik.ali 300
            itemSerialNumbers.addCell(new Paragraph("Item Name", FONT_BOLD));
301
            itemSerialNumbers.addCell(new Paragraph("Serial Number", FONT_BOLD));
302
            itemSerialNumbers.setHeaderRows(1);
303
 
304
            for(CustomFofoOrderItem orderItem : orderItems){
305
            	itemSerialNumbers.addCell(new Paragraph(orderItem.getDescription(), FONT_NORMAL));
306
            	itemSerialNumbers.addCell(new Paragraph(orderItem.getSerialNumbers().toString(), FONT_NORMAL));
307
            }
308
 
309
            document.add(itemSerialNumbers);
310
            document.close(); // no need to close PDFwriter?
311
 
312
        } catch (DocumentException e) {
313
            LOGGER.error("Unable to write data to pdf file : ", e);
21901 ashik.ali 314
        } catch (Exception e) {
315
			// TODO Auto-generated catch block
316
			e.printStackTrace();
317
		}
21686 ashik.ali 318
	}
21915 ashik.ali 319
 
320
	private static String toAmountInWords(float amount){
321
		RuleBasedNumberFormat amountInWordsFormat = new RuleBasedNumberFormat(indianLocale, RuleBasedNumberFormat.SPELLOUT);
322
       	StringBuilder amountInWords = new StringBuilder("Rs. ");
22068 ashik.ali 323
        amountInWords.append(StringUtils.capitalize(amountInWordsFormat.format((int)amount)));
21915 ashik.ali 324
       	amountInWords.append(" and ");
22068 ashik.ali 325
        amountInWords.append(StringUtils.capitalize(amountInWordsFormat.format((int)(amount*100)%100)));
21915 ashik.ali 326
       	amountInWords.append(" paise");
327
       	return amountInWords.toString();
328
	}
21686 ashik.ali 329
}