Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@
<div class="row row-align">
<div class="col-md-4 detail-label">GST Number</div>
<div class="col-md-8">
{{ selectedSupplier?.supplierGstNumber?.part1 }} -RT-
{{ selectedSupplier?.supplierGstNumber?.part2 }}
<ng-container
*ngIf="
selectedSupplier?.supplierGstNumber?.part1 && selectedSupplier?.supplierGstNumber?.part2;
else emptyGST
"
>
{{ selectedSupplier?.supplierGstNumber?.part1 }} -RT- {{ selectedSupplier?.supplierGstNumber?.part2 }}
</ng-container>
<ng-template #emptyGST></ng-template>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { MatAutocompleteTrigger, MatAutocomplete } from '@angular/material/autoc
import { MatInput } from '@angular/material/input';
import { MatFormField, MatLabel, MatError } from '@angular/material/form-field';
import { MatButton } from '@angular/material/button';
import { AsyncPipe, UpperCasePipe, DatePipe } from '@angular/common';
import { AsyncPipe, UpperCasePipe, DatePipe, CommonModule } from '@angular/common';
import { MatCard, MatCardContent } from '@angular/material/card';

@Component({
Expand All @@ -53,6 +53,7 @@ import { MatCard, MatCardContent } from '@angular/material/card';
styleUrls: ['./supplier-detail.component.scss'],
standalone: true,
imports: [
CommonModule,
MatCard,
MatCardContent,
MatButton,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ export class SupplierManagementService {
constructor(private locationServices: LocationsService) {}

convertSupplierGSTNumberToFormModel(gstNumber: string): GstNumberModel {
if (!gstNumber) {
return { part1: '', part2: '' };
}
const gstArray: string[] = gstNumber.split('-RT-', 2);
const convertedGstNumber: GstNumberModel = {
part1: gstArray[0],
part2: gstArray[1]
part1: gstArray[0] || '',
part2: gstArray[1] || ''
};

return convertedGstNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ export class SupplierListDataService {
resolve();
},
error: (error) => {
console.error('Error in getSupplierById:', error);
this.alertService.clearAlert();
this.alertService.setAlert('danger', globalConst.getSupportByIdError);
reject(error);
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,19 @@ export class SuppliersListComponent implements OnInit {
this.isLoading = true;
this.supplierListDataService.getSupplierDetails($event.id, 'supplier').then(() => {
this.isLoading = false;
})
.catch(() => {
this.isLoading = false;
});
}

openMutualAidDetails($event: SupplierListItem): void {
this.isLoading = true;
this.supplierListDataService.getSupplierDetails($event.id, 'mutualAid').then(() => {
this.isLoading = false;
})
.catch(() => {
this.isLoading = false;
});
}

Expand Down