From ded55446279b5135f6cc362e45a1f110cb3499f0 Mon Sep 17 00:00:00 2001 From: Muthaiah Date: Sat, 21 Dec 2024 14:41:40 +0100 Subject: [PATCH] day 20 --- README.md | 2 +- aoc-day19/data.json | 76 ++++++++++++++++++++++++++++++++++++++++++++ aoc-day19/index.html | 54 +++++++++++++++++++++++++++++++ aoc-day19/index.js | 56 ++++++++++++++++++++++++++++++++ aoc-day20/index.html | 46 +++++++++++++++++++++++++++ aoc-day20/index.js | 25 +++++++++++++++ 6 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 aoc-day19/data.json create mode 100644 aoc-day19/index.html create mode 100644 aoc-day19/index.js create mode 100644 aoc-day20/index.html create mode 100644 aoc-day20/index.js diff --git a/README.md b/README.md index e31b242..060dfc0 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ * [Day 16 - CodeEditor](https://github.com/yogananda-muthaiah/adventofcode2024/tree/main/aoc-day16) * [Day 17 - UI5 WebComponents 2.0](https://github.com/yogananda-muthaiah/adventofcode2024/tree/main/aoc-day17) * [Day 18 - RangeSlider](https://github.com/yogananda-muthaiah/adventofcode2024/tree/main/aoc-day18) -* [Day 19 - ](https://github.com/yogananda-muthaiah/adventofcode2024/tree/main/aoc-day19) +* [Day 19 - Timelines](https://github.com/yogananda-muthaiah/adventofcode2024/tree/main/aoc-day19) * [Day 20 - ](https://github.com/yogananda-muthaiah/adventofcode2024/tree/main/aoc-day20) * [Day 21 - ](https://github.com/yogananda-muthaiah/adventofcode2024/tree/main/aoc-day21) ### Week 4 diff --git a/aoc-day19/data.json b/aoc-day19/data.json new file mode 100644 index 0000000..b42c5fb --- /dev/null +++ b/aoc-day19/data.json @@ -0,0 +1,76 @@ +{ + "Employees": [ + { + "Name": "Laurent Dubois", + "JobTitle": "Accounts Payables Manager", + "Photo": "/images/Laurent_Dubois.png", + "Icon": "sap-icon://activity-individual", + "JobResponsibilities": "Plans, organizes and manages the operations and activities of an accounts payables.\nSupervises employees and monitors activities.\nFinal check of accounts payable payments and sign off.\nReporting to the head of finance.\n\n\"I am a diligent person. I put great attention to detail.\"", + "HireDate": "Date(1371020400000)" + }, + { + "Name": "Sabine Mayer", + "JobTitle": "Configuration Expert", + "Photo": "/images/Sabine_Mayer.png", + "Icon": "sap-icon://settings", + "JobResponsibilities": "Implementing new Public Cloud ERP Financials system into his company and keeping it aligned with business.\nDuring the initial set-up of an ERP system: Customizing Financial Accounting settings such as organizational structures, chart of accounts, and tax configuration (as part of implementation projects).\nDuring the ongoing maintenance of the configuration: Adapting the configuration to organizational and process changes in business.\n\n\"I’m a versatile person. I keep the big picture in mind.\"", + "HireDate": "Date(1376290800000)" + }, + { + "Name": "Alain Chevalier", + "JobTitle": "Credit Analyst", + "Photo": "/images/Alain_Chevalier.png", + "Icon": "sap-icon://manager-insight", + "JobResponsibilities": "Responsible for a high number of accounts (ca. 4000 customers).\nMonitor the credit risk of his customers.\nFocus on changes in his customer’s credit situation.\nRecurring checks on a regular basis.\nDecide on credit blocked sales orders.\nDecide on credit limits for his customers (according the company’s credit policy).\n\n\"I almost always find a pragmatic solution, that’s acceptable for my customers and my company.\"", + "HireDate": "Date(1332403200000)" + }, + { + "Name": "Monique Legrand", + "JobTitle": "GL Accountant", + "Photo": "/images/Monique_Legrand.png", + "Icon": "sap-icon://account", + "JobResponsibilities": "Ensure and adjust correct structuring of company (e.g. chart of accounts, legal/management entities , profit centers etc. …).\nEnsure accuracy of financial data (profit center data).\nExplain financial data for both compliance and management purposes (Profit center reporting).\nExecute, check, and explain period-end close.\nIdentify root causes of issues on accounts, track and correct these.\n\n\"I am a diligent person. I put great attention to detail.\"", + "HireDate": "Date(1422777600000)" + }, + { + "Name": "John Miller", + "JobTitle": "GL Accountant", + "Photo": "/images/John_Miller.png", + "Icon": "sap-icon://account", + "JobResponsibilities": "Ensure and adjust correct structuring of company (e.g. chart of accounts, legal/management entities , profit centers etc. …).\nEnsure accuracy of financial data (profit center data).\nExplain financial data for both compliance and management purposes (Profit center reporting).\nExecute, check, and explain period-end close.\nIdentify root causes of issues on accounts, track and correct these.\n\n\"I am a diligent person. I put great attention to detail.\"", + "HireDate": "Date(1473404400000)" + }, + { + "Name": "Richard Wilson", + "JobTitle": "Internal Auditor", + "Photo": "/images/Richard_Wilson.png", + "Icon": "sap-icon://badge", + "JobResponsibilities": "Execute the audit (Setup meeting, request documents, do interview, etc.).\nFinish the report (Working papers, findings).\nFollow up action plans.", + "HireDate": "Date(1167638400000)" + }, + { + "Name": "Julie Armstrong", + "JobTitle": "Internal Auditor", + "Photo": "/images/Julie_Armstrong.png", + "Icon": "sap-icon://badge", + "JobResponsibilities": "Execute the audit (Setup meeting, request documents, do interview, etc.).\nFinish the report (Working papers, findings).\nFollow up action plans.", + "HireDate": "Date(1272697200000)" + }, + { + "Name": "Donna Moore", + "JobTitle": "Expense Controller", + "Photo": "/images/Donna_Moore.png", + "Icon": "sap-icon://employee", + "JobResponsibilities": "Keep Organizational Structure updated.\nOrganize and reorganize related objects into groups Keep object information up-to-date as needed.\nMaintain overhead-related structures and objects so costs can be distributed fairly.\nTrigger cost reposting to properly reflect changes that were not made in time.\n\n\"Everything needs to be as efficient as possible and always correct.\"", + "HireDate": "Date(920275200000)" + }, + { + "Name": "Elena Petrova", + "JobTitle": "Accounts Receivables Accountant", + "Photo": "/images/Elena_Petrova.png", + "Icon": "sap-icon://employee", + "JobResponsibilities": "Responsible for a high number of accounts (ca. 5000 customers).\nCentral contact for all internal and external requests for invoice related issues (e.g. manage disputes on invoices, set dunning blocks). (ca. 15-30 calls per day).\nPost-processing of incoming payments; clearing accounts.\nCollect Cash.\nManage accounting related master data of his customers.\n\n\"I am a diligent person. I put great attention to detail.\"", + "HireDate": "Date(1354348800000)" + } + ] +} diff --git a/aoc-day19/index.html b/aoc-day19/index.html new file mode 100644 index 0000000..59e8b20 --- /dev/null +++ b/aoc-day19/index.html @@ -0,0 +1,54 @@ + + + + + Timelines + + + + + + + + + + \ No newline at end of file diff --git a/aoc-day19/index.js b/aoc-day19/index.js new file mode 100644 index 0000000..c01b871 --- /dev/null +++ b/aoc-day19/index.js @@ -0,0 +1,56 @@ +sap.ui.define([ + "sap/ui/core/mvc/Controller", + "sap/ui/core/mvc/XMLView", + "sap/m/MessageToast", + "sap/suite/ui/commons/util/DateUtils", + "sap/ui/model/json/JSONModel"], + function (Controller, XMLView, MessageToast, DateUtils, JSONModel) { + "use strict"; + function getBasePath() { + return sap.ui.require.toUrl("sap/suite/ui/commons/demokit/sample/TimelineCustomGrouping/data.json"); + } + + function convertData(oEvent) { + var oData, + oModel = oEvent.getSource(), + sBasePath = getBasePath(); + + if (!oEvent.getParameters().success) { + return; + } + + oData = oModel.getData(); + oData.Employees.forEach(function(oEmployee) { + oEmployee.HireDate = DateUtils.parseDate(oEmployee.HireDate); + oEmployee.Photo = sBasePath + oEmployee.Photo; + }); + oModel.updateBindings(true); + } + + + Controller.extend("myController", { + onInit: function() { + var sDataPath = "https://ui5.sap.com/test-resources/sap/suite/ui/commons/demokit/sample/TimelineCustomGrouping/data.json"; + var oModel = new JSONModel(sDataPath); + oModel.attachRequestCompleted(convertData); + + this.getView().setModel(oModel); + this.byId("idTimeline").setCustomGrouping(function(oDate) { + return { + key: oDate.getFullYear() + "/" + (oDate.getMonth() < 6 ? 1 : 2), + title: oDate.getFullYear() + "/" + (oDate.getMonth() < 6 ? "1. half" : "2. half"), + date: oDate + }; + }); + }, + onUserNameClick : function(oEvent) { + MessageToast.show(oEvent.getSource().getUserName() + " is pressed."); + }, + onPressItems : function(evt) { + MessageToast.show("The TimelineItem is pressed."); + } + }); + XMLView.create({definition: jQuery('#myXml').html()}).then(function (oView) { + oView.placeAt("content"); + }); + }); \ No newline at end of file diff --git a/aoc-day20/index.html b/aoc-day20/index.html new file mode 100644 index 0000000..91e1dec --- /dev/null +++ b/aoc-day20/index.html @@ -0,0 +1,46 @@ + + + + + Page Header Title with Header + + + + + + + + + + \ No newline at end of file diff --git a/aoc-day20/index.js b/aoc-day20/index.js new file mode 100644 index 0000000..45f345b --- /dev/null +++ b/aoc-day20/index.js @@ -0,0 +1,25 @@ +sap.ui.define([ + "sap/ui/core/mvc/Controller", + "sap/ui/core/mvc/XMLView", + "sap/m/MessageToast", + "sap/ui/model/json/JSONModel"], + function (Controller, XMLView, MessageToast, JSONModel) { + Controller.extend("myController", { + + onInit: function () { + // set explored app's demo model on this sample + var sDataPath = "https://ui5.sap.com/test-resources/sap/ui/documentation/sdk/products.json"; + var oModel = new JSONModel(sDataPath); + this.getView().setModel(oModel); + }, + + handleButtonPress: function () { + MessageToast.show("Header toolbar button pressed."); + } + + }); + + XMLView.create({definition: jQuery('#myXml').html()}).then(function (oView) { + oView.placeAt("content"); + }); + }); \ No newline at end of file