Skip to main content

Overview

Budget Item Management in SMAF handles two critical catalog types:
  1. PEF (Presupuesto de Egresos de la Federación): The federal budget classifications imported from the annual federal budget decree
  2. Partidas Presupuestales: Specific budget line items assigned to projects for expense tracking
These catalogs form the foundation of SMAF’s expense control and ensure compliance with federal budgetary regulations.
PEF management is restricted to Director de Administración, Director General, and authorized financial staff (Subdirector Adjunto with Financiero position). Budget item assignment to projects is available to all administrators.

PEF (Presupuesto de Egresos de la Federación)

What is PEF?

The PEF is Mexico’s annual federal budget, approved by Congress, that establishes spending authority for all government agencies. SMAF imports PEF data to ensure all expenses are charged against authorized budget classifications.

PEF Structure

The federal budget uses a complex classification system:
UR
string
Unidad Responsable - Responsible Unit code
UE
string
Unidad Ejecutora - Executing Unit code
EDO
string
Estado - State/geographic location code
FI
string
Finalidad - Purpose classification
FU
string
Función - Function classification
SF
string
Subfunción - Subfunction classification
RG
string
Región - Region code
AI
string
Actividad Institucional - Institutional Activity
PP
string
Programa Presupuestario - Budget Program
CP
string
Componente Presupuestario - Budget Component
PARTIDA
string
Partida Específica - Specific budget line item (e.g., “3801” for national travel)
TG
string
Tipo de Gasto - Type of expenditure (current, capital, etc.)
FF
string
Fuente de Financiamiento - Funding source
PPI
string
Programa Presupuestario Institucional - Institutional Budget Program

Importing PEF Data

Access Requirements

Navigate to Catálogos > PEF. Access is validated:
if ((lsRol == Dictionary.DIRECTOR_ADMINISTRACION) | 
    (lsRol == Dictionary.DIRECTOR_GRAL) |
    ((lsRol == Dictionary.SUBDIRECTOR_ADJUNTO) & (lsPuesto == Dictionary.PUESTO_FINANCIERO)))
{
    // Access granted
}
else
{
    Response.Redirect("../Home/Home.aspx", true);
}

One-Time Import Rule

The PEF can only be imported once per fiscal year:
int objPef = MngNegocioPef.Obtiene_pef();

if (objPef >= 1)
{
    clsFuncionesGral.Activa_Paneles(Panel1, false);
    lblTitle.Text = "Ya existe cargado un pef para este año, " +
                    "si desea agregar mas partidas al actual ingresar al " +
                    "modulo de adecuaciones Pef";
}
else
{
    clsFuncionesGral.Activa_Paneles(Panel1, true);
    lblTitle.Text = "Carga de archivo excel de pef anual " + Year;
}
Once the PEF is loaded for a fiscal year, the import interface is disabled. Additional budget items must be added through the Adecuaciones PEF module.

Excel File Preparation

1

Obtain Federal Budget Data

Acquire the official PEF allocation from SHCP (Secretaría de Hacienda y Crédito Público) for INAPESCA.
2

Format Excel Workbook

Organize data in an Excel file with the following structure:
ColumnFieldDescription
AURUnidad Responsable
BUEUnidad Ejecutora
CEDOEstado
DFIFinalidad
EFUFunción
FSFSubfunción
GRGRegión
HAIActividad Institucional
IPPPrograma Presupuestario
JCPComponente Presupuestario
KPARTIDAPartida Específica
LTGTipo de Gasto
MFFFuente de Financiamiento
NPPIPrograma Presupuestario Institucional
OPEFTotal Annual Amount
PENEROJanuary allocation
QFEBREROFebruary allocation
RMARZOMarch allocation
SABRILApril allocation
TMAYOMay allocation
UJUNIOJune allocation
VJULIOJuly allocation
WAGOSTOAugust allocation
XSEPTIEMBRESeptember allocation
YOCTUBREOctober allocation
ZNOVIEMBRENovember allocation
AADICIEMBREDecember allocation
3

Validate Data

Ensure:
  • All classification codes match federal standards
  • Monthly allocations sum to annual total
  • No empty cells in required columns
  • Numeric values for all budget amounts
4

Name the Worksheet

Note the exact name of the worksheet containing the data (e.g., “PEF2024”).

Upload Process

1

Access PEF Module

Navigate to Catálogos > PEF
2

Select Excel File

