Documentation
¶
Index ¶
- func DecimalString(value float64) string
- type ApproximateTaxes
- type CofinsAliq
- type CofinsGroup
- type CofinsNt
- type CofinsOutr
- type CofinsQtde
- type CofinsSt
- type Construction
- type DeductionDocument
- type DeductionSupplier
- type DeductionSupplierAddress
- type Deductions
- type Event
- type FederalTaxes
- type ForeignTrade
- type Fuel
- type IbsCbs
- type IbsCbsDeferral
- type IbsCbsGovernment
- type IbsCbsRecipient
- type IbsCbsRecipientAddress
- type IbsCbsRegularTaxation
- type Icms00
- type Icms02
- type Icms10
- type Icms15
- type Icms20
- type Icms30
- type Icms40
- type Icms51
- type Icms53
- type Icms60
- type Icms61
- type Icms70
- type Icms90
- type IcmsGroup
- type IcmsPart
- type IcmsSn101
- type IcmsSn102
- type IcmsSn201
- type IcmsSn202
- type IcmsSn500
- type IcmsSn900
- type IcmsSt
- type IcmsUfDest
- type IntermediaryAddress
- type Ipi
- type IpiNt
- type IpiTrib
- type IpiVariant
- type IssDetails
- type IssMunicipalBenefit
- type IssSuspension
- type MovableGood
- type MunicipalNfse
- type NfseDetails
- type NfseIntermediary
- type OtherDocument
- type OtherFiscalDocument
- type PaperInvoice
- type PersonAddress
- type PisAliq
- type PisCofins
- type PisGroup
- type PisNt
- type PisOutr
- type PisQtde
- type PisSt
- type PresumedCredit
- type Product
- type RealEstate
- type RealEstateBaseAdjustment
- type RealEstateLease
- type RealEstateUnit
- type References
- type ServiceAddress
- type Substitution
- type Tax
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecimalString ¶ added in v0.21.0
DecimalString writes a price as the plain decimal the API takes, never in exponent form. The catalog's unit price goes through it too.
Types ¶
type ApproximateTaxes ¶ added in v0.27.0
type ApproximateTaxes struct {
SimplesPercent *float64
FederalPercent *float64
StatePercent *float64
MunicipalPercent *float64
FederalAmount *float64
StateAmount *float64
MunicipalAmount *float64
}
ApproximateTaxes is the approximate tax burden of Lei 12.741 (totTrib). Send exactly one shape: SimplesPercent; the federal, state and municipal percentages; or the federal, state and municipal amounts. A left-out member of the chosen group is written as 0 by the API.
type CofinsAliq ¶
type CofinsAliq struct {
CST string `json:"cst"`
VBC string `json:"v_bc"`
PCofins string `json:"p_cofins"`
VCofins string `json:"v_cofins"`
}
CofinsAliq is COFINSAliq: COFINS taxed by rate.
func NewCofinsAliq ¶ added in v0.4.0
func NewCofinsAliq(cST, vBC, pCOFINS, vCOFINS string) CofinsAliq
NewCofinsAliq fills the fields the schema requires.
type CofinsGroup ¶
type CofinsGroup interface {
// contains filtered or unexported methods
}
CofinsGroup is any of the COFINS variants.
type CofinsNt ¶
type CofinsNt struct {
CST string `json:"cst"`
}
CofinsNt is COFINSNT: COFINS not taxed.
func NewCofinsNt ¶ added in v0.4.0
NewCofinsNt fills the fields the schema requires.
type CofinsOutr ¶
type CofinsOutr struct {
CST string `json:"cst"`
VBC *string `json:"v_bc,omitempty"`
PCofins *string `json:"p_cofins,omitempty"`
QBCProd *string `json:"q_bc_prod,omitempty"`
VAliqProd *string `json:"v_aliq_prod,omitempty"`
VCofins string `json:"v_cofins"`
}
CofinsOutr is COFINSOutr: COFINS taxed some other way.
func NewCofinsOutr ¶ added in v0.4.0
func NewCofinsOutr(cST, vCOFINS string) CofinsOutr
NewCofinsOutr fills the fields the schema requires.
type CofinsQtde ¶ added in v0.4.0
type CofinsQtde struct {
CST string `json:"cst"`
QBCProd string `json:"q_bc_prod"`
VAliqProd string `json:"v_aliq_prod"`
VCofins string `json:"v_cofins"`
}
CofinsQtde is COFINSQtde: COFINS taxed by quantity.
func NewCofinsQtde ¶ added in v0.4.0
func NewCofinsQtde(qBCProd, vAliqProd, vCOFINS string) CofinsQtde
NewCofinsQtde fills the fields the schema requires.
type CofinsSt ¶ added in v0.4.0
type CofinsSt struct {
VBC *string `json:"v_bc,omitempty"`
PCofins *string `json:"p_cofins,omitempty"`
QBCProd *string `json:"q_bc_prod,omitempty"`
VAliqProd *string `json:"v_aliq_prod,omitempty"`
VCofins string `json:"v_cofins"`
IndSomaCOFINSST *string `json:"ind_soma_cofins_st,omitempty"`
}
CofinsSt is COFINS withheld by substitution.
type Construction ¶ added in v0.27.0
type Construction struct {
PropertyRegistration string
WorkIDType string
WorkID string
Address *ServiceAddress
}
Construction is the obra group. Identify the work by WorkID with WorkIDType ("cno" or "cib", a CIB being exactly 8 characters) or by Address, not both. PropertyRegistration is optional and not enough alone.
type DeductionDocument ¶ added in v0.27.0
type DeductionDocument struct {
Type int
Description string
NfseKey string
NfeKey string
CteKey string
MunicipalNfse *MunicipalNfse
PaperInvoice *PaperInvoice
FiscalDocument *OtherFiscalDocument
OtherDocument *OtherDocument
IssueDate time.Time
CompetenceDate time.Time
TotalAmount float64
DeductedAmount float64
Supplier *DeductionSupplier
}
DeductionDocument is one document behind the deduction (docDedRed, or docAjusteBC in the homologation layout). Set exactly one of NfseKey, NfeKey, CteKey, MunicipalNfse, PaperInvoice, FiscalDocument and OtherDocument. Type is the tpDedRed code: 1 to 9, 99, 101 to 105 or 199.
type DeductionSupplier ¶ added in v0.27.0
type DeductionSupplier struct {
TaxID string
ForeignID string
Name string
Address *PersonAddress
}
DeductionSupplier is fornec, who issued the deducted document: TaxID (CPF or CNPJ, masks dropped) with an address in Brazil, or ForeignID (NIF) with an address abroad. Exactly one of the two.
type DeductionSupplierAddress ¶ added in v0.27.0
type DeductionSupplierAddress = PersonAddress
DeductionSupplierAddress is the supplier's address (fornec/end).
type Deductions ¶ added in v0.27.0
type Deductions struct {
Percent *float64
Amount *float64
Documents []DeductionDocument
}
Deductions is the ISSQN base deduction or reduction (vDedRed, or vAjusteBC in the homologation layout). Percent and Amount are exclusive; Documents are 1 to 1000. Send at least one of the three.
type Event ¶ added in v0.27.0
type Event struct {
Name string
StartDate time.Time
EndDate time.Time
EventID string
Address *ServiceAddress
}
Event is the atvEvento group. Name, StartDate and EndDate are required; identify the place by EventID or by Address, one of the two. The dates carry only their day.
type FederalTaxes ¶ added in v0.27.0
type FederalTaxes struct {
PisCofins *PisCofins
SocialSecurityWithheld *float64
IrrfWithheld *float64
SocialContributionsWithheld *float64
}
FederalTaxes are the federal taxes of the service (tribFed). Send at least one member. The withheld amounts are in BRL and above 0.
type ForeignTrade ¶ added in v0.27.0
type ForeignTrade struct {
ServiceMode int
Relationship *int
CurrencyCode string
ForeignAmount float64
ProviderSupport int
RecipientSupport int
TemporaryGoods int
ImportDeclaration string
ExportRegistration string
}
ForeignTrade is the comExt group, for a service traded with someone abroad. The coded fields take what the layout lists: ServiceMode 1 to 4, Relationship 0 to 6 or 9 (a pointer so 0, none, can be sent), ProviderSupport 1 to 8, RecipientSupport 1 to 26 and TemporaryGoods 1 to 3, where 2 needs ImportDeclaration and 3 needs ExportRegistration. CurrencyCode is the 3-digit BACEN code. ShareWithMdic is sent only when true.
type Fuel ¶ added in v0.14.0
type Fuel struct {
AnpCode string
AnpDescription string
ConsumerState string
GlpPercent *float64
NaturalGasNationalPercent *float64
NaturalGasImportedPercent *float64
StartingValue *float64
Codif *string
TemperatureQuantity *float64
BiodieselPercent *float64
}
Fuel is the NF-e fuel group (comb), needed for a good on a fuel CFOP. AnpCode (cProdANP, 9 digits), AnpDescription (descANP) and ConsumerState (UFCons) are required; the others are sent only when set. It goes on the wire under the item's "fuel" key and never together with ExtraGroups["comb"].
type IbsCbs ¶ added in v0.9.0
type IbsCbs struct {
CST string
Classification string
Base *float64
// RateState (pIBSUF), RateCity (pIBSMun) and RateFederal (pCBS) are in
// percent and sent only when set, so 0 is a rate a pointer can say. An
// NF-e group carries all three; an NFS-e group carries none.
RateState *float64
RateCity *float64
RateFederal *float64
// OperationIndicator is the cIndOp, 6 digits. Sent only when set.
OperationIndicator *string
// ReductionIbs is the IBS pRedAliq (state and municipality), in percent:
// the cClassTrib's pRedIBS. Sent only when set.
ReductionIbs *float64
// ReductionCbs is the CBS pRedAliq, in percent: the cClassTrib's pRedCBS.
// Sent only when set.
ReductionCbs *float64
// The fields below are NFS-e only and sent only when set.
PersonalUse *bool
Government *IbsCbsGovernment
ReferencedNfse []string
Recipient *IbsCbsRecipient
RealEstate *RealEstate
MovableGoods []MovableGood
RegularTaxation *IbsCbsRegularTaxation
Deferral *IbsCbsDeferral
PresumedCredit *string
}
type IbsCbsDeferral ¶ added in v0.27.0
IbsCbsDeferral is gDif: the deferred share of each tax, in percent.
type IbsCbsGovernment ¶ added in v0.27.0
IbsCbsGovernment is tpOper and tpEnteGov: OperationType "1" to "5" and EntityType "1" to "4". Send at least one.
type IbsCbsRecipient ¶ added in v0.27.0
type IbsCbsRecipient struct {
TaxID string
NIF string
NoNifReason string
Name string
Address *IbsCbsRecipientAddress
Phone string
Email string
}
IbsCbsRecipient is the dest group: who receives the service when it is not the tomador. Send exactly one of TaxID, NIF or NoNifReason ("0", "1" or "2").
type IbsCbsRecipientAddress ¶ added in v0.27.0
type IbsCbsRecipientAddress struct {
Street string
Number string
Complement string
Neighborhood string
CityCode string
ZipCode string
CountryCode string
PostalCode string
City string
Region string
}
IbsCbsRecipientAddress is the dest/end address: in Brazil (CityCode and ZipCode) or abroad (CountryCode, PostalCode, City and Region), never both. Street, Number and Neighborhood are required.
type IbsCbsRegularTaxation ¶ added in v0.27.0
IbsCbsRegularTaxation is gTribRegular: the CST (3 digits) and Classification (6 digits) the operation would have under regular taxation.
type Icms00 ¶
type Icms00 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
ModBC string `json:"mod_bc"`
VBC string `json:"v_bc"`
PICMS string `json:"p_icms"`
VICMS string `json:"v_icms"`
PFCP *string `json:"p_fcp,omitempty"`
VFCP *string `json:"v_fcp,omitempty"`
}
Icms00 is ICMS00: ICMS fully taxed.
type Icms02 ¶ added in v0.4.0
type Icms02 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
QBCMono *string `json:"q_bc_mono,omitempty"`
AdRemICMS string `json:"ad_rem_icms"`
VICMSMono string `json:"v_icms_mono"`
}
Icms02 is ICMS02: ICMS monofasico, taxed by unit.
type Icms10 ¶ added in v0.4.0
type Icms10 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
ModBC string `json:"mod_bc"`
VBC string `json:"v_bc"`
PICMS string `json:"p_icms"`
VICMS string `json:"v_icms"`
VBCFCP *string `json:"v_bc_fcp,omitempty"`
PFCP *string `json:"p_fcp,omitempty"`
VFCP *string `json:"v_fcp,omitempty"`
ModBCST string `json:"mod_bc_st"`
PMVAST *string `json:"p_mva_st,omitempty"`
PRedBCST *string `json:"p_red_bc_st,omitempty"`
VBCST string `json:"v_bc_st"`
PICMSST string `json:"p_icms_st"`
VICMSST string `json:"v_icms_st"`
VBCFCPST *string `json:"v_bc_fcp_st,omitempty"`
PFCPST *string `json:"p_fcp_st,omitempty"`
VFCPST *string `json:"v_fcp_st,omitempty"`
VICMSSTDeson *string `json:"v_icms_st_deson,omitempty"`
MotDesICMSST *string `json:"mot_des_icms_st,omitempty"`
}
Icms10 is ICMS10: ICMS taxed with substitution.
type Icms15 ¶ added in v0.4.0
type Icms15 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
QBCMono *string `json:"q_bc_mono,omitempty"`
AdRemICMS string `json:"ad_rem_icms"`
VICMSMono string `json:"v_icms_mono"`
QBCMonoReten *string `json:"q_bc_mono_reten,omitempty"`
AdRemICMSReten string `json:"ad_rem_icms_reten"`
VICMSMonoReten string `json:"v_icms_mono_reten"`
PRedAdRem *string `json:"p_red_ad_rem,omitempty"`
MotRedAdRem *string `json:"mot_red_ad_rem,omitempty"`
}
Icms15 is ICMS15: ICMS monofasico with retention.
type Icms20 ¶ added in v0.4.0
type Icms20 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
ModBC string `json:"mod_bc"`
PRedBC string `json:"p_red_bc"`
VBC string `json:"v_bc"`
PICMS string `json:"p_icms"`
VICMS string `json:"v_icms"`
VBCFCP *string `json:"v_bc_fcp,omitempty"`
PFCP *string `json:"p_fcp,omitempty"`
VFCP *string `json:"v_fcp,omitempty"`
VICMSDeson *string `json:"v_icms_deson,omitempty"`
MotDesICMS *string `json:"mot_des_icms,omitempty"`
IndDeduzDeson *string `json:"ind_deduz_deson,omitempty"`
}
Icms20 is ICMS20: ICMS with a reduced base.
type Icms30 ¶ added in v0.4.0
type Icms30 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
ModBCST string `json:"mod_bc_st"`
PMVAST *string `json:"p_mva_st,omitempty"`
PRedBCST *string `json:"p_red_bc_st,omitempty"`
VBCST string `json:"v_bc_st"`
PICMSST string `json:"p_icms_st"`
VICMSST string `json:"v_icms_st"`
VBCFCPST *string `json:"v_bc_fcp_st,omitempty"`
PFCPST *string `json:"p_fcp_st,omitempty"`
VFCPST *string `json:"v_fcp_st,omitempty"`
VICMSDeson *string `json:"v_icms_deson,omitempty"`
MotDesICMS *string `json:"mot_des_icms,omitempty"`
IndDeduzDeson *string `json:"ind_deduz_deson,omitempty"`
}
Icms30 is ICMS30: ICMS exempt with substitution.
type Icms40 ¶
type Icms40 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
VICMSDeson *string `json:"v_icms_deson,omitempty"`
MotDesICMS *string `json:"mot_des_icms,omitempty"`
IndDeduzDeson *string `json:"ind_deduz_deson,omitempty"`
}
Icms40 is ICMS40: ICMS exempt or not taxed.
type Icms51 ¶ added in v0.4.0
type Icms51 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
ModBC *string `json:"mod_bc,omitempty"`
PRedBC *string `json:"p_red_bc,omitempty"`
CBenefRBC *string `json:"c_benef_rbc,omitempty"`
VBC *string `json:"v_bc,omitempty"`
PICMS *string `json:"p_icms,omitempty"`
VICMSOp *string `json:"v_icms_op,omitempty"`
PDif *string `json:"p_dif,omitempty"`
VICMSDif *string `json:"v_icms_dif,omitempty"`
VICMS *string `json:"v_icms,omitempty"`
VBCFCP *string `json:"v_bc_fcp,omitempty"`
PFCP *string `json:"p_fcp,omitempty"`
VFCP *string `json:"v_fcp,omitempty"`
PFCPDif *string `json:"p_fcp_dif,omitempty"`
VFCPDif *string `json:"v_fcp_dif,omitempty"`
VFCPEfet *string `json:"v_fcp_efet,omitempty"`
}
Icms51 is ICMS51: ICMS deferred.
type Icms53 ¶ added in v0.4.0
type Icms53 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
QBCMono *string `json:"q_bc_mono,omitempty"`
AdRemICMS *string `json:"ad_rem_icms,omitempty"`
VICMSMonoOp *string `json:"v_icms_mono_op,omitempty"`
PDif *string `json:"p_dif,omitempty"`
VICMSMonoDif *string `json:"v_icms_mono_dif,omitempty"`
VICMSMono *string `json:"v_icms_mono,omitempty"`
QBCMonoDif *string `json:"q_bc_mono_dif,omitempty"`
AdRemICMSDif *string `json:"ad_rem_icms_dif,omitempty"`
}
Icms53 is ICMS53: ICMS monofasico deferred.
type Icms60 ¶
type Icms60 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
VBCSTRet *string `json:"v_bc_st_ret,omitempty"`
PST *string `json:"p_st,omitempty"`
VICMSSubstituto *string `json:"v_icms_substituto,omitempty"`
VICMSSTRet *string `json:"v_icms_st_ret,omitempty"`
VBCFCPSTRet *string `json:"v_bc_fcp_st_ret,omitempty"`
PFCPSTRet *string `json:"p_fcp_st_ret,omitempty"`
VFCPSTRet *string `json:"v_fcp_st_ret,omitempty"`
PRedBCEfet *string `json:"p_red_bc_efet,omitempty"`
VBCEfet *string `json:"v_bc_efet,omitempty"`
PICMSEfet *string `json:"p_icms_efet,omitempty"`
VICMSEfet *string `json:"v_icms_efet,omitempty"`
}
Icms60 is ICMS60: ICMS already charged by an earlier substitution.
type Icms61 ¶ added in v0.4.0
type Icms61 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
QBCMonoRet *string `json:"q_bc_mono_ret,omitempty"`
AdRemICMSRet string `json:"ad_rem_icms_ret"`
VICMSMonoRet string `json:"v_icms_mono_ret"`
}
Icms61 is ICMS61: ICMS monofasico already charged earlier.
type Icms70 ¶ added in v0.4.0
type Icms70 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
ModBC string `json:"mod_bc"`
PRedBC string `json:"p_red_bc"`
VBC string `json:"v_bc"`
PICMS string `json:"p_icms"`
VICMS string `json:"v_icms"`
VBCFCP *string `json:"v_bc_fcp,omitempty"`
PFCP *string `json:"p_fcp,omitempty"`
VFCP *string `json:"v_fcp,omitempty"`
ModBCST string `json:"mod_bc_st"`
PMVAST *string `json:"p_mva_st,omitempty"`
PRedBCST *string `json:"p_red_bc_st,omitempty"`
VBCST string `json:"v_bc_st"`
PICMSST string `json:"p_icms_st"`
VICMSST string `json:"v_icms_st"`
VBCFCPST *string `json:"v_bc_fcp_st,omitempty"`
PFCPST *string `json:"p_fcp_st,omitempty"`
VFCPST *string `json:"v_fcp_st,omitempty"`
VICMSDeson *string `json:"v_icms_deson,omitempty"`
MotDesICMS *string `json:"mot_des_icms,omitempty"`
IndDeduzDeson *string `json:"ind_deduz_deson,omitempty"`
VICMSSTDeson *string `json:"v_icms_st_deson,omitempty"`
MotDesICMSST *string `json:"mot_des_icms_st,omitempty"`
}
Icms70 is ICMS70: ICMS with a reduced base and substitution.
type Icms90 ¶ added in v0.4.0
type Icms90 struct {
Orig string `json:"orig"`
CST string `json:"cst"`
ModBC *string `json:"mod_bc,omitempty"`
VBC *string `json:"v_bc,omitempty"`
PRedBC *string `json:"p_red_bc,omitempty"`
CBenefRBC *string `json:"c_benef_rbc,omitempty"`
PICMS *string `json:"p_icms,omitempty"`
VICMSOp *string `json:"v_icms_op,omitempty"`
PDif *string `json:"p_dif,omitempty"`
VICMSDif *string `json:"v_icms_dif,omitempty"`
VICMS *string `json:"v_icms,omitempty"`
VBCFCP *string `json:"v_bc_fcp,omitempty"`
PFCP *string `json:"p_fcp,omitempty"`
VFCP *string `json:"v_fcp,omitempty"`
PFCPDif *string `json:"p_fcp_dif,omitempty"`
VFCPDif *string `json:"v_fcp_dif,omitempty"`
VFCPEfet *string `json:"v_fcp_efet,omitempty"`
ModBCST *string `json:"mod_bc_st,omitempty"`
PMVAST *string `json:"p_mva_st,omitempty"`
PRedBCST *string `json:"p_red_bc_st,omitempty"`
VBCST *string `json:"v_bc_st,omitempty"`
PICMSST *string `json:"p_icms_st,omitempty"`
VICMSST *string `json:"v_icms_st,omitempty"`
VBCFCPST *string `json:"v_bc_fcp_st,omitempty"`
PFCPST *string `json:"p_fcp_st,omitempty"`
VFCPST *string `json:"v_fcp_st,omitempty"`
VICMSDeson *string `json:"v_icms_deson,omitempty"`
MotDesICMS *string `json:"mot_des_icms,omitempty"`
IndDeduzDeson *string `json:"ind_deduz_deson,omitempty"`
VICMSSTDeson *string `json:"v_icms_st_deson,omitempty"`
MotDesICMSST *string `json:"mot_des_icms_st,omitempty"`
}
Icms90 is ICMS90: ICMS, other cases.
type IcmsGroup ¶
type IcmsGroup interface {
// contains filtered or unexported methods
}
IcmsGroup is any of the ICMS variants.
type IcmsPart ¶ added in v0.4.0
type IcmsPart struct {
Orig string `json:"orig"`
CST string `json:"cst"`
ModBC string `json:"mod_bc"`
VBC string `json:"v_bc"`
PRedBC *string `json:"p_red_bc,omitempty"`
PICMS string `json:"p_icms"`
VICMS string `json:"v_icms"`
ModBCST string `json:"mod_bc_st"`
PMVAST *string `json:"p_mva_st,omitempty"`
PRedBCST *string `json:"p_red_bc_st,omitempty"`
VBCST string `json:"v_bc_st"`
PICMSST string `json:"p_icms_st"`
VICMSST string `json:"v_icms_st"`
VBCFCPST *string `json:"v_bc_fcp_st,omitempty"`
PFCPST *string `json:"p_fcp_st,omitempty"`
VFCPST *string `json:"v_fcp_st,omitempty"`
PBCOp string `json:"p_bc_op"`
UFST string `json:"uf_st"`
VICMSDeson *string `json:"v_icms_deson,omitempty"`
MotDesICMS *string `json:"mot_des_icms,omitempty"`
IndDeduzDeson *string `json:"ind_deduz_deson,omitempty"`
}
IcmsPart is ICMSPart: ICMS split between the origin and destination states.
func NewIcmsPart ¶ added in v0.4.0
func NewIcmsPart(orig, cST, modBC, vBC, pICMS, vICMS, modBCST, vBCST, pICMSST, vICMSST, pBCOp, uFST string) IcmsPart
NewIcmsPart fills the fields the schema requires.
type IcmsSn101 ¶
type IcmsSn101 struct {
Orig string `json:"orig"`
CSOSN string `json:"csosn"`
PCredSN string `json:"p_cred_sn"`
VCredICMSSN string `json:"v_cred_icms_sn"`
}
IcmsSn101 is ICMSSN101: Simples Nacional ICMS with a credit.
func NewIcmsSn101 ¶
NewIcmsSn101 fills the fields the schema requires.
type IcmsSn102 ¶
IcmsSn102 is ICMSSN102: Simples Nacional ICMS without a credit.
func NewIcmsSn102 ¶ added in v0.4.0
NewIcmsSn102 fills the fields the schema requires.
type IcmsSn201 ¶ added in v0.4.0
type IcmsSn201 struct {
Orig string `json:"orig"`
CSOSN string `json:"csosn"`
ModBCST string `json:"mod_bc_st"`
PMVAST *string `json:"p_mva_st,omitempty"`
PRedBCST *string `json:"p_red_bc_st,omitempty"`
VBCST string `json:"v_bc_st"`
PICMSST string `json:"p_icms_st"`
VICMSST string `json:"v_icms_st"`
VBCFCPST *string `json:"v_bc_fcp_st,omitempty"`
PFCPST *string `json:"p_fcp_st,omitempty"`
VFCPST *string `json:"v_fcp_st,omitempty"`
PCredSN string `json:"p_cred_sn"`
VCredICMSSN string `json:"v_cred_icms_sn"`
}
IcmsSn201 is ICMSSN201: Simples Nacional ICMS with a credit and substitution.
func NewIcmsSn201 ¶ added in v0.4.0
NewIcmsSn201 fills the fields the schema requires.
type IcmsSn202 ¶ added in v0.4.0
type IcmsSn202 struct {
Orig string `json:"orig"`
CSOSN string `json:"csosn"`
ModBCST string `json:"mod_bc_st"`
PMVAST *string `json:"p_mva_st,omitempty"`
PRedBCST *string `json:"p_red_bc_st,omitempty"`
VBCST string `json:"v_bc_st"`
PICMSST string `json:"p_icms_st"`
VICMSST string `json:"v_icms_st"`
VBCFCPST *string `json:"v_bc_fcp_st,omitempty"`
PFCPST *string `json:"p_fcp_st,omitempty"`
VFCPST *string `json:"v_fcp_st,omitempty"`
}
IcmsSn202 is ICMSSN202: Simples Nacional ICMS without a credit, with substitution.
func NewIcmsSn202 ¶ added in v0.4.0
NewIcmsSn202 fills the fields the schema requires.
type IcmsSn500 ¶ added in v0.4.0
type IcmsSn500 struct {
Orig string `json:"orig"`
CSOSN string `json:"csosn"`
VBCSTRet *string `json:"v_bc_st_ret,omitempty"`
PST *string `json:"p_st,omitempty"`
VICMSSubstituto *string `json:"v_icms_substituto,omitempty"`
VICMSSTRet *string `json:"v_icms_st_ret,omitempty"`
VBCFCPSTRet *string `json:"v_bc_fcp_st_ret,omitempty"`
PFCPSTRet *string `json:"p_fcp_st_ret,omitempty"`
VFCPSTRet *string `json:"v_fcp_st_ret,omitempty"`
PRedBCEfet *string `json:"p_red_bc_efet,omitempty"`
VBCEfet *string `json:"v_bc_efet,omitempty"`
PICMSEfet *string `json:"p_icms_efet,omitempty"`
VICMSEfet *string `json:"v_icms_efet,omitempty"`
}
IcmsSn500 is ICMSSN500: Simples Nacional ICMS already charged by substitution.
func NewIcmsSn500 ¶ added in v0.4.0
NewIcmsSn500 fills the fields the schema requires.
type IcmsSn900 ¶ added in v0.1.1
type IcmsSn900 struct {
Orig *string `json:"orig,omitempty"`
CSOSN string `json:"csosn"`
ModBC *string `json:"mod_bc,omitempty"`
VBC *string `json:"v_bc,omitempty"`
PRedBC *string `json:"p_red_bc,omitempty"`
PICMS *string `json:"p_icms,omitempty"`
VICMS *string `json:"v_icms,omitempty"`
ModBCST *string `json:"mod_bc_st,omitempty"`
PMVAST *string `json:"p_mva_st,omitempty"`
PRedBCST *string `json:"p_red_bc_st,omitempty"`
VBCST *string `json:"v_bc_st,omitempty"`
PICMSST *string `json:"p_icms_st,omitempty"`
VICMSST *string `json:"v_icms_st,omitempty"`
VBCFCPST *string `json:"v_bc_fcp_st,omitempty"`
PFCPST *string `json:"p_fcp_st,omitempty"`
VFCPST *string `json:"v_fcp_st,omitempty"`
PCredSN *string `json:"p_cred_sn,omitempty"`
VCredICMSSN *string `json:"v_cred_icms_sn,omitempty"`
}
IcmsSn900 is ICMSSN900: Simples Nacional ICMS, other cases.
type IcmsSt ¶ added in v0.4.0
type IcmsSt struct {
Orig string `json:"orig"`
CST string `json:"cst"`
VBCSTRet string `json:"v_bc_st_ret"`
PST *string `json:"p_st,omitempty"`
VICMSSubstituto *string `json:"v_icms_substituto,omitempty"`
VICMSSTRet string `json:"v_icms_st_ret"`
VBCFCPSTRet *string `json:"v_bc_fcp_st_ret,omitempty"`
PFCPSTRet *string `json:"p_fcp_st_ret,omitempty"`
VFCPSTRet *string `json:"v_fcp_st_ret,omitempty"`
VBCSTDest string `json:"v_bc_st_dest"`
VICMSSTDest string `json:"v_icms_st_dest"`
PRedBCEfet *string `json:"p_red_bc_efet,omitempty"`
VBCEfet *string `json:"v_bc_efet,omitempty"`
PICMSEfet *string `json:"p_icms_efet,omitempty"`
VICMSEfet *string `json:"v_icms_efet,omitempty"`
}
IcmsSt is ICMSST: ICMS charged earlier, for the substituted taxpayer.
type IcmsUfDest ¶
type IcmsUfDest struct {
VBCUFDest string `json:"v_bc_uf_dest"`
VBCFCPUFDest *string `json:"v_bc_fcp_uf_dest,omitempty"`
PFCPUFDest *string `json:"p_fcp_uf_dest,omitempty"`
PICMSUFDest string `json:"p_icms_uf_dest"`
PICMSInter string `json:"p_icms_inter"`
PICMSInterPart string `json:"p_icms_inter_part"`
VFCPUFDest *string `json:"v_fcp_uf_dest,omitempty"`
VICMSUFDest string `json:"v_icms_uf_dest"`
VICMSUFRemet string `json:"v_icms_uf_remet"`
}
IcmsUfDest is the interstate ICMS share owed to the destination state.
type IntermediaryAddress ¶ added in v0.27.0
type IntermediaryAddress = PersonAddress
IntermediaryAddress is the intermediary's address (interm/end).
type Ipi ¶
type Ipi struct {
CNPJProd *string `json:"cnpj_prod,omitempty"`
CSelo *string `json:"c_selo,omitempty"`
QSelo *string `json:"q_selo,omitempty"`
CEnq string `json:"c_enq"`
Trib IpiVariant `json:"-"`
}
Ipi is this item's IPI.
type IpiTrib ¶
type IpiTrib struct {
CST string `json:"cst"`
VBC *string `json:"v_bc,omitempty"`
PIPI *string `json:"p_ipi,omitempty"`
QUnid *string `json:"q_unid,omitempty"`
VUnid *string `json:"v_unid,omitempty"`
VIPI string `json:"v_ipi"`
}
IpiTrib is IPITrib: IPI taxed by rate or by quantity.
func NewIpiTrib ¶ added in v0.4.0
NewIpiTrib fills the fields the schema requires.
type IpiVariant ¶
type IpiVariant interface {
// contains filtered or unexported methods
}
IpiVariant is any of the IPI variants.
type IssDetails ¶ added in v0.27.0
type IssDetails struct {
Taxation string
ImmunityType *int
ResultCountryCode string
Suspension *IssSuspension
Rate *float64
Retention string
MunicipalBenefit *IssMunicipalBenefit
}
IssDetails is the ISSQN of the service (tribMun). Taxation is "taxable" (the default when empty), "immune", "export" or "not_levied"; Retention is "none", "tomador" or "intermediary".
type IssMunicipalBenefit ¶ added in v0.27.0
IssMunicipalBenefit is the municipality's registered benefit (BM): ID is the 14-digit nBM, and at most one of ReductionAmount and ReductionPercent goes with it.
type IssSuspension ¶ added in v0.27.0
IssSuspension is exigSusp: Type is "judicial" or "administrative" and ProcessNumber the 30-digit proceeding number.
type MovableGood ¶ added in v0.27.0
MovableGood is one bensMoveis entry: NCM (8 digits), Description and a Quantity from 1 to 999.
type MunicipalNfse ¶ added in v0.27.0
MunicipalNfse is a municipal NFS-e outside the national repository.
type NfseDetails ¶ added in v0.27.0
type NfseDetails struct {
ApproximateTaxes *ApproximateTaxes
CompetenceDate time.Time
ServiceCityCode string
ServiceCountryCode string
Iss *IssDetails
Federal *FederalTaxes
Deductions *Deductions
Substitution *Substitution
Construction *Construction
Event *Event
References *References
Intermediary *NfseIntermediary
ForeignTrade *ForeignTrade
}
NfseDetails are the NFS-e document-level fields beyond the lines. Every group is optional and left out when nil; NFS-e only, refused for an NF-e. CompetenceDate (dCompet) carries only its day. ServiceCityCode and ServiceCountryCode are exclusive, and the country is never BR.
type NfseIntermediary ¶ added in v0.27.0
type NfseIntermediary struct {
TaxID string
ForeignID string
ForeignIDMissingReason *int
Caepf string
MunicipalRegistration string
Name string
Address *PersonAddress
Phone string
Email string
}
NfseIntermediary is the interm group, identified by exactly one of TaxID (CPF or CNPJ, masks dropped), ForeignID (NIF) or ForeignIDMissingReason (1 exempt, 2 not required). A ForeignID or ForeignIDMissingReason needs an Address abroad, and a TaxID one in Brazil or none.
type OtherDocument ¶ added in v0.27.0
OtherDocument is a non-fiscal document. Description is read by the homologation layout only.
type OtherFiscalDocument ¶ added in v0.27.0
OtherFiscalDocument is a fiscal document outside the national repository. CityCode and Description are read by the homologation layout only.
type PaperInvoice ¶ added in v0.27.0
PaperInvoice is a paper service invoice (NFNFS).
type PersonAddress ¶ added in v0.27.0
type PersonAddress struct {
Street string
Number string
Complement string
Neighborhood string
CityCode string
ZipCode string
CountryCode string
PostalCode string
City string
State string
}
PersonAddress is a person's address: in Brazil (CityCode and ZipCode) or abroad (CountryCode, PostalCode, City and State), never both. Street, Number and Neighborhood are required.
type PisAliq ¶
type PisAliq struct {
CST string `json:"cst"`
VBC string `json:"v_bc"`
PPIS string `json:"p_pis"`
VPIS string `json:"v_pis"`
}
PisAliq is PISAliq: PIS taxed by rate.
func NewPisAliq ¶ added in v0.4.0
NewPisAliq fills the fields the schema requires.
type PisCofins ¶ added in v0.27.0
type PisCofins struct {
CST string
Base *float64
PisRate *float64
CofinsRate *float64
PisAmount *float64
CofinsAmount *float64
WithholdingType *int
}
PisCofins is the PIS and COFINS of the service. CST is required. WithholdingType is tpRetPisCofins, 0 to 9.
type PisGroup ¶
type PisGroup interface {
// contains filtered or unexported methods
}
PisGroup is any of the PIS variants.
type PisOutr ¶
type PisOutr struct {
CST string `json:"cst"`
VBC *string `json:"v_bc,omitempty"`
PPIS *string `json:"p_pis,omitempty"`
QBCProd *string `json:"q_bc_prod,omitempty"`
VAliqProd *string `json:"v_aliq_prod,omitempty"`
VPIS string `json:"v_pis"`
}
PisOutr is PISOutr: PIS taxed some other way.
func NewPisOutr ¶ added in v0.4.0
NewPisOutr fills the fields the schema requires.
type PisQtde ¶ added in v0.4.0
type PisQtde struct {
CST string `json:"cst"`
QBCProd string `json:"q_bc_prod"`
VAliqProd string `json:"v_aliq_prod"`
VPIS string `json:"v_pis"`
}
PisQtde is PISQtde: PIS taxed by quantity.
func NewPisQtde ¶ added in v0.4.0
NewPisQtde fills the fields the schema requires.
type PisSt ¶ added in v0.4.0
type PisSt struct {
VBC *string `json:"v_bc,omitempty"`
PPIS *string `json:"p_pis,omitempty"`
QBCProd *string `json:"q_bc_prod,omitempty"`
VAliqProd *string `json:"v_aliq_prod,omitempty"`
VPIS string `json:"v_pis"`
IndSomaPISST *string `json:"ind_soma_pis_st,omitempty"`
}
PisSt is PIS withheld by substitution.
type PresumedCredit ¶
type Product ¶
type Product struct {
// ItemID names a catalog item of the company (see stackin.Items). With
// it, Description is optional and the item fills whatever the line
// leaves out: Unit, Barcode, NCM, CFOP, CEST, Tax, ServiceCode,
// TaxRetained and, when neither Amount nor UnitPrice is set, the price.
// A field set here wins. Unit is then not defaulted to UN and
// TaxRetained is sent only when set (nil), so the item's values are not
// overridden by the SDK's own defaults.
ItemID string
Description string
Amount float64
UnitPrice *float64
Unit string
Quantity float64
Barcode *string
Freight *float64
Insurance *float64
Discount *float64
OtherExpenses *float64
UsedMovableAsset bool
PurchaseOrder *string
PurchaseOrderItem *string
// NetWeight and GrossWeight are one unit's weight in kg, NF-e only. A
// pointer so a real 0 can be sent.
NetWeight *float64
GrossWeight *float64
NCM *string
CFOP *string
CEST *string
NVECodes []string
IndEscala *string
ManufacturerCNPJ *string
TaxBenefitCode *string
PresumedCredits []PresumedCredit
ExTipi *string
ImportContentControlNumber *string
RecopiNumber *string
ExtraGroups map[string]any
Tax *Tax
IbsCbs *IbsCbs
Fuel *Fuel
ServiceCode *string // LC 116/2003 item.subitem, nfse only
NBS string
ServiceDiscount *float64 // unconditional discount, nfse only
// MunicipalServiceCode is cTribMun, three digits; InternalCode is
// cIntContrib, up to 20 letters or digits; ConditionalDiscount is
// vDescCond in BRL, above 0. All nfse only; the API refuses the first on
// an MEI.
MunicipalServiceCode string
InternalCode string
ConditionalDiscount *float64
// TaxRetained is a pointer so false can be sent on a line with an ItemID
// (turning off a retention the item has). nil is left to the item, or
// sent as false when there is no ItemID.
TaxRetained *bool // ISSQN retained by the tomador, nfse only
Observations *string // nfse only
}
type RealEstate ¶ added in v0.27.0
type RealEstate struct {
CityCode string
Lease *RealEstateLease
Units []RealEstateUnit
}
RealEstate is the imovel group. CityCode and Lease are read by the homologation layout only; Units are 1 to 99, and the production layout takes exactly one.
type RealEstateBaseAdjustment ¶ added in v0.27.0
RealEstateBaseAdjustment is gAjusteBCLocImoveis: Type is "01" to "04" or "99", and Description goes with "99".
type RealEstateLease ¶ added in v0.27.0
type RealEstateLease struct {
CoOwnershipPercent float64
TotalAmount float64
UnconditionalDiscount *float64
ConditionalDiscount *float64
OriginalDueDate time.Time
}
RealEstateLease is gLocacao, for a lease, onerous assignment or rental of real estate. CoOwnershipPercent is 100 with a single lessor. The day of OriginalDueDate is the only part sent.
type RealEstateUnit ¶ added in v0.27.0
type RealEstateUnit struct {
PropertyRegistration string
CIB string
Address *ServiceAddress
BaseAdjustments []RealEstateBaseAdjustment
}
RealEstateUnit is one property: identify it by CIB (8 characters) or by Address, one of the two. BaseAdjustments are 1 to 1000 and read by the homologation layout only.
type References ¶ added in v0.27.0
type References struct {
OrderNumber string
OrderItems []string
ReferenceDocument string
TechnicalDocument string
}
References are the infoCompl references: OrderNumber (xPed), OrderItems (gItemPed, up to 99), ReferenceDocument (docRef) and TechnicalDocument (idDocTec). The free text stays in Product.Observations.
type ServiceAddress ¶ added in v0.27.0
type ServiceAddress struct {
ZipCode string
Street string
Number string
Complement string
Neighborhood string
}
ServiceAddress is a Brazilian address of a construction, an event or a property: ZipCode (8 digits), Street, Number and Neighborhood are required.
type Substitution ¶ added in v0.27.0
Substitution is the subst group: the access key of the authorized NFS-e this one replaces, the ReasonCode (01 to 05 or 99) and, with 99, a Reason of 15 to 255 Latin-1 characters.
type Tax ¶
type Tax struct {
VTotTrib *string
Icms IcmsGroup
IcmsUfDest *IcmsUfDest
Ipi *Ipi
Pis PisGroup
PisSt *PisSt
Cofins CofinsGroup
CofinsSt *CofinsSt
}
Tax is this item's taxes, already computed by the caller.