2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +00:00

incr: drop unused doctypes

This commit is contained in:
18alantom 2022-03-23 12:17:13 +05:30
parent 71d931ac75
commit a546f144ca
46 changed files with 42 additions and 1900 deletions

View File

@ -1,61 +0,0 @@
const { t } = require('frappe');
module.exports = {
name: 'File',
doctype: 'DocType',
isSingle: 0,
keywordFields: ['name', 'filename'],
fields: [
{
fieldname: 'name',
label: t`File Path`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'filename',
label: t`File Name`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'mimetype',
label: t`MIME Type`,
fieldtype: 'Data',
},
{
fieldname: 'size',
label: t`File Size`,
fieldtype: 'Int',
},
{
fieldname: 'referenceDoctype',
label: t`Reference DocType`,
fieldtype: 'Data',
},
{
fieldname: 'referenceName',
label: t`Reference Name`,
fieldtype: 'Data',
},
{
fieldname: 'referenceField',
label: t`Reference Field`,
fieldtype: 'Data',
},
],
layout: [
{
columns: [{ fields: ['filename'] }],
},
{
columns: [{ fields: ['mimetype'] }, { fields: ['size'] }],
},
{
columns: [
{ fields: ['referenceDoctype'] },
{ fields: ['referenceName'] },
],
},
],
};

View File

@ -1,33 +0,0 @@
const { t } = require('frappe');
module.exports = {
name: 'PrintFormat',
label: t`Print Format`,
doctype: 'DocType',
isSingle: 0,
isChild: 0,
keywordFields: [],
fields: [
{
fieldname: 'name',
label: t`Name`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'for',
label: t`For`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'template',
label: t`Template`,
fieldtype: 'Code',
required: 1,
options: {
mode: 'text/html',
},
},
],
};

View File

@ -1,17 +0,0 @@
const { t } = require('frappe');
module.exports = {
name: 'Role',
doctype: 'DocType',
isSingle: 0,
isChild: 0,
keywordFields: [],
fields: [
{
fieldname: 'name',
label: t`Name`,
fieldtype: 'Data',
required: 1,
},
],
};

View File

@ -1,23 +0,0 @@
const { t } = require('frappe');
module.exports = {
name: 'Session',
doctype: 'DocType',
isSingle: 0,
isChild: 0,
keywordFields: [],
fields: [
{
fieldname: 'username',
label: t`Username`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'password',
label: t`Password`,
fieldtype: 'Password',
required: 1,
},
],
};

View File

@ -1,62 +0,0 @@
const { indicators } = require('../../../../src/colors');
const { BLUE, GREEN } = indicators;
const { t } = require('frappe');
module.exports = {
name: 'ToDo',
label: t`To Do`,
naming: 'autoincrement',
isSingle: 0,
keywordFields: ['subject', 'description'],
titleField: 'subject',
indicators: {
key: 'status',
colors: {
Open: BLUE,
Closed: GREEN,
},
},
fields: [
{
fieldname: 'subject',
label: t`Subject`,
placeholder: t`Subject`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'status',
label: t`Status`,
fieldtype: 'Select',
options: ['Open', 'Closed'],
default: 'Open',
required: 1,
},
{
fieldname: 'description',
label: t`Description`,
fieldtype: 'Text',
},
],
quickEditFields: ['status', 'description'],
actions: [
{
label: t`Close`,
condition: (doc) => doc.status !== 'Closed',
action: async (doc) => {
await doc.set('status', 'Closed');
await doc.update();
},
},
{
label: t`Re-Open`,
condition: (doc) => doc.status !== 'Open',
action: async (doc) => {
await doc.set('status', 'Open');
await doc.update();
},
},
],
};

View File

@ -1,7 +0,0 @@
const BaseList = require('frappe/client/view/list');
module.exports = class ToDoList extends BaseList {
getFields(list) {
return ['name', 'subject', 'status'];
}
};

View File

@ -1,42 +0,0 @@
const { t } = require('frappe');
module.exports = {
name: 'User',
doctype: 'DocType',
isSingle: 0,
isChild: 0,
keywordFields: ['name', 'fullName'],
fields: [
{
fieldname: 'name',
label: t`Email`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'password',
label: t`Password`,
fieldtype: 'Password',
required: 1,
hidden: 1,
},
{
fieldname: 'fullName',
label: t`Full Name`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'roles',
label: t`Roles`,
fieldtype: 'Table',
childtype: 'UserRole',
},
{
fieldname: 'userId',
label: t`User ID`,
fieldtype: 'Data',
hidden: 1,
},
],
};

View File

@ -1,17 +0,0 @@
const { t } = require('frappe');
module.exports = {
name: 'UserRole',
doctype: 'DocType',
isSingle: 0,
isChild: 1,
keywordFields: [],
fields: [
{
fieldname: 'role',
label: t`Role`,
fieldtype: 'Link',
target: 'Role',
},
],
};

View File

@ -1,25 +1,13 @@
import File from './doctype/File/File.js';
import NumberSeries from './doctype/NumberSeries/NumberSeries.js'; import NumberSeries from './doctype/NumberSeries/NumberSeries.js';
import PatchRun from './doctype/PatchRun/PatchRun.js'; import PatchRun from './doctype/PatchRun/PatchRun.js';
import PrintFormat from './doctype/PrintFormat/PrintFormat.js'; import PrintFormat from './doctype/PrintFormat/PrintFormat.js';
import Role from './doctype/Role/Role.js';
import Session from './doctype/Session/Session.js';
import SingleValue from './doctype/SingleValue/SingleValue.js'; import SingleValue from './doctype/SingleValue/SingleValue.js';
import SystemSettings from './doctype/SystemSettings/SystemSettings.js'; import SystemSettings from './doctype/SystemSettings/SystemSettings.js';
import ToDo from './doctype/ToDo/ToDo.js';
import User from './doctype/User/User.js';
import UserRole from './doctype/UserRole/UserRole.js';
export default { export default {
NumberSeries, NumberSeries,
PrintFormat, PrintFormat,
Role,
Session,
SingleValue, SingleValue,
SystemSettings, SystemSettings,
ToDo,
User,
UserRole,
File,
PatchRun, PatchRun,
}; };

View File

