object srvContabilidad: TsrvContabilidad
  OldCreateOrder = True
  OnCreate = DARemoteServiceCreate
  SessionManager = dmServer.SessionManager
  ServiceSchema = schContabilidad
  ServiceDataStreamer = Bin2DataStreamer
  ExportedDataTables = <>
  BeforeAcquireConnection = DataAbstractServiceBeforeAcquireConnection
  Height = 283
  Width = 351
  object Diagrams: TDADiagrams
    Left = 150
    Top = 90
    DiagramData = 
      '<Diagrams>'#13#10'  <Diagram Name="New Diagram" Left="200" Top="200" W' +
      'idth="400" Height="300">'#13#10'    <Entity Name="Balances" Left="0,00' +
      '" Top="0,00" />'#13#10'  </Diagram>'#13#10'</Diagrams>'#13#10
  end
  object DataDictionary: TDADataDictionary
    Fields = <
      item
        Name = 'Ejercicios_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_CONT_EJERCICIOS_ID'
        Required = True
        DisplayLabel = 'ID'
        ServerAutoRefresh = True
      end
      item
        Name = 'Balances_REF_BALANCE'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Balances_NATURALEZA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Balances_NIVEL1'
        DataType = datString
        Size = 15
      end
      item
        Name = 'Balances_DESCRIPCION1'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Balances_NIVEL2'
        DataType = datString
        Size = 15
      end
      item
        Name = 'Balances_DESCRIPCION2'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Balances_NIVEL3'
        DataType = datString
        Size = 15
      end
      item
        Name = 'Balances_DESCRIPCION3'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Epigrafes_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_CONT_EPIGRAFES_ID'
        Required = True
        ServerAutoRefresh = True
      end
      item
        Name = 'Epigrafes_REF_EPIGRAFE'
        DataType = datString
        Size = 6
      end
      item
        Name = 'Epigrafes_ID_PADRE'
        DataType = datInteger
      end
      item
        Name = 'Epigrafes_DESCRIPCION'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Epigrafes_ID_EJERCICIO'
        DataType = datInteger
      end
      item
        Name = 'CuentasEspeciales_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_CONT_CUENTAS_ESP_ID'
        Required = True
        DisplayLabel = 'ID'
      end
      item
        Name = 'CuentasEspeciales_REFERENCIA'
        DataType = datString
        Size = 6
      end
      item
        Name = 'CuentasEspeciales_DESCRIPCION'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Cuentas_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_CONT_CUENTAS_ID'
        Required = True
        DisplayLabel = 'ID'
        ServerAutoRefresh = True
      end
      item
        Name = 'Cuentas_REF_CUENTA'
        DataType = datString
        Size = 10
      end
      item
        Name = 'Cuentas_ID_EJERCICIO'
        DataType = datInteger
      end
      item
        Name = 'Cuentas_ID_EPIGRAFE'
        DataType = datInteger
      end
      item
        Name = 'Cuentas_DESCRIPCION'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Cuentas_ID_BALANCE'
        DataType = datInteger
      end
      item
        Name = 'Cuentas_ID_CUENTA_ESPECIAL'
        DataType = datInteger
      end
      item
        Name = 'SubCuentas_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_CONT_SUBCUENTAS_ID'
        Required = True
        DisplayLabel = 'ID'
        ServerAutoRefresh = True
      end
      item
        Name = 'SubCuentas_REF_SUBCUENTA'
        DataType = datString
        Size = 15
      end
      item
        Name = 'SubCuentas_DESCRIPCION'
        DataType = datString
        Size = 255
      end
      item
        Name = 'SubCuentas_ID_CUENTA'
        DataType = datInteger
      end
      item
        Name = 'SubCuentas_ID_EJERCICIO'
        DataType = datInteger
      end
      item
        Name = 'Asientos_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_CONT_ASIENTOS_ID'
        Required = True
        DisplayLabel = 'ID'
        ServerAutoRefresh = True
      end
      item
        Name = 'Asientos_ID_ASIENTO_COMPENSADO'
        DataType = datInteger
      end
      item
        Name = 'Asientos_ID_SUBCUENTA'
        DataType = datInteger
      end
      item
        Name = 'Asientos_FECHA_ASIENTO'
        DataType = datDateTime
      end
      item
        Name = 'Asientos_CONCEPTO'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Asientos_PUNTEADO'
        DataType = datSmallInt
      end
      item
        Name = 'Asientos_DEBE'
        DataType = datCurrency
      end
      item
        Name = 'Asientos_HABER'
        DataType = datCurrency
      end
      item
        Name = 'Epigrafes_EPIGRAFE_PADRE'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Cuentas_EPIGRAFE'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Cuentas_BALANCE'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Cuentas_CUENTA_ESPECIAL'
        DataType = datString
        Size = 255
      end
      item
        Name = 'SubCuentas_CUENTA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'SubCuentas_DEBE'
        DataType = datCurrency
      end
      item
        Name = 'SubCuentas_HABER'
        DataType = datCurrency
      end
      item
        Name = 'SubCuentas_SALDO'
        DataType = datCurrency
      end
      item
        Name = 'Asientos_ID_APUNTE'
        DataType = datInteger
        DisplayLabel = 'ID_APUNTE'
      end
      item
        Name = 'Asientos_ID_ASIENTO'
        DataType = datInteger
      end
      item
        Name = 'Asientos_ORDEN_ASIENTO'
        DataType = datInteger
      end
      item
        Name = 'Asientos_SUBCUENTA'
        DataType = datString
        Size = 15
      end
      item
        Name = 'Asientos_ORDEN'
        DataType = datInteger
      end
      item
        Name = 'Apuntes_ID'
        DataType = datAutoInc
        GeneratorName = 'GEN_CONT_APUNTES_ID'
        Required = True
        DisplayLabel = 'ID'
      end
      item
        Name = 'Apuntes_ID_ASIENTO'
        DataType = datInteger
      end
      item
        Name = 'Apuntes_ID_SUBCUENTA'
        DataType = datInteger
      end
      item
        Name = 'Apuntes_CONCEPTO'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Apuntes_PUNTEADO'
        DataType = datSmallInt
      end
      item
        Name = 'Apuntes_DEBE'
        DataType = datCurrency
      end
      item
        Name = 'Apuntes_HABER'
        DataType = datCurrency
      end
      item
        Name = 'Apuntes_ID_FACTURA'
        DataType = datInteger
      end
      item
        Name = 'Apuntes_ID_RECIBO'
        DataType = datInteger
      end
      item
        Name = 'Apuntes_REF_SUBCUENTA'
        DataType = datString
        Size = 15
      end
      item
        Name = 'Apuntes_SUBCUENTA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Epigrafes_ID_EMPRESA'
        DataType = datInteger
      end
      item
        Name = 'Cuentas_ID_EMPRESA'
        DataType = datInteger
      end
      item
        Name = 'Asientos_ID_FACTURA'
        DataType = datInteger
      end
      item
        Name = 'Asientos_ID_RECIBO'
        DataType = datInteger
      end
      item
        Name = 'Diario_ID_APUNTE'
        DataType = datInteger
      end
      item
        Name = 'Diario_ID_ASIENTO'
        DataType = datInteger
      end
      item
        Name = 'Diario_ID_FACTURA'
        DataType = datInteger
      end
      item
        Name = 'Diario_ID_PAGO'
        DataType = datInteger
      end
      item
        Name = 'Diario_ORDEN_ASIENTO'
        DataType = datInteger
        Alignment = taRightJustify
      end
      item
        Name = 'Diario_FECHA_ASIENTO'
        DataType = datDateTime
      end
      item
        Name = 'Diario_ID_SUBCUENTA'
        DataType = datInteger
      end
      item
        Name = 'Diario_REF_SUBCUENTA'
        DataType = datString
        Size = 15
      end
      item
        Name = 'Diario_SUBCUENTA'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Diario_ID_EJERCICIO'
        DataType = datInteger
      end
      item
        Name = 'Diario_CONCEPTO'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Diario_DOCUMENTO'
        DataType = datString
        Size = 255
      end
      item
        Name = 'Diario_DEBE'
        DataType = datCurrency
        DisplayLabel = 'DEBE'
        Alignment = taRightJustify
      end
      item
        Name = 'Diario_HABER'
        DataType = datCurrency
        Alignment = taRightJustify
      end
      item
        Name = 'Diario_PUNTEADO'
        DataType = datSmallInt
      end>
    Left = 150
    Top = 24
  end
  object schContabilidad: TDASchema
    ConnectionManager = dmServer.ConnectionManager
    DataDictionary = DataDictionary
    Diagrams = Diagrams
    Datasets = <
      item
        Params = <
          item
            Name = 'REFERENCIA'
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_EJERCICIO'
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            Name = 'IBX'
            SQL = 
              'select ID'#10'from cont_cuentas'#10'where ref_cuenta = :REFERENCIA'#10'and i' +
              'd_ejercicio = :ID_EJERCICIO'#10#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end>
          end>
        Name = 'DarIDCuenta'
        Fields = <
          item
            Name = 'ID'
            DataType = datInteger
          end>
      end
      item
        Params = <
          item
            Name = 'ID_EMPRESA'
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'ID_TIENDA'
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            Name = 'IBX'
            SQL = 
              'select CODIGO_CONTABLE'#10'from empresas_tiendas'#10'where ID_EMPRESA = ' +
              ':ID_EMPRESA'#10'and ID = :ID_TIENDA'#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'CODIGO_CONTABLE'
                TableField = 'CODIGO_CONTABLE'
              end>
          end>
        Name = 'DarCodigoContableTienda'
        Fields = <
          item
            Name = 'CODIGO_CONTABLE'
            DataType = datString
            Size = 2
          end>
      end
      item
        Params = <
          item
            Name = 'ID_EJERCICIO'
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REF_CUENTA'
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            Name = 'IBX'
            SQL = 
              'select max(cast(substr(cont_subcuentas.ref_subcuenta, 6, 10) as ' +
              'Integer))'#10'from cont_subcuentas'#10'left join cont_cuentas on cont_cu' +
              'entas.id = cont_subcuentas.id_cuenta'#10'where cont_subcuentas.id_ej' +
              'ercicio = :ID_EJERCICIO'#10'and cont_cuentas.ref_cuenta = :REF_CUENT' +
              'A'#10#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'MAX'
                TableField = 'MAX'
              end>
          end>
        Name = 'DarMaxRefSubCuentaProv'
        Fields = <
          item
            Name = 'MAX'
            DataType = datInteger
          end>
      end
      item
        Params = <
          item
            Name = 'ID_CONTACTO'
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            Name = 'IBX'
            SQL = 
              'select COUNT(ID)'#10'from CONT_SUBCUENTAS'#10'where ID_CONTACTO = :ID_CO' +
              'NTACTO'#10'and {where}'#10#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'COUNT'
                TableField = 'COUNT'
              end>
          end>
        Name = 'ExisteSubCuenta'
        Fields = <
          item
            Name = 'COUNT'
            DataType = datInteger
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'V_CONT_DIARIO'
            Name = 'IBX'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID_APUNTE'
                TableField = 'ID_APUNTE'
              end
              item
                DatasetField = 'ID_ASIENTO'
                TableField = 'ID_ASIENTO'
              end
              item
                DatasetField = 'ID_FACTURA'
                TableField = 'ID_FACTURA'
              end
              item
                DatasetField = 'ORDEN_ASIENTO'
                TableField = 'ORDEN_ASIENTO'
              end
              item
                DatasetField = 'FECHA_ASIENTO'
                TableField = 'FECHA_ASIENTO'
              end
              item
                DatasetField = 'ID_SUBCUENTA'
                TableField = 'ID_SUBCUENTA'
              end
              item
                DatasetField = 'REF_SUBCUENTA'
                TableField = 'REF_SUBCUENTA'
              end
              item
                DatasetField = 'ID_EJERCICIO'
                TableField = 'ID_EJERCICIO'
              end
              item
                DatasetField = 'CONCEPTO'
                TableField = 'CONCEPTO'
              end
              item
                DatasetField = 'DOCUMENTO'
                TableField = 'DOCUMENTO'
              end
              item
                DatasetField = 'DEBE'
                TableField = 'DEBE'
              end
              item
                DatasetField = 'HABER'
                TableField = 'HABER'
              end
              item
                DatasetField = 'PUNTEADO'
                TableField = 'PUNTEADO'
              end
              item
                DatasetField = 'ID_PAGO'
                TableField = 'ID_PAGO'
              end
              item
                DatasetField = 'SUBCUENTA'
                TableField = 'SUBCUENTA'
              end
              item
                DatasetField = 'TIPO'
                TableField = 'TIPO'
              end>
          end>
        Name = 'Diario'
        Fields = <
          item
            Name = 'ID_APUNTE'
            DataType = datInteger
            DictionaryEntry = 'Diario_ID_APUNTE'
            InPrimaryKey = True
          end
          item
            Name = 'ID_ASIENTO'
            DataType = datInteger
            DictionaryEntry = 'Diario_ID_ASIENTO'
          end
          item
            Name = 'ID_FACTURA'
            DataType = datInteger
            DictionaryEntry = 'Diario_ID_FACTURA'
          end
          item
            Name = 'ID_PAGO'
            DataType = datInteger
            DictionaryEntry = 'Diario_ID_PAGO'
          end
          item
            Name = 'TIPO'
            DataType = datString
            Size = 1
          end
          item
            Name = 'ORDEN_ASIENTO'
            DataType = datInteger
            DictionaryEntry = 'Diario_ORDEN_ASIENTO'
          end
          item
            Name = 'FECHA_ASIENTO'
            DataType = datDateTime
            DictionaryEntry = 'Diario_FECHA_ASIENTO'
          end
          item
            Name = 'ID_SUBCUENTA'
            DataType = datInteger
            DictionaryEntry = 'Diario_ID_SUBCUENTA'
          end
          item
            Name = 'REF_SUBCUENTA'
            DataType = datString
            Size = 15
            DictionaryEntry = 'Diario_REF_SUBCUENTA'
          end
          item
            Name = 'SUBCUENTA'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Diario_SUBCUENTA'
          end
          item
            Name = 'ID_EJERCICIO'
            DataType = datInteger
            DictionaryEntry = 'Diario_ID_EJERCICIO'
          end
          item
            Name = 'CONCEPTO'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Diario_CONCEPTO'
          end
          item
            Name = 'DOCUMENTO'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Diario_DOCUMENTO'
          end
          item
            Name = 'DEBE'
            DataType = datCurrency
            DictionaryEntry = 'Diario_DEBE'
          end
          item
            Name = 'HABER'
            DataType = datCurrency
            DictionaryEntry = 'Diario_HABER'
          end
          item
            Name = 'PUNTEADO'
            DataType = datSmallInt
            DictionaryEntry = 'Diario_PUNTEADO'
          end
          item
            Name = 'SALDO'
            DataType = datCurrency
            LogChanges = False
            DisplayLabel = 'Saldo'
            Alignment = taRightJustify
            Calculated = True
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_APUNTES'
            Name = 'IBX'
            SQL = 
              'SELECT'#10'    CONT_APUNTES.ID,'#10'    CONT_APUNTES.ID_ASIENTO,'#10'    CON' +
              'T_APUNTES.ID_SUBCUENTA,'#10'    CONT_APUNTES.NUM_ORDEN,'#10'    CONT_SUB' +
              'CUENTAS.REF_SUBCUENTA,'#10'    CONT_SUBCUENTAS.DESCRIPCION as SUBCUE' +
              'NTA,'#10'    CONT_APUNTES.CONCEPTO,'#10'    CONT_APUNTES.DOCUMENTO,'#10'    ' +
              'CONT_APUNTES.DEBE,'#10'    CONT_APUNTES.HABER,'#10'    CONT_APUNTES.PUNT' +
              'EADO'#10#10'FROM CONT_APUNTES'#10'LEFT JOIN CONT_SUBCUENTAS ON (CONT_SUBCU' +
              'ENTAS.ID = CONT_APUNTES.ID_SUBCUENTA)'#10'WHERE {Where}'#10'ORDER BY CON' +
              'T_APUNTES.ID'#10#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'ID_ASIENTO'
                TableField = 'ID_ASIENTO'
              end
              item
                DatasetField = 'ID_SUBCUENTA'
                TableField = 'ID_SUBCUENTA'
              end
              item
                DatasetField = 'NUM_ORDEN'
                TableField = 'NUM_ORDEN'
              end
              item
                DatasetField = 'REF_SUBCUENTA'
                TableField = '<unknown>'
                SQLOrigin = 'REF_SUBCUENTA'
              end
              item
                DatasetField = 'SUBCUENTA'
                TableField = '<unknown>'
                SQLOrigin = 'SUBCUENTA'
              end
              item
                DatasetField = 'CONCEPTO'
                TableField = 'CONCEPTO'
              end
              item
                DatasetField = 'DOCUMENTO'
                TableField = 'DOCUMENTO'
              end
              item
                DatasetField = 'DEBE'
                TableField = 'DEBE'
              end
              item
                DatasetField = 'HABER'
                TableField = 'HABER'
              end
              item
                DatasetField = 'PUNTEADO'
                TableField = 'PUNTEADO'
              end>
          end>
        Name = 'Apuntes'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_APUNTES_ID'
            DictionaryEntry = 'Apuntes_ID'
            InPrimaryKey = True
          end
          item
            Name = 'ID_ASIENTO'
            DataType = datInteger
            DictionaryEntry = 'Apuntes_ID_ASIENTO'
          end
          item
            Name = 'ID_SUBCUENTA'
            DataType = datInteger
            DictionaryEntry = 'Apuntes_ID_SUBCUENTA'
          end
          item
            Name = 'NUM_ORDEN'
            DataType = datInteger
          end
          item
            Name = 'REF_SUBCUENTA'
            DataType = datString
            Size = 15
            DictionaryEntry = 'Apuntes_REF_SUBCUENTA'
          end
          item
            Name = 'SUBCUENTA'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Apuntes_SUBCUENTA'
          end
          item
            Name = 'CONCEPTO'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Apuntes_CONCEPTO'
          end
          item
            Name = 'DOCUMENTO'
            DataType = datString
            Size = 255
          end
          item
            Name = 'DEBE'
            DataType = datCurrency
            DictionaryEntry = 'Apuntes_DEBE'
          end
          item
            Name = 'HABER'
            DataType = datCurrency
            DictionaryEntry = 'Apuntes_HABER'
          end
          item
            Name = 'PUNTEADO'
            DataType = datSmallInt
            DictionaryEntry = 'Apuntes_PUNTEADO'
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_ASIENTOS'
            Name = 'IBX'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'FECHA_ASIENTO'
                TableField = 'FECHA_ASIENTO'
              end
              item
                DatasetField = 'ORDEN'
                TableField = 'ORDEN'
              end
              item
                DatasetField = 'ID_FACTURA'
                TableField = 'ID_FACTURA'
              end
              item
                DatasetField = 'ID_PAGO'
                TableField = 'ID_PAGO'
              end
              item
                DatasetField = 'TIPO'
                TableField = 'TIPO'
              end>
          end>
        Name = 'Asientos'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_ASIENTOS_ID'
            DictionaryEntry = 'Asientos_ID'
            InPrimaryKey = True
          end
          item
            Name = 'FECHA_ASIENTO'
            DataType = datDateTime
            DictionaryEntry = 'Asientos_FECHA_ASIENTO'
          end
          item
            Name = 'ORDEN'
            DataType = datInteger
            DictionaryEntry = 'Asientos_ORDEN'
          end
          item
            Name = 'ID_FACTURA'
            DataType = datInteger
            DictionaryEntry = 'Asientos_ID_FACTURA'
          end
          item
            Name = 'ID_PAGO'
            DataType = datInteger
          end
          item
            Name = 'TIPO'
            DataType = datString
            Size = 1
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'V_CONT_SUBCUENTAS'
            Name = 'IBX'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'REF_SUBCUENTA'
                TableField = 'REF_SUBCUENTA'
              end
              item
                DatasetField = 'DESCRIPCION'
                TableField = 'DESCRIPCION'
              end
              item
                DatasetField = 'ID_EJERCICIO'
                TableField = 'ID_EJERCICIO'
              end
              item
                DatasetField = 'ID_CONTACTO'
                TableField = 'ID_CONTACTO'
              end
              item
                DatasetField = 'ID_CUENTA'
                TableField = 'ID_CUENTA'
              end
              item
                DatasetField = 'REF_CUENTA'
                TableField = 'REF_CUENTA'
              end
              item
                DatasetField = 'CUENTA'
                TableField = 'CUENTA'
              end
              item
                DatasetField = 'DEBE'
                TableField = 'DEBE'
              end
              item
                DatasetField = 'HABER'
                TableField = 'HABER'
              end
              item
                DatasetField = 'SALDO'
                TableField = 'SALDO'
              end>
          end>
        Name = 'SubCuentas'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_SUBCUENTAS_ID'
            DictionaryEntry = 'SubCuentas_ID'
            InPrimaryKey = True
          end
          item
            Name = 'REF_SUBCUENTA'
            DataType = datString
            Size = 15
            DictionaryEntry = 'SubCuentas_REF_SUBCUENTA'
          end
          item
            Name = 'DESCRIPCION'
            DataType = datString
            Size = 255
            DictionaryEntry = 'SubCuentas_DESCRIPCION'
          end
          item
            Name = 'ID_EJERCICIO'
            DataType = datInteger
            DictionaryEntry = 'SubCuentas_ID_EJERCICIO'
          end
          item
            Name = 'ID_CONTACTO'
            DataType = datInteger
          end
          item
            Name = 'ID_CUENTA'
            DataType = datInteger
            DictionaryEntry = 'SubCuentas_ID_CUENTA'
          end
          item
            Name = 'REF_CUENTA'
            DataType = datString
            Size = 10
          end
          item
            Name = 'CUENTA'
            DataType = datString
            Size = 255
            DictionaryEntry = 'SubCuentas_CUENTA'
          end
          item
            Name = 'DEBE'
            DataType = datCurrency
            DictionaryEntry = 'SubCuentas_DEBE'
          end
          item
            Name = 'HABER'
            DataType = datCurrency
            DictionaryEntry = 'SubCuentas_HABER'
          end
          item
            Name = 'SALDO'
            DataType = datCurrency
            DictionaryEntry = 'SubCuentas_SALDO'
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'V_CONT_CUENTAS'
            Name = 'IBX'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'REF_CUENTA'
                TableField = 'REF_CUENTA'
              end
              item
                DatasetField = 'ID_EJERCICIO'
                TableField = 'ID_EJERCICIO'
              end
              item
                DatasetField = 'DESCRIPCION'
                TableField = 'DESCRIPCION'
              end
              item
                DatasetField = 'ID_EPIGRAFE'
                TableField = 'ID_EPIGRAFE'
              end
              item
                DatasetField = 'EPIGRAFE'
                TableField = 'EPIGRAFE'
              end
              item
                DatasetField = 'ID_BALANCE'
                TableField = 'ID_BALANCE'
              end
              item
                DatasetField = 'BALANCE'
                TableField = 'BALANCE'
              end
              item
                DatasetField = 'ID_CUENTA_ESPECIAL'
                TableField = 'ID_CUENTA_ESPECIAL'
              end
              item
                DatasetField = 'CUENTA_ESPECIAL'
                TableField = 'CUENTA_ESPECIAL'
              end>
          end>
        Name = 'Cuentas'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_CUENTAS_ID'
            DictionaryEntry = 'Cuentas_ID'
            InPrimaryKey = True
          end
          item
            Name = 'REF_CUENTA'
            DataType = datString
            Size = 10
            DictionaryEntry = 'Cuentas_REF_CUENTA'
          end
          item
            Name = 'ID_EJERCICIO'
            DataType = datInteger
            DictionaryEntry = 'Cuentas_ID_EJERCICIO'
          end
          item
            Name = 'DESCRIPCION'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Cuentas_DESCRIPCION'
          end
          item
            Name = 'ID_EPIGRAFE'
            DataType = datInteger
            DictionaryEntry = 'Cuentas_ID_EPIGRAFE'
          end
          item
            Name = 'EPIGRAFE'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Cuentas_EPIGRAFE'
          end
          item
            Name = 'ID_BALANCE'
            DataType = datInteger
            DictionaryEntry = 'Cuentas_ID_BALANCE'
          end
          item
            Name = 'BALANCE'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Cuentas_BALANCE'
          end
          item
            Name = 'ID_CUENTA_ESPECIAL'
            DataType = datInteger
            DictionaryEntry = 'Cuentas_ID_CUENTA_ESPECIAL'
          end
          item
            Name = 'CUENTA_ESPECIAL'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Cuentas_CUENTA_ESPECIAL'
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_CUENTAS_ESPECIALES'
            Name = 'IBX'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'REFERENCIA'
                TableField = 'REFERENCIA'
              end
              item
                DatasetField = 'DESCRIPCION'
                TableField = 'DESCRIPCION'
              end>
          end>
        Name = 'CuentasEspeciales'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_CUENTAS_ESP_ID'
            DictionaryEntry = 'CuentasEspeciales_ID'
            InPrimaryKey = True
          end
          item
            Name = 'REFERENCIA'
            DataType = datString
            Size = 6
            DictionaryEntry = 'CuentasEspeciales_REFERENCIA'
          end
          item
            Name = 'DESCRIPCION'
            DataType = datString
            Size = 255
            DictionaryEntry = 'CuentasEspeciales_DESCRIPCION'
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'V_CONT_EPIGRAFES'
            Name = 'IBX'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'REF_EPIGRAFE'
                TableField = 'REF_EPIGRAFE'
              end
              item
                DatasetField = 'DESCRIPCION'
                TableField = 'DESCRIPCION'
              end
              item
                DatasetField = 'ID_EJERCICIO'
                TableField = 'ID_EJERCICIO'
              end
              item
                DatasetField = 'ID_PADRE'
                TableField = 'ID_PADRE'
              end
              item
                DatasetField = 'EPIGRAFE_PADRE'
                TableField = 'EPIGRAFE_PADRE'
              end>
          end>
        Name = 'Epigrafes'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_EPIGRAFES_ID'
            ServerAutoRefresh = True
            DictionaryEntry = 'Epigrafes_ID'
            InPrimaryKey = True
          end
          item
            Name = 'REF_EPIGRAFE'
            DataType = datString
            Size = 6
            DictionaryEntry = 'Epigrafes_REF_EPIGRAFE'
          end
          item
            Name = 'DESCRIPCION'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Epigrafes_DESCRIPCION'
          end
          item
            Name = 'ID_EJERCICIO'
            DataType = datInteger
            DictionaryEntry = 'Epigrafes_ID_EJERCICIO'
          end
          item
            Name = 'ID_PADRE'
            DataType = datInteger
            DictionaryEntry = 'Epigrafes_ID_PADRE'
          end
          item
            Name = 'EPIGRAFE_PADRE'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Epigrafes_EPIGRAFE_PADRE'
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            TargetTable = 'CONT_BALANCES'
            StatementType = stAutoSQL
            ColumnMappings = <
              item
                DatasetField = 'ID'
                TableField = 'ID'
              end
              item
                DatasetField = 'REF_BALANCE'
                TableField = 'REF_BALANCE'
              end
              item
                DatasetField = 'NATURALEZA'
                TableField = 'NATURALEZA'
              end
              item
                DatasetField = 'NIVEL1'
                TableField = 'NIVEL1'
              end
              item
                DatasetField = 'DESCRIPCION1'
                TableField = 'DESCRIPCION1'
              end
              item
                DatasetField = 'NIVEL2'
                TableField = 'NIVEL2'
              end
              item
                DatasetField = 'DESCRIPCION2'
                TableField = 'DESCRIPCION2'
              end
              item
                DatasetField = 'NIVEL3'
                TableField = 'NIVEL3'
              end
              item
                DatasetField = 'DESCRIPCION3'
                TableField = 'DESCRIPCION3'
              end>
          end>
        Name = 'Balances'
        Fields = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_EJERCICIOS_ID'
            ServerAutoRefresh = True
            DictionaryEntry = 'Ejercicios_ID'
            InPrimaryKey = True
          end
          item
            Name = 'REF_BALANCE'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Balances_REF_BALANCE'
          end
          item
            Name = 'NATURALEZA'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Balances_NATURALEZA'
          end
          item
            Name = 'NIVEL1'
            DataType = datString
            Size = 15
            DictionaryEntry = 'Balances_NIVEL1'
          end
          item
            Name = 'DESCRIPCION1'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Balances_DESCRIPCION1'
          end
          item
            Name = 'NIVEL2'
            DataType = datString
            Size = 15
            DictionaryEntry = 'Balances_NIVEL2'
          end
          item
            Name = 'DESCRIPCION2'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Balances_DESCRIPCION2'
          end
          item
            Name = 'NIVEL3'
            DataType = datString
            Size = 15
            DictionaryEntry = 'Balances_NIVEL3'
          end
          item
            Name = 'DESCRIPCION3'
            DataType = datString
            Size = 255
            DictionaryEntry = 'Balances_DESCRIPCION3'
          end>
      end
      item
        Params = <
          item
            Name = 'ID_EJERCICIO'
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REF_CUENTA'
            Value = ''
            ParamType = daptInput
          end
          item
            Name = 'REF_TIENDA'
            Value = ''
            ParamType = daptInput
          end>
        Statements = <
          item
            Connection = 'IBX'
            SQL = 
              'select max(cast(substr(cont_subcuentas.ref_subcuenta, 6, 10) as ' +
              'Integer))'#10'from cont_subcuentas'#10'left join cont_cuentas on cont_cu' +
              'entas.id = cont_subcuentas.id_cuenta'#10'where cont_subcuentas.id_ej' +
              'ercicio = :ID_EJERCICIO'#10'and cont_cuentas.ref_cuenta = :REF_CUENT' +
              'A'#10'and substr(cont_subcuentas.ref_subcuenta, 4, 5) = :REF_TIENDA'#10 +
              #10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'MAX'
                TableField = 'MAX'
              end>
          end>
        Name = 'DarMaxRefSubCuentaCli'
        Fields = <
          item
            Name = 'MAX'
            DataType = datInteger
          end>
      end
      item
        Params = <>
        Statements = <
          item
            Connection = 'IBX'
            SQL = 'select coalesce(max(orden),0)+1 as NUM_ORDEN'#10'from cont_asientos'#10
            StatementType = stSQL
            ColumnMappings = <
              item
                DatasetField = 'NUM_ORDEN'
                TableField = 'NUM_ORDEN'
              end>
          end>
        Name = 'DarNumOrdenAsiento'
        Fields = <
          item
            Name = 'NUM_ORDEN'
            DataType = datLargeInt
          end>
      end>
    JoinDataTables = <>
    UnionDataTables = <>
    Commands = <
      item
        Params = <
          item
            Name = 'REFERENCIA'
            Value = ''
          end
          item
            Name = 'DESCRIPCION'
            Value = ''
          end
          item
            Name = 'ID_CUENTA'
            Value = ''
          end
          item
            Name = 'ID_EJERCICIO'
            Value = ''
          end
          item
            Name = 'ID_CONTACTO'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            Name = 'IBX'
            SQL = 
              'insert into CONT_SUBCUENTAS (ID, REF_SUBCUENTA, DESCRIPCION, ID_' +
              'CUENTA, ID_EJERCICIO, ID_CONTACTO)'#10'values (GEN_ID(gen_cont_subcu' +
              'entas_id, 1), :REFERENCIA, :DESCRIPCION, :ID_CUENTA, :ID_EJERCIC' +
              'IO, :ID_CONTACTO)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'AnadirSubCuenta'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_EPIGRAFES_ID'
            Value = ''
          end
          item
            Name = 'REF_EPIGRAFE'
            Value = ''
          end
          item
            Name = 'DESCRIPCION'
            Value = ''
          end
          item
            Name = 'ID_EJERCICIO'
            Value = ''
          end
          item
            Name = 'ID_PADRE'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_EPIGRAFES'
            SQL = 
              'INSERT'#10'  INTO CONT_EPIGRAFES'#10'    (ID, REF_EPIGRAFE, DESCRIPCION,' +
              ' ID_EJERCICIO, ID_PADRE)'#10'  VALUES'#10'    (:ID, :REF_EPIGRAFE, :DESC' +
              'RIPCION, :ID_EJERCICIO, :ID_PADRE)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_Epigrafes'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_EPIGRAFES'
            SQL = 'DELETE '#10'  FROM'#10'    CONT_EPIGRAFES'#10'  WHERE'#10'    (ID = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_Epigrafes'
      end
      item
        Params = <
          item
            Name = 'ID'
            Value = ''
          end
          item
            Name = 'REF_EPIGRAFE'
            Value = ''
          end
          item
            Name = 'DESCRIPCION'
            Value = ''
          end
          item
            Name = 'ID_EJERCICIO'
            Value = ''
          end
          item
            Name = 'ID_PADRE'
            Value = ''
          end
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_EPIGRAFES'
            SQL = 
              'UPDATE CONT_EPIGRAFES'#10'  SET '#10'    ID = :ID,'#10'    REF_EPIGRAFE = :R' +
              'EF_EPIGRAFE, '#10'    DESCRIPCION = :DESCRIPCION, '#10'    ID_EJERCICIO ' +
              '= :ID_EJERCICIO, '#10'    ID_PADRE = :ID_PADRE'#10'  WHERE'#10'    (ID = :OL' +
              'D_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_Epigrafes'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_CUENTAS_ID'
            Value = ''
          end
          item
            Name = 'REF_CUENTA'
            Value = ''
          end
          item
            Name = 'ID_EJERCICIO'
            Value = ''
          end
          item
            Name = 'DESCRIPCION'
            Value = ''
          end
          item
            Name = 'ID_EPIGRAFE'
            Value = ''
          end
          item
            Name = 'ID_BALANCE'
            Value = ''
          end
          item
            Name = 'ID_CUENTA_ESPECIAL'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_CUENTAS'
            SQL = 
              'INSERT'#10'  INTO CONT_CUENTAS'#10'    (ID, REF_CUENTA, ID_EJERCICIO, DE' +
              'SCRIPCION, ID_EPIGRAFE,'#10'     ID_BALANCE, ID_CUENTA_ESPECIAL)'#10'  V' +
              'ALUES'#10'    (:ID, :REF_CUENTA, :ID_EJERCICIO, :DESCRIPCION, :ID_EP' +
              'IGRAFE,'#10'     :ID_BALANCE, :ID_CUENTA_ESPECIAL)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_Cuentas'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_CUENTAS'
            SQL = 'DELETE '#10'  FROM'#10'    CONT_CUENTAS'#10'  WHERE'#10'    (ID = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_Cuentas'
      end
      item
        Params = <
          item
            Name = 'ID'
            Value = ''
          end
          item
            Name = 'REF_CUENTA'
            Value = ''
          end
          item
            Name = 'ID_EJERCICIO'
            Value = ''
          end
          item
            Name = 'DESCRIPCION'
            Value = ''
          end
          item
            Name = 'ID_EPIGRAFE'
            Value = ''
          end
          item
            Name = 'ID_BALANCE'
            Value = ''
          end
          item
            Name = 'ID_CUENTA_ESPECIAL'
            Value = ''
          end
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_CUENTAS'
            SQL = 
              'UPDATE CONT_CUENTAS'#10'  SET '#10'    ID = :ID,'#10'    REF_CUENTA = :REF_C' +
              'UENTA, '#10'    ID_EJERCICIO = :ID_EJERCICIO, '#10'    DESCRIPCION = :DE' +
              'SCRIPCION, '#10'    ID_EPIGRAFE = :ID_EPIGRAFE, '#10'    ID_BALANCE = :I' +
              'D_BALANCE,'#10'    ID_CUENTA_ESPECIAL = :ID_CUENTA_ESPECIAL'#10'  WHERE'#10 +
              '    (ID = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_Cuentas'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_SUBCUENTAS_ID'
            Value = ''
          end
          item
            Name = 'REF_SUBCUENTA'
            Value = ''
          end
          item
            Name = 'DESCRIPCION'
            Value = ''
          end
          item
            Name = 'ID_EJERCICIO'
            Value = ''
          end
          item
            Name = 'ID_CUENTA'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_SUBCUENTAS'
            SQL = 
              'INSERT'#10'  INTO CONT_SUBCUENTAS'#10'    (ID, REF_SUBCUENTA, DESCRIPCIO' +
              'N, ID_EJERCICIO, ID_CUENTA)'#10'  VALUES'#10'    (:ID, :REF_SUBCUENTA, :' +
              'DESCRIPCION, :ID_EJERCICIO, :ID_CUENTA)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_SubCuentas'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_SUBCUENTAS'
            SQL = 'DELETE '#10'  FROM'#10'    CONT_SUBCUENTAS'#10'  WHERE'#10'    (ID = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_SubCuentas'
      end
      item
        Params = <
          item
            Name = 'ID'
            Value = ''
          end
          item
            Name = 'REF_SUBCUENTA'
            Value = ''
          end
          item
            Name = 'DESCRIPCION'
            Value = ''
          end
          item
            Name = 'ID_EJERCICIO'
            Value = ''
          end
          item
            Name = 'ID_CUENTA'
            Value = ''
          end
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_SUBCUENTAS'
            SQL = 
              'UPDATE CONT_SUBCUENTAS'#10'  SET '#10'    ID = :ID,'#10'    REF_SUBCUENTA = ' +
              ':REF_SUBCUENTA, '#10'    DESCRIPCION = :DESCRIPCION, '#10'    ID_EJERCIC' +
              'IO = :ID_EJERCICIO, '#10'    ID_CUENTA = :ID_CUENTA'#10'  WHERE'#10'    (ID ' +
              '= :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_SubCuentas'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_ASIENTOS_ID'
            Value = ''
          end
          item
            Name = 'FECHA_ASIENTO'
            Value = ''
          end
          item
            Name = 'ORDEN'
            Value = ''
          end
          item
            Name = 'TIPO'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_ASIENTOS'
            SQL = 
              'INSERT'#10'  INTO CONT_ASIENTOS'#10'    (ID, FECHA_ASIENTO, ORDEN, TIPO)' +
              #10'  VALUES'#10'    (:ID, :FECHA_ASIENTO, :ORDEN, :TIPO)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_Asientos'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_ASIENTOS'
            SQL = 'DELETE '#10'  FROM'#10'    CONT_ASIENTOS'#10'  WHERE'#10'    (ID = :OLD_ID)'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_Asientos'
      end
      item
        Params = <
          item
            Name = 'FECHA_ASIENTO'
            Value = ''
          end
          item
            Name = 'ORDEN'
            Value = ''
          end
          item
            Name = 'TIPO'
            Value = ''
          end
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_ASIENTOS'
            SQL = 
              'UPDATE CONT_ASIENTOS'#10'  SET '#10'    FECHA_ASIENTO = :FECHA_ASIENTO, ' +
              #10'    ORDEN = :ORDEN,'#10'    TIPO = :TIPO'#10'  WHERE'#10'    (ID = :OLD_ID)' +
              #10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_Asientos'
      end
      item
        Params = <
          item
            Name = 'ID'
            DataType = datAutoInc
            GeneratorName = 'GEN_CONT_APUNTES_ID'
            Value = ''
          end
          item
            Name = 'ID_ASIENTO'
            Value = ''
          end
          item
            Name = 'NUM_ORDEN'
            Value = ''
          end
          item
            Name = 'ID_SUBCUENTA'
            Value = ''
          end
          item
            Name = 'CONCEPTO'
            Value = ''
          end
          item
            Name = 'DOCUMENTO'
            Value = ''
          end
          item
            Name = 'DEBE'
            Value = ''
          end
          item
            Name = 'HABER'
            Value = ''
          end
          item
            Name = 'PUNTEADO'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_APUNTES'
            SQL = 
              'INSERT'#10'  INTO CONT_APUNTES'#10'    (ID, ID_ASIENTO, NUM_ORDEN, ID_SU' +
              'BCUENTA, CONCEPTO, DOCUMENTO, DEBE, HABER, PUNTEADO)'#10'  VALUES'#10'  ' +
              '  (:ID, :ID_ASIENTO, :NUM_ORDEN, :ID_SUBCUENTA, :CONCEPTO, :DOCU' +
              'MENTO, :DEBE, :HABER, :PUNTEADO)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Insert_Apuntes'
      end
      item
        Params = <
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_APUNTES'
            SQL = 'DELETE '#10'  FROM'#10'    CONT_APUNTES'#10'  WHERE'#10'    (ID = :OLD_ID)'
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Delete_Apuntes'
      end
      item
        Params = <
          item
            Name = 'ID_ASIENTO'
            Value = ''
          end
          item
            Name = 'NUM_ORDEN'
            Value = ''
          end
          item
            Name = 'ID_SUBCUENTA'
            Value = ''
          end
          item
            Name = 'CONCEPTO'
            Value = ''
          end
          item
            Name = 'DOCUMENTO'
            Value = ''
          end
          item
            Name = 'DEBE'
            Value = ''
          end
          item
            Name = 'HABER'
            Value = ''
          end
          item
            Name = 'PUNTEADO'
            Value = ''
          end
          item
            Name = 'OLD_ID'
            Value = ''
          end>
        Statements = <
          item
            Connection = 'IBX'
            ConnectionType = 'Interbase'
            Default = True
            TargetTable = 'CONT_APUNTES'
            SQL = 
              'UPDATE CONT_APUNTES'#10'  SET '#10'    ID_ASIENTO = :ID_ASIENTO, '#10'    NU' +
              'M_ORDEN = :NUM_ORDEN,'#10'    ID_SUBCUENTA = :ID_SUBCUENTA, '#10'    CON' +
              'CEPTO = :CONCEPTO,'#10'    DOCUMENTO = :DOCUMENTO, '#10'    DEBE = :DEBE' +
              ', '#10'    HABER = :HABER, '#10'    PUNTEADO = :PUNTEADO'#10'  WHERE'#10'    (ID' +
              ' = :OLD_ID)'#10
            StatementType = stSQL
            ColumnMappings = <>
          end>
        Name = 'Update_Apuntes'
      end>
    RelationShips = <
      item
        Name = 'FK_Apuntes'
        MasterDatasetName = 'Asientos'
        MasterFields = 'ID'
        DetailDatasetName = 'Apuntes'
        DetailFields = 'ID_ASIENTO'
        RelationshipType = rtForeignKey
      end>
    UpdateRules = <
      item
        Name = 'Insert Asientos'
        DoUpdate = False
        DoDelete = False
        DatasetName = 'Asientos'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Insert Apuntes'
        DoUpdate = False
        DoDelete = False
        DatasetName = 'Apuntes'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Update Asientos'
        DoInsert = False
        DoDelete = False
        DatasetName = 'Asientos'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Update Apuntes'
        DoInsert = False
        DoDelete = False
        DatasetName = 'Apuntes'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Delete Apuntes'
        DoUpdate = False
        DoInsert = False
        DatasetName = 'Apuntes'
        FailureBehavior = fbRaiseException
      end
      item
        Name = 'Delete Asientos'
        DoUpdate = False
        DoInsert = False
        DatasetName = 'Asientos'
        FailureBehavior = fbRaiseException
      end>
    Version = 0
    Left = 48
    Top = 24
  end
  object Bin2DataStreamer: TDABin2DataStreamer
    Left = 48
    Top = 88
  end
  object bpEpigrafes: TDABusinessProcessor
    Schema = schContabilidad
    InsertCommandName = 'Insert_Epigrafes'
    DeleteCommandName = 'Delete_Epigrafes'
    UpdateCommandName = 'Update_Epigrafes'
    ReferencedDataset = 'Epigrafes'
    ProcessorOptions = [poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 248
    Top = 24
  end
  object bpCuentas: TDABusinessProcessor
    Schema = schContabilidad
    InsertCommandName = 'Insert_Cuentas'
    DeleteCommandName = 'Delete_Cuentas'
    UpdateCommandName = 'Update_Cuentas'
    ReferencedDataset = 'Cuentas'
    ProcessorOptions = [poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 248
    Top = 80
  end
  object bpSubCuentas: TDABusinessProcessor
    Schema = schContabilidad
    InsertCommandName = 'Insert_SubCuentas'
    DeleteCommandName = 'Delete_SubCuentas'
    UpdateCommandName = 'Update_SubCuentas'
    ReferencedDataset = 'SubCuentas'
    ProcessorOptions = [poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 248
    Top = 136
  end
  object bpApuntes: TDABusinessProcessor
    Schema = schContabilidad
    InsertCommandName = 'Insert_Apuntes'
    DeleteCommandName = 'Delete_Apuntes'
    UpdateCommandName = 'Update_Apuntes'
    ReferencedDataset = 'Apuntes'
    ProcessorOptions = [poAutoGenerateRefreshDataset, poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 248
    Top = 192
  end
  object bpAsientos: TDABusinessProcessor
    Schema = schContabilidad
    InsertCommandName = 'Insert_Asientos'
    DeleteCommandName = 'Delete_Asientos'
    UpdateCommandName = 'Update_Asientos'
    ReferencedDataset = 'Asientos'
    ProcessorOptions = [poAutoGenerateRefreshDataset, poPrepareCommands]
    UpdateMode = updWhereKeyOnly
    Left = 152
    Top = 192
  end
end
