Skip to content

Commit c159616

Browse files
fix: update incorrect memo structure key in sage300 advanced settings payload (#1138)
1 parent aefcef5 commit c159616

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ExpenseFilterPost, ExpenseFilterPayload, ConditionField } from "../../c
33
import { JoinOption, Operator } from "../../enum/enum.model";
44

55
export type Sage300AdvancedSetting = {
6-
memo_structure: string[],
6+
expense_memo_structure: string[],
77
schedule_is_enabled: boolean,
88
auto_create_vendor: boolean,
99
interval_hours: number
@@ -23,7 +23,7 @@ export class Sage300AdvancedSettingModel {
2323
static mapAPIResponseToFormGroup(advancedSettings: Sage300AdvancedSettingGet | null, isSkipExportEnabled: boolean): FormGroup {
2424
const defaultMemoOptions: string[] = ['employee_email', 'purpose', 'category', 'spent_on', 'report_number', 'expense_link'];
2525
return new FormGroup({
26-
memoStructure: new FormControl(advancedSettings?.memo_structure ? advancedSettings?.memo_structure : defaultMemoOptions),
26+
memoStructure: new FormControl(advancedSettings?.expense_memo_structure ? advancedSettings?.expense_memo_structure : defaultMemoOptions),
2727
scheduleEnabled: new FormControl(advancedSettings?.schedule_is_enabled ? true : false),
2828
autoCreateVendor: new FormControl(advancedSettings?.auto_create_vendor ? true : false),
2929
scheduleAutoExportFrequency: new FormControl(advancedSettings?.interval_hours ? advancedSettings.interval_hours : 1),
@@ -33,7 +33,7 @@ export class Sage300AdvancedSettingModel {
3333

3434
static createAdvancedSettingPayload(advancedSettingsForm: FormGroup): Sage300AdvancedSettingPost {
3535
return {
36-
memo_structure: advancedSettingsForm.get('memoStructure')?.value ? advancedSettingsForm.get('memoStructure')?.value : null,
36+
expense_memo_structure: advancedSettingsForm.get('memoStructure')?.value ? advancedSettingsForm.get('memoStructure')?.value : null,
3737
schedule_is_enabled: advancedSettingsForm.get('scheduleEnabled')?.value ? advancedSettingsForm.get('scheduleEnabled')?.value : false,
3838
interval_hours: advancedSettingsForm.get('scheduleEnabled')?.value ? advancedSettingsForm.get('scheduleAutoExportFrequency')?.value : null,
3939
auto_create_vendor: advancedSettingsForm.get('autoCreateVendor')?.value ? advancedSettingsForm.get('autoCreateVendor')?.value : false

src/app/integrations/sage300/sage300-shared/fixture.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const sage300FieldsResponse: IntegrationField[] =
7272
];
7373

7474
export const sage300AdvancedSettingResponse: Sage300AdvancedSettingGet = {
75-
memo_structure: [
75+
expense_memo_structure: [
7676
"employee_email",
7777
"category",
7878
"spent_on",

0 commit comments

Comments
 (0)