diff --git a/Controllers/ApiController.cs b/Controllers/ApiController.cs index bf6c4019..dd12a107 100644 --- a/Controllers/ApiController.cs +++ b/Controllers/ApiController.cs @@ -139,15 +139,22 @@ namespace QuotationMaker.Controllers XSSFCellStyle copyTempCellStyle = (XSSFCellStyle)workbook.CreateCellStyle(); // Copy style from old cell and apply to new cell XSSFCellStyle copyTempCellFloatStyle = (XSSFCellStyle)workbook.CreateCellStyle(); - - + + XSSFCellStyle copyTempCellStyleRight = (XSSFCellStyle)workbook.CreateCellStyle(); + XSSFCellStyle copyTempCellFloatStyleRight = (XSSFCellStyle)workbook.CreateCellStyle(); //估價單總價項目 row = (XSSFRow)sheet.GetRow(11); copyTempCellStyle.CloneStyleFrom(row.Cells[6].CellStyle); copyTempCellFloatStyle.CloneStyleFrom(row.Cells[6].CellStyle); + copyTempCellStyleRight.CloneStyleFrom(row.Cells[6].CellStyle); + copyTempCellFloatStyleRight.CloneStyleFrom(row.Cells[6].CellStyle); + copyTempCellStyle.DataFormat = workbook.CreateDataFormat().GetFormat("#,##0"); copyTempCellFloatStyle.DataFormat = workbook.CreateDataFormat().GetFormat("#,##0.#"); + copyTempCellStyleRight.DataFormat = workbook.CreateDataFormat().GetFormat("#,##0"); + copyTempCellFloatStyleRight.DataFormat = workbook.CreateDataFormat().GetFormat("#,##0.#"); + copyTempCellStyle.BorderTop = BorderStyle.Thin; copyTempCellStyle.BorderRight = BorderStyle.Thin; copyTempCellStyle.BorderBottom = BorderStyle.Thin; @@ -156,6 +163,14 @@ namespace QuotationMaker.Controllers copyTempCellFloatStyle.BorderRight = BorderStyle.Thin; copyTempCellFloatStyle.BorderBottom = BorderStyle.Thin; copyTempCellFloatStyle.BorderLeft = BorderStyle.Thin; + copyTempCellStyleRight.BorderTop = BorderStyle.Thin; + copyTempCellStyleRight.BorderRight = BorderStyle.Medium; + copyTempCellStyleRight.BorderBottom = BorderStyle.Thin; + copyTempCellStyleRight.BorderLeft = BorderStyle.Thin; + copyTempCellFloatStyleRight.BorderTop = BorderStyle.Thin; + copyTempCellFloatStyleRight.BorderRight = BorderStyle.Medium; + copyTempCellFloatStyleRight.BorderBottom = BorderStyle.Thin; + copyTempCellFloatStyleRight.BorderLeft = BorderStyle.Thin; //copyTempCellFloatStyle.BorderDiagonalLineStyle= BorderStyle.None; @@ -163,10 +178,10 @@ namespace QuotationMaker.Controllers row.Cells[6].SetCellValue(objDetail.quotation_noTaxTotal); if (objDetail.quotation_noTaxTotal.ToString().IndexOf('.') >= 0) { - row.Cells[6].CellStyle = copyTempCellFloatStyle; + row.Cells[6].CellStyle = copyTempCellFloatStyleRight; } else { - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; } @@ -182,7 +197,7 @@ namespace QuotationMaker.Controllers - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; } else { row.Cells[6].SetCellValue(""); } @@ -197,11 +212,11 @@ namespace QuotationMaker.Controllers if (objDetail.quotation_tax.ToString().IndexOf('.') >= 0) { - row.Cells[6].CellStyle = copyTempCellFloatStyle; + row.Cells[6].CellStyle = copyTempCellFloatStyleRight; } else { - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; } //row.Cells[6].CellStyle = copyTempCellStyle; @@ -210,7 +225,7 @@ namespace QuotationMaker.Controllers //row.Cells[6].SetCellValue(row.Cells[6].StringCellValue.Replace("{quotation_grandTotal}", objDetail.quotation_grandTotal.ToString("###,###"))); row.Cells[6].SetCellType(CellType.Numeric); row.Cells[6].SetCellValue(objDetail.quotation_grandTotal); - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; //服務協議 string services_aggrement = objDetail.quotation_sa; @@ -223,13 +238,13 @@ namespace QuotationMaker.Controllers //付款方式與發票 string quotation_grandTotal = ChtNumConverter.ToChtNum((long)objDetail.quotation_grandTotal); - string quotation_grandTotalStr = "本專案費用總計新台幣"+ quotation_grandTotal + "圓整 (即NTD" + objDetail.quotation_grandTotal.ToString("###,###") + "含稅)"; + string quotation_grandTotalStr = "本專案費用總計新台幣"+ quotation_grandTotal + "元整 (即NTD $" + objDetail.quotation_grandTotal.ToString("###,###") + "整,含稅)"; row = (XSSFRow)sheet.GetRow(20); row.Cells[0].SetCellValue(quotation_grandTotalStr); //簽章欄 row = (XSSFRow)sheet.GetRow(27); - row.Cells[0].SetCellValue(row.Cells[0].StringCellValue.Replace("{user_name}", objDetail.user.user_name)); + row.Cells[3].SetCellValue(row.Cells[3].StringCellValue.Replace("{user_name}", objDetail.user.user_name)); //匯款項目與發票 int payment_count = objDetail.payments.Count; @@ -279,7 +294,7 @@ namespace QuotationMaker.Controllers //row.Cells[6].SetCellValue("$NT" + objDetail.invoices[i - 1].invoice_noTaxMoney.ToString("###,###")); row.Cells[6].SetCellType(CellType.Numeric); row.Cells[6].SetCellValue(objDetail.invoices[i - 1].invoice_noTaxMoney); - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; } } @@ -406,11 +421,11 @@ namespace QuotationMaker.Controllers if (objSub.quotationSubItem_subTotal.ToString().IndexOf('.') >= 0) { - row.Cells[6].CellStyle = copyTempCellFloatStyle; + row.Cells[6].CellStyle = copyTempCellFloatStyleRight; } else { - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; } //row.Cells[6].CellStyle = copyTempCellStyle; @@ -444,7 +459,7 @@ namespace QuotationMaker.Controllers //row.Cells[6].SetCellValue("NTD " + (objMain.quotationMainItem_subTotal - acTotal).ToString("###,###")); row.Cells[6].SetCellType(CellType.Numeric); row.Cells[6].SetCellValue((objMain.quotationMainItem_subTotal - acTotal)); - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; rowCount++; @@ -458,7 +473,7 @@ namespace QuotationMaker.Controllers //row.Cells[6].SetCellValue("NTD " + acTotal.ToString("###,###")); row.Cells[6].SetCellType(CellType.Numeric); row.Cells[6].SetCellValue(acTotal); - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; row.Cells[0].SetCellValue(row.Cells[0].StringCellValue.Replace("{quotationMainItem_ac}", objMain.quotationMainItem_ac.ToString())); rowCount++; @@ -479,7 +494,7 @@ namespace QuotationMaker.Controllers //row.Cells[6].SetCellValue("NTD " + (objMain.quotationMainItem_subTotal).ToString("###,###")); row.Cells[6].SetCellType(CellType.Numeric); row.Cells[6].SetCellValue(objMain.quotationMainItem_subTotal); - row.Cells[6].CellStyle = copyTempCellStyle; + row.Cells[6].CellStyle = copyTempCellStyleRight; row.ZeroHeight = true; rowCount++; editRowIndex++; diff --git a/Views/Home/ProjectList.cshtml b/Views/Home/ProjectList.cshtml index 7cedc0b1..fcc4b1e2 100644 --- a/Views/Home/ProjectList.cshtml +++ b/Views/Home/ProjectList.cshtml @@ -407,7 +407,7 @@
- +
diff --git a/wwwroot/logo/bremen_temp.xlsx b/wwwroot/logo/bremen_temp.xlsx index b3b1a3d5..37f1d7c8 100644 Binary files a/wwwroot/logo/bremen_temp.xlsx and b/wwwroot/logo/bremen_temp.xlsx differ diff --git a/wwwroot/logo/journeys_temp.xlsx b/wwwroot/logo/journeys_temp.xlsx index 5a28fcc3..0f7315d7 100644 Binary files a/wwwroot/logo/journeys_temp.xlsx and b/wwwroot/logo/journeys_temp.xlsx differ