@ -1,73 +0,0 @@
import frappe, { t } from 'frappe';
export default {
name: 'Email',
doctype: 'DocType',
pageSettings: {
hideTitle: true,
},
isSingle: 0,
isChild: 0,
keywordFields: ['name'],
fields: [
{
fieldname: 'name',
label: t`name`,
fieldtype: 'Data',
required: 0,
hidden: 1,
disabled: 0,
},
{
fieldname: 'fromEmailAddress',
label: t`From`,
fieldtype: 'Data',
required: 1,
hidden: 0,
formula: async () => {
const accountingSettings = await frappe.getDoc('AccountingSettings');
return accountingSettings.email;
},
disabled: 1,
},
{
fieldname: 'toEmailAddress',
label: t`To`,
fieldtype: 'Data',
required: 1,
hidden: 0,
disabled: 0,
},
{
fieldname: 'date',
label: t`Date`,
fieldtype: 'Datetime',
required: 0,
hidden: 0,
disabled: 1,
},
{
fieldname: 'subject',
label: t`Subject`,
fieldtype: 'Data',
required: 0,
hidden: 0,
disabled: 0,
},
{
fieldname: 'bodyText',
label: t`Body`,
fieldtype: 'Text',
required: 0,
hidden: 0,
disabled: 0,
},
{
fieldname: 'filePath',
label: t`File Path`,
fieldtype: 'Text',
required: 0,
hidden: 1,
},
],
};

View File

@ -1,54 +0,0 @@
import frappe, { t } from 'frappe';
export default {
name: 'EmailAccount',
label: t`Email Account`,
doctype: 'DocType',
isSingle: true,
isChild: false,
keywordFields: ['email'],
fields: [
{
fieldname: 'email',
label: t`Email`,
fieldtype: 'Data',
required: 1,
formula: async () => {
const accountingSettings = await frappe.getDoc('AccountingSettings');
return accountingSettings.email;
},
},
{
fieldname: 'password',
label: t`Password`,
fieldtype: 'Password',
required: 1,
},
{
fieldname: 'confirmPassword',
label: t`Confirm Password`,
fieldtype: 'Password',
required: 1,
},
{
fieldname: 'smtpHost',
label: t`SMTP Host`,
fieldtype: 'Select',
options: [
'smtp.gmail.com',
'smtp.mail.yahoo.com',
'smtp-mail.outlook.com',
'smtp.mail.me.com',
'smtp.aol.com',
],
default: 'smtp.gmail.com',
},
{
fieldname: 'smtpPort',
label: t`SMTP Port`,
fieldtype: 'Select',
options: ['465', '587'],
default: '465',
},
],
};

View File

@ -1,39 +0,0 @@
import { t } from 'frappe';
import EventDocument from './EventDocument';
export default {
name: 'Event',
doctype: 'DocType',
naming: 'random',
documentClass: EventDocument,
settings: 'EventSettings',
fields: [
{
fieldname: 'title',
label: t`Title`,
fieldtype: 'Data',
},
{
fieldname: 'date',
label: t`Date`,
fieldtype: 'Date',
},
{
fieldname: 'schedule',
fieldtype: 'Table',
childtype: 'EventSchedule',
label: t`Schedule`,
},
],
titleField: 'title',
keywordFields: [],
isSingle: 0,
listSettings: {
getFields(list) {
return ['name', 'title', 'date'];
},
getRowHTML(list, data) {
return `<div class='col-11'>${data.title} on ${data.date}</div>`;
},
},
};

View File

@ -1,7 +0,0 @@
import Document from 'frappe/model/document';
export default class Event extends Document {
alertEvent() {
alert(this.title);
}
}

View File

@ -1,19 +0,0 @@
import { t } from 'frappe';
export default {
name: 'EventSchedule',
doctype: 'DocType',
isChild: 1,
fields: [
{
fieldname: 'startTime',
label: t`Start Time`,
fieldtype: 'Data',
},
{
fieldname: 'title',
label: t`Title`,
fieldtype: 'Data',
},
],
};

View File

@ -1,17 +0,0 @@
import { t } from 'frappe';
export default {
name: 'EventSettings',
label: t`Event Settings`,
doctype: 'DocType',
isSingle: 1,
isChild: 0,
keywordFields: [],
fields: [
{
fieldname: 'enableNotifications',
label: t`Enable Notifications`,
fieldtype: 'Check',
},
],
};

View File

@ -1,27 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import { DEFAULT_NUMBER_SERIES } from '../../../frappe/utils/consts';
import Quotation from '../Quotation/Quotation';
export default model.extend(Quotation, {
name: 'Fulfillment',
label: t`Fulfillment`,
settings: 'FulfillmentSettings',
fields: [
{
fieldname: 'items',
childtype: 'FulfillmentItem',
},
{
fieldname: 'numberSeries',
label: t`Number Series`,
fieldtype: 'Link',
target: 'NumberSeries',
required: 1,
getFilters: () => {
return { referenceType: 'Fulfillment' };
},
default: DEFAULT_NUMBER_SERIES['FulFillment'],
},
],
});

View File

@ -1,6 +0,0 @@
import model from 'frappe/model';
import QuotationItem from '../QuotationItem/QuotationItem';
export default model.extend(QuotationItem, {
name: 'FulfillmentItem',
});

View File

@ -1,25 +0,0 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash';
import FulfillmentItemOriginal from './FulfillmentItem';
export default function getAugmentedFulfillmentItem({ country }) {
const FulfillmentItem = cloneDeep(FulfillmentItemOriginal);
if (!country) {
return FulfillmentItem;
}
if (country === 'India') {
FulfillmentItem.fields = [
...FulfillmentItem.fields,
{
fieldname: 'hsnCode',
label: t`HSN/SAC`,
fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'],
},
];
}
return FulfillmentItem;
}

View File

@ -1,9 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import QuotationSettings from '../QuotationSettings/QuotationSettings';
export default model.extend(QuotationSettings, {
name: 'FulfillmentSettings',
label: t`Fulfillment Settings`,
fields: [],
});

View File

@ -1,78 +0,0 @@
import frappe, { t } from 'frappe';
import GSTR3B from './GSTR3BDocument.js';
export default {
name: 'GSTR3B',
label: t`GSTR 3B`,
doctype: 'DocType',
documentClass: GSTR3B,
print: {
printFormat: 'GSTR3B Print Format',
},
keywordFields: ['name', 'month', 'year'],
fields: [
{
fieldname: 'year',
label: t`Year`,
fieldtype: 'Data',
required: 1,
},
{
fieldname: 'month',
label: t`Month`,
placeholder: t`Month`,
fieldtype: 'Select',
options: [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
],
required: 1,
},
{
fieldname: 'jsonData',
label: t`JSON Data`,
fieldtype: 'Code',
formula: (doc) => doc.getJson(),
required: 1,
readOnly: 1,
rows: 15,
},
],
layout: [
{
columns: [{ fields: ['year', 'month', 'jsonData'] }],
},
],
links: [
{
label: t`Print PDF`,
condition: (form) => !form.doc._notInserted,
action: async (form) => {
form.$router.push({
path: `/print/GSTR3B/${form.doc.name}`,
});
},
},
{
label: t`Delete`,
condition: (form) => !form.doc._notInserted,
action: async (form) => {
const doc = await frappe.getDoc('GSTR3B', form.doc.name);
await doc.delete();
form.$router.push({
path: `/list/GSTR3B`,
});
},
},
],
};

