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:
parent
6c29f0c4ba
commit
776f12c2d1
@ -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);
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
}
|
||||
|
17
src/utils.js
17
src/utils.js
@ -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);
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user