diff --git a/src/app/_layout/footer/footer.component.html b/src/app/_layout/footer/footer.component.html index 49b2ea5..c76e469 100644 --- a/src/app/_layout/footer/footer.component.html +++ b/src/app/_layout/footer/footer.component.html @@ -13,7 +13,7 @@ href="https://allbestsistem.com/" target="_blank" style="background-color: #000000 !important;" - >Smart Building Management Systems (V@2024-06-28.01) + >Smart Building Management Systems (V@2024-06-28.02)

diff --git a/src/app/_services/tableexcel.service.ts b/src/app/_services/tableexcel.service.ts index 64c9a39..ce75892 100644 --- a/src/app/_services/tableexcel.service.ts +++ b/src/app/_services/tableexcel.service.ts @@ -98,11 +98,17 @@ export class TableexcelService { }); return filteredItem; }); - + // Calculate totals for estimation_cost and total_use - const totalEstimationCost = filteredJson.reduce((sum, item) => sum + (item['estimation_cost'] || 0), 0); - const totalUse = filteredJson.reduce((sum, item) => sum + (item['total_use'] || 0), 0); - + const totalEstimationCost = filteredJson.reduce( + (sum, item) => sum + (item["estimation_cost"] || 0), + 0 + ); + const totalUse = filteredJson.reduce( + (sum, item) => sum + (item["total_use"] || 0), + 0 + ); + // Create the worksheet const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(filteredJson); const columnWidths = [ @@ -114,7 +120,7 @@ export class TableexcelService { { wch: 30 }, ]; worksheet["!cols"] = columnWidths; - + // Add header const header = [ "Building", @@ -125,7 +131,7 @@ export class TableexcelService { "Date", ]; XLSX.utils.sheet_add_aoa(worksheet, [header]); - + // Add totals row const totalsRow = [ "Totals", @@ -133,21 +139,73 @@ export class TableexcelService { "", `Total: ${totalUse} Kwh`, `Total: ${totalEstimationCost}`, - "" + "", ]; XLSX.utils.sheet_add_aoa(worksheet, [totalsRow], { origin: -1 }); - + // Create the workbook const workbook: XLSX.WorkBook = { Sheets: { data: worksheet }, SheetNames: ["data"], }; - + // Write the workbook and save it const excelBuffer: any = XLSX.write(workbook, { bookType: "xlsx", type: "array", }); this.saveAsExcelFile(excelBuffer, excelFileName); - } + } + + public exportAsExcelFileManageDetail( + json: any[], + excelFileName: string, + columns: string[] + ): void { + const filteredJson = json.map((item) => { + const filteredItem = {}; + columns.forEach((column) => { + filteredItem[column] = item[column]; + }); + return filteredItem; + }); + + const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(filteredJson); + const columnWidths = [ + { wch: 40 }, + { wch: 30 }, + { wch: 30 }, + { wch: 20 }, + { wch: 20 }, + { wch: 20 }, + { wch: 20 }, + { wch: 20 }, + { wch: 30 }, + ]; + worksheet["!cols"] = columnWidths; + + const header = [ + "Device", + "Room", + "Category", + "Estimation Cost", + "Total Kwh", + "Watt", + "Duration", + "Price Kwh", + "Periode", + ]; + XLSX.utils.sheet_add_aoa(worksheet, [header]); + + const workbook: XLSX.WorkBook = { + Sheets: { data: worksheet }, + SheetNames: ["data"], + }; + + const excelBuffer: any = XLSX.write(workbook, { + bookType: "xlsx", + type: "array", + }); + this.saveAsExcelFile(excelBuffer, excelFileName); + } } diff --git a/src/app/content/hemat-app/cost-management/cost-management.component.css b/src/app/content/hemat-app/cost-management/cost-management.component.css index 3b51239..a99d931 100644 --- a/src/app/content/hemat-app/cost-management/cost-management.component.css +++ b/src/app/content/hemat-app/cost-management/cost-management.component.css @@ -417,3 +417,8 @@ input[type="month"]::-webkit-calendar-picker-indicator { background-color: #1a1a1a; /* Darker black for hover effect */ } +.modal-open .content { + filter: blur(5px); + transition: filter 0.3s ease-in-out; +} + diff --git a/src/app/content/hemat-app/cost-management/cost-management.component.ts b/src/app/content/hemat-app/cost-management/cost-management.component.ts index 109c61e..9d36b8a 100644 --- a/src/app/content/hemat-app/cost-management/cost-management.component.ts +++ b/src/app/content/hemat-app/cost-management/cost-management.component.ts @@ -97,6 +97,8 @@ export class CostManagementComponent implements OnInit { totalUse: item.total_use, endDate: item.end_date, statusId: item.status_id, + categoryId: item.category_id, + roomId: item.room_id, })); }); } diff --git a/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.css b/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.css index 10cac6b..d4aff3e 100644 --- a/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.css +++ b/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.css @@ -1,3 +1,419 @@ +:host ::ng-deep .progress-bar { + background-color: #bef264 !important; +} + +:host ::ng-deep .donut-chart2 .ct-series-a .ct-slice-donut { + stroke: #8a8a8a; + stroke-width: 20px !important; +} + +:host ::ng-deep .donut-chart2 .ct-series-b .ct-slice-donut { + stroke: #bef264; + stroke-width: 20px !important; +} + +:host ::ng-deep .donut-chart2 .ct-label { + fill: #ffffff; + color: rgb(255, 255, 255); + font-size: 12px; + line-height: 1; +} + +:host ::ng-deep .sp-line-total-cost .ct-series-a .ct-point { + stroke: #bef264; +} + +:host ::ng-deep .sp-line-total-cost .ct-series-a .ct-line { + stroke: #bef264; +} + +:host ::ng-deep .sp-line-total-cost .ct-series-a .ct-area { + fill: #bef264; + fill-opacity: 1; +} + +:host ::ng-deep .sp-line-total-cost .ct-point { + stroke-width: 0px; +} + +.ct-chart-bar .ct-series .ct-bar { + stroke-width: 20px !important; /* Atur lebar bar sesuai kebutuhan */ +} + +.ct-chart-bar .ct-label.ct-horizontal { + margin-left: -10px !important; /* Mengatur margin label horizontal */ + margin-right: -10px !important; +} + +:host ::ng-deep .donut-chart3 .ct-series-a .ct-bar { + stroke: #bef264; + fill: none; + stroke-width: 30px; +} + +:host ::ng-deep .donut-chart3 .ct-series-b .ct-bar { + stroke: #bef264; + fill: none; + stroke-width: 30px; +} + +:host ::ng-deep .donut-chart3 .ct-label { + fill: #ffffff; + color: rgb(255, 255, 255); + font-size: 12px; + line-height: 1; + margin-right: 20px; +} + +:host ::ng-deep .ct-label.ct-horizontal { + font-size: 12px; /* Adjust font size */ + transform: rotate(-45deg); /* Rotate labels if needed for better fit */ + text-anchor: end; + margin-top: 10px; +} + +:host ::ng-deep .ct-chart-bar .ct-labels .ct-label.ct-horizontal { + margin-right: 20px; /* Adjust margin for labels */ +} + +.chart-title { + font-size: 18px; + margin-bottom: 10px; + font-weight: bold; +} + +/* Hide the default calendar icon */ +input[type="month"]::-webkit-calendar-picker-indicator { + background-color: #ffffff; +} + +/* table */ +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-header + .datatable-header-cell + .datatable-header-cell-label { + font-family: inherit; + font-size: medium; + font-weight: bold; + color: #6b6f82; +} +:host ::ng-deep .ngx-datatable .datatable-row-center, +.ngx-datatable .datatable-row-group, +.ngx-datatable .datatable-row-right { + position: relative; + height: 50px !important; +} + +:host ::ng-deep .datatable-icon-right:before { + font-family: "icofont"; + font-style: normal; +} + +:host ::ng-deep .datatable-icon-skip:before { + font-family: "icofont"; + font-style: normal; +} + +:host ::ng-deep .datatable-icon-left:before { + font-family: "icofont"; + font-style: normal; +} + +:host ::ng-deep .datatable-icon-left:before { + content: "\2039"; + font-size: x-large; +} + +:host ::ng-deep .datatable-icon-prev:before { + content: "\00AB"; + font-size: x-large; +} + +:host ::ng-deep .datatable-icon-right:before { + content: "\203A"; + font-size: x-large; +} + +:host ::ng-deep .datatable-icon-skip:before { + content: "\00BB"; + font-size: x-large; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-left, +.ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-right, +.ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-prev { + font-size: 16px; + line-height: 22px; + padding: 0px 09px; + background-color: #d4d2e7; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-right, +.ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-right { + font-size: 16px; + line-height: 22px; + padding: 0px 09px; + background-color: #d4d2e7; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-skip { + font-size: 16px; + line-height: 22px; + padding: 0px 09px; + background-color: #d4d2e7; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-prev { + font-size: 16px; + line-height: 22px; + padding: 0px 09px; + background-color: #d4d2e7; +} + +:host + ::ng-deep + .datatable-footer + .datatable-pager + ul + li:not(.disabled).active + a, +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + ul[_ngcontent-c11] + li[_ngcontent-c11]:not(.disabled):hover + a[_ngcontent-c11] { + background-color: #d4d2e7; + font-weight: bold; + font-size: larger; +} + +:host ::ng-deep .ngx-datatable.bootstrap .datatable-footer .datatable-pager a { + height: 32px; + min-width: 34px; + line-height: 22px; + padding: 0; + border-radius: 3px; + margin: 0 3px; + text-align: center; + vertical-align: top; + padding-top: 3px; + text-decoration: none; + vertical-align: bottom; + color: #7c8091; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-left, +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-right[_ngcontent-c11], +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-prev[_ngcontent-c11] { + font-size: 14px; + line-height: 9px; + padding: 0px 08px; + background-color: #ffffff; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-left, +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-right[_ngcontent-c11], +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-prev[_ngcontent-c11] { + font-size: 0px; + line-height: 22px; + padding: 0px 09px; + background-color: #ffffff; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-right, +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-right[_ngcontent-c11], +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-prev[_ngcontent-c11] { + font-size: 0px; + line-height: 22px; + padding: 0px 09px; + background-color: #ffffff; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-skip, +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-right[_ngcontent-c11], +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-prev[_ngcontent-c11] { + font-size: 0px; + line-height: 22px; + padding: 0px 09px; + background-color: #ffffff; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + .datatable-icon-prev, +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-right[_ngcontent-c11], +.ngx-datatable.bootstrap[_ngcontent-c11] + .datatable-footer[_ngcontent-c11] + .datatable-pager[_ngcontent-c11] + .datatable-icon-prev[_ngcontent-c11] { + font-size: 0px; + line-height: 22px; + padding: 0px 09px; + background-color: #ffffff; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + ul + li:not(.disabled):hover + a { + background-color: #545454; + font-weight: bold; + color: white; +} + +:host + ::ng-deep + .ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + ul + li:not(.disabled).active + a, +.ngx-datatable.bootstrap + .datatable-footer + .datatable-pager + ul + li:not(.disabled):hover + a { + background-color: #252525; + font-weight: bold; + color: white; +} + +:host ::ng-deep .ngx-datatable.bootstrap .datatable-footer { + background: #252525; + color: #ededed; + margin-top: -1px; + overflow: inherit; +} + +:host ::ng-deep .ngx-datatable.bootstrap .datatable-header { + font-weight: bold; + height: unset !important; + overflow: inherit; +} + +:host ::ng-deep .ngx-datatable .datatable-footer .datatable-pager { + flex: 0 0 0%; +} + +:host ::ng-deep .ngx-datatable .datatable-footer .datatable-pager .pager { + display: flex; +} + +:host + ::ng-deep + .ngx-datatable + .datatable-footer + .selected-count + .datatable-pager { + flex: 0 0 0%; +} + +:host ::ng-deep .ngx-datatable { + display: -webkit-box; +} + +:host ::ng-deep .ng-select .ng-select-container { + color: #ffffff !important; + background-color: #252525 !important; + height: 40px !important; +} + +:host ::ng-deep .ngx-datatable.bootstrap .datatable-body-row { + background-color: rgba(190, 242, 100, 0.11); /* Black color for table rows */ +} + +:host ::ng-deep .ngx-datatable.bootstrap .datatable-body-row:hover { + background-color: #1a1a1a; /* Darker black for hover effect */ +} + ::ng-deep .modal-backdrop.show { z-index: auto !important; } diff --git a/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.html b/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.html index f7d5727..dfdbbc0 100644 --- a/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.html +++ b/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.html @@ -1,7 +1,121 @@ -