私はこれに苦しんでいます。それはとても簡単で、おそらく何か愚かなことがありませんが、私は助けが必要です。ARの印刷文にParentAccountIdと名前を追加してください。
AR503500のPrint Statement画面の下に、詳細グリッドに別のフィールドを追加しようとしています。このフィールドは、顧客のparentAccountIdです。 DetailsResultには既にCustomerIDが含まれています。
私はAR.ARStatementPrint.DetailsResult DACを拡張し、次の
public abstract class parentAccountTest2 : IBqlField
{
}
#region Parent Account test 2
[PXString]
[PXUIField(DisplayName = "Parent Account test 2")]
[PXDBScalar(typeof(Search<Customer.parentBAccountID,
Where<Customer.bAccountID, Equal<DetailsResult.customerID>>>))]
public string ParentAccountTest2 { get; set; }
#endregion
を追加しました。しかし、私は、任意の値がグリッド上に表示するために取得カントています。
グラフには、DetailsResultのコピーメソッドを呼び出すメソッドdetails()があります。これを何とかオーバーライドして、そのようにparentAccountIdを設定する必要がありますか?ここで
は、「詳細」メソッドが呼び出されたグラフの詳細方法
protected virtual IEnumerable details()
{
ARSetup setup = ARSetup.Current;
PrintParameters header = Filter.Current;
List<DetailsResult> result = new List<DetailsResult>();
if (header == null)
yield break;
GL.Company company = PXSelect<GL.Company>.Select(this);
foreach (PXResult<ARStatement, Customer> it in PXSelectJoin<ARStatement,
InnerJoin<Customer, On<Customer.bAccountID, Equal<ARStatement.statementCustomerID>>>,
Where<ARStatement.statementDate, Equal<Required<ARStatement.statementDate>>,
And<ARStatement.statementCycleId, Equal<Required<ARStatement.statementCycleId>>>>,
OrderBy<Asc<ARStatement.statementCustomerID, Asc<ARStatement.curyID>>>>
.Select(this, header.StatementDate, header.StatementCycleId))
{
DetailsResult res = new DetailsResult();
ARStatement st = it;
Customer cust = it;
res.Copy(st, cust);
if (setup.ConsolidatedStatement != true && st.BranchID != header.BranchID)
continue;
if (Filter.Current.Action == 0 &&
header.ShowAll != true &&
(st.DontPrint == true || st.Printed == true))
continue;
if ((Filter.Current.Action == 1 || Filter.Current.Action == 2) &&
header.ShowAll != true &&
(st.DontEmail == true || st.Emailed == true))
continue;
if (cust.PrintCuryStatements == true)
{
if (Filter.Current.CuryStatements != true)
continue;
DetailsResult last = result.Count > 0 ? result[result.Count - 1] : null;
if (last?.CustomerID == res.CustomerID && last?.CuryID == res.CuryID)
{
last.Append(res);
}
else
{
result.Add(res);
}
}
else
{
if (Filter.Current.CuryStatements == true)
continue;
res.ResetToBaseCury(company.BaseCuryID);
DetailsResult last = result.Count > 0 ? result[result.Count - 1] : null;
if (last?.CustomerID == res.CustomerID)
{
last.Append(res);
}
else
{
result.Add(res);
}
}
}
foreach (var item in result)
{
var located = Details.Cache.Locate(item);
if (located != null)
{
yield return located;
}
else
{
Details.Cache.SetStatus(item, PXEntryStatus.Held);
yield return item;
}
}
Details.Cache.IsDirty = false;
}
され、PX.Objects.AR.ARStatementPrint.DetailsResultクラス上のコピー方法
public virtual void Copy(ARStatement aSrc, Customer cust)
{
this.CustomerID = cust.BAccountID;
this.UseCurrency = cust.PrintCuryStatements;
this.StatementBalance = aSrc.EndBalance ?? decimal.Zero;
this.AgeBalance00 = aSrc.AgeBalance00 ?? decimal.Zero;
this.CuryID = aSrc.CuryID;
this.CuryStatementBalance = aSrc.CuryEndBalance ?? decimal.Zero;
this.CuryAgeBalance00 = aSrc.CuryAgeBalance00 ?? decimal.Zero;
this.DontEmail = aSrc.DontEmail;
this.DontPrint = aSrc.DontPrint;
this.Emailed = aSrc.Emailed;
this.Printed = aSrc.Printed;
this.BranchID = aSrc.BranchID;
}
どのように相互に関連している2つの抽象クラスがあります。プロパティ 'ParentAccountTest2'はどのクラスに属していますか? 'Details'と' Copy'メソッドのコードを共有できますか? 'DetailsResult'クラスはどこですか? –
ParentAccountTest2は私のDetailsResult Extensionに追加したフィールドです。それらのメソッドでポストを更新しました.DetailsResultはPX.Objects.AR.AR.StatementPrintにあります – GrayFoxNZ