Skip to content

Commit

Permalink
Merge branch 'master' into qbd-direct-onboarding-phase-1
Browse files Browse the repository at this point in the history
  • Loading branch information
DhaaraniCIT committed Nov 25, 2024
2 parents 7b6cc00 + 92dc51b commit dd6f7e0
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/app/core/models/db/expense-group-setting.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type ExpenseGroupSettingPost = {
reimbursable_export_date_type: ExportDateType | null;
corporate_credit_card_expense_group_fields?: string[] | null;
ccc_export_date_type: ExportDateType | null;
split_expense_grouping: SplitExpenseGrouping;
};

export interface ExpenseGroupSetting extends ExpenseGroupSettingPost {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ExportModuleRule, ExportSettingModel, ExportSettingValidatorRule } from
import { SelectFormOption } from "../../common/select-form-option.model";
import { DefaultDestinationAttribute } from "../../db/destination-attribute.model";
import { ExpenseGroupSettingGet, ExpenseGroupSettingPost } from "../../db/expense-group-setting.model";
import { CCCExpenseState, EmployeeFieldMapping, ExpenseGroupingFieldOption, ExpenseState, ExportDateType, FyleField, NameInJournalEntry, NetSuiteCorporateCreditCardExpensesObject, NetsuiteReimbursableExpensesObject } from "../../enum/enum.model";
import { CCCExpenseState, EmployeeFieldMapping, ExpenseGroupingFieldOption, ExpenseState, ExportDateType, FyleField, NameInJournalEntry, NetSuiteCorporateCreditCardExpensesObject, NetsuiteReimbursableExpensesObject, SplitExpenseGrouping } from "../../enum/enum.model";
import { brandingConfig, brandingContent, brandingFeatureConfig } from "src/app/branding/branding-config";
import { ExportSettingFormOption } from "../../intacct/intacct-configuration/export-settings.model";

