2
0
mirror of https://github.com/frappe/books.git synced 2025-02-02 12:08:27 +00:00

chore: Delete old ReportPage based views

This commit is contained in:
Faris Ansari 2019-12-03 15:50:14 +05:30
parent fb4e6c067a
commit 82bc0143e1
11 changed files with 0 additions and 473 deletions

View File

@ -1,41 +0,0 @@
const frappe = require('frappejs');
const ReportPage = require('frappejs/client/desk/reportpage');
const { DateTime } = require('luxon');
module.exports = class AccountsReceivableView extends ReportPage {
constructor(opts) {
super({
title: frappe._('Accounts Payable'),
filterFields: [
{fieldtype: 'Date', fieldname: 'date', label: 'As on Date', required: 1},
]
});
this.method = 'accounts-payable';
this.datatableOptions = {
layout: 'fixed'
}
}
async setDefaultFilterValues() {
const today = DateTime.local();
this.filters.setValue('date', today.toISODate());
this.run();
}
getRowsForDataTable(data) {
return data.rows || [];
}
getColumns() {
const columns = [
{ label: 'Posting Date', fieldtype: 'Data', fieldname: 'date' },
{ label: 'Supplier', fieldtype: 'Data', fieldname: 'party' },
{ label: 'Voucher Type', fieldtype: 'Data', fieldname: 'voucherType' },
{ label: 'Voucher No', fieldtype: 'Data', fieldname: 'voucherNo' },
{ label: 'Due Date', fieldtype: 'Data', fieldname: 'dueDate' },
];
return columns;
}
}

View File

@ -1,41 +0,0 @@
const frappe = require('frappejs');
const ReportPage = require('frappejs/client/desk/reportpage');
const { DateTime } = require('luxon');
module.exports = class AccountsReceivableView extends ReportPage {
constructor(opts) {
super({
title: frappe._('Accounts Receivable'),
filterFields: [
{fieldtype: 'Date', fieldname: 'date', label: 'As on Date', required: 1},
]
});
this.method = 'accounts-receivable';
this.datatableOptions = {
layout: 'fixed'
}
}
async setDefaultFilterValues() {
const today = DateTime.local();
this.filters.setValue('date', today.toISODate());
this.run();
}
getRowsForDataTable(data) {
return data.rows || [];
}
getColumns() {
const columns = [
{ label: 'Posting Date', fieldtype: 'Data', fieldname: 'date' },
{ label: 'Customer', fieldtype: 'Data', fieldname: 'party' },
{ label: 'Voucher Type', fieldtype: 'Data', fieldname: 'voucherType' },
{ label: 'Voucher No', fieldtype: 'Data', fieldname: 'voucherNo' },
{ label: 'Due Date', fieldtype: 'Data', fieldname: 'dueDate' },
];
return columns;
}
}

View File

@ -1,24 +0,0 @@
const frappe = require('frappejs');
const FinancialStatementsView = require('../FinancialStatements/FinancialStatementsView');
module.exports = class BalanceSheetView extends FinancialStatementsView {
constructor() {
super({
title: frappe._('Balance Sheet'),
method: 'balance-sheet',
filterFields: [
{fieldtype: 'Date', fieldname: 'toDate', label: 'To Date', required: 1},
{fieldtype: 'Select', options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'],
label: 'Periodicity', fieldname: 'periodicity', default: 'Monthly'}
]
});
}
async setDefaultFilterValues() {
const accountingSettings = await frappe.getSingle('AccountingSettings');
this.filters.setValue('toDate', accountingSettings.fiscalYearEnd);
this.filters.setValue('periodicity', 'Monthly');
this.run();
}
}

View File

