Skip to content

Commit

Permalink
Merge branch master into intacct-onboarding-import-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyle authored and Fyle committed Feb 13, 2024
2 parents a712c85 + 5fa73c1 commit c70b760
Show file tree
Hide file tree
Showing 35 changed files with 102 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class BusinessCentralImportSettingsModel extends ImportSettingsModel {
}

static createImportSettingPayload(importSettingsForm: FormGroup): BusinessCentralImportSettingsPost {
const expenseFieldArray = importSettingsForm.value.expenseFields;
const expenseFieldArray = importSettingsForm.getRawValue().expenseFields;
const mappingSettings = this.constructMappingSettingPayload(expenseFieldArray);
return {
import_settings: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class QBOImportSettingModel extends ImportSettingsModel {

static constructPayload(importSettingsForm: FormGroup): QBOImportSettingPost {
const emptyDestinationAttribute = {id: null, name: null};
const expenseFieldArray = importSettingsForm.value.expenseFields;
const expenseFieldArray = importSettingsForm.getRawValue().expenseFields;
const mappingSettings = this.constructMappingSettingPayload(expenseFieldArray);

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export type Sage300ImportSettingsDependentFieldSetting = {
export type Sage300ImportSetting = {
import_settings: {
import_categories: boolean,
import_vendors_as_merchants: boolean
import_vendors_as_merchants: boolean,
add_commitment_details: boolean
},
mapping_settings: ImportSettingMappingRow[] | [],
dependent_field_settings: Sage300ImportSettingsDependentFieldSetting | null,
Expand Down Expand Up @@ -63,13 +64,14 @@ export class Sage300ImportSettingModel extends ImportSettingsModel {
}

static createImportSettingPayload(importSettingsForm: FormGroup, importSettings: Sage300ImportSettingGet): Sage300ImportSettingPost {
const expenseFieldArray = importSettingsForm.value.expenseFields;
const expenseFieldArray = importSettingsForm.getRawValue().expenseFields;
const mappingSettings = this.constructMappingSettingPayload(expenseFieldArray);

return {
import_settings: {
import_categories: importSettingsForm.get('importCategories')?.value,
import_vendors_as_merchants: importSettingsForm.get('importVendorAsMerchant')?.value
import_vendors_as_merchants: importSettingsForm.get('importVendorAsMerchant')?.value,
add_commitment_details: false
},
mapping_settings: mappingSettings,
dependent_field_settings: importSettingsForm.get('isDependentImportEnabled')?.value ? {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/common/events.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class EventsService {
if (EXPOSE_INTACCT_NEW_APP && message.data.redirectUri.includes('sage-intacct')) {
this.sageIntacctLogin.emit(message.data.redirectUri);
this.redirectToOldIntacctApp.emit(message.data.redirectUri);
} else if (brandingFeatureConfig.exposeOnlyQBOApp && message.data.redirectUri.includes('quickbooks')) {
} else if (message.data.redirectUri.includes('quickbooks')) {
this.qboLogin.emit(message.data.redirectUri);
} else {
this.windowService.openInNewTab(message.data.redirectUri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<ng-template pTemplate="filter" let-options="options">
<div *ngIf="emails.length" class="p-inputgroup">
<div class="p-input-icon-left">
<i class="pi pi-search"></i>
<app-svg-icon [svgSource]="'search-medium'" [height]="'18px'" [width]="'18px'"></app-svg-icon>
<input type="text" class="!tw-h-32-px !tw-w-300-px" (keyup)="options.filter($event)"
pInputText placeholder="Search by Name / Email" formControlName="search" />
<app-svg-icon [svgSource]="'cross'" [width]="'24px'" [height]="'24px'"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs';
import { Subscription, forkJoin } from 'rxjs';
import { BusinessCentralConnectorModel, BusinessCentralConnectorPost } from 'src/app/core/models/business-central/business-central-configuration/business-central-connector.model';
import { BusinessCentralCredential } from 'src/app/core/models/business-central/db/business-central-credentials.model';
import { BusinessCentralField, BusinessCentralOnboardingState, ConfigurationCta, ToastSeverity } from 'src/app/core/models/enum/enum.model';
Expand All @@ -23,6 +23,7 @@ import { GroupedDestinationAttribute } from 'src/app/core/models/db/destination-
import { BusinessCentralCompanyPost, BusinessCentralWorkspace } from 'src/app/core/models/business-central/db/business-central-workspace.model';
import { MinimalUser } from 'src/app/core/models/db/user.model';
import { UserService } from 'src/app/core/services/misc/user.service';
import { BusinessCentralMappingService } from 'src/app/core/services/business-central/business-central-mapping/business-central-mapping.service';

@Component({
selector: 'app-business-central-onboarding-connector',
Expand Down Expand Up @@ -80,7 +81,8 @@ export class BusinessCentralOnboardingConnectorComponent implements OnInit, OnDe
private workspaceService: WorkspaceService,
private businessCentralHelperService: BusinessCentralHelperService,
private helperService: HelperService,
private mappingService: MappingService
private mappingService: MappingService,
private mapping: BusinessCentralMappingService
) { }

disconnectBusinessCentral(): void {
Expand Down Expand Up @@ -196,10 +198,12 @@ export class BusinessCentralOnboardingConnectorComponent implements OnInit, OnDe
if (!this.businessCentralCompanyName) {
const data: BusinessCentralCompanyPost = BusinessCentralConnectorModel.constructCompanyPost(this.businessCentralCompanyselected.destination_id, this.businessCentralCompanyselected.value);
this.businessCentralConnectorService.postBusinessCentralCompany(data).subscribe((workspace: BusinessCentralWorkspace) => {
this.saveInProgress = false;
this.toastService.displayToastMessage(ToastSeverity.SUCCESS, 'MS Dynamics Company saved Successfully');
this.workspaceService.setOnboardingState(BusinessCentralOnboardingState.EXPORT_SETTINGS);
this.router.navigate([`/integrations/business_central/onboarding/export_settings`]);
this.mapping.importBusinessCentralAttributes(true).subscribe(() => {
this.saveInProgress = false;
this.toastService.displayToastMessage(ToastSeverity.SUCCESS, 'MS Dynamics Company saved Successfully');
this.workspaceService.setOnboardingState(BusinessCentralOnboardingState.EXPORT_SETTINGS);
this.router.navigate([`/integrations/business_central/onboarding/export_settings`]);
});
});
} else {
this.saveInProgress = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-8-px !tw-font-400 !tw-l
<span>
{{ item.value }}
</span>
<i [ngClass]="[brandingConfig.brandId === 'fyle' ? 'pi pi-times fyle' : 'pi pi-times co']" (click)="removeFilter(advancedSettingsForm.controls.defaultLocation)"></i>
<app-svg-icon [svgSource]="'cross-medium'" (click)="removeFilter(advancedSettingsForm.controls.defaultLocation)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</div>
</ng-template>
</p-dropdown>
Expand All @@ -182,7 +182,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-8-px !tw-font-400 !tw-l
<span>
{{ item.value }}
</span>
<i [ngClass]="[brandingConfig.brandId === 'fyle' ? 'pi pi-times fyle' : 'pi pi-times co']" (click)="removeFilter(advancedSettingsForm.controls.defaultDepartment)"></i>
<app-svg-icon [svgSource]="'cross-medium'" (click)="removeFilter(advancedSettingsForm.controls.defaultDepartment)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</div>
</ng-template>
</p-dropdown>
Expand All @@ -203,7 +203,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-8-px !tw-font-400 !tw-l
<span>
{{ item.value }}
</span>
<i [ngClass]="[brandingConfig.brandId === 'fyle' ? 'pi pi-times fyle' : 'pi pi-times co']" (click)="removeFilter(advancedSettingsForm.controls.defaultProject)"></i>
<app-svg-icon [svgSource]="'cross-medium'" (click)="removeFilter(advancedSettingsForm.controls.defaultProject)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</div>
</ng-template>
</p-dropdown>
Expand All @@ -220,7 +220,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-8-px !tw-font-400 !tw-l
<span>
{{ item.value }}
</span>
<i [ngClass]="[brandingConfig.brandId === 'fyle' ? 'pi pi-times fyle' : 'pi pi-times co']" (click)="removeFilter(advancedSettingsForm.controls.defaultClass)"></i>
<app-svg-icon [svgSource]="'cross-medium'" (click)="removeFilter(advancedSettingsForm.controls.defaultClass)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</div>
</ng-template>
</p-dropdown>
Expand All @@ -237,7 +237,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-8-px !tw-font-400 !tw-l
<span>
{{ item.value }}
</span>
<i [ngClass]="[brandingConfig.brandId === 'fyle' ? 'pi pi-times fyle' : 'pi pi-times co']" (click)="removeFilter(advancedSettingsForm.controls.defaultItems)"></i>
<app-svg-icon [svgSource]="'cross-medium'" (click)="removeFilter(advancedSettingsForm.controls.defaultItems)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</div>
</ng-template>
</p-dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h3 class="tw-text-20-px tw-font-500 tw-text-slightly-normal-text-color" *ngIf="
<h3 class="tw-text-20-px tw-font-500 tw-text-slightly-normal-text-color" *ngIf="exportInProgress"> Exporting {{ processedCount }} of {{ exportableExpenseGroupIds.length }} expense{{exportableExpenseGroupIds.length > 1 ? 's' : ''}} to your Sage Intacct Account</h3>
<h3 class="tw-text-20-px tw-font-500 tw-text-slightly-normal-text-color" *ngIf="!exportInProgress && exportableExpenseGroupIds.length"> {{ exportableExpenseGroupIds.length }} expense{{exportableExpenseGroupIds.length > 1 ? 's' : ''}} ready to export</h3>
<h3 class="tw-text-20-px tw-font-500 tw-text-slightly-normal-text-color" *ngIf="!exportInProgress && !exportableExpenseGroupIds.length && lastExport?.successful_expense_groups_count">You are all caught up!</h3>
<app-svg-icon [svgSource]="'info-circle-fill'" [width]="'16px'" [height]="'16px'" [styleClasses]="'tw-flex tw-text-info tw-ml-4-px'" [tooltipText]="'All expenses that have reached your export state in {{brandingConfig.brandName}} will be automatically imported and kept ready for export'"></app-svg-icon>
<app-svg-icon [svgSource]="'info-circle-fill'" [width]="'16px'" [height]="'16px'" [styleClasses]="'tw-flex tw-text-info tw-ml-4-px'" [tooltipText]="'All expenses that have reached your export state in ' + brandingConfig.brandName + ' will be automatically imported and kept ready for export'"></app-svg-icon>
</div>
<h5 class="tw-text-14-px tw-font-400 tw-text-slightly-normal-text-color tw-pl-34-px tw-pt-8-px" *ngIf="!exportInProgress && !exportableExpenseGroupIds.length && !lastExport">No new expenses to export in the configured state of export in {{brandingConfig.brandName}}. Once you start processing payments or closing your expenses, they will be automatically available here.</h5>
<h5 class="tw-text-14-px tw-font-400 tw-text-slightly-normal-text-color tw-pl-34-px tw-pt-8-px" *ngIf="exportInProgress">This may take a few minutes...</h5>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div [formGroup]="exportLogForm" class="tw-flex tw-items-center tw-p-24-px">

<span class="custom-search-field" [ngStyle]="{ 'border-color': isSearchFocused ? 'black' : '#ccc' }">
<i class="pi pi-search"></i>
<app-svg-icon [svgSource]="'search-medium'" [width]="'18px'" [height]="'18px'"></app-svg-icon>
<input class="tw-pb-1 tw-pt-1 tw-text-14-px" type="text" (input)="filterTable($event)" (focus)="isSearchFocused = true" (blur)="isSearchFocused = false" placeholder="Search by Employee Name or Expense ID" />
</span>
<div class="tw-flex tw-mr-4"></div>
Expand All @@ -32,7 +32,7 @@
</div>
</div>
</span>
<i [ngClass]="[brandingConfig.brandId === 'fyle' ? 'pi pi-times fyle' : 'pi pi-times co']" (click)="removeFilter(exportLogForm.controls.dateRange)"></i>
<app-svg-icon [svgSource]="'cross-medium'" (click)="removeFilter(exportLogForm.controls.dateRange)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</div>
</ng-template>
<ng-template let-date pTemplate="item">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div [formGroup]="skipExportLogForm" class="tw-flex tw-items-center tw-p-24-px">

<span class="custom-search-field" [ngStyle]="{ 'border-color': isSearchFocused ? 'black' : '#ccc' }">
<i class="pi pi-search"></i>
<app-svg-icon [svgSource]="'search-medium'" [width]="'18px'" [height]="'18px'"></app-svg-icon>
<input class="tw-pb-1 tw-pt-1 tw-text-14-px" type="text" (input)="filterTable($event)" (focus)="isSearchFocused = true" (blur)="isSearchFocused = false" placeholder="Search by Employee Name or Expense ID" />
</span>
<div class="tw-flex tw-mr-4"></div>
Expand Down
3 changes: 0 additions & 3 deletions src/app/integrations/landing/landing.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
<img src="assets/logos/quickbooks-logo.png" width="120px" />
<span class="landing--accounting-app-name">
QuickBooks Online
<div class="landing--accounting-app-open">
<app-svg-icon *ngIf="!exposeOnlyQBOApp" [svgSource]="'open-in-new-tab'" [width]="'16px'" [height]="'16px'"></app-svg-icon>
</div>
</span>
</div>
<!-- <div *ngIf="!isINCluster" class="landing--accounting-app tw-mr-20-px tw-mt-20-px" (click)="openInAppIntegration(InAppIntegration.SAGE300)">
Expand Down
2 changes: 1 addition & 1 deletion src/app/integrations/landing/landing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class LandingComponent implements OnInit {

private readonly integrationCallbackUrlMap: IntegrationCallbackUrl = {
[AccountingIntegrationApp.NETSUITE]: [environment.ns_callback_url, environment.ns_client_id],
[AccountingIntegrationApp.QBO]: [this.exposeOnlyQBOApp ? `${environment.fyle_app_url}/quickbooks` : environment.qbo_callback_url, environment.qbo_client_id],
[AccountingIntegrationApp.QBO]: [`${environment.fyle_app_url}/quickbooks`, environment.qbo_client_id],
[AccountingIntegrationApp.SAGE_INTACCT]: [environment.si_callback_url, environment.si_client_id],
[AccountingIntegrationApp.XERO]: [environment.xero_callback_url, environment.xero_client_id]
};
Expand Down
3 changes: 2 additions & 1 deletion src/app/integrations/sage300/sage300-shared/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { Sage300ImportSettingGet } from "src/app/core/models/sage300/sage300-con
export const importSettingsResponse: Sage300ImportSettingGet = {
"import_settings": {
"import_categories": false,
"import_vendors_as_merchants": false
"import_vendors_as_merchants": false,
"add_commitment_details": false
},
"mapping_settings": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="tw-p-24-px tw-border-b-1-px tw-border-b-box-color">
<div class="tw-flex tw-justify-between tw-items-center">
<p class="tw-text-text-primary tw-text-20-px tw-font-500">Add new Custom Field</p>
<i [ngClass]="[brandingConfig.brandId === 'fyle' ? 'pi pi-times fyle' : 'pi pi-times co']" class="tw-cursor-pointer tw-text-12-px" (click)="closeModel()"></i>
<app-svg-icon [svgSource]="'cross-medium'" class="tw-cursor-pointer tw-text-12-px" (click)="closeModel()" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</div>
</div>
<div *ngIf="existingFields.indexOf(customFieldForm.value.attribute_type?.toLowerCase()) !== -1">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
<div [formGroup]="form">
<!-- <div *ngIf="!isDestinationFixedImport && !isCloneSettingView" class="fields-header" fxLayout="row" fxLayoutAlign="start center">
<div class="fields-header-text tw-pl-48-px tw-w-450-px">{{appName}} Dimensions</div>
<div class="fields-header-text tw-w-30-vw">{{brandingConfig.brandName}} Fields</div>
<div class="fields-header-text tw-flex tw-w-[10vw] tw-whitespace-nowrap">
Import to {{brandingConfig.brandName}}
<app-svg-icon [svgSource]="'info-circle-fill'" [width]="'16px'" [height]="'16px'" [styleClasses]="'tw-text-text-muted'" [tooltipPosition]="'top'"
[tooltipText]="'Importing a dimension syncs active values from ' + appName + ' every 24 hours. Deactivated values in ' + appName + ' will also be disabled in ' + brandingConfig.brandName + ''">
</app-svg-icon>
</div>
</div> -->
<div *ngIf="defaultImportFields" class="tw-mx-20-px tw-mt-18px">
<div *ngFor="let defaultField of defaultImportFields; let i = index">
<div class="tw-pt-18-px">
Expand Down Expand Up @@ -121,12 +111,12 @@ <h5 *ngIf="!isCloneSettingView" class="!tw-text-text-muted tw-text-14-px tw-pt-8
</div>
</ng-template>
<ng-template pTemplate="selectedItem" let-item>
<div class="tw-flex tw-justify-between tw-items-center ">
<span>
{{ item.display_name }}
</span>
<i [ngClass]="[brandingConfig.brandId === 'fyle' ? 'pi pi-times fyle' : 'pi pi-times co']" (click)="removeFilter(expenseField)"></i>
</div>
<div class="tw-flex tw-justify-between tw-items-center ">
<span>
{{ item.display_name }}
</span>
<app-svg-icon [svgSource]="'cross-medium'" (click)="removeFilter(expenseField)" [height]="'16px'" [width]="'16px'"></app-svg-icon>
</div>
</ng-template>
</p-dropdown>
<p *ngIf="expenseField.value.source_field && !expenseField.valid && !hasDuplicateOption(expenseField, i, 'source_field')" class="tw-text-alert-toast tw-text-12-px tw-pt-4-px">
Expand Down
Loading

0 comments on commit c70b760

Please sign in to comment.