将货币余额字段添加到客户门户?

时间:2017-05-11 15:22:26

标签: acumatica portal

我尝试将当前余额(货币)字段添加到标题区域中客户门户网站的“我的文档(SP.40.20.00)”页面,但无论我做什么,这些字段都不会显示,并且修改(覆盖)聚合函数似乎不可能(包装错误)。有没有其他方式让我获得货币(客户)总数而不是默认货币总额?

Link to the project

1 个答案:

答案 0 :(得分:1)

您正在处理的基本图表(ARDocumentEnq)在RowSelected事件中具有基于许可证中选择的功能集和所选行CuryID /公司基础货币的可见性验证。

检查主站点上的这些功能是否已在Configuration-> Common Settings-> Licensing->启用/禁用功能中启用,并计算出row.CuryID和Company.Current.BaseCuryID所需的条件。要覆盖基本图形条件,可以在图形扩展中添加RowSelected事件。

public class ARDocumentEnq_Extension:PXGraphExtension<ARDocumentEnq>
  {
    public virtual void ARDocumentFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
    {
      ARDocumentEnq.ARDocumentFilter row = (ARDocumentEnq.ARDocumentFilter)e.Row;
      if (row == null) return;

      PXCache docCache = Base.Documents.Cache;

      // Forcing display
      bool byPeriod = true; //(row.Period != null);
      bool isMCFeatureInstalled = true; //PXAccess.FeatureInstalled<FeaturesSet.multicurrency>();
      bool isForeignCurrencySelected = true; //String.IsNullOrEmpty(row.CuryID) == false && (row.CuryID != this.Company.Current.BaseCuryID);
      bool isBaseCurrencySelected = true; //String.IsNullOrEmpty(row.CuryID) == false && (row.CuryID == this.Company.Current.BaseCuryID);

      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentFilter.curyID>(cache, row, isMCFeatureInstalled);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentFilter.curyBalanceSummary>(cache, row, isMCFeatureInstalled && isForeignCurrencySelected);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentFilter.curyDifference>(cache, row, isMCFeatureInstalled && isForeignCurrencySelected);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentFilter.curyCustomerBalance>(cache, row, isMCFeatureInstalled && isForeignCurrencySelected);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentFilter.curyCustomerDepositsBalance>(cache, row, isMCFeatureInstalled && isForeignCurrencySelected);

      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentResult.curyID>(docCache, null, isMCFeatureInstalled);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentResult.rGOLAmt>(docCache, null, isMCFeatureInstalled && !isBaseCurrencySelected);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentResult.curyBegBalance>(docCache, null, byPeriod && isMCFeatureInstalled && !isBaseCurrencySelected);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentResult.begBalance>(docCache, null, byPeriod);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentResult.curyOrigDocAmt>(docCache, null, isMCFeatureInstalled && !isBaseCurrencySelected);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentResult.curyDocBal>(docCache, null, isMCFeatureInstalled && !isBaseCurrencySelected);
      PXUIFieldAttribute.SetVisible<ARDocumentEnq.ARDocumentResult.curyDiscActTaken>(docCache, null, isMCFeatureInstalled && !isBaseCurrencySelected);
    }
  }