Subversion Repositories SmartDukaan

Rev

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

Rev 20945 Rev 20946
Line 1087... Line 1087...
1087
 
1087
 
1088
	private PdfPTable getTopInvoiceTable(List<Order> orderList, String tinNo, String invoiceFormat){
1088
	private PdfPTable getTopInvoiceTable(List<Order> orderList, String tinNo, String invoiceFormat){
1089
		PdfPTable invoiceTable = new PdfPTable(new float[]{0.2f, 0.2f, 0.3f, 0.1f, 0.1f, 0.1f});
1089
		PdfPTable invoiceTable = new PdfPTable(new float[]{0.2f, 0.2f, 0.3f, 0.1f, 0.1f, 0.1f});
1090
		invoiceTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
1090
		invoiceTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
1091
 
1091
 
1092
		invoiceTable.addCell(getInvoiceTableHeader(6,orderList.get(0).getLogisticsTransactionId()));
1092
		invoiceTable.addCell(getInvoiceTableHeader(5,orderList.get(0).getLogisticsTransactionId()));
1093
		if("Bulk".equalsIgnoreCase(invoiceFormat)){
1093
		if("Bulk".equalsIgnoreCase(invoiceFormat)){
1094
			invoiceTable.addCell(new Phrase("Sr No", helvetica8));
1094
			invoiceTable.addCell(new Phrase("Sr No", helvetica8));
1095
		}else{
1095
		}else{
1096
			invoiceTable.addCell(new Phrase("Order No", helvetica8));
1096
			invoiceTable.addCell(new Phrase("Order No", helvetica8));
1097
		}
1097
		}
Line 1168... Line 1168...
1168
			
1168
			
1169
		}else{
1169
		}else{
1170
			for(Order order : orderList){
1170
			for(Order order : orderList){
1171
				populateTopInvoiceTable(order, invoiceTable);
1171
				populateTopInvoiceTable(order, invoiceTable);
1172
				if(order.getInsurer() > 0) {
1172
				if(order.getInsurer() > 0) {
1173
					invoiceTable.addCell(getInsuranceCell(4));
1173
					invoiceTable.addCell(getInsuranceCell(3));
1174
					invoiceTable.addCell(getPriceCell(order.getInsuranceAmount()));
1174
					invoiceTable.addCell(getPriceCell(order.getInsuranceAmount()));
1175
					invoiceTable.addCell(getPriceCell(order.getInsuranceAmount()));
1175
					invoiceTable.addCell(getPriceCell(order.getInsuranceAmount()));
1176
				}
1176
				}
1177
 
1177
 
1178
				if(order.getSource() == OrderSource.STORE.getValue()) {
1178
				if(order.getSource() == OrderSource.STORE.getValue()) {
1179
					invoiceTable.addCell(getAdvanceAmountCell(4));
1179
					invoiceTable.addCell(getAdvanceAmountCell(3));
1180
					invoiceTable.addCell(getPriceCell(order.getAdvanceAmount()));
1180
					invoiceTable.addCell(getPriceCell(order.getAdvanceAmount()));
1181
					invoiceTable.addCell(getPriceCell(order.getAdvanceAmount()));
1181
					invoiceTable.addCell(getPriceCell(order.getAdvanceAmount()));
1182
				}
1182
				}
1183
				if(order.getInsurer() > 0) {
1183
				if(order.getInsurer() > 0) {
1184
					insuranceAmount =insuranceAmount + order.getInsuranceAmount();
1184
					insuranceAmount =insuranceAmount + order.getInsuranceAmount();
Line 1191... Line 1191...
1191
				totalGvAmount = totalGvAmount + order.getGvAmount();
1191
				totalGvAmount = totalGvAmount + order.getGvAmount();
1192
				totalWalletAmount = totalWalletAmount + order.getWallet_amount();
1192
				totalWalletAmount = totalWalletAmount + order.getWallet_amount();
1193
			}
1193
			}
1194
		}
1194
		}
1195
		if(insuranceAmount>0){
1195
		if(insuranceAmount>0){
1196
			invoiceTable.addCell(getInsuranceCell(4));
1196
			invoiceTable.addCell(getInsuranceCell(3));
1197
			invoiceTable.addCell(getPriceCell(insuranceAmount));
1197
			invoiceTable.addCell(getPriceCell(insuranceAmount));
1198
			invoiceTable.addCell(getPriceCell(insuranceAmount));
1198
			invoiceTable.addCell(getPriceCell(insuranceAmount));
1199
		}
1199
		}
1200
		if(advanceAmount>0){
1200
		if(advanceAmount>0){
1201
			invoiceTable.addCell(getAdvanceAmountCell(4));
1201
			invoiceTable.addCell(getAdvanceAmountCell(3));
1202
			invoiceTable.addCell(getPriceCell(advanceAmount));
1202
			invoiceTable.addCell(getPriceCell(advanceAmount));
1203
			invoiceTable.addCell(getPriceCell(advanceAmount));
1203
			invoiceTable.addCell(getPriceCell(advanceAmount));
1204
		}
1204
		}
1205
		if(totalShippingCost>0){
1205
		if(totalShippingCost>0){
1206
			invoiceTable.addCell(getShippingCostCell(4));      
1206
			invoiceTable.addCell(getShippingCostCell(3));      
1207
			invoiceTable.addCell(getRupeesCell(false));
1207
			invoiceTable.addCell(getRupeesCell(false));
1208
			invoiceTable.addCell(getPriceCell(totalShippingCost));
1208
			invoiceTable.addCell(getPriceCell(totalShippingCost));
1209
		}
1209
		}
1210
		if(totalGvAmount>0){
1210
		if(totalGvAmount>0){
1211
			totalGvAmount = 0-totalGvAmount;
1211
			totalGvAmount = 0-totalGvAmount;
1212
			invoiceTable.addCell(getGvAmountCell(4));      
1212
			invoiceTable.addCell(getGvAmountCell(3));      
1213
			invoiceTable.addCell(getRupeesCell(false));
1213
			invoiceTable.addCell(getRupeesCell(false));
1214
			invoiceTable.addCell(getPriceCell(totalGvAmount));
1214
			invoiceTable.addCell(getPriceCell(totalGvAmount));
1215
		}
1215
		}
1216
		if(totalWalletAmount>0){
1216
		if(totalWalletAmount>0){
1217
			totalWalletAmount = 0-totalWalletAmount;
1217
			totalWalletAmount = 0-totalWalletAmount;
1218
			invoiceTable.addCell(getGvAmountCell(4));      
1218
			invoiceTable.addCell(getGvAmountCell(3));      
1219
			invoiceTable.addCell(getRupeesCell(false));
1219
			invoiceTable.addCell(getRupeesCell(false));
1220
			invoiceTable.addCell(getPriceCell(totalWalletAmount));
1220
			invoiceTable.addCell(getPriceCell(totalWalletAmount));
1221
		}
1221
		}
1222
		
1222
		
1223
		invoiceTable.addCell(getTotalCell(4));      
1223
		invoiceTable.addCell(getTotalCell(3));      
1224
		invoiceTable.addCell(getRupeesCell(true));
1224
		invoiceTable.addCell(getRupeesCell(true));
1225
		invoiceTable.addCell(getTotalAmountCell(totalAmount+totalShippingCost));
1225
		invoiceTable.addCell(getTotalAmountCell(totalAmount+totalShippingCost));
1226
		
1226
		
1227
 
1227
 
1228
		PdfPCell tinCell = new PdfPCell(new Phrase("TIN NO. " + tinNo, helvetica8));
1228
		PdfPCell tinCell = new PdfPCell(new Phrase("TIN NO. " + tinNo, helvetica8));
1229
		tinCell.setColspan(6);
1229
		tinCell.setColspan(5);
1230
		tinCell.setPadding(2);
1230
		tinCell.setPadding(2);
1231
		invoiceTable.addCell(tinCell);
1231
		invoiceTable.addCell(tinCell);
1232
 
1232
 
1233
		return invoiceTable;
1233
		return invoiceTable;
1234
	}
1234
	}