mirror of
https://github.com/frappe/books.git
synced 2024-11-09 23:30:56 +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({
|
||||
name: 'Report',
|
||||
params: {
|
||||
reportName: 'general-ledger',
|
||||
defaultFilters: {
|
||||
// @ts-ignore
|
||||
reportClassName: 'GeneralLedger',
|
||||
defaultFilters: JSON.stringify({
|
||||
referenceType: doc.schemaName,
|
||||
referenceName: doc.name,
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
},
|
||||
|
@ -57,7 +57,7 @@ export abstract class Report extends Observable<RawValue> {
|
||||
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);
|
||||
if (field === undefined) {
|
||||
return;
|
||||
@ -74,6 +74,12 @@ export abstract class Report extends Observable<RawValue> {
|
||||
this[key] = value;
|
||||
}
|
||||
|
||||
if (callPostSet) {
|
||||
await this.postSet(key);
|
||||
}
|
||||
}
|
||||
|
||||
async postSet(key?: string) {
|
||||
await this.setDefaultFilters();
|
||||
this.filters = await this.getFilters();
|
||||
this.columns = await this.getColumns();
|
||||
|
@ -47,6 +47,10 @@ import { defineComponent } from 'vue';
|
||||
export default defineComponent({
|
||||
props: {
|
||||
reportClassName: String,
|
||||
defaultFilters: {
|
||||
type: String,
|
||||
default: '{}',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -62,6 +66,17 @@ export default defineComponent({
|
||||
components: { PageHeader, FormControl, ListReport, DropdownWithActions },
|
||||
async activated() {
|
||||
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) {
|
||||
window.rep = this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user