Package org.jallinone.sales.documents.java

Examples of org.jallinone.sales.documents.java.SaleDocRowPK


    }

    //Response res = ClientUtils.getData("insertSaleDocRow",newPersistentObject);
    if (!res.isError()) {
      DetailSaleDocRowVO vo = (DetailSaleDocRowVO)((VOResponse)res).getVo();
      pk = new SaleDocRowPK(
          vo.getCompanyCodeSys01DOC02(),
          vo.getDocTypeDOC02(),
          vo.getDocYearDOC02(),
          vo.getDocNumberDOC02(),
          vo.getItemCodeItm01DOC02(),
View Full Code Here


   * @param rowNumber selected row index
   * @param persistentObject v.o. related to the selected row
   */
  public void doubleClick(int rowNumber,ValueObject persistentObject) {
    GridSaleDocRowVO vo = (GridSaleDocRowVO)persistentObject;
    SaleDocRowPK pk = new SaleDocRowPK(
        vo.getCompanyCodeSys01DOC02(),
        vo.getDocTypeDOC02(),
        vo.getDocYearDOC02(),
        vo.getDocNumberDOC02(),
        vo.getItemCodeItm01DOC02(),
View Full Code Here

   * @param persistentObjects value objects to delete (related to the currently selected rows)
   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response deleteRecords(ArrayList persistentObjects) throws Exception {
    ArrayList pks = new ArrayList();
    SaleDocRowPK pk = null;
    GridSaleDocRowVO vo = null;
    for(int i=0;i<persistentObjects.size();i++) {
      vo = (GridSaleDocRowVO)persistentObjects.get(i);
      pk = new SaleDocRowPK(
          vo.getCompanyCodeSys01DOC02(),
          vo.getDocTypeDOC02(),
          vo.getDocYearDOC02(),
          vo.getDocNumberDOC02(),
          vo.getItemCodeItm01DOC02(),
View Full Code Here

    }

    //Response res = ClientUtils.getData("insertSaleDocRow",newPersistentObject);
    if (!res.isError()) {
      DetailSaleDocRowVO vo = (DetailSaleDocRowVO)((VOResponse)res).getVo();
      pk = new SaleDocRowPK(
          vo.getCompanyCodeSys01DOC02(),
          vo.getDocTypeDOC02(),
          vo.getDocYearDOC02(),
          vo.getDocNumberDOC02(),
          vo.getItemCodeItm01DOC02(),
View Full Code Here

   * @param rowNumber selected row index
   * @param persistentObject v.o. related to the selected row
   */
  public void doubleClick(int rowNumber,ValueObject persistentObject) {
    GridSaleDocRowVO vo = (GridSaleDocRowVO)persistentObject;
    SaleDocRowPK pk = new SaleDocRowPK(
        vo.getCompanyCodeSys01DOC02(),
        vo.getDocTypeDOC02(),
        vo.getDocYearDOC02(),
        vo.getDocNumberDOC02(),
        vo.getItemCodeItm01DOC02(),
View Full Code Here

   * @param persistentObjects value objects to delete (related to the currently selected rows)
   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response deleteRecords(ArrayList persistentObjects) throws Exception {
    ArrayList pks = new ArrayList();
    SaleDocRowPK pk = null;
    GridSaleDocRowVO vo = null;
    for(int i=0;i<persistentObjects.size();i++) {
      vo = (GridSaleDocRowVO)persistentObjects.get(i);
      pk = new SaleDocRowPK(
          vo.getCompanyCodeSys01DOC02(),
          vo.getDocTypeDOC02(),
          vo.getDocYearDOC02(),
          vo.getDocNumberDOC02(),
          vo.getItemCodeItm01DOC02(),
View Full Code Here

            availVO = (BookedItemQtyVO) availRows.get(0);
            if (availVO.getAvailableQtyWAR03().doubleValue()>=vo.getQtyDOC02().doubleValue()) {
              // unload item from the specified warehouse...
              res = loadSaleDocRowBean.loadSaleDocRow(
                  variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,
                  new SaleDocRowPK(
                    vo.getCompanyCodeSys01DOC02(),
                    vo.getDocTypeDOC02(),
                    vo.getDocYearDOC02(),
                    vo.getDocNumberDOC02(),
                    vo.getItemCodeItm01DOC02(),
                    vo.getVariantTypeItm06DOC02(),
                    vo.getVariantCodeItm11DOC02(),
                    vo.getVariantTypeItm07DOC02(),
                    vo.getVariantCodeItm12DOC02(),
                    vo.getVariantTypeItm08DOC02(),
                    vo.getVariantCodeItm13DOC02(),
                    vo.getVariantTypeItm09DOC02(),
                    vo.getVariantCodeItm14DOC02(),
                    vo.getVariantTypeItm10DOC02(),
                    vo.getVariantCodeItm15DOC02()

                  ),
                  serverLanguageId,
                  username

              );
              if (res.isError()) {
                throw new Exception(res.getErrorMessage());
              }
              detailVO = (DetailSaleDocRowVO)((VOResponse)res).getVo();
              WarehouseMovementVO movVO = new WarehouseMovementVO(
                  detailVO.getProgressiveHie01DOC02(),
                  vo.getQtyDOC02(),
                  vo.getCompanyCodeSys01DOC02(),
                  docVO.getWarehouseCodeWar01DOC01(),
                  vo.getItemCodeItm01DOC02(),
                  ApplicationConsts.WAREHOUSE_MOTIVE_DIRECTLY_UNLOAD,
                  ApplicationConsts.ITEM_GOOD,
                  t2+" "+docVO.getDocTypeDOC01()+"/"+docVO.getDocNumberDOC01()+"/"+docVO.getDocYearDOC01(),
                  detailVO.getSerialNumbers(),

                  vo.getVariantCodeItm11DOC02(),
                  vo.getVariantCodeItm12DOC02(),
                  vo.getVariantCodeItm13DOC02(),
                  vo.getVariantCodeItm14DOC02(),
                  vo.getVariantCodeItm15DOC02(),
                  vo.getVariantTypeItm06DOC02(),
                  vo.getVariantTypeItm07DOC02(),
                  vo.getVariantTypeItm08DOC02(),
                  vo.getVariantTypeItm09DOC02(),
                  vo.getVariantTypeItm10DOC02()

              );
              res = movBean.addWarehouseMovement(movVO,t15,serverLanguageId,username);
              if (res.isError()) {
                throw new Exception(res.getErrorMessage());
              }
            }
            else {
              throw new Exception(t1);
            }
          }
          else {
            throw new Exception(t1);
          }
        }
      } // end if SALE_DESK_DOC_TYPE (check item availabilities...)



      // check if this document is a sale invoice and has a linked sale document:
      // if this is the case, then the linked document will be updated...
      if ((docVO.getDocTypeDOC01().equals(ApplicationConsts.SALE_INVOICE_FROM_DN_DOC_TYPE) ||
           docVO.getDocTypeDOC01().equals(ApplicationConsts.SALE_INVOICE_FROM_SD_DOC_TYPE)) &&
        docVO.getDocNumberDoc01DOC01()!=null
      ) {
        SaleDocPK refPK = new SaleDocPK(
          docVO.getCompanyCodeSys01Doc01DOC01(),
          docVO.getDocTypeDoc01DOC01(),
          docVO.getDocYearDoc01DOC01(),
          docVO.getDocNumberDoc01DOC01()
        );

        // retrieve ref. document item rows...
        GridSaleDocRowVO vo = null;
        DetailSaleDocRowVO refDetailVO = null;
        BigDecimal qty = null;
        BigDecimal invoiceQty = null;
        String docType = null;
        BigDecimal docYear = null;
        BigDecimal docNumber = null;
        BigDecimal rowNumber = null;
        for(int i=0;i<rows.size();i++) {
          vo = (GridSaleDocRowVO)rows.get(i);
          res = loadSaleDocRowBean.loadSaleDocRow(
              variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,
              new SaleDocRowPK(
                docVO.getCompanyCodeSys01Doc01DOC01(),
                docVO.getDocTypeDoc01DOC01(),
                docVO.getDocYearDoc01DOC01(),
                docVO.getDocNumberDoc01DOC01(),
                vo.getItemCodeItm01DOC02(),
View Full Code Here

              vo.getVariantTypeItm08DOC02().equals(itemVO.getVariantTypeItm08DOC02()) &&
              vo.getVariantTypeItm09DOC02().equals(itemVO.getVariantTypeItm09DOC02()) &&
              vo.getVariantTypeItm10DOC02().equals(itemVO.getVariantTypeItm10DOC02())) {

            // load old row..
            SaleDocRowPK pk = new SaleDocRowPK(
              vo.getCompanyCodeSys01DOC02(),
              vo.getDocTypeDOC02(),vo.getDocYearDOC02(),
              vo.getDocNumberDOC02(),
              vo.getItemCodeItm01DOC02(),
              vo.getVariantTypeItm06DOC02(),
              vo.getVariantCodeItm11DOC02(),
              vo.getVariantTypeItm07DOC02(),
              vo.getVariantCodeItm12DOC02(),
              vo.getVariantTypeItm08DOC02(),
              vo.getVariantCodeItm13DOC02(),
              vo.getVariantTypeItm09DOC02(),
              vo.getVariantCodeItm14DOC02(),
              vo.getVariantTypeItm10DOC02(),
              vo.getVariantCodeItm15DOC02()
            );
            res = ClientUtils.getData("loadSaleDocRow",pk);
            if (res.isError())
              return res;
            DetailSaleDocRowVO oldVO = (DetailSaleDocRowVO)((VOResponse)res).getVo();
            DetailSaleDocRowVO newVO = (DetailSaleDocRowVO)oldVO.clone();
            newVO.setQtyDOC02(oldVO.getQtyDOC02().add(new BigDecimal(1)));
            newVO.setSerialNumbers(itemVO.getSerialNumbers());
            newVO.getSerialNumbers().addAll(oldVO.getSerialNumbers());

            // update qty...
            res = ClientUtils.getData(
              "updateSaleDocRow",
              new ValueObject[]{
                oldVO,
                newVO
              }
            );
            return res;
          }
        }
      }


      // the item has variants...
      res = ClientUtils.getData(
        "insertSaleDocRows",
        new Object[]{
          newPersistentObject,
          panel.getVariantsPanel().getVariantsMatrixVO(),
          panel.getVariantsPanel().getCells(),
          panel.getParentVO().getDecimalsREG03()
        }
      );
    }


    //Response res = ClientUtils.getData("insertSaleDocRow",newPersistentObject);
    if (!res.isError()) {
      DetailSaleDocRowVO vo = (DetailSaleDocRowVO)((VOResponse)res).getVo();
      pk = new SaleDocRowPK(
          vo.getCompanyCodeSys01DOC02(),
          vo.getDocTypeDOC02(),
          vo.getDocYearDOC02(),
          vo.getDocNumberDOC02(),
          vo.getItemCodeItm01DOC02(),
View Full Code Here

TOP

Related Classes of org.jallinone.sales.documents.java.SaleDocRowPK

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.