mirror of
https://github.com/frappe/books.git
synced 2025-02-02 12:08:27 +00:00
refactor: rename linkFields to actions, remove clear filter from viewConfigs
This commit is contained in:
parent
9869daf498
commit
c4c5ef3a9f
@ -43,7 +43,7 @@ export default {
|
|||||||
fieldname: 'toDate',
|
fieldname: 'toDate',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
linkFields: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: 'Reconcile',
|
label: 'Reconcile',
|
||||||
type: 'secondary',
|
type: 'secondary',
|
||||||
@ -62,14 +62,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'Clear Filters',
|
|
||||||
type: 'secondary',
|
|
||||||
action: async (report) => {
|
|
||||||
await report.getReportData({});
|
|
||||||
report.usedToReRender += 1;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
getColumns() {
|
getColumns() {
|
||||||
return [
|
return [
|
||||||
|
@ -67,21 +67,7 @@ const viewConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
method: 'general-ledger',
|
method: 'general-ledger',
|
||||||
linkFields: [
|
actions: [],
|
||||||
{
|
|
||||||
label: 'Clear Filters',
|
|
||||||
type: 'secondary',
|
|
||||||
action: async report => {
|
|
||||||
await report.getReportData({});
|
|
||||||
report.usedToReRender += 1;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Export',
|
|
||||||
type: 'primary',
|
|
||||||
action: () => {}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
getColumns() {
|
getColumns() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { generateGstr1Json } from '../../accounting/gst';
|
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
|
import { generateGstr1Json } from '../../accounting/gst';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
filterFields: [
|
filterFields: [
|
||||||
@ -41,22 +41,15 @@ export default {
|
|||||||
default: () => DateTime.local().toISODate(),
|
default: () => DateTime.local().toISODate(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
linkFields: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: 'Export as JSON',
|
group: 'Export',
|
||||||
type: 'secondary',
|
label: 'JSON',
|
||||||
|
type: 'primary',
|
||||||
action: async (report, filters) => {
|
action: async (report, filters) => {
|
||||||
generateGstr1Json(report, filters);
|
generateGstr1Json(report, filters);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'Clear Filters',
|
|
||||||
type: 'secondary',
|
|
||||||
action: async report => {
|
|
||||||
await report.getReportData({});
|
|
||||||
report.usedToReRender += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
|
||||||
getColumns() {
|
getColumns() {
|
||||||
|
@ -5,6 +5,6 @@ export default {
|
|||||||
title: title,
|
title: title,
|
||||||
method: 'gstr-1',
|
method: 'gstr-1',
|
||||||
filterFields: baseConfig.filterFields,
|
filterFields: baseConfig.filterFields,
|
||||||
linkFields: baseConfig.linkFields,
|
actions: baseConfig.actions,
|
||||||
getColumns: baseConfig.getColumns,
|
getColumns: baseConfig.getColumns,
|
||||||
};
|
};
|
||||||
|
@ -5,6 +5,6 @@ export default {
|
|||||||
title: title,
|
title: title,
|
||||||
method: 'gstr-2',
|
method: 'gstr-2',
|
||||||
filterFields: baseConfig.filterFields,
|
filterFields: baseConfig.filterFields,
|
||||||
linkFields: baseConfig.linkFields,
|
actions: baseConfig.actions,
|
||||||
getColumns: baseConfig.getColumns,
|
getColumns: baseConfig.getColumns,
|
||||||
};
|
};
|
||||||
|
@ -11,17 +11,17 @@ export default {
|
|||||||
fieldname: 'supplier',
|
fieldname: 'supplier',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
placeholder: 'Supplier Name',
|
placeholder: 'Supplier Name',
|
||||||
getFilters: query => {
|
getFilters: (query) => {
|
||||||
if (query)
|
if (query)
|
||||||
return {
|
return {
|
||||||
keywords: ['like', query],
|
keywords: ['like', query],
|
||||||
supplier: 1
|
supplier: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
supplier: 1
|
supplier: 1,
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: 'Date',
|
fieldtype: 'Date',
|
||||||
@ -29,7 +29,7 @@ export default {
|
|||||||
size: 'small',
|
size: 'small',
|
||||||
placeholder: 'From Date',
|
placeholder: 'From Date',
|
||||||
label: 'From Date',
|
label: 'From Date',
|
||||||
required: 1
|
required: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: 'Date',
|
fieldtype: 'Date',
|
||||||
@ -37,19 +37,10 @@ export default {
|
|||||||
placeholder: 'To Date',
|
placeholder: 'To Date',
|
||||||
fieldname: 'toDate',
|
fieldname: 'toDate',
|
||||||
label: 'To Date',
|
label: 'To Date',
|
||||||
required: 1
|
required: 1,
|
||||||
}
|
},
|
||||||
],
|
|
||||||
linkFields: [
|
|
||||||
{
|
|
||||||
label: 'Clear Filters',
|
|
||||||
type: 'secondary',
|
|
||||||
action: async report => {
|
|
||||||
await report.getReportData({});
|
|
||||||
report.usedToReRender += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
actions: [],
|
||||||
getColumns() {
|
getColumns() {
|
||||||
return [
|
return [
|
||||||
{ label: 'PurchaseInvoice', fieldname: 'name' },
|
{ label: 'PurchaseInvoice', fieldname: 'name' },
|
||||||
@ -58,7 +49,7 @@ export default {
|
|||||||
{ label: 'Payable Account', fieldname: 'account' },
|
{ label: 'Payable Account', fieldname: 'account' },
|
||||||
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' },
|
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' },
|
||||||
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' },
|
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' },
|
||||||
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' }
|
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' },
|
||||||
];
|
];
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
@ -11,17 +11,17 @@ export default {
|
|||||||
size: 'small',
|
size: 'small',
|
||||||
placeholder: 'Customer Name',
|
placeholder: 'Customer Name',
|
||||||
fieldname: 'customer',
|
fieldname: 'customer',
|
||||||
getFilters: query => {
|
getFilters: (query) => {
|
||||||
if (query)
|
if (query)
|
||||||
return {
|
return {
|
||||||
keywords: ['like', query],
|
keywords: ['like', query],
|
||||||
customer: 1
|
customer: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
customer: 1
|
customer: 1,
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: 'Date',
|
fieldtype: 'Date',
|
||||||
@ -29,7 +29,7 @@ export default {
|
|||||||
size: 'small',
|
size: 'small',
|
||||||
placeholder: 'From Date',
|
placeholder: 'From Date',
|
||||||
label: 'From Date',
|
label: 'From Date',
|
||||||
required: 1
|
required: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: 'Date',
|
fieldtype: 'Date',
|
||||||
@ -37,19 +37,10 @@ export default {
|
|||||||
placeholder: 'To Date',
|
placeholder: 'To Date',
|
||||||
fieldname: 'toDate',
|
fieldname: 'toDate',
|
||||||
label: 'To Date',
|
label: 'To Date',
|
||||||
required: 1
|
required: 1,
|
||||||
}
|
},
|
||||||
],
|
|
||||||
linkFields: [
|
|
||||||
{
|
|
||||||
label: 'Clear Filters',
|
|
||||||
type: 'secondary',
|
|
||||||
action: async report => {
|
|
||||||
await report.getReportData({});
|
|
||||||
report.usedToReRender += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
actions: [],
|
||||||
getColumns() {
|
getColumns() {
|
||||||
return [
|
return [
|
||||||
{ label: 'SalesInvoice', fieldname: 'name' },
|
{ label: 'SalesInvoice', fieldname: 'name' },
|
||||||
@ -58,7 +49,7 @@ export default {
|
|||||||
{ label: 'Receivable Account', fieldname: 'account' },
|
{ label: 'Receivable Account', fieldname: 'account' },
|
||||||
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' },
|
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' },
|
||||||
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' },
|
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' },
|
||||||
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' }
|
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' },
|
||||||
];
|
];
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
@ -16,7 +16,7 @@ export default {
|
|||||||
required: 1,
|
required: 1,
|
||||||
default: async () => {
|
default: async () => {
|
||||||
return (await frappe.getSingle('AccountingSettings')).fiscalYearStart;
|
return (await frappe.getSingle('AccountingSettings')).fiscalYearStart;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: 'Date',
|
fieldtype: 'Date',
|
||||||
@ -27,46 +27,37 @@ export default {
|
|||||||
required: 1,
|
required: 1,
|
||||||
default: async () => {
|
default: async () => {
|
||||||
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
|
return (await frappe.getSingle('AccountingSettings')).fiscalYearEnd;
|
||||||
}
|
},
|
||||||
}
|
|
||||||
],
|
|
||||||
linkFields: [
|
|
||||||
{
|
|
||||||
label: 'Clear Filters',
|
|
||||||
type: 'secondary',
|
|
||||||
action: async report => {
|
|
||||||
await report.getReportData({});
|
|
||||||
report.usedToReRender += 1;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
actions: [],
|
||||||
getColumns(data) {
|
getColumns(data) {
|
||||||
const columns = [
|
const columns = [
|
||||||
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 2 },
|
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 2 },
|
||||||
{
|
{
|
||||||
label: 'Opening (Dr)',
|
label: 'Opening (Dr)',
|
||||||
fieldtype: 'Currency',
|
fieldtype: 'Currency',
|
||||||
fieldname: 'openingDebit'
|
fieldname: 'openingDebit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Opening (Cr)',
|
label: 'Opening (Cr)',
|
||||||
fieldtype: 'Currency',
|
fieldtype: 'Currency',
|
||||||
fieldname: 'openingCredit'
|
fieldname: 'openingCredit',
|
||||||
},
|
},
|
||||||
{ label: 'Debit', fieldtype: 'Currency', fieldname: 'debit' },
|
{ label: 'Debit', fieldtype: 'Currency', fieldname: 'debit' },
|
||||||
{ label: 'Credit', fieldtype: 'Currency', fieldname: 'credit' },
|
{ label: 'Credit', fieldtype: 'Currency', fieldname: 'credit' },
|
||||||
{
|
{
|
||||||
label: 'Closing (Dr)',
|
label: 'Closing (Dr)',
|
||||||
fieldtype: 'Currency',
|
fieldtype: 'Currency',
|
||||||
fieldname: 'closingDebit'
|
fieldname: 'closingDebit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Closing (Cr)',
|
label: 'Closing (Cr)',
|
||||||
fieldtype: 'Currency',
|
fieldtype: 'Currency',
|
||||||
fieldname: 'closingCredit'
|
fieldname: 'closingCredit',
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return columns;
|
return columns;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user