mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
17e5187c51
- Models - Bill - Quotation (extended from Invoice) - Journal Entry - Reports - Sales Register - Purchase Register
35 lines
984 B
JavaScript
35 lines
984 B
JavaScript
const ReportPage = require('frappejs/client/desk/reportpage');
|
|
const frappe = require('frappejs');
|
|
const { DateTime } = require('luxon');
|
|
const { unique } = require('frappejs/utils');
|
|
|
|
module.exports = class RegisterView extends ReportPage {
|
|
constructor({ title }) {
|
|
super({
|
|
title,
|
|
filterFields: [
|
|
{fieldtype: 'Date', fieldname: 'fromDate', label: 'From Date', required: 1},
|
|
{fieldtype: 'Date', fieldname: 'toDate', label: 'To Date', required: 1}
|
|
]
|
|
});
|
|
|
|
this.datatableOptions = {
|
|
layout: 'fixed'
|
|
}
|
|
}
|
|
|
|
async setDefaultFilterValues() {
|
|
const today = DateTime.local();
|
|
const oneMonthAgo = today.minus({ months: 1 });
|
|
|
|
this.filters.setValue('fromDate', oneMonthAgo.toISODate());
|
|
this.filters.setValue('toDate', today.toISODate());
|
|
|
|
this.run();
|
|
}
|
|
|
|
getRowsForDataTable(data) {
|
|
return data.rows || [];
|
|
}
|
|
}
|