mirror of
https://github.com/frappe/books.git
synced 2024-12-22 19:09:01 +00:00
fix: show Ledger Entries
This commit is contained in:
parent
9bb5299b97
commit
cda198bc69
@ -64,12 +64,11 @@ export function getLedgerLinkAction(fyo: Fyo): Action {
|
|||||||
router.push({
|
router.push({
|
||||||
name: 'Report',
|
name: 'Report',
|
||||||
params: {
|
params: {
|
||||||
reportName: 'general-ledger',
|
reportClassName: 'GeneralLedger',
|
||||||
defaultFilters: {
|
defaultFilters: JSON.stringify({
|
||||||
// @ts-ignore
|
|
||||||
referenceType: doc.schemaName,
|
referenceType: doc.schemaName,
|
||||||
referenceName: doc.name,
|
referenceName: doc.name,
|
||||||
},
|
}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -57,7 +57,7 @@ export abstract class Report extends Observable<RawValue> {
|
|||||||
return filterMap;
|
return filterMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
async set(key: string, value: RawValue) {
|
async set(key: string, value: RawValue, callPostSet: boolean = true) {
|
||||||
const field = this.filters.find((f) => f.fieldname === key);
|
const field = this.filters.find((f) => f.fieldname === key);
|
||||||
if (field === undefined) {
|
if (field === undefined) {
|
||||||
return;
|
return;
|
||||||
@ -74,6 +74,12 @@ export abstract class Report extends Observable<RawValue> {
|
|||||||
this[key] = value;
|
this[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (callPostSet) {
|
||||||
|
await this.postSet(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async postSet(key?: string) {
|
||||||
await this.setDefaultFilters();
|
await this.setDefaultFilters();
|
||||||
this.filters = await this.getFilters();
|
this.filters = await this.getFilters();
|
||||||
this.columns = await this.getColumns();
|
this.columns = await this.getColumns();
|
||||||
|
@ -47,6 +47,10 @@ import { defineComponent } from 'vue';
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
reportClassName: String,
|
reportClassName: String,
|
||||||
|
defaultFilters: {
|
||||||
|
type: String,
|
||||||
|
default: '{}',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -62,6 +66,17 @@ export default defineComponent({
|
|||||||
components: { PageHeader, FormControl, ListReport, DropdownWithActions },
|
components: { PageHeader, FormControl, ListReport, DropdownWithActions },
|
||||||
async activated() {
|
async activated() {
|
||||||
await this.setReportData();
|
await this.setReportData();
|
||||||
|
|
||||||
|
const filters = JSON.parse(this.defaultFilters);
|
||||||
|
const filterKeys = Object.keys(filters);
|
||||||
|
for (const key of filterKeys) {
|
||||||
|
await this.report.set(key, filters[key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (filterKeys.length) {
|
||||||
|
await this.report.postSet()
|
||||||
|
}
|
||||||
|
|
||||||
if (fyo.store.isDevelopment) {
|
if (fyo.store.isDevelopment) {
|
||||||
window.rep = this;
|
window.rep = this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user