Subversion Repositories SmartDukaan

Rev

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

Rev 12629 Rev 14072
Line 38... Line 38...
38
    private String contactPhone;
38
    private String contactPhone;
39
    private String contactFax;
39
    private String contactFax;
40
    private String contactEmail;
40
    private String contactEmail;
41
    private String registeredAddress;
41
    private String registeredAddress;
42
    private long stateId;
42
    private long stateId;
-
 
43
    private long poValidityLimit;
43
    private String communicationAddress;
44
    private String communicationAddress;
44
    private List<Long> billingWarehouseIds;
45
    private List<Long> billingWarehouseIds;
45
    
46
    
46
    private String id;
47
    private String id;
47
    private List<Supplier> suppliers;
48
    private List<Supplier> suppliers;
Line 117... Line 118...
117
        		throw new Exception("Atleast One Billing Warehouse is Mandatory.");
118
        		throw new Exception("Atleast One Billing Warehouse is Mandatory.");
118
        	}
119
        	}
119
        	if(stateId == -1){
120
        	if(stateId == -1){
120
        		throw new Exception("State is Mandatory. Please select state");
121
        		throw new Exception("State is Mandatory. Please select state");
121
        	}
122
        	}
-
 
123
        	if(poValidityLimit < 1){
-
 
124
        		throw new Exception("PO Validity Limit Must be greater than equal to 1.");
-
 
125
        	}
122
            Supplier supplier = new Supplier();
126
            Supplier supplier = new Supplier();
123
            name = name.trim();
127
            name = name.trim();
124
            supplier.setName(name);
128
            supplier.setName(name);
125
            supplier.setCommunicationAddress(communicationAddress);
129
            supplier.setCommunicationAddress(communicationAddress);
126
            supplier.setContactEmail(contactEmail);
130
            supplier.setContactEmail(contactEmail);
Line 134... Line 138...
134
            supplier.setPan(pan);
138
            supplier.setPan(pan);
135
            supplier.setPhone(phone);
139
            supplier.setPhone(phone);
136
            supplier.setRegisteredAddress(registeredAddress);
140
            supplier.setRegisteredAddress(registeredAddress);
137
            supplier.setTin(tin);
141
            supplier.setTin(tin);
138
            supplier.setStateId(stateId);
142
            supplier.setStateId(stateId);
-
 
143
            supplier.setPoValidityLimit(poValidityLimit);
139
            Client purchaseClient = new PurchaseClient().getClient();
144
            Client purchaseClient = new PurchaseClient().getClient();
140
            supplier = purchaseClient.addSupplier(supplier);
145
            supplier = purchaseClient.addSupplier(supplier);
141
            
146
            
142
            in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = new InventoryClient(ConfigClientKeys.inventory_service_server_host.toString(),
147
            in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = new InventoryClient(ConfigClientKeys.inventory_service_server_host.toString(),
143
                    ConfigClientKeys.inventory_service_server_port.toString()).getClient();
148
                    ConfigClientKeys.inventory_service_server_port.toString()).getClient();
Line 204... Line 209...
204
            supplier.setPan(pan);
209
            supplier.setPan(pan);
205
            supplier.setPhone(phone);
210
            supplier.setPhone(phone);
206
            supplier.setRegisteredAddress(registeredAddress);
211
            supplier.setRegisteredAddress(registeredAddress);
207
            supplier.setTin(tin);
212
            supplier.setTin(tin);
208
            supplier.setStateId(stateId);
213
            supplier.setStateId(stateId);
-
 
214
            supplier.setPoValidityLimit(poValidityLimit);
209
            purchaseClient.updateSupplier(supplier);
215
            purchaseClient.updateSupplier(supplier);
210
        } catch (Exception e) {
216
        } catch (Exception e) {
211
            errorMessage = "Error updating supplier: " + supplierName + ": " + e.getMessage();
217
            errorMessage = "Error updating supplier: " + supplierName + ": " + e.getMessage();
212
            logger.error("Error updating supplier", e);
218
            logger.error("Error updating supplier", e);
213
        }
219
        }
Line 345... Line 351...
345
	}
351
	}
346
 
352
 
347
	public void setStateId(long stateId) {
353
	public void setStateId(long stateId) {
348
		this.stateId = stateId;
354
		this.stateId = stateId;
349
	}
355
	}
-
 
356
 
-
 
357
	public long getPoValidityLimit() {
-
 
358
		return poValidityLimit;
-
 
359
	}
-
 
360
 
-
 
361
	public void setPoValidityLimit(long poValidityLimit) {
-
 
362
		this.poValidityLimit = poValidityLimit;
-
 
363
	}
350
    
364
    
351
}
365
}