View File

@ -1,150 +0,0 @@
import frappe from 'frappe';
import Document from 'frappe/model/document';
import format from './GSTR3BFormat';
export default class GSTR3B extends Document {
async getData() {
const monthIndex = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
].indexOf(this.month);
const month = monthIndex + 1 > 9 ? monthIndex + 1 : `0${monthIndex + 1}`;
const lastDate = new Date(this.year, monthIndex + 1, 0).getDate();
const filters = {
date: [
'>=',
`${this.year}-${month}-01`,
'<=',
`${this.year}-${month}-${lastDate}`,
],
};
const salesInvoices = frappe.db.getAll({
doctype: 'SalesInvoice',
filters,
fields: ['*'],
});
const purchaseInvoices = frappe.db.getAll({
doctype: 'PurchaseInvoice',
filters,
fields: ['*'],
});
const [gstr1Data, gstr2Data] = await Promise.all([
salesInvoices,
purchaseInvoices,
]);
let gstr3bData = [[], []];
for (let ledgerEntry of gstr1Data) {
ledgerEntry.doctype = 'SalesInvoice';
gstr3bData[0].push(await this.makeGSTRow(ledgerEntry));
}
for (let ledgerEntry of gstr2Data) {
ledgerEntry.doctype = 'PurchaseInvoice';
gstr3bData[1].push(await this.makeGSTRow(ledgerEntry));
}
return gstr3bData;
}
async makeGSTRow(ledgerEntry) {
let row = {};
ledgerEntry = await frappe.getDoc(ledgerEntry.doctype, ledgerEntry.name);
let party = await frappe.getDoc(
'Party',
ledgerEntry.customer || ledgerEntry.supplier
);
if (party.address) {
let addressDetails = await frappe.getDoc('Address', party.address);
row.place = addressDetails.state || '';
}
row.gstin = party.gstin;
row.partyName = ledgerEntry.customer || ledgerEntry.supplier;
row.invNo = ledgerEntry.name;
row.invDate = ledgerEntry.date;
row.rate = 0;
row.inState = true;
row.reverseCharge = !party.gstin ? 'Y' : 'N';
ledgerEntry.taxes.forEach((tax) => {
row.rate += tax.rate;
const taxAmt = (tax.rate * ledgerEntry.netTotal) / 100;
if (tax.account === 'IGST') row.igstAmt = taxAmt;
if (tax.account === 'IGST') row.inState = false;
if (tax.account === 'CGST') row.cgstAmt = taxAmt;
if (tax.account === 'SGST') row.sgstAmt = taxAmt;
if (tax.account === 'Nil Rated') row.nilRated = true;
if (tax.account === 'Exempt') row.exempt = true;
if (tax.account === 'Non GST') row.nonGST = true;
});
row.invAmt = ledgerEntry.grandTotal;
row.taxVal = ledgerEntry.netTotal;
return row;
}
async createJson(data) {
let jsonData = JSON.parse(JSON.stringify(format));
for (let ledgerEntry of data[0]) {
if (ledgerEntry.rate > 0) {
jsonData['sup_details']['osup_det']['samt'] += ledgerEntry.sgstAmt || 0;
jsonData['sup_details']['osup_det']['camt'] += ledgerEntry.cgstAmt || 0;
jsonData['sup_details']['osup_det']['iamt'] += ledgerEntry.igstAmt || 0;
jsonData['sup_details']['osup_det']['txval'] += ledgerEntry.taxVal;
}
if (ledgerEntry.rate === 0) {
jsonData['sup_details']['osup_zero']['txval'] += ledgerEntry.taxVal;
}
if (ledgerEntry.nilRated || ledgerEntry.exempt) {
jsonData['sup_details']['osup_nil_exmp']['txval'] += ledgerEntry.taxVal;
}
if (ledgerEntry.nonGST) {
jsonData['sup_details']['osup_nongst']['txval'] += ledgerEntry.taxVal;
}
if (!ledgerEntry.inState && !ledgerEntry.gstin) {
jsonData['inter_sup']['unreg_details'].push({
pos: ledgerEntry.place,
txval: ledgerEntry.taxVal,
iAmt: ledgerEntry.igstAmt || 0,
});
}
}
for (let ledgerEntry of data[1]) {
if (ledgerEntry.reverseCharge === 'Y') {
jsonData['sup_details']['isup_rev']['samt'] += ledgerEntry.sgstAmt || 0;
jsonData['sup_details']['isup_rev']['camt'] += ledgerEntry.cgstAmt || 0;
jsonData['sup_details']['isup_rev']['iamt'] += ledgerEntry.igstAmt || 0;
jsonData['sup_details']['isup_rev']['txval'] += ledgerEntry.taxVal;
}
if (ledgerEntry.nilRated || ledgerEntry.exempt) {
jsonData['inward_sup']['isup_details'][0][
ledgerEntry.inState ? 'intra' : 'inter'
] += ledgerEntry.taxVal;
}
if (ledgerEntry.nonGST) {
jsonData['inward_sup']['isup_details'][0][
ledgerEntry.inState ? 'intra' : 'inter'
] += ledgerEntry.taxVal;
}
}
return jsonData;
}
async getJson() {
if (this.year && this.month) {
const data = await this.getData();
const json = await this.createJson(data);
return JSON.stringify(json, undefined, 2);
}
}
}

View File

