Skip to content

Commit

Permalink
add für_moneyplex_exportiert to PAyment entry and set it. issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
roquegv committed Sep 1, 2023
1 parent 9f82b60 commit 287d90f
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 3 deletions.
106 changes: 106 additions & 0 deletions moneyplex/fixtures/custom_field.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,59 @@
"unique": 0,
"width": null
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": null,
"columns": 0,
"default": null,
"depends_on": null,
"description": null,
"docstatus": 0,
"doctype": "Custom Field",
"dt": "Payment Entry",
"fetch_from": null,
"fetch_if_empty": 0,
"fieldname": "moneyplex_section",
"fieldtype": "Section Break",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "mode_of_payment",
"label": "Moneyplex Section",
"length": 0,
"mandatory_depends_on": null,
"modified": "2023-09-01 11:37:13.176329",
"name": "Payment Entry-moneyplex_section",
"no_copy": 0,
"non_negative": 0,
"options": null,
"parent": null,
"parentfield": null,
"parenttype": null,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": null,
"read_only": 0,
"read_only_depends_on": null,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"translatable": 0,
"unique": 0,
"width": null
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
Expand Down Expand Up @@ -317,6 +370,59 @@
"unique": 0,
"width": null
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": null,
"columns": 0,
"default": null,
"depends_on": null,
"description": null,
"docstatus": 0,
"doctype": "Custom Field",
"dt": "Payment Entry",
"fetch_from": null,
"fetch_if_empty": 0,
"fieldname": "f\u00fcr_moneyplex_exportiert",
"fieldtype": "Check",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "moneyplex_section",
"label": "F\u00fcr Moneyplex exportiert",
"length": 0,
"mandatory_depends_on": null,
"modified": "2023-09-01 11:40:52.306346",
"name": "Payment Entry-f\u00fcr_moneyplex_exportiert",
"no_copy": 0,
"non_negative": 0,
"options": null,
"parent": null,
"parentfield": null,
"parenttype": null,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": null,
"read_only": 0,
"read_only_depends_on": null,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"translatable": 0,
"unique": 0,
"width": null
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
Expand Down
4 changes: 3 additions & 1 deletion moneyplex/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@
"Payment Request-moneypley_column_break",
"Payment Request-party_bank_account",
"Payment Request-party_iban",
"Payment Request-party_bic"
"Payment Request-party_bic",
"Payment Entry-moneyplex_section",
"Payment Entry-für_moneyplex_exportiert"
]
]
]},
Expand Down
5 changes: 3 additions & 2 deletions moneyplex/moneyplex/server_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ def moneyplex_export():

payment_entries = []
for name in names:
# set für_moneyplex_exportiert to 1
frappe.db.set_value("Payment Request", name, "für_moneyplex_exportiert", 1)
# create payment entries
doc = frappe.get_doc("Payment Request", name)
pe = doc.create_payment_entry(submit=True)
payment_entries.append(pe.name)
# set für_moneyplex_exportiert to 1
frappe.db.set_value("Payment Entry", pe.name, "für_moneyplex_exportiert", 1)
frappe.db.set_value("Payment Request", name, "für_moneyplex_exportiert", 1)

if payment_entries:
message = "Payment Entries generated: "
Expand Down

0 comments on commit 287d90f

Please sign in to comment.