2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Moved function promptWhenGstUnavailable to gst.js

This commit is contained in:
Piyush Singhania 2021-12-12 15:03:59 +05:30 committed by Alan
parent 6c29f0c4ba
commit 776f12c2d1
2 changed files with 20 additions and 18 deletions

View File

@ -4,7 +4,7 @@ import { IPC_ACTIONS } from '@/messages';
import { ipcRenderer } from 'electron';
import { DateTime } from 'luxon';
import { sleep } from 'frappejs/utils';
import { makeJSON, promptWhenGstUnavailable } from '@/utils';
import { makeJSON, showMessageDialog } from '@/utils';
/**
* GST is a map which gives a final rate for any given gst item
@ -174,3 +174,22 @@ async function getSavePath(name = 'gstr1') {
return filePath;
}
export function promptWhenGstUnavailable() {
return new Promise((resolve) => {
showMessageDialog({
message: _('Export failed!'),
description: _(
'Report cannot be exported if company gst details are not configured'
),
buttons: [
{
label: _('Ok'),
action() {
resolve(true);
},
},
],
});
});
}

View File

@ -306,20 +306,3 @@ export function fuzzyMatch(keyword, candidate) {
export function openSettings(tab) {
routeTo({ path: '/settings', query: { tab } });
}
export function promptWhenGstUnavailable() {
return new Promise((resolve) => {
showMessageDialog({
message: _('Export failed!'),
description: _('Report cannot be exported if company gst details are not configured'),
buttons: [
{
label: _('Ok'),
action() {
resolve(true);
},
},
],
});
});
}