diff --git a/handlers/corporate/mcudetail/tabkeuangan.handlers.go b/handlers/corporate/mcudetail/tabkeuangan.handlers.go new file mode 100644 index 0000000..f419f93 --- /dev/null +++ b/handlers/corporate/mcudetail/tabkeuangan.handlers.go @@ -0,0 +1,124 @@ +package mcu_corporate_handlers + +import ( + "cpone/component/pagination" + "cpone/models" + "cpone/utils" + corporate_mcudetail "cpone/views/corporate/mcu/mcutab" + "strconv" + + "github.com/labstack/echo/v4" + "go.uber.org/zap" +) + +type TabKeuanganServices interface { + GetTotalOrderKeuangan(mcuID string) (float64, error) + GetTotalCardData(mcuID string) (models.TotalBillCard, error) + GetListingDataKeuangan(mcuID string, currentpage int, rowperpage int) ([]models.KeuanganModel, int, error) +} + +type TabKeuanganHandler struct { + TabKeuanganServices TabKeuanganServices +} + +func NewTabKeuanganHandler(tk TabKeuanganServices) *TabKeuanganHandler { + return &TabKeuanganHandler{ + TabKeuanganServices: tk, + } +} + +func (tk *TabKeuanganHandler) HandleShowTabKeuangan(c echo.Context) error { + logger, _ := zap.NewProduction() + logger.Info("handler keuangan") + tableID := utils.GenerateRandomID("tableID") + paginationID := utils.GenerateRandomID("paginationID") + + id := c.Param("id") + logger.Info("Params", zap.Any("id", id)) + + dataTable, totalPage, err := tk.TabKeuanganServices.GetListingDataKeuangan(id, 1, 10) + if err != nil { + defer logger.Sync() + logger.Info("error get list data keuangan", zap.Any("error", err)) + return err + } + + tablecompo := corporate_mcudetail.TableKeuangan(dataTable, tableID) + + pagination := pagination.PaginationV3( + totalPage, + 1, + "/corp/dashboard_pic/detail/"+id+"/tabkeuangan/changepage", + paginationID, + "#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent", + "#tabdanpagi", + "outerHTML", "", "", + corporate_mcudetail.BeforeRequestContent(), + corporate_mcudetail.AfterRequestContent(), + ) + + totalOrder, err := tk.TabKeuanganServices.GetTotalOrderKeuangan(id) + if err != nil { + defer logger.Sync() + logger.Info("error get total order keuangan", zap.Any("error", err)) + return err + } + + totalBill, err := tk.TabKeuanganServices.GetTotalCardData(id) + if err != nil { + defer logger.Sync() + logger.Info("error get total bill keuangan", zap.Any("error", err)) + return err + } + + content := corporate_mcudetail.TabKeuanganScreen( + tableID, + paginationID, + corporate_mcudetail.KeuanganCard( + strconv.FormatFloat(totalOrder, 'f', 0, 64), + strconv.FormatFloat(totalBill.TotalTagihan, 'f', 0, 64), + strconv.FormatFloat(totalBill.TotalPelunasan, 'f', 0, 64), + strconv.FormatFloat(totalBill.TotalHutang, 'f', 0, 64), + ), + corporate_mcudetail.TableAndPagination( + tablecompo, + pagination, + ), + ) + + return utils.View(c, content) +} + +func (tk *TabKeuanganHandler) HandleChangePage(c echo.Context) error { + pageparam := c.QueryParam("page") + tableID := c.QueryParam("tableID") + paginationID := c.QueryParam("paginationID") + + id := c.Param("id") + + page, err := strconv.Atoi(pageparam) + if err != nil { + return err + } + + tableData, totalPage, err := tk.TabKeuanganServices.GetListingDataKeuangan(id, page, 10) + if err != nil { + return err + } + + tablecomp := corporate_mcudetail.TableKeuangan(tableData, tableID) + pagination := pagination.PaginationV3( + totalPage, + page, + "/corp/dashboard_pic/detail/"+id+"/tabkeuangan/changepage", + paginationID, + "#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent", + "#tabdanpagi", + "outerHTML", "", "", + corporate_mcudetail.BeforeRequestContent(), + corporate_mcudetail.AfterRequestContent(), + ) + + tabdanpagi := corporate_mcudetail.TableAndPagination(tablecomp, pagination) + return utils.View(c, tabdanpagi) +} diff --git a/handlers/routes.go b/handlers/routes.go index a3b0f4c..e12204d 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -131,6 +131,11 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/changepage", daftarpesertaHandl.HandlePagination) corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openreport", daftarpesertaHandl.HandleOpenReportDialog) + keuanganService := mcu_corporate_services.NewTabKeuanganServices(appStore) + keuanganHandler := mcu_corporate_handlers.NewTabKeuanganHandler(keuanganService) + corp.GET("/dashboard_pic/detail/:id/tabkeuangan", keuanganHandler.HandleShowTabKeuangan) + corp.GET("/dashboard_pic/detail/:id/tabkeuangan/changepage", keuanganHandler.HandleChangePage) + patienServices := corporate_services.NewPatientServices(appStore) patientHandler := corporate_handlers.NewPatientHandler(patienServices) corp.GET("/dashboard_pat", patientHandler.HandleShowPatient) diff --git a/models/keuangan.models.go b/models/keuangan.models.go index 42b9c60..c61ac67 100644 --- a/models/keuangan.models.go +++ b/models/keuangan.models.go @@ -1,8 +1,34 @@ package models type KeuanganModel struct { - TotalOrder string - TotalTagihan string - TotalPelunasan string - TotalHutang string + F_BillID int `db:"F_BillID"` + F_BillNo string `db:"F_BillNo"` + F_BillCorporateID int `db:"F_BillCorporateID"` + F_BillDueDate string `db:"F_BillDueDate"` + F_BillTotal float64 `db:"F_BillTotal"` + F_BillUnpaid float64 `db:"F_BillUnpaid"` + F_BillCreated string `db:"F_BillCreated"` + BillPayment []BillPaymentModel + TotalBillPayment float64 +} + +type BillPaymentModel struct { + F_BillPaymentID int `db:"F_BillPaymentID"` + F_BillPaymentF_BillID int `db:"F_BillPaymentF_BillID"` + F_BillPaymentDate string `db:"F_BillPaymentDate"` + F_BillPaymentNumber string `db:"F_BillPaymentNumber"` + F_BillPaymentAmount float64 `db:"F_BillPaymentAmount"` +} + +type TotalOrderHeader struct { + T_OrderHeaderID int `db:"T_OrderHeaderID"` + T_OrderHeaderCorporateID int `db:"T_OrderHeaderCorporateID"` + T_OrderHeaderTotal float64 `db:"T_OrderHeaderTotal"` + T_OrderHeaderCreated string `db:"T_OrderHeaderCreated"` +} + +type TotalBillCard struct { + TotalTagihan float64 + TotalPelunasan float64 + TotalHutang float64 } diff --git a/services/corporate/mcudetail/tabkeuangan.services.go b/services/corporate/mcudetail/tabkeuangan.services.go new file mode 100644 index 0000000..bc4e2aa --- /dev/null +++ b/services/corporate/mcudetail/tabkeuangan.services.go @@ -0,0 +1,198 @@ +package mcu_corporate_services + +import ( + "cpone/db" + "cpone/models" + dbx "cpone/package/database" + "fmt" + "math" + + "go.uber.org/zap" +) + +type TabKeuanganServices struct { + TabKeuanganStore db.AppStore +} + +func NewTabKeuanganServices(uStore db.AppStore) *TabKeuanganServices { + return &TabKeuanganServices{ + TabKeuanganStore: uStore, + } +} + +func (tks *TabKeuanganServices) GetTotalOrderKeuangan(mcuID string) (float64, error) { + logger, _ := zap.NewProduction() + var mcu models.DashboardPic + ret := 0.00 + var data []models.TotalOrderHeader + + q := ` + SELECT + Mgm_McuID, + Mgm_McuLabel, + Mgm_McuCorporateID, + Mgm_McuIsActive + FROM mgm_mcu + WHERE Mgm_McuIsActive = 'Y' + AND Mgm_McuID = ? + ` + if err := dbx.Handlex.Get(&mcu, q, mcuID); err != nil { + defer logger.Sync() + logger.Info("error get corportate id", zap.Any("mcuID", mcuID)) + return ret, fmt.Errorf("error get corporate id: %v", err) + } + + q = ` + SELECT + T_OrderHeaderID, + T_OrderHeaderCorporateID, + T_OrderHeaderTotal, + T_OrderHeaderCreated + FROM t_orderheader + WHERE T_OrderHeaderIsActive = 'Y' + AND T_OrderHeaderCorporateID = ? + ` + if err := dbx.Handlex.Select(&data, q, mcu.Mgm_McuCorporateID); err != nil { + defer logger.Sync() + logger.Info("error get orderheader data by corp id", zap.Any("corpID", mcu.Mgm_McuCorporateID)) + return ret, fmt.Errorf("error get orderheader data by corp id: %v", err) + } + + for _, d := range data { + ret = ret + d.T_OrderHeaderTotal + } + + return ret, nil +} + +func (tks *TabKeuanganServices) GetTotalCardData(mcuID string) (models.TotalBillCard, error) { + logger, _ := zap.NewProduction() + var ret models.TotalBillCard + var mcu models.DashboardPic + var uang []models.KeuanganModel + + q := ` + SELECT + Mgm_McuID, + Mgm_McuLabel, + Mgm_McuCorporateID, + Mgm_McuIsActive + FROM mgm_mcu + WHERE Mgm_McuIsActive = 'Y' + AND Mgm_McuID = ? + ` + if err := dbx.Handlex.Get(&mcu, q, mcuID); err != nil { + defer logger.Sync() + logger.Info("error get corportate id", zap.Any("mcuID", mcuID)) + return ret, fmt.Errorf("error get corporate id: %v", err) + } + + q = ` + SELECT + fb.F_BillID, + fb.F_BillNo, + fb.F_BillCorporateID, + DATE_FORMAT(fb.F_BillDueDate, '%e %M %Y') AS F_BillDueDate, + fb.F_BillTotal, + fb.F_BillUnpaid, + DATE_FORMAT(fb.F_BillCreated, '%e %M %Y') AS F_BillCreated + FROM f_bill fb + WHERE fb.F_BillIsActive = 'Y' + AND fb.F_BillCorporateID = ? + ` + + if err := dbx.Handlex.Select(&uang, q, mcu.Mgm_McuCorporateID); err != nil { + defer logger.Sync() + logger.Error("Error Get List Bill Data", zap.Any("corpID", mcu.Mgm_McuCorporateID)) + return ret, fmt.Errorf("error query database: %v", err) + } + + for _, bill := range uang { + ret.TotalTagihan = ret.TotalTagihan + bill.F_BillTotal + ret.TotalHutang = ret.TotalHutang + bill.F_BillUnpaid + } + ret.TotalPelunasan = ret.TotalTagihan - ret.TotalHutang + + return ret, nil +} + +func (tks *TabKeuanganServices) GetListingDataKeuangan(mcuID string, currentpage int, rowperpage int) ([]models.KeuanganModel, int, error) { + logger, _ := zap.NewProduction() + var ret []models.KeuanganModel + var totalData int + var mcu models.DashboardPic + + q := ` + SELECT + Mgm_McuID, + Mgm_McuLabel, + Mgm_McuCorporateID, + Mgm_McuIsActive + FROM mgm_mcu + WHERE Mgm_McuIsActive = 'Y' + AND Mgm_McuID = ? + ` + if err := dbx.Handlex.Get(&mcu, q, mcuID); err != nil { + defer logger.Sync() + logger.Info("error get corportate id", zap.Any("mcuID", mcuID)) + return ret, 0, fmt.Errorf("error get corporate id: %v", err) + } + + offset := (currentpage - 1) * rowperpage + querytotal := ` + SELECT COUNT(*) + FROM f_bill + WHERE F_BillIsActive = 'Y' AND F_BillCorporateID = ? + ` + if err := dbx.Handlex.Get(&totalData, querytotal, mcu.Mgm_McuCorporateID); err != nil { + return nil, 0, fmt.Errorf("error query get total data: %v", err) + } + + q = ` + SELECT + fb.F_BillID, + fb.F_BillNo, + fb.F_BillCorporateID, + DATE_FORMAT(fb.F_BillDueDate, '%e %M %Y') AS F_BillDueDate, + fb.F_BillTotal, + fb.F_BillUnpaid, + DATE_FORMAT(fb.F_BillCreated, '%e %M %Y') AS F_BillCreated + FROM f_bill fb + WHERE fb.F_BillIsActive = 'Y' + AND fb.F_BillCorporateID = ? + LIMIT ? OFFSET ? + ` + + if err := dbx.Handlex.Select(&ret, q, mcu.Mgm_McuCorporateID, rowperpage, offset); err != nil { + defer logger.Sync() + logger.Error("Error Get List Bill Data", zap.Any("corpID", mcu.Mgm_McuCorporateID)) + return ret, 0, fmt.Errorf("error query database: %v", err) + } + + for idx, data := range ret { + var paym []models.BillPaymentModel + + q := ` + SELECT + F_BillPaymentID, + F_BillPaymentF_BillID, + DATE_FORMAT(F_BillPaymentDate, '%e %M %Y') AS F_BillPaymentDate, + F_BillPaymentNumber, + F_BillPaymentAmount + FROM f_bill_payment + WHERE F_BillPaymentIsActive = 'Y' + AND F_BillPaymentF_BillID = ? + ` + if err := dbx.Handlex.Select(&paym, q, data.F_BillID); err != nil { + defer logger.Sync() + logger.Error("Error Get List Payment Data", zap.Any("billID", data.F_BillID)) + return ret, 0, fmt.Errorf("error query database: %v", err) + } + + ret[idx].BillPayment = append(ret[idx].BillPayment, paym...) + ret[idx].TotalBillPayment = data.F_BillTotal - data.F_BillUnpaid + } + + totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage))) + return ret, totalPage, nil +} diff --git a/views/corporate/mcu/mcutab/tabkeuangan.templ b/views/corporate/mcu/mcutab/tabkeuangan.templ index b16d58f..643c680 100644 --- a/views/corporate/mcu/mcutab/tabkeuangan.templ +++ b/views/corporate/mcu/mcutab/tabkeuangan.templ @@ -1,21 +1,31 @@ package corporate_mcudetail -// import "cpone/component/customtextfield" -// import "cpone/models" +import "cpone/component/customtextfield" +import "cpone/models" -templ TabKeuangan( - // tableID string, +templ TabKeuanganScreen( + tableID string, + paginationID string, + totalcardcomponent templ.Component, + tableandpagination templ.Component, ) {
- // @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID", - // Name: "tableID", - // Type: "hidden", - // Value: tableID, - // }) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID", + Name: "tableID", + Type: "hidden", + Value: tableID, + }) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID", + Name: "paginationID", + Type: "hidden", + Value: paginationID, + })

