Partidas por tipo de factura en importacion
This commit is contained in:
@@ -32,6 +32,7 @@ class IdentifierDetailBase(BaseModel):
|
||||
part_line: Optional[int] = Field(None, description="Part Line")
|
||||
identifier_code: Optional[str] = Field(
|
||||
None, max_length=2, description="Identifier Code")
|
||||
item_line_id: Optional[int] = Field(None, description="Item Line ID")
|
||||
module: Optional[str] = Field(None, max_length=20, description="Module")
|
||||
complement1: Optional[str] = Field(
|
||||
None, max_length=50, description="Complement 1")
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
from typing import Optional
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
from sqlalchemy import Integer, String, UniqueConstraint, ForeignKey
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from api.v1.common.base_models import TenantScopedMixin, TimestampMixin
|
||||
from core.database import Base
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from api.v1.modules.a76.items.models import LineItem
|
||||
|
||||
class Identifier(Base, TenantScopedMixin, TimestampMixin):
|
||||
__tablename__ = "identifiers"
|
||||
__table_args__ = (
|
||||
@@ -44,6 +47,8 @@ class IdentifierDetail(Base, TenantScopedMixin, TimestampMixin):
|
||||
Integer, nullable=True) # LINEAPARTIDA
|
||||
identifier_code: Mapped[Optional[str]] = mapped_column(
|
||||
String(2), ForeignKey("a76.identifiers.code"), nullable=True) # ID
|
||||
item_line_id: Mapped[Optional[int]] = mapped_column(
|
||||
ForeignKey("a76.item_lines.id"), nullable=True)
|
||||
module: Mapped[Optional[str]] = mapped_column(
|
||||
String(20), nullable=True) # MODULO
|
||||
complement1: Mapped[Optional[str]] = mapped_column(
|
||||
@@ -54,3 +59,4 @@ class IdentifierDetail(Base, TenantScopedMixin, TimestampMixin):
|
||||
String(50), nullable=True) # COMPLEMENTO3
|
||||
|
||||
identifier: Mapped["Identifier"] = relationship(back_populates="details")
|
||||
line: Mapped[Optional["LineItem"]] = relationship(back_populates="identifiers")
|
||||
|
||||
Reference in New Issue
Block a user