@ -1,80 +0,0 @@
const ReportPage = require('frappejs/client/desk/reportpage');
const frappe = require('frappejs');
module.exports = class BankReconciliationView extends ReportPage {
constructor() {
super({
title: frappe._('Bank Reconciliation'),
filterFields: [{
fieldtype: 'Link',
target: 'Account',
label: 'Payment Account'
},
{
fieldtype: 'Link',
target: 'Party',
label: 'Party'
},
{
fieldtype: 'Date',
label: 'From Date'
},
{
fieldtype: 'Date',
label: 'To Date'
}
]
});
this.method = 'bank-reconciliation';
}
getColumns() {
return [{
label: 'Posting Date',
fieldtype: 'Date',
fieldname: 'date'
},
{
label: 'Payment Account',
fieldtype: 'Link'
},
{
label: 'Debit',
fieldtype: 'Currency'
},
{
label: 'Credit',
fieldtype: 'Currency'
},
{
label: 'Balance',
fieldtype: 'Currency'
},
{
label: 'Ref. Type',
fieldtype: 'Data',
fieldname: 'referenceType'
},
{
label: 'Ref. Name',
fieldtype: 'Data',
fieldname: 'referenceName'
},
{
label: 'Ref. Date',
fieldtype: 'Date',
fieldname: 'referenceDate'
},
{
label: 'Clearance Date',
fieldtype: 'Date',
fieldname: 'clearanceDate'
},
{
label: 'Party',
fieldtype: 'Link'
}
];
}
};

View File

@ -1,41 +0,0 @@
const ReportPage = require('frappejs/client/desk/reportpage');
const frappe = require('frappejs');
const { unique } = require('frappejs/utils');
module.exports = class FinancialStatementsView extends ReportPage {
constructor(opts) {
super({
title: opts.title,
filterFields: opts.filterFields
});
this.method = opts.method;
this.datatableOptions = {
treeView: true,
layout: 'fixed'
}
}
getRowsForDataTable(data) {
return data.rows || [];
}
getColumns(data) {
const columns = [
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 340 }
];
if (data && data.columns) {
const currencyColumns = data.columns;
const columnDefs = currencyColumns.map(name => ({
label: name,
fieldname: name,
fieldtype: 'Currency'
}));
columns.push(...columnDefs);
}
return columns;
}
}

View File

@ -1,85 +0,0 @@
const ReportPage = require('frappejs/client/desk/reportpage');
const frappe = require('frappejs');
module.exports = class GeneralLedgerView extends ReportPage {
constructor() {
super({
title: frappe._('General Ledger'),
filterFields: [
{
fieldtype: 'Select',
options: ['', 'SalesInvoice', 'Payment'],
label: 'Reference Type',
fieldname: 'referenceType'
},
{
fieldtype: 'DynamicLink',
references: 'referenceType',
label: 'Reference Name',
fieldname: 'referenceName'
},
{
fieldtype: 'Link',
target: 'Account',
label: 'Account'
},
{
fieldtype: 'Link',
target: 'Party',
label: 'Party'
},
{
fieldtype: 'Date',
label: 'From Date'
},
{
fieldtype: 'Date',
label: 'To Date'
}
]
});
this.method = 'general-ledger';
}
getColumns() {
return [
{
label: 'Account',
fieldtype: 'Link'
},
{
label: 'Date',
fieldtype: 'Date'
},
{
label: 'Debit',
fieldtype: 'Currency'
},
{
label: 'Credit',
fieldtype: 'Currency'
},
{
label: 'Balance',
fieldtype: 'Currency'
},
{
label: 'Reference Type',
fieldtype: 'Data'
},
{
label: 'Reference Name',
fieldtype: 'Data'
},
{
label: 'Party',
fieldtype: 'Link'
},
{
label: 'Description',
fieldtype: 'Data'
}
];
}
};

View File

@ -1,26 +0,0 @@
const frappe = require('frappejs');
const FinancialStatementsView = require('../FinancialStatements/FinancialStatementsView');
module.exports = class ProfitAndLossView extends FinancialStatementsView {
constructor() {
super({
title: frappe._('Profit and Loss'),
method: 'profit-and-loss',
filterFields: [
{fieldtype: 'Date', fieldname: 'fromDate', label: 'From Date', required: 1},
{fieldtype: 'Date', fieldname: 'toDate', label: 'To Date', required: 1},
{fieldtype: 'Select', options: ['Monthly', 'Quarterly', 'Half Yearly', 'Yearly'],
label: 'Periodicity', fieldname: 'periodicity', default: 'Monthly'}
]
});
}
async setDefaultFilterValues() {
const accountingSettings = await frappe.getSingle('AccountingSettings');
this.filters.setValue('fromDate', accountingSettings.fiscalYearStart);
this.filters.setValue('toDate', accountingSettings.fiscalYearEnd);
this.filters.setValue('periodicity', 'Monthly');
this.run();
}
}