Keuangan

+ @totalcardcomponent + @tableandpagination
Loading.... @@ -24,4 +34,46 @@ templ TabKeuangan(
+} + +templ KeuanganCard( + totalOrder string, + totalTagihan string, + totalPelunasan string, + totalHutang string, +) { +
+
+
+
+

Order

+

{ totalOrder }

+
+
+
+
+
+
+

Tagihan

+

{ totalTagihan }

+
+
+
+
+
+
+

Pelunasan

+

{ totalPelunasan }

+
+
+
+
+
+
+

Hutang

+

{ totalHutang }

+
+
+
+
} \ No newline at end of file diff --git a/views/corporate/mcu/mcutab/tabkeuangan_templ.go b/views/corporate/mcu/mcutab/tabkeuangan_templ.go index 4589602..ae39a40 100644 --- a/views/corporate/mcu/mcutab/tabkeuangan_templ.go +++ b/views/corporate/mcu/mcutab/tabkeuangan_templ.go @@ -10,10 +10,14 @@ import "context" import "io" import "bytes" -// import "cpone/component/customtextfield" -// import "cpone/models" -func TabKeuangan( -// tableID string, +import "cpone/component/customtextfield" +import "cpone/models" + +func TabKeuanganScreen( + tableID string, + paginationID string, + totalcardcomponent templ.Component, + tableandpagination templ.Component, ) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) @@ -27,7 +31,120 @@ func TabKeuangan( templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Keuangan

