Exemplo n.º 1
0
  /**
   * Set Individual system asset transaction type and asset numbers.
   *
   * @param poId
   * @param purApDocs
   */
  protected void setIndividualAssetsFromPurAp(
      Integer poId,
      List<PurchasingAccountsPayableDocument> purApDocs,
      String capitalAssetSystemStateCode) {
    List<PurchasingCapitalAssetItem> capitalAssetItems =
        this.getPurchaseOrderService().retrieveCapitalAssetItemsForIndividual(poId);
    String capitalAssetTransactionTypeCode = null;
    List<ItemCapitalAsset> purApCapitalAssets = null;

    // For each capitalAssetItem from PurAp, we set it to all matching CAB items
    for (PurchasingCapitalAssetItem purchasingCapitalAssetItem : capitalAssetItems) {
      capitalAssetTransactionTypeCode =
          purchasingCapitalAssetItem.getCapitalAssetTransactionTypeCode();
      // get matching CAB items origin from the same PO item.
      List<PurchasingAccountsPayableItemAsset> matchingItems =
          getMatchingItems(purchasingCapitalAssetItem.getItemIdentifier(), purApDocs);
      // if modify existing asset, acquire the assets from Puraps
      if (PurapConstants.CapitalAssetSystemStates.MODIFY.equalsIgnoreCase(
          capitalAssetSystemStateCode)) {
        purApCapitalAssets =
            getAssetsFromItemCapitalAsset(
                purchasingCapitalAssetItem
                    .getPurchasingCapitalAssetSystem()
                    .getItemCapitalAssets());
      }

      // set TransactionTypeCode, itemCapitalAssets and system identifier for each matching item
      setItemAssetsCamsTransaction(
          purchasingCapitalAssetItem.getCapitalAssetSystemIdentifier(),
          capitalAssetTransactionTypeCode,
          purApCapitalAssets,
          matchingItems);
    }
  }
Exemplo n.º 2
0
  /**
   * Set Multiple system capital asset transaction type code and asset numbers.
   *
   * @param poId
   * @param purApDocs
   */
  protected void setMultipleSystemFromPurAp(
      Integer poId,
      List<PurchasingAccountsPayableDocument> purApDocs,
      String capitalAssetSystemStateCode) {
    List<CapitalAssetSystem> capitalAssetSystems =
        this.getPurchaseOrderService().retrieveCapitalAssetSystemsForMultipleSystem(poId);
    if (ObjectUtils.isNotNull(capitalAssetSystems) && !capitalAssetSystems.isEmpty()) {
      // PurAp doesn't support multiple system asset information for KFS3.0. It works as one system
      // for 3.0.
      CapitalAssetSystem capitalAssetSystem = capitalAssetSystems.get(0);
      if (ObjectUtils.isNotNull(capitalAssetSystem)) {
        String capitalAssetTransactionType = getCapitalAssetTransTypeForOneSystem(poId);
        // if modify existing asset, acquire the assets from Purap
        List<ItemCapitalAsset> purApCapitalAssets = null;
        if (PurapConstants.CapitalAssetSystemStates.MODIFY.equalsIgnoreCase(
            capitalAssetSystemStateCode)) {
          purApCapitalAssets =
              getAssetsFromItemCapitalAsset(capitalAssetSystem.getItemCapitalAssets());
        }

        // set TransactionTypeCode, itemCapitalAssets and system identifier for each item
        for (PurchasingAccountsPayableDocument purApDoc : purApDocs) {
          setItemAssetsCamsTransaction(
              capitalAssetSystem.getCapitalAssetSystemIdentifier(),
              capitalAssetTransactionType,
              purApCapitalAssets,
              purApDoc.getPurchasingAccountsPayableItemAssets());
        }
      }
    }
  }
Exemplo n.º 3
0
  /**
   * Set One System capital asset transaction type code and asset numbers.
   *
   * @param poId
   * @param purApDocs
   */
  protected void setOneSystemFromPurAp(
      Integer poId,
      List<PurchasingAccountsPayableDocument> purApDocs,
      String capitalAssetSystemStateCode) {
    CapitalAssetSystem capitalAssetSystem =
        this.getPurchaseOrderService().retrieveCapitalAssetSystemForOneSystem(poId);
    String capitalAssetTransactionTypeCode = getCapitalAssetTransTypeForOneSystem(poId);
    List<ItemCapitalAsset> purApCapitalAssets = null;
    // if modify existing asset, acquire the assets from Purap
    if (PurapConstants.CapitalAssetSystemStates.MODIFY.equalsIgnoreCase(
        capitalAssetSystemStateCode)) {
      purApCapitalAssets = getAssetsFromItemCapitalAsset(capitalAssetSystem.getItemCapitalAssets());
    }

    for (PurchasingAccountsPayableDocument purApDoc : purApDocs) {
      // set TransactionTypeCode, itemCapitalAssets and system identifier for each item
      setItemAssetsCamsTransaction(
          capitalAssetSystem.getCapitalAssetSystemIdentifier(),
          capitalAssetTransactionTypeCode,
          purApCapitalAssets,
          purApDoc.getPurchasingAccountsPayableItemAssets());
    }
  }