Skip to content

Commit 7fd2f67

Browse files
authored
qbd direct integration advanced settings html changes (#950)
qbd direct integration advanced settings html changes
1 parent 2ff13ba commit 7fd2f67

File tree

9 files changed

+193
-88
lines changed

9 files changed

+193
-88
lines changed

src/app/branding/c1-contents-config.ts

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,19 @@ export const c1Contents = {
6464
advancedSettings: {
6565
stepName: 'Advanced settings',
6666
contentText: 'Customize the integration based on your accounting requirements.',
67-
scheduleAutoExport: 'Schedule automatic export',
68-
email: 'Send error notification to',
69-
paymentSyncLabel: 'Auto-sync payment status for reimbursable expenses',
70-
autoCreateVendorsLabel: 'Auto create ',
71-
autoCreateMerchantsAsVendorsLabel: 'Auto create ' + brandingConfig.brandName + ' merchants as vendors on QuickBooks Desktop',
72-
billPaymentAccountLabel: 'To which payment account should the payment entries be posted?',
73-
billPaymentAccountSubLabel: ', the payment entries will be posted to the selected payment account in ',
74-
postEntriesCurrentPeriod: 'Post entries in the current accounting period',
75-
dfvSubLabel: 'If you\'ve made a field mandatory in QuickBooks Desktop but don\'t collect a value from your employees in the expense form, you can set a default value here to be added to all the expenses.',
76-
dfvLabel: 'Default field values',
77-
changeAccountingPeriodSubLabel: 'If the accounting period is closed, the expenses will be exported with a date stamp for the first day of the current open accounting period.',
78-
defaultPaymentAccount: 'Select payment bank account',
79-
memoStructureLabel: 'Set the line-item description field in QuickBooks Desktop',
80-
memoStructureSubLabel: 'Choose from a list of available data points that you\'d like to export to the description field in QuickBooks Desktop. ',
81-
customizationSubLabel: 'Customize the data that you\'d like to export from Expense Management to QuickBooks Desktop by choosing which data points need to be exported.',
82-
automationSubLabel: 'Automate exports and data syncs.',
83-
scheduleSubLabel: 'Set up a schedule to automate the export of expenses from Expense Management to QuickBooks Desktop.',
84-
frequencySubLabel: 'Set how often your expenses will be exported to QuickBooks Desktop.',
85-
preferenceLabel: 'Other preferences',
86-
preferenceSubLabel: 'Create new records in QuickBooks Desktop if no vendor record is found or the accounting period is closed.',
87-
previewDescriptionFieldLabel: 'Preview of the description field',
88-
autoCreateMerchantsLabel: 'Auto create merchant on QuickBooks Desktop for credit card charge'
67+
customizeSectionLabel: 'Customization',
68+
customizeSectionSubLabel: 'In this section, you can customize the data that you\'d like to export from Fyle to QuickBooks Online You can choose what data points need to be exported and what shouldn\'t be.',
69+
automationLabel: 'Automation',
70+
automationSubLabel: 'You can automate the export and sync of your data in this section.',
71+
scheduleAutoExportLabel: 'Schedule automatic export',
72+
scheduleAutoExportSubLabel: 'Set up a schedule to frequently automate the export of expenses from ' + brandingConfig.brandName + ' to QuickBooks Desktop.',
73+
autoExportfrequencyLabel: 'Set up export frequency',
74+
autoExportfrequencySubLabel: '',
75+
topLevelMemoStructureLabel: 'Select the top level memo field data for QuickBooks Desktop',
76+
topLevelMemoStructureSubLabel: 'You can customize the <b>data point</b> you would like to export to QuickBooks Desktop\’s <b>top-level memo</b> field while exporting expenses from ' + brandingConfig.brandName + '.',
77+
memoStructureLabel: 'Set the line-item level memo field data for QuickBooks Desktop.',
78+
memoStructureSubLabel: 'You can customize the data set you would like to export to QuickBooks Desktop\’s <b>transaction line-item level memo</b> field while exporting expenses from ' + brandingConfig.brandName + '.',
79+
previewDescriptionFieldLabel: 'Preview of the description field'
8980
}
9081
}
9182
},

