Se integro la ventana de tipo de dato en pedimentos y facturas

This commit is contained in:
2026-01-22 17:30:04 -06:00
parent 5a254fb2b1
commit bf26268f23
8 changed files with 525 additions and 64 deletions

View File

@@ -0,0 +1,30 @@
import sys
import os
from datetime import datetime
# Add backend directory to path
sys.path.append('/home/josmar/dev/anexo76/backend')
from api.v1.modules.a76.general_catalogs.exchange_rate.services import ExchangeRateService
from core.database import get_core_db
# from api.v1.common.tenant_crud_routes import get_core_db # This might be needing another import path
db = next(get_core_db())
today = datetime.now().strftime("%Y-%m-%d")
tenant_id = 1
company_id = 1
print(f"Checking for exchange rate on {today}...")
filters = {"date": today}
rates, total = ExchangeRateService.get_all(db, tenant_id, company_id, filters=filters)
if total > 0:
print(f"Found {total} exchange rate(s) for today. Deleting...")
for rate in rates:
ExchangeRateService.delete(db, rate.id, tenant_id, company_id)
print("Deleted.")
else:
print("No exchange rate found for today.")
db.close()