Se integro el modulo de manifestacion base
This commit is contained in:
@@ -73,6 +73,16 @@ class InvoiceService:
|
||||
):
|
||||
query = query.filter(models.InvoiceHeader.operation_type != "REPAR")
|
||||
|
||||
if filters.get("manifest_number"):
|
||||
# Avoid duplicate joins if pedimento filter was also applied (though rare in this context)
|
||||
# For safety, we can just use the relationship attribute directly if mapped,
|
||||
# but explicit join is clearer given the previous pattern.
|
||||
# Assuming SQLAlchemy handles the join overlap or we just accept it for now.
|
||||
# To be safe and consistent with previous 'pedimento' block:
|
||||
query = query.join(models.InvoiceComplianceMx).filter(
|
||||
models.InvoiceComplianceMx.manifest_number.ilike(f"%{filters['manifest_number']}%")
|
||||
)
|
||||
|
||||
total = query.count()
|
||||
items = query.offset(skip).limit(limit).all()
|
||||
return items, total
|
||||
|
||||
Reference in New Issue
Block a user