Subversion Repositories SmartDukaan

Rev

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

Rev 9586 Rev 9591
Line 102... Line 102...
102
        poTable.addCell(poTitleCell);
102
        poTable.addCell(poTitleCell);
103
        poTable.addCell(getAddressCell(purchaseOrder.getWarehouseId()));
103
        poTable.addCell(getAddressCell(purchaseOrder.getWarehouseId()));
104
        poTable.addCell(poSummaryTable);
104
        poTable.addCell(poSummaryTable);
105
        poTable.addCell(getSalutationTable(supplier));
105
        poTable.addCell(getSalutationTable(supplier));
106
        poTable.addCell(getPoDetailsTable(purchaseOrder));
106
        poTable.addCell(getPoDetailsTable(purchaseOrder));
107
        poTable.addCell(getBillToTable(purchaseOrder.getWarehouseId()));
107
        poTable.addCell(getBillToTable(purchaseOrder.getWarehouseId(), purchaseOrder.getTaxType()));
108
        poTable.addCell(getCFormCell(purchaseOrder.getTaxType()));
108
        //poTable.addCell(getCFormCell(purchaseOrder.getTaxType()));
109
 
109
 
110
        return poTable;
110
        return poTable;
111
    }
111
    }
112
 
112
 
113
    private static PdfPCell getCFormCell(TaxType taxType) {
113
    private static PdfPCell getCFormCell(TaxType taxType) {
Line 175... Line 175...
175
        return salutationTable;
175
        return salutationTable;
176
    }
176
    }
177
 
177
 
178
    private static PdfPTable getPoDetailsTable(PurchaseOrder purchaseOrder) {
178
    private static PdfPTable getPoDetailsTable(PurchaseOrder purchaseOrder) {
179
        PdfPTable detailsTable = new PdfPTable(new float[] { 0.1f, 0.5f, 0.1f,
179
        PdfPTable detailsTable = new PdfPTable(new float[] { 0.1f, 0.5f, 0.1f,
180
                0.2f, 0.2f });
180
                0.1f, 0.15f, 0.15f });
181
        detailsTable.addCell(new Phrase("Sl. No.", helveticaBold8));
181
        detailsTable.addCell(new Phrase("Sl. No.", helveticaBold8));
182
        detailsTable.addCell(new Phrase("Description", helveticaBold8));
182
        detailsTable.addCell(new Phrase("Description", helveticaBold8));
183
        detailsTable.addCell(new Phrase("Quantity", helveticaBold8));
183
        detailsTable.addCell(new Phrase("Quantity", helveticaBold8));
-
 
184
        detailsTable.addCell(new Phrase("Mrp", helveticaBold8));
184
        detailsTable.addCell(new Phrase("Rate (Rs)", helveticaBold8));
185
        detailsTable.addCell(new Phrase("Rate (Rs)", helveticaBold8));
185
        detailsTable.addCell(new Phrase("Amount (Rs)", helveticaBold8));
186
        detailsTable.addCell(new Phrase("Amount (Rs)", helveticaBold8));
186
 
187
 
187
        int slNo = 0;
188
        int slNo = 0;
188
        double total = 0;
189
        double total = 0;
Line 191... Line 192...
191
            slNo++;
192
            slNo++;
192
            detailsTable.addCell(new Phrase(slNo + "", helvetica8));
193
            detailsTable.addCell(new Phrase(slNo + "", helvetica8));
193
            detailsTable.addCell(getProductNameCell(lineitem));
194
            detailsTable.addCell(getProductNameCell(lineitem));
194
            detailsTable.addCell(new Phrase(lineitem.getQuantity() + "",
195
            detailsTable.addCell(new Phrase(lineitem.getQuantity() + "",
195
                    helvetica8));
196
                    helvetica8));
-
 
197
            detailsTable.addCell(new Phrase(lineitem.getMrp() + "",
-
 
198
                    helvetica8));
196
            detailsTable.addCell(new Phrase(lineitem.getUnitPrice() + "",
199
            detailsTable.addCell(new Phrase(lineitem.getUnitPrice() + "",
197
                    helvetica8));
200
                    helvetica8));
198
            double lineTotal = lineitem.getQuantity() * lineitem.getUnitPrice();
201
            double lineTotal = lineitem.getQuantity() * lineitem.getUnitPrice();
199
            total += lineTotal;
202
            total += lineTotal;
200
            detailsTable.addCell(new Phrase("" + lineTotal, helvetica8));
203
            detailsTable.addCell(new Phrase("" + lineTotal, helvetica8));
Line 202... Line 205...
202
        detailsTable.addCell(getTotalCell(4));
205
        detailsTable.addCell(getTotalCell(4));
203
        detailsTable.addCell(new Phrase("" + total, helvetica8));
206
        detailsTable.addCell(new Phrase("" + total, helvetica8));
204
        return detailsTable;
207
        return detailsTable;
205
    }
208
    }
206
 
209
 
207
    private static PdfPTable getBillToTable(long warehouseId) {
210
    private static PdfPTable getBillToTable(long warehouseId, TaxType taxType) {
208
    	//TODO Write this code in a proper configurable way
211
    	//TODO Write this code in a proper configurable way
209
    	String address = "";
212
    	String address = "";
210
    	String tinNo = "";
213
    	String tinNo = "";
211
    	String contactPerson = "";
214
    	String contactPerson = "";
212
    	if(warehouseId ==7) {
215
    	if(warehouseId ==7) {
Line 236... Line 239...
236
 
239
 
237
        billToTable.addCell(new Phrase("Contact Person:", helvetica8));
240
        billToTable.addCell(new Phrase("Contact Person:", helvetica8));
238
        billToTable.addCell(new Phrase(contactPerson, helvetica8));
241
        billToTable.addCell(new Phrase(contactPerson, helvetica8));
239
 
242
 
240
        billToTable.addCell(new Phrase("Taxes:", helvetica8));
243
        billToTable.addCell(new Phrase("Taxes:", helvetica8));
-
 
244
        if(taxType == TaxType.CFORM) {
-
 
245
        	billToTable.addCell(new Phrase("Prices inclusive of all taxes (To be billed on CST Against C-Form)",
-
 
246
        			helvetica8));
-
 
247
        } else {
241
        billToTable.addCell(new Phrase("Prices inclusive of all taxes",
248
        	billToTable.addCell(new Phrase("Prices inclusive of all taxes",
242
                helvetica8));
249
        			helvetica8));
-
 
250
        }
243
 
251
 
244
        return billToTable;
252
        return billToTable;
245
    }
253
    }
246
 
254
 
247
    private static PdfPCell getProductNameCell(
255
    private static PdfPCell getProductNameCell(