Click the file upload control and select your prepared Excel file.
String fileExtension = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower();
String[] allowedExtensions = { ".xlsx", ".xls" };
Supported formats: .xlsx, .xls
3

Enter Worksheet Name

In the “Nombre de Hoja excel a cargar” field, type the exact worksheet name.
if ((lsHoja == null) | (lsHoja == ""))
{
    alert('Debe indicar un nombre de hoja como aparece en su archivo de excel.');
    return;
}
4

Upload

Click the upload button (Excel icon) to begin import.
5

Processing

The system reads the Excel file and processes each row:
ds = MngDatosPef.Lee_Excel_Pef(
    Ruta + "/" + FileUpload1.FileName, 
    lsHoja, 
    fileExtension, 
    FileUpload1.FileName
).Tables[0];

Carga_PEF(ds, FileUpload1.FileName);
6

Confirmation

Success message appears: “PEF ha subido exitosamente.”The interface is then disabled for the remainder of the fiscal year.

Import Logic

The system processes each row of the Excel file:
public static void Carga_PEF(DataTable pdtTable, string psNombre)
{
    int conta = 0;
    foreach (DataRow row in pdtTable.Rows)
    {
        pef = new Pef();
        conta = 0;
        
        foreach (var item in row.ItemArray)
        {
            switch (conta)
            {
                case 0: pef.UR = item.ToString(); break;
                case 1: pef.UE = item.ToString(); break;
                case 2: pef.EDO = item.ToString(); break;
                case 3: pef.FI = item.ToString(); break;
                case 4: pef.FU = item.ToString(); break;
                case 5: pef.SF = item.ToString(); break;
                case 6: pef.RG = item.ToString(); break;
                case 7: pef.AI = item.ToString(); break;
                case 8: pef.PP = item.ToString(); break;
                case 9: pef.CP = item.ToString(); break;
                case 10: pef.PARTIDA = item.ToString(); break;
                case 11: pef.TG = item.ToString(); break;
                case 12: pef.FF = item.ToString(); break;
                case 13: pef.PPI = item.ToString(); break;
                case 14: pef.PEF = item.ToString(); break;
                case 15: pef.ENERO = item.ToString(); break;
                case 16: pef.FEBRERO = item.ToString(); break;
                case 17: pef.MARZO = item.ToString(); break;
                case 18: pef.ABRIL = item.ToString(); break;
                case 19: pef.MAYO = item.ToString(); break;
                case 20: pef.JUNIO = item.ToString(); break;
                case 21: pef.JULIO = item.ToString(); break;
                case 22: pef.AGOSTO = item.ToString(); break;
                case 23: pef.SEPTIEMBRE = item.ToString(); break;
                case 24: pef.OCTUBRE = item.ToString(); break;
                case 25: pef.NOVIEMBRE = item.ToString(); break;
                case 26: pef.DICIEMBRE = item.ToString(); break;
            }
            conta++;
        }
        
        // Insert based on whether PARTIDA is present
        if ((pef.PARTIDA == null) | (pef.PARTIDA == Dictionary.CADENA_NULA))
        {
            MngNegocioPef.Inserta_Pef_Detalle(pef, "1", lsUsuario, psNombre);
        }
        else
        {
            MngNegocioPef.Inserta_Pef(pef, "1");
        }
    }
}

File Storage

Uploaded files are stored in a year-specific directory:
public static void Valida_Carpeta()
{
    string raiz = HttpContext.Current.Server.MapPath("..") + "\\CONTABLE\\";
    if (!Directory.Exists(raiz + Year)) 
        Directory.CreateDirectory(raiz + Year);
    
    Ruta = raiz + Year;
    lsUbicacion = "CONTABLE/" + Year;
}
Example path: /InapescaWeb/CONTABLE/2024/PEF_2024.xlsx

Budget Classifications

Chapter Structure (Capítulos)

Budget items are organized into chapters following federal guidelines:
Salaries, wages, and personnel benefits
Office supplies, fuel, consumables
  • 3801: National Travel (Viáticos Nacionales)
  • 3802: International Travel (Viáticos al Extranjero)
  • 3851: Installation, Relocation, and Travel Expenses
Grants and transfers to other entities
Furniture, vehicles, equipment
Construction and infrastructure

Partidas Presupuestales

Specific budget line items used for expense tracking:
PartidaDescriptionChapterTypical Use
3801Viáticos Nacionales3000Domestic travel expenses
3802Viáticos Internacionales3000International travel
3851Gastos de Instalación3000Relocation expenses
2141Materiales y Útiles2000Office supplies
2611Combustibles2000Fuel for vehicles

