Subversion Repositories SmartDukaan

Rev

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

Rev 3065 Rev 3132
Line 8... Line 8...
8
import in.shop2020.model.v1.catalog.Warehouse;
8
import in.shop2020.model.v1.catalog.Warehouse;
9
import in.shop2020.model.v1.catalog.InventoryService.Client;
9
import in.shop2020.model.v1.catalog.InventoryService.Client;
10
import in.shop2020.model.v1.order.LineItem;
10
import in.shop2020.model.v1.order.LineItem;
11
import in.shop2020.model.v1.order.Order;
11
import in.shop2020.model.v1.order.Order;
12
import in.shop2020.model.v1.order.TransactionServiceException;
12
import in.shop2020.model.v1.order.TransactionServiceException;
13
import in.shop2020.thrift.clients.CatalogServiceClient;
13
import in.shop2020.thrift.clients.CatalogClient;
14
import in.shop2020.thrift.clients.LogisticsServiceClient;
14
import in.shop2020.thrift.clients.LogisticsClient;
15
import in.shop2020.thrift.clients.TransactionServiceClient;
15
import in.shop2020.thrift.clients.TransactionClient;
16
import in.shop2020.thrift.clients.config.ConfigClient;
16
import in.shop2020.thrift.clients.config.ConfigClient;
17
 
17
 
18
import java.io.ByteArrayOutputStream;
18
import java.io.ByteArrayOutputStream;
19
import java.io.File;
19
import java.io.File;
20
import java.io.FileOutputStream;
20
import java.io.FileOutputStream;
Line 92... Line 92...
92
 
92
 
93
class InvoiceGenerationService {
93
class InvoiceGenerationService {
94
    
94
    
95
    private static Logger logger = LoggerFactory.getLogger(InvoiceGenerationService.class);
95
    private static Logger logger = LoggerFactory.getLogger(InvoiceGenerationService.class);
96
    
96
    
97
    private TransactionServiceClient tsc = null;
97
    private TransactionClient tsc = null;
98
    private CatalogServiceClient csc = null;
98
    private CatalogClient csc = null;
99
    private LogisticsServiceClient lsc = null;
99
    private LogisticsClient lsc = null;
100
    
100
    
101
    private static Locale indianLocale = new Locale("en", "IN");
101
    private static Locale indianLocale = new Locale("en", "IN");
102
    private DecimalFormat amountFormat = new DecimalFormat("#,##0.00");
102
    private DecimalFormat amountFormat = new DecimalFormat("#,##0.00");
103
 
103
 
104
    private static final Font helvetica8 = FontFactory.getFont(FontFactory.HELVETICA, 8);
104
    private static final Font helvetica8 = FontFactory.getFont(FontFactory.HELVETICA, 8);
Line 133... Line 133...
133
        return props;
133
        return props;
134
    }
134
    }
135
    
135
    
136
    public InvoiceGenerationService() {
136
    public InvoiceGenerationService() {
137
        try {
137
        try {
138
            tsc = new TransactionServiceClient();
138
            tsc = new TransactionClient();
139
            csc = new CatalogServiceClient();
139
            csc = new CatalogClient();
140
            lsc = new LogisticsServiceClient();
140
            lsc = new LogisticsClient();
141
        } catch (Exception e) {
141
        } catch (Exception e) {
142
            logger.error("Error while instantiating thrift clients.", e);
142
            logger.error("Error while instantiating thrift clients.", e);
143
        }
143
        }
144
    }
144
    }
145
 
145