Included subject on document generation

This commit is contained in:
Patrick Fic
2021-02-25 15:57:45 -08:00
parent efa4a3f42b
commit c9fb2bc074
6 changed files with 17 additions and 19 deletions

View File

@@ -48,7 +48,7 @@ export function Jobd3RdPartyModal({ bodyshop, jobId }) {
variables: { id: jobId },
context: restVals,
},
{},
{ subject: TemplateList("job_special").thirdpartypayer.subject },
sendtype
);
};

View File

@@ -156,6 +156,7 @@ export function PartsOrderModalContainer({
if (refetch) refetch();
toggleModalVisible();
const Templates = TemplateList("partsorder");
if (sendType === "e") {
const matchingVendor = data.vendors.filter(
@@ -165,8 +166,8 @@ export function PartsOrderModalContainer({
GenerateDocument(
{
name: isReturn
? TemplateList("partsorder").parts_return_slip.key
: TemplateList("partsorder").parts_order.key,
? Templates.parts_return_slip.key
: Templates.parts_order.key,
variables: {
id: insertResult.data.insert_parts_orders.returning[0].id,
},
@@ -174,7 +175,9 @@ export function PartsOrderModalContainer({
{
to: matchingVendor ? [matchingVendor.email] : null,
replyTo: bodyshop.email,
subject: TemplateList("partsorder", {}).parts_order.subject,
subject: isReturn
? Templates.parts_return_slip.subject
: Templates.parts_order.subject,
},
"e"
);
@@ -182,8 +185,8 @@ export function PartsOrderModalContainer({
GenerateDocument(
{
name: isReturn
? TemplateList("partsorder").parts_return_slip.key
: TemplateList("partsorder").parts_order.key,
? Templates.parts_return_slip.key
: Templates.parts_order.key,
variables: {
id: insertResult.data.insert_parts_orders.returning[0].id,
},

View File

@@ -118,10 +118,10 @@ function BillEnterModalContainer({
} else {
notification["error"]({ message: t("payments.errors.payment") });
}
const Templates = TemplateList("payment");
GenerateDocument(
{
name: TemplateList("payment").payment_receipt.key,
name: Templates.payment_receipt.key,
variables: {
id: newPayment.data.insert_payments.returning[0].id,
},
@@ -129,6 +129,7 @@ function BillEnterModalContainer({
{
// to: [appData.email],
replyTo: bodyshop.email,
subject: Templates.payment_receipt.subject,
},
sendby === "email" ? "e" : "p"
);

View File

@@ -36,7 +36,7 @@ export function PaymentsListPaginated({
sortedInfo: {},
filteredInfo: { text: "" },
});
const Templates = TemplateList("payment");
const { t } = useTranslation();
const columns = [
{
@@ -156,9 +156,10 @@ export function PaymentsListPaginated({
</Button>
<PrintWrapperComponent
templateObject={{
name: TemplateList("payment").payment_receipt.key,
name: Templates.payment_receipt.key,
variables: { id: record.id },
}}
messageObject={{ subject: Templates.payment_receipt.subject }}
/>
</Space>
),

View File

@@ -50,7 +50,7 @@ export function PrintCenterItemComponent({
name: item.key,
variables: { id: id },
},
{ to: context.job && context.job.ownr_ea },
{ to: context.job && context.job.ownr_ea, subject: item.subject },
"e"
);
}}

View File

@@ -201,14 +201,7 @@ export const TemplateList = (type, context) => {
description: "Parts Order",
key: "parts_order",
subject: `${bodyshop && bodyshop.shopname} Parts Order ${
(context &&
context &&
context.job &&
context.job &&
context &&
context.job &&
context.job.ro_number) ||
""
(context && context.job && context.job.ro_number) || ""
}`,
disabled: false,
},