Package org.mustangproject.ZUGFeRD
Class ZUGFeRD2PullProvider
- java.lang.Object
-
- org.mustangproject.ZUGFeRD.ZUGFeRD2PullProvider
-
- All Implemented Interfaces:
IXMLProvider
- Direct Known Subclasses:
DAPullProvider,OXPullProvider,ZUGFeRD1PullProvider
public class ZUGFeRD2PullProvider extends java.lang.Object implements IXMLProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected TransactionCalculatorcalcprotected Profileprofileprotected IExportableTransactiontransprotected byte[]zugferdData
-
Constructor Summary
Constructors Constructor Description ZUGFeRD2PullProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringbuildItemNotes(IZUGFeRDExportableItem currentItem)protected java.lang.StringbuildNotes(IExportableTransaction exportableTransaction)protected java.lang.StringcurrencyFormat(java.math.BigDecimal value)voidgenerateXML(IExportableTransaction trans)protected java.lang.StringgetAllowanceChargeStr(IZUGFeRDAllowanceCharge allowance, IAbsoluteValueProvider item)returns the XML for a charge or allowance on item levelprotected java.lang.StringgetItemTotalAllowanceChargeStr(IZUGFeRDAllowanceCharge allowance, IAbsoluteValueProvider item)returns the XML for a charge or allowance on item total levelProfilegetProfile()protected java.lang.StringgetTradePartyAsXML(IZUGFeRDExportableTradeParty party, boolean isSender, boolean isShipToTradeParty)returns the UN/CEFACT CII XML for companies(tradeparties), which is actually the same for ZF1 (v 2013b) and ZF2 (v 2016b)protected java.lang.StringgetTradePartyPayeeAsXML(IZUGFeRDExportableTradeParty party)byte[]getXML()protected java.lang.StringpriceFormat(java.math.BigDecimal value)protected java.lang.StringquantityFormat(java.math.BigDecimal value)voidsetProfile(Profile p)voidsetTest()enables the flag to indicate a test invoice in the XML structureprotected java.lang.StringvatFormat(java.math.BigDecimal value)
-
-
-
Field Detail
-
zugferdData
protected byte[] zugferdData
-
trans
protected IExportableTransaction trans
-
calc
protected TransactionCalculator calc
-
profile
protected Profile profile
-
-
Method Detail
-
setTest
public void setTest()
enables the flag to indicate a test invoice in the XML structure- Specified by:
setTestin interfaceIXMLProvider
-
vatFormat
protected java.lang.String vatFormat(java.math.BigDecimal value)
-
currencyFormat
protected java.lang.String currencyFormat(java.math.BigDecimal value)
-
priceFormat
protected java.lang.String priceFormat(java.math.BigDecimal value)
-
quantityFormat
protected java.lang.String quantityFormat(java.math.BigDecimal value)
-
getXML
public byte[] getXML()
- Specified by:
getXMLin interfaceIXMLProvider
-
getProfile
public Profile getProfile()
- Specified by:
getProfilein interfaceIXMLProvider
-
getTradePartyAsXML
protected java.lang.String getTradePartyAsXML(IZUGFeRDExportableTradeParty party, boolean isSender, boolean isShipToTradeParty)
returns the UN/CEFACT CII XML for companies(tradeparties), which is actually the same for ZF1 (v 2013b) and ZF2 (v 2016b)- Parameters:
party- any sender, recipient, seller or legal party involvedisSender- some attributes are allowed only for senders in certain profilesisShipToTradeParty- some attributes are allowed only for senders or recipients- Returns:
- CII XML
-
getTradePartyPayeeAsXML
protected java.lang.String getTradePartyPayeeAsXML(IZUGFeRDExportableTradeParty party)
-
getAllowanceChargeStr
protected java.lang.String getAllowanceChargeStr(IZUGFeRDAllowanceCharge allowance, IAbsoluteValueProvider item)
returns the XML for a charge or allowance on item level- Parameters:
allowance- the allowance or charge on this itemitem- the item- Returns:
- CII XML
-
getItemTotalAllowanceChargeStr
protected java.lang.String getItemTotalAllowanceChargeStr(IZUGFeRDAllowanceCharge allowance, IAbsoluteValueProvider item)
returns the XML for a charge or allowance on item total level- Parameters:
allowance- the allowance or chargeitem- the line- Returns:
- CII XML
-
generateXML
public void generateXML(IExportableTransaction trans)
- Specified by:
generateXMLin interfaceIXMLProvider
-
buildItemNotes
protected java.lang.String buildItemNotes(IZUGFeRDExportableItem currentItem)
-
buildNotes
protected java.lang.String buildNotes(IExportableTransaction exportableTransaction)
-
setProfile
public void setProfile(Profile p)
- Specified by:
setProfilein interfaceIXMLProvider
-
-