Skip to main content

Overview

Updates a payroll novelty record in tab_novedades identified by year, month, and period.

Signature

fun_update_novedades(
    wano_nom INTEGER,
    wmes_nom INTEGER,
    wper_nom INTEGER,
    wid_emplea INTEGER,
    wid_concepto INTEGER,
    wval_dias_trab INTEGER,
    wval_nomina NUMERIC
) RETURNS VOID

Parameters

wano_nom
INTEGER
required
Payroll year (Primary Key)
wmes_nom
INTEGER
required
Payroll month (Primary Key)
wper_nom
INTEGER
required
Payroll period (Primary Key)
wid_emplea
INTEGER
required
New employee ID
wid_concepto
INTEGER
required
New concept ID
wval_dias_trab
INTEGER
required
New number of days worked
wval_nomina
NUMERIC
required
New payroll value

Returns

VOID (no return value)

Example Usage

-- Update a novelty
SELECT fun_update_novedades(
    2024,
    3,
    1,
    1,
    1,
    20,
    4500000
);

Validation Rules

  • The novelty identified by year, month, and period must exist
  • Employee ID must exist in tab_emplea
  • Concept ID must exist in tab_conceptos
  • Days worked must be positive
  • Payroll value must be positive

Notes

Updating the primary key values (year, month, period) will create a new record rather than updating the existing one.

Source

source/func/novedades/fun_update_novedades.sql

Build docs developers (and LLMs) love