我正在使用我们的查询工具为Exact Online的XML API主题GLTransactions
生成XML文件。这些文件的输入是来自Twinfield(XAF 3.1格式)的XML审计文件。
由于Exact Online具有混合分类帐和许多约束,因此无法直接加载银行分录。相反,在从Twinfield加载XML审计文件时,银行交易将作为第一步发布到Exact Online的单独总帐帐户中,作为第一步。
在下一步中,保留总帐帐户的Exact Online中的内容将发布在银行业日记帐中。 Exact Online本身生成另一半作为银行总账的关联交易行。
用于生成银行条目的查询是:
create or replace table bank@inmemorystorage
as
select case
when substr(tle.description, 1, instr(tle.description, '/') - 1) = 'BNK'
then '20'
when substr(tle.description, 1, instr(tle.description, '/') - 1) = 'BNK2'
then '21'
else '??'
end
txn_journalcode
, txn.financialyear txn_financialyear
, txn.financialperiod txn_financialperiod
, txn.entrynumber txn_entrynumber
, txn.date txn_date
, tle.date tle_date
, tle.linenumber tle_linenumber
, substr(tle.description, instr(tle.description, '/') + 1, instr(tle.description, ':') - instr(tle.description, '/') - 1) tle_glaccountcode_target
, substr(tle.description, instr(tle.description, ':') + 2) tle_description
, trim(tle.accountcode) tle_accountcode
, tle.glaccountcode glaccountcode_source
, tle.amountdc tle_amountdc
, tle.vatcode tle_vatcode
, tle.yourref tle_yourref
from exactonlinerest..transactionlines tle
join exactonlinerest..transactions txn
on tle.entryid = txn.entryid
where tle.glaccountcode like '290%'
and substr(tle.description, instr(tle.description, '/') + 1, instr(tle.description, ':') - instr(tle.description, '/') - 1) not like '11%' /* Not a bank account. */
order
by tle.entrynumber
, tle.linenumber
select 'GLTransactions\99-Interim-empty.xml'
filename
, stg.fileprefix
|| chr(13)
|| '<GLTransactions>'
|| xml
|| chr(13)
|| '</GLTransactions>'
|| stg.filepostfix
filecontents
from ( select listagg
( chr(13)
|| '<GLTransaction entry="'
|| txn_entrynumber
|| '">'
|| chr(13)
|| '<Journal code="'
|| txn_journalcode
|| '" />'
|| chr(13)
|| '<Date>'
|| substr(xmlencode(txn_date), 1, 10)
|| '</Date>'
|| chr(13)
|| xml
|| chr(13)
|| '</GLTransaction>'
, ''
) xml
from ( select txn_date
, txn_journalcode
, txn_financialyear
, txn_financialperiod
, txn_entrynumber
, listagg
( chr(13)
|| '<GLTransactionLine type="40" linetype="0" line="'
|| tle_linenumber
|| '" offsetline="1" status="20">'
|| chr(13)
|| '<Date>'
|| substr(xmlencode(tle_date), 1, 10)
|| '</Date>'
|| chr(13)
|| '<FinYear number="'
|| txn_financialyear
|| '" />'
|| chr(13)
|| '<FinPeriod number="'
|| txn_financialperiod
|| '" />'
|| chr(13)
|| '<GLAccount code="'
|| case
when tle_glaccountcode_target = '1560'
then '2902' /* Separate interim GL account, Twinfield does not provide separated. */
else xmlencode(tle_glaccountcode_target)
end
|| '" />'
|| case
when tle_description is not null
then chr(13)
|| '<Description>'
|| xmlencode(tle_description)
|| '</Description>'
end
|| case
when tle_accountcode is not null
then chr(13)
|| '<Account code="'
|| xmlencode(tle_accountcode)
|| '" />'
end
|| chr(13)
|| '<Amount>'
|| '<Currency code="EUR" />'
|| '<Value>'
|| -1 * tle_amountdc
|| '</Value>'
|| case
when tle_glaccountcode_target like '4%'
then '<VAT code="GB" />' /* GB = No VAT. */
else ''
end
|| '</Amount>'
|| chr(13)
|| '</GLTransactionLine>'
, ''
)
xml
from bank@inmemorystorage
group
by txn_date
, txn_journalcode
, txn_financialyear
, txn_financialperiod
, txn_entrynumber
)
)
join settings@inmemorystorage stg
on 1=1
在tle_yourref
的{{1}}列中,有一个逗号分隔的关联销售/采购发票清单。
在银行日记帐上手动输入总帐交易时,对帐窗口会填充参考凭证的内容。但是,当我使用事务从Exact Online导出XML文件时,您的引用将丢失。
目前,我似乎无法通过银行期刊中的这些交易自动协调Exact Online的XML或REST API。
作为一种变通方法,您可以在“对帐”窗口中选择每个帐户(它们几乎都是0欧元),然后选择“自动对帐”。但是,从Twinfield到Exact Online的每次转换都有太多的帐户。
是否有另一种方法通过Exact Online的API(REST或XML)将发票与银行交易相关联?
答案 0 :(得分:4)
如果发票与付款之间存在1对1的关系(因此只需1张发票和1笔付款),您可以使用银行条目中的<References><InvoiceNumber>put invoice entrynumber here</InvoiceNumber></References>
自动对帐。
另一种可能性是使用主题MatchSets(参见文档)创建一个XML文件,以便以后匹配。
答案 1 :(得分:0)
此外,您还可以说:
<References><EntryNumber>10000012</EntryNumber><InvoiceNumber>FAC0001</InvoiceNumber></References>
当关系为1 = 1时始终有效。 如果仅指定发票编号,则匹配通常会静默失败。