@ -1,386 +0,0 @@
export default {
gstin: '',
ret_period: '',
inward_sup: {
isup_details: [
{
ty: 'GST',
intra: 0,
inter: 0
},
{
ty: 'NONGST',
inter: 0,
intra: 0
}
]
},
sup_details: {
osup_zero: {
csamt: 0,
txval: 0,
iamt: 0
},
osup_nil_exmp: {
txval: 0
},
osup_det: {
samt: 0,
csamt: 0,
txval: 0,
camt: 0,
iamt: 0
},
isup_rev: {
samt: 0,
csamt: 0,
txval: 0,
camt: 0,
iamt: 0
},
osup_nongst: {
txval: 0
}
},
inter_sup: {
unreg_details: [],
comp_details: [],
uin_details: []
},
itc_elg: {
itc_avl: [
{
csamt: 0,
samt: 0,
ty: 'IMPG',
camt: 0,
iamt: 0
},
{
csamt: 0,
samt: 0,
ty: 'IMPS',
camt: 0,
iamt: 0
},
{
samt: 0,
csamt: 0,
ty: 'ISRC',
camt: 0,
iamt: 0
},
{
ty: 'ISD',
iamt: 0,
camt: 0,
samt: 0,
csamt: 0
},
{
samt: 0,
csamt: 0,
ty: 'OTH',
camt: 0,
iamt: 0
}
],
itc_rev: [
{
ty: 'RUL',
iamt: 0,
camt: 0,
samt: 0,
csamt: 0
},
{
ty: 'OTH',
iamt: 0,
camt: 0,
samt: 0,
csamt: 0
}
],
itc_net: {
samt: 0,
csamt: 0,
camt: 0,
iamt: 0
},
itc_inelg: [
{
ty: 'RUL',
iamt: 0,
camt: 0,
samt: 0,
csamt: 0
},
{
ty: 'OTH',
iamt: 0,
camt: 0,
samt: 0,
csamt: 0
}
]
}
};
function generateHTML(data) {
let template = `
<div class="p-5 m-5" style="font-size: 14px !important">
<div>
<h3 class="text-center">GSTR3B-Form</h3>
<h5>GSTIN: &nbsp ${data.gstin}</h5>
<h5>Period: &nbsp ${data.ret_period}</h5>
</div>
<h5>3.1&nbsp&nbspDetails of Outward Supplies and inward supplies liable to reverse charge</h5>
<table class="table table-bordered">
<thead>
<tr>
<th>Nature Of Supplies</th>
<th>Total Taxable value</th>
<th>Integrated Tax</th>
<th>Central Tax</th>
<th>State/UT Tax</th>
<th>Cess</th>
</tr>
</thead>
<tbody>
<tr>
<td>(a) Outward taxable supplies(other than zero rated, nil rated and exempted</td>
<td class="right">${data.sup_details.osup_det.txval}</td>
<td class="right">${data.sup_details.osup_det.iamt}</td>
<td class="right">${data.sup_details.osup_det.camt}</td>
<td class="right">${data.sup_details.osup_det.samt}</td>
<td class="right">${data.sup_details.osup_det.csamt}</td>
</tr>
<tr>
<td>(b) Outward taxable supplies(zero rated)</td>
<td class="right">${data.sup_details.osup_zero.txval}</td>
<td class="right">${data.sup_details.osup_zero.iamt}</td>
<td style="background-color:#d9d9d9;"></td>
<td style="background-color:#d9d9d9;"></td>
<td class="right">${data.sup_details.osup_zero.csamt}</td>
</tr>
<tr>
<td>(b) Other outward supplies(Nil rated,Exempted)</td>
<td class="right">${data.sup_details.osup_nil_exmp.txval}</td>
<td style="background-color:#d9d9d9;"></td>
<td style="background-color:#d9d9d9;"></td>
<td style="background-color:#d9d9d9;"></td>
<td style="background-color:#d9d9d9;"></td>
<tr>
<td>(d) Inward Supplies(liable to reverse charge</td>
<td class="right">${data.sup_details.isup_rev.txval}</td>
<td class="right">${data.sup_details.isup_rev.iamt}</td>
<td class="right">${data.sup_details.isup_rev.camt}</td>
<td class="right">${data.sup_details.isup_rev.samt}</td>
<td class="right">${data.sup_details.isup_rev.csamt}</td>
</tr>
<tr>
<td>(e) Non-GST outward supplies</td>
<td class="right">${data.sup_details.osup_nongst.txval}</td>
<td style="background-color:#d9d9d9;"></td>
<td style="background-color:#d9d9d9;"></td>
<td style="background-color:#d9d9d9;"></td>
<td style="background-color:#d9d9d9;"></td>
</tr>
</tbody>
</table>
<h5>
3.2&nbsp&nbspOf the supplies shown in 3.1 (a) above, details of inter-State supplies made to unregisterd
persons, composition taxable persons and UIN holders
</h5>
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>Place Of Supply (State/UT)</th>
<th>Total Taxable Value</th>
<th>Amount of Integrated Tax</th>
</tr>
</thead>
<tbody>
<tr>
<td>Supplies made to Unregistered Persons</td>
<td class="right">`;
for (let row of data.inter_sup.unreg_details) {
if (row) template += row.pos + '<br>';
}
template += '</td><td class="right">';
for (let row of data.inter_sup.unreg_details) {
if (row) template += row.txval + '<br>';
}
template += '</td><td class="right">';
for (let row of data.inter_sup.unreg_details) {
if (row) template += row.iamt + '<br>';
}
template +=
'</td></tr><tr><td>Supplies made to Composition Taxable Persons</td><td class="right">';
for (let row of data.inter_sup.comp_details) {
if (row) template += row.pos + '<br>';
}
template += '</td><td class="right">';
for (let row of data.inter_sup.comp_details) {
if (row) template += row.txval + '<br>';
}
template += '</td><td class="right">';
for (let row of data.inter_sup.comp_details) {
if (row) template += row.iamt + '<br>';
}
template +=
'</td></tr><tr><td>Supplies made to UIN holders</td><td class="right">';
for (let row of data.inter_sup.uin_details) {
if (row) template += row.pos + '<br>';
}
template += '</td><td class="right">';
for (let row of data.inter_sup.uin_details) {
if (row) template += row.txval + '<br>';
}
template += '</td><td class="right">';
for (let row of data.inter_sup.uin_details) {
if (row) template += row.iamt + '<br>';
}
template += `</td>
</tr>
</tbody>
</table>
<h5>4. &nbsp Eligible ITC</h5>
<table class="table table-bordered">
<thead>
<tr>
<th>Details</th>
<th>Integrated Tax</th>
<th>Central Tax</th>
<th>State/UT tax</th>
<th>Cess</th>
</tr>
</thead>
<tbody>
<tr>
<td><b>(A) ITC Available (whether in full op part)</b></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>&nbsp (1) Import of goods </td>
<td class="right">${data.itc_elg.itc_avl[0].iamt}</td>
<td class="right">${data.itc_elg.itc_avl[0].camt}</td>
<td class="right">${data.itc_elg.itc_avl[0].samt}</td>
<td class="right">${data.itc_elg.itc_avl[0].csamt}</td>
</tr>
<tr>
<td>&nbsp (2) Import of services</td>
<td class="right">${data.itc_elg.itc_avl[1].iamt}</td>
<td class="right">${data.itc_elg.itc_avl[1].camt}</td>
<td class="right">${data.itc_elg.itc_avl[1].samt}</td>
<td class="right">${data.itc_elg.itc_avl[1].csamt}</td>
</tr>
<tr>
<td>&nbsp (3) Inward supplies liable to reverse charge (other than 1 & 2 above)</td>
<td class="right">${data.itc_elg.itc_avl[2].iamt}</td>
<td class="right">${data.itc_elg.itc_avl[2].camt}</td>
<td class="right">${data.itc_elg.itc_avl[2].samt}</td>
<td class="right">${data.itc_elg.itc_avl[2].csamt}</td>
</tr>
<tr>
<td>&nbsp (4) Inward supplies from ISD</td>
<td class="right">${data.itc_elg.itc_avl[3].iamt}</td>
<td class="right">${data.itc_elg.itc_avl[3].camt}</td>
<td class="right">${data.itc_elg.itc_avl[3].samt}</td>
<td class="right">${data.itc_elg.itc_avl[3].csamt}</td>
</tr>
<tr>
<td>&nbsp (5) All other ITC</td>
<td class="right">${data.itc_elg.itc_avl[4].iamt}</td>
<td class="right">${data.itc_elg.itc_avl[4].camt}</td>
<td class="right">${data.itc_elg.itc_avl[4].samt}</td>
<td class="right">${data.itc_elg.itc_avl[4].csamt}</td>
</tr>
<tr>
<td><b>(B) ITC Reversed</b></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>&nbsp (1) As per rules 42 & 43 of CGST Rules</td>
<td class="right">${data.itc_elg.itc_rev[0].iamt}</td>
<td class="right">${data.itc_elg.itc_rev[0].camt}</td>
<td class="right">${data.itc_elg.itc_rev[0].samt}</td>
<td class="right">${data.itc_elg.itc_rev[0].csamt}</td>
</tr>
<tr>
<td>&nbsp (2) Others</td>
<td class="right">${data.itc_elg.itc_rev[1].iamt}</td>
<td class="right">${data.itc_elg.itc_rev[1].camt}</td>
<td class="right">${data.itc_elg.itc_rev[1].samt}</td>
<td class="right">${data.itc_elg.itc_rev[1].csamt}</td>
</tr>
<tr>
<td><b>(C) Net ITC Available(A) - (B)</b></td>
<td class="right">${data.itc_elg.itc_net.iamt}</td>
<td class="right">${data.itc_elg.itc_net.camt}</td>
<td class="right">${data.itc_elg.itc_net.samt}</td>
<td class="right">${data.itc_elg.itc_net.csamt}</td>
</tr>
<tr>
<td><b>(D) Ineligible ITC</b></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>&nbsp (1) As per section 17(5)</td>
<td class="right">${data.itc_elg.itc_inelg[0].iamt}</td>
<td class="right">${data.itc_elg.itc_inelg[0].camt}</td>
<td class="right">${data.itc_elg.itc_inelg[0].samt}</td>
<td class="right">${data.itc_elg.itc_inelg[0].csamt}</td>
</tr>
<tr>
<td>&nbsp (2) Others</td>
<td class="right">${data.itc_elg.itc_inelg[1].iamt}</td>
<td class="right">${data.itc_elg.itc_inelg[1].camt}</td>
<td class="right">${data.itc_elg.itc_inelg[1].samt}</td>
<td class="right">${data.itc_elg.itc_inelg[1].csamt}</td>
</tr>
</tbody>
</table>
<h5>5. &nbsp&nbsp Values of exempt, nil rated and non-GST inward supplies</h5>
<table class="table table-bordered">
<thead>
<tr>
<th>Nature of Supplies</th>
<th>Inter-State Supplies</th>
<th>Intra-State Supplies</th>
</tr>
</thead>
<tbody>
<tr>
<td>From a supplier under composition scheme, Exempt and Nil rated</td>
<td class="right">${data.inward_sup.isup_details[0].inter}</td>
<td class="right">${data.inward_sup.isup_details[0].intra}</td>
</tr>
<tr>
<td>Non GST Inward Supplies</td>
<td class="right">${data.inward_sup.isup_details[1].inter}</td>
<td class="right">${data.inward_sup.isup_details[1].intra}</td>
</tr>
</tbody>
</table>
</div>`;
return template;
}

