2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Merge pull request #232 from 18alantom/bump-versions

build(deps): bump versions of all except vue
This commit is contained in:
Alan 2021-11-05 14:47:22 +05:30 committed by GitHub
commit c6c89c2e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
138 changed files with 3311 additions and 2652 deletions

View File

@ -3,12 +3,15 @@ module.exports = {
env: { env: {
node: true node: true
}, },
extends: ["plugin:vue/essential", "@vue/prettier"], extends: ["plugin:vue/essential"],
rules: { rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off", "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"arrow-body-style": "off",
"prefer-arrow-callback": "off",
"vue/multi-word-component-names": "off"
}, },
parserOptions: { parserOptions: {
parser: "babel-eslint" parser: "@babel/eslint-parser"
} }
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
const frappe = require('frappejs'); import frappe from 'frappejs';
const _ = frappe._.bind(frappe); const _ = frappe._.bind(frappe);
module.exports = { export default {
[_("Application of Funds (Assets)")]: { [_("Application of Funds (Assets)")]: {
[_("Current Assets")]: { [_("Current Assets")]: {
[_("Accounts Receivable")]: { [_("Accounts Receivable")]: {
@ -170,4 +170,4 @@ module.exports = {
}, },
"rootType": "Equity" "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', name: 'Account',
label: 'Account', label: 'Account',
doctype: 'DocType', doctype: 'DocType',
documentClass: require('./AccountDocument.js'), documentClass: Account,
isSingle: 0, isSingle: 0,
isTree: 1, isTree: 1,
keywordFields: ['name', 'rootType', 'accountType'], keywordFields: ['name', 'rootType', 'accountType'],

View File

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

View File

@ -1,4 +1,4 @@
module.exports = { export default {
name: 'AccountingLedgerEntry', name: 'AccountingLedgerEntry',
label: 'Ledger Entry', label: 'Ledger Entry',
naming: 'autoincrement', 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', name: 'AccountingSettings',
label: 'Accounting Settings', label: 'Accounting Settings',
naming: 'name', // {random|autoincrement} naming: 'name', // {random|autoincrement}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
const model = require('frappejs/model'); import model from 'frappejs/model';
const QuotationSettings = require('../QuotationSettings/QuotationSettings'); import QuotationSettings from '../QuotationSettings/QuotationSettings';
module.exports = model.extend(QuotationSettings, { export default model.extend(QuotationSettings, {
"name": "FulfillmentSettings", "name": "FulfillmentSettings",
"label": "Fulfillment Settings", "label": "Fulfillment Settings",
"fields": [ "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', name: 'GSTR3B',
label: 'GSTR 3B', label: 'GSTR 3B',
doctype: 'DocType', doctype: 'DocType',
documentClass: require('./GSTR3BDocument.js'), documentClass: GSTR3B,
print: { print: {
printFormat: 'GSTR3B Print Format' printFormat: 'GSTR3B Print Format'
}, },

View File

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

View File

@ -1,4 +1,4 @@
const format = { export default {
gstin: '', gstin: '',
ret_period: '', ret_period: '',
inward_sup: { inward_sup: {
@ -383,8 +383,4 @@ function generateHTML(data) {
</div>`; </div>`;
return template; 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() { async validate() {
if (this.month.length === 0 || this.year.length != 4) { if (this.month.length === 0 || this.year.length != 4) {
frappe.call({ frappe.call({

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,11 +1,12 @@
const { getActions } = require('../Transaction/Transaction'); import { getActions } from '../Transaction/Transaction';
const InvoiceTemplate = require('../SalesInvoice/InvoiceTemplate.vue').default; import InvoiceTemplate from '../SalesInvoice/InvoiceTemplate.vue';
import PurchaseInvoice from './PurchaseInvoiceDocument';
module.exports = { export default {
name: 'PurchaseInvoice', name: 'PurchaseInvoice',
doctype: 'DocType', doctype: 'DocType',
label: 'Purchase Invoice', label: 'Purchase Invoice',
documentClass: require('./PurchaseInvoiceDocument'), documentClass: PurchaseInvoice,
printTemplate: InvoiceTemplate, printTemplate: InvoiceTemplate,
isSingle: 0, isSingle: 0,
isChild: 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'); import TransactionServer from '../Transaction/TransactionServer';
const PurchaseInvoice = require('./PurchaseInvoiceDocument'); import PurchaseInvoice from './PurchaseInvoiceDocument';
const LedgerPosting = require('../../../accounting/ledgerPosting'); import LedgerPosting from '../../../accounting/ledgerPosting';
class PurchaseInvoiceServer extends PurchaseInvoice { class PurchaseInvoiceServer extends PurchaseInvoice {
async getPosting() { async getPosting() {
@ -24,4 +24,4 @@ class PurchaseInvoiceServer extends PurchaseInvoice {
// apply common methods from TransactionServer // apply common methods from TransactionServer
Object.assign(PurchaseInvoiceServer.prototype, TransactionServer); Object.assign(PurchaseInvoiceServer.prototype, TransactionServer);
module.exports = PurchaseInvoiceServer; export default PurchaseInvoiceServer;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
const model = require('frappejs/model'); import model from 'frappejs/model';
const SalesInvoice = require('../SalesInvoice/SalesInvoice'); import SalesInvoice from '../SalesInvoice/SalesInvoice';
const Quotation = model.extend( const Quotation = model.extend(
SalesInvoice, 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'); import model from 'frappejs/model';
const SalesInvoiceItem = require('../SalesInvoiceItem/SalesInvoiceItem'); import SalesInvoiceItem from '../SalesInvoiceItem/SalesInvoiceItem';
module.exports = model.extend(SalesInvoiceItem, { export default model.extend(SalesInvoiceItem, {
name: "QuotationItem" name: "QuotationItem"
}); });

View File

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

View File

@ -1,11 +1,12 @@
const { getActions } = require('../Transaction/Transaction'); import { getActions } from '../Transaction/Transaction';
const InvoiceTemplate = require('./InvoiceTemplate.vue').default; import InvoiceTemplate from './InvoiceTemplate.vue';
import SalesInvoice from './SalesInvoiceDocument';
module.exports = { export default {
name: 'SalesInvoice', name: 'SalesInvoice',
label: 'Sales Invoice', label: 'Sales Invoice',
doctype: 'DocType', doctype: 'DocType',
documentClass: require('./SalesInvoiceDocument'), documentClass: SalesInvoice,
printTemplate: InvoiceTemplate, printTemplate: InvoiceTemplate,
isSingle: 0, isSingle: 0,
isChild: 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'); import TransactionServer from '../Transaction/TransactionServer';
const SalesInvoice = require('./SalesInvoiceDocument'); import SalesInvoice from './SalesInvoiceDocument';
const LedgerPosting = require('../../../accounting/ledgerPosting'); import LedgerPosting from '../../../accounting/ledgerPosting';
class SalesInvoiceServer extends SalesInvoice { class SalesInvoiceServer extends SalesInvoice {
async getPosting() { async getPosting() {
@ -24,4 +24,4 @@ class SalesInvoiceServer extends SalesInvoice {
// apply common methods from TransactionServer // apply common methods from TransactionServer
Object.assign(SalesInvoiceServer.prototype, TransactionServer); Object.assign(SalesInvoiceServer.prototype, TransactionServer);
module.exports = SalesInvoiceServer; export default SalesInvoiceServer;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,88 +1,86 @@
const frappe = require('frappejs'); import frappe from 'frappejs';
const utils = require('../../../accounting/utils'); import utils from '../../../accounting/utils';
const { openQuickEdit } = require('@/utils'); import { openQuickEdit } from '@/utils';
const Badge = require('@/components/Badge').default; import Badge from '@/components/Badge';
module.exports = { export function getStatusColumn() {
getStatusColumn() { return {
return { label: 'Status',
label: 'Status', fieldname: 'status',
fieldname: 'status', fieldtype: 'Select',
fieldtype: 'Select', render(doc) {
render(doc) { let status = 'Unpaid';
let status = 'Unpaid'; let color = 'orange';
let color = 'orange'; if (!doc.submitted) {
if (!doc.submitted) { status = 'Draft';
status = 'Draft'; color = 'gray';
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 }
};
} }
}; if (doc.submitted === 1 && doc.outstandingAmount === 0.0) {
}, status = 'Paid';
getActions(doctype) { color = 'green';
return [ }
{ return {
label: 'Make Payment', template: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
condition: doc => doc.submitted && doc.outstandingAmount > 0, components: { Badge },
action: async function makePayment(doc) { };
let payment = await frappe.getNewDoc('Payment'); },
payment.once('afterInsert', async () => { };
await payment.submit(); }
});
let isSales = doctype === 'SalesInvoice'; export function getActions(doctype) {
let party = isSales ? doc.customer : doc.supplier; return [
let paymentType = isSales ? 'Receive' : 'Pay'; {
let hideAccountField = isSales ? 'account' : 'paymentAccount'; label: 'Make Payment',
openQuickEdit({ condition: (doc) => doc.submitted && doc.outstandingAmount > 0,
doctype: 'Payment', action: async function makePayment(doc) {
name: payment.name, let payment = await frappe.getNewDoc('Payment');
hideFields: [ payment.once('afterInsert', async () => {
'party', await payment.submit();
'date', });
hideAccountField, let isSales = doctype === 'SalesInvoice';
'paymentType', let party = isSales ? doc.customer : doc.supplier;
'for' 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 => label: 'Revert',
doc.submitted && doc.baseGrandTotal === doc.outstandingAmount, condition: (doc) =>
action(doc) { doc.submitted && doc.baseGrandTotal === doc.outstandingAmount,
doc.revert(); action(doc) {
} doc.revert();
}, },
{ },
label: 'Print', {
condition: doc => doc.submitted, label: 'Print',
action(doc, router) { condition: (doc) => doc.submitted,
router.push(`/print/${doc.doctype}/${doc.name}`); 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'); import BaseDocument from 'frappejs/model/document';
const frappe = require('frappejs'); import frappe from 'frappejs';
const { round } = require('frappejs/utils/numberFormat'); import { round } from 'frappejs/utils/numberFormat';
const { getExchangeRate } = require('../../../accounting/exchangeRate'); import { getExchangeRate } from '../../../accounting/exchangeRate';
module.exports = class TransactionDocument extends BaseDocument { export default class TransactionDocument extends BaseDocument {
async getExchangeRate() { async getExchangeRate() {
if (!this.currency) return; if (!this.currency) return;

View File

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

View File

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

View File

@ -17,37 +17,41 @@
}, },
"main": "background.js", "main": "background.js",
"dependencies": { "dependencies": {
"@popperjs/core": "^2.0.3", "@popperjs/core": "^2.10.2",
"core-js": "^3.4.3", "core-js": "^3.19.0",
"electron-store": "^5.1.0", "csvjson-csv2json": "^5.0.6",
"frappejs": "https://github.com/frappe/frappejs", "electron-store": "^8.0.1",
"frappe-charts": "1.6.1", "frappe-charts": "1.6.1",
"knex": "^0.95.11", "frappejs": "https://github.com/frappe/frappejs",
"lodash": "^4.17.15", "knex": "^0.95.12",
"luxon": "^1.21.3", "lodash": "^4.17.21",
"portal-vue": "^2.1.6", "luxon": "^2.0.2",
"sqlite3": "^4.1.1", "portal-vue": "^2.1.7",
"tailwindcss": "^1.2.0", "sqlite3": "^5.0.2",
"vue": "^2.6.10", "vue": "^2.6.14",
"vue-router": "^3.1.3" "vue-router": "^3.5.3"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@babel/core": "^7.16.0",
"@vue/cli-plugin-eslint": "^4.1.0", "@babel/eslint-parser": "^7.16.0",
"@vue/cli-plugin-router": "^4.1.0", "@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-service": "^4.1.0", "@vue/cli-plugin-eslint": "^5.0.0-beta.7",
"@vue/eslint-config-prettier": "^5.0.0", "@vue/cli-plugin-router": "^4.5.0",
"babel-eslint": "^10.0.3", "@vue/cli-service": "^4.5.0",
"electron": "^8.0.0", "autoprefixer": "^9",
"electron": "^15.3.0",
"electron-devtools-installer": "^3.2.0", "electron-devtools-installer": "^3.2.0",
"electron-notarize": "^0.2.1", "electron-notarize": "^1.1.1",
"electron-updater": "^4.2.0", "electron-updater": "^4.3.9",
"eslint": "^5.16.0", "eslint": "^7.32.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-prettier": "^4.0.0",
"lint-staged": "^9.4.3", "eslint-plugin-vue": "^8.0.3",
"prettier": "^1.19.1", "lint-staged": "^11.2.6",
"raw-loader": "^4.0.0", "postcss": "^7",
"prettier": "^2.4.1",
"raw-loader": "^4.0.2",
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
"vue-cli-plugin-electron-builder": "^2.0.0", "vue-cli-plugin-electron-builder": "^2.0.0",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"
}, },

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 }) { async run(reportType, { date }) {
const rows = await getReceivablePayable({ const rows = await getReceivablePayable({
reportType, reportType,

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs'); import frappe from 'frappejs';
const { unique } = require('frappejs/utils'); import { unique } from 'frappejs/utils';
const { getData } = require('../FinancialStatements/FinancialStatements'); import { getData } from '../FinancialStatements/FinancialStatements';
class BalanceSheet { class BalanceSheet {
async run({ fromDate, toDate, periodicity }) { 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', title: 'Balance Sheet',
method: 'balance-sheet', method: 'balance-sheet',
filterFields: [ filterFields: [

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs'); import frappe from 'frappejs';
class BankReconciliation { class BankReconciliation {
async run(params) { 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'); import csv2json from 'csvjson-csv2json';
const frappe = require('frappejs'); import frappe from 'frappejs';
import Vue from 'vue'; import ReconciliationValidation from '../../src/components/ReconciliationValidation';
export const fileImportHandler = (file, report) => { export const fileImportHandler = (file, report) => {
const reader = new FileReader(); const reader = new FileReader();
@ -12,34 +12,34 @@ export const fileImportHandler = (file, report) => {
reader.readAsBinaryString(file); reader.readAsBinaryString(file);
}; };
export const csvToJsonHandler = csv => { export const csvToJsonHandler = (csv) => {
const json = csv2json(csv, { parseNumbers: true }); const json = csv2json(csv, { parseNumbers: true });
return json; return json;
}; };
export const findMatchingReferences = async (json, report) => { 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; 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; 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 || return field.toLowerCase().indexOf('debit') > -1 ||
field.toLowerCase().indexOf('deposit') > -1 field.toLowerCase().indexOf('deposit') > -1
? true ? true
: false; : false;
}); });
const creditField = Object.keys(json[0]).filter(field => { const creditField = Object.keys(json[0]).filter((field) => {
return field.toLowerCase().indexOf('credit') > -1 || return field.toLowerCase().indexOf('credit') > -1 ||
field.toLowerCase().indexOf('withdraw') > -1 field.toLowerCase().indexOf('withdraw') > -1
? true ? true
: false; : 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; return field.toLowerCase().indexOf('balance') > -1 ? true : false;
}); });
const references = json.map(row => { const references = json.map((row) => {
return row[referenceField]; return row[referenceField];
}); });
const payments = await frappe.db.getAll({ const payments = await frappe.db.getAll({
@ -48,17 +48,17 @@ export const findMatchingReferences = async (json, report) => {
filters: { filters: {
referenceId: ['in', references], referenceId: ['in', references],
paymentAccount: report.currentFilters.paymentAccount, paymentAccount: report.currentFilters.paymentAccount,
clearanceDate: ['in', [null, undefined, '']] clearanceDate: ['in', [null, undefined, '']],
} },
}); });
if (payments.length) { if (payments.length) {
const entries = payments.map(payment => { const entries = payments.map((payment) => {
const jsonEntry = json.filter(row => { const jsonEntry = json.filter((row) => {
return row[referenceField] === payment.referenceId; return row[referenceField] === payment.referenceId;
}); });
return Object.assign(payment, jsonEntry[0]); return Object.assign(payment, jsonEntry[0]);
}); });
const normalizedEntries = entries.map(entry => { const normalizedEntries = entries.map((entry) => {
return { return {
'Posting Date': frappe.format(entry.date, 'Date'), 'Posting Date': frappe.format(entry.date, 'Date'),
'Payment Entry': entry.name, 'Payment Entry': entry.name,
@ -67,30 +67,29 @@ export const findMatchingReferences = async (json, report) => {
frappe.parseNumber(entry[debitField]) > 0 frappe.parseNumber(entry[debitField]) > 0
? entry[debitField] + ' Dr.' ? entry[debitField] + ' Dr.'
: entry[creditField] + ' Cr.', : entry[creditField] + ' Cr.',
'Clearance Date': entry[clearanceDateField] 'Clearance Date': entry[clearanceDateField],
}; };
}); });
report.$modal.show({ report.$modal.show({
modalProps: { modalProps: {
title: `Validate Matching Entries`, title: `Validate Matching Entries`,
noFooter: true noFooter: true,
}, },
component: require('../../src/components/ReconciliationValidation') component: ReconciliationValidation,
.default,
props: { props: {
entries: normalizedEntries, entries: normalizedEntries,
afterReconcile: async () => { afterReconcile: async () => {
await report.getReportData(report.currentFilters); await report.getReportData(report.currentFilters);
} },
} },
}); });
} else { } else {
frappe.call({ frappe.call({
method: 'show-dialog', method: 'show-dialog',
args: { args: {
title: 'Message', 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'; const title = 'Bank Reconciliation';
module.exports = { import ImportWizard from '../../src/components/ImportWizart';
import BankReconciliationImport from './BankReconciliationImport';
export default {
title: title, title: title,
method: 'bank-reconciliation', method: 'bank-reconciliation',
filterFields: [ filterFields: [
@ -13,9 +16,9 @@ module.exports = {
getFilters: () => { getFilters: () => {
return { return {
accountType: 'Bank', accountType: 'Bank',
isGroup: 0 isGroup: 0,
}; };
} },
}, },
{ {
fieldtype: 'Link', fieldtype: 'Link',
@ -23,105 +26,104 @@ module.exports = {
size: 'small', size: 'small',
label: 'Party', label: 'Party',
placeholder: 'Party', placeholder: 'Party',
fieldname: 'party' fieldname: 'party',
}, },
{ {
fieldtype: 'Date', fieldtype: 'Date',
size: 'small', size: 'small',
placeholder: 'From Date', placeholder: 'From Date',
label: 'From Date', label: 'From Date',
fieldname: 'fromDate' fieldname: 'fromDate',
}, },
{ {
fieldtype: 'Date', fieldtype: 'Date',
size: 'small', size: 'small',
placeholder: 'To Date', placeholder: 'To Date',
label: 'To Date', label: 'To Date',
fieldname: 'toDate' fieldname: 'toDate',
} },
], ],
linkFields: [ linkFields: [
{ {
label: 'Reconcile', label: 'Reconcile',
type: 'secondary', type: 'secondary',
condition: report => report.currentFilters.paymentAccount, condition: (report) => report.currentFilters.paymentAccount,
action: async report => { action: async (report) => {
report.$modal.show({ report.$modal.show({
modalProps: { modalProps: {
title: `Import Bank Account Statement`, title: `Import Bank Account Statement`,
noFooter: true noFooter: true,
}, },
component: require('../../src/components/ImportWizard').default, component: ImportWizard,
props: { props: {
importHandler: require('./BankReconciliationImport') importHandler: BankReconciliationImport.fileImportHandler,
.fileImportHandler, report,
report },
}
}); });
} },
}, },
{ {
label: 'Clear Filters', label: 'Clear Filters',
type: 'secondary', type: 'secondary',
action: async report => { action: async (report) => {
await report.getReportData({}); await report.getReportData({});
report.usedToReRender += 1; report.usedToReRender += 1;
} },
} },
], ],
getColumns() { getColumns() {
return [ return [
{ {
label: 'Posting Date', label: 'Posting Date',
fieldtype: 'Date', fieldtype: 'Date',
fieldname: 'date' fieldname: 'date',
}, },
{ {
label: 'Payment Account', label: 'Payment Account',
fieldtype: 'Link' fieldtype: 'Link',
}, },
{ {
label: 'Debit', label: 'Debit',
fieldtype: 'Currency' fieldtype: 'Currency',
}, },
{ {
label: 'Credit', label: 'Credit',
fieldtype: 'Currency' fieldtype: 'Currency',
}, },
{ {
label: 'Balance', label: 'Balance',
fieldtype: 'Currency' fieldtype: 'Currency',
}, },
{ {
label: 'Ref/Cheque ID', label: 'Ref/Cheque ID',
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'referenceId' fieldname: 'referenceId',
}, },
{ {
label: 'Clearance Date', label: 'Clearance Date',
fieldtype: 'Date', fieldtype: 'Date',
fieldname: 'clearanceDate' fieldname: 'clearanceDate',
}, },
{ {
label: 'Ref. Type', label: 'Ref. Type',
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'referenceType' fieldname: 'referenceType',
}, },
{ {
label: 'Ref. Name', label: 'Ref. Name',
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'referenceName' fieldname: 'referenceName',
}, },
{ {
label: 'Ref. Date', label: 'Ref. Date',
fieldtype: 'Date', fieldtype: 'Date',
fieldname: 'referenceDate' fieldname: 'referenceDate',
}, },
{ {
label: 'Party', label: 'Party',
fieldtype: 'Link' fieldtype: 'Link',
} },
]; ];
} },
}; };

View File

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

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs'); import frappe from 'frappejs';
class GeneralLedger { class GeneralLedger {
async run(params) { 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 { class BaseGSTR {
async getCompleteReport(gstrType, filters) { 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: [ filterFields: [
{ {
fieldtype: 'Select', fieldtype: 'Select',
@ -62,7 +64,7 @@ module.exports = {
title: `Export ${title}`, title: `Export ${title}`,
noFooter: true noFooter: true
}, },
component: require('../../src/components/ExportWizard').default, component: ExportWizard,
props: await getReportDetails() props: await getReportDetails()
}); });
} }

View File

@ -1,4 +1,4 @@
const BaseGSTR = require('./BaseGSTR'); import BaseGSTR from './BaseGSTR';
class GSTR1 extends BaseGSTR { class GSTR1 extends BaseGSTR {
async run(params) { 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 title = 'GSTR 1';
const baseConfig = require('./BaseViewConfig'); import baseConfig from './BaseViewConfig';
module.exports = {
export default {
title: title, title: title,
method: 'gstr-1', method: 'gstr-1',
filterFields: baseConfig.filterFields, filterFields: baseConfig.filterFields,

View File

@ -1,4 +1,4 @@
const BaseGSTR = require('./BaseGSTR'); import BaseGSTR from './BaseGSTR';
class GSTR2 extends BaseGSTR { class GSTR2 extends BaseGSTR {
async run(params) { 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 title = 'GSTR 2';
const baseConfig = require('./BaseViewConfig'); import baseConfig from './BaseViewConfig';
module.exports = {
export default {
title: title, title: title,
method: 'gstr-2', method: 'gstr-2',
filterFields: baseConfig.filterFields, filterFields: baseConfig.filterFields,

View File

@ -1,6 +1,6 @@
const frappe = require('frappejs'); import frappe from 'frappejs';
const { unique } = require('frappejs/utils'); import { unique } from 'frappejs/utils';
const { getData } = require('../FinancialStatements/FinancialStatements'); import { getData } from '../FinancialStatements/FinancialStatements';
class ProfitAndLoss { class ProfitAndLoss {
async run({ fromDate, toDate, periodicity }) { 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'; const title = 'Profit and Loss';
module.exports = {
export default {
title: title, title: title,
method: 'profit-and-loss', method: 'profit-and-loss',
treeView: true, treeView: true,

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs'); import frappe from 'frappejs';
class PurchaseRegister { class PurchaseRegister {
async run({ fromDate, toDate, supplier }) { 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'; const title = 'Purchase Register';
module.exports = {
export default {
title: title, title: title,
method: 'purchase-register', method: 'purchase-register',
filterFields: [ filterFields: [

View File

@ -1,4 +1,4 @@
const frappe = require('frappejs'); import frappe from 'frappejs';
class SalesRegister { class SalesRegister {
async run({ fromDate, toDate, customer }) { 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'; const title = 'Sales Register';
module.exports = {
export default {
title: title, title: title,
method: 'sales-register', method: 'sales-register',
filterFields: [ filterFields: [

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