Loading....
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID", + Name: "tableID", + Type: "hidden", + Value: tableID, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID", + Name: "paginationID", + Type: "hidden", + Value: paginationID, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Keuangan

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = totalcardcomponent.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = tableandpagination.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading....
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func KeuanganCard( + totalOrder string, + totalTagihan string, + totalPelunasan string, + totalHutang string, +) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Order

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(totalOrder) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkeuangan.templ`, Line: 50, Col: 76} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Tagihan

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(totalTagihan) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkeuangan.templ`, Line: 58, Col: 78} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Pelunasan

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(totalPelunasan) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkeuangan.templ`, Line: 66, Col: 80} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Hutang

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(totalHutang) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkeuangan.templ`, Line: 74, Col: 77} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/corporate/mcu/mcutab/tablekeuangan.templ b/views/corporate/mcu/mcutab/tablekeuangan.templ index 0a5176d..5430917 100644 --- a/views/corporate/mcu/mcutab/tablekeuangan.templ +++ b/views/corporate/mcu/mcutab/tablekeuangan.templ @@ -1,20 +1,109 @@ package corporate_mcudetail -// import "cpone/models" +import "cpone/models" +import "strconv" + +templ TableAndPagination( + tablecomponent templ.Component, + paginationcomp templ.Component, +) { +
+ @tablecomponent + @paginationcomp +
+} templ TableKeuangan( - // data []models.KeuanganModel, - // tableID string, + data []models.KeuanganModel, + tableID string, ) { -
- +
+
- - - + + + + + + + + + + + + @RowKeuangan(data) +
TagihanPelunasanSisa

TAGIHAN

PELUNASAN

SISA

No/TglTgl Jatuh TempoJumlahNo/TglJumlah
+} + +// note +// row pelunasan -> row tagihan rowspan=len(tab pelunasan) +// row sisa ikut ke row pertama tagihan + +templ RowKeuangan( + data []models.KeuanganModel, +) { + if len(data) == 0 { + + Data Tidak Ditemukan + + } + for _, v := range data { + if len(v.BillPayment) == 0 { + + +
{ v.F_BillNo }
+
{ v.F_BillCreated }
+ + { v.F_BillDueDate } + { strconv.FormatFloat(v.F_BillTotal, 'f', 0, 64) } + - + - + { strconv.FormatFloat(v.F_BillUnpaid, 'f', 0, 64) } + + } else if len(v.BillPayment) == 1 { + + +
{ v.F_BillNo }
+
{ v.F_BillCreated }
+ + { v.F_BillDueDate } + { strconv.FormatFloat(v.F_BillTotal, 'f', 0, 64) } + +
{ v.BillPayment[0].F_BillPaymentNumber }
+
{ v.BillPayment[0].F_BillPaymentDate }
+ + { strconv.FormatFloat(v.BillPayment[0].F_BillPaymentAmount, 'f', 0, 64) } + { strconv.FormatFloat(v.F_BillUnpaid, 'f', 0, 64) } + + } else { + + +
{ v.F_BillNo }
+
{ v.F_BillCreated }
+ + { v.F_BillDueDate } + { strconv.FormatFloat(v.F_BillTotal, 'f', 0, 64) } + +
{ v.BillPayment[0].F_BillPaymentNumber }
+
{ v.BillPayment[0].F_BillPaymentDate }
+ + { strconv.FormatFloat(v.BillPayment[0].F_BillPaymentAmount, 'f', 0, 64) } + { strconv.FormatFloat(v.F_BillUnpaid, 'f', 0, 64) } + + for i := 1; i < len(v.BillPayment); i++ { + + +
{ v.BillPayment[i].F_BillPaymentNumber }
+
{ v.BillPayment[i].F_BillPaymentDate }
+ + { strconv.FormatFloat(v.BillPayment[i].F_BillPaymentAmount, 'f', 0, 64) } + + } + } + } } \ No newline at end of file diff --git a/views/corporate/mcu/mcutab/tablekeuangan_templ.go b/views/corporate/mcu/mcutab/tablekeuangan_templ.go index dd3f08a..a8b42ca 100644 --- a/views/corporate/mcu/mcutab/tablekeuangan_templ.go +++ b/views/corporate/mcu/mcutab/tablekeuangan_templ.go @@ -10,10 +10,12 @@ import "context" import "io" import "bytes" -// import "cpone/models" -func TableKeuangan( -// data []models.KeuanganModel, -// tableID string, +import "cpone/models" +import "strconv" + +func TableAndPagination( + tablecomponent templ.Component, + paginationcomp templ.Component, ) templ.Component { return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) @@ -27,7 +29,32 @@ func TableKeuangan( templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
TagihanPelunasanSisa
") + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, AfterRequestContent()) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = tablecomponent.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = paginationcomp.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -37,3 +64,522 @@ func TableKeuangan( return templ_7745c5c3_Err }) } + +func TableKeuangan( + data []models.KeuanganModel, + tableID string, +) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = RowKeuangan(data).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