View File

@ -1,7 +0,0 @@
import { t } from 'frappe';
export default {
doctype: 'GSTR3B',
title: t`GSTR 3B Report`,
columns: ['year', 'month'],
};

View File

@ -1,367 +0,0 @@
<template>
<div>
<div class="row no-gutters">
<div class="col-8 mx-auto text-right mt-4">
<f-button
primary
@click="$emit('makePDF', $refs.printComponent.innerHTML)"
>{{ t`PDF` }}</f-button
>
</div>
</div>
<div ref="printComponent" class="col-8 bg-white mt-4 mx-auto border shadow">
<div
class="print-format"
style="padding: 3.5rem; font-size: 8pt !important"
>
<div>
<h3 class="text-center">GSTR3B-Form</h3>
<h5>GSTIN: &nbsp; {{ jsonData.gstin }}</h5>
<h5>Period: &nbsp; {{ jsonData.ret_period }}</h5>
</div>
<h5>
3.1&nbsp;&nbsp;Details of Outward Supplies and inward supplies liable
to reverse charge
</h5>
<table class="table table-bordered">
<thead>
<tr>
<th>Nature Of Supplies</th>
<th>Total Taxable value</th>
<th>Integrated Tax</th>
<th>Central Tax</th>
<th>State/UT Tax</th>
<th>Cess</th>
</tr>
</thead>
<tbody>
<tr>
<td>
(a) Outward taxable supplies(other than zero rated, nil rated
and exempted
</td>
<td class="right">{{ jsonData.sup_details.osup_det.txval }}</td>
<td class="right">{{ jsonData.sup_details.osup_det.iamt }}</td>
<td class="right">{{ jsonData.sup_details.osup_det.camt }}</td>
<td class="right">{{ jsonData.sup_details.osup_det.samt }}</td>
<td class="right">{{ jsonData.sup_details.osup_det.csamt }}</td>
</tr>
<tr>
<td>(b) Outward taxable supplies(zero rated)</td>
<td class="right">{{ jsonData.sup_details.osup_zero.txval }}</td>
<td class="right">{{ jsonData.sup_details.osup_zero.iamt }}</td>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="right">{{ jsonData.sup_details.osup_zero.csamt }}</td>
</tr>
<tr>
<td>(b) Other outward supplies(Nil rated,Exempted)</td>
<td class="right">
{{ jsonData.sup_details.osup_nil_exmp.txval }}
</td>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="disabled"></td>
</tr>
<tr>
<td>(d) Inward Supplies(liable to reverse charge</td>
<td class="right">{{ jsonData.sup_details.isup_rev.txval }}</td>
<td class="right">{{ jsonData.sup_details.isup_rev.iamt }}</td>
<td class="right">{{ jsonData.sup_details.isup_rev.camt }}</td>
<td class="right">{{ jsonData.sup_details.isup_rev.samt }}</td>
<td class="right">{{ jsonData.sup_details.isup_rev.csamt }}</td>
</tr>
<tr>
<td>(e) Non-GST outward supplies</td>
<td class="right">
{{ jsonData.sup_details.osup_nongst.txval }}
</td>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="disabled"></td>
</tr>
</tbody>
</table>
<h5>
3.2&nbsp;&nbsp;Of the supplies shown in 3.1 (a) above, details of
inter-State supplies made to unregisterd persons, composition taxable
persons and UIN holders
</h5>
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>Place Of Supply (State/UT)</th>
<th>Total Taxable Value</th>
<th>Amount of Integrated Tax</th>
</tr>
</thead>
<tbody>
<tr>
<td>Supplies made to Unregistered Persons</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.unreg_details"
:key="i"
>
<p>{{ row.pos }}</p>
</div>
</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.unreg_details"
:key="i"
>
<p>{{ row.txval }}</p>
</div>
</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.unreg_details"
:key="i"
>
<p>{{ row.iamt }}</p>
</div>
</td>
</tr>
<tr>
<td>Suppliies made to Composition Taxable Persons</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.comp_details"
:key="i"
>
<p>{{ row.pos }}</p>
</div>
</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.comp_details"
:key="i"
>
<p>{{ row.txval }}</p>
</div>
</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.comp_details"
:key="i"
>
<p>{{ row.iamt }}</p>
</div>
</td>
</tr>
<tr>
<td>Supplies made to UIN holders</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.uin_details"
:key="i"
>
<p>{{ row.pos }}</p>
</div>
</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.uin_details"
:key="i"
>
<p>{{ row.txval }}</p>
</div>
</td>
<td class="right">
<div
v-for="(row, i) in jsonData.inter_sup.uin_details"
:key="i"
>
<p>{{ row.iamt }}</p>
</div>
</td>
</tr>
</tbody>
</table>
<h5>4. &nbsp; Eligible ITC</h5>
<table class="table table-bordered">
<thead>
<tr>
<th>Details</th>
<th>Integrated Tax</th>
<th>Central Tax</th>
<th>State/UT tax</th>
<th>Cess</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<b>(A) ITC Available (whether in full op part)</b>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>&nbsp; (1) Import of goods</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[0].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[0].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[0].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[0].csamt }}</td>
</tr>
<tr>
<td>&nbsp; (2) Import of services</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[1].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[1].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[1].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[1].csamt }}</td>
</tr>
<tr>
<td>
&nbsp; (3) Inward supplies liable to reverse charge (other than
1 & 2 above)
</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[2].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[2].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[2].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[2].csamt }}</td>
</tr>
<tr>
<td>&nbsp; (4) Inward supplies from ISD</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[3].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[3].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[3].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[3].csamt }}</td>
</tr>
<tr>
<td>&nbsp; (5) All other ITC</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[4].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[4].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[4].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[4].csamt }}</td>
</tr>
<tr>
<td>
<b>(B) ITC Reversed</b>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>&nbsp; (1) As per rules 42 & 43 of CGST Rules</td>
<td class="right">{{ jsonData.itc_elg.itc_rev[0].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_rev[0].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_rev[0].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_rev[0].csamt }}</td>
</tr>
<tr>
<td>&nbsp; (2) Others</td>
<td class="right">{{ jsonData.itc_elg.itc_rev[1].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_rev[1].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_rev[1].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_rev[1].csamt }}</td>
</tr>
<tr>
<td>
<b>(C) Net ITC Available(A) - (B)</b>
</td>
<td class="right">{{ jsonData.itc_elg.itc_net.iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_net.camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_net.samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_net.csamt }}</td>
</tr>
<tr>
<td>
<b>(D) Ineligible ITC</b>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>&nbsp; (1) As per section 17(5)</td>
<td class="right">{{ jsonData.itc_elg.itc_inelg[0].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_inelg[0].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_inelg[0].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_inelg[0].csamt }}</td>
</tr>
<tr>
<td>&nbsp; (2) Others</td>
<td class="right">{{ jsonData.itc_elg.itc_inelg[1].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_inelg[1].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_inelg[1].samt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_inelg[1].csamt }}</td>
</tr>
</tbody>
</table>
<h5>
5. &nbsp;&nbsp; Values of exempt, nil rated and non-GST inward
supplies
</h5>
<table class="table table-bordered">
<thead>
<tr>
<th>Nature of Supplies</th>
<th>Inter-State Supplies</th>
<th>Intra-State Supplies</th>
</tr>
</thead>
<tbody>
<tr>
<td>
From a supplier under composition scheme, Exempt and Nil rated
</td>
<td class="right">
{{ jsonData.inward_sup.isup_details[0].inter }}
</td>
<td class="right">
{{ jsonData.inward_sup.isup_details[0].intra }}
</td>
</tr>
<tr>
<td>Non GST Inward Supplies</td>
<td class="right">
{{ jsonData.inward_sup.isup_details[1].inter }}
</td>
<td class="right">
{{ jsonData.inward_sup.isup_details[1].intra }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'GSTR3BPrintView',
props: ['doc'],
emits: ['makePDF'],
computed: {
jsonData() {
return JSON.parse(this.doc.jsonData);
},
},
};
</script>
<style>
.print-format {
}
.disabled {
background-color: #d9d9d9;
}
.right {
text-align: right;
}
</style>