Assigning Budget Items to Projects

Access

Navigate to Catálogos > Proyecto Partida to assign budget items to projects.

Assignment Process

1

Select Administrative Unit

Choose the CRIP or directorate containing the project.
dplUnidadesAdministrativas.DataSource = MngNegocioAdscripcion.ObtieneCrips("1", "");
2

Select Project

Choose the project to assign budget items.
dplProyectos.DataSource = MngNegocioProyecto.ListaProyectoCrip(lsUnidad);
3

Select Component

Choose the budget component (usually inherited from program).
4

Select Chapter

Choose the budget chapter (e.g., 3000 for General Services).
protected void dplCapitulos_SelectedIndexChanged(object sender, EventArgs e)
{
    // Load sub-chapters for selected chapter
    dplSUbCapitulo.DataSource = GetSubChapters(dplCapitulos.SelectedValue);
}
5

Select Sub-Chapter (if applicable)

Some chapters have sub-categories.
6

Select Partida

Click the partida field to open the modal selector showing available budget items.
<cc1:ModalPopupExtender 
    ID="txtPartida_ModalPopupExtender" 
    TargetControlID="txtPartida" 
    PopupControlID="pnlPartidasPeaje" 
    BackgroundCssClass="modalBackground"
/>
7

Allocate Monthly Budgets

Enter budget amounts for each month:
  • Enero (January)
  • Febrero (February)
  • Marzo (March)
  • Abril (April)
  • Mayo (May)
  • Junio (June)
  • Julio (July)
  • Agosto (August)
  • Septiembre (September)
  • Octubre (October)
  • Noviembre (November)
  • Diciembre (December)
Monthly allocations enable time-based budget controls and prevent overspending in specific periods.
8

Save Assignment

Click Guardar to save the budget item assignment.

Partida Selector Interface

The modal popup displays budget items in a tree structure:
<asp:Panel ID="pnlPartidasPeaje" runat="server" 
    Style="display: none; background: white; width: 80%; height: auto">
    <div class="modal-header">
        <table border="0" width="100%">
            <tr>
                <td>Partidas Presupuestales Inapesca</td>
                <td align="right">
                    <asp:ImageButton ID="ImageButton4" runat="server" 
                        ImageUrl="~/Resources/cancelar.gif" />
                </td>
            </tr>
        </table>
    </div>
    <div class="Contenedor">
        <asp:TreeView ID="tvPartidasPeaje" runat="server" 
            ShowCheckBoxes="None" 
            ShowLines="false"
            OnSelectedNodeChanged="tvPartidasPeaje_SelectedNodeChanged">
        </asp:TreeView>
    </div>
</asp:Panel>

Budget Control and Validation

Monthly Budget Tracking

SMAF validates expenses against monthly allocations:
  1. Monthly Caps: Prevents charging expenses beyond the monthly budget
  2. Cumulative Tracking: Monitors year-to-date spending
  3. Remaining Balance: Shows available budget for each partida/month combination

Validation Rules

Budget Validation Enforced:
  • Cannot exceed monthly allocation for a partida
  • Cannot exceed annual allocation for a partida
  • Cannot use partidas not assigned to the project
  • Cannot charge to closed fiscal periods

Best Practices

Validate PEF Before Import

Cross-reference Excel data with official SHCP documentation before uploading.

Test with Sample Data

Import a small subset first to verify column mapping and format.

Document Worksheet Names

Keep a record of worksheet names used for each fiscal year’s import.

Distribute Budgets Realistically

Allocate monthly budgets based on expected spending patterns, not uniform distribution.

Common Import Errors

Error: “Tipo de Archivo no valido.”Solution: Ensure file extension is .xlsx or .xls. Save Excel files in compatible format, not CSV or other types.
Error: Import fails silently or throws exception.Solution: Verify the worksheet name is entered exactly as it appears in Excel, including capitalization and spaces.
Error: “Ya existe cargado un pef para este año…”Solution: This is expected behavior. Use the Adecuaciones PEF module to add budget items after initial load.
Error: Import succeeds but data is misaligned.Solution: Ensure Excel has exactly 27 columns in the correct order. Do not add or remove columns.

Programs

Link programs to budget components

Projects

Assign partidas to active projects

Expense Tracking

Charge expenses against budget items

Build docs developers (and LLMs) love