{*******************************************************************************
Title: T2Ti ERP                                                                 
Description:  DTO  relacionado à tabela [NFE_DECLARACAO_IMPORTACAO] 
                                                                                
The MIT License                                                                 
                                                                                
Copyright: Copyright (C) 2017 T2Ti.COM                                          
                                                                                
Permission is hereby granted, free of charge, to any person                     
obtaining a copy of this software and associated documentation                  
files (the "Software"), to deal in the Software without                         
restriction, including without limitation the rights to use,                    
copy, modify, merge, publish, distribute, sublicense, and/or sell               
copies of the Software, and to permit persons to whom the                       
Software is furnished to do so, subject to the following                        
conditions:                                                                     
                                                                                
The above copyright notice and this permission notice shall be                  
included in all copies or substantial portions of the Software.                 
                                                                                
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,                 
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES                 
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND                        
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT                     
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,                    
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING                    
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR                   
OTHER DEALINGS IN THE SOFTWARE.                                                 
                                                                                
       The author may be contacted at:                                          
           t2ti.com@gmail.com                                                   
                                                                                
@author Albert Eije (t2ti.com@gmail.com)                    
@version 1.0                                                                    
*******************************************************************************}
unit NfeDeclaracaoImportacaoDTO;

interface

uses
    SynCommons,
  mORMot, Classes, Generics.Collections,

  Atributos, Constantes, DTO,

  NfeImportacaoDetalheDTO;

type
  TNFE_DECLARACAO_IMPORTACAO = class(TDTO)
   
  private
    FPK: Integer;
    FID_NFE_DETALHE: Integer;
    FNUMERO_DOCUMENTO: RawUTF8;
    FDATA_REGISTRO: TDateTime;
    FLOCAL_DESEMBARACO: RawUTF8;
    FUF_DESEMBARACO: RawUTF8;
    FDATA_DESEMBARACO: TDateTime;
    FCODIGO_EXPORTADOR: RawUTF8;
    FVIA_TRANSPORTE: Integer;
    FVALOR_AFRMM: Double;
    FFORMA_INTERMEDIACAO: Integer;
    FCNPJ: RawUTF8;
    FUF_TERCEIRO: RawUTF8;

    //Usado no lado cliente para controlar quais registros serão persistidos
    FPersiste: RawUTF8;

    FListaNfeImportacaoDetalheDTO: TObjectList<TNfe_Importacao_Detalhe>; //1:100

  public 
    [TId('ID')]
    [TGeneratedValue(sAuto)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property PK: Integer  read FPK write FPK;

    [TColumn('PERSISTE', 'Persiste', 60, [], True)]
    property Persiste: RawUTF8  read FPersiste write FPersiste;

    property ListaNfeImportacaoDetalheDTO: TObjectList<TNfe_Importacao_Detalhe> read FListaNfeImportacaoDetalheDTO write FListaNfeImportacaoDetalheDTO;
  
  
  published
    [TColumn('ID_NFE_DETALHE', 'Id Nfe Detalhe', 80, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property IdNfeDetalhe: Integer  read FID_NFE_DETALHE write FID_NFE_DETALHE;
    [TColumn('NUMERO_DOCUMENTO', 'Numero Documento', 96, [ldGrid, ldLookup, ldCombobox], False)]
    property NumeroDocumento: RawUTF8  read FNUMERO_DOCUMENTO write FNUMERO_DOCUMENTO;
    [TColumn('DATA_REGISTRO', 'Data Registro', 80, [ldGrid, ldLookup, ldCombobox], False)]
    property DataRegistro: TDateTime  read FDATA_REGISTRO write FDATA_REGISTRO;
    [TColumn('LOCAL_DESEMBARACO', 'Local Desembaraco', 450, [ldGrid, ldLookup, ldCombobox], False)]
    property LocalDesembaraco: RawUTF8  read FLOCAL_DESEMBARACO write FLOCAL_DESEMBARACO;
    [TColumn('UF_DESEMBARACO', 'Uf Desembaraco', 16, [ldGrid, ldLookup, ldCombobox], False)]
    property UfDesembaraco: RawUTF8  read FUF_DESEMBARACO write FUF_DESEMBARACO;
    [TColumn('DATA_DESEMBARACO', 'Data Desembaraco', 80, [ldGrid, ldLookup, ldCombobox], False)]
    property DataDesembaraco: TDateTime  read FDATA_DESEMBARACO write FDATA_DESEMBARACO;
    [TColumn('CODIGO_EXPORTADOR', 'Codigo Exportador', 450, [ldGrid, ldLookup, ldCombobox], False)]
    property CodigoExportador: RawUTF8  read FCODIGO_EXPORTADOR write FCODIGO_EXPORTADOR;
    [TColumn('VIA_TRANSPORTE', 'Via Transporte', 80, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property ViaTransporte: Integer  read FVIA_TRANSPORTE write FVIA_TRANSPORTE;
    [TColumn('VALOR_AFRMM', 'Valor Afrmm', 168, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftFloatComSeparador, taRightJustify)]
    property ValorAfrmm: Double  read FVALOR_AFRMM write FVALOR_AFRMM;
    [TColumn('FORMA_INTERMEDIACAO', 'Forma Intermediacao', 80, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property FormaIntermediacao: Integer  read FFORMA_INTERMEDIACAO write FFORMA_INTERMEDIACAO;
    [TColumn('CNPJ', 'Cnpj', 112, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftCnpj, taLeftJustify)]
    property Cnpj: RawUTF8  read FCNPJ write FCNPJ;
    [TColumn('UF_TERCEIRO', 'Uf Terceiro', 16, [ldGrid, ldLookup, ldCombobox], False)]
    property UfTerceiro: RawUTF8  read FUF_TERCEIRO write FUF_TERCEIRO;


  end;

implementation


end.
