Skip to content

Commit 33b6aef

Browse files
committed
Fix SEPA flow
1 parent 281f040 commit 33b6aef

9 files changed

Lines changed: 186 additions & 163 deletions

File tree

landolfio/accounting/admin/contact.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,7 @@ class ContactAdmin(MoneybirdResourceModelAdmin):
114114
(
115115
_("Moneybird"),
116116
{
117-
"fields": (
118-
"invoice_workflow",
119-
"estimate_workflow",
120-
"sales_invoices_url",
121-
),
117+
"fields": ("sales_invoices_url",),
122118
},
123119
),
124120
]

landolfio/accounting/models/contact.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,12 @@ class Meta:
226226
verbose_name_plural = _("contacts")
227227
ordering = ["company_name", "last_name", "first_name"]
228228

229-
def request_payments_mandate(self, message=None, identity=None):
229+
def get_payments_mandate_url(self):
230230
administration = get_moneybird_administration()
231-
data = {"mandate_request": {}}
232-
if message:
233-
data["mandate_request"]["email_message"] = message
234-
if identity:
235-
data["mandate_request"]["identity_id"] = identity
236-
administration.post(
237-
f"contacts/{self.moneybird_id}/moneybird_payments_mandate", data=data
231+
response = administration.post(
232+
f"contacts/{self.moneybird_id}/moneybird_payments_mandate/url", data={}
238233
)
239-
logging.info("Sent SEPA mandate request to %s", self)
234+
return response.get("url")
240235

241236

242237
class ContactResourceType(resources.ContactResourceType):
@@ -319,17 +314,6 @@ def serialize_for_moneybird(cls, instance):
319314
)
320315
data["sepa_sequence_type"] = instance.sepa_sequence_type
321316

322-
data["invoice_workflow_id"] = (
323-
instance.invoice_workflow.moneybird_id
324-
if instance.invoice_workflow
325-
else None
326-
)
327-
data["estimate_workflow_id"] = (
328-
instance.estimate_workflow.moneybird_id
329-
if instance.estimate_workflow
330-
else None
331-
)
332-
333317
data["send_invoices_to_email"] = instance.email
334318
data["send_estimates_to_email"] = instance.email
335319
return data

landolfio/inventory/locale/nl/LC_MESSAGES/django.po

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2025-10-12 18:57+0200\n"
10+
"POT-Creation-Date: 2025-10-13 11:01+0200\n"
1111
"PO-Revision-Date: 2023-02-21 13:39+0100\n"
1212
"Last-Translator: Job Doesburg <job.doesburg@gmail.com>\n"
1313
"Language-Team: \n"
@@ -59,57 +59,57 @@ msgstr "heeft huurovereenkomst"
5959
msgid "has loan agreement"
6060
msgstr "heeft leenovereenkomst"
6161

62-
#: inventory/admin.py:281
62+
#: inventory/admin.py:280
6363
#, fuzzy
6464
#| msgid "margin"
6565
msgid "margin asset"
6666
msgstr "marge"
6767

68-
#: inventory/admin.py:288 inventory/models/asset.py:145
68+
#: inventory/admin.py:287 inventory/models/asset.py:145
6969
msgid "start date"
7070
msgstr "startdatum"
7171

72-
#: inventory/admin.py:294
72+
#: inventory/admin.py:293
7373
msgid "Moneybird Asset"
7474
msgstr ""
7575

76-
#: inventory/admin.py:310
76+
#: inventory/admin.py:309
7777
msgid "Moneybird Asset URL"
7878
msgstr ""
7979

80-
#: inventory/admin.py:326
80+
#: inventory/admin.py:325
8181
msgid "disposed"
8282
msgstr ""
8383

84-
#: inventory/admin.py:333
84+
#: inventory/admin.py:332
8585
msgid "disposal reason"
8686
msgstr ""
8787

88-
#: inventory/admin.py:407
88+
#: inventory/admin.py:406
8989
#, fuzzy
9090
#| msgid "categories"
9191
msgid "Categories"
9292
msgstr "categorieën"
9393

94-
#: inventory/admin.py:411 inventory/admin.py:479
94+
#: inventory/admin.py:410 inventory/admin.py:477
9595
msgid "Basic Information"
9696
msgstr ""
9797

98-
#: inventory/admin.py:415
98+
#: inventory/admin.py:414
9999
msgid "Type-Specific Settings"
100100
msgstr ""
101101

102-
#: inventory/admin.py:419
102+
#: inventory/admin.py:418
103103
msgid ""
104104
"Unit is used for numeric properties. Dropdown options should be a JSON array "
105105
"like [\"Option 1\", \"Option 2\"]"
106106
msgstr ""
107107

108-
#: inventory/admin.py:485
108+
#: inventory/admin.py:479
109109
msgid "Display Settings"
110110
msgstr ""
111111

112-
#: inventory/admin.py:492
112+
#: inventory/admin.py:484
113113
msgid "Color"
114114
msgstr ""
115115