src/app/branding/fyle-contents-config.ts

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,19 @@ export const fyleContents = {
6464
advancedSettings: {
6565
stepName: 'Advanced Settings',
6666
contentText: 'In this section, you can customize the integration based on your accounting requirements. ',
67-
scheduleAutoExport: 'Schedule automatic export',
68-
email: 'Send error notification to',
69-
paymentSyncLabel: 'Auto-sync payment status for reimbursable expenses',
70-
autoCreateVendorsLabel: 'Auto create ',
71-
autoCreateMerchantsAsVendorsLabel: 'Auto Create ' + brandingConfig.brandName + ' Merchants as Contacts on QuickBooks Desktop',
72-
billPaymentAccountLabel: 'To which Payment account should the payment entries be posted?',
73-
billPaymentAccountSubLabel: ', the payment entries will be posted to the selected Payment account in ',
74-
postEntriesCurrentPeriod: 'Post entries in the next open accounting period',
75-
dfvSubLabel: 'If you\'ve made a field mandatory in QuickBooks Desktop but don\'t collect a value from your employees in the expense form, you can set a default value here to be added to all the expenses. For Location and Department, you can opt to use the values from your employee records in QuickBooks Desktop.',
76-
dfvLabel: 'Default Field Values',
77-
changeAccountingPeriodSubLabel: 'If the accounting period in QuickBooks Desktop is closed, the expenses from ' + brandingConfig.brandName + ' will be exported with a date stamp of the first day next open accounting period.',
78-
defaultPaymentAccount: 'Select Payment Bank Account',
79-
memoStructureLabel: 'Set the line item-level description field in QuickBooks Desktop',
80-
memoStructureSubLabel: 'You can choose from a list of available data points that you\'d like to export to the description field in QuickBooks Desktop.',
81-
customizationSubLabel: 'In this section, you can customize the data that you\'d like to export from ' + brandingConfig.brandName + ' to QuickBooks Desktop, You can choose what data points need to be exported and what shouldn\'t be.',
67+
automationLabel: 'Automation',
8268
automationSubLabel: 'You can automate the export and sync of your data in this section.',
83-
scheduleSubLabel: 'Set up a schedule to frequently automate the export of expenses from ' + brandingConfig.brandName + ' to QuickBooks Desktop.',
84-
frequencySubLabel: 'Set a frequency based on how often you want your expenses in ' + brandingConfig.brandName + ' to be exported to QuickBooks Desktop.',
85-
preferenceLabel: 'Other Preferences',
86-
preferenceSubLabel: 'Based on your preference, you can choose whether you want to create any new records in QuickBooks Desktop from Fyle. (when there is no employee record found, or when the accounting period is closed).',
87-
previewDescriptionFieldLabel: 'Preview of the Description Field',
88-
autoCreateMerchantsLabel: 'Auto Create Merchant on QuickBooks Desktop for Credit Card Charge'
69+
customizeSectionLabel: 'Customization',
70+
customizeSectionSubLabel: 'In this section, you can customize the data that you\'d like to export from Fyle to QuickBooks Online You can choose what data points need to be exported and what shouldn\'t be.',
71+
scheduleAutoExportLabel: 'Schedule automatic export',
72+
scheduleAutoExportSubLabel: 'Set up a schedule to frequently automate the export of expenses from ' + brandingConfig.brandName + ' to QuickBooks Desktop.',
73+
autoExportfrequencyLabel: 'Set up export frequency',
74+
autoExportfrequencySubLabel: 'Set a frequency based on how often you want your expenses in Fyle to be exported to QuickBooks Online.',
75+
topLevelMemoStructureLabel: 'Select the top level memo field data for QuickBooks Desktop',
76+
topLevelMemoStructureSubLabel: 'You can customize the <b>data point</b> you would like to export to QuickBooks Desktop\’s <b>top-level memo</b> field while exporting expenses from ' + brandingConfig.brandName + '.',
77+
memoStructureLabel: 'Set the line-ttem level memo field data for QuickBooks Desktop.',
78+
memoStructureSubLabel: 'You can customize the data set you would like to export to QuickBooks Desktop\’s <b>transaction line-item level memo</b> field while exporting expenses from ' + brandingConfig.brandName + '.',
79+
previewDescriptionFieldLabel: 'Preview of the Description Field'
8980
}
9081
}
9182
},

