Fixed error to function to create quotation

This commit is contained in:
2026-05-27 13:05:54 +01:00
parent a7ef707388
commit 0aec0be1d4
11 changed files with 206 additions and 16 deletions
+1
View File
@@ -23,6 +23,7 @@
(ok)="onModalQuotationOk()"
(cancel)="onModalQuotationCancel()">
<app-create-quotation-form #quotationForm
[suppliers]="suppliers()"
[products]="selectedProducts()">
</app-create-quotation-form>
</app-modal-button>
+8 -6
View File
@@ -4,7 +4,7 @@ import {ModalButton} from "../../components/modal-button/modal-button";
import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-form/create-purchaseorder-form";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {
CreatePurchaseOrderDto,
CreatePurchaseOrderDto, CreateQuotationDto,
GetProductDto,
GetSupplierDto,
PurchaseordersService,
@@ -123,17 +123,19 @@ export class Stock implements OnInit {
return;
}
const quotation = {
message: this.createQuotation().createQuotationForm.get('message')!.value,
purchaseConditions: this.createQuotation().createQuotationForm.get('purchaseConditions')!.value,
const quotation: CreateQuotationDto = {
message: this.createQuotation().createQuotationForm.value.message,
conditionsSale: this.createQuotation().createQuotationForm.value.conditionsSale,
customerId: this.createQuotation().createQuotationForm.value.customerId,
supplierId: this.createQuotation().createQuotationForm.value.supplierId,
products: orderLines
};
try {
await firstValueFrom(this.quotationsService.createQuotationEndpoint(quotation));
this.notificationService.success('Succès', 'Bon de commande créé');
this.notificationService.success('Succès', 'Devis créé');
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.');
this.notificationService.error('Erreur', 'Erreur lors de la création du devis.');
}
}