Repository navigation
Conversation
Extend the provider interface with ReportPayment, Received and Download. The SuperPDP client posts fr:212 lifecycle events, walks the received invoice list by strictly increasing id across pages, expands the seller block, and downloads any invoice as a readable Factur-X PDF. HTTP calls share a single authenticated helper.
…by month Received invoices are saved as PDF under recues/YYYY-MM with a metadata sidecar; pdp-sync.json keeps the last id and only advances once the file is written. Payments go to the journal; a dated or partial payment is split by VAT rate as the platform requires. Export writes issued and received PDFs plus a semicolon CSV summary, and skips unchanged files.
…ices report_payment is destructive and requires confirm=true like send_invoice. list_invoices now shows the payment date when reported.
gofact sync fetches received invoices, raises a desktop notification and refreshes the accounting export of the current and previous month. gofact schedule installs a systemd user timer, a LaunchAgent or a Windows scheduled task, and only prints the plan without -yes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three gaps after deposit: gofact could not report a payment, did not know when a supplier invoice arrived, and offered nothing for the accountant, since the SuperPDP API has no way to grant read access.
Payments (
fr:212).report_payment(MCP, destructive,confirm=true) andgofact paidpost the lifecycle event. Without date or amount, SuperPDP takes the invoice total. A dated or partial payment must carry oneMENblock per VAT rate with its percentage (BR-FR-CDV-14, rejected by the sandbox otherwise); gofact splits the amount pro rata of each rate's gross total, read from the sidecar. The payment goes to the journal and shows asencaissee_leinlist_invoices.Received invoices. SuperPDP has no webhook; the documented way is
GET /invoices?direction=in&starting_after_id=N, ids being strictly increasing.gofact syncandlist_received_invoices(refresh=true) walk every page, download each invoice as a readable Factur-X PDF (even when received as UBL/CII) intorecues/YYYY-MM/, and keep the cursor inpdp-sync.json, advanced only once the file is written.gofact syncraises a desktop notification (notify-send, osascript, PowerShell toast).Accounting export.
gofact export/export_invoiceswrite<dest>/<org>/<YYYY-MM>/withemises/,recues/andrecapitulatif.csv(;, decimal comma, BOM for Excel). Unchanged PDFs are not copied again.gofact syncrefreshes the current and previous month whenGOFACT_EXPORT_DIRis set.Scheduling.
gofact scheduleinstalls a systemd user timer, a LaunchAgent or a Windows scheduled task; it only prints the plan without-yes, likegofact install.Tests: an MCP test against a mocked SuperPDP covers payment refusal before deposit, total/partial/dated payments, two-page reception with no refetch, and the export CSV; unit tests for the VAT split, file names and the two amount shapes of the API.
Sandbox (Burger Queen account): three
fr:212accepted and visible in the lifecycle; listing and PDF download decoded against the real API, which revealed that the seller block needsexpand[]=en_invoice.seller(fixed); export checked. Not covered: receiving a real invoice (this sandbox account has none, it needs another sandbox company's credentials), Windows toast and applyingschedule -yes.Local CI replay:
act -j crossgreen;mkdocs build --strictgreen underact -j build(only the Pages upload fails, no runtime token under act);testcannot start Chrome under act, sogo vet ./...andgo test ./...were replayed by hand with a real Chrome — green, nothing skipped.Independent of #26; both touch
docs/pdp.mdin different sections.