Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.

9 downloads

dbbasic-object-server/packages/app-exchange/objects/action/exchange_confirm_remittance.py
Install on DigitalOcean Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-object-server.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-object-server.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-object-server.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

Daniel Quellhorst Changelog for this batch. 65ef78d 3 hours, 49 minutes ago History
exchange_confirm_remittance.py · 1.3 KB · 29 lines
1"""action_exchange_confirm_remittance -- a remittance checked against the bank.
2
3POST {inbox_id, received_on?}
4
5A remittance from a partner is the payer saying it paid; the bank statement
6is the proof (docs/box-to-box-exchange.md, "Payments"). Received, it waits in
7the inbox as awaiting_confirmation (the attention queue
8remittances_to_confirm). A person who has seen the money arrive confirms it
9here, and the payment is recorded then: one payments row per invoice it
10settles, under the payments collection's own rules (its locked overpayment
11check refuses a payment that would take an invoice past what it is worth).
12The caller must be allowed to update each invoice AND to create the payment
13(app-payments gives that to role:manager; the customer who owns an invoice
14may not record money received on it), asked of the policy for every payment
15before anything is written. A second confirmation is
16refused, and the payment's reference names the document, so nothing is
17recorded twice.
18"""
19
20import object_exchange_box as box
21
22
23def POST(request):
24 try:
25 return box.confirm_remittance(box.base_dir(), request.get("inbox_id") or "",
26 request.get("_identity"),
27 received_on=request.get("received_on") or "")
28 except box.Refusal as refusal:
29 return refusal.answer()