2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +00:00

fix(ux): journal entry submission confirmation; message

This commit is contained in:
18alantom 2021-12-16 17:22:23 +05:30 committed by Alan
parent eab88f61a1
commit b7cd516138
2 changed files with 26 additions and 7 deletions

View File

@ -288,19 +288,19 @@ export default {
onSubmitClick() { onSubmitClick() {
let message = let message =
this.doctype === 'SalesInvoice' this.doctype === 'SalesInvoice'
? this._('Are you sure you want to submit this invoice?') ? this._('Are you sure you want to submit this Invoice?')
: this._('Are you sure you want to submit this bill?'); : this._('Are you sure you want to submit this Bill?');
showMessageDialog({ showMessageDialog({
message, message,
buttons: [ buttons: [
{ {
label: this._('Submit'), label: this._('Yes'),
action: () => { action: () => {
this.doc.submit().catch(this.handleError); this.doc.submit().catch(this.handleError);
}, },
}, },
{ {
label: this._('Cancel'), label: this._('No'),
action() {}, action() {},
}, },
], ],

View File

@ -123,7 +123,12 @@ import DropdownWithActions from '@/components/DropdownWithActions';
import FormControl from '@/components/Controls/FormControl'; import FormControl from '@/components/Controls/FormControl';
import BackLink from '@/components/BackLink'; import BackLink from '@/components/BackLink';
import StatusBadge from '@/components/StatusBadge'; import StatusBadge from '@/components/StatusBadge';
import { handleErrorWithDialog, getActionsForDocument, routeTo } from '@/utils'; import {
handleErrorWithDialog,
showMessageDialog,
getActionsForDocument,
routeTo,
} from '@/utils';
export default { export default {
name: 'JournalEntryForm', name: 'JournalEntryForm',
@ -194,7 +199,21 @@ export default {
return this.doc.insertOrUpdate().catch(this.handleError); return this.doc.insertOrUpdate().catch(this.handleError);
}, },
async onSubmitClick() { async onSubmitClick() {
await this.doc.submit().catch(this.handleError); showMessageDialog({
message: this._('Are you sure you want to submit this Journal Entry?'),
buttons: [
{
label: this._('Yes'),
action: () => {
this.doc.submit().catch(this.handleError);
},
},
{
label: this._('No'),
action() {},
},
],
});
}, },
handleError(e) { handleError(e) {
handleErrorWithDialog(e, this.doc); handleErrorWithDialog(e, this.doc);