Examples of ReturnToSupplier


Examples of com.swinarta.sunflower.core.model.ReturnToSupplier

    String invNumber = RequestUtil.getString(req.getData().get("invoiceNumber"));
   
    Supplier supplier = coreManager.get(Supplier.class, supplierId);
    Integer storeId = Integer.parseInt(properties.getProperty("curr.store.id"));
   
    ReturnToSupplier retSup = new ReturnToSupplier();
    retSup.setInvoiceNumber(invNumber);
    retSup.setRemarks(remarks);
    retSup.setReturnDate(returnDate);
    retSup.setSupplier(supplier);
    retSup.setStatus(Status.fromString("NEW"));
    retSup.setReturnId("temp");
    retSup.setStoreId(storeId);
       
    try {
      ReturnToSupplier retResp = coreManager.save(ReturnToSupplier.class, retSup);
      retResp.setReturnId(ReturnUtil.constructReturnId(retResp.getReturnDate(), retResp.getSupplier().getId(), retResp.getId()));
      retResp = coreManager.save(ReturnToSupplier.class, retResp);
     
      DisplaySearchReturnToSupplier dret = mapper.map(retResp, DisplaySearchReturnToSupplier.class);
      resp = dret;
     
View Full Code Here

Examples of com.swinarta.sunflower.core.model.ReturnToSupplier

    Integer productId = RequestUtil.getInteger(request.getData().get("productId"));
    Serializable resp = null;
   
    try{
      Product product = coreManager.get(Product.class, productId);
      ReturnToSupplier ret = coreManager.get(ReturnToSupplier.class, retId);
     
      ReturnToSupplierDetail retd = new ReturnToSupplierDetail();
      retd.setProduct(product);
      retd.setReturnToSupplier(ret);
      retd.setQty(qty);
View Full Code Here

Examples of com.swinarta.sunflower.core.model.ReturnToSupplier

 
  @Get("json")
  public SgwtRestResponseBase fetch(){
    Serializable resp = null;
    Integer id = RequestUtil.getInteger(getRequestAttributes().get("id"));
    ReturnToSupplier ret = coreManager.get(ReturnToSupplier.class, id);
    if(ret != null){
      DisplaySearchReturnToSupplier dret = mapper.map(ret, DisplaySearchReturnToSupplier.class);
      resp = dret;
    }
    return new SgwtRestFetchResponseBase(resp);
View Full Code Here

Examples of com.swinarta.sunflower.core.model.ReturnToSupplier

    String invNumber = RequestUtil.getString(req.getData().get("invoiceNumber"));
    String remarks = RequestUtil.getString(req.getData().get("remarks"));
    String status = RequestUtil.getString(req.getData().get("status"));
    Boolean isCompleted = false;
   
    ReturnToSupplier retResp = null;
    ReturnToSupplier ret = coreManager.get(ReturnToSupplier.class, id);     

    Status RetStatus = Status.fromString(status);
   
    if(status != null){
      Status oldStatus = ret.getStatus();
      Status newStatus = Status.fromString(status);
      isCompleted = (!oldStatus.equals(newStatus) && newStatus == Status.COMPLETED);
    }
   
    try {
      if(isCompleted){
        retResp = coreManager.updateCompleteReturnToSupplier(id);
      }else{
        ret.setRemarks(remarks);
        ret.setInvoiceNumber(invNumber);
        ret.setStatus(RetStatus);
        retResp = coreManager.save(ReturnToSupplier.class, ret);
      }
      DisplaySearchReturnToSupplier dret = mapper.map(retResp, DisplaySearchReturnToSupplier.class);
      resp = dret;
    } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.