Class MLBRTax

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_LBR_Tax, I_Persistent, Evaluatee

public class MLBRTax extends X_LBR_Tax
Model for MLBRTax
Version:
$Id: MLBRTax.java, v1.0 26/09/2014 16:59:15, muriloht Exp $
Author:
Murilo H. Torquato (devCoffee,www.devcoffee.com.br) Old Version:, Ricardo Santana (Kenos, www.kenos.com.br)
  • Sponsored by Soliton, www.soliton.com.br
  • See Also:
    • Field Details

    • Constructor Details

      • MLBRTax

        public MLBRTax(Properties ctx, int LBR_Tax_ID, String trx)
        Default Constructor
        Parameters:
        Properties - ctx
        int - LBR_Tax_ID (0 create new)
        String - trx
      • MLBRTax

        public MLBRTax(Properties ctx, ResultSet rs, String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set record
        trxName - transaction
      • MLBRTax

        public MLBRTax(Properties ctx, int LBR_Tax_ID, String trxName, String... virtualColumns)
      • MLBRTax

        public MLBRTax(Properties ctx, String LBR_Tax_UU, String trxName, String... virtualColumns)
      • MLBRTax

        public MLBRTax(Properties ctx, String LBR_Tax_UU, String trxName)
    • Method Details

      • calculate

        public void calculate(int AD_Client_ID, int AD_Org_ID, boolean isTaxIncludedPriceList, Timestamp dateDoc, Map<String,Object> params, String trxType, boolean isReversal, boolean isCompleted)
        Calculate taxes
        Parameters:
        amt -
        isTaxIncludedPriceList -
        trxType -
      • evalFormula

        public BigDecimal evalFormula(String formula) throws bsh.EvalError
        Get tax factor
        Parameters:
        formula -
        Returns:
        factor
        Throws:
        bsh.EvalError
      • evalFormula

        public BigDecimal evalFormula(String formula, Map<String,Object> params)
        Get tax factor
        Parameters:
        formula -
        params -
        Returns:
        factor
        Throws:
        bsh.EvalError
      • setDescription

        public void setDescription()
        Set Description
      • copyTo

        public MLBRTax copyTo()
        Copy the current MTax and return a new copy of the Object
        Returns:
        MTax newTax
      • copyLinesTo

        public void copyLinesTo(MLBRTax newTax)
        Copy lines from the current MTax to the newTax param
        Parameters:
        MLBRTax - newTax
      • copyLinesTo

        public void copyLinesTo(int LBR_Tax_ID)
        Copy lines from the current MTax to the newTax param
        Parameters:
        LBR_Tax_ID -
      • getTaxLines

        public Map<Integer,MLBRTaxLine> getTaxLines()
        Get Lines
        Returns:
        MLBRTaxLine[] lines
      • getLines

        public MLBRTaxLine[] getLines()
        Get Lines
        Returns:
        MLBRTaxLine[] lines
      • deleteLines

        public void deleteLines()
        Apaga as linhas
      • delete

        public boolean delete(boolean force, String trxName)
        Apaga as Linhas antes de apagar o registro
        Overrides:
        delete in class PO
        Parameters:
        force - delete also processed records
        trxName - transaction
        Returns:
        true if deleted
      • getTaxes

        public static Object[] getTaxes(MOrderLine ol)
        Retorna o registro do imposto baseado na pesquisa Não usar este método em Callouts, pois a Callout pode acioná=lo antes que a linha tenha sido salva.
        Parameters:
        Order - Line
        Returns:
        Object Array (Taxes, Legal Msg, CFOP and CST)
      • getTaxes

        public static Object[] getTaxes(int C_DocTypeTarget_ID, boolean isSOTrx, String lbr_TransactionType, MProduct p, MOrgInfo oi, MBPartner bp, MBPartnerLocation bpLoc, Timestamp dateAcct)
        Retorna o registro do imposto baseado na pesquisa
        Parameters:
        Order -
        Order - Line
        Product -
        Organization - Info
        Business - Partner
        Date - Acct
        Returns:
        Object Array (Taxes, Legal Msg, CFOP , Tax, CFOP Delivery, Legal Message Delivery)
      • toString

        public String toString()
        To String
        Overrides:
        toString in class X_LBR_Tax
        Returns:
        String representation
      • getLine

        public static int getLine(int LBR_Tax_ID, int LBR_TaxName_ID, String trx)
        getLine
        Returns:
        Integer LBR_TaxLine_ID
      • processOnlyMissingTaxes

        public static void processOnlyMissingTaxes(Map<Integer,MLBRTaxLine> taxes, int LBR_Tax_ID, String trxName)
        Processa um map de impostos para somente complementar impostos faltantes, sem alterar linhas já existentes
        Parameters:
        taxes -
        LBR_Tax_ID -
        trxName -