2016-12-13 17 views
2

我正在使用Invantive Control來創建Excel報表,其中包含一些來自Exact Online的優秀髮票信息。如何在Exact Online的報告中向AR未完成項目添加付款條件?

我已經用塊設計器創建了一個模型,並且我有我需要的優秀髮票信息。現在我也想知道有欠賬戶的付款情況,但是AROutstandingItems表沒有關於付款條件的信息。

這是查詢我到目前爲止:

select division_code 
,  division_name 
,  number_attr 
,  outstandingitems_ar_account_code_attr 
,  outstandingitems_ar_account_name 
,  description 
,  invoicedate 
,  duedate 
,  currency_code_attr 
,  invoiceamtfc 
,  outstandingamtfc 
,  invoiceamtdc 
,  outstandingamtdc 
from aroutstandingitems 
order 
by  division_code 
,  outstandingamtdc desc 

我怎樣才能加入支付條件,我的報告?

+4

您可以在invantive-sql中使用連接。因此,將其與支付條件信息表一起加入並相應顯示。 – Ravenix

+0

您也可以在ExactOnlineREST..salesinvoices上使用連接。但是,根據salesinvoices中的行數以及REST API IN ...優化的存在情況,它將非常慢或很快。 salesinvoices API在性能上並不優秀:-) –

回答

3

支付條件是從未完成項目的帳戶中引用的。爲了獲得帳戶的(銷售)付款條件,有幾種選擇。

  1. 加入Accounts表,並從那裏(從外地salespaymentcondition_code_attrsalespaymentcondition_description)獲得的支付條件。

    的SQL是這樣的,那麼:

    select ... 
    ,  act.salespaymentcondition_code_attr 
    from aroutstandingitems aom 
    join exactonlinexml..accounts act 
    on  aom.outstandingitems_ar_account_code_attr = act.code_attr 
    
  2. 使用Excel函數來獲取付款條件:I_EOL_ACT_SLS_PAY_CODE

    該公式有兩個參數:division_codeaccount_code_attr。第一個是可選的。

    因此,對公式的有效調用將因此爲:=I_EOL_ACT_SLS_PAY_CODE(,"22"),用於當前Exact Online公司的代碼爲22的帳戶的付款條件代碼。你可以結合你的SQL是這樣的:

    select ... 
    ,  '=I_EOL_ACT_SLS_PAY_CODE("' + division_code + '", "' + outstandingitems_ar_account_code_attr + '")' 
         pcn_code 
    from aroutstandingitems 
    

    這將導致在同步模型得到的公式檢索付款條件碼。請記住選中「公式」複選框以確保將SQL結果視爲Excel公式。

  3. 與上面相同,但隨後利用列表達式:

    select ... 
    ,  '=I_EOL_ACT_SLS_PAY_CODE("$C{E,.,.,^,.}";"$C{E,.,.,^+3,.}")' 
         pcn_code 
    from aroutstandingitems 
    

    記住檢查複選框「式」和「列表達式」,以確保SQL結果被作爲Excel式與處理$C列表達式。

推薦的選擇是使用列表達式,因爲整個的部署方案,範圍最廣的這些工作,如與數百家企業和會計公式是升級安全。 SQL語句可能需要適應Invantive的Exact Online數據模型的新版本。

相關問題