View File

@ -1,12 +0,0 @@
import GSTR3B from './GSTR3BDocument';
export default class GSTR3BServer extends GSTR3B {
async validate() {
if (this.month.length === 0 || this.year.length != 4) {
throw new Error('Month or Year is not valid');
}
}
async beforeInsert() {
this.name = `${this.doctype} Report ${this.month} ${this.year}`;
}
};

View File

@ -1,33 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import { DEFAULT_NUMBER_SERIES } from '../../../frappe/utils/consts';
import PurchaseInvoice from '../PurchaseInvoice/PurchaseInvoice';
export default model.extend(
PurchaseInvoice,
{
name: 'PurchaseOrder',
label: t`Purchase Order`,
settings: 'PurchaseOrderSettings',
fields: [
{
fieldname: 'items',
childtype: 'PurchaseOrderItem',
},
{
fieldname: 'numberSeries',
label: t`Number Series`,
fieldtype: 'Link',
target: 'NumberSeries',
required: 1,
getFilters: () => {
return { referenceType: 'PurchaseOrder' };
},
default: DEFAULT_NUMBER_SERIES['PurchaseOrder'],
},
],
},
{
skipFields: ['account'],
}
);

View File

@ -1,6 +0,0 @@
import model from 'frappe/model';
import PurchaseInvoiceItem from '../PurchaseInvoiceItem/PurchaseInvoiceItem';
export default model.extend(PurchaseInvoiceItem, {
name: 'PurchaseOrderItem',
});

View File

@ -1,9 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import PurchaseInvoiceSettings from '../PurchaseInvoiceSettings/PurchaseInvoiceSettings';
export default model.extend(PurchaseInvoiceSettings, {
name: 'PurchaseOrderSettings',
label: t`Purchase Order Settings`,
fields: [],
});

View File

