Source incoming :)

This commit is contained in:
2021-12-12 07:06:51 +00:00
parent 415f50ce1e
commit 907bf2206f
50 changed files with 2918 additions and 0 deletions

20
invoice Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
from fosspay.database import db
from fosspay.objects import Invoice
from fosspay.config import _cfg
import sys
if len(sys.argv) != 3:
print(f"Usage: {sys.argv[0]} <amount in cents> <comment>")
sys.exit(1)
amount = int(sys.argv[1])
comment = sys.argv[2]
invoice = Invoice()
invoice.amount = amount
invoice.comment = comment
db.add(invoice)
db.commit()
print(f"{_cfg('protocol')}://{_cfg('domain')}/invoice/{invoice.external_id}")