Skip to content

Commit

Permalink
feat: add note to "Download Bank Statements" modal
Browse files Browse the repository at this point in the history
(cherry picked from commit 7ccbc26)

# Conflicts:
#	banking/translations/de.csv
  • Loading branch information
barredterra authored and mergify[bot] committed Dec 17, 2024
1 parent d23fe75 commit c4d2f19
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 26 deletions.
80 changes: 54 additions & 26 deletions banking/ebics/doctype/ebics_user/ebics_user.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,32 +151,60 @@ async function confirm_bank_keys(ebics_user, passphrase) {
}

function download_bank_statements(ebics_user, needs_passphrase) {
const fields = [
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
default: frappe.datetime.now_date(),
},
{
fieldname: "to_date",
label: __("To Date"),
fieldtype: "Date",
default: frappe.datetime.now_date(),
},
];

if (needs_passphrase) {
fields.push({
fieldname: "passphrase",
label: __("Passphrase"),
fieldtype: "Password",
reqd: true
});
}

frappe.prompt(
fields,
const dialog = frappe.prompt(
[
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
default: frappe.datetime.now_date(),
onchange: () => {
const from_date = dialog.get_value("from_date");
const empty_disclaimer = __(
"If no <a href='/app/bank-transaction' target='_blank'>Bank Transactions</a> are created, please check the <a href='/app/error-log' target='_blank'>Error Logs</a>. If there are no errors, the bank likely did not provide any (new) bank statements for this period."
);
if (from_date == frappe.datetime.now_date()) {
dialog.set_df_property(
"note",
"options",
__(
"We'll try to download new transactions from today, using <code>camt.052</code>."
) + `<br><br>${empty_disclaimer}`
);
} else {
dialog.set_df_property(
"note",
"options",
__(
"We'll try to download all transactions of completed days in the selected period, using <code>camt.053</code>."
) + `<br><br>${empty_disclaimer}`
);
}
},
},
{
fieldname: "to_date",
label: __("To Date"),
fieldtype: "Date",
default: frappe.datetime.now_date(),
},
...(
needs_passphrase
? [
{
fieldname: "passphrase",
label: __("Passphrase"),
fieldtype: "Password",
reqd: true,
},
]
: []
),
{
fieldname: "note",
fieldtype: "HTML",
},
],
async (values) => {
try {
await frappe.xcall(
Expand Down
6 changes: 6 additions & 0 deletions banking/translations/de.csv
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,10 @@ Intraday Sync,Untertägige Synchronisation,
"If enabled, <code>camt.052</code> transactions are downloaded four times a day. Otherwise <code>camt.053</code> transactions are downloaded once a day.","Falls aktiviert, werden <code>camt.052</code>-Transaktionen viermal am Tag heruntergeladen. Andernfalls werden <code>camt.053</code>-Transaktionen einmal am Tag heruntergeladen.",
"It seems like EBICS User {0} lacks permission 'C52' for downloading intraday transactions. The permitted types are: {1}.","Es scheint, dass dem EBICS-Benutzer {0} die Berechtigung 'C52' zum Herunterladen von untertägigen Kontoauszügen fehlt. Die zulässigen Typen sind: {1}.",
"It seems like EBICS User {0} lacks permission 'C53' for downloading booked bank statements. The permitted types are: {1}.","Es scheint, dass dem EBICS-Benutzer {0} die Berechtigung 'C53' zum Herunterladen von gebuchten Kontoauszügen fehlt. Die zulässigen Typen sind: {1}.",
<<<<<<< HEAD
>>>>>>> 31d7ce7 (feat: add german translations)
=======
"If no <a href='/app/bank-transaction' target='_blank'>Bank Transactions</a> are created, please check the <a href='/app/error-log' target='_blank'>Error Logs</a>. If there are no errors, the bank likely did not provide any (new) bank statements for this period.","Wenn keine <a href='/app/bank-transaction' target='_blank'>Banktransaktionen</a> erstellt wurden, überprüfen Sie bitte die <a href='/app/error-log' target='_blank'>Fehlerprotokolle</a>. Wenn keine Fehler vorliegen, hat die Bank wahrscheinlich keine (neuen) Kontoauszüge für diesen Zeitraum bereitgestellt.",
"We'll try to download new transactions from today, using <code>camt.052</code>.","Wir versuchen, neue Transaktionen von heute via <code>camt.052</code> herunterzuladen.",
"We'll try to download all transactions of completed days in the selected period, using <code>camt.053</code>.","Wir versuchen, alle Transaktionen der abgeschlossenen Tage im ausgewählten Zeitraum via <code>camt.053</code> herunterzuladen.",
>>>>>>> 7ccbc26 (feat: add note to "Download Bank Statements" modal)

0 comments on commit c4d2f19

Please sign in to comment.