From f710db48ded0edf66d682cc0eb1fc051d49be01d71e85ec4c83f9a5903670cc9 Mon Sep 17 00:00:00 2001 From: Daniel Stoppek Date: Mon, 3 Feb 2025 16:46:35 +0100 Subject: [PATCH] backup encryption file --- Gui/AddObject.qml | 10 +- Gui/CustomersTable.qml | 88 ++++---------- Gui/ObjectAddOnContactPerson.qml | 14 +-- Gui/ObjectAddOnEmployee.qml | 200 +++++++++++++++---------------- Gui/ObjectAddOns.qml | 4 - Gui/ObjectView.qml | 86 ++++++++++--- backup.pyqrec | 1 + 7 files changed, 195 insertions(+), 208 deletions(-) create mode 100644 backup.pyqrec diff --git a/Gui/AddObject.qml b/Gui/AddObject.qml index 62ec0ed..d75845f 100644 --- a/Gui/AddObject.qml +++ b/Gui/AddObject.qml @@ -21,7 +21,7 @@ ColumnLayout CheckBox { id: checkAddObject - text: qsTr("Mitarbeiter/Ansprechpartner hinzufügen") + text: qsTr("Ansprechpartner hinzufügen") Layout.alignment: Qt.AlignRight checked: false onCheckStateChanged: @@ -73,14 +73,16 @@ ColumnLayout if (!checkAddObject.checked) { new_object = JsLib.parseForm(objectView) - object_model.addObject(new_object, 0) - appLoader.source = "ObjectTable.qml" + // object_model.addObject(new_object, 0) + // appLoader.source = "ObjectTable.qml" + console.log(new_object) } else { new_object = JsLib.parseForm(objectView) var new_objecto = JsLib.parseForm(addObjectLayout) - objecto_model.addObject(new_objecto) + console.log(new_objecto) + //objecto_model.addObject(new_objecto) } } } diff --git a/Gui/CustomersTable.qml b/Gui/CustomersTable.qml index 7f16047..70895e2 100644 --- a/Gui/CustomersTable.qml +++ b/Gui/CustomersTable.qml @@ -22,7 +22,6 @@ Item onClicked: appLoader.source = "AddCustomer.qml" } - ColumnLayout { id: tableColumn @@ -67,7 +66,6 @@ Item text: qsTr("Erledigt") onClicked: viewCriterion(showFinished) } - } HorizontalHeaderView @@ -77,29 +75,28 @@ Item implicitHeight: 40 movableColumns: true //@disable-check M16 syncView: customerTable - - delegate: Rectangle { - color: addBusinessBtn.palette.alternateBase - border.color: addBusinessBtn.palette.base - implicitHeight: 40 - Layout.fillWidth: true - implicitWidth: 1 - Text - { - text: model.display - elide: Text.ElideRight - width: parent.width - height: parent.height - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - color: addBusinessBtn.palette.text - } + delegate: Rectangle + { + color: addBusinessBtn.palette.alternateBase + border.color: addBusinessBtn.palette.base + implicitHeight: 40 + Layout.fillWidth: true + implicitWidth: 1 + Text + { + text: model.display + elide: Text.ElideRight + width: parent.width + height: parent.height + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + color: addBusinessBtn.palette.text + } } } TableView { - //property var customWidths: [0.2, 0.5, 0.3, 05, 0.2, 0.2] property real newWidth: 0 id: customerTable Layout.fillHeight: true @@ -112,43 +109,13 @@ Item rowSpacing: 2 model: business_model alternatingRows: true - resizableColumns: true // @disable-check M16 + resizableColumns: true selectionBehavior: TableView.SelectRows selectionModel: ItemSelectionModel { id: selModel model: customerTable.model } - - // columnWidthProvider: function(column) - // { - // switch (column) - // { - // case 0: return width * 0.2; - // case 1: return width * 0.5; - // case 2: return width * 0.3; - // default: return width / model.columnCount(); - // } - //return customWidths[column] * width; - //return tableColumn.content.implicitWidth // model.columnCount() - // newWidth = columnWidth(column) - // return newWidth - // } - - Timer - { - id: redrawTable - running: true - interval: 1 - repeat: false - onTriggered: - { - customerTable.forceLayout(); - } - } - - - delegate:Rectangle { required property bool selected @@ -160,30 +127,22 @@ Item : (customerTable.alternatingRows && row % 2 !== 0 ? addBusinessBtn.palette.base // palette.base : addBusinessBtn.palette.alternateBase) //palette.alternateBase) - Text { - text: model.display == null? "": model.display + text: model.display == null? "": model.display // @disable-check M126 elide: Text.ElideRight width: parent.width height: parent.height verticalAlignment: Text.AlignVCenter - leftPadding: 9 //@d isable-check M16 + leftPadding: 9 color: addBusinessBtn.palette.text } - MouseArea { property bool hovered: false id: mouseArea anchors.fill: parent hoverEnabled: true - - // onClicked: - // { - // business_model.onRowClicked(row) - // } - onDoubleClicked: { customersStack.push("CustomerDetails.qml", {selectedClient: row}); @@ -195,17 +154,10 @@ Item } } } - - onContentWidthChanged: - { - //console.log("Model changed!!") - redrawTable.start() - } } Item { - //Layout.fillHeight: true Layout.fillWidth: true } } diff --git a/Gui/ObjectAddOnContactPerson.qml b/Gui/ObjectAddOnContactPerson.qml index 17f0dd2..e3ed2f4 100644 --- a/Gui/ObjectAddOnContactPerson.qml +++ b/Gui/ObjectAddOnContactPerson.qml @@ -7,12 +7,6 @@ GridLayout property var contacts: null columns: 2 - CheckBox - { - id: contactperson - text: qsTr("Ansprechpartner") - Layout.columnSpan: 2 - } Label { text: qsTr("Anrede") @@ -23,7 +17,6 @@ GridLayout id: title model: [qsTr("Herr"),qsTr("Frau")] Layout.fillWidth: true - enabled: contactperson.checked } Label { @@ -36,7 +29,6 @@ GridLayout Layout.fillWidth: true placeholderText: "Pflichtfeld" placeholderTextColor: "red" - enabled: contactperson.checked } Label { @@ -49,7 +41,6 @@ GridLayout Layout.fillWidth: true placeholderText: "Pflichtfeld" placeholderTextColor: "red" - enabled: contactperson.checked } Label { @@ -62,7 +53,7 @@ GridLayout Layout.fillWidth: true placeholderText: "Pflichtfeld" placeholderTextColor: "red" - enabled: contactperson.checked + } Label { @@ -75,7 +66,6 @@ GridLayout Layout.fillWidth: true placeholderText: "Pflichtfeld" placeholderTextColor: "red" - enabled: contactperson.checked } RowLayout @@ -92,14 +82,12 @@ GridLayout { id: removeContact text: qsTr("Entfernen") - enabled: contactperson.checked } Button { id: addContact text: qsTr("Hinzufügen") - enabled: contactperson.checked onClicked: { var num_contacts = 0 diff --git a/Gui/ObjectAddOnEmployee.qml b/Gui/ObjectAddOnEmployee.qml index 4f54bda..57bbb46 100644 --- a/Gui/ObjectAddOnEmployee.qml +++ b/Gui/ObjectAddOnEmployee.qml @@ -4,120 +4,120 @@ import QtQuick.Controls GridLayout { - property var employeeForm: null - property var employees: null - id: oaoemployee - columns: 2 - rows: 4 - Label - { - text: qsTr("Mitarbeiter") - Layout.alignment: Qt.AlignRight | Qt.AlignTop - } + // property var employeeForm: null + // property var employees: null + // id: oaoemployee + // columns: 2 + // rows: 4 + // Label + // { + // text: qsTr("Mitarbeiter") + // Layout.alignment: Qt.AlignRight | Qt.AlignTop + // } - ListModel - { - id: employeeModel - } + // ListModel + // { + // id: employeeModel + // } - Component - { - id: employeesHeader - Row - { - Text - { - id: empName - text: qsTr("Mitarbeiter") - width: 175 - font.bold: true - horizontalAlignment: Text.AlignLeft - color: "black" - } - } - } + // Component + // { + // id: employeesHeader + // Row + // { + // Text + // { + // id: empName + // text: qsTr("Mitarbeiter") + // width: 175 + // font.bold: true + // horizontalAlignment: Text.AlignLeft + // color: "black" + // } + // } + // } - Rectangle - { - Layout.fillWidth: true - implicitHeight: 75 - Layout.rowSpan: 2 - color: mitarbeiterhin.palette.base - border.color: mitarbeiterhin.activeFocus? mitarbeiterhin.palette.highlight: mitarbeiterhin.palette.base - ListView - { - id: employeesList - //anchors.fill: parent - implicitHeight: parent.height + // Rectangle + // { + // Layout.fillWidth: true + // implicitHeight: 75 + // Layout.rowSpan: 2 + // color: mitarbeiterhin.palette.base + // border.color: mitarbeiterhin.activeFocus? mitarbeiterhin.palette.highlight: mitarbeiterhin.palette.base + // ListView + // { + // id: employeesList + // //anchors.fill: parent + // implicitHeight: parent.height - model: employeeModel + // model: employeeModel - header: employeesHeader + // header: employeesHeader - delegate: Row - { - width: 200 - height: 15 - //padding: 7 - Text - { - text: model.namens - } - } + // delegate: Row + // { + // width: 200 + // height: 15 + // //padding: 7 + // Text + // { + // text: model.namens + // } + // } - } - } - RowLayout - { - Layout.columnSpan: 2 - Layout.fillWidth: true - Item - { - Layout.fillWidth: true - } + // } + // } + // RowLayout + // { + // Layout.columnSpan: 2 + // Layout.fillWidth: true + // Item + // { + // Layout.fillWidth: true + // } - Button - { - id: mitarbeiterraus - text: qsTr("Mitarbeiter entfernen") - } + // Button + // { + // id: mitarbeiterraus + // text: qsTr("Mitarbeiter entfernen") + // } - Button - { - id: mitarbeiterhin - text: qsTr("Mitarbeiter hinzufügen") - onClicked: - { - var nm = Qt.createComponent("AddObjectEmployee.qml") - if (nm.status === Component.Ready) - { - employeeForm = nm.createObject (appWindow, {width: 600, height: 400}) - employeeForm.addNewEmployee.connect(onAddEmployee) - employeeForm.show() - } - else console.log(nm.errorString()) - } - } - } + // Button + // { + // id: mitarbeiterhin + // text: qsTr("Mitarbeiter hinzufügen") + // onClicked: + // { + // var nm = Qt.createComponent("AddObjectEmployee.qml") + // if (nm.status === Component.Ready) + // { + // employeeForm = nm.createObject (appWindow, {width: 600, height: 400}) + // employeeForm.addNewEmployee.connect(onAddEmployee) + // employeeForm.show() + // } + // else console.log(nm.errorString()) + // } + // } + // } - function onAddEmployee(new_employee) - { - var num_employees = 0 + // function onAddEmployee(new_employee) + // { + // var num_employees = 0 - if (employees === null || employees === undefined) employees = {} - else num_employees = Object.keys(employees).length; + // if (employees === null || employees === undefined) employees = {} + // else num_employees = Object.keys(employees).length; - employees[num_employees] = {} - employees[num_employees]["assignee"] = new_employee["assignee"]; - employees[num_employees]["duration"] = new_employee["duration"]; - employees[num_employees]["wage"] = new_employee["wage"]; - employees[num_employees]["cleandays"] = new_employee["cleandays"]; - employees[num_employees]["tasks"] = new_employee["tasks"]; - employees[num_employees]["output"] = new_employee["output"]; + // employees[num_employees] = {} + // employees[num_employees]["assignee"] = new_employee["assignee"]; + // employees[num_employees]["duration"] = new_employee["duration"]; + // employees[num_employees]["wage"] = new_employee["wage"]; + // employees[num_employees]["cleandays"] = new_employee["cleandays"]; + // employees[num_employees]["tasks"] = new_employee["tasks"]; + // employees[num_employees]["output"] = new_employee["output"]; - employeeModel.append({namens: new_employee["assignee"]}); + // employeeModel.append({namens: new_employee["assignee"]}); - } + // } } diff --git a/Gui/ObjectAddOns.qml b/Gui/ObjectAddOns.qml index 007dbe1..5fc9d85 100644 --- a/Gui/ObjectAddOns.qml +++ b/Gui/ObjectAddOns.qml @@ -10,10 +10,6 @@ Frame { id: addObjectLayout width: parent.width - ObjectAddOnEmployee - { - id: oaoemployee - } ObjectAddOnContactPerson { id: oaocontactperson diff --git a/Gui/ObjectView.qml b/Gui/ObjectView.qml index 31bacd6..897ac12 100644 --- a/Gui/ObjectView.qml +++ b/Gui/ObjectView.qml @@ -6,47 +6,94 @@ GridLayout { id: objectView - columns: 2 + columns: 4 Layout.fillWidth: true Layout.fillHeight: true rowSpacing: 9 + Label + { + text: qsTr("Firma") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + } + ComboBox + { + property string name: "business" + id: business + editable: true + Layout.fillWidth: true + Layout.columnSpan: 3 + } Label { - text: qsTr("Objektstraße") + text: qsTr("Straße") Layout.alignment: Qt.AlignRight | Qt.AlignVCenter - } TextField { - id: objectName + property string name: "street" + id: street Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter onTextChanged: checkFields() placeholderText: "Pflichtfeld" placeholderTextColor: "red" - //Layout.maximumWidth: parent.width / 2 - } - Label { - text: qsTr("Leistungsort") + text: qsTr("Nr.") Layout.alignment: Qt.AlignRight | Qt.AlignVCenter } TextField { - id: leistungsortid + property string name: "houseno" + id: houseno Layout.fillWidth: true - //Layout.maximumWidth: parent.width / 2 + Layout.alignment: Qt.AlignVCenter onTextChanged: checkFields() placeholderText: "Pflichtfeld" placeholderTextColor: "red" } + Label + { + text: qsTr("PLZ") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + } + + TextField + { + property string name: "postcode" + id: postcode + Layout.fillWidth: true + onTextChanged: checkFields() + placeholderText: "Pflichtfeld" + placeholderTextColor: "red" + } + Label + { + text: qsTr("Ort") + Layout.alignment: Qt.AlignRight + + } + ComboBox + { + property string name: "city" + id: city + Layout.fillWidth: true + editable: true + onEditTextChanged: checkFields() + onCurrentTextChanged: checkFields() + model: address_model + textRole: "city" + popup.height: 300 + popup.y: postcode.y + 5 - (postcode.height * 2) + currentIndex: -1 + } + Label { text: qsTr("Lohnanteil inkl. Fahrtkosten") @@ -57,7 +104,7 @@ GridLayout { id: lohnanteil Layout.fillWidth: true - //Layout.maximumWidth: parent.width / 2 + Layout.columnSpan: 3 } Label @@ -70,7 +117,7 @@ GridLayout { id: materialanteil Layout.fillWidth: true - //Layout.maximumWidth: parent.width / 2 + Layout.columnSpan: 3 } Label @@ -83,7 +130,7 @@ GridLayout { id: zusatz1 Layout.fillWidth: true - //Layout.maximumWidth: parent.width / 2 + Layout.columnSpan: 3 } Label @@ -96,7 +143,7 @@ GridLayout { id: zusatz2 Layout.fillWidth: true - //Layout.maximumWidth: parent.width / 2 + Layout.columnSpan: 3 } Label @@ -109,7 +156,7 @@ GridLayout { id: gesamtnetto Layout.fillWidth: true - //Layout.maximumWidth: parent.width / 2 + Layout.columnSpan: 3 } Label @@ -122,7 +169,7 @@ GridLayout { id: mwst Layout.fillWidth: true - //Layout.maximumWidth: parent.width / 2 + Layout.columnSpan: 3 } Label @@ -135,7 +182,7 @@ GridLayout { id: gesamt Layout.fillWidth: true - //Layout.maximumWidth: parent.width / 2 + Layout.columnSpan: 3 } Label @@ -149,9 +196,8 @@ GridLayout id: zahlungsziel Layout.fillWidth: true editable: false - //model: business_type textRole: "display" - //Layout.maximumWidth: parent.width / 2 + Layout.columnSpan: 3 } @@ -165,6 +211,7 @@ GridLayout id: infoview Layout.fillWidth: true Layout.preferredHeight: 110 + Layout.columnSpan: 3 ScrollBar.horizontal: ScrollBar { policy: ScrollBar.AlwaysOn @@ -180,6 +227,7 @@ GridLayout { color: objectInfo.palette.base border.color: objectInfo.activeFocus? objectInfo.palette.highlight: objectInfo.palette.base + width: parent.width } } } diff --git a/backup.pyqrec b/backup.pyqrec new file mode 100644 index 0000000..d8cc3ed --- /dev/null +++ b/backup.pyqrec @@ -0,0 +1 @@ +zIgY4d8ORJ0HZpG7y8/XeS84mKHFcvNaMmCxdirT6ebjApHlo5XVXspy3ENIEvrZczSDRugR0sAVVt8StqZ2gGAr42tIwFF9Uwl7YBMi72+iGIkwyIGX/Jw3OiHYubkXEooZLYX1MYPOC91ppVnZG0PA0IYdpDofq5inFfxpPBwMdcJxvtZPLhIX2y7Fn3m1/lsWe+e2EBwDGxnZjUjPMsRFMjswBv20EOHk46OuNFwlDyn+w9ZDoJfhF6HKYqNxnBnN90KEUygTYGWk.nfaytDW7Z0Nn2/5d22/ciQ== \ No newline at end of file