Expand Down Expand Up @@ -237,7 +237,7 @@ export class NetSuiteExportSettingModel extends ExportSettingModel {
static getValidators(): [ExportSettingValidatorRule, ExportModuleRule[]] {
const exportSettingValidatorRule: ExportSettingValidatorRule = {
reimbursableExpense: ['reimbursableExportType', 'reimbursableExportGroup', 'reimbursableExportDate', 'expenseState'],
creditCardExpense: ['creditCardExportType', 'creditCardExportGroup', 'creditCardExportDate', 'cccExpenseState']
creditCardExpense: ['creditCardExportType', 'creditCardExportGroup', 'creditCardExportDate', 'cccExpenseState', 'splitExpenseGrouping']
};

const exportModuleRule: ExportModuleRule[] = [
Expand Down Expand Up @@ -286,7 +286,8 @@ export class NetSuiteExportSettingModel extends ExportSettingModel {
accountsPayable: new FormControl(exportSettings?.general_mappings?.accounts_payable?.id ? exportSettings.general_mappings.accounts_payable : null),
defaultCreditCardVendor: new FormControl(exportSettings?.general_mappings?.default_ccc_vendor?.id ? exportSettings.general_mappings.default_ccc_vendor : null),
nameInJournalEntry: new FormControl(exportSettings?.configuration?.name_in_journal_entry ? exportSettings?.configuration.name_in_journal_entry : this.getNameInJournalOptions()[0].value),
searchOption: new FormControl('')
searchOption: new FormControl(''),
splitExpenseGrouping: new FormControl(exportSettings?.expense_group_settings?.split_expense_grouping)
});
}

Expand All @@ -306,7 +307,8 @@ export class NetSuiteExportSettingModel extends ExportSettingModel {
reimbursable_expense_group_fields: exportSettingsForm.get('reimbursableExportGroup')?.value ? [exportSettingsForm.get('reimbursableExportGroup')?.value] : null,
reimbursable_export_date_type: exportSettingsForm.get('reimbursableExportDate')?.value,
corporate_credit_card_expense_group_fields: exportSettingsForm.get('creditCardExportGroup')?.value ? [exportSettingsForm.get('creditCardExportGroup')?.value] : null,
ccc_export_date_type: exportSettingsForm.get('creditCardExportDate')?.value
ccc_export_date_type: exportSettingsForm.get('creditCardExportDate')?.value,
split_expense_grouping: exportSettingsForm.get('splitExpenseGrouping')?.value ? exportSettingsForm.get('splitExpenseGrouping')?.value : SplitExpenseGrouping.MULTIPLE_LINE_ITEM
},
configuration: {
reimbursable_expenses_object: exportSettingsForm.get('reimbursableExportType')?.value ? exportSettingsForm.get('reimbursableExportType')?.value : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type XeroWorkspaceGeneralSetting = {
map_merchant_to_contact: boolean;
auto_map_employees: string;
auto_create_destination_entity: boolean;
auto_create_merchant_destination_entity: boolean;
is_simplify_report_closure_enabled: boolean;
skip_cards_mapping?: boolean;
import_tax_codes: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,20 @@
[formControllerName]="'creditCardExportDate'">
</app-configuration-select-field>
</div>

<div *ngIf="brandingFeatureConfig.featureFlags.exportSettings.splitExpenseGrouping && exportSettingForm.get('creditCardExportType')?.value === NetSuiteCorporateCreditCardExpensesObject.CREDIT_CARD_CHARGE" class="tw-mt-16-px tw-bg-white tw-border tw-border-solid tw-border-border-tertiary tw-rounded-12-px">
<app-configuration-select-field
[form]="exportSettingForm"
[isFieldMandatory]="true"
[mandatoryErrorListName]="'split expense grouping'"
[label]="'How should the split expenses be grouped?'"
[subLabel]="'Choose how expenses should be grouped for split expenses'"
[options]="splitExpenseGroupingOptions"
[iconPath]="'question-square-outline'"
[placeholder]="'Select the split expense grouping type'"
[formControllerName]="'splitExpenseGrouping'">
</app-configuration-select-field>
</div>
</div>
</div>
<app-configuration-step-footer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export class NetsuiteExportSettingsComponent implements OnInit {

nameInJournalOptions = NetSuiteExportSettingModel.getNameInJournalOptions();

readonly splitExpenseGroupingOptions = NetSuiteExportSettingModel.getSplitExpenseGroupingOptions();

showNameInJournalOption: boolean;

exportSettingForm: FormGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export class NetsuiteImportSettingsComponent implements OnInit {
this.netsuiteConnectorService.getSubsidiaryMapping(),
this.importSettingService.getNetsuiteFields(),
this.workspaceService.getConfiguration(),
this.mappingService.getPaginatedDestinationAttributes(NetsuiteFyleField.TAX_ITEM)
this.mappingService.getPaginatedDestinationAttributes(NetsuiteFyleField.TAX_ITEM, '@0.0%')
]).subscribe(([importSettingsResponse, fyleFieldsResponse, subsidiaryMapping, netsuiteFields, workspaceGeneralSetting, destinationAttribute]) => {
this.importSettings = importSettingsResponse;
if (subsidiaryMapping && subsidiaryMapping.country_name !== '_unitedStates') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
[placeholder]="'Select a Payment Account'"
[formControllerName]="'billPaymentAccount'">
</app-configuration-select-field>
<app-configuration-toggle-field *ngIf="workspaceGeneralSettings.corporate_credit_card_expenses_object"
<app-configuration-toggle-field *ngIf="workspaceGeneralSettings.corporate_credit_card_expenses_object && !workspaceGeneralSettings.import_suppliers_as_merchants"
[form]="advancedSettingForm"
[iconPath]="'user-plus'"
[label]="brandingContent.autoCreateMerchantsAsVendorsLabel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
</div>
</div>

<div class="tw-rounded-lg tw-border-border-tertiary tw-border tw-mt-24-px" *ngIf="brandingFeatureConfig.featureFlags.importSettings.importVendorsAsMerchants && workspaceGeneralSettings.corporate_credit_card_expenses_object">
<div
class="tw-rounded-lg tw-border-border-tertiary tw-border tw-mt-24-px"
*ngIf="brandingFeatureConfig.featureFlags.importSettings.importVendorsAsMerchants
&& workspaceGeneralSettings.corporate_credit_card_expenses_object
&& !workspaceGeneralSettings.auto_create_merchant_destination_entity">
<app-configuration-toggle-field
[form]="importSettingsForm"
[label]="brandingContent.importSuppliersAsMerchantsLabel"
Expand Down

0 comments on commit dd6f7e0

Please sign in to comment.