@ -1,27 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import { DEFAULT_NUMBER_SERIES } from '../../../frappe/utils/consts';
import PurchaseOrder from '../PurchaseOrder/PurchaseOrder';
export default model.extend(PurchaseOrder, {
name: 'PurchaseReceipt',
label: t`Purchase Receipt`,
settings: 'PurchaseReceiptSettings',
fields: [
{
fieldname: 'items',
childtype: 'PurchaseReceiptItem',
},
{
fieldname: 'numberSeries',
label: t`Number Series`,
fieldtype: 'Link',
target: 'NumberSeries',
required: 1,
getFilters: () => {
return { referenceType: 'PurchaseReceipt' };
},
default: DEFAULT_NUMBER_SERIES['PurchaseReceipt'],
},
],
});

View File

@ -1,21 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import PurchaseOrderItem from '../PurchaseOrderItem/PurchaseOrderItem';
export default model.extend(
PurchaseOrderItem,
{
name: 'PurchaseReceiptItem',
fields: [
{
fieldname: 'acceptedQuantity',
label: t`Accepted Quantity`,
fieldtype: 'Float',
required: 1,
},
],
},
{
skipFields: ['expenseAccount'],
}
);

View File

@ -1,9 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import PurchaseOrderSettings from '../PurchaseOrderSettings/PurchaseOrderSettings';
export default model.extend(PurchaseOrderSettings, {
name: 'PurchaseReceiptSettings',
label: t`Purchase Receipt Settings`,
fields: [],
});

View File

@ -1,37 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import { DEFAULT_NUMBER_SERIES } from '../../../frappe/utils/consts';
import SalesInvoice from '../SalesInvoice/SalesInvoice';
const Quotation = model.extend(
SalesInvoice,
{
name: 'Quotation',
label: t`Quotation`,
settings: 'QuotationSettings',
fields: [
{
fieldname: 'items',
childtype: 'QuotationItem',
},
{
fieldname: 'numberSeries',
label: t`Number Series`,
fieldtype: 'Link',
target: 'NumberSeries',
required: 1,
getFilters: () => {
return { referenceType: 'Quotation' };
},
default: DEFAULT_NUMBER_SERIES['Quotation'],
},
],
links: [],
},
{
skipFields: ['account'],
overrideProps: ['links'],
}
);
export default Quotation;

View File

@ -1,3 +0,0 @@
import SalesInvoiceDocument from '../SalesInvoice/SalesInvoiceDocument';
export default class Quotation extends SalesInvoiceDocument {};

View File

@ -1,6 +0,0 @@
import model from 'frappe/model';
import SalesInvoiceItem from '../SalesInvoiceItem/SalesInvoiceItem';
export default model.extend(SalesInvoiceItem, {
name: 'QuotationItem',
});

View File

@ -1,25 +0,0 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash';
import QuotationItemOriginal from './QuotationItem';
export default function getAugmentedQuotationItem({ country }) {
const QuotationItem = cloneDeep(QuotationItemOriginal);
if (!country) {
return QuotationItem;
}
if (country === 'India') {
QuotationItem.fields = [
...QuotationItem.fields,
{
fieldname: 'hsnCode',
label: t`HSN/SAC`,
fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'],
},
];
}
return QuotationItem;
}

View File

@ -1,9 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import SalesInvoiceSettings from '../SalesInvoiceSettings/SalesInvoiceSettings';
export default model.extend(SalesInvoiceSettings, {
name: 'QuotationSettings',
label: t`Quotation Settings`,
fields: [],
});

View File

@ -1,27 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import { DEFAULT_NUMBER_SERIES } from '../../../frappe/utils/consts';
import Quotation from '../Quotation/Quotation';
export default model.extend(Quotation, {
name: 'SalesOrder',
label: t`Sales Order`,
settings: 'SalesOrderSettings',
fields: [
{
fieldname: 'items',
childtype: 'SalesOrderItem',
},
{
fieldname: 'numberSeries',
label: t`Number Series`,
fieldtype: 'Link',
target: 'NumberSeries',
required: 1,
getFilters: () => {
return { referenceType: 'SalesOrder' };
},
default: DEFAULT_NUMBER_SERIES['SalesOrder'],
},
],
});

View File

@ -1,25 +0,0 @@
import { t } from 'frappe';
import { cloneDeep } from 'lodash';
import SalesOrderItemOriginal from './SalesOrderItem';
export default function getAugmentedSalesOrderItem({ country }) {
const SalesOrderItem = cloneDeep(SalesOrderItemOriginal);
if (!country) {
return SalesOrderItem;
}
if (country === 'India') {
SalesOrderItem.fields = [
...SalesOrderItem.fields,
{
fieldname: 'hsnCode',
label: t`HSN/SAC`,
fieldtype: 'Int',
formula: (row, doc) => doc.getFrom('Item', row.item, 'hsnCode'),
formulaDependsOn: ['item'],
},
];
}
return SalesOrderItem;
}

View File

@ -1,6 +0,0 @@
import model from 'frappe/model';
import QuotationItem from '../QuotationItem/QuotationItem';
export default model.extend(QuotationItem, {
name: 'SalesOrderItem',
});

View File

@ -1,9 +0,0 @@
import { t } from 'frappe';
import model from 'frappe/model';
import QuotationSettings from '../QuotationSettings/QuotationSettings';
export default model.extend(QuotationSettings, {
name: 'SalesOrderSettings',
label: t`Sales Order Settings`,
fields: [],
});

View File

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

View File

