feat: payment received mail preview

This commit is contained in:
Ahmed Bouhuolia
2024-11-24 13:19:26 +02:00
parent da47418f17
commit 3537a05ea2
19 changed files with 438 additions and 49 deletions

View File

@@ -40,7 +40,7 @@ export function EstimateSendMailForm({ children }: EstimateSendMailFormProps) {
{ setSubmitting }: FormikHelpers<EstimateSendMailFormValues>,
) => {
setSubmitting(true);
sendEstimateMail({ id: estimateId, values: { ...values } })
sendEstimateMail([estimateId, values])
.then(() => {
AppToaster.show({
message: 'The invoice mail has been sent to the customer.',

View File

@@ -3,7 +3,7 @@ import { css } from '@emotion/css';
import { Intent } from '@blueprintjs/core';
import { PaymentReceivedSendMailFormSchema } from './_types';
import { AppToaster } from '@/components';
import { useSendSaleInvoiceMail } from '@/hooks/query';
import { useSendPaymentReceiveMail, } from '@/hooks/query';
import { usePaymentReceivedSendMailBoot } from './PaymentReceivedMailBoot';
import { useDrawerActions } from '@/hooks/state';
import { useDrawerContext } from '@/components/Drawer/DrawerProvider';
@@ -27,7 +27,7 @@ interface PaymentReceivedSendMailFormProps {
export function PaymentReceivedSendMailForm({
children,
}: PaymentReceivedSendMailFormProps) {
const { mutateAsync: sendInvoiceMail } = useSendSaleInvoiceMail();
const { mutateAsync: sendPaymentMail } = useSendPaymentReceiveMail();
const { paymentReceivedId, paymentReceivedMailState } =
usePaymentReceivedSendMailBoot();
@@ -43,7 +43,7 @@ export function PaymentReceivedSendMailForm({
{ setSubmitting }: FormikHelpers<PaymentReceivedSendMailFormValues>,
) => {
setSubmitting(true);
sendInvoiceMail({ id: paymentReceivedId, values: { ...values } })
sendPaymentMail([paymentReceivedId, values])
.then(() => {
AppToaster.show({
message: 'The invoice mail has been sent to the customer.',

View File

@@ -40,7 +40,7 @@ export function ReceiptSendMailForm({ children }: ReceiptSendMailFormProps) {
{ setSubmitting }: FormikHelpers<ReceiptSendMailFormValues>,
) => {
setSubmitting(true);
sendReceiptMail({ id: receiptId, values: { ...values } })
sendReceiptMail([receiptId, values])
.then(() => {
AppToaster.show({
message: 'The receipt mail has been sent to the customer.',