Class MCOFRPS

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_COF_RPS, I_Persistent, DocAction, DocOptions, Evaluatee

public class MCOFRPS extends X_COF_RPS implements DocAction, DocOptions
Header do RPS
Version:
$Id: MCOFRPS.java, 2018/03/27 10:58:12 muriloht
Author:
Murilo H. Torquato (devCoffee, www.devcoffee.com.br), muriloht
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getRPS

      public static MCOFRPS[] getRPS(int C_Invoice_ID, String trxName)
      Obter RPS vinculado a uma fatura
      Parameters:
      ctx -
      C_Invoice_ID -
      trxName -
      Returns:
    • geLBRDocFiscal

      public static MCOFRPS geLBRDocFiscal(int p_M_InOut_ID, boolean nfImportada, String trxName)
      Obtem um DocumentoFiscal associado a um recebimento/expedicao de material
      Parameters:
      p_M_InOut_ID -
      Returns:
    • setC_DocTypeTarget_ID

      public void setC_DocTypeTarget_ID()
      Ajusta o Tipo de Documento correto para o RPS de acordo com a Organização ou pela Fatura
    • setInvoice

      public void setInvoice(MInvoice inv, boolean force) throws LBRDocException
      Set Invoice
      Parameters:
      MInvoice - inv
      Throws:
      LBRDocException
      Exception
    • getLines

      public List<MCOFRPSLine> getLines(String whereClause)
      Get RPS Lines of RPS
      Parameters:
      whereClause - starting with AND
      Returns:
      List
    • getLines

      public List<MCOFRPSLine> getLines(boolean requery)
      Get Lines
      Parameters:
      boolean - requery
      Returns:
      List
    • getLines

      public List<MCOFRPSLine> getLines()
      Get RPS_Lines of RPS
      Returns:
      List
    • setC_Invoice_ID

      public void setC_Invoice_ID(int p_C_Invoice_ID)
      Set Invoice.
      Specified by:
      setC_Invoice_ID in interface I_COF_RPS
      Overrides:
      setC_Invoice_ID in class X_COF_RPS
      Parameters:
      C_Invoice_ID - Invoice Identifier
    • setOrgAsEmitOrDest

      public void setOrgAsEmitOrDest(int p_AD_Org_Trx_ID)
      Seta informções da organização mediante o documento ser de emissão propria ou nao
      Parameters:
      AD_OrgTrx_ID - Performing or initiating organization
    • setBPAsEmitOrDest

      public void setBPAsEmitOrDest(int C_BPartner_ID)
      Define o PN como Prestador ou Destinatário Mediante documento proprio ou não
      Parameters:
      Dest_BPartner_ID - Parceiro Tomador
    • setEnderecoTomador

      public void setEnderecoTomador(int C_Location_ID)
      Set Endereco Tomador.
      Parameters:
      C_Location_ID - Endereco Tomador
    • setEnderecoPrestador

      public void setEnderecoPrestador(int C_Location_ID)
      Set Endereco Prestador.
      Parameters:
      C_Location_ID - Endereco Prestador
    • beforeSave

      protected boolean beforeSave(boolean newRecord)
      Before Save
      Overrides:
      beforeSave in class PO
      Parameters:
      newRecord - new
      Returns:
      true
    • processIt

      public boolean processIt(String processAction)
      Process document
      Specified by:
      processIt in interface DocAction
      Parameters:
      processAction - document action
      Returns:
      true if performed
    • unlockIt

      public boolean unlockIt()
      Unlock Document.
      Specified by:
      unlockIt in interface DocAction
      Returns:
      true if success
    • invalidateIt

      public boolean invalidateIt()
      Description copied from interface: DocAction
      Invalidate Document
      Specified by:
      invalidateIt in interface DocAction
      Returns:
      true if success
    • prepareIt

      public String prepareIt()
      Description copied from interface: DocAction
      Prepare Document
      Specified by:
      prepareIt in interface DocAction
      Returns:
      new status (In Progress or Invalid)
    • completeIt

      public String completeIt()
      Description copied from interface: DocAction
      Complete Document
      Specified by:
      completeIt in interface DocAction
      Returns:
      new status (Complete, In Progress, Invalid, Waiting ..)
    • closeIt

      public boolean closeIt()
      Description copied from interface: DocAction
      Close Document
      Specified by:
      closeIt in interface DocAction
      Returns:
      true if success
    • reActivateIt

      public boolean reActivateIt()
      Description copied from interface: DocAction
      Re-activate
      Specified by:
      reActivateIt in interface DocAction
      Returns:
      true if success
    • getSummary

      public String getSummary()
      Description copied from interface: DocAction
      Get Summary
      Specified by:
      getSummary in interface DocAction
      Returns:
      Summary of Document
    • getDocumentInfo

      public String getDocumentInfo()
      Description copied from interface: DocAction
      Get Document Info
      Specified by:
      getDocumentInfo in interface DocAction
      Returns:
      Type and Document No
    • createPDF

      public File createPDF()
      Description copied from interface: DocAction
      Create PDF
      Specified by:
      createPDF in interface DocAction
      Returns:
      file
    • getProcessMsg

      public String getProcessMsg()
      Description copied from interface: DocAction
      Get Process Message
      Specified by:
      getProcessMsg in interface DocAction
      Returns:
      clear text message
    • getDoc_User_ID

      public int getDoc_User_ID()
      Description copied from interface: DocAction
      Get Document Owner
      Specified by:
      getDoc_User_ID in interface DocAction
      Returns:
      AD_User_ID
    • getC_Currency_ID

      public int getC_Currency_ID()
      Description copied from class: X_COF_RPS
      Get Currency.
      Specified by:
      getC_Currency_ID in interface DocAction
      Specified by:
      getC_Currency_ID in interface I_COF_RPS
      Overrides:
      getC_Currency_ID in class X_COF_RPS
      Returns:
      The Currency for this record
    • getApprovalAmt

      public BigDecimal getApprovalAmt()
      Description copied from interface: DocAction
      Get Document Approval Amount
      Specified by:
      getApprovalAmt in interface DocAction
      Returns:
      amount
    • setcof_SituacaoNota

      public void setcof_SituacaoNota(String cof_SituacaoNota)
      Define a situacao do RPS e forca o status de envio
      Specified by:
      setcof_SituacaoNota in interface I_COF_RPS
      Overrides:
      setcof_SituacaoNota in class X_COF_RPS
      Parameters:
      cof_SituacaoNota - Indica a situação da nota se ela é uma nota Normal ou Cancelada.
    • podeInserirNoLote

      public boolean podeInserirNoLote()
    • setIsPrinted

      public void setIsPrinted(boolean isPrinted)
      Set Printed.
      Specified by:
      setIsPrinted in interface I_COF_RPS
      Overrides:
      setIsPrinted in class X_COF_RPS
      Parameters:
      IsPrinted - Indicates if this document / line is printed
    • setClientOrg

      public void setClientOrg(PO po)
      Overwrite Client Org if different
      Overrides:
      setClientOrg in class PO
      Parameters:
      po - persistent object
    • voidIt

      public boolean voidIt()
      Description copied from interface: DocAction
      Void Document
      Specified by:
      voidIt in interface DocAction
      Returns:
      true if success
    • getCOF_RPS_ID

      public static int getCOF_RPS_ID(String DocumentNo, String trx)
      Obter ID de documento Fiscal à partir do Número do Documento
      Parameters:
      DocumentNo -
      IsSOTrx -
      trx -
      Returns:
    • getCOF_RPS_ID

      public static int getCOF_RPS_ID(String numeroRPS, String situacaoRPSBarueri, String trx)
      Obter ID de documento Fiscal à partir do Número do RPS e Situacao do RPS Barueri
      Parameters:
      numeroRPS -
      situacaoRPSBarueri -
      trx -
      Returns:
    • addDescricaoRPS

      public void addDescricaoRPS(String msg)
      Adiciona novas mensagens complementares ao documento
      Parameters:
      msg -
    • descricaoOrder

      public void descricaoOrder(MOrder order)
    • detalhesDescricao

      public void detalhesDescricao(MInvoice invoice)
    • isComplete

      public boolean isComplete()
      Document Status is Complete or Closed
      Returns:
      true if CO, CL or RE
    • customizeValidActions

      public int customizeValidActions(String docStatus, Object processing, String orderType, String isSOTrx, int AD_Table_ID, String[] docAction, String[] options, int index)
      Description copied from interface: DocOptions
      Customize Valid Actions
      Specified by:
      customizeValidActions in interface DocOptions
      Returns:
      Number of valid options
    • approveIt

      public boolean approveIt()
      Description copied from interface: DocAction
      Approve Document
      Specified by:
      approveIt in interface DocAction
      Returns:
      true if success
    • rejectIt

      public boolean rejectIt()
      Description copied from interface: DocAction
      Reject Approval
      Specified by:
      rejectIt in interface DocAction
      Returns:
      true if success
    • reverseCorrectIt

      public boolean reverseCorrectIt()
      Description copied from interface: DocAction
      Reverse Correction
      Specified by:
      reverseCorrectIt in interface DocAction
      Returns:
      true if success
    • reverseAccrualIt

      public boolean reverseAccrualIt()
      Description copied from interface: DocAction
      Reverse Accrual
      Specified by:
      reverseAccrualIt in interface DocAction
      Returns:
      true if success
    • getForSped

      public static List<MCOFRPS> getForSped(Properties ctx, Timestamp DateFrom, Timestamp DateTo, Integer[] orgs_ID, Boolean IsSOTrx, String trxName) throws Exception
      Retornar Documentos Fiscais de acordo com os parâmetros
      Parameters:
      ctx -
      DateFrom -
      DateTo -
      orgs_ID - Array com um conjunto de organizações ou NULL para todas
      IsSOTrx - Transação de Venda/Compra ou NULL para amabas
      TrxName - transação do BD
      Returns:
      Throws:
      Exception
    • getDocStatusName

      public String getDocStatusName()
      Get Document Status
      Returns:
      Document Status Clear Text
    • getTSelection

      public static List<MCOFRPS> getTSelection(Properties ctx, String trx, String whereClause, Integer AD_PInstance_ID)
      Retorna registros de RPS selecionados em sua InfoWindow
      Parameters:
      ctx -
      trx -
      whereClause -
      AD_PInstance_ID -
      Returns: