RS - platform dependent record set typepublic class UtlInvBase<RS> extends Object
Utility for purchase/sales invoice. Base shared code-bunch.
| Constructor and Description |
|---|
UtlInvBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
addInvBsTxExTxc(List<SalesInvoiceServiceLine> pTxdLns,
Long pCatId,
Double pSubt,
Double pSubtFc,
Double pPercent,
AccSettings pAs,
TaxDestination pTxRules)
Adds total tax by category for farther invoice adjusting.
|
<T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>> |
adjustInvoiceLns(Map<String,Object> pReqVars,
T pInv,
List<SalesInvoiceServiceLine> pTxdLns,
AccSettings pAs,
IInvTxMeth<T,TL> pInvTxMeth)
Adjust invoice lines totals/subtotals/cost for invoice basis method.
|
<T extends IInvoice,TL extends AInvTxLn<T>> |
findCreateTaxLine(Map<String,Object> pReqVars,
T pInv,
List<TL> pInvTxLns,
Tax pTax,
boolean pNeedFind,
org.beigesoft.factory.IFactorySimple<TL> pFctInvTxLn)
Finds (if need) line with same tax or creates one.
|
org.beigesoft.log.ILogger |
getLogger()
Geter for logger.
|
org.beigesoft.service.ISrvDatabase<RS> |
getSrvDatabase()
Getter for srvDatabase.
|
org.beigesoft.service.ISrvNumberToString |
getSrvNumberToString()
Getter for srvNumberToString.
|
org.beigesoft.service.ISrvOrm<RS> |
getSrvOrm()
Geter for srvOrm.
|
<T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>,LTL extends ALineTxLn<T,L>> |
makeLine(Map<String,Object> pReqVars,
L pLine,
AccSettings pAs,
TaxDestination pTxRules,
IInvTxMeth<T,TL> pInvTxMeth,
IInvLnTxMeth<T,L,LTL> pInvLnTxMeth)
Makes invoice line's taxes, totals.
|
<T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>> |
makeTotals(Map<String,Object> pReqVars,
L pLine,
AccSettings pAs,
TaxDestination pTxRules,
IInvTxMeth<T,TL> pInvTxMeth)
Makes invoice totals include taxes lines
cause line inserted/changed/deleted.
|
SalesInvoiceServiceLine |
makeTxdLine(List<SalesInvoiceServiceLine> pTxdLns,
Long pTdlId,
Long pCatId,
Tax pTax,
Double pPercent,
AccSettings pAs)
Make invoice line that stores taxes data in lines set
for invoice basis or item basis aggregate rate.
|
<T extends IInvoice,L extends IInvoiceLine<T>> |
mkLnFinal(L pLine,
BigDecimal pTotTxs,
BigDecimal pTotTxsFc,
Boolean pIsTxByUser)
Makes invoice line final results.
|
<T extends IInvoice,L extends IInvoiceLine<T>,LTL extends ALineTxLn<T,L>> |
mkLnTxItBasNonAggr(Map<String,Object> pReqVars,
L pLine,
AccSettings pAs,
TaxDestination pTxRules,
IInvTxMeth<T,?> pInvTxMeth,
IInvLnTxMeth<T,L,LTL> pInvLnTxMeth)
Makes invoice line taxes item basis basis non-aggregate.
|
String |
prn(Map<String,Object> pReqVars,
BigDecimal pVal)
Simple delegator to print number.
|
<T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>> |
retrieveDataTx(Map<String,Object> pReqVars,
L pLine,
AccSettings pAs,
TaxDestination pTxRules,
IInvTxMeth<T,TL> pInvTxMeth)
Retrieve from database bundle of tax data.
|
<T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>> |
retrTxdLnsAdjInv(Map<String,Object> pReqVars,
T pInv,
AccSettings pAs,
TaxDestination pTxRules,
IInvTxMeth<T,TL> pInvTxMeth)
Retrieve from database tax data for adjusting invoice lines after
invoice tax line has been changed by user.
|
TaxDestination |
revealTaxRules(Map<String,Object> pReqVars,
IInvoice pInv,
AccSettings pAs,
Boolean pIsExtrTx)
Reveal shared tax rules for invoice..
|
void |
setLogger(org.beigesoft.log.ILogger pLogger)
Setter for logger.
|
void |
setSrvDatabase(org.beigesoft.service.ISrvDatabase<RS> pSrvDatabase)
Setter for srvDatabase.
|
void |
setSrvNumberToString(org.beigesoft.service.ISrvNumberToString pSrvNumberToString)
Setter for srvNumberToString.
|
void |
setSrvOrm(org.beigesoft.service.ISrvOrm<RS> pSrvOrm)
Setter for srvOrm.
|
<T extends IInvoice> |
updInvTots(Map<String,Object> pReqVars,
T pInv,
AccSettings pAs,
IInvTxMeth<T,?> pInvTxMeth)
Update invoice totals after its line has been changed/deleted
and taxes lines has been made
or after tax line has been changed (Invoice basis).
|
public final TaxDestination revealTaxRules(Map<String,Object> pReqVars, IInvoice pInv, AccSettings pAs, Boolean pIsExtrTx) throws Exception
Reveal shared tax rules for invoice..
pReqVars - request scoped varspInv - invoicepAs - Accounting SettingspIsExtrTx - if extract taxesException - - an exception.public final <T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>> void makeTotals(Map<String,Object> pReqVars, L pLine, AccSettings pAs, TaxDestination pTxRules, IInvTxMeth<T,TL> pInvTxMeth) throws Exception
Makes invoice totals include taxes lines cause line inserted/changed/deleted.
T - invoice typeL - invoice line typeTL - invoice tax line typepReqVars - request scoped varspLine - affected linepAs - Accounting SettingspTxRules - NULL if not taxablepInvTxMeth - tax method code/data for purchase/sales invoiceException - - an exception.public final <T extends IInvoice> void updInvTots(Map<String,Object> pReqVars, T pInv, AccSettings pAs, IInvTxMeth<T,?> pInvTxMeth) throws Exception
Update invoice totals after its line has been changed/deleted and taxes lines has been made or after tax line has been changed (Invoice basis).
T - invoice typepReqVars - additional parampInv - InvoicepAs - accounting settingspInvTxMeth - tax method code/data for purchase/sales invoiceException - - an exceptionpublic final <T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>> void adjustInvoiceLns(Map<String,Object> pReqVars, T pInv, List<SalesInvoiceServiceLine> pTxdLns, AccSettings pAs, IInvTxMeth<T,TL> pInvTxMeth) throws Exception
Adjust invoice lines totals/subtotals/cost for invoice basis method.
T - invoice typeL - invoice line typeTL - invoice tax line typepReqVars - additional parampInv - invoicepTxdLns - Tax Data linespAs - ASpInvTxMeth - tax method code/data for purchase/sales invoiceException - an Exceptionpublic final <T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>> ArrayList<SalesInvoiceServiceLine> retrTxdLnsAdjInv(Map<String,Object> pReqVars, T pInv, AccSettings pAs, TaxDestination pTxRules, IInvTxMeth<T,TL> pInvTxMeth) throws Exception
Retrieve from database tax data for adjusting invoice lines after invoice tax line has been changed by user.
T - invoice typeL - invoice line typeTL - invoice tax line typepReqVars - request scoped varspInv - affected invoicepAs - Accounting SettingspTxRules - taxable rulespInvTxMeth - tax method code/data for purchase/sales invoiceException - - an exception.public final <T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>,LTL extends ALineTxLn<T,L>> void makeLine(Map<String,Object> pReqVars, L pLine, AccSettings pAs, TaxDestination pTxRules, IInvTxMeth<T,TL> pInvTxMeth, IInvLnTxMeth<T,L,LTL> pInvLnTxMeth) throws Exception
Makes invoice line's taxes, totals.
T - invoice typeL - invoice line typeTL - invoice tax line typeLTL - invoice line's tax line typepReqVars - request scoped varspLine - invoice linepAs - Accounting SettingspTxRules - NULL if not taxablepInvTxMeth - tax method code/data for purchase/sales invoicepInvLnTxMeth - tax method code/data for purchase/sales invoice lineException - - an exception.public final <T extends IInvoice,L extends IInvoiceLine<T>,TL extends AInvTxLn<T>> DataTx retrieveDataTx(Map<String,Object> pReqVars, L pLine, AccSettings pAs, TaxDestination pTxRules, IInvTxMeth<T,TL> pInvTxMeth) throws Exception
Retrieve from database bundle of tax data.
T - invoice typeL - invoice line typeTL - invoice tax line typepReqVars - request scoped varspLine - affected linepAs - Accounting SettingspTxRules - taxable rulespInvTxMeth - tax method code/data for purchase/sales invoiceException - - an exception.public final void addInvBsTxExTxc(List<SalesInvoiceServiceLine> pTxdLns, Long pCatId, Double pSubt, Double pSubtFc, Double pPercent, AccSettings pAs, TaxDestination pTxRules)
Adds total tax by category for farther invoice adjusting.
pTxdLns - Tax Data linespCatId - tax category IDpSubt - subtotal without taxespSubtFc - subtotal FC without taxespPercent - tax ratepAs - ASpTxRules - tax rulespublic final SalesInvoiceServiceLine makeTxdLine(List<SalesInvoiceServiceLine> pTxdLns, Long pTdlId, Long pCatId, Tax pTax, Double pPercent, AccSettings pAs)
Make invoice line that stores taxes data in lines set for invoice basis or item basis aggregate rate.
pTxdLns - Tax Data linespTdlId - line IDpCatId - tax category IDpTax - taxpPercent - tax ratepAs - ASpublic final <T extends IInvoice,L extends IInvoiceLine<T>,LTL extends ALineTxLn<T,L>> List<LTL> mkLnTxItBasNonAggr(Map<String,Object> pReqVars, L pLine, AccSettings pAs, TaxDestination pTxRules, IInvTxMeth<T,?> pInvTxMeth, IInvLnTxMeth<T,L,LTL> pInvLnTxMeth) throws Exception
Makes invoice line taxes item basis basis non-aggregate.
T - invoice typeL - invoice line typeLTL - invoice line's tax line typepReqVars - request scoped varspLine - invoice linepAs - Accounting SettingspTxRules - taxable rulespInvTxMeth - tax method code/data for purchase/sales invoicepInvLnTxMeth - tax method code/data for purchase/sales invoice lineException - - an exception.public final <T extends IInvoice,L extends IInvoiceLine<T>> void mkLnFinal(L pLine, BigDecimal pTotTxs, BigDecimal pTotTxsFc, Boolean pIsTxByUser)
Makes invoice line final results.
T - invoice typeL - invoice line typepLine - invoice linepTotTxs - total line taxespTotTxsFc - total line taxes FCpIsTxByUser - if tax set by userpublic final <T extends IInvoice,TL extends AInvTxLn<T>> TL findCreateTaxLine(Map<String,Object> pReqVars, T pInv, List<TL> pInvTxLns, Tax pTax, boolean pNeedFind, org.beigesoft.factory.IFactorySimple<TL> pFctInvTxLn) throws Exception
Finds (if need) line with same tax or creates one.
T - invoice typeTL - invoice tax line typepReqVars - additional parampInv - invoicepInvTxLns - invoice tax linespTax - taxpNeedFind - if need to find enabledpFctInvTxLn - invoice tax line factoryException - if no need to find but line is foundpublic final String prn(Map<String,Object> pReqVars, BigDecimal pVal)
Simple delegator to print number.
pReqVars - additional parampVal - valuepublic final org.beigesoft.service.ISrvNumberToString getSrvNumberToString()
Getter for srvNumberToString.
public final void setSrvNumberToString(org.beigesoft.service.ISrvNumberToString pSrvNumberToString)
Setter for srvNumberToString.
pSrvNumberToString - referencepublic final org.beigesoft.service.ISrvDatabase<RS> getSrvDatabase()
Getter for srvDatabase.
public final void setSrvDatabase(org.beigesoft.service.ISrvDatabase<RS> pSrvDatabase)
Setter for srvDatabase.
pSrvDatabase - referencepublic final org.beigesoft.service.ISrvOrm<RS> getSrvOrm()
Geter for srvOrm.
public final void setSrvOrm(org.beigesoft.service.ISrvOrm<RS> pSrvOrm)
Setter for srvOrm.
pSrvOrm - referencepublic final org.beigesoft.log.ILogger getLogger()
Geter for logger.
public final void setLogger(org.beigesoft.log.ILogger pLogger)
Setter for logger.
pLogger - referenceCopyright © 2016–2019. All rights reserved.