View File

@ -1,24 +0,0 @@
const frappe = require('frappejs');
const RegisterView = require('../Register/RegisterView');
module.exports = class PurchaseRegisterView extends RegisterView {
constructor() {
super({
title: frappe._('Purchase Register')
});
this.method = 'purchase-register';
}
getColumns() {
return [
{ label: 'PurchaseInvoice', fieldname: 'name' },
{ label: 'Posting Date', fieldname: 'date' },
{ label: 'Supplier', fieldname: 'supplier' },
{ label: 'Payable Account', fieldname: 'account' },
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' },
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' },
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' }
];
}
};

View File

@ -1,34 +0,0 @@
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 || [];
}
}

View File

@ -1,31 +0,0 @@
const RegisterView = require('../Register/RegisterView');
const frappe = require('frappejs');
const { DateTime } = require('luxon');
const { unique } = require('frappejs/utils');
module.exports = class SalesRegisterView extends RegisterView {
constructor() {
super({
title: frappe._('Sales Register'),
filterFields: [
{ fieldtype: 'Link', target: 'Party', label: 'Customer Name', fieldname: 'customer' },
{ fieldtype: 'Date', fieldname: 'fromDate', label: 'From Date', required: 1 },
{ fieldtype: 'Date', fieldname: 'toDate', label: 'To Date', required: 1 }
]
});
this.method = 'sales-register';
}
getColumns() {
return [
{ label: 'SalesInvoice', fieldname: 'name' },
{ label: 'Posting Date', fieldname: 'date' , fieldtype: 'Date' },
{ label: 'Customer', fieldname: 'customer' },
{ label: 'Receivable Account', fieldname: 'account' },
{ label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' },
{ label: 'Total Tax', fieldname: 'totalTax', fieldtype: 'Currency' },
{ label: 'Grand Total', fieldname: 'grandTotal', fieldtype: 'Currency' },
];
}
}

View File

@ -1,46 +0,0 @@
const ReportPage = require('frappejs/client/desk/reportpage');
const frappe = require('frappejs');
module.exports = class TrialBalanceView extends ReportPage {
constructor(opts) {
super({
title: frappe._('Trial Balance'),
filterFields: [
{fieldtype: 'Date', fieldname: 'fromDate', label: 'From Date', required: 1},
{fieldtype: 'Date', fieldname: 'toDate', label: 'To Date', required: 1}
]
});
this.method = 'trial-balance';
this.datatableOptions = {
treeView: true,
layout: 'fixed'
}
}
async setDefaultFilterValues() {
const accountingSettings = await frappe.getSingle('AccountingSettings');
this.filters.setValue('fromDate', accountingSettings.fiscalYearStart);
this.filters.setValue('toDate', accountingSettings.fiscalYearEnd);
this.run();
}
getRowsForDataTable(data) {
return data.rows || [];
}
getColumns(data) {
const columns = [
{ label: 'Account', fieldtype: 'Data', fieldname: 'account', width: 340 },
{ label: 'Opening (Dr)', fieldtype: 'Currency', fieldname: 'openingDebit' },
{ label: 'Opening (Cr)', fieldtype: 'Currency', fieldname: 'openingCredit' },
{ label: 'Debit', fieldtype: 'Currency', fieldname: 'debit' },
{ label: 'Credit', fieldtype: 'Currency', fieldname: 'credit' },
{ label: 'Closing (Dr)', fieldtype: 'Currency', fieldname: 'closingDebit' },
{ label: 'Closing (Cr)', fieldtype: 'Currency', fieldname: 'closingCredit' }
];
return columns;
}
}