@ -22,7 +22,6 @@ export enum DoctypeName {
Tax = 'Tax', Tax = 'Tax',
TaxDetail = 'TaxDetail', TaxDetail = 'TaxDetail',
TaxSummary = 'TaxSummary', TaxSummary = 'TaxSummary',
GSTR3B = 'GSTR3B',
Address = 'Address', Address = 'Address',
Contact = 'Contact', Contact = 'Contact',
JournalEntry = 'JournalEntry', JournalEntry = 'JournalEntry',

View File

@ -3,8 +3,6 @@ import { DateTime } from 'luxon';
import { stateCodeMap } from '../../accounting/gst'; import { stateCodeMap } from '../../accounting/gst';
import { titleCase } from '../../src/utils'; import { titleCase } from '../../src/utils';
const stateList = Object.keys(stateCodeMap).map(titleCase).sort();
export default { export default {
filterFields: [ filterFields: [
{ {
@ -13,7 +11,7 @@ export default {
size: 'small', size: 'small',
placeholder: t`Place`, placeholder: t`Place`,
fieldname: 'place', fieldname: 'place',
getList: () => stateList, getList: () => Object.keys(stateCodeMap).map(titleCase).sort(),
}, },
{ {
fieldtype: 'Date', fieldtype: 'Date',

View File

@ -1,21 +1,19 @@
import GeneralLedgerViewConfig from './GeneralLedger/viewConfig';
import SalesRegisterViewConfig from './SalesRegister/viewConfig';
import PurchaseRegisterViewConfig from './PurchaseRegister/viewConfig';
import BalanceSheetViewConfig from './BalanceSheet/viewConfig'; import BalanceSheetViewConfig from './BalanceSheet/viewConfig';
import ProfitAndLossViewConfig from './ProfitAndLoss/viewConfig'; import GeneralLedgerViewConfig from './GeneralLedger/viewConfig';
import TrialBalanceViewConfig from './TrialBalance/viewConfig';
// import BankReconciliationViewConfig from './BankReconciliation/viewConfig';
import GoodsAndServiceTaxGSTR1View from './GoodsAndServiceTax/GSTR1View'; import GoodsAndServiceTaxGSTR1View from './GoodsAndServiceTax/GSTR1View';
import GoodsAndServiceTaxGSTR2View from './GoodsAndServiceTax/GSTR2View'; import GoodsAndServiceTaxGSTR2View from './GoodsAndServiceTax/GSTR2View';
import ProfitAndLossViewConfig from './ProfitAndLoss/viewConfig';
import PurchaseRegisterViewConfig from './PurchaseRegister/viewConfig';
import SalesRegisterViewConfig from './SalesRegister/viewConfig';
import TrialBalanceViewConfig from './TrialBalance/viewConfig';
export default { export default {
'general-ledger' : GeneralLedgerViewConfig, 'general-ledger': GeneralLedgerViewConfig,
'sales-register' : SalesRegisterViewConfig, 'sales-register': SalesRegisterViewConfig,
'purchase-register' : PurchaseRegisterViewConfig, 'purchase-register': PurchaseRegisterViewConfig,
'balance-sheet' : BalanceSheetViewConfig, 'balance-sheet': BalanceSheetViewConfig,
'profit-and-loss' : ProfitAndLossViewConfig, 'profit-and-loss': ProfitAndLossViewConfig,
'trial-balance' : TrialBalanceViewConfig, 'trial-balance': TrialBalanceViewConfig,
// 'bank-reconciliation' : BankReconciliationViewConfig, 'gstr-1': GoodsAndServiceTaxGSTR1View,
'gstr-1' : GoodsAndServiceTaxGSTR1View, 'gstr-2': GoodsAndServiceTaxGSTR2View,
'gstr-2' : GoodsAndServiceTaxGSTR2View,
}; };

View File

@ -1,6 +1,5 @@
import frappe from 'frappe'; import frappe from 'frappe';
import { createNumberSeries } from 'frappe/model/naming'; import { createNumberSeries } from 'frappe/model/naming';
import GSTR3BServer from '../models/doctype/GSTR3B/GSTR3BServer.js';
import JournalEntryServer from '../models/doctype/JournalEntry/JournalEntryServer.js'; import JournalEntryServer from '../models/doctype/JournalEntry/JournalEntryServer.js';
import PartyServer from '../models/doctype/Party/PartyServer.js'; import PartyServer from '../models/doctype/Party/PartyServer.js';
import PaymentServer from '../models/doctype/Payment/PaymentServer.js'; import PaymentServer from '../models/doctype/Payment/PaymentServer.js';
@ -14,7 +13,6 @@ export default async function postStart() {
frappe.models.Party.documentClass = PartyServer; frappe.models.Party.documentClass = PartyServer;
frappe.models.PurchaseInvoice.documentClass = PurchaseInvoiceServer; frappe.models.PurchaseInvoice.documentClass = PurchaseInvoiceServer;
frappe.models.JournalEntry.documentClass = JournalEntryServer; frappe.models.JournalEntry.documentClass = JournalEntryServer;
frappe.models.GSTR3B.documentClass = GSTR3BServer;
frappe.metaCache = {}; frappe.metaCache = {};
@ -23,11 +21,6 @@ export default async function postStart() {
await createNumberSeries('PINV-', 'PurchaseInvoice'); await createNumberSeries('PINV-', 'PurchaseInvoice');
await createNumberSeries('PAY-', 'Payment'); await createNumberSeries('PAY-', 'Payment');
await createNumberSeries('JV-', 'JournalEntry'); await createNumberSeries('JV-', 'JournalEntry');
// await naming.createNumberSeries('QTN-', 'QuotationSettings');
// await naming.createNumberSeries('SO-', 'SalesOrderSettings');
// await naming.createNumberSeries('OF-', 'FulfillmentSettings');
// await naming.createNumberSeries('PO-', 'PurchaseOrderSettings');
// await naming.createNumberSeries('PREC-', 'PurchaseReceiptSettings');
// fetch singles // fetch singles
// so that they are available synchronously // so that they are available synchronously

View File

@ -1,15 +1,14 @@
import SalesInvoice from '../../../models/doctype/SalesInvoice/SalesInvoiceList';
import PurchaseInvoice from '../../../models/doctype/PurchaseInvoice/PurchaseInvoiceList';
import Customer from '../../../models/doctype/Party/CustomerList';
import Supplier from '../../../models/doctype/Party/SupplierList';
import Party from '../../../models/doctype/Party/PartyList';
import Item from '../../../models/doctype/Item/ItemList';
import Payment from '../../../models/doctype/Payment/PaymentList';
import Tax from '../../../models/doctype/Tax/TaxList';
import JournalEntry from '../../../models/doctype/JournalEntry/JournalEntryList';
import AccountingLedgerEntry from '../../../models/doctype/AccountingLedgerEntry/AccountingLedgerEntryList';
import Account from '../../../models/doctype/Account/AccountList'; import Account from '../../../models/doctype/Account/AccountList';
import GSTR3B from '../../../models/doctype/GSTR3B/GSTR3BList'; import AccountingLedgerEntry from '../../../models/doctype/AccountingLedgerEntry/AccountingLedgerEntryList';
import Item from '../../../models/doctype/Item/ItemList';
import JournalEntry from '../../../models/doctype/JournalEntry/JournalEntryList';
import Customer from '../../../models/doctype/Party/CustomerList';
import Party from '../../../models/doctype/Party/PartyList';
import Supplier from '../../../models/doctype/Party/SupplierList';
import Payment from '../../../models/doctype/Payment/PaymentList';
import PurchaseInvoice from '../../../models/doctype/PurchaseInvoice/PurchaseInvoiceList';
import SalesInvoice from '../../../models/doctype/SalesInvoice/SalesInvoiceList';
import Tax from '../../../models/doctype/Tax/TaxList';
export default { export default {
SalesInvoice, SalesInvoice,
@ -22,6 +21,5 @@ export default {
Tax, Tax,
JournalEntry, JournalEntry,
Account, Account,
GSTR3B, AccountingLedgerEntry,
AccountingLedgerEntry
}; };