diff --git a/CHANGELOG.md b/CHANGELOG.md index 808fb36..27bd1a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,3 @@ -# 0.8.2 - - * Add ability to delete an invoice via 'Manage Invoices' dialog - # 0.8.1 * Fix bold/italic/strikethrough styling in certain conditions when toolbar action is used. diff --git a/bouquin/db.py b/bouquin/db.py index 157aae8..d1c6a69 100644 --- a/bouquin/db.py +++ b/bouquin/db.py @@ -2392,18 +2392,6 @@ class DBManager: (document_id, invoice_id), ) - def delete_invoice(self, invoice_id: int) -> None: - """Delete an invoice. - - Related invoice line items and invoice ↔ time log links are removed via - ON DELETE CASCADE. - """ - with self.conn: - self.conn.execute( - "DELETE FROM invoices WHERE id = ?", - (invoice_id,), - ) - def time_logs_for_range( self, project_id: int, diff --git a/bouquin/invoices.py b/bouquin/invoices.py index fde6a92..a0b50cb 100644 --- a/bouquin/invoices.py +++ b/bouquin/invoices.py @@ -1065,10 +1065,6 @@ class InvoicesDialog(QDialog): btn_row = QHBoxLayout() btn_row.addStretch(1) - delete_btn = QPushButton(strings._("delete")) - delete_btn.clicked.connect(self._on_delete_clicked) - btn_row.addWidget(delete_btn) - close_btn = QPushButton(strings._("close")) close_btn.clicked.connect(self.accept) btn_row.addWidget(close_btn) @@ -1077,68 +1073,6 @@ class InvoicesDialog(QDialog): self._reload_invoices() - # ----------------------------------------------------------------- deletion - - def _on_delete_clicked(self) -> None: - """Delete the currently selected invoice.""" - row = self.table.currentRow() - if row < 0: - sel = self.table.selectionModel().selectedRows() - if sel: - row = sel[0].row() - if row < 0: - QMessageBox.information( - self, - strings._("delete"), - strings._("invoice_required"), - ) - return - - base_item = self.table.item(row, self.COL_NUMBER) - if base_item is None: - return - - inv_id = base_item.data(Qt.ItemDataRole.UserRole) - if not inv_id: - return - - invoice_number = (base_item.text() or "").strip() or "?" - proj_item = self.table.item(row, self.COL_PROJECT) - project_name = (proj_item.text() if proj_item is not None else "").strip() - - label = strings._("delete") - prompt = ( - f"{label} '{invoice_number}'" - + (f" ({project_name})" if project_name else "") - + "?" - ) - - resp = QMessageBox.question( - self, - label, - prompt, - QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No, - QMessageBox.StandardButton.No, - ) - if resp != QMessageBox.StandardButton.Yes: - return - - # Remove any automatically created due-date reminder. - if self.cfg.reminders: - self._remove_invoice_due_reminder(row, int(inv_id)) - - try: - self._db.delete_invoice(int(inv_id)) - except Exception as e: - QMessageBox.warning( - self, - strings._("error"), - f"Failed to delete invoice: {e}", - ) - return - - self._reload_invoices() - # ------------------------------------------------------------------ helpers def _reload_projects(self) -> None: diff --git a/bouquin/locales/en.json b/bouquin/locales/en.json index f1f86dd..26a4d5c 100644 --- a/bouquin/locales/en.json +++ b/bouquin/locales/en.json @@ -436,6 +436,5 @@ "invoice_invalid_date_format": "Invalid date format", "invoice_invalid_tax_rate": "The tax rate is invalid", "invoice_no_items": "There are no items in the invoice", - "invoice_number_required": "An invoice number is required", - "invoice_required": "Please select a specific invoice before trying to delete an invoice." + "invoice_number_required": "An invoice number is required" } diff --git a/bouquin/locales/fr.json b/bouquin/locales/fr.json index 87a6a16..d82890d 100644 --- a/bouquin/locales/fr.json +++ b/bouquin/locales/fr.json @@ -432,6 +432,5 @@ "invoice_invalid_date_format": "Format de date invalide", "invoice_invalid_tax_rate": "Le taux de TVA est invalide", "invoice_no_items": "La facture ne contient aucun article", - "invoice_number_required": "Un numéro de facture est requis", - "invoice_required": "Veuillez sélectionner une facture spécifique avant d'essayer de supprimer la facture." + "invoice_number_required": "Un numéro de facture est requis" } diff --git a/debian/changelog b/debian/changelog index 26075f4..036fb4e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,3 @@ -bouquin (0.8.2) unstable; urgency=medium - - * Add ability to delete an invoice via 'Manage Invoices' dialog - - -- Miguel Jacq Wed, 31 Dec 2025 16:00:00 +1100 - bouquin (0.8.1) unstable; urgency=medium * Fix bold/italic/strikethrough styling in certain conditions when toolbar action is used. diff --git a/pyproject.toml b/pyproject.toml index 868fb26..380e67b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bouquin" -version = "0.8.2" +version = "0.8.1" description = "Bouquin is a simple, opinionated notebook application written in Python, PyQt and SQLCipher." authors = ["Miguel Jacq "] readme = "README.md" diff --git a/rpm/bouquin.spec b/rpm/bouquin.spec index 2f8d442..f7d3c37 100644 --- a/rpm/bouquin.spec +++ b/rpm/bouquin.spec @@ -4,7 +4,7 @@ # provides the Python distribution/module as "sqlcipher4". To keep Fedora's # auto-generated python3dist() Requires correct, we rewrite the dependency key in # pyproject.toml at build time. -%global upstream_version 0.8.2 +%global upstream_version 0.8.1 Name: bouquin Version: %{upstream_version} @@ -82,8 +82,6 @@ install -Dpm 0644 bouquin/icons/bouquin.svg %{buildroot}%{_datadir}/icons/hicolo %{_datadir}/icons/hicolor/scalable/apps/bouquin.svg %changelog -* Wed Dec 31 2025 Miguel Jacq - %{version}-%{release} -- Add ability to delete an invoice via 'Manage Invoices' dialog * Fri Dec 26 2025 Miguel Jacq - %{version}-%{release} - Fix bold/italic/strikethrough styling in certain conditions when toolbar action is used. - Move a code block or collapsed section (or generally, anything after a checkbox line until the next checkbox line) when moving an unchecked checkbox line to another day.