TAGIHAN

PELUNASAN

SISA

No/TglTgl Jatuh TempoJumlahNo/TglJumlah
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +// note +// row pelunasan -> row tagihan rowspan=len(tab pelunasan) +// row sisa ikut ke row pertama tagihan +func RowKeuangan( + data []models.KeuanganModel, +) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if len(data) == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Data Tidak Ditemukan") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + for _, v := range data { + if len(v.BillPayment) == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillNo) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 59, Col: 37} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillCreated) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 60, Col: 42} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillDueDate) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 62, Col: 57} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.F_BillTotal, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 63, Col: 88} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("--") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.F_BillUnpaid, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 66, Col: 89} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if len(v.BillPayment) == 1 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillNo) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 71, Col: 37} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillCreated) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 72, Col: 42} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillDueDate) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 74, Col: 102} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var17 string + templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.F_BillTotal, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 75, Col: 133} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var18 string + templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[0].F_BillPaymentNumber) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 77, Col: 63} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var19 string + templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[0].F_BillPaymentDate) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 78, Col: 61} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var20 string + templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.BillPayment[0].F_BillPaymentAmount, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 80, Col: 111} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var22 string + templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.F_BillUnpaid, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 81, Col: 134} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var24 string + templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillNo) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 86, Col: 37} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var25 string + templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillCreated) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 87, Col: 42} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var27 string + templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillDueDate) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 89, Col: 102} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var29 string + templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.F_BillTotal, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 90, Col: 133} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var30 string + templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[0].F_BillPaymentNumber) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 92, Col: 63} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var31 string + templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[0].F_BillPaymentDate) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 93, Col: 61} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var32 string + templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.BillPayment[0].F_BillPaymentAmount, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 95, Col: 111} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var34 string + templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.F_BillUnpaid, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 96, Col: 134} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for i := 1; i < len(v.BillPayment); i++ { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var35 string + templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[i].F_BillPaymentNumber) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 101, Col: 67} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var36 string + templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[i].F_BillPaymentDate) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 102, Col: 65} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var37 string + templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatFloat(v.BillPayment[i].F_BillPaymentAmount, 'f', 0, 64)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tablekeuangan.templ`, Line: 104, Col: 115} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + } + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/corporate/mcu/mcutabview.templ b/views/corporate/mcu/mcutabview.templ index fa39cab..e540979 100644 --- a/views/corporate/mcu/mcutabview.templ +++ b/views/corporate/mcu/mcutabview.templ @@ -30,7 +30,7 @@ templ TabViewMcuDetail( Executive Summary
@@ -63,7 +63,6 @@ templ TabViewMcuDetail(
- Soon....
diff --git a/views/corporate/mcu/mcutabview_templ.go b/views/corporate/mcu/mcutabview_templ.go index 146f0bf..f649d2b 100644 --- a/views/corporate/mcu/mcutabview_templ.go +++ b/views/corporate/mcu/mcutabview_templ.go @@ -51,16 +51,29 @@ func TabViewMcuDetail( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"#tabdaftarpeserta\">Daftar Peserta
  • Executive Summary
  • Keuangan
  • Daftar Peserta
  • Executive Summary
  • Keuangan
  • Soon....\r
    ") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\">
    ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }