Subversion Repositories SmartDukaan

Rev

Rev 22858 | Rev 22891 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22858 Rev 22889
Line 198... Line 198...
198
            		cgstTotalAmount = cgstTotalAmount + insurancePolicy.getCgstAmount();
198
            		cgstTotalAmount = cgstTotalAmount + insurancePolicy.getCgstAmount();
199
            		sgstTotalAmount = sgstTotalAmount + insurancePolicy.getSgstAmount();
199
            		sgstTotalAmount = sgstTotalAmount + insurancePolicy.getSgstAmount();
200
            	}
200
            	}
201
            	orders.addCell(new Paragraph(String.format("%.0f", insurancePolicy.getNetAmount()), FONT_NORMAL));
201
            	orders.addCell(new Paragraph(String.format("%.0f", insurancePolicy.getNetAmount()), FONT_NORMAL));
202
        	}
202
        	}
203
            //orders.addCell("1");
-
 
204
            //orders.addCell("Sansui X71Activ Ta2s");
-
 
205
            //orders.setHeaderRows(1);
-
 
206
            //orders.getDefaultCell().setBorder(Rectangle.NO_BORDER);
-
 
207
            //orders.addCell(orderDetail);
-
 
208
            //orders.addCell(ordersTable);
-
 
-
 
203
 
209
            document.add(paragraphTitle);
204
        	document.add(paragraphTitle);
210
            document.add(Chunk.NEWLINE);
205
            document.add(Chunk.NEWLINE);
211
            document.add(Chunk.NEWLINE);
206
            document.add(Chunk.NEWLINE);
212
            //document.add(paragraphRetailerName);
-
 
213
            document.add(tableCustomerRetailer);
207
            document.add(tableCustomerRetailer);
214
            
208
            
215
            //document.add(Chunk.NEWLINE);
-
 
216
            //document.add(Chunk.NEWLINE);
-
 
217
            document.add(Chunk.NEWLINE);
209
            document.add(Chunk.NEWLINE);
218
            document.add(orders);
210
            document.add(orders);
219
            /*
-
 
220
            
-
 
221
            
-
 
222
            
-
 
223
            PdfPTable gstTotalTable = null;
-
 
224
            if(!gstWithInState){
-
 
225
            	gstTotalTable = new PdfPTable(3);
-
 
226
            	gstTotalTable.setWidths(new float[]{8, .9f, .9f});
-
 
227
            }else{
-
 
228
            	gstTotalTable = new PdfPTable(5);
-
 
229
            	gstTotalTable.setWidths(new float[]{8, .9f, .9f, .9f, .9f});
-
 
230
            }
-
 
231
            gstTotalTable.setWidthPercentage(90);
-
 
232
            for(int i = 0; i < 6; i++){
-
 
233
            	grandTotalTable.addCell(new Paragraph());
-
 
234
            }
-
 
235
            //PdfPCell grandTotalCell = new PdfPCell(new Paragraph("Grand total", fontBold));
-
 
236
            //grandTotalCell.setVerticalAlignment(Element.ALIGN_RIGHT);
-
 
237
            Paragraph gstTotalParagraph = new Paragraph("Gst Total", FONT_BOLD);
-
 
238
            gstTotalParagraph.setIndentationRight(20);
-
 
239
            gstTotalTable.addCell(gstTotalParagraph);
-
 
240
            if(!gstWithInState){
-
 
241
            	gstTotalTable.addCell(new Paragraph("IGST", FONT_BOLD));
-
 
242
            	gstTotalTable.addCell(new Paragraph(String.format("%.2f", igstTotalAmount), FONT_BOLD));
-
 
243
            }else{
-
 
244
            	gstTotalTable.addCell(new Paragraph("CGST", FONT_BOLD));
-
 
245
            	gstTotalTable.addCell(new Paragraph(String.format("%.2f", cgstTotalAmount), FONT_BOLD));
-
 
246
            	gstTotalTable.addCell(new Paragraph("SGST", FONT_BOLD));
-
 
247
            	gstTotalTable.addCell(new Paragraph(String.format("%.2f", sgstTotalAmount), FONT_BOLD));
-
 
248
            }
-
 
249
            
-
 
250
            //grandTotalCell.setColspan(6);
-
 
251
            document.add(gstTotalTable);*/
-
 
252
            
211
            
253
            PdfPTable grandTotalTable = new PdfPTable(3);
212
            PdfPTable grandTotalTable = new PdfPTable(3);
254
            if(stateGst){
213
            if(stateGst){
255
            	grandTotalTable.setWidths(new float[]{6.6f, .6f, .8f});
214
            	grandTotalTable.setWidths(new float[]{6.6f, .6f, .8f});
256
            }else{
215
            }else{
Line 303... Line 262...
303
			// TODO Auto-generated catch block
262
			// TODO Auto-generated catch block
304
			e.printStackTrace();
263
			e.printStackTrace();
305
		}
264
		}
306
	}
265
	}
307
	
266
	
-
 
267
	//
-
 
268
	private static void generatePdfInvoice(InvoiceModel model, OutputStream outputStream) {
-
 
269
		Document document = new Document();
-
 
270
		document.setMargins(0, 0, 25, 0);
-
 
271
		
-
 
272
	}
-
 
273
	
308
	private static String toAmountInWords(float amount){
274
	private static String toAmountInWords(float amount){
309
		RuleBasedNumberFormat amountInWordsFormat = new RuleBasedNumberFormat(indianLocale, RuleBasedNumberFormat.SPELLOUT);
275
		RuleBasedNumberFormat amountInWordsFormat = new RuleBasedNumberFormat(indianLocale, RuleBasedNumberFormat.SPELLOUT);
310
       	StringBuilder amountInWords = new StringBuilder("Rs. ");
276
       	StringBuilder amountInWords = new StringBuilder("Rs. ");
311
        amountInWords.append(StringUtils.capitalize(amountInWordsFormat.format((int)amount)));
277
        amountInWords.append(StringUtils.capitalize(amountInWordsFormat.format((int)amount)));
312
       	amountInWords.append(" and ");
278
       	amountInWords.append(" and ");