Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **Invoices** — Generating an invoice from many time entries no longer fails on PostgreSQL: `invoice_items.time_entry_ids` is now `TEXT` (was `VARCHAR(500)`).
- **Report export** — CSV and Excel exports from the report form now apply the client, task, billable, source and tags filters.
- **Payments** — Stripe checkout now sends JPY and other zero-decimal currencies (and three-decimal ones such as KWD) in the unit Stripe expects; before, every amount was multiplied by 100, so a JPY invoice was charged 100 times its balance, and the webhook amount was divided by 100 the same way.
- **Peppol** — The UBL invoice now reports payments already recorded on the invoice as `PrepaidAmount` and sets `PayableAmount` to the total minus those payments (BR-CO-16), never below zero, as the Factur-X/ZUGFeRD export already does; before, a partly paid invoice sent or exported as UBL asked the buyer for the full total.
Expand Down
2 changes: 1 addition & 1 deletion app/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class InvoiceItem(db.Model):
total_amount = db.Column(db.Numeric(10, 2), nullable=False)

# Time entry reference (optional)
time_entry_ids = db.Column(db.String(500), nullable=True) # Comma-separated IDs
time_entry_ids = db.Column(db.Text, nullable=True) # Comma-separated IDs

# Inventory integration
stock_item_id = db.Column(db.Integer, db.ForeignKey("stock_items.id"), nullable=True, index=True)
Expand Down
23 changes: 23 additions & 0 deletions migrations/versions/207_widen_invoice_item_time_entry_ids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Widen invoice_items.time_entry_ids so a grouped line can hold many entries.

Revision ID: 207_invoice_item_time_entry_ids
Revises: 206_add_bank_transactions
"""

import sqlalchemy as sa
from alembic import op

revision = "207_invoice_item_time_entry_ids"
down_revision = "206_add_bank_transactions"
branch_labels = None
depends_on = None


def upgrade():
with op.batch_alter_table("invoice_items") as batch_op:
batch_op.alter_column("time_entry_ids", existing_type=sa.String(length=500), type_=sa.Text())


def downgrade():
with op.batch_alter_table("invoice_items") as batch_op:
batch_op.alter_column("time_entry_ids", existing_type=sa.Text(), type_=sa.String(length=500))
Loading