{*******************************************************************************
Title: T2Ti ERP                                                                 
Description:  DTO  relacionado à tabela [NFE_TRANSPORTE] 
                                                                                
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 NfeTransporteDTO;

interface

uses
    SynCommons,
  mORMot, Classes, Generics.Collections,

  Atributos, Constantes, DTO,

  NfeTransporteReboqueDTO, NfeTransporteVolumeDTO;

type
  TNfe_Transporte = class(TDTO)
  private
    FPK: Integer;
    FID_TRANSPORTADORA: Integer;
    FID_NFE_CABECALHO: Integer;
    FMODALIDADE_FRETE: Integer;
    FCPF_CNPJ: RawUTF8;
    FNOME: RawUTF8;
    FINSCRICAO_ESTADUAL: RawUTF8;
    FEMPRESA_ENDERECO: RawUTF8;
    FNOME_MUNICIPIO: RawUTF8;
    FUF: RawUTF8;
    FVALOR_SERVICO: Double;
    FVALOR_BC_RETENCAO_ICMS: Double;
    FALIQUOTA_RETENCAO_ICMS: Double;
    FVALOR_ICMS_RETIDO: Double;
    FCFOP: Integer;
    FMUNICIPIO: Integer;
    FPLACA_VEICULO: RawUTF8;
    FUF_VEICULO: RawUTF8;
    FRNTC_VEICULO: RawUTF8;
    FVAGAO: RawUTF8;
    FBALSA: RawUTF8;

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

    // Grupo X - X22
    FListaNfeTransporteReboqueDTO: TObjectList<TNfe_Transporte_Reboque>; //0:5
    // Grupo X - X26
    FListaNfeTransporteVolumeDTO: TObjectList<TNfe_Transporte_Volume>; //0:5000

  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 ListaNfeTransporteReboqueDTO: TObjectList<TNfe_Transporte_Reboque> read FListaNfeTransporteReboqueDTO write FListaNfeTransporteReboqueDTO;
    property ListaNfeTransporteVolumeDTO: TObjectList<TNfe_Transporte_Volume> read FListaNfeTransporteVolumeDTO write FListaNfeTransporteVolumeDTO;
	
  published

    [TColumn('ID_TRANSPORTADORA', 'Id Transportadora', 80, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property IdTransportadora: Integer  read FID_TRANSPORTADORA write FID_TRANSPORTADORA;
    [TColumn('ID_NFE_CABECALHO', 'Id Nfe Cabecalho', 80, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property IdNfeCabecalho: Integer  read FID_NFE_CABECALHO write FID_NFE_CABECALHO;
    [TColumn('MODALIDADE_FRETE', 'Modalidade Frete', 80, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property ModalidadeFrete: Integer  read FMODALIDADE_FRETE write FMODALIDADE_FRETE;
    [TColumn('CPF_CNPJ', 'Cpf Cnpj', 112, [ldGrid, ldLookup, ldCombobox], False)]
    property CpfCnpj: RawUTF8  read FCPF_CNPJ write FCPF_CNPJ;
    [TColumn('NOME', 'Nome', 450, [ldGrid, ldLookup, ldCombobox], False)]
    property Nome: RawUTF8  read FNOME write FNOME;
    [TColumn('INSCRICAO_ESTADUAL', 'Inscricao Estadual', 112, [ldGrid, ldLookup, ldCombobox], False)]
    property InscricaoEstadual: RawUTF8  read FINSCRICAO_ESTADUAL write FINSCRICAO_ESTADUAL;
    [TColumn('EMPRESA_ENDERECO', 'Empresa Endereco', 450, [ldGrid, ldLookup, ldCombobox], False)]
    property EmpresaEndereco: RawUTF8  read FEMPRESA_ENDERECO write FEMPRESA_ENDERECO;
    [TColumn('NOME_MUNICIPIO', 'Nome Municipio', 450, [ldGrid, ldLookup, ldCombobox], False)]
    property NomeMunicipio: RawUTF8  read FNOME_MUNICIPIO write FNOME_MUNICIPIO;
    [TColumn('UF', 'Uf', 16, [ldGrid, ldLookup, ldCombobox], False)]
    property Uf: RawUTF8  read FUF write FUF;
    [TColumn('VALOR_SERVICO', 'Valor Servico', 168, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftFloatComSeparador, taRightJustify)]
    property ValorServico: Double  read FVALOR_SERVICO write FVALOR_SERVICO;
    [TColumn('VALOR_BC_RETENCAO_ICMS', 'Valor Bc Retencao Icms', 168, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftFloatComSeparador, taRightJustify)]
    property ValorBcRetencaoIcms: Double  read FVALOR_BC_RETENCAO_ICMS write FVALOR_BC_RETENCAO_ICMS;
    [TColumn('ALIQUOTA_RETENCAO_ICMS', 'Aliquota Retencao Icms', 168, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftFloatComSeparador, taRightJustify)]
    property AliquotaRetencaoIcms: Double  read FALIQUOTA_RETENCAO_ICMS write FALIQUOTA_RETENCAO_ICMS;
    [TColumn('VALOR_ICMS_RETIDO', 'Valor Icms Retido', 168, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftFloatComSeparador, taRightJustify)]
    property ValorIcmsRetido: Double  read FVALOR_ICMS_RETIDO write FVALOR_ICMS_RETIDO;
    [TColumn('CFOP', 'Cfop', 80, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property Cfop: Integer  read FCFOP write FCFOP;
    [TColumn('MUNICIPIO', 'Municipio', 80, [ldGrid, ldLookup, ldCombobox], False)]
    [TFormatter(ftZerosAEsquerda, taCenter)]
    property Municipio: Integer  read FMUNICIPIO write FMUNICIPIO;
    [TColumn('PLACA_VEICULO', 'Placa Veiculo', 56, [ldGrid, ldLookup, ldCombobox], False)]
    property PlacaVeiculo: RawUTF8  read FPLACA_VEICULO write FPLACA_VEICULO;
    [TColumn('UF_VEICULO', 'Uf Veiculo', 16, [ldGrid, ldLookup, ldCombobox], False)]
    property UfVeiculo: RawUTF8  read FUF_VEICULO write FUF_VEICULO;
    [TColumn('RNTC_VEICULO', 'Rntc Veiculo', 160, [ldGrid, ldLookup, ldCombobox], False)]
    property RntcVeiculo: RawUTF8  read FRNTC_VEICULO write FRNTC_VEICULO;
    [TColumn('VAGAO', 'Vagao', 160, [ldGrid, ldLookup, ldCombobox], False)]
    property Vagao: RawUTF8  read FVAGAO write FVAGAO;
    [TColumn('BALSA', 'Balsa', 160, [ldGrid, ldLookup, ldCombobox], False)]
    property Balsa: RawUTF8  read FBALSA write FBALSA;



  end;

implementation


end.