@@ -177,11 +177,11 @@ msgstr "beschikbaar of afgeschreven"
177177
msgid "Name must be uppercase"
178178
msgstr ""
179179

180-
#: inventory/models/asset.py:71 inventory/models/asset.py:255
180+
#: inventory/models/asset.py:71 inventory/models/asset.py:256
181181
msgid "out of use"
182182
msgstr ""
183183

184-
#: inventory/models/asset.py:72 inventory/models/asset.py:264
184+
#: inventory/models/asset.py:72 inventory/models/asset.py:266
185185
msgid "divested"
186186
msgstr ""
187187

@@ -202,7 +202,7 @@ msgstr "nummer"
202202
#: inventory/models/asset.py:82 inventory/models/category.py:13
203203
#: inventory/models/category.py:37 inventory/models/collection.py:6
204204
#: inventory/models/location.py:13 inventory/models/location.py:30
205-
#: inventory/models/status_type.py:21
205+
#: inventory/models/status_type.py:23
206206
msgid "name"
207207
msgstr "naam"
208208

@@ -305,25 +305,25 @@ msgstr "aankoopwaarde"
305305
msgid "Current value of the asset from Moneybird"
306306
msgstr "aankoopwaarde"
307307

308-
#: inventory/models/asset.py:271
308+
#: inventory/models/asset.py:273
309309
msgid "active depreciated"
310310
msgstr ""
311311

312-
#: inventory/models/asset.py:275
312+
#: inventory/models/asset.py:277
313313
msgid "active"
314314
msgstr "actief"
315315

316-
#: inventory/models/asset.py:277
316+
#: inventory/models/asset.py:279
317317
msgid "margin"
318318
msgstr "marge"
319319

320-
#: inventory/models/asset.py:728 inventory/models/asset_on_document_line.py:12
320+
#: inventory/models/asset.py:730 inventory/models/asset_on_document_line.py:12
321321
#: inventory/models/asset_property.py:141 inventory/models/attachment.py:17
322322
#: inventory/models/remarks.py:9 inventory/models/status_change.py:13
323323
msgid "asset"
324324
msgstr "eigendom"
325325

326-
#: inventory/models/asset.py:729
326+
#: inventory/models/asset.py:731
327327
msgid "assets"
328328
msgstr "eigendommen"
329329

@@ -485,7 +485,7 @@ msgstr "uploaddatum"
485485
#: inventory/models/attachment.py:30 inventory/models/category.py:23
486486
#: inventory/models/category.py:43 inventory/models/collection.py:9
487487
#: inventory/models/location.py:16 inventory/models/location.py:40
488-
#: inventory/models/status_type.py:47
488+
#: inventory/models/status_type.py:51
489489
msgid "order"
490490
msgstr "volgorde"
491491

@@ -593,49 +593,49 @@ msgstr "status"
593593
msgid "status changes"
594594
msgstr "status"
595595

596-
#: inventory/models/status_type.py:16
596+
#: inventory/models/status_type.py:17
597597
msgid "Unique identifier used in code (e.g., 'available', 'issued_rent')"
598598
msgstr ""
599599

600-
#: inventory/models/status_type.py:22
600+
#: inventory/models/status_type.py:24
601601
msgid "Display name for this status"
602602
msgstr ""
603603

604-
#: inventory/models/status_type.py:27
604+
#: inventory/models/status_type.py:29
605605
msgid "background color"
606606
msgstr ""
607607

608-
#: inventory/models/status_type.py:29
608+
#: inventory/models/status_type.py:31
609609
msgid "Hex color code for background (e.g., '#198754' for green)"
610610
msgstr ""
611611

612-
#: inventory/models/status_type.py:34
612+
#: inventory/models/status_type.py:36
613613
msgid "text color"
614614
msgstr ""
615615

616-
#: inventory/models/status_type.py:36
616+
#: inventory/models/status_type.py:38
617617
msgid "Hex color code for text (e.g., '#ffffff' for white)"
618618
msgstr ""
619619

620-
#: inventory/models/status_type.py:41
620+
#: inventory/models/status_type.py:43
621621
msgid "is archived"
622622
msgstr ""
623623

624-
#: inventory/models/status_type.py:42
624+
#: inventory/models/status_type.py:45
625625
msgid "Indicates if this status means the asset is archived/no longer active"
626626
msgstr ""
627627

628-
#: inventory/models/status_type.py:48
628+
#: inventory/models/status_type.py:52
629629
msgid "Display order in lists and dropdowns"
630630
msgstr ""
631631

632-
#: inventory/models/status_type.py:53
632+
#: inventory/models/status_type.py:57
633633
#, fuzzy
634634
#| msgid "start date"
635635
msgid "status type"
636636
msgstr "startdatum"
637637

638-
#: inventory/models/status_type.py:54
638+
#: inventory/models/status_type.py:58
639639
#, fuzzy
640640
#| msgid "start date"
641641
msgid "status types"

0 commit comments

Comments
 (0)