{% extends "base.html" %} {% block contenido %} {% import "transaction_form_macros.html" as tf_macros %}
{{ _('Editar reposición de Caja Chica') if reposicion else _('Nueva reposición de Caja Chica') }}
{{ tf_macros.smart_select( doctype="company", name="company", label=_("Compañía"), preload=True, required=True, initial_value=reposicion.company if reposicion else '', initial_label=reposicion.company if reposicion else '', locked_expr="true" if reposicion else "false", on_select="function(opt){ document.dispatchEvent(new CustomEvent('company-selected', {detail: opt})); }" ) }}
{{ tf_macros.smart_select( doctype="naming_series", name="naming_series", label=_("Secuencia"), filters={"company": {"selector": "#company"}, "entity_type": "petty_cash_replenishment"}, filter_sources=["#company"], required_filters=["company", "entity_type"], auto_select_default=True, load_on_filter_change=True, default_after_ms=1500, initial_value=reposicion.naming_series_id if reposicion else '', initial_label=reposicion.naming_series_id if reposicion else '' ) }}
{{ tf_macros.smart_select( doctype="petty_cash", name="petty_cash_id", label=_("Caja Chica"), filters={"company": {"selector": "#company"}}, filter_sources=["#company"], required_filters=["company"], required=True, initial_value=reposicion.petty_cash_id if reposicion else '', initial_label=reposicion.petty_cash_id if reposicion else '', locked_expr="true" if reposicion else "false", on_select="function(opt){ var el = document.getElementById('pc_currency'); if (el) el.value = opt.currency || ''; var company = document.getElementById('company'); var c = company ? company.value : ''; if (opt.value) { window.location = '{{ url_for('bancos.caja_chica_reposicion_nueva') }}?petty_cash_id=' + encodeURIComponent(opt.value) + (c ? '&company=' + encodeURIComponent(c) : ''); } }" ) }}
{% for expense in gastos %}
{% else %}

{{ _('No hay gastos pendientes para esta caja.') }}

{% endfor %}
{{ _('Cancelar') }}
{% endblock %}