Package com.swinarta.sunflower.core.model

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


    Date returnDate = new Date();
    Integer supplierId = RequestUtil.getInteger(req.getData().get("supplierId"));
    String remarks = RequestUtil.getString(req.getData().get("remarks"));
    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);
View Full Code Here


        Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
        b.setMeasurement(selm);
      }
     
      if(supplierId.intValue() != b.getSupplier().getId().intValue()){
        Supplier supp = coreManager.get(Supplier.class, supplierId);
        b.setSupplier(supp);
      }
           
      try{
        respBuying = coreManager.save(Buying.class, b);
      }catch (Exception e) {
        SgwtRestErrorResponse resp = new SgwtRestErrorResponse(SgwtRestResponseBase.RESPONSE_FAILURE);
        resp.addError("exception", e.getMessage());
        return resp;
      }
     
    }else if(request.getOperationType() == OPERATION_TYPE.ADD){
     
      Double buyingPrice = RequestUtil.getDouble(request.getData().get("buyingPrice"));
      Double disc1 = RequestUtil.getDouble(request.getData().get("disc1"));
      Double disc2 = RequestUtil.getDouble(request.getData().get("disc2"));
      Double disc3 = RequestUtil.getDouble(request.getData().get("disc3"));
      Double disc4 = RequestUtil.getDouble(request.getData().get("disc4"));     
      Boolean taxIncluded = RequestUtil.getBoolean(request.getData().get("taxIncluded"));     
      Double discPrice = RequestUtil.getDouble(request.getData().get("discPrice"));
     
      Integer measurementSelectionId = RequestUtil.getInteger(request.getData().get("measurementSelectionId"));
      Integer supplierId = RequestUtil.getInteger(request.getData().get("supplierId"));

      Buying b = new Buying();
      b.setId(id);
      b.setBuyingPrice(buyingPrice);
      b.setDisc1(disc1);
      b.setDisc2(disc2);
      b.setDisc3(disc3);
      b.setDisc4(disc4);
      b.setTaxIncluded(taxIncluded);
      b.setDiscPrice(discPrice);
     
      Measurement selm = coreManager.get(Measurement.class, measurementSelectionId);
      b.setMeasurement(selm);

      Supplier supp = coreManager.get(Supplier.class, supplierId);
      b.setSupplier(supp);
     
      Product prod = coreManager.get(Product.class, id);
      b.setProduct(prod);
           
View Full Code Here

    String phone = RequestUtil.getString(request.getData().get("phone"));
    String fax = RequestUtil.getString(request.getData().get("fax"));
    String mobile = RequestUtil.getString(request.getData().get("mobile"));
    Integer termOfPayment = RequestUtil.getInteger(request.getData().get("termOfPayment"));

    Supplier s = new Supplier();
    s.setSupplierCode(supplierCode);
    s.setName(supplierName);
    s.setContactName(contactName);
    s.setAddress1(addr1);
    s.setAddress2(addr2);
    s.setCity(city);
    s.setPhone(phone);
    s.setFax(fax);
    s.setMobile(mobile);
    s.setTermOfPayment(termOfPayment);
   
    Supplier savedSupp;
   
    try {
        savedSupp = coreManager.save(Supplier.class, s);
    }catch (DataIntegrityViolationException dive){
      SgwtRestErrorResponse resp = new SgwtRestErrorResponse(-4);
View Full Code Here

    Date poDate = RequestUtil.getDate(req.getData().get("poDate"));
    Date cancelDate = RequestUtil.getDate(req.getData().get("cancelDate"));
    Integer supplierId = RequestUtil.getInteger(req.getData().get("supplierId"));
    String remarks = RequestUtil.getString(req.getData().get("remarks"));
   
    Supplier supplier = coreManager.get(Supplier.class, supplierId);
   
    Integer storeId = Integer.parseInt(properties.getProperty("curr.store.id"));
   
    PurchasingOrder po = new PurchasingOrder();
    po.setCancelDate(cancelDate);
View Full Code Here

    String phone = RequestUtil.getString(request.getData().get("phone"));
    String fax = RequestUtil.getString(request.getData().get("fax"));
    String mobile = RequestUtil.getString(request.getData().get("mobile"));
    Integer termOfPayment = RequestUtil.getInteger(request.getData().get("termOfPayment"));
 
    Supplier supp = coreManager.get(Supplier.class, id);
    supp.setSupplierCode(supplierCode);
    supp.setName(supplierName);
    supp.setContactName(contactName);
    supp.setAddress1(addr1);
    supp.setAddress2(addr2);
    supp.setCity(city);
    supp.setPhone(phone);
    supp.setFax(fax);
    supp.setMobile(mobile);
    supp.setTermOfPayment(termOfPayment);
 
    try {
      resp = coreManager.save(Supplier.class, supp);
    }catch (DataIntegrityViolationException dive){
View Full Code Here

TOP

Related Classes of com.swinarta.sunflower.core.model.Supplier

Copyright © 2018 www.massapicom. 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.