src/app/core/models/branding/content-configuration.model.ts

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,21 @@ export type ContentConfiguration = {
5858
customSegmentHeader: string;
5959
},
6060
advancedSettings: {
61-
memoStructureSubLabel: string;
62-
preferenceLabel: string;
63-
preferenceSubLabel: string;
64-
frequencySubLabel: string;
65-
automationSubLabel: string;
66-
customizationSubLabel: string;
67-
defaultPaymentAccount: string;
68-
memoStructureLabel: string;
6961
stepName: string;
7062
contentText: string;
71-
scheduleAutoExport: string;
72-
email: string;
73-
paymentSyncLabel: string;
74-
postEntriesCurrentPeriod: string;
75-
autoCreateMerchantsAsVendorsLabel: string;
76-
billPaymentAccountLabel: string;
77-
billPaymentAccountSubLabel: string;
78-
autoCreateVendorsLabel: string;
79-
dfvSubLabel: string;
80-
dfvLabel: string;
81-
changeAccountingPeriodSubLabel: string;
82-
scheduleSubLabel: string;
63+
automationLabel: string;
64+
automationSubLabel: string;
65+
customizeSectionLabel: string;
66+
customizeSectionSubLabel: string;
67+
scheduleAutoExportLabel: string;
68+
scheduleAutoExportSubLabel: string;
69+
autoExportfrequencyLabel: string;
70+
autoExportfrequencySubLabel: string;
71+
topLevelMemoStructureLabel: string;
72+
topLevelMemoStructureSubLabel: string;
73+
memoStructureLabel: string;
74+
memoStructureSubLabel: string;
8375
previewDescriptionFieldLabel: string;
84-
autoCreateMerchantsLabel: string;
8576
}
8677
},
8778
},

src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-advanced-settings.model.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,21 @@ export class QbdDirectAdvancedSettingsModel extends AdvancedSettingsModel {
3838
searchOption: new FormControl('')
3939
});
4040
}
41+
42+
static constructPayload (advancedSettingForm: FormGroup): QbdDirectAdvancedSettingsPost {
43+
44+
const topMemo: string[] = [];
45+
topMemo.push(advancedSettingForm.value.topMemoStructure);
46+
47+
const advancedSettingPayload: QbdDirectAdvancedSettingsPost = {
48+
expense_memo_structure: advancedSettingForm.get('expenseMemoStructure')?.value ? advancedSettingForm.get('expenseMemoStructure')?.value : null,
49+
top_memo_structure: advancedSettingForm.get('topMemoStructure')?.value ? topMemo : null,
50+
schedule_is_enabled: advancedSettingForm.get('exportSchedule')?.value ? advancedSettingForm.get('exportSchedule')?.value : false,
51+
emails_selected: advancedSettingForm.get('exportSchedule')?.value ? advancedSettingForm.get('email')?.value : null,
52+
interval_hours: advancedSettingForm.get('exportSchedule')?.value ? advancedSettingForm.get('exportScheduleFrequency')?.value : null
53+
};
54+
55+
return advancedSettingPayload;
56+
}
4157
}
4258

src/app/core/services/qbd/qbd-configuration/qbd-advanced-setting.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
33
import { QBDAdvancedSettingsGet, QBDAdvancedSettingsPost } from 'src/app/core/models/qbd/qbd-configuration/qbd-advanced-setting.model';
44
import { QbdWorkspaceService } from '../qbd-core/qbd-workspace.service';
55
import { ApiService } from '../../common/api.service';
6+
import { HelperService } from '../../common/helper.service';
67

