mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
feat: add number series to the forms
This commit is contained in:
parent
454a2f5a95
commit
2de72153e4
@ -27,6 +27,20 @@ module.exports = {
|
||||
fieldtype: 'Data',
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldname: 'start',
|
||||
label: t`Start`,
|
||||
fieldtype: 'Int',
|
||||
default: 1001,
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldname: 'padZeros',
|
||||
label: t`Pad Zeros`,
|
||||
fieldtype: 'Int',
|
||||
default: 4,
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldname: 'referenceType',
|
||||
label: t`Reference Type`,
|
||||
@ -35,13 +49,7 @@ module.exports = {
|
||||
map: referenceTypeMap,
|
||||
default: '-',
|
||||
required: 1,
|
||||
},
|
||||
{
|
||||
fieldname: 'start',
|
||||
label: t`Start`,
|
||||
fieldtype: 'Int',
|
||||
default: 1001,
|
||||
required: 1,
|
||||
readOnly: 1,
|
||||
},
|
||||
{
|
||||
fieldname: 'current',
|
||||
@ -51,4 +59,5 @@ module.exports = {
|
||||
readOnly: 1,
|
||||
},
|
||||
],
|
||||
quickEditFields: ['start', 'padZeros', 'referenceType'],
|
||||
};
|
||||
|
@ -1,10 +1,9 @@
|
||||
<script>
|
||||
import frappe from 'frappe';
|
||||
import AutoComplete from './AutoComplete';
|
||||
import Badge from '@/components/Badge';
|
||||
import { openQuickEdit } from '@/utils';
|
||||
import frappe, { t } from 'frappe';
|
||||
import { markRaw } from 'vue';
|
||||
import { t } from 'frappe';
|
||||
import AutoComplete from './AutoComplete';
|
||||
|
||||
export default {
|
||||
name: 'Link',
|
||||
@ -84,12 +83,20 @@ export default {
|
||||
};
|
||||
},
|
||||
async getFilters(keyword) {
|
||||
if (this.doc) {
|
||||
return this.df.getFilters
|
||||
? (await this.df.getFilters(keyword, this.doc)) || {}
|
||||
: {};
|
||||
const { getFilters } = this.df;
|
||||
if (!getFilters) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (this.doc) {
|
||||
return (await getFilters(keyword, this.doc)) ?? {};
|
||||
}
|
||||
|
||||
try {
|
||||
return (await getFilters()) ?? {};
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
return {};
|
||||
},
|
||||
getTarget() {
|
||||
return this.df.target;
|
||||
|
@ -103,6 +103,14 @@
|
||||
@change="(value) => doc.set('date', value)"
|
||||
:read-only="doc.submitted"
|
||||
/>
|
||||
<FormControl
|
||||
class="mt-2 text-base"
|
||||
input-class="bg-gray-100 px-3 py-2 text-base text-right"
|
||||
:df="meta.getField('numberSeries')"
|
||||
:value="doc.numberSeries"
|
||||
@change="(value) => doc.set('numberSeries', value)"
|
||||
:read-only="doc.submitted"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -190,20 +198,20 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import frappe from 'frappe';
|
||||
import StatusBadge from '@/components/StatusBadge';
|
||||
import PageHeader from '@/components/PageHeader';
|
||||
import BackLink from '@/components/BackLink';
|
||||
import Button from '@/components/Button';
|
||||
import FormControl from '@/components/Controls/FormControl';
|
||||
import DropdownWithActions from '@/components/DropdownWithActions';
|
||||
import BackLink from '@/components/BackLink';
|
||||
import PageHeader from '@/components/PageHeader';
|
||||
import StatusBadge from '@/components/StatusBadge';
|
||||
import {
|
||||
openSettings,
|
||||
getActionsForDocument,
|
||||
getInvoiceStatus,
|
||||
showMessageDialog,
|
||||
routeTo,
|
||||
getActionsForDocument,
|
||||
getInvoiceStatus,
|
||||
openSettings,
|
||||
routeTo,
|
||||
showMessageDialog
|
||||
} from '@/utils';
|
||||
import frappe from 'frappe';
|
||||
import { handleErrorWithDialog } from '../errorHandling';
|
||||
|
||||
export default {
|
||||
|
@ -35,7 +35,7 @@
|
||||
<h1 class="text-2xl font-semibold">
|
||||
{{ doc._notInserted ? t`New Journal Entry` : doc.name }}
|
||||
</h1>
|
||||
<div class="flex justify-between mt-2">
|
||||
<div class="flex justify-between mt-2 gap-2">
|
||||
<div class="w-1/3">
|
||||
<FormControl
|
||||
:df="meta.getField('entryType')"
|
||||
@ -78,6 +78,16 @@
|
||||
:class="doc.submitted && 'pointer-events-none'"
|
||||
/>
|
||||
</div>
|
||||
<div class="w-1/3">
|
||||
<FormControl
|
||||
:df="meta.getField('numberSeries')"
|
||||
:value="doc.numberSeries"
|
||||
@change="(value) => doc.set('numberSeries', value)"
|
||||
input-class="bg-gray-100 p-2 text-base"
|
||||
:read-only="doc.submitted"
|
||||
:class="doc.submitted && 'pointer-events-none'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2 px-6 text-base">
|
||||
@ -118,14 +128,14 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import frappe from 'frappe';
|
||||
import PageHeader from '@/components/PageHeader';
|
||||
import Button from '@/components/Button';
|
||||
import DropdownWithActions from '@/components/DropdownWithActions';
|
||||
import FormControl from '@/components/Controls/FormControl';
|
||||
import BackLink from '@/components/BackLink';
|
||||
import Button from '@/components/Button';
|
||||
import FormControl from '@/components/Controls/FormControl';
|
||||
import DropdownWithActions from '@/components/DropdownWithActions';
|
||||
import PageHeader from '@/components/PageHeader';
|
||||
import StatusBadge from '@/components/StatusBadge';
|
||||
import { showMessageDialog, getActionsForDocument, routeTo } from '@/utils';
|
||||
import { getActionsForDocument, routeTo, showMessageDialog } from '@/utils';
|
||||
import frappe from 'frappe';
|
||||
import { handleErrorWithDialog } from '../errorHandling';
|
||||
|
||||
export default {
|
||||
|
Loading…
Reference in New Issue
Block a user