2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +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

@ -286,21 +286,21 @@ export default {
return this.doc.insertOrUpdate().catch(this.handleError);
},
onSubmitClick() {
let message =
let message =
this.doctype === 'SalesInvoice'
? 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 Invoice?')
: this._('Are you sure you want to submit this Bill?');
showMessageDialog({
message,
buttons: [
{
label: this._('Submit'),
label: this._('Yes'),
action: () => {
this.doc.submit().catch(this.handleError);
},
},
{
label: this._('Cancel'),
label: this._('No'),
action() {},
},
],

View File

@ -123,7 +123,12 @@ import DropdownWithActions from '@/components/DropdownWithActions';
import FormControl from '@/components/Controls/FormControl';
import BackLink from '@/components/BackLink';
import StatusBadge from '@/components/StatusBadge';
import { handleErrorWithDialog, getActionsForDocument, routeTo } from '@/utils';
import {
handleErrorWithDialog,
showMessageDialog,
getActionsForDocument,
routeTo,
} from '@/utils';
export default {
name: 'JournalEntryForm',
@ -194,7 +199,21 @@ export default {
return this.doc.insertOrUpdate().catch(this.handleError);
},
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) {
handleErrorWithDialog(e, this.doc);