Skip to main content

foreign-currency-payment

This skill handles foreign currency invoice payment with exchange rate differences (disagio/agio). Keywords include "exchange rate", "valutakurs", "vekslingskurs", "taux de change", "Wechselkurs", "tipo de cambio", "disagio", "agio", "currency difference", "valutadifferanse", "EUR", "USD", "foreign currency", "fremmed valuta".

跳到安装

来源信息

仓库
JardarIversen/ainm-2026
最近来源活动
2026年3月21日 20:40
检测到的 SKILL.md 语言
英语
星标
18
分支
14

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
foreign_currency_payment
tier
3
task
T27
description
This skill handles foreign currency invoice payment with exchange rate differences (disagio/agio). Keywords include "exchange rate", "valutakurs", "vekslingskurs", "taux de change", "Wechselkurs", "tipo de cambio", "disagio", "agio", "currency difference", "valutadifferanse", "EUR", "USD", "foreign currency", "fremmed valuta".
# Foreign Currency Payment + Exchange Rate Difference Register payment on foreign currency invoice and post disagio/agio. 5 calls. ## Turn 1: 3 parallel GETs ``` GET /invoice?invoiceDateFrom=2020-01-01&invoiceDateTo=2030-12-31&fields=id,invoiceNumber,amount,amountCurrency,amountOutstanding,amountCurrencyOutstanding,currency(id,code),customer(id,name)&count=100 GET /invoice/paymentType?fields=id,description&count=10 GET /ledger/account?number=8060,8160,1920&fields=id,number,name ``` Find the invoice by matching the customer name/org and amount. The EUR invoice has `currency.code` = "EUR" and `amountCurrency` matching the EUR amount from the prompt. Use `amountOutstanding` (in NOK) for payment. Use "Betalt til bank" payment type. Account 8060 or 8160 = agio/disagio (exchange rate differences). ## Turn 2: Register payment ``` PUT /invoice/<invoice_id>/:payment?paymentDate=2026-03-21&paymentTypeId=<bank_type_id>&paidAmount=<amountOutstanding_from_invoice> ``` Use the invoice's `amountOutstanding` (NOK) as `paidAmount`. This zeroes out the invoice. ## Turn 3: Post agio/disagio voucher Calculate: - invoice_nok = amountOutstanding from the invoice (NOK at original rate) - payment_nok = foreign_amount × new_rate (from prompt) - difference = payment_nok - invoice_nok If difference > 0 → agio (gain, customer paid MORE in NOK). Credit 8060/8160. If difference < 0 → disagio (loss, customer paid LESS). Debit 8060/8160. ```json POST /ledger/voucher { "date": "2026-03-21", "description": "Valutadifferanse", "postings": [ {"date": "2026-03-21", "account": {"id": <account_1920_id>}, "amountGross": <payment_nok>, "amountGrossCurrency": <payment_nok>, "row": 1}, {"date": "2026-03-21", "account": {"id": <account_8060_id>}, "amountGross": -<difference>, "amountGrossCurrency": -<difference>, "row": 2}, {"date": "2026-03-21", "account": {"id": <customer_receivable_acct>}, "amountGross": -<invoice_nok>, "amountGrossCurrency": -<invoice_nok>, "row": 3} ] } ``` Actually, simpler 2-line voucher for just the exchange rate difference: ```json POST /ledger/voucher { "date": "2026-03-21", "description": "Valutadifferanse", "postings": [ {"date": "2026-03-21", "account": {"id": <account_1920_id>}, "amountGross": <difference>, "amountGrossCurrency": <difference>, "row": 1}, {"date": "2026-03-21", "account": {"id": <account_8060_id>}, "amountGross": -<difference>, "amountGrossCurrency": -<difference>, "row": 2} ] } ``` For agio (gain): difference is positive → debit 1920 (more cash), credit 8060 (gain). For disagio (loss): difference is negative → credit 1920 (less cash), debit 8060 (loss). **5 calls, 0 errors.** ## Key details - Find the EUR/USD invoice by `currency.code` — NOT by amount in NOK - `paidAmount` = invoice's `amountOutstanding` in NOK (from GET response). Do NOT calculate from prompt rates. - difference = (foreign_amount × new_rate) - invoice_amountOutstanding - Account 8060 "Annen finansinntekt" or 8160 "Agio" for exchange differences — check which exists - Agio = gain (new rate higher). Disagio = loss (new rate lower).
在 GitHub 查看