Subversion Repositories SmartDukaan

Rev

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

Rev 22891 Rev 23001
Line 1... Line 1...
1
package com.spice.profitmandi.common.util;
1
package com.spice.profitmandi.common.util;
2
 
2
 
3
 
3
 
4
import java.io.OutputStream;
4
import java.io.OutputStream;
-
 
5
import java.util.List;
5
import java.util.Locale;
6
import java.util.Locale;
6
import java.util.Set;
7
import java.util.Set;
7
 
8
 
8
import org.slf4j.Logger;
9
import org.slf4j.Logger;
9
import org.slf4j.LoggerFactory;
10
import org.slf4j.LoggerFactory;
Line 19... Line 20...
19
import com.itextpdf.text.Rectangle;
20
import com.itextpdf.text.Rectangle;
20
import com.itextpdf.text.pdf.PdfPCell;
21
import com.itextpdf.text.pdf.PdfPCell;
21
import com.itextpdf.text.pdf.PdfPTable;
22
import com.itextpdf.text.pdf.PdfPTable;
22
import com.itextpdf.text.pdf.PdfWriter;
23
import com.itextpdf.text.pdf.PdfWriter;
23
import com.spice.profitmandi.common.model.CustomCustomer;
24
import com.spice.profitmandi.common.model.CustomCustomer;
24
import com.spice.profitmandi.common.model.CustomOrderItem;
-
 
25
import com.spice.profitmandi.common.model.CustomInsurancePolicy;
25
import com.spice.profitmandi.common.model.CustomInsurancePolicy;
-
 
26
import com.spice.profitmandi.common.model.CustomOrderItem;
26
import com.spice.profitmandi.common.model.CustomRetailer;
27
import com.spice.profitmandi.common.model.CustomRetailer;
27
import com.spice.profitmandi.common.model.PdfModel;
28
import com.spice.profitmandi.common.model.PdfModel;
28
 
29
 
29
public class PdfUtils {
30
public class PdfUtils {
30
	
31
	
Line 241... Line 242...
241
           	amountInWordsTable.addCell(new Paragraph(amountInWords.toString(), FONT_BOLD));
242
           	amountInWordsTable.addCell(new Paragraph(amountInWords.toString(), FONT_BOLD));
242
            amountInWordsTable.addCell(new Paragraph("E & O.E", FONT_NORMAL));
243
            amountInWordsTable.addCell(new Paragraph("E & O.E", FONT_NORMAL));
243
            document.add(amountInWordsTable);            
244
            document.add(amountInWordsTable);            
244
            
245
            
245
            StringBuffer sb = new StringBuffer();
246
            StringBuffer sb = new StringBuffer();
246
            sb.append("I agree that goods received are in good working condition");
247
            List<String> tncs = pdfModel.getTncs();
247
            sb.append("\nGoods once sold cannot be exchanged or taken back");
248
            for (String tnc: tncs){
248
            sb.append("\nWarranty for the goods received by me is the responsibility of the manufacturer only.");
-
 
249
            if(pdfModel.getInsurancePolicies() != null && pdfModel.getInsurancePolicies().size() > 0) {
-
 
250
            	sb.append("\nDamage protection provided is the responisibility of Protection Provider only");
249
            	sb.append(tnc).append("\n");
251
            }
250
            }
-
 
251
            
252
            Paragraph warningParagraph = new Paragraph(sb.toString(), FONT_NORMAL);
252
            Paragraph warningParagraph = new Paragraph(sb.toString(), FONT_NORMAL);
253
            warningParagraph.setIndentationLeft(40);
253
            warningParagraph.setIndentationLeft(40);
254
            document.add(Chunk.NEWLINE);
254
            document.add(Chunk.NEWLINE);
255
            document.add(warningParagraph);
255
            document.add(warningParagraph);
256
            
256