| Line 32... |
Line 32... |
| 32 |
private String receivedFrom;
|
32 |
private String receivedFrom;
|
| 33 |
private String supplierId;
|
33 |
private String supplierId;
|
| 34 |
private String numItems;
|
34 |
private String numItems;
|
| 35 |
private Long warehouseId;
|
35 |
private Long warehouseId;
|
| 36 |
private String invoiceDate;
|
36 |
private String invoiceDate;
|
| 37 |
private SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
|
37 |
private SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
|
| 38 |
private Map<Long, Supplier> suppliers = new HashMap<Long, Supplier>();
|
38 |
private Map<Long, Supplier> suppliers = new HashMap<Long, Supplier>();
|
| 39 |
|
39 |
|
| 40 |
/*
|
40 |
/*
|
| 41 |
* (non-Javadoc)
|
41 |
* (non-Javadoc)
|
| 42 |
*
|
42 |
*
|
| Line 86... |
Line 86... |
| 86 |
if(!isAutorizedToAccessWarehouse(warehouseId)){
|
86 |
if(!isAutorizedToAccessWarehouse(warehouseId)){
|
| 87 |
logger.error("Unauthorized Access for WarehouseId " + warehouseId + " by " + SecurityUtils.getSubject().getPrincipal().toString());
|
87 |
logger.error("Unauthorized Access for WarehouseId " + warehouseId + " by " + SecurityUtils.getSubject().getPrincipal().toString());
|
| 88 |
addActionError("Unauthorized Access for WarehouseId " + warehouseId);
|
88 |
addActionError("Unauthorized Access for WarehouseId " + warehouseId);
|
| 89 |
return EDIT_NEW;
|
89 |
return EDIT_NEW;
|
| 90 |
}
|
90 |
}
|
| - |
|
91 |
long currentTime = sdf.parse(sdf.format(new Date())).getTime();
|
| - |
|
92 |
if(currentTime !=sdf.parse(date).getTime()){
|
| - |
|
93 |
logger.error("Invoice Receive Date Must be equal to Today's Date");
|
| - |
|
94 |
addActionError("Invoice Receive Date Must be equal to Today's Date");
|
| - |
|
95 |
return EDIT_NEW;
|
| - |
|
96 |
}
|
| 91 |
Client purchaseClient = new PurchaseClient().getClient();
|
97 |
Client purchaseClient = new PurchaseClient().getClient();
|
| 92 |
if(!purchaseClient.isInvoiceReceived(invoiceNumber, Long.parseLong(supplierId))) {
|
98 |
if(!purchaseClient.isInvoiceReceived(invoiceNumber, Long.parseLong(supplierId))) {
|
| 93 |
Invoice invoice = new Invoice();
|
99 |
Invoice invoice = new Invoice();
|
| 94 |
invoice.setInvoiceNumber(invoiceNumber);
|
100 |
invoice.setInvoiceNumber(invoiceNumber);
|
| 95 |
invoice.setDate(sdf.parse(date).getTime());
|
101 |
invoice.setDate(sdf.parse(date).getTime());
|