b4cd4c05f2
fix: update total price info handling in correction form and ensure accurate calculations refactor: streamline sale invoice single view component by extracting info card into a separate component style: adjust button sizes in payment forms for better UI consistency feat: implement season picker navigation controls to prevent out-of-bounds selection fix: improve price formatting utility to handle undefined values gracefully chore: update environment configuration for API base URL feat: add navigation service to manage routing history and back navigation
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { SaleInvoiceSingleInfoCardComponent } from '@/shared/components/invoices/sale-invoice-single-info-card.component';
|
|
import pageParamsUtils from '@/utils/page-params.utils';
|
|
import { Component, computed, inject, signal } from '@angular/core';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
import { ButtonDirective } from 'primeng/button';
|
|
import { Card } from 'primeng/card';
|
|
import { PublicSaleInvoiceStore } from '../store/main.store';
|
|
|
|
@Component({
|
|
selector: 'public-saleInvoice',
|
|
templateUrl: './single.component.html',
|
|
imports: [SaleInvoiceSingleInfoCardComponent, Card, ButtonDirective],
|
|
})
|
|
export class PublicSaleInvoiceComponent {
|
|
private readonly route = inject(ActivatedRoute);
|
|
private readonly store = inject(PublicSaleInvoiceStore);
|
|
|
|
pageParams = computed(() => pageParamsUtils(this.route));
|
|
invoiceId = signal<string>(this.pageParams()['invoiceId']);
|
|
|
|
readonly invoice = computed(() => this.store.entity());
|
|
readonly loading = computed(() => this.store.loading());
|
|
|
|
ngOnInit() {
|
|
this.store.getData(this.invoiceId());
|
|
}
|
|
|
|
async share() {
|
|
if (navigator.share) {
|
|
await navigator.share({
|
|
title: window.document.title,
|
|
text: 'برای مشاهده صورتحساب اینجا کلیک کنید.',
|
|
url: window.location.href,
|
|
});
|
|
}
|
|
}
|
|
}
|