2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

build(electron): bump electron to 15.3.0

- refactor Common Js imports to ES6
This commit is contained in:
18alantom 2021-11-04 16:01:26 +05:30
parent f0424d0ee4
commit 1a8a23d2a2
120 changed files with 679 additions and 586 deletions

View File

@ -1,4 +1,4 @@
let { DateTime } = require('luxon');
import { DateTime } from 'luxon';
export async function getExchangeRate({ fromCurrency, toCurrency, date }) {
if (!date) {

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
const countries = require('../fixtures/countryInfo.json');
const standardCOA = require('../fixtures/verified/standardCOA.json');
import frappe from 'frappejs';
import countries from '../fixtures/countryInfo.json';
import standardCOA from '../fixtures/verified/standardCOA.json';
const accountFields = [
'accountType',
'rootType',
@ -57,14 +57,14 @@ async function getCountryCOA() {
const conCode = countries[doc.country].code;
try {
const countryCoa = require('../fixtures/verified/' + conCode + '.json');
const countryCoa = await import('../fixtures/verified/' + conCode + '.json');
return countryCoa.tree;
} catch (e) {
return standardCOA;
}
}
module.exports = async function importCharts() {
export default async function importCharts() {
const chart = await getCountryCOA();
await importAccounts(chart, '', '', true);
};

View File

@ -1,7 +1,7 @@
const frappe = require('frappejs');
const { round } = require('frappejs/utils/numberFormat');
import frappe from 'frappejs';
import { round } from 'frappejs/utils/numberFormat';
module.exports = class LedgerPosting {
export default class LedgerPosting {
constructor({ reference, party, date, description }) {
this.reference = reference;
this.party = party;

View File

@ -1,18 +1,18 @@
module.exports = {
ledgerLink: {
label: 'Ledger Entries',
condition: doc => doc.submitted,
action: (doc, router) => {
router.push({
name: 'Report',
params: {
reportName: 'general-ledger',
defaultFilters: {
referenceType: doc.doctype,
referenceName: doc.name
}
}
});
}
}
export const ledgerLink = {
label: 'Ledger Entries',
condition: (doc) => doc.submitted,
action: (doc, router) => {
router.push({
name: 'Report',
params: {
reportName: 'general-ledger',
defaultFilters: {
referenceType: doc.doctype,
referenceName: doc.name,
},
},
});
},
};
export default { ledgerLink };

View File

@ -1,4 +1,4 @@
const { notarize } = require('electron-notarize');
import { notarize } from 'electron-notarize';
exports.default = async context => {
const { electronPlatformName, appOutDir } = context;

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
doctype: "PrintFormat",
name: "Standard Invoice Format",
for: "SalesInvoice",
@ -71,4 +71,4 @@ module.exports = {
{{ frappe.format(doc.terms, 'Text') }}
</div>
`
}
};

View File

@ -1,7 +1,7 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
const _ = frappe._.bind(frappe);
module.exports = {
export default {
[_("Application of Funds (Assets)")]: {
[_("Current Assets")]: {
[_("Accounts Receivable")]: {
@ -170,4 +170,4 @@ module.exports = {
},
"rootType": "Equity"
}
}
};

View File

@ -1,10 +1,11 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
import Account from './AccountDocument';
module.exports = {
export default {
name: 'Account',
label: 'Account',
doctype: 'DocType',
documentClass: require('./AccountDocument.js'),
documentClass: Account,
isSingle: 0,
isTree: 1,
keywordFields: ['name', 'rootType', 'accountType'],

View File

@ -1,7 +1,7 @@
const frappe = require('frappejs');
const BaseDocument = require('frappejs/model/document');
import frappe from 'frappejs';
import BaseDocument from 'frappejs/model/document';
module.exports = class Account extends BaseDocument {
export default class Account extends BaseDocument {
async validate() {
if (!this.accountType && this.parentAccount) {
this.accountType = await frappe.db.getValue(

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'AccountingLedgerEntry',
label: 'Ledger Entry',
naming: 'autoincrement',

View File

@ -1,6 +1,7 @@
const countryList = Object.keys(require('~/fixtures/countryInfo.json')).sort();
import countryInfo from '~/fixtures/countryInfo.json';
module.exports = {
const countryList = Object.keys(countryInfo).sort();
export default {
name: 'AccountingSettings',
label: 'Accounting Settings',
naming: 'name', // {random|autoincrement}

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'Address',
doctype: 'DocType',
isSingle: 0,

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'Color',
doctype: 'DocType',
fields: [

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
"name": "CompanySettings",
"label": "Company Settings",
"naming": "autoincrement",
@ -24,4 +24,4 @@ module.exports = {
"target": "Address"
}
]
}
};

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
"name": "Contact",
"doctype": "DocType",
"isSingle": 0,
@ -78,4 +78,4 @@ module.exports = {
]
}
]
}
};

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'Currency',
label: 'Currency',
doctype: 'DocType',

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
module.exports = {
export default {
"name": "Email",
"doctype": "DocType",
"pageSettings": {
@ -69,4 +69,4 @@ module.exports = {
"hidden": 1,
}
]
}
};

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
module.exports = {
export default {
"name": "EmailAccount",
"label": "Email Account",
"doctype": "DocType",
@ -56,4 +56,4 @@ module.exports = {
"default": "465"
}
]
}
};

View File

@ -1,7 +1,7 @@
const { DateTime } = require('luxon');
const EventDocument = require('./EventDocument');
import { DateTime } from 'luxon';
import EventDocument from './EventDocument';
module.exports = {
export default {
name: 'Event',
doctype: 'DocType',
naming: 'random',

View File

@ -1,8 +1,8 @@
const frappe = require('frappejs');
const BaseDocument = require('frappejs/model/document');
import frappe from 'frappejs';
import BaseDocument from 'frappejs/model/document';
module.exports = class Event extends BaseDocument {
export default class Event extends BaseDocument {
alertEvent() {
alert(this.title);
}
}
};

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'EventSchedule',
doctype: 'DocType',
isChild: 1,
@ -14,4 +14,4 @@ module.exports = {
fieldtype: 'Data',
},
]
}
};

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
"name": "EventSettings",
"label": "Event Settings",
"doctype": "DocType",
@ -12,4 +12,4 @@ module.exports = {
fieldtype: "Check"
}
]
}
};

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const Quotation = require('../Quotation/Quotation');
import model from 'frappejs/model';
import Quotation from '../Quotation/Quotation';
module.exports = model.extend(Quotation, {
export default model.extend(Quotation, {
name: "Fulfillment",
label: "Fulfillment",
settings: "FulfillmentSettings",

View File

@ -1,6 +1,6 @@
const model = require('frappejs/model');
const QuotationItem = require('../QuotationItem/QuotationItem');
import model from 'frappejs/model';
import QuotationItem from '../QuotationItem/QuotationItem';
module.exports = model.extend(QuotationItem, {
export default model.extend(QuotationItem, {
name: "FulfillmentItem"
});

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const QuotationSettings = require('../QuotationSettings/QuotationSettings');
import model from 'frappejs/model';
import QuotationSettings from '../QuotationSettings/QuotationSettings';
module.exports = model.extend(QuotationSettings, {
export default model.extend(QuotationSettings, {
"name": "FulfillmentSettings",
"label": "Fulfillment Settings",
"fields": [

View File

@ -1,10 +1,11 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
import GSTR3B from './GSTR3BDocument.js';
module.exports = {
export default {
name: 'GSTR3B',
label: 'GSTR 3B',
doctype: 'DocType',
documentClass: require('./GSTR3BDocument.js'),
documentClass: GSTR3B,
print: {
printFormat: 'GSTR3B Print Format'
},

View File

@ -1,8 +1,8 @@
const BaseDocument = require('frappejs/model/document');
const frappe = require('frappejs');
const { format } = require('./GSTR3BFormat');
import BaseDocument from 'frappejs/model/document';
import frappe from 'frappejs';
import format from './GSTR3BFormat';
module.exports = class GSTR3B extends BaseDocument {
export default class GSTR3B extends BaseDocument {
async getData() {
const monthIndex = [
'January',

View File

@ -1,4 +1,4 @@
const format = {
export default {
gstin: '',
ret_period: '',
inward_sup: {
@ -383,8 +383,4 @@ function generateHTML(data) {
</div>`;
return template;
}
module.exports = {
format
};
}

View File

@ -1,6 +1,6 @@
const GSTR3B = require('./GSTR3BDocument');
import GSTR3B from './GSTR3BDocument';
module.exports = class GSTR3BServer extends GSTR3B {
export default class GSTR3BServer extends GSTR3B {
async validate() {
if (this.month.length === 0 || this.year.length != 4) {
frappe.call({

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'GetStarted',
isSingle: 1,
fields: [

View File

@ -1,7 +1,7 @@
const frappe = require('frappejs');
const { _ } = require('frappejs/utils');
import frappe from 'frappejs';
import { _ } from 'frappejs/utils';
module.exports = {
export default {
name: 'Item',
doctype: 'DocType',
isSingle: 0,

View File

@ -1,7 +1,7 @@
const { ledgerLink } = require('../../../accounting/utils');
const { DateTime } = require('luxon');
import { ledgerLink } from '../../../accounting/utils';
import { DateTime } from 'luxon';
module.exports = {
export default {
label: 'Journal Entry',
name: 'JournalEntry',
doctype: 'DocType',

View File

@ -1,7 +1,7 @@
const BaseDocument = require('frappejs/model/document');
const LedgerPosting = require('../../../accounting/ledgerPosting');
import BaseDocument from 'frappejs/model/document';
import LedgerPosting from '../../../accounting/ledgerPosting';
module.exports = class JournalEntryServer extends BaseDocument {
export default class JournalEntryServer extends BaseDocument {
getPosting() {
let entries = new LedgerPosting({ reference: this });

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'JournalEntryAccount',
isChild: 1,
fields: [

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'JournalEntrySettings',
label: 'Journal Entry Setting',
doctype: 'DocType',

View File

@ -1,9 +1,9 @@
const frappe = require('frappejs');
const { _ } = require('frappejs/utils');
const router = require('@/router').default;
const PartyWidget = require('./PartyWidget.vue').default;
import frappe from 'frappejs';
import { _ } from 'frappejs/utils';
import router from '@/router';
import PartyWidget from './PartyWidget.vue';
module.exports = {
export default {
name: 'Customer',
label: 'Customer',
basedOn: 'Party',

View File

@ -1,7 +1,7 @@
const frappe = require('frappejs');
let { _ } = require('frappejs/utils');
import frappe from 'frappejs';
import { _ } from 'frappejs/utils';
module.exports = {
export default {
name: 'Party',
label: 'Party',
keywordFields: ['name'],

View File

@ -1,7 +1,7 @@
const BaseDocument = require('frappejs/model/document');
const frappe = require('frappejs');
import BaseDocument from 'frappejs/model/document';
import frappe from 'frappejs';
module.exports = class PartyServer extends BaseDocument {
export default class PartyServer extends BaseDocument {
beforeInsert() {
if (this.customer && this.supplier) {
frappe.call({

View File

@ -1,4 +1,4 @@
const party = require('./Party');
import party from './Party';
party.fields.splice(3, 0, {
//insert at 3rd position
@ -18,4 +18,4 @@ party.fields.splice(4, 0, {
party.fields.join();
const newParty = party;
module.exports = newParty;
export default newParty;

View File

@ -1,9 +1,9 @@
const { _ } = require('frappejs/utils');
const router = require('@/router').default;
const frappe = require('frappejs');
const PartyWidget = require('./PartyWidget.vue').default;
import { _ } from 'frappejs/utils';
import router from '@/router';
import frappe from 'frappejs';
import PartyWidget from './PartyWidget.vue';
module.exports = {
export default {
name: 'Supplier',
label: 'Supplier',
basedOn: 'Party',

View File

@ -1,7 +1,7 @@
const frappe = require('frappejs');
const utils = require('../../../accounting/utils');
import frappe from 'frappejs';
import utils from '../../../accounting/utils';
module.exports = {
export default {
name: 'Payment',
label: 'Payment',
isSingle: 0,

View File

@ -1,8 +1,8 @@
const BaseDocument = require('frappejs/model/document');
const frappe = require('frappejs');
const LedgerPosting = require('../../../accounting/ledgerPosting');
import BaseDocument from 'frappejs/model/document';
import frappe from 'frappejs';
import LedgerPosting from '../../../accounting/ledgerPosting';
module.exports = class PaymentServer extends BaseDocument {
export default class PaymentServer extends BaseDocument {
async change({ changed }) {
if (changed === 'for') {
this.amount = 0;

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'PaymentFor',
label: 'Payment For',
isSingle: 0,

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: "PaymentSettings",
label: "Payment Settings",
isSingle: 1,
@ -14,4 +14,4 @@ module.exports = {
"default": "PAY"
}
]
}
};

View File

@ -1,6 +1,6 @@
const theme = require('@/theme');
import theme from '@/theme';
module.exports = {
export default {
name: 'PrintSettings',
label: 'Print Settings',
isSingle: 1,

View File

@ -1,11 +1,12 @@
const { getActions } = require('../Transaction/Transaction');
const InvoiceTemplate = require('../SalesInvoice/InvoiceTemplate.vue').default;
import { getActions } from '../Transaction/Transaction';
import InvoiceTemplate from '../SalesInvoice/InvoiceTemplate.vue';
import PurchaseInvoice from './PurchaseInvoiceDocument';
module.exports = {
export default {
name: 'PurchaseInvoice',
doctype: 'DocType',
label: 'Purchase Invoice',
documentClass: require('./PurchaseInvoiceDocument'),
documentClass: PurchaseInvoice,
printTemplate: InvoiceTemplate,
isSingle: 0,
isChild: 0,

View File

@ -1,3 +1,3 @@
const TransactionDocument = require('../Transaction/TransactionDocument');
import TransactionDocument from '../Transaction/TransactionDocument';
module.exports = class PurchaseInvoice extends TransactionDocument {};
export default class PurchaseInvoice extends TransactionDocument {};

View File

@ -1,6 +1,6 @@
const TransactionServer = require('../Transaction/TransactionServer');
const PurchaseInvoice = require('./PurchaseInvoiceDocument');
const LedgerPosting = require('../../../accounting/ledgerPosting');
import TransactionServer from '../Transaction/TransactionServer';
import PurchaseInvoice from './PurchaseInvoiceDocument';
import LedgerPosting from '../../../accounting/ledgerPosting';
class PurchaseInvoiceServer extends PurchaseInvoice {
async getPosting() {
@ -24,4 +24,4 @@ class PurchaseInvoiceServer extends PurchaseInvoice {
// apply common methods from TransactionServer
Object.assign(PurchaseInvoiceServer.prototype, TransactionServer);
module.exports = PurchaseInvoiceServer;
export default PurchaseInvoiceServer;

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'PurchaseInvoiceItem',
doctype: 'DocType',
isChild: 1,

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'PurchaseInvoiceSettings',
label: 'Purchase Invoice Settings',
doctype: 'DocType',

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const PurchaseInvoice = require('../PurchaseInvoice/PurchaseInvoice');
import model from 'frappejs/model';
import PurchaseInvoice from '../PurchaseInvoice/PurchaseInvoice';
module.exports = model.extend(
export default model.extend(
PurchaseInvoice,
{
name: 'PurchaseOrder',

View File

@ -1,6 +1,6 @@
const model = require('frappejs/model');
const PurchaseInvoiceItem = require('../PurchaseInvoiceItem/PurchaseInvoiceItem');
import model from 'frappejs/model';
import PurchaseInvoiceItem from '../PurchaseInvoiceItem/PurchaseInvoiceItem';
module.exports = model.extend(PurchaseInvoiceItem, {
export default model.extend(PurchaseInvoiceItem, {
name: "PurchaseOrderItem"
});

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const PurchaseInvoiceSettings = require('../PurchaseInvoiceSettings/PurchaseInvoiceSettings');
import model from 'frappejs/model';
import PurchaseInvoiceSettings from '../PurchaseInvoiceSettings/PurchaseInvoiceSettings';
module.exports = model.extend(PurchaseInvoiceSettings, {
export default model.extend(PurchaseInvoiceSettings, {
"name": "PurchaseOrderSettings",
"label": "Purchase Order Settings",
"fields": [

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const PurchaseOrder = require('../PurchaseOrder/PurchaseOrder');
import model from 'frappejs/model';
import PurchaseOrder from '../PurchaseOrder/PurchaseOrder';
module.exports = model.extend(PurchaseOrder, {
export default model.extend(PurchaseOrder, {
name: "PurchaseReceipt",
label: "Purchase Receipt",
settings: "PurchaseReceiptSettings",

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const PurchaseOrderItem = require('../PurchaseOrderItem/PurchaseOrderItem');
import model from 'frappejs/model';
import PurchaseOrderItem from '../PurchaseOrderItem/PurchaseOrderItem';
module.exports = model.extend(PurchaseOrderItem, {
export default model.extend(PurchaseOrderItem, {
name: "PurchaseReceiptItem",
fields: [
{

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const PurchaseOrderSettings = require('../PurchaseOrderSettings/PurchaseOrderSettings');
import model from 'frappejs/model';
import PurchaseOrderSettings from '../PurchaseOrderSettings/PurchaseOrderSettings';
module.exports = model.extend(PurchaseOrderSettings, {
export default model.extend(PurchaseOrderSettings, {
"name": "PurchaseReceiptSettings",
"label": "Purchase Receipt Settings",
"fields": [

View File

@ -1,5 +1,5 @@
const model = require('frappejs/model');
const SalesInvoice = require('../SalesInvoice/SalesInvoice');
import model from 'frappejs/model';
import SalesInvoice from '../SalesInvoice/SalesInvoice';
const Quotation = model.extend(
SalesInvoice,
@ -21,4 +21,4 @@ const Quotation = model.extend(
}
);
module.exports = Quotation;
export default Quotation;

View File

@ -1,3 +1,3 @@
const SalesInvoiceDocument = require('../SalesInvoice/SalesInvoiceDocument');
import SalesInvoiceDocument from '../SalesInvoice/SalesInvoiceDocument';
module.exports = class Quotation extends SalesInvoiceDocument {};
export default class Quotation extends SalesInvoiceDocument {};

View File

@ -1,6 +1,6 @@
const model = require('frappejs/model');
const SalesInvoiceItem = require('../SalesInvoiceItem/SalesInvoiceItem');
import model from 'frappejs/model';
import SalesInvoiceItem from '../SalesInvoiceItem/SalesInvoiceItem';
module.exports = model.extend(SalesInvoiceItem, {
export default model.extend(SalesInvoiceItem, {
name: "QuotationItem"
});

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const SalesInvoiceSettings = require('../SalesInvoiceSettings/SalesInvoiceSettings');
import model from 'frappejs/model';
import SalesInvoiceSettings from '../SalesInvoiceSettings/SalesInvoiceSettings';
module.exports = model.extend(SalesInvoiceSettings, {
export default model.extend(SalesInvoiceSettings, {
"name": "QuotationSettings",
"label": "Quotation Settings",
"fields": [

View File

@ -1,11 +1,12 @@
const { getActions } = require('../Transaction/Transaction');
const InvoiceTemplate = require('./InvoiceTemplate.vue').default;
import { getActions } from '../Transaction/Transaction';
import InvoiceTemplate from './InvoiceTemplate.vue';
import SalesInvoice from './SalesInvoiceDocument';
module.exports = {
export default {
name: 'SalesInvoice',
label: 'Sales Invoice',
doctype: 'DocType',
documentClass: require('./SalesInvoiceDocument'),
documentClass: SalesInvoice,
printTemplate: InvoiceTemplate,
isSingle: 0,
isChild: 0,

View File

@ -1,3 +1,3 @@
const TransactionDocument = require('../Transaction/TransactionDocument');
import TransactionDocument from '../Transaction/TransactionDocument';
module.exports = class SalesInvoice extends TransactionDocument {};
export default class SalesInvoice extends TransactionDocument {};

View File

@ -1,6 +1,6 @@
const TransactionServer = require('../Transaction/TransactionServer');
const SalesInvoice = require('./SalesInvoiceDocument');
const LedgerPosting = require('../../../accounting/ledgerPosting');
import TransactionServer from '../Transaction/TransactionServer';
import SalesInvoice from './SalesInvoiceDocument';
import LedgerPosting from '../../../accounting/ledgerPosting';
class SalesInvoiceServer extends SalesInvoice {
async getPosting() {
@ -24,4 +24,4 @@ class SalesInvoiceServer extends SalesInvoice {
// apply common methods from TransactionServer
Object.assign(SalesInvoiceServer.prototype, TransactionServer);
module.exports = SalesInvoiceServer;
export default SalesInvoiceServer;

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'SalesInvoiceItem',
doctype: 'DocType',
isChild: 1,

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'SalesInvoiceSettings',
label: 'SalesInvoice Settings',
doctype: 'DocType',

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const Quotation = require('../Quotation/Quotation');
import model from 'frappejs/model';
import Quotation from '../Quotation/Quotation';
module.exports = model.extend(Quotation, {
export default model.extend(Quotation, {
name: 'SalesOrder',
label: 'Sales Order',
settings: 'SalesOrderSettings',

View File

@ -1,6 +1,6 @@
const model = require('frappejs/model');
const QuotationItem = require('../QuotationItem/QuotationItem');
import model from 'frappejs/model';
import QuotationItem from '../QuotationItem/QuotationItem';
module.exports = model.extend(QuotationItem, {
export default model.extend(QuotationItem, {
name: "SalesOrderItem"
});

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model');
const QuotationSettings = require('../QuotationSettings/QuotationSettings');
import model from 'frappejs/model';
import QuotationSettings from '../QuotationSettings/QuotationSettings';
module.exports = model.extend(QuotationSettings, {
export default model.extend(QuotationSettings, {
"name": "SalesOrderSettings",
"label": "Sales Order Settings",
"fields": [

View File

@ -1,7 +1,7 @@
const { DateTime } = require('luxon');
const countryList = require('~/fixtures/countryInfo.json');
import { DateTime } from 'luxon';
import countryList from '~/fixtures/countryInfo.json';
module.exports = {
export default {
name: 'SetupWizard',
label: 'Setup Wizard',
naming: 'name',

View File

@ -1,4 +1,4 @@
module.exports = async function generateTaxes(country) {
export default async function generateTaxes(country) {
if (country === 'India') {
const GSTs = {
GST: [28, 18, 12, 6, 5, 3, 0.25, 0],

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'Tax',
label: 'Tax',
doctype: 'DocType',

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'TaxDetail',
label: 'Tax Detail',
doctype: 'DocType',

View File

@ -1,4 +1,4 @@
module.exports = {
export default {
name: 'TaxSummary',
doctype: 'DocType',
isChild: 1,

View File

@ -1,88 +1,86 @@
const frappe = require('frappejs');
const utils = require('../../../accounting/utils');
const { openQuickEdit } = require('@/utils');
const Badge = require('@/components/Badge').default;
import frappe from 'frappejs';
import utils from '../../../accounting/utils';
import { openQuickEdit } from '@/utils';
import Badge from '@/components/Badge';
module.exports = {
getStatusColumn() {
return {
label: 'Status',
fieldname: 'status',
fieldtype: 'Select',
render(doc) {
let status = 'Unpaid';
let color = 'orange';
if (!doc.submitted) {
status = 'Draft';
color = 'gray';
}
if (doc.submitted === 1 && doc.outstandingAmount === 0.0) {
status = 'Paid';
color = 'green';
}
return {
template: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
components: { Badge }
};
export function getStatusColumn() {
return {
label: 'Status',
fieldname: 'status',
fieldtype: 'Select',
render(doc) {
let status = 'Unpaid';
let color = 'orange';
if (!doc.submitted) {
status = 'Draft';
color = 'gray';
}
};
},
getActions(doctype) {
return [
{
label: 'Make Payment',
condition: doc => doc.submitted && doc.outstandingAmount > 0,
action: async function makePayment(doc) {
let payment = await frappe.getNewDoc('Payment');
payment.once('afterInsert', async () => {
await payment.submit();
});
let isSales = doctype === 'SalesInvoice';
let party = isSales ? doc.customer : doc.supplier;
let paymentType = isSales ? 'Receive' : 'Pay';
let hideAccountField = isSales ? 'account' : 'paymentAccount';
openQuickEdit({
doctype: 'Payment',
name: payment.name,
hideFields: [
'party',
'date',
hideAccountField,
'paymentType',
'for'
if (doc.submitted === 1 && doc.outstandingAmount === 0.0) {
status = 'Paid';
color = 'green';
}
return {
template: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
components: { Badge },
};
},
};
}
export function getActions(doctype) {
return [
{
label: 'Make Payment',
condition: (doc) => doc.submitted && doc.outstandingAmount > 0,
action: async function makePayment(doc) {
let payment = await frappe.getNewDoc('Payment');
payment.once('afterInsert', async () => {
await payment.submit();
});
let isSales = doctype === 'SalesInvoice';
let party = isSales ? doc.customer : doc.supplier;
let paymentType = isSales ? 'Receive' : 'Pay';
let hideAccountField = isSales ? 'account' : 'paymentAccount';
openQuickEdit({
doctype: 'Payment',
name: payment.name,
hideFields: ['party', 'date', hideAccountField, 'paymentType', 'for'],
defaults: {
party,
[hideAccountField]: doc.account,
date: new Date().toISOString().slice(0, 10),
paymentType,
for: [
{
referenceType: doc.doctype,
referenceName: doc.name,
amount: doc.outstandingAmount,
},
],
defaults: {
party,
[hideAccountField]: doc.account,
date: new Date().toISOString().slice(0, 10),
paymentType,
for: [
{
referenceType: doc.doctype,
referenceName: doc.name,
amount: doc.outstandingAmount
}
]
}
});
}
},
});
},
{
label: 'Revert',
condition: doc =>
doc.submitted && doc.baseGrandTotal === doc.outstandingAmount,
action(doc) {
doc.revert();
}
},
{
label: 'Revert',
condition: (doc) =>
doc.submitted && doc.baseGrandTotal === doc.outstandingAmount,
action(doc) {
doc.revert();
},
{
label: 'Print',
condition: doc => doc.submitted,
action(doc, router) {
router.push(`/print/${doc.doctype}/${doc.name}`);
}
},
{
label: 'Print',
condition: (doc) => doc.submitted,
action(doc, router) {
router.push(`/print/${doc.doctype}/${doc.name}`);
},
utils.ledgerLink
];
}
};
},
utils.ledgerLink,
];
}
export default {
getStatusColumn,
getActions
}

View File

@ -1,9 +1,9 @@
const BaseDocument = require('frappejs/model/document');
const frappe = require('frappejs');
const { round } = require('frappejs/utils/numberFormat');
const { getExchangeRate } = require('../../../accounting/exchangeRate');
import BaseDocument from 'frappejs/model/document';
import frappe from 'frappejs';
import { round } from 'frappejs/utils/numberFormat';
import { getExchangeRate } from '../../../accounting/exchangeRate';
module.exports = class TransactionDocument extends BaseDocument {
export default class TransactionDocument extends BaseDocument {
async getExchangeRate() {
if (!this.currency) return;

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
module.exports = {
export default {
async getPayments() {
let payments = await frappe.db.getAll({
doctype: 'PaymentFor',

View File

@ -1,69 +1,105 @@
module.exports = {
SetupWizard: require('./doctype/SetupWizard/SetupWizard'),
Currency: require('./doctype/Currency/Currency'),
Color: require('./doctype/Color/Color'),
Account: require('./doctype/Account/Account.js'),
AccountingSettings: require('./doctype/AccountingSettings/AccountingSettings'),
CompanySettings: require('./doctype/CompanySettings/CompanySettings'),
AccountingLedgerEntry: require('./doctype/AccountingLedgerEntry/AccountingLedgerEntry.js'),
Party: require('./doctype/Party/Party.js'),
Customer: require('./doctype/Party/Customer'),
Supplier: require('./doctype/Party/Supplier'),
import SetupWizard from './doctype/SetupWizard/SetupWizard.js';
import Currency from './doctype/Currency/Currency.js';
import Color from './doctype/Color/Color.js';
import Account from './doctype/Account/Account.js';
import AccountingSettings from './doctype/AccountingSettings/AccountingSettings.js';
import CompanySettings from './doctype/CompanySettings/CompanySettings.js';
import AccountingLedgerEntry from './doctype/AccountingLedgerEntry/AccountingLedgerEntry.js';
import Party from './doctype/Party/Party.js';
import Customer from './doctype/Party/Customer.js';
import Supplier from './doctype/Party/Supplier.js';
import Payment from './doctype/Payment/Payment.js';
import PaymentFor from './doctype/PaymentFor/PaymentFor.js';
import PaymentSettings from './doctype/PaymentSettings/PaymentSettings.js';
import Item from './doctype/Item/Item.js';
import SalesInvoice from './doctype/SalesInvoice/SalesInvoice.js';
import SalesInvoiceItem from './doctype/SalesInvoiceItem/SalesInvoiceItem.js';
import SalesInvoiceSettings from './doctype/SalesInvoiceSettings/SalesInvoiceSettings.js';
import PurchaseInvoice from './doctype/PurchaseInvoice/PurchaseInvoice.js';
import PurchaseInvoiceItem from './doctype/PurchaseInvoiceItem/PurchaseInvoiceItem.js';
import PurchaseInvoiceSettings from './doctype/PurchaseInvoiceSettings/PurchaseInvoiceSettings.js';
import Tax from './doctype/Tax/Tax.js';
import TaxDetail from './doctype/TaxDetail/TaxDetail.js';
import TaxSummary from './doctype/TaxSummary/TaxSummary.js';
import GSTR3B from './doctype/GSTR3B/GSTR3B.js';
import Address from './doctype/Address/Address.js';
import Contact from './doctype/Contact/Contact.js';
import JournalEntry from './doctype/JournalEntry/JournalEntry.js';
import JournalEntryAccount from './doctype/JournalEntryAccount/JournalEntryAccount.js';
import JournalEntrySettings from './doctype/JournalEntrySettings/JournalEntrySettings.js';
import Quotation from './doctype/Quotation/Quotation.js';
import QuotationItem from './doctype/QuotationItem/QuotationItem.js';
import QuotationSettings from './doctype/QuotationSettings/QuotationSettings.js';
import SalesOrder from './doctype/SalesOrder/SalesOrder.js';
import SalesOrderItem from './doctype/SalesOrderItem/SalesOrderItem.js';
import SalesOrderSettings from './doctype/SalesOrderSettings/SalesOrderSettings.js';
import Fulfillment from './doctype/Fulfillment/Fulfillment.js';
import FulfillmentItem from './doctype/FulfillmentItem/FulfillmentItem.js';
import FulfillmentSettings from './doctype/FulfillmentSettings/FulfillmentSettings.js';
import PurchaseOrder from './doctype/PurchaseOrder/PurchaseOrder.js';
import PurchaseOrderItem from './doctype/PurchaseOrderItem/PurchaseOrderItem.js';
import PurchaseOrderSettings from './doctype/PurchaseOrderSettings/PurchaseOrderSettings.js';
import PurchaseReceipt from './doctype/PurchaseReceipt/PurchaseReceipt.js';
import PurchaseReceiptItem from './doctype/PurchaseReceiptItem/PurchaseReceiptItem.js';
import PurchaseReceiptSettings from './doctype/PurchaseReceiptSettings/PurchaseReceiptSettings.js';
import Event from './doctype/Event/Event.js';
import EventSchedule from './doctype/EventSchedule/EventSchedule.js';
import EventSettings from './doctype/EventSettings/EventSettings.js';
import Email from './doctype/Email/Email.js';
import EmailAccount from './doctype/EmailAccount/EmailAccount.js';
import PrintSettings from './doctype/PrintSettings/PrintSettings.js';
import GetStarted from './doctype/GetStarted/GetStarted.js';
Payment: require('./doctype/Payment/Payment.js'),
PaymentFor: require('./doctype/PaymentFor/PaymentFor.js'),
PaymentSettings: require('./doctype/PaymentSettings/PaymentSettings.js'),
Item: require('./doctype/Item/Item.js'),
SalesInvoice: require('./doctype/SalesInvoice/SalesInvoice.js'),
SalesInvoiceItem: require('./doctype/SalesInvoiceItem/SalesInvoiceItem.js'),
SalesInvoiceSettings: require('./doctype/SalesInvoiceSettings/SalesInvoiceSettings.js'),
PurchaseInvoice: require('./doctype/PurchaseInvoice/PurchaseInvoice.js'),
PurchaseInvoiceItem: require('./doctype/PurchaseInvoiceItem/PurchaseInvoiceItem.js'),
PurchaseInvoiceSettings: require('./doctype/PurchaseInvoiceSettings/PurchaseInvoiceSettings.js'),
Tax: require('./doctype/Tax/Tax.js'),
TaxDetail: require('./doctype/TaxDetail/TaxDetail.js'),
TaxSummary: require('./doctype/TaxSummary/TaxSummary.js'),
GSTR3B: require('./doctype/GSTR3B/GSTR3B.js'),
Address: require('./doctype/Address/Address.js'),
Contact: require('./doctype/Contact/Contact.js'),
JournalEntry: require('./doctype/JournalEntry/JournalEntry.js'),
JournalEntryAccount: require('./doctype/JournalEntryAccount/JournalEntryAccount.js'),
JournalEntrySettings: require('./doctype/JournalEntrySettings/JournalEntrySettings.js'),
Quotation: require('./doctype/Quotation/Quotation.js'),
QuotationItem: require('./doctype/QuotationItem/QuotationItem.js'),
QuotationSettings: require('./doctype/QuotationSettings/QuotationSettings.js'),
SalesOrder: require('./doctype/SalesOrder/SalesOrder.js'),
SalesOrderItem: require('./doctype/SalesOrderItem/SalesOrderItem.js'),
SalesOrderSettings: require('./doctype/SalesOrderSettings/SalesOrderSettings.js'),
Fulfillment: require('./doctype/Fulfillment/Fulfillment.js'),
FulfillmentItem: require('./doctype/FulfillmentItem/FulfillmentItem.js'),
FulfillmentSettings: require('./doctype/FulfillmentSettings/FulfillmentSettings.js'),
PurchaseOrder: require('./doctype/PurchaseOrder/PurchaseOrder.js'),
PurchaseOrderItem: require('./doctype/PurchaseOrderItem/PurchaseOrderItem.js'),
PurchaseOrderSettings: require('./doctype/PurchaseOrderSettings/PurchaseOrderSettings.js'),
PurchaseReceipt: require('./doctype/PurchaseReceipt/PurchaseReceipt.js'),
PurchaseReceiptItem: require('./doctype/PurchaseReceiptItem/PurchaseReceiptItem.js'),
PurchaseReceiptSettings: require('./doctype/PurchaseReceiptSettings/PurchaseReceiptSettings.js'),
Event: require('./doctype/Event/Event'),
EventSchedule: require('./doctype/EventSchedule/EventSchedule'),
EventSettings: require('./doctype/EventSettings/EventSettings'),
Email: require('./doctype/Email/Email'),
EmailAccount: require('./doctype/EmailAccount/EmailAccount'),
PrintSettings: require('./doctype/PrintSettings/PrintSettings'),
GetStarted: require('./doctype/GetStarted/GetStarted')
export default {
SetupWizard,
Currency,
Color,
Account,
AccountingSettings,
CompanySettings,
AccountingLedgerEntry,
Party,
Customer,
Supplier,
Payment,
PaymentFor,
PaymentSettings,
Item,
SalesInvoice,
SalesInvoiceItem,
SalesInvoiceSettings,
PurchaseInvoice,
PurchaseInvoiceItem,
PurchaseInvoiceSettings,
Tax,
TaxDetail,
TaxSummary,
GSTR3B,
Address,
Contact,
JournalEntry,
JournalEntryAccount,
JournalEntrySettings,
Quotation,
QuotationItem,
QuotationSettings,
SalesOrder,
SalesOrderItem,
SalesOrderSettings,
Fulfillment,
FulfillmentItem,
FulfillmentSettings,
PurchaseOrder,
PurchaseOrderItem,
PurchaseOrderSettings,
PurchaseReceipt,
PurchaseReceiptItem,
PurchaseReceiptSettings,
Event,
EventSchedule,
EventSettings,
Email,
EmailAccount,
PrintSettings,
GetStarted,
};

View File

@ -20,7 +20,7 @@
"@popperjs/core": "^2.10.2",
"core-js": "^3.19.0",
"csvjson-csv2json": "^5.0.6",
"electron-store": "^5.1.0",
"electron-store": "^8.0.1",
"frappe-charts": "1.6.1",
"frappejs": "https://github.com/frappe/frappejs",
"knex": "^0.95.12",
@ -39,7 +39,7 @@
"@vue/cli-plugin-router": "^4.5.0",
"@vue/cli-service": "^4.5.0",
"autoprefixer": "^9",
"electron": "^8.5.5",
"electron": "^15.3.0",
"electron-devtools-installer": "^3.2.0",
"electron-notarize": "^1.1.1",
"electron-updater": "^4.3.9",

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
module.exports = class AccountsReceivablePayable {
export default class AccountsReceivablePayable {
async run(reportType, { date }) {
const rows = await getReceivablePayable({
reportType,

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
const { unique } = require('frappejs/utils');
const { getData } = require('../FinancialStatements/FinancialStatements');
import frappe from 'frappejs';
import { unique } from 'frappejs/utils';
import { getData } from '../FinancialStatements/FinancialStatements';
class BalanceSheet {
async run({ fromDate, toDate, periodicity }) {
@ -48,4 +48,4 @@ class BalanceSheet {
}
}
module.exports = BalanceSheet;
export default BalanceSheet;

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
module.exports = {
export default {
title: 'Balance Sheet',
method: 'balance-sheet',
filterFields: [

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
class BankReconciliation {
async run(params) {
@ -51,4 +51,4 @@ class BankReconciliation {
}
}
module.exports = BankReconciliation;
export default BankReconciliation;

View File

@ -1,6 +1,6 @@
const csv2json = require('csvjson-csv2json');
const frappe = require('frappejs');
import Vue from 'vue';
import csv2json from 'csvjson-csv2json';
import frappe from 'frappejs';
import ReconciliationValidation from '../../src/components/ReconciliationValidation';
export const fileImportHandler = (file, report) => {
const reader = new FileReader();
@ -12,34 +12,34 @@ export const fileImportHandler = (file, report) => {
reader.readAsBinaryString(file);
};
export const csvToJsonHandler = csv => {
export const csvToJsonHandler = (csv) => {
const json = csv2json(csv, { parseNumbers: true });
return json;
};
export const findMatchingReferences = async (json, report) => {
const referenceField = Object.keys(json[0]).filter(field => {
const referenceField = Object.keys(json[0]).filter((field) => {
return field.toLowerCase().indexOf('ref') > -1 ? true : false;
});
const clearanceDateField = Object.keys(json[0]).filter(field => {
const clearanceDateField = Object.keys(json[0]).filter((field) => {
return field.toLowerCase().indexOf('date') > -1 ? true : false;
});
const debitField = Object.keys(json[0]).filter(field => {
const debitField = Object.keys(json[0]).filter((field) => {
return field.toLowerCase().indexOf('debit') > -1 ||
field.toLowerCase().indexOf('deposit') > -1
? true
: false;
});
const creditField = Object.keys(json[0]).filter(field => {
const creditField = Object.keys(json[0]).filter((field) => {
return field.toLowerCase().indexOf('credit') > -1 ||
field.toLowerCase().indexOf('withdraw') > -1
? true
: false;
});
const balanceField = Object.keys(json[0]).filter(field => {
const balanceField = Object.keys(json[0]).filter((field) => {
return field.toLowerCase().indexOf('balance') > -1 ? true : false;
});
const references = json.map(row => {
const references = json.map((row) => {
return row[referenceField];
});
const payments = await frappe.db.getAll({
@ -48,17 +48,17 @@ export const findMatchingReferences = async (json, report) => {
filters: {
referenceId: ['in', references],
paymentAccount: report.currentFilters.paymentAccount,
clearanceDate: ['in', [null, undefined, '']]
}
clearanceDate: ['in', [null, undefined, '']],
},
});
if (payments.length) {
const entries = payments.map(payment => {
const jsonEntry = json.filter(row => {
const entries = payments.map((payment) => {
const jsonEntry = json.filter((row) => {
return row[referenceField] === payment.referenceId;
});
return Object.assign(payment, jsonEntry[0]);
});
const normalizedEntries = entries.map(entry => {
const normalizedEntries = entries.map((entry) => {
return {
'Posting Date': frappe.format(entry.date, 'Date'),
'Payment Entry': entry.name,
@ -67,30 +67,29 @@ export const findMatchingReferences = async (json, report) => {
frappe.parseNumber(entry[debitField]) > 0
? entry[debitField] + ' Dr.'
: entry[creditField] + ' Cr.',
'Clearance Date': entry[clearanceDateField]
'Clearance Date': entry[clearanceDateField],
};
});
report.$modal.show({
modalProps: {
title: `Validate Matching Entries`,
noFooter: true
noFooter: true,
},
component: require('../../src/components/ReconciliationValidation')
.default,
component: ReconciliationValidation,
props: {
entries: normalizedEntries,
afterReconcile: async () => {
await report.getReportData(report.currentFilters);
}
}
},
},
});
} else {
frappe.call({
method: 'show-dialog',
args: {
title: 'Message',
message: 'No entries found with matching Ref / Cheque ID'
}
message: 'No entries found with matching Ref / Cheque ID',
},
});
}
};

View File

@ -1,5 +1,8 @@
const title = 'Bank Reconciliation';
module.exports = {
import ImportWizard from '../../src/components/ImportWizart';
import BankReconciliationImport from './BankReconciliationImport';
export default {
title: title,
method: 'bank-reconciliation',
filterFields: [
@ -13,9 +16,9 @@ module.exports = {
getFilters: () => {
return {
accountType: 'Bank',
isGroup: 0
isGroup: 0,
};
}
},
},
{
fieldtype: 'Link',
@ -23,105 +26,104 @@ module.exports = {
size: 'small',
label: 'Party',
placeholder: 'Party',
fieldname: 'party'
fieldname: 'party',
},
{
fieldtype: 'Date',
size: 'small',
placeholder: 'From Date',
label: 'From Date',
fieldname: 'fromDate'
fieldname: 'fromDate',
},
{
fieldtype: 'Date',
size: 'small',
placeholder: 'To Date',
label: 'To Date',
fieldname: 'toDate'
}
fieldname: 'toDate',
},
],
linkFields: [
{
label: 'Reconcile',
type: 'secondary',
condition: report => report.currentFilters.paymentAccount,
action: async report => {
condition: (report) => report.currentFilters.paymentAccount,
action: async (report) => {
report.$modal.show({
modalProps: {
title: `Import Bank Account Statement`,
noFooter: true
noFooter: true,
},
component: require('../../src/components/ImportWizard').default,
component: ImportWizard,
props: {
importHandler: require('./BankReconciliationImport')
.fileImportHandler,
report
}
importHandler: BankReconciliationImport.fileImportHandler,
report,
},
});
}
},
},
{
label: 'Clear Filters',
type: 'secondary',
action: async report => {
action: async (report) => {
await report.getReportData({});
report.usedToReRender += 1;
}
}
},
},
],
getColumns() {
return [
{
label: 'Posting Date',
fieldtype: 'Date',
fieldname: 'date'
fieldname: 'date',
},
{
label: 'Payment Account',
fieldtype: 'Link'
fieldtype: 'Link',
},
{
label: 'Debit',
fieldtype: 'Currency'
fieldtype: 'Currency',
},
{
label: 'Credit',
fieldtype: 'Currency'
fieldtype: 'Currency',
},
{
label: 'Balance',
fieldtype: 'Currency'
fieldtype: 'Currency',
},
{
label: 'Ref/Cheque ID',
fieldtype: 'Data',
fieldname: 'referenceId'
fieldname: 'referenceId',
},
{
label: 'Clearance Date',
fieldtype: 'Date',
fieldname: 'clearanceDate'
fieldname: 'clearanceDate',
},
{
label: 'Ref. Type',
fieldtype: 'Data',
fieldname: 'referenceType'
fieldname: 'referenceType',
},
{
label: 'Ref. Name',
fieldtype: 'Data',
fieldname: 'referenceName'
fieldname: 'referenceName',
},
{
label: 'Ref. Date',
fieldtype: 'Date',
fieldname: 'referenceDate'
fieldname: 'referenceDate',
},
{
label: 'Party',
fieldtype: 'Link'
}
fieldtype: 'Link',
},
];
}
},
};

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
const { getPeriodList } = require('../FinancialStatements/FinancialStatements');
const { DateTime } = require('luxon');
import frappe from 'frappejs';
import { getPeriodList } from '../FinancialStatements/FinancialStatements';
import { DateTime } from 'luxon';
class Cashflow {
async run({ fromDate, toDate, periodicity }) {
@ -51,4 +51,4 @@ class Cashflow {
}
}
module.exports = Cashflow;
export default Cashflow;

View File

@ -1,8 +1,8 @@
const frappe = require('frappejs');
const { DateTime } = require('luxon');
const { unique } = require('frappejs/utils');
import frappe from 'frappejs';
import { DateTime } from 'luxon';
import { unique } from 'frappejs/utils';
async function getData({
export async function getData({
rootType,
balanceMustBe = 'Debit',
fromDate,
@ -65,7 +65,7 @@ async function getData({
return { accounts, totalRow, periodList };
}
async function getTrialBalance({ rootType, fromDate, toDate }) {
export async function getTrialBalance({ rootType, fromDate, toDate }) {
let accounts = await getAccounts(rootType);
let ledgerEntries = await getLedgerEntries(null, toDate, accounts);
@ -134,7 +134,7 @@ async function getTrialBalance({ rootType, fromDate, toDate }) {
return accounts;
}
function getPeriodList(fromDate, toDate, periodicity, fiscalYear) {
export function getPeriodList(fromDate, toDate, periodicity, fiscalYear) {
if (!fromDate) {
fromDate = fiscalYear.start;
}
@ -284,7 +284,7 @@ async function getFiscalYear() {
};
}
module.exports = {
export default {
getData,
getTrialBalance,
getPeriodList

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
class GeneralLedger {
async run(params) {
@ -84,4 +84,4 @@ class GeneralLedger {
}
}
module.exports = GeneralLedger;
export default GeneralLedger;

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
class BaseGSTR {
async getCompleteReport(gstrType, filters) {
@ -65,4 +65,4 @@ class BaseGSTR {
}
}
module.exports = BaseGSTR;
export default BaseGSTR;

View File

@ -1,4 +1,6 @@
module.exports = {
import ExportWizard from '../../src/components/ExportWizard';
export default {
filterFields: [
{
fieldtype: 'Select',
@ -62,7 +64,7 @@ module.exports = {
title: `Export ${title}`,
noFooter: true
},
component: require('../../src/components/ExportWizard').default,
component: ExportWizard,
props: await getReportDetails()
});
}

View File

@ -1,4 +1,4 @@
const BaseGSTR = require('./BaseGSTR');
import BaseGSTR from './BaseGSTR';
class GSTR1 extends BaseGSTR {
async run(params) {
@ -25,4 +25,4 @@ class GSTR1 extends BaseGSTR {
}
}
module.exports = GSTR1;
export default GSTR1;

View File

@ -1,6 +1,7 @@
const title = 'GSTR 1';
const baseConfig = require('./BaseViewConfig');
module.exports = {
import baseConfig from './BaseViewConfig';
export default {
title: title,
method: 'gstr-1',
filterFields: baseConfig.filterFields,

View File

@ -1,4 +1,4 @@
const BaseGSTR = require('./BaseGSTR');
import BaseGSTR from './BaseGSTR';
class GSTR2 extends BaseGSTR {
async run(params) {
@ -25,4 +25,4 @@ class GSTR2 extends BaseGSTR {
}
}
module.exports = GSTR2;
export default GSTR2;

View File

@ -1,6 +1,7 @@
const title = 'GSTR 2';
const baseConfig = require('./BaseViewConfig');
module.exports = {
import baseConfig from './BaseViewConfig';
export default {
title: title,
method: 'gstr-2',
filterFields: baseConfig.filterFields,

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs');
const { unique } = require('frappejs/utils');
const { getData } = require('../FinancialStatements/FinancialStatements');
import frappe from 'frappejs';
import { unique } from 'frappejs/utils';
import { getData } from '../FinancialStatements/FinancialStatements';
class ProfitAndLoss {
async run({ fromDate, toDate, periodicity }) {
@ -81,4 +81,4 @@ class ProfitAndLoss {
}
}
module.exports = ProfitAndLoss;
export default ProfitAndLoss;

View File

@ -1,7 +1,8 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
const title = 'Profit and Loss';
module.exports = {
export default {
title: title,
method: 'profit-and-loss',
treeView: true,

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
class PurchaseRegister {
async run({ fromDate, toDate, supplier }) {
@ -53,4 +53,4 @@ class PurchaseRegister {
}
}
module.exports = PurchaseRegister;
export default PurchaseRegister;

View File

@ -1,5 +1,6 @@
const title = 'Purchase Register';
module.exports = {
export default {
title: title,
method: 'purchase-register',
filterFields: [

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs');
import frappe from 'frappejs';
class SalesRegister {
async run({ fromDate, toDate, customer }) {
@ -52,4 +52,4 @@ class SalesRegister {
}
}
module.exports = SalesRegister;
export default SalesRegister;

View File

@ -1,5 +1,6 @@
const title = 'Sales Register';
module.exports = {
export default {
title: title,
method: 'sales-register',
filterFields: [

View File

@ -1,9 +1,7 @@
const frappe = require('frappejs');
const {
getTrialBalance
} = require('../FinancialStatements/FinancialStatements');
import frappe from 'frappejs';
import { getTrialBalance } from '../FinancialStatements/FinancialStatements';
module.exports = class TrialBalance {
export default class TrialBalance {
async run({ fromDate, toDate }) {
if (!fromDate && !toDate) {
return { rows: [] };

Some files were not shown because too many files have changed in this diff Show More