Subversion Repositories SmartDukaan

Rev

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

Rev 21879 Rev 23081
Line 51... Line 51...
51
    private long stateId;
51
    private long stateId;
52
    private String stateIdVal;
52
    private String stateIdVal;
53
    private long poValidityLimit;
53
    private long poValidityLimit;
54
    private String communicationAddress;
54
    private String communicationAddress;
55
    private List<Long> billingWarehouseIds;
55
    private List<Long> billingWarehouseIds;
-
 
56
    private String tnc;
56
    
57
    
57
    private String id;
58
    private String id;
58
    private List<Supplier> suppliers;
59
    private List<Supplier> suppliers;
59
    private String errorMessage = "";
60
    private String errorMessage = "";
60
    private Supplier supplier;
61
    private Supplier supplier;
Line 118... Line 119...
118
        		throw new Exception("Supplier Communication Address is Mandatory.");
119
        		throw new Exception("Supplier Communication Address is Mandatory.");
119
        	}
120
        	}
120
        	if(billingWarehouseIds==null || billingWarehouseIds.size()==0){
121
        	if(billingWarehouseIds==null || billingWarehouseIds.size()==0){
121
        		throw new Exception("Atleast One Billing Warehouse is Mandatory.");
122
        		throw new Exception("Atleast One Billing Warehouse is Mandatory.");
122
        	}
123
        	}
-
 
124
        	if(billingWarehouseIds==null || billingWarehouseIds.size()==0){
-
 
125
        		throw new Exception("Atleast One Billing Warehouse is Mandatory.");
-
 
126
        	}
123
        	if(stateId == -1){
127
        	if(stateId == -1){
124
        		throw new Exception("State is Mandatory. Please select state");
128
        		throw new Exception("State is Mandatory. Please select state");
125
        	}
129
        	}
126
        	if(poValidityLimit < 1){
130
        	if(poValidityLimit < 1){
127
        		throw new Exception("PO Validity Limit Must be greater than equal to 1.");
131
        		throw new Exception("PO Validity Limit Must be greater than equal to 1.");
Line 143... Line 147...
143
            supplier.setRegisteredAddress(registeredAddress);
147
            supplier.setRegisteredAddress(registeredAddress);
144
            //supplier.setTin(tin);
148
            //supplier.setTin(tin);
145
            supplier.setGstin(gstin);
149
            supplier.setGstin(gstin);
146
            supplier.setStateId(stateId);
150
            supplier.setStateId(stateId);
147
            supplier.setPoValidityLimit(poValidityLimit);
151
            supplier.setPoValidityLimit(poValidityLimit);
-
 
152
            supplier.setTnc(tnc);
148
            Client purchaseClient = new PurchaseClient().getClient();
153
            Client purchaseClient = new PurchaseClient().getClient();
149
            supplier = purchaseClient.addSupplier(supplier);
154
            supplier = purchaseClient.addSupplier(supplier);
150
            
155
            
151
            in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = new InventoryClient(ConfigClientKeys.inventory_service_server_host.toString(),
156
            in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = new InventoryClient(ConfigClientKeys.inventory_service_server_host.toString(),
152
                    ConfigClientKeys.inventory_service_server_port.toString()).getClient();
157
                    ConfigClientKeys.inventory_service_server_port.toString()).getClient();
Line 212... Line 217...
212
            supplier.setHeadEmail(headEmail);
217
            supplier.setHeadEmail(headEmail);
213
            supplier.setHeadName(headName);
218
            supplier.setHeadName(headName);
214
            supplier.setPan(pan);
219
            supplier.setPan(pan);
215
            supplier.setRegisteredAddress(registeredAddress);
220
            supplier.setRegisteredAddress(registeredAddress);
216
            supplier.setGstin(gstin);
221
            supplier.setGstin(gstin);
-
 
222
            supplier.setTnc(tnc);
217
            supplier.setStateId(supplier.getStateId());
223
            supplier.setStateId(supplier.getStateId());
218
            supplier.setPoValidityLimit(poValidityLimit);
224
            supplier.setPoValidityLimit(poValidityLimit);
219
            purchaseClient.updateSupplier(supplier);
225
            purchaseClient.updateSupplier(supplier);
220
            Utils.resetSuppliers();
226
            Utils.resetSuppliers();
221
        } catch (Exception e) {
227
        } catch (Exception e) {
Line 370... Line 376...
370
	}
376
	}
371
 
377
 
372
	public void setStateIdVal(String stateIdVal) {
378
	public void setStateIdVal(String stateIdVal) {
373
		this.stateIdVal = stateIdVal;
379
		this.stateIdVal = stateIdVal;
374
	}
380
	}
-
 
381
 
-
 
382
	public void setTnc(String tnc) {
-
 
383
		this.tnc = tnc;
-
 
384
	}
-
 
385
 
-
 
386
	public String getTnc() {
-
 
387
		return tnc;
-
 
388
	}
375
    
389
    
376
}
390
}