diff --git a/src/app/carnet/application/application.component.html b/src/app/carnet/application/application.component.html
index 6a17cce..342eb28 100644
--- a/src/app/carnet/application/application.component.html
+++ b/src/app/carnet/application/application.component.html
@@ -21,7 +21,7 @@
diff --git a/src/app/carnet/travel-plan/travel-plan.component.ts b/src/app/carnet/travel-plan/travel-plan.component.ts
index bace1b3..4ef21fe 100644
--- a/src/app/carnet/travel-plan/travel-plan.component.ts
+++ b/src/app/carnet/travel-plan/travel-plan.component.ts
@@ -19,6 +19,8 @@ import { ConfirmDialogComponent } from '../../shared/components/confirm-dialog/c
})
export class TravelPlanComponent {
@Input() headerid: number = 0;
+ @Input() isViewMode = false;
+
@Output() completed = new EventEmitter();
private fb = inject(FormBuilder);
diff --git a/src/app/carnet/view/view-carnet.component.html b/src/app/carnet/view/view-carnet.component.html
new file mode 100644
index 0000000..6b9b54e
--- /dev/null
+++ b/src/app/carnet/view/view-carnet.component.html
@@ -0,0 +1,42 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/carnet/view/view-carnet.component.scss b/src/app/carnet/view/view-carnet.component.scss
new file mode 100644
index 0000000..bb26aa7
--- /dev/null
+++ b/src/app/carnet/view/view-carnet.component.scss
@@ -0,0 +1,8 @@
+.carnet-headers-align .mat-expansion-panel-header-description {
+ justify-content: space-between;
+ align-items: center;
+}
+
+.carnet-headers-align .mat-mdc-form-field+.mat-mdc-form-field {
+ margin-left: 8px;
+}
\ No newline at end of file
diff --git a/src/app/carnet/view/view-carnet.component.ts b/src/app/carnet/view/view-carnet.component.ts
new file mode 100644
index 0000000..ebbedc5
--- /dev/null
+++ b/src/app/carnet/view/view-carnet.component.ts
@@ -0,0 +1,46 @@
+import { afterNextRender, Component, inject, viewChild } from '@angular/core';
+import { AngularMaterialModule } from '../../shared/module/angular-material.module';
+import { MatAccordion } from '@angular/material/expansion';
+import { UserPreferences } from '../../core/models/user-preference';
+import { CommonModule } from '@angular/common';
+import { ActivatedRoute } from '@angular/router';
+import { UserPreferencesService } from '../../core/services/user-preference.service';
+import { ReactiveFormsModule } from '@angular/forms';
+import { ApplicationComponent } from '../application/application.component';
+import { GoodsComponent } from '../goods/goods.component';
+import { HolderComponent } from '../holder/holder.component';
+import { ShippingComponent } from '../shipping/shipping.component';
+import { TravelPlanComponent } from '../travel-plan/travel-plan.component';
+
+@Component({
+ selector: 'app-view-carnet',
+ imports: [AngularMaterialModule, CommonModule, ReactiveFormsModule,
+ ApplicationComponent, HolderComponent, GoodsComponent, TravelPlanComponent, ShippingComponent],
+ templateUrl: './view-carnet.component.html',
+ styleUrl: './view-carnet.component.scss'
+})
+export class ViewCarnetComponent {
+ accordion = viewChild.required(MatAccordion);
+ isViewMode = true;
+ headerid: number = 0;
+ applicationName: string = '';
+ userPreferences: UserPreferences;
+
+ private route = inject(ActivatedRoute);
+
+ constructor(userPrefenceService: UserPreferencesService) {
+ this.userPreferences = userPrefenceService.getPreferences();
+
+ afterNextRender(() => {
+ // Open all panels
+ this.accordion().openAll();
+ });
+ }
+
+ ngOnInit(): void {
+ const idParam = this.route.snapshot.paramMap.get('headerid');
+ this.headerid = idParam ? parseInt(idParam, 10) : 0;
+
+ this.applicationName = this.route.snapshot.queryParamMap.get('applicationname') || '';
+ }
+}
diff --git a/src/app/core/models/carnet/holder.ts b/src/app/core/models/carnet/holder.ts
index 85fdb1b..79f97d9 100644
--- a/src/app/core/models/carnet/holder.ts
+++ b/src/app/core/models/carnet/holder.ts
@@ -1,5 +1,6 @@
export interface Holder {
holderid: number;
+ locationid?: number;
holderName: string;
dbaName?: string | null;
holderNumber: string;
diff --git a/src/app/core/services/carnet/carnet.service.ts b/src/app/core/services/carnet/carnet.service.ts
index ee382b4..339e2b9 100644
--- a/src/app/core/services/carnet/carnet.service.ts
+++ b/src/app/core/services/carnet/carnet.service.ts
@@ -45,4 +45,15 @@ export class CarnetService {
return this.http.post(`${this.apiUrl}/${this.apiDb}/TransmitApplicationtoProcess`, appData);
}
+
+ processApplication(headerid: number): Observable {
+
+ let appData = {
+ // P_SPID: this.userService.getUserSpid(),
+ P_USERID: this.userService.getUser(),
+ P_HEADERID: headerid
+ }
+
+ return this.http.post(`${this.apiUrl}/${this.apiDb}//ProcessCarnet`, appData);
+ }
}
diff --git a/src/app/core/services/carnet/holder.service.ts b/src/app/core/services/carnet/holder.service.ts
index d3c8172..caba5b9 100644
--- a/src/app/core/services/carnet/holder.service.ts
+++ b/src/app/core/services/carnet/holder.service.ts
@@ -23,10 +23,11 @@ export class HolderService {
private mapToHolder(holder: any): Holder {
return {
holderid: holder.HOLDERID,
+ locationid: holder.LOCATIONID,
holderNumber: holder.HOLDERNO,
holderType: holder.HOLDERTYPE,
uscibMember: holder.USCIBMEMBERFLAG === 'Y',
- // govAgency: holder.GOVAGENCYFLAG === 'Y',
+ // govAgency: holder.GOVAGENCYFLAG === 'Y',
holderName: holder.HOLDERNAME,
//NAMEQUALIFIER: holder.NAMEQUALIFIER || null,
dbaName: holder.ADDLNAME || null,
diff --git a/src/app/core/services/carnet/shipping.service.ts b/src/app/core/services/carnet/shipping.service.ts
index d60524e..37c24b7 100644
--- a/src/app/core/services/carnet/shipping.service.ts
+++ b/src/app/core/services/carnet/shipping.service.ts
@@ -1,11 +1,12 @@
import { inject, Injectable } from '@angular/core';
import { environment } from '../../../../environments/environment';
import { HttpClient } from '@angular/common/http';
-import { filter, map, Observable } from 'rxjs';
+import { filter, map, Observable, of } from 'rxjs';
import { UserService } from '../common/user.service';
import { Shipping } from '../../models/carnet/shipping';
import { ShippingContact } from '../../models/carnet/shipping-contact';
import { ShippingAddress } from '../../models/carnet/shipping-address';
+import { Holder } from '../../models/carnet/holder';
@Injectable({
providedIn: 'root'
@@ -75,7 +76,7 @@ export class ShippingService {
P_CUSTCOURIERNO: shippingData.courierAccount,
P_PAYMENTMETHOD: shippingData.paymentMethod,
- // P_BONDPROTECTION: shippingData.needsBond ? 'Y' : 'N',
+ // P_BONDPROTECTION: shippingData.needsBond ? 'Y' : 'N',
P_INSPROTECTION: shippingData.needsInsurance ? 'Y' : 'N',
P_LDIPROTECTION: shippingData.needsLostDocProtection ? 'Y' : 'N',
P_FORMOFSECURITY: shippingData.formOfSecurity,
@@ -137,21 +138,20 @@ export class ShippingService {
map(response => this.mapToAddress(response?.[0])));
}
- getHolderAddressById(id: number): ShippingAddress | any {
- return this.http.get(`${this.apiUrl}/${this.apiDb}/GetHolderRecord/${this.userService.getUserSpid()}/${id}`).pipe(
- map(response => this.mapToAddress(response)));
+ getHolderAddress(holder: Holder): ShippingAddress | any {
+ return of(this.mapToAddress(holder));
}
private mapToAddress(address: any): ShippingAddress {
return {
- companyName: address.NAMEOF ?? address.HOLDERNAME,
- addressid: address.LOCATIONID ?? address.LOCATIONID,
- address1: address.ADDRESS1,
- address2: address.ADDRESS2,
- city: address.CITY,
- state: address.STATE,
- zip: address.ZIP,
- country: address.COUNTRY
+ companyName: address.NAMEOF ?? address.holderName,
+ addressid: address.LOCATIONID ?? address.locationid,
+ address1: address.ADDRESS1 ?? address.address1,
+ address2: address.ADDRESS2 ?? address.address2,
+ city: address.CITY ?? address.city,
+ state: address.STATE ?? address.state,
+ zip: address.ZIP ?? address.zip,
+ country: address.COUNTRY ?? address.country
};
}
}
diff --git a/src/app/holder/search/search-holder.component.html b/src/app/holder/search/search-holder.component.html
index 51f0b0b..3ffe5dd 100644
--- a/src/app/holder/search/search-holder.component.html
+++ b/src/app/holder/search/search-holder.component.html
@@ -22,7 +22,7 @@
Clear Search
-