Compare commits
3 Commits
v0.18.2
...
dev/tax-nu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c498a100bc | ||
|
|
d313774205 | ||
|
|
b42153bcc4 |
@@ -65,6 +65,7 @@ export default class OrganizationController extends BaseController {
|
||||
check('fiscal_year').exists().isIn(MONTHS),
|
||||
check('language').exists().isString().isIn(ACCEPTED_LOCALES),
|
||||
check('date_format').optional().isIn(DATE_FORMATS),
|
||||
check('tax_number').optional({ nullable: true }).isString().trim().escape(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ export interface IOrganizationSetupDTO {
|
||||
fiscalYear: string;
|
||||
industry: string;
|
||||
timeZone: string;
|
||||
taxNumber: string;
|
||||
}
|
||||
|
||||
export interface IOrganizationBuildDTO {
|
||||
@@ -16,6 +17,7 @@ export interface IOrganizationBuildDTO {
|
||||
timezone: string;
|
||||
fiscalYear: string;
|
||||
dateFormat?: string;
|
||||
taxNumber: string;
|
||||
}
|
||||
|
||||
export interface IOrganizationUpdateDTO {
|
||||
@@ -25,6 +27,7 @@ export interface IOrganizationUpdateDTO {
|
||||
timezone: string;
|
||||
fiscalYear: string;
|
||||
industry: string;
|
||||
taxNumber: string;
|
||||
}
|
||||
|
||||
export interface IOrganizationBuildEventPayload {
|
||||
|
||||
@@ -189,6 +189,7 @@ export default class OrganizationService {
|
||||
tenant.metadata?.baseCurrency
|
||||
);
|
||||
await tenant.saveMetadata(organizationDTO);
|
||||
// console.log('organizationDTO', organizationDTO);
|
||||
|
||||
if (organizationDTO.baseCurrency !== tenant.metadata?.baseCurrency) {
|
||||
// Triggers `onOrganizationBaseCurrencyUpdated` event.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
exports.up = function (knex) {
|
||||
return knex.schema.table('tenants_metadata', (table) => {
|
||||
table.string('tax_number')
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function (knex) {
|
||||
return knex.schema.table('tenants_metadata', (table) => {
|
||||
table.dropColumn('tax_number');
|
||||
});
|
||||
};
|
||||
@@ -6,6 +6,9 @@ const Schema = Yup.object().shape({
|
||||
name: Yup.string()
|
||||
.required()
|
||||
.label(intl.get('organization_name_')),
|
||||
tax_number: Yup.string()
|
||||
.nullable()
|
||||
.label(intl.get('organization_tax_number_')),
|
||||
industry: Yup.string()
|
||||
.nullable()
|
||||
.label(intl.get('organization_industry_')),
|
||||
|
||||
@@ -59,6 +59,17 @@ export default function PreferencesGeneralForm({ isSubmitting }) {
|
||||
<FInputGroup medium={'true'} name={'name'} fastField={true} />
|
||||
</FFormGroup>
|
||||
|
||||
{/* ---------- Organization Tax Number ---------- */}
|
||||
<FFormGroup
|
||||
name={'tax_number'}
|
||||
label={<T id={'organization_tax_number'} />}
|
||||
inline={true}
|
||||
helperText={<T id={'shown_on_sales_forms_and_purchase_orders'} />}
|
||||
fastField={true}
|
||||
>
|
||||
<FInputGroup medium={'true'} name={'tax_number'} fastField={true} />
|
||||
</FFormGroup>
|
||||
|
||||
{/* ---------- Industry ---------- */}
|
||||
<FFormGroup
|
||||
name={'industry'}
|
||||
|
||||
@@ -23,6 +23,7 @@ const defaultValues = {
|
||||
fiscal_year: '',
|
||||
date_format: '',
|
||||
timezone: '',
|
||||
tax_number: '',
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -43,6 +43,15 @@ export default function SetupOrganizationForm({ isSubmitting, values }) {
|
||||
<FInputGroup name={'name'} fastField={true} />
|
||||
</FFormGroup>
|
||||
|
||||
{/* ---------- Organization Tax Number ---------- */}
|
||||
<FFormGroup
|
||||
name={'tax_number'}
|
||||
label={<T id={'organization_tax_number'} />}
|
||||
fastField={true}
|
||||
>
|
||||
<FInputGroup name={'tax_number'} fastField={true} />
|
||||
</FFormGroup>
|
||||
|
||||
{/* ---------- Location ---------- */}
|
||||
<FFormGroup
|
||||
name={'location'}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"success": "Success",
|
||||
"register_a_new_organization": "Register a New Organization.",
|
||||
"organization_name": "Organization Name",
|
||||
"organization_tax_number": "Organization Tax Number",
|
||||
"email": "Email",
|
||||
"email_address": "Email Address",
|
||||
"register": "Register",
|
||||
@@ -339,6 +340,7 @@
|
||||
"item_type_": "Item type",
|
||||
"item_name_": "Item name",
|
||||
"organization_industry_": "Organization industry",
|
||||
"organization_tax_number_": "Organization tax number",
|
||||
"base_currency_": "Base currency",
|
||||
"date_format_": "Date format",
|
||||
"category_name_": "Category name",
|
||||
|
||||
Reference in New Issue
Block a user