Package org.brerp.base.component
Class Base_Validator
java.lang.Object
org.adempiere.base.event.AbstractEventHandler
org.brerp.base.component.Base_Validator
- All Implemented Interfaces:
org.osgi.service.event.EventHandler
- Author:
- muriloht
-
Field Summary
Fields inherited from class org.adempiere.base.event.AbstractEventHandler
eventManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckUniqueBP(String value, MBPartner bp) Verifica se um PN já existe no BD utilizando como critério de busca o CPF/CNPJvoidcorrigeImpostos(Properties ctx, MInvoiceLine linha, Integer docTypeID, MInvoice faturaOriginal, String trxName) voidcreateConsumoMateriaPrimaPMP(MProduction production) Ticket #4828 Atualiza a quantidade de MP utilizada na aba consumo de materia prima (PMP) em uma linha espicifica da OP, apenas onde a materia prima consta na aba Gestão do MP (Também do PMP)static MInvoicecreateInvoice(MOrder order, MDocType dt, MInOut shipment, Timestamp invoiceDate) Create InvoicecreateLBRTax(Object taxation0, String trxName) static MInOutcreateShipment(MOrder order, MDocType dt, Timestamp movementDate) Create ShipmentcriaFaturaItemSubs(int sequenciaDocumento, MOrder order, MInvoice inv, Integer docType, Integer user2_ID, Integer paymentTermID, Integer COF_FaturaCF_ID, boolean linkOrder) criaLinhaItemSubs(Properties ctx, MInvoice faturaOriginal, MInvoice fatura, MCOFItemSubstituto is, Integer M_InOutLine_ID, BigDecimal qty, boolean limpaDespesas, String trxName) protected voiddoHandleEvent(org.osgi.service.event.Event event) Sub class should override this method to handle event.voidgetCorrigeValorComDespesaAbaixo(MInvoiceLine[] lines, BigDecimal despesasTotais, BigDecimal qtdTotalItens, String trxName) getDespesasFatura(MInvoiceLine[] lines, BigDecimal despesasTotais, BigDecimal qtdTotalItens) getQuantidadeTotalLinhas(MInvoiceLine[] lines) MInvoice[]getRetentionsInvoice(String whereClause, String trxName) Object[]getValorSemImpostoIncluso(BigDecimal valor, BigDecimal qtd, BigDecimal lineNetAmt, Integer tax, String trxName) protected voidSub class should override this method to register event that the class want to listen tovoidsetEstimateWeight(PO po) Aplica o Peso estimado Total no Cabeçalho do PedidovoidsetRetunedRate(MInOutLine iol) Define o percentual da devolução do itemvoidDefine o percentual da devolução do itemsetRetunedRate(MRMALine rmaLine, BigDecimal Qty) Define o percentual da devolução do itembooleanvalidateBeforeCompleteOp(MProduction production) Aplica validações neessárias antes da Op ser completadavoidTicket #5092 Se a quantidade for 0 zera outras despesas e freteMethods inherited from class org.adempiere.base.event.AbstractEventHandler
addError, addErrorMessage, bindEventManager, getEventData, getEventProperty, getPO, getProcessInfo, handleEvent, registerEvent, registerEvent, registerProcessEvent, registerTableEvent, unbindEventManager
-
Constructor Details
-
Base_Validator
public Base_Validator()
-
-
Method Details
-
initialize
protected void initialize()Description copied from class:AbstractEventHandlerSub class should override this method to register event that the class want to listen to- Specified by:
initializein classAbstractEventHandler
-
doHandleEvent
protected void doHandleEvent(org.osgi.service.event.Event event) Description copied from class:AbstractEventHandlerSub class should override this method to handle event.- Specified by:
doHandleEventin classAbstractEventHandler
-
createConsumoMateriaPrimaPMP
Ticket #4828 Atualiza a quantidade de MP utilizada na aba consumo de materia prima (PMP) em uma linha espicifica da OP, apenas onde a materia prima consta na aba Gestão do MP (Também do PMP)- Parameters:
pmp- (Plano Mestre de Produção)
-
validateBeforeCompleteOp
Aplica validações neessárias antes da Op ser completada- Parameters:
production- (Ordem de produção a ser validada)- Returns:
- boolean (True para op que pode ser completada e false para OP que não pode ser completada)
-
setRetunedRate
Define o percentual da devolução do item- Parameters:
MInvoiceLine- il
-
setRetunedRate
Define o percentual da devolução do item- Parameters:
MInOutLine- iol
-
setRetunedRate
Define o percentual da devolução do item- Parameters:
MRMALine- rmaLineBigDecimal- Qty- Returns:
- pDevol
-
checkUniqueBP
Verifica se um PN já existe no BD utilizando como critério de busca o CPF/CNPJ- Parameters:
String- valueint- AD_Client_IDint- C_BPartner_ID- Returns:
- boolean true or false
-
createShipment
Create Shipment- Parameters:
dt- order document typemovementDate- optional movement date (default today)- Returns:
- shipment or null
-
createInvoice
public static MInvoice createInvoice(MOrder order, MDocType dt, MInOut shipment, Timestamp invoiceDate) Create Invoice- Parameters:
dt- order document typeshipment- optional shipmentinvoiceDate- invoice date- Returns:
- invoice or null
-
setEstimateWeight
Aplica o Peso estimado Total no Cabeçalho do Pedido -
getRetentionsInvoice
-
validateZeroQtyInvoiceLine
Ticket #5092 Se a quantidade for 0 zera outras despesas e frete- Parameters:
po-
-
getTaxes
-
createLBRTax
-
getValorSemImpostoIncluso
public BigDecimal getValorSemImpostoIncluso(BigDecimal valor, BigDecimal qtd, BigDecimal lineNetAmt, Integer tax, String trxName) -
getDespesasRateada
-
getCorrigeValorComDespesaAbaixo
public void getCorrigeValorComDespesaAbaixo(MInvoiceLine[] lines, BigDecimal despesasTotais, BigDecimal qtdTotalItens, String trxName) -
getDespesasFatura
public BigDecimal getDespesasFatura(MInvoiceLine[] lines, BigDecimal despesasTotais, BigDecimal qtdTotalItens) -
getQuantidadeTotalLinhas
-
criaFaturaItemSubs
-
criaLinhaItemSubs
public MInvoiceLine criaLinhaItemSubs(Properties ctx, MInvoice faturaOriginal, MInvoice fatura, MCOFItemSubstituto is, Integer M_InOutLine_ID, BigDecimal qty, boolean limpaDespesas, String trxName) -
corrigeImpostos
public void corrigeImpostos(Properties ctx, MInvoiceLine linha, Integer docTypeID, MInvoice faturaOriginal, String trxName)
-