Subversion Repositories SmartDukaan

Rev

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

Rev 31065 Rev 31067
Line 976... Line 976...
976
		pdfModel.setAuther("SmartDukaan");
976
		pdfModel.setAuther("SmartDukaan");
977
		pdfModel.setInvoiceDate(FormattingUtils.formatDate(fofoOrder.getCreateTimestamp()));
977
		pdfModel.setInvoiceDate(FormattingUtils.formatDate(fofoOrder.getCreateTimestamp()));
978
 
978
 
979
		// insurance calculation
979
		// insurance calculation
980
		List<InsurancePolicy> insurancePolicies = insurancePolicyRepository
980
		List<InsurancePolicy> insurancePolicies = insurancePolicyRepository
981
				.selectByRetailerIdDeviceInvoiceNumber(fofoOrder.getFofoId(), fofoOrder.getInvoiceNumber());
981
				.selectByRetailerIdInvoiceNumber(fofoOrder.getFofoId(), fofoOrder.getInvoiceNumber());
982
		Set<CustomInsurancePolicy> customInsurancePolicies = new HashSet<>();
982
		Set<CustomInsurancePolicy> customInsurancePolicies = new HashSet<>();
983
		final float totalInsuranceTaxRate = 18;
983
		final float totalInsuranceTaxRate = 18;
984
		for (InsurancePolicy insurancePolicy : insurancePolicies) {
984
		for (InsurancePolicy insurancePolicy : insurancePolicies) {
985
			float taxableInsurancePrice = insurancePolicy.getSaleAmount() / (1 + totalInsuranceTaxRate / 100);
985
			float taxableInsurancePrice = insurancePolicy.getSaleAmount() / (1 + totalInsuranceTaxRate / 100);
986
			CustomInsurancePolicy customInsurancePolicy = new CustomInsurancePolicy();
986
			CustomInsurancePolicy customInsurancePolicy = new CustomInsurancePolicy();
Line 1079... Line 1079...
1079
	}
1079
	}
1080
 
1080
 
1081
	@Override
1081
	@Override
1082
	public InvoicePdfModel getInsuranceInvoicePdfModel(int fofoId, int orderId) throws ProfitMandiBusinessException {
1082
	public InvoicePdfModel getInsuranceInvoicePdfModel(int fofoId, int orderId) throws ProfitMandiBusinessException {
1083
		FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndOrderId(fofoId, orderId);
1083
		FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndOrderId(fofoId, orderId);
1084
		return this.getInsuranceInvoicePdfModel(fofoOrder);
1084
		return this.getInvoicePdfModel(fofoId, orderId);
1085
	}
1085
	}
1086
 
1086
 
1087
	public String getBillingAddress(CustomerAddress customerAddress) {
1087
	public String getBillingAddress(CustomerAddress customerAddress) {
1088
		StringBuilder address = new StringBuilder();
1088
		StringBuilder address = new StringBuilder();
1089
		if ((customerAddress.getLine1() != null) && (!customerAddress.getLine1().isEmpty())) {
1089
		if ((customerAddress.getLine1() != null) && (!customerAddress.getLine1().isEmpty())) {