2026-06-11 16:13:48 +03:30
|
|
|
import { SaleInvoiceSingleInfoCardComponent } from '@/shared/components/invoices/sale-invoice-single-info-card.component';
|
2026-05-21 21:35:34 +03:30
|
|
|
import pageParamsUtils from '@/utils/page-params.utils';
|
|
|
|
|
import { Component, computed, inject, signal } from '@angular/core';
|
|
|
|
|
import { ActivatedRoute } from '@angular/router';
|
2026-06-11 16:13:48 +03:30
|
|
|
import { ButtonDirective } from 'primeng/button';
|
|
|
|
|
import { Card } from 'primeng/card';
|
2026-05-21 21:35:34 +03:30
|
|
|
import { PublicSaleInvoiceStore } from '../store/main.store';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'public-saleInvoice',
|
|
|
|
|
templateUrl: './single.component.html',
|
2026-06-11 16:13:48 +03:30
|
|
|
imports: [SaleInvoiceSingleInfoCardComponent, Card, ButtonDirective],
|
2026-05-21 21:35:34 +03:30
|
|
|
})
|
|
|
|
|
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());
|
|
|
|
|
}
|
2026-06-11 16:13:48 +03:30
|
|
|
|
|
|
|
|
async share() {
|
|
|
|
|
if (navigator.share) {
|
|
|
|
|
await navigator.share({
|
|
|
|
|
title: window.document.title,
|
|
|
|
|
text: 'برای مشاهده صورتحساب اینجا کلیک کنید.',
|
|
|
|
|
url: window.location.href,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-05-21 21:35:34 +03:30
|
|
|
}
|