78
@Injectable({
89
providedIn: 'root'
@@ -11,8 +12,11 @@ export class QbdAdvancedSettingService {
1112

1213
constructor(
1314
private apiService: ApiService,
14-
private workspaceService: QbdWorkspaceService
15-
) { }
15+
private workspaceService: QbdWorkspaceService,
16+
private helper: HelperService
17+
) {
18+
helper.setBaseApiURL();
19+
}
1620

1721
getQbdAdvancedSettings(): Observable<QBDAdvancedSettingsGet> {
1822
return this.apiService.get(`/workspaces/${this.workspaceService.getWorkspaceId()}/advanced_settings/`, {});
Original file line numberDiff line numberDiff line change
@@ -1 +1,88 @@
1-
<p>qbd-direct-advanced-settings works!</p>
1+
<div *ngIf="isLoading" class="tw-flex tw-justify-center tw-items-center tw-h-screen">
2+
<app-loader></app-loader>
3+
</div>
4+
<div *ngIf="!isLoading" class="configuration--contents tw-border-separator tw-mt-6" [ngClass]="{'tw-mx-120-px tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-mx-60-px tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}">
5+
<div>
6+
<app-configuration-step-header
7+
[headerText]="brandingContent.stepName"
8+
[contentText]="brandingContent.contentText"
9+
[showSyncButton]="isOnboarding"
10+
[appName]="appName.QBD_DIRECT">
11+
</app-configuration-step-header>
12+
</div>
13+
<div>
14+
<form [formGroup]="advancedSettingsForm">
15+
<div class="tw-p-24-px">
16+
<div class="tw-mb-16-px">
17+
<app-configuration-step-sub-header
18+
[label]="brandingContent.automationLabel"
19+
[subLabel]="brandingContent.automationSubLabel">
20+
</app-configuration-step-sub-header>
21+
</div>
22+
<div class="tw-rounded-lg tw-border-separator tw-border tw-my-16-px">
23+
<app-configuration-toggle-field
24+
[form]="advancedSettingsForm"
25+
[label]="brandingContent.scheduleAutoExportLabel"
26+
[subLabel]="brandingContent.scheduleAutoExportSubLabel"
27+
[iconPath]="'calendar'"
28+
[formControllerName]="'exportSchedule'">
29+
</app-configuration-toggle-field>
30+
31+
<div *ngIf="advancedSettingsForm.value.exportSchedule">
32+
<app-configuration-schedule-export
33+
[form]="advancedSettingsForm"
34+
[appName]="appName.QBD_DIRECT"
35+
[isFieldMandatory]="false"
36+
[mandatoryErrorListName]="'automatic export method'"
37+
[label]="brandingContent.autoExportfrequencyLabel"
38+
[subLabel]="brandingContent.autoExportfrequencySubLabel"
39+
[options]="hours"
40+
[isEmailPresent]="brandingFeatureConfig.featureFlags.advancedSettings.emailNotification ? true: false"
41+
[formControllerName]="'exportScheduleFrequency'"
42+
[adminEmails]="adminEmails">
43+
</app-configuration-schedule-export>
44+
</div>
45+
</div>
46+
47+
<div class="tw-mb-16-px">
48+
<app-configuration-step-sub-header
49+
[label]="brandingContent.customizeSectionLabel"
50+
[subLabel]="brandingContent.customizeSectionSubLabel">
51+
</app-configuration-step-sub-header>
52+
</div>
53+
<div class="tw-mt-12-px tw-bg-white tw-border tw-border-solid tw-border-separator tw-rounded-12-px">
54+
<app-configuration-select-field
55+
[form]="advancedSettingsForm"
56+
[label]="brandingContent.topLevelMemoStructureLabel"
57+
[subLabel]="brandingContent.topLevelMemoStructureSubLabel"
58+
[isFieldMandatory]="true"
59+
[mandatoryErrorListName]="'top level memo'"
60+
[simpleOptions]="defaultTopMemoOptions"
61+
[iconPath]="'list'"
62+
[placeholder]="'Select top memo type'"
63+
[formControllerName]="'topMemoStructure'">
64+
</app-configuration-select-field>
65+
66+
<app-configuration-multi-select
67+
[form]="advancedSettingsForm"
68+
[isFieldMandatory]="true"
69+
[customErrorMessage]="'Please select atleast one memo type from the list'"
70+
[label]="brandingContent.memoStructureLabel"
71+
[subLabel]="brandingContent.memoStructureSubLabel"
72+
[options]="defaultMemoFields"
73+
[iconPath]="'list'"
74+
[placeholder]="'Select memo types'"
75+
[formControllerName]="'expenseMemoStructure'">
76+
</app-configuration-multi-select>
77+
<div class="tw-p-24-px">
78+
<p class="tw-text-12-px tw-mb-12-px tw-text-text-muted">{{brandingContent.previewDescriptionFieldLabel}}</p>
79+
<div class="tw-bg-input-read-only-bg tw-rounded-4-px tw-text-14-px tw-py-8-px tw-px-8-px tw-border-input-read-only-border tw-border-solid">
80+
<span>{{ memoPreviewText }}</span>
81+
</div>
82+
</div>
83+
</div>
84+
</div>
85+
<app-configuration-step-footer [ctaText]="!saveInProgress ? (isOnboarding ? ConfigurationCtaText.SAVE_AND_CONTINUE : ConfigurationCtaText.SAVE) : ConfigurationCtaText.SAVING" [isButtonDisabled]="!advancedSettingsForm.valid || saveInProgress" (save)="save()"></app-configuration-step-footer>
86+
</form>
87+
</div>
88+
</div>

0 commit comments

Comments
 (0)