mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Warenausgabe Edit Page: Show Price with two decimal places
This commit is contained in:
6
apps/sales/src/app/core/utils/price.util.ts
Normal file
6
apps/sales/src/app/core/utils/price.util.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function toDecimalPlaces(
|
||||
value: number,
|
||||
decimalPlaces: number = 2
|
||||
): string {
|
||||
return Number(value).toFixed(decimalPlaces);
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import { DatePipe } from '@angular/common';
|
||||
import { ProcessingStatusNameMap } from '../constants';
|
||||
import { Select } from '@ngxs/store';
|
||||
import { VatState } from '../../../core/store/state/vat.state';
|
||||
import { toDecimalPlaces } from '../../../core/utils/price.util';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ShelfEditFormService {
|
||||
@@ -231,7 +232,10 @@ export class ShelfEditFormService {
|
||||
],
|
||||
quantity: [{ value: orderItem.quantity, disabled: true }],
|
||||
price: [
|
||||
{ value: String(orderItem.price).replace('.', ','), disabled: false },
|
||||
{
|
||||
value: toDecimalPlaces(orderItem.price, 2).replace('.', ','),
|
||||
disabled: false,
|
||||
},
|
||||
[Validators.required, Validators.pattern(/^\d+(,\d{1,2})?$/)],
|
||||
],
|
||||
ean: [
|
||||
|
||||
@@ -9,6 +9,14 @@ label {
|
||||
display: flex;
|
||||
width: calc(95% - #{$status-width});
|
||||
}
|
||||
|
||||
input {
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.suffix {
|
||||
margin-top: -1px;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
|
||||
Reference in New Issue
Block a user