';
if (skipped > 0) {
table += '
' +
@@ -150,6 +157,14 @@ const BIExcelImport = {
__("Open the Bank Integration Excel Preset, enable 'Use Custom Date Format', and set the exact format your bank uses.") +
'
';
}
+ if (droppedDirection > 0) {
+ const sample = (unknownDirections || []).map(frappe.utils.escape_html).join(', ');
+ table += '
' +
+ __('Dropped {0} row(s) — unknown direction value(s):', [droppedDirection]) +
+ ' ' + (sample || '?') + '. ' +
+ __('Open the preset and add these to Debit Values or Credit Values.') +
+ '
';
+ }
if (droppedAmount > 0) {
table += '
' +
__('Dropped {0} row(s) — missing or zero amount.', [droppedAmount]) +
@@ -301,6 +316,30 @@ const BIExcelImport = {
d.show();
},
+ _showDirectionHelp(droppedCount, unknownDirections, presetName) {
+ const openPreset = function () {
+ frappe.set_route('Form', 'Bank Integration Excel Preset', presetName);
+ };
+ const sample = (unknownDirections || []).map(frappe.utils.escape_html).join(', ') || '?';
+ const d = new frappe.ui.Dialog({
+ title: __('Unknown Direction Values'),
+ fields: [{
+ fieldtype: 'HTML',
+ options:
+ '
' +
+ __('All {0} row(s) were dropped because the Direction column contained values not configured on the preset.', [droppedCount]) +
+ '
' +
+ '
' + __('Unrecognised values:') + ' ' + sample + '
' +
+ '
' + __('Open the preset and add these to Debit Values (for outflows) or Credit Values (for inflows), comma-separated.') + '
',
+ }],
+ primary_action_label: __('Open Preset'),
+ primary_action() { d.hide(); openPreset(); },
+ secondary_action_label: __('Close'),
+ secondary_action() { d.hide(); },
+ });
+ d.show();
+ },
+
_closeProgress() {
try {
if (frappe.cur_progress) {