<?php

/**
 * qaux_mov actions.
 *
 * @package    contab2
 * @subpackage qaux_mov
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class qaux_movActions extends sfQuery {

    protected $table_names = array(
        'CN_LIBRO_AUX'
    );
    protected $table_join_ids = array();
    protected $fields = array(
        'CN_LIBRO_AUX' =>
        array(
            'cuenta' => 'cuenta',
            'cod_aux' => 'cod_aux',
            'subauxiliar' => 'subauxiliar',
            'nitocc' => 'nitocc',
            'id_auxiliar' => 'id_auxiliar',
            'id_mae_ter' => 'id_mae_ter',
            'nombre_cuenta' => 'nombre_cuenta',
            'id_cia' => 'id_cia',
            'id_cen_op' => 'id_cen_op',
            'id_vigencia' => 'id_vigencia',
            'id_periodo_contable' => 'id_periodo_contable',
            'id_mov_cont' => 'id_mov_cont',
            'fecha_cad' => 'fecha_cad',
            'id_cad' => 'id_cad',
            'id_documento' => 'id_documento',
            'descr_mto' => 'descr_mto',
            'debito' => 'debito',
            'credito' => 'credito'
        )
    );
    protected $table_field_conditions = array(
        'CN_LIBRO_AUX' => array(
            'id_cia' => array('=' => array('id_cia')),
            'id_vigencia' => array('=' => array('id_vigencia')),
            'id_cen_op' => array('=' => array('id_cen_op')),
            'id_periodo_contable' => array('=' => array('id_periodo_contable')),
            'cuenta' => array('BETWEEN' => array('subc_ini', 'subc_fin')),
            'id_auxiliar' => array('=' => array('id_auxiliar')),
            'id_mae_ter' => array('=' => array('id_mae_ter')),
            'rownum,start' => array('>' => array('_startRow')),
            'rownum,end' => array('<=' => array('_endRow'))
        )
    );

    /*  protected $table_field_or_conditions = null;
      protected $query_qualifier = 'DISTINCT'; */

    /* service sum */
    protected $summatory_data = array(
        'CN_LIBRO_AUX' =>
        array(
            'fields' => array('debito', 'credito'),
            'labels' => array('cuenta,Total'),
            'condition,cuenta' => array('LENGTH(', 'field', ') = 6')
//            ,
//            'condition,id_auxiliar' => array('field', ' IS NULL'),
//            'condition,id_mae_ter' => array('field', ' IS NULL')
        )
    );

}
