Subversion Repositories SmartDukaan

Rev

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

Rev 21847 Rev 21873
Line 1... Line 1...
1
/**
1
/**
2
 * 
2
 * 
3
 */
3
 */
4
package in.shop2020.inventory.controllers;
4
package in.shop2020.inventory.controllers;
5
 
5
 
-
 
6
import in.shop2020.inventory.utils.Utils;
6
import in.shop2020.model.v1.inventory.BillingType;
7
import in.shop2020.model.v1.inventory.BillingType;
7
import in.shop2020.model.v1.inventory.InventoryType;
8
import in.shop2020.model.v1.inventory.InventoryType;
8
import in.shop2020.model.v1.inventory.Vendor;
9
import in.shop2020.model.v1.inventory.Vendor;
9
import in.shop2020.model.v1.inventory.Warehouse;
10
import in.shop2020.model.v1.inventory.Warehouse;
10
import in.shop2020.model.v1.inventory.WarehouseType;
11
import in.shop2020.model.v1.inventory.WarehouseType;
Line 189... Line 190...
189
	            warehouse.setTransferDelayInHours(24);
190
	            warehouse.setTransferDelayInHours(24);
190
	            warehouse.setBillingType(null);
191
	            warehouse.setBillingType(null);
191
	            warehouse.setBillingWarehouseId(0);
192
	            warehouse.setBillingWarehouseId(0);
192
	            warehouse.setShippingWarehouseId(0);
193
	            warehouse.setShippingWarehouseId(0);
193
	            inventoryClient.addWarehouse(warehouse);
194
	            inventoryClient.addWarehouse(warehouse);
-
 
195
	            Utils.resetSuppliers();
194
            }
196
            }
195
        } catch (Exception e) {
197
        } catch (Exception e) {
196
            errorMessage = "Error creating supplier: " + e.getMessage();
198
            errorMessage = "Error creating supplier: " + e.getMessage();
197
            logger.error("Error creating supplier", e);
199
            logger.error("Error creating supplier", e);
198
        }
200
        }
Line 221... Line 223...
221
            supplier.setRegisteredAddress(registeredAddress);
223
            supplier.setRegisteredAddress(registeredAddress);
222
            supplier.setGstin(gstin);
224
            supplier.setGstin(gstin);
223
            supplier.setStateId(supplier.getStateId());
225
            supplier.setStateId(supplier.getStateId());
224
            supplier.setPoValidityLimit(poValidityLimit);
226
            supplier.setPoValidityLimit(poValidityLimit);
225
            purchaseClient.updateSupplier(supplier);
227
            purchaseClient.updateSupplier(supplier);
-
 
228
            Utils.resetSuppliers();
226
        } catch (Exception e) {
229
        } catch (Exception e) {
227
            errorMessage = "Error updating supplier: " + supplierName + ": " + e.getMessage();
230
            errorMessage = "Error updating supplier: " + supplierName + ": " + e.getMessage();
228
            logger.error("Error updating supplier", e);
231
            logger.error("Error updating supplier", e);
229
        }
232
        }
230
 
233
 
Line 317... Line 320...
317
    public void setId(String id) {
320
    public void setId(String id) {
318
        this.id = id;
321
        this.id = id;
319
    }
322
    }
320
 
323
 
321
    public List<Supplier> getSuppliers() {
324
    public List<Supplier> getSuppliers() {
322
        return suppliers;
325
        return Utils.getSuppliers();
323
    }
326
    }
324
 
327
 
325
    public void setSuppliers(List<Supplier> suppliers) {
328
    public void setSuppliers(List<Supplier> suppliers) {
326
        this.suppliers = suppliers;
329
        this.suppliers = suppliers;
327
    }
330
    }
Line 351... Line 354...
351
	}
354
	}
352
 
355
 
353
    public long getStateId() {
356
    public long getStateId() {
354
		return stateId;
357
		return stateId;
355
	}
358
	}
-
 
359
    
-
 
360
    public String getState(String stateId){
-
 
361
    	return Utils.getStateIdMap().get(stateId).getStateName();
-
 
362
    }
356
 
363
 
357
	public void setStateId(long stateId) {
364
	public void setStateId(long stateId) {
358
		this.stateId = stateId;
365
		this.stateId = stateId;
359
	}
366
	}
360
 
367