This commit is contained in:
2026-07-27 18:22:22 +08:00
parent d823cedd3c
commit 35a0be701b
9 changed files with 66 additions and 9 deletions
+7 -3
View File
@@ -311,7 +311,8 @@ public class receiptController: ApiController
try
{
string templatePath = HttpContext.Current.Server.MapPath("~/rpt/sample/receipt_sample01.docx");
string sample = $"~/rpt/sample/receipt_sample{string.Format("{0:D2}",data.style_num)}.docx";
string templatePath = HttpContext.Current.Server.MapPath(sample);
if (!File.Exists(templatePath))
{
@@ -411,7 +412,7 @@ public class receiptController: ApiController
}
if (textNode.Text.Contains("$ReceiptDate"))
{
textNode.Text = textNode.Text.Replace("$ReceiptDate", data.receipt_date ?? "");
textNode.Text = textNode.Text.Replace("$ReceiptDate", data.details[i].receipt_date ?? "");
}
if (textNode.Text.Contains("$ReceiptTitle"))
{
@@ -429,7 +430,10 @@ public class receiptController: ApiController
{
textNode.Text = textNode.Text.Replace("$Caseofficer", data.details[i].caseofficer ?? "");
}
if (textNode.Text.Contains("$ReceiptItem"))
{
textNode.Text = textNode.Text.Replace("$ReceiptItem", data.details[i].receipt_item ?? "");
}
}
currentAnchor= body.InsertAfter(newTable, currentAnchor);