feature/correccion-de-actualizar
This commit is contained in:
@@ -138,7 +138,7 @@ def review_classes(
|
|||||||
3a. If no class errors: validate fractions for ALL lines.
|
3a. If no class errors: validate fractions for ALL lines.
|
||||||
3b. If class errors exist: add a CLASE error per invalid line and validate
|
3b. If class errors exist: add a CLASE error per invalid line and validate
|
||||||
fractions only for those lines.
|
fractions only for those lines.
|
||||||
4. If the invoice has not been reviewed by the company, flag lines whose
|
4. If invoice logistics does not mark equipment_reviewed, flag lines whose
|
||||||
class requires physical review (Class.physical_review == 1).
|
class requires physical review (Class.physical_review == 1).
|
||||||
"""
|
"""
|
||||||
# 1. Lines whose class is not assigned / not found in the catalog
|
# 1. Lines whose class is not assigned / not found in the catalog
|
||||||
@@ -178,7 +178,7 @@ def review_classes(
|
|||||||
_validate_line_fraction(db, line, errors)
|
_validate_line_fraction(db, line, errors)
|
||||||
|
|
||||||
# 4. Physical review check
|
# 4. Physical review check
|
||||||
if not invoice.compliance_mx.was_reviewed_by_company:
|
if not (invoice.logistics and invoice.logistics.equipment_reviewed):
|
||||||
review_required_lines = (
|
review_required_lines = (
|
||||||
db.query(LineItem)
|
db.query(LineItem)
|
||||||
.join(Class, LineItem.class_id == Class.id)
|
.join(Class, LineItem.class_id == Class.id)
|
||||||
@@ -201,7 +201,7 @@ def review_classes(
|
|||||||
),
|
),
|
||||||
solution=[
|
solution=[
|
||||||
f"Revisar el Equipo de la Partida: {line.line_number} "
|
f"Revisar el Equipo de la Partida: {line.line_number} "
|
||||||
"y Asignar Como Revisado a Nivel Factura."
|
"y marcar Equipo revisado en Continuación (logística) a nivel factura."
|
||||||
],
|
],
|
||||||
code="CLASE",
|
code="CLASE",
|
||||||
)
|
)
|
||||||
|
|||||||
2
backend/tests/fixtures/builders.py
vendored
2
backend/tests/fixtures/builders.py
vendored
@@ -343,6 +343,7 @@ def create_import_invoice_with_line(
|
|||||||
tenant_id=tenant_id,
|
tenant_id=tenant_id,
|
||||||
company_id=company_id,
|
company_id=company_id,
|
||||||
weight_type="kgs",
|
weight_type="kgs",
|
||||||
|
equipment_reviewed=True,
|
||||||
)
|
)
|
||||||
db.add(invoice)
|
db.add(invoice)
|
||||||
db.flush()
|
db.flush()
|
||||||
@@ -413,6 +414,7 @@ def create_export_invoice_with_line(
|
|||||||
tenant_id=tenant_id,
|
tenant_id=tenant_id,
|
||||||
company_id=company_id,
|
company_id=company_id,
|
||||||
weight_type="kgs",
|
weight_type="kgs",
|
||||||
|
equipment_reviewed=True,
|
||||||
)
|
)
|
||||||
db.add(invoice)
|
db.add(invoice)
|
||||||
db.flush()
|
db.flush()
|
||||||
|
|||||||
Reference in New Issue
Block a user