feat: Add new item management components for invoice editing

- Implemented packages section for item details in `packages-section.svelte`
- Created summary section to display general data and weights in `summary-section.svelte`
- Developed tab continuation for additional item details in `tab-continuation.svelte`
- Added identifiers tab for managing item identifiers in `tab-identifiers.svelte`
- Introduced labeling tab for item labeling information in `tab-labeling.svelte`
- Created serial numbers tab for entering multiple serial numbers in `tab-series.svelte`
- Built item sheet for inventory items in `item-sheet-inv.svelte`
- Developed items tab form for managing invoice items in `items-tab-form.svelte`
This commit is contained in:
AlexeerCT
2025-12-30 12:02:51 -06:00
parent 30b8daf16e
commit 5bb9343f6e
20 changed files with 991 additions and 267 deletions

View File

@@ -38,7 +38,7 @@ class InvoiceHeader(Base, TenantScopedMixin, TimestampMixin):
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
# Identifiers
system: Mapped[Optional[str]] = mapped_column(String(10)) # SISTEMA / Sistema de origen <-- no tiene campo en la antigua base de datos, sera para fixed-asset(scaf), inventory(scaii)
system: Mapped[Optional[str]] = mapped_column(String(12)) # SISTEMA / Sistema de origen <-- no tiene campo en la antigua base de datos, sera para fixed_asset(scaf), inventory(scaii)
operation_type: Mapped[OperationType] = mapped_column(String(10)) # TIPOMOVIMIENTO / Clasifica imp/exp/sm/ctm
invoice_type: Mapped[Optional[str]] = mapped_column(ForeignKey("public.invoice_types.key")) # TIPOFACTURA / TIPODOC
invoice_number: Mapped[Optional[str]] = mapped_column(String(20)) # FACTURAIMPO/FACTURAEXPO/FACTURAREMISION/FACTURAENVIO/FACTURASALIDA

View File

@@ -9,7 +9,7 @@ from .models import OperationType
class InvoiceHeaderBase(BaseModel):
"""Base fields for Invoice Header"""
system: Optional[str] = Field(
None, max_length=10, description="System of origin")
None, max_length=12, description="System of origin")
operation_type: Optional[OperationType] = Field(
None, max_length=10, description="Operation type: imp/exp/sm/ctm")
invoice_type: Optional[str] = Field(

View File

@@ -28,14 +28,9 @@ class Item(Base, TenantScopedMixin, TimestampMixin):
}
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
invoice_id: Mapped[int] = mapped_column(ForeignKey("a76.invoice_header.id")) # CONSECUTIVO
# Type: IMPORT_TEMP, IMPORT_DEF, EXPORT, REPAIR, etc.
item_type: Mapped[str] = mapped_column(String(20))
system_origin: Mapped[str] = mapped_column(String(10)) # SCAF or SCAII
invoice_id: Mapped[int] = mapped_column(ForeignKey("a76.invoice_header.id")) # CONSECUTIVO
# Item references
invoice_number: Mapped[Optional[str]] = mapped_column(
String(15)) # FACTURAIMPO/FACTURAEXPO
reference_number: Mapped[Optional[str]] = mapped_column(
String(20)) # NUMREFERENCIA
order: Mapped[Optional[str]] = mapped_column(
@@ -44,8 +39,6 @@ class Item(Base, TenantScopedMixin, TimestampMixin):
String(50)) # NUMEROGUIA/NUMERODEGUIA
# Dates
invoice_date: Mapped[Optional[int]] = mapped_column(
Integer) # FECHAFACTURA
depreciation_date: Mapped[Optional[int]] = mapped_column(
Integer) # FECHADEPRECIACION

View File

@@ -24,14 +24,6 @@ from .line_items.schemas import (
class ItemBase(BaseModel):
"""Base schema for items"""
invoice_id: int = Field(..., description="Invoice ID")
item_type: str = Field(..., max_length=20,
description="Item type: IMPORT_TEMP, IMPORT_DEF, EXPORT, REPAIR")
system_origin: str = Field(..., max_length=10,
description="System origin: SCAF or SCAII")
# Item references
invoice_number: Optional[str] = Field(
None, max_length=15, description="Invoice number")
reference_number: Optional[str] = Field(
None, max_length=20, description="Reference number")
order: Optional[str] = Field(None, max_length=50, description="Order")
@@ -39,7 +31,6 @@ class ItemBase(BaseModel):
None, max_length=50, description="Guide number")
# Dates
invoice_date: Optional[int] = Field(None, description="Invoice date")
depreciation_date: Optional[int] = Field(
None, description="Depreciation date")
@@ -60,10 +51,6 @@ class ItemCreate(ItemBase):
class ItemUpdate(ItemBase):
"""Schema for updating item"""
invoice_id: Optional[int] = Field(None, description="Invoice ID")
item_type: Optional[str] = Field(
None, max_length=20, description="Item type")
system_origin: Optional[str] = Field(
None, max_length=10, description="System origin")
lines: Optional[list[LineItemUpdate]] = Field(
None, description="List of line items to update")