2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

incr: scaffold template builder

This commit is contained in:
18alantom 2023-02-22 14:15:59 +05:30
parent 205ef4aa6a
commit 2e0eb654e9
7 changed files with 70 additions and 4 deletions

View File

@ -0,0 +1,8 @@
import { Doc } from 'fyo/model/doc';
export class PrintTemplate extends Doc {
name?: string;
type?: string;
template?: string;
isCustom?: boolean;
}

View File

@ -29,6 +29,7 @@ import { StockLedgerEntry } from './inventory/StockLedgerEntry';
import { StockMovement } from './inventory/StockMovement';
import { StockMovementItem } from './inventory/StockMovementItem';
import { PrintTemplate } from './baseModels/PrintTemplate';
export const models = {
Account,
AccountingLedgerEntry,
@ -48,6 +49,7 @@ export const models = {
SalesInvoice,
SalesInvoiceItem,
SetupWizard,
PrintTemplate,
Tax,
TaxSummary,
// Inventory Models

View File

@ -0,0 +1,32 @@
{
"name": "PrintTemplate",
"label": "Print Template",
"naming": "manual",
"isSingle": false,
"fields": [
{
"fieldname": "name",
"label": "Template Name",
"fieldtype": "Data",
"required": true
},
{
"fieldname": "type",
"label": "Template Type",
"fieldtype": "Select",
"required": true
},
{
"fieldname": "template",
"label": "Template",
"fieldtype": "Data",
"required": true
},
{
"fieldname": "isCustom",
"label": "Is Custom",
"fieldtype": "Check",
"default": false
}
]
}

View File

@ -2,11 +2,13 @@ import Account from './app/Account.json';
import AccountingLedgerEntry from './app/AccountingLedgerEntry.json';
import AccountingSettings from './app/AccountingSettings.json';
import Address from './app/Address.json';
import Batch from './app/Batch.json';
import Color from './app/Color.json';
import CompanySettings from './app/CompanySettings.json';
import Currency from './app/Currency.json';
import Defaults from './app/Defaults.json';
import GetStarted from './app/GetStarted.json';
import InventorySettings from './app/inventory/InventorySettings.json';
import Location from './app/inventory/Location.json';
import PurchaseReceipt from './app/inventory/PurchaseReceipt.json';
import PurchaseReceiptItem from './app/inventory/PurchaseReceiptItem.json';
@ -17,6 +19,7 @@ import StockMovement from './app/inventory/StockMovement.json';
import StockMovementItem from './app/inventory/StockMovementItem.json';
import StockTransfer from './app/inventory/StockTransfer.json';
import StockTransferItem from './app/inventory/StockTransferItem.json';
import UOMConversionItem from './app/inventory/UOMConversionItem.json';
import Invoice from './app/Invoice.json';
import InvoiceItem from './app/InvoiceItem.json';
import Item from './app/Item.json';
@ -28,6 +31,7 @@ import Party from './app/Party.json';
import Payment from './app/Payment.json';
import PaymentFor from './app/PaymentFor.json';
import PrintSettings from './app/PrintSettings.json';
import PrintTemplate from './app/PrintTemplate.json';
import PurchaseInvoice from './app/PurchaseInvoice.json';
import PurchaseInvoiceItem from './app/PurchaseInvoiceItem.json';
import SalesInvoice from './app/SalesInvoice.json';
@ -37,7 +41,6 @@ import Tax from './app/Tax.json';
import TaxDetail from './app/TaxDetail.json';
import TaxSummary from './app/TaxSummary.json';
import UOM from './app/UOM.json';
import UOMConversionItem from './app/inventory/UOMConversionItem.json';
import PatchRun from './core/PatchRun.json';
import SingleValue from './core/SingleValue.json';
import SystemSettings from './core/SystemSettings.json';
@ -46,8 +49,6 @@ import child from './meta/child.json';
import submittable from './meta/submittable.json';
import tree from './meta/tree.json';
import { Schema, SchemaStub } from './types';
import InventorySettings from './app/inventory/InventorySettings.json';
import Batch from './app/Batch.json'
export const coreSchemas: Schema[] = [
PatchRun as Schema,
@ -66,6 +67,7 @@ export const appSchemas: Schema[] | SchemaStub[] = [
Misc as Schema,
SetupWizard as Schema,
GetStarted as Schema,
PrintTemplate as Schema,
Color as Schema,
Currency as Schema,
@ -116,5 +118,5 @@ export const appSchemas: Schema[] | SchemaStub[] = [
PurchaseReceipt as Schema,
PurchaseReceiptItem as Schema,
Batch as Schema
Batch as Schema,
];

View File

@ -0,0 +1,11 @@
<template>
<div>
<PageHeader :title="t`Template Builder`" />
</div>
</template>
<script lang="ts">
import PageHeader from 'src/components/PageHeader.vue';
import { defineComponent } from 'vue';
export default defineComponent({ components: { PageHeader } });
</script>

View File

@ -1,4 +1,5 @@
import { ModelNameEnum } from 'models/types';
import TemplateBuilder from 'src/pages/TemplateBuilder.vue';
import ChartOfAccounts from 'src/pages/ChartOfAccounts.vue';
import CommonForm from 'src/pages/CommonForm/CommonForm.vue';
import Dashboard from 'src/pages/Dashboard/Dashboard.vue';
@ -127,6 +128,11 @@ const routes: RouteRecordRaw[] = [
name: 'Import Wizard',
component: ImportWizard,
},
{
path: '/template-builder',
name: 'Template Builder',
component: TemplateBuilder,
},
{
path: '/settings',
name: 'Settings',

View File

@ -272,6 +272,11 @@ async function getCompleteSidebar(): Promise<SidebarConfig> {
name: 'import-wizard',
route: '/import-wizard',
},
{
label: t`Template Builder`,
name: 'template-builder',
route: '/template-builder',
},
{
label: t`Settings`,
name: 'settings',