feat(back-end and front-end): calculator improvements

This commit is contained in:
2026-03-05 21:46:11 +01:00
parent 235fe7780d
commit 7a699d2adf
15 changed files with 206 additions and 172 deletions

View File

@@ -16,6 +16,10 @@ import {
AppToggleSelectorComponent,
ToggleOption,
} from '../../shared/components/app-toggle-selector/app-toggle-selector.component';
import {
PriceBreakdownComponent,
PriceBreakdownRow,
} from '../../shared/components/price-breakdown/price-breakdown.component';
import { LanguageService } from '../../core/services/language.service';
import { StlViewerComponent } from '../../shared/components/stl-viewer/stl-viewer.component';
import { getColorHex } from '../../core/constants/colors.const';
@@ -31,6 +35,7 @@ import { getColorHex } from '../../core/constants/colors.const';
AppButtonComponent,
AppCardComponent,
AppToggleSelectorComponent,
PriceBreakdownComponent,
StlViewerComponent,
],
templateUrl: './checkout.component.html',
@@ -197,6 +202,28 @@ export class CheckoutComponent implements OnInit {
return this.quoteSession()?.cadTotalChf ?? 0;
}
checkoutPriceBreakdownRows(session: any): PriceBreakdownRow[] {
return [
{
labelKey: 'CHECKOUT.SUBTOTAL',
amount: session?.itemsTotalChf ?? 0,
},
{
labelKey: 'CHECKOUT.SETUP_FEE',
amount: session?.baseSetupCostChf ?? session?.session?.setupCostChf ?? 0,
},
{
label: 'Cambio Ugello',
amount: session?.nozzleChangeCostChf ?? 0,
visible: (session?.nozzleChangeCostChf ?? 0) > 0,
},
{
labelKey: 'CHECKOUT.SHIPPING',
amount: session?.shippingCostChf ?? 0,
},
];
}
itemMaterial(item: any): string {
return String(
item?.materialCode ?? this.quoteSession()?.session?.materialCode ?? '-',