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:
parent
eab88f61a1
commit
b7cd516138
@ -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() {},
|
||||
},
|
||||
],
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user