Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regional schema for Switzerland #769

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ yarn-error.log*
*.njsproj
*.sln
*.sw?
*.code-workspace

#Electron-builder output
/dist_electron
Expand Down
21 changes: 21 additions & 0 deletions schemas/regional/ch/AccountingSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "AccountingSettings",
"fields": [
{
"fieldname": "taxId",
"label": "Tax ID",
"fieldtype": "Data",
"placeholder": "CHE-123.456.789",
"section": "Default"
}
],
"quickEditFields": [
"fullname",
"email",
"companyName",
"country",
"fiscalYearStart",
"fiscalYearEnd",
"taxId"
]
}
4 changes: 4 additions & 0 deletions schemas/regional/ch/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { SchemaStub } from '../../types';
import AccountingSettings from './AccountingSettings.json';

export default [AccountingSettings] as SchemaStub[];
6 changes: 5 additions & 1 deletion schemas/regional/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { SchemaStub } from 'schemas/types';
import IndianSchemas from './in';
import SwissSchemas from './ch';

/**
* Regional Schemas are exported by country code.
*/
export default { in: IndianSchemas } as Record<string, SchemaStub[]>;
export default { in: IndianSchemas, ch: SwissSchemas } as Record<
string,
SchemaStub[]
>;
2 changes: 1 addition & 1 deletion src/utils/printTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const printSettingsFields = [
'address',
'companyName',
];
const accountingSettingsFields = ['gstin'];
const accountingSettingsFields = ['gstin', 'taxId'];

export async function getPrintTemplatePropValues(
doc: Doc
Expand Down
Loading