records

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARecord

type ARecord struct {
	// Required. Enter “A.”
	RecordType string `json:"record_type" validate:"required"`

	// Required. Enter “2019.”
	// If reporting prior year data, report the year which applies (2018, 2017, etc.) and set the Prior Year Data Indicator in field position 6.
	PaymentYear int `json:"payment_year" validate:"required"`

	// Required for CF/SF.
	// Enter “1” (one) if approved and submitting information as part
	// of the CF/SF Program or if submitting a test file in order to
	// obtain approval for the CF/SF Program. Otherwise, enter a
	// blank.
	// Note 1: If the Payer “A” Record is coded for CF/SF, there
	// must be coding in the Payee “B” Records and the State Totals
	// “K” Records.
	// Note 2: If “1” (one) is entered in this field position, be sure to
	// code the Payee “B” Records with the appropriate state code.
	// Refer to Part A. Sec. 12, Table 1, Participating States and
	// Codes, for further information.
	CombinedFSFilingProgram string `json:"combined_fs_filing_program"`

	// Required. Enter the valid nine-digit taxpayer identification
	// number assigned to the payer. Do not enter blanks, hyphens,
	// or alpha characters. Filling the field with all zeros, ones, twos,
	// etc., will result in an incorrect TIN.
	// Note: For foreign entities that are not required to have a TIN,
	// this field must be blank; however, the Foreign Entity Indicator,
	// position 52 of the “A” Record, must be set to one (1).
	TIN string `json:"payer_tin" validate:"required"`

	// Enter the four characters of the name control or enter blanks.
	PayerNameControl string `json:"payer_name_control"`

	// Enter “1” (one) if this is the last year this payer name and TIN
	// will file information returns electronically or on paper.
	// Otherwise, enter a blank.
	LastFilingIndicator string `json:"last_filing_indicator"`

	// Required. Enter the appropriate code. Left justify and fill
	// unused positions with blanks.
	TypeOfReturn string `json:"type_of_return" validate:"required"`

	// Required. Enter the appropriate amount code(s) for the type
	// of return being reported. In most cases, the box numbers on
	// paper information returns correspond with the amount codes
	// used to file electronically. However, if discrepancies occur,
	// Publication 1220 governs for filing electronically. Enter the
	// amount codes in ascending sequence; numeric characters
	// followed by alphas. Left justify the information and fill unused
	// positions with blanks.
	// Note: A type of return and an amount code must be present
	// in every Payer “A” Record even if no money amounts are
	// being reported. For a detailed explanation of the information
	// to be reported in each amount code, refer to the appropriate
	// paper instructions for each form.
	AmountCodes string `json:"amount_codes" validate:"required"`

	// Enter “1” (one) if the transmitter is a foreign entity. If the transmitter is not a foreign entity, enter a blank.
	ForeignEntityIndicator string `json:"foreign_entity_indicator"`

	// Required. Enter the name of the payer whose TIN appears in
	// positions 12-20 of the “A” Record. (The transfer agent’s name
	// is entered in the Second Payer Name Line Field, if
	// applicable). Left justify information and fill unused positions
	// with blanks. Delete extraneous information.
	FirstPayerNameLine string `json:"first_payer_name" validate:"required"`

	// If position 133 Transfer (or Paying) Agent Indicator contains a
	// “1” (one), this field must contain the name of the transfer or
	// paying agent.
	// If position 133 contains a “0” (zero), this field may contain
	// either a continuation of the First Payer Name Line or blanks.
	// Left justify the information. Fill unused positions with blanks
	SecondPayerNameLine string `json:"second_payer_name"`

	// Required. Enter the appropriate numeric code from the table below
	// 1: The entity in the Second Payer Name Line Field is the transfer (or paying) agent.
	// 0: The entity shown is not the transfer (or paying) agent (that is, the Second Payer Name Line Field either contains
	//    a continuation of the First Payer Name Line Field or blanks).
	TransferAgentIndicator string `json:"transfer_agent_control" validate:"required"`

	// Required. If position 133 Transfer Agent Indicator is “1” (one),
	// enter the shipping address of the transfer or paying agent.
	// Otherwise, enter the actual shipping address of the payer. The
	// street address includes street number, apartment or suite
	// number, or P.O. Box address if mail is not delivered to a street
	// address. Left justify the information and fill unused positions
	// with blanks.
	// For U.S. addresses, the payer city, state, and ZIP Code must
	// be reported as 40-, 2-, and 9-position fields, respectively.
	// Filers must adhere to the correct format for the payer city,
	// state, and ZIP Code.
	// For foreign addresses, filers may use the payer city, state, and
	// ZIP Code as a continuous 51-position field. Enter information
	// in the following order: city, province or state, postal code, and
	// the name of the country. When reporting a foreign address,
	// the Foreign Entity Indicator in position 52 must contain a
	// "1" (one).
	PayerShippingAddress string `json:"payer_shipping_address" validate:"required"`

	// Required. If the Transfer Agent Indicator in position 133 is a
	// “1” (one), enter the city, town, or post office of the transfer
	// agent. Otherwise, enter payer’s city, town, or post office city.
	// Do not enter state and ZIP Code information in this field. Left
	// justify the information and fill unused positions with blanks.
	PayerCity string `json:"payer_city" validate:"required"`

	// Required. Enter the valid U.S. Postal Service state abbreviation.
	PayerState string `json:"payer_state" validate:"required"`

	// Required. Enter the valid nine-digit ZIP Code assigned by the
	// U.S. Postal Service. If only the first five digits are known, left
	// justify the information and fill unused positions with blanks. For
	// foreign countries, alpha characters are acceptable as long as
	// the filer has entered a “1” (one) in “A” Record, field position 52
	// Foreign Entity Indicator.
	PayerZipCode string `json:"payer_zip_code" validate:"required"`

	// Enter the payer’s telephone number and extension. Omit
	// hyphens. Left justify the information and fill unused positions
	// with blanks.
	PayerTelephoneNumber string `json:"payer_telephone_number_and_ext"`

	// Required. Enter the number of the record as it appears within
	// the file. The record sequence number for the “T” Record will
	// always be “1” (one), since it is the first record on the file and
	// the file can have only one “T” Record. Each record thereafter
	// must be increased by one in ascending numerical sequence,
	// that is, 2, 3, 4, etc. Right justify numbers with leading zeros in
	// the field. For example, the “T” Record sequence number
	// would appear as “00000001” in the field, the first “A” Record
	// would be “00000002,” the first “B” Record, “00000003,” the
	// second “B” Record, “00000004” and so on until the final record
	// of the file, the “F” Record.
	RecordSequenceNumber int `json:"record_sequence_number" validate:"required"`
}

func (*ARecord) Ascii

func (r *ARecord) Ascii() []byte

Ascii returns fire ascii of “A” record

func (*ARecord) Parse

func (r *ARecord) Parse(buf []byte) error

Parse parses the “A” record from fire ascii

func (*ARecord) SequenceNumber

func (r *ARecord) SequenceNumber() int

SequenceNumber returns sequence number of the record

func (*ARecord) SetSequenceNumber

func (r *ARecord) SetSequenceNumber(number int)

SequenceNumber set sequence number of the record

func (*ARecord) Type

func (r *ARecord) Type() string

Type returns type of “A” record

func (*ARecord) Validate

func (r *ARecord) Validate() error

Validate performs some checks on the record and returns an error if not Validated

func (*ARecord) ValidateAmountCodes

func (r *ARecord) ValidateAmountCodes() error

func (*ARecord) ValidateCombinedFSFilingProgram

func (r *ARecord) ValidateCombinedFSFilingProgram() error

func (*ARecord) ValidateForeignEntityIndicator

func (r *ARecord) ValidateForeignEntityIndicator() error

func (*ARecord) ValidateLastFilingIndicator

func (r *ARecord) ValidateLastFilingIndicator() error

func (*ARecord) ValidatePayerState

func (r *ARecord) ValidatePayerState() error

func (*ARecord) ValidatePayerZipCode added in v0.1.4

func (r *ARecord) ValidatePayerZipCode() error

func (*ARecord) ValidateRecordSequenceNumber

func (r *ARecord) ValidateRecordSequenceNumber() error

func (*ARecord) ValidateTransferAgentIndicator

func (r *ARecord) ValidateTransferAgentIndicator() error

func (*ARecord) ValidateTypeOfReturn

func (r *ARecord) ValidateTypeOfReturn() error

type BRecord

type BRecord struct {
	// Required. Enter “B.”
	RecordType string `json:"record_type" validate:"required"`

	// Required. Enter “2019.”
	// If reporting prior year data, report the year which applies (2018, 2017, etc.) and set the Prior Year Data Indicator in field position 6.
	PaymentYear int `json:"payment_year" validate:"required"`

	// Required for corrections only.
	// Indicates a corrected return. Enter the appropriate code from
	// the following table.
	// G: For a one-transaction correction or the first of a two transaction correction
	// C: For a second transaction of a two-transaction correction
	// Blank: For an original return
	// Note: C, G, and non-coded records must be reported using
	// separate Payer “A” Records.
	CorrectedReturnIndicator string `json:"corrected_return_indicator"`

	// If determinable, enter the first four characters of the last name
	// of the person whose TIN is being reported in positions 12-20
	// of the “B” Record. Otherwise, enter blanks. Last names of
	// less than four characters must be left justified and fill the
	// unused positions with blanks.
	NameControl string `json:"payees_name_control"`

	// This field is used to identify the taxpayer identification number
	// (TIN) in positions 12-20 as either an employer identification
	// number (EIN), a social security number (SSN), an individual
	// taxpayer identification number (ITIN) or an adoption taxpayer
	// identification number (ATIN). Enter the appropriate code from
	// the following table:
	// 1: EIN : A business, organization, some
	//          sole proprietors or other entity
	// 2: SSN : An individual, including some sole proprietors
	// 2: ITIN : An individual required to have a
	//           taxpayer identification number but
	//           who is not eligible to obtain an SSN
	// 2: ATIN : An adopted individual prior to the
	//           assignment of a SSN
	// Blank : N/A : If the type of TIN is not
	//               determinable, enter a blank
	TypeOfTIN string `json:"type_of_tin"`

	// Required. Enter the nine-digit taxpayer identification number
	// of the payee (SSN, ITIN, ATIN, or EIN). Do not enter hyphens
	// or alpha characters.
	// If an identification number has been applied for but not
	// received, enter blanks. All zeros, ones, twos, etc., will have
	// the effect of an incorrect TIN. If the TIN is not available, enter
	// blanks.
	TIN string `json:"payees_tin" validate:"required"`

	// Required if submitting more than one information return of the
	// same type for the same payee. Enter any number assigned by
	// the payer to the payee that can be used by the IRS to
	// distinguish between information returns. This number must be
	// unique for each information return of the same type for the
	// same payee. If a payee has more than one reporting of the
	// same document type, it is vital that each reporting have a
	// unique account number. For example, if a payer has three
	// separate pension distributions for the same payee and three
	// separate Forms 1099-R are filed; three separate unique
	// account numbers are required. A payee’s account number
	// may be given a unique sequencing number, such as 01, 02, or
	// A, B, etc., to differentiate each reported information return. Do
	// not use the payee’s TIN since this will not make each record
	// unique. This information is critical when corrections are filed.
	// This number will be provided with the backup withholding
	// notification and may be helpful in identifying the branch or
	// subsidiary reporting the transaction. The account number can
	// be any combination of alpha, numeric, or special characters. If
	// fewer than 20 characters are used, filers may either left or
	// right justify, filling the remaining positions with blanks.
	// Forms 1099-LS and 1099-SB - use this field to report
	// “Policy Number.”
	PayerAccountNumber string `json:"payers_account_number_for_payee"`

	// Enter the office code of the payer. Otherwise, enter blanks.
	// For payers with multiple locations, this field may be used to
	// identify the location of the office submitting the information
	// returns. This code will also appear on backup withholding
	// notices.
	PayerOfficeCode string `json:"payers_office_code"`

	// Required. Filers should allow for all payment amounts. For
	// those not used, enter zeros. Each payment field must contain
	// 12 numeric characters. Each payment amount must contain
	// U.S. dollars and cents. The right-most two positions represent
	// cents in the payment amount fields. Do not enter dollar signs,
	// commas, decimal points, or negative payments, except those
	// items that reflect a loss on Form 1099-B, 1099-OID, or 1099-
	// Q. Positive and negative amounts are indicated by placing a
	// “+” (plus) or “-” (minus) sign in the left-most position of the
	// payment amount field. A negative over punch in the unit’s
	// position may be used instead of a minus sign, to indicate a
	// negative amount. If a plus sign, minus sign, or negative over
	// punch is not used, the number is assumed to be positive.
	// Negative over punch cannot be used in PC created files.
	// Payment amounts must be right justified and fill unused
	// positions with zeros.
	PaymentAmount1 int `json:"payment_amount_1"`
	PaymentAmount2 int `json:"payment_amount_2"`
	PaymentAmount3 int `json:"payment_amount_3"`
	PaymentAmount4 int `json:"payment_amount_4"`
	PaymentAmount5 int `json:"payment_amount_5"`
	PaymentAmount6 int `json:"payment_amount_6"`
	PaymentAmount7 int `json:"payment_amount_7"`
	PaymentAmount8 int `json:"payment_amount_8"`
	PaymentAmount9 int `json:"payment_amount_9"`
	PaymentAmountA int `json:"payment_amount_A"`
	PaymentAmountB int `json:"payment_amount_B"`
	PaymentAmountC int `json:"payment_amount_C"`
	PaymentAmountD int `json:"payment_amount_D"`
	PaymentAmountE int `json:"payment_amount_E"`
	PaymentAmountF int `json:"payment_amount_F"`
	PaymentAmountG int `json:"payment_amount_G"`
	PaymentAmountH int `json:"payment_amount_H"`
	PaymentAmountJ int `json:"payment_amount_J"`

	// If the address of the payee is in a foreign country, enter a
	// “1” (one) in this field. Otherwise, enter blank. When filers use
	// the foreign country indicator, they may use a free format for
	// the payee city, state, and ZIP Code.
	// Enter information in the following order: city, province or state,
	// postal code, and the name of the country. Do not enter
	// address information in the First or Second Payee Name Lines.
	ForeignCountryIndicator string `json:"foreign_country_indicator"`

	// Required. Enter the name of the payee (preferably last
	// name first) whose taxpayer identification number (TIN) was
	// provided in positions 12-20 of the Payee “B” Record.
	// Left justify the information and fill unused positions with
	// blanks. If more space is required for the name, use the
	// Second Payee Name Line Field. If reporting information for a
	// sole proprietor, the individual’s name must always be present
	// on the First Payee Name Line. The use of the business
	// name is optional in the Second Payee Name Line Field. End
	// the First Payee Name Line with a full word. Extraneous
	// words, titles, and special characters (that is, Mr., Mrs., Dr.,
	// period, apostrophe) should be removed from the Payee
	// Name Lines. A hyphen (-) and an ampersand (&) are the only
	// acceptable special characters for First and Second Payee
	// Name Lines.
	// Note: If a filer is required to report payments made through
	// Foreign Intermediaries and Foreign Flow-Through Entities on
	// Form 1099, see the General Instructions for Certain
	// Information Returns for reporting instructions.
	FirstPayeeNameLine string `json:"first_payee_name_line" validate:"required"`

	// If there are multiple payees (for example, partners, joint
	// owners, or spouses), use this field for those names not
	// associated with the TIN provided in positions 12-20 of the “B”
	// Record, or if not enough space was provided in the First
	// Payee Name Line, continue the name in this field. Do not
	// enter address information. It is important that filers provide as
	// much payee information to the IRS as possible to identify the
	// payee associated with the TIN. See the Note under the First
	// Payee Name Line. Left justify the information and fill unused
	// positions with blanks.
	SecondPayeeNameLine string `json:"second_payee_name_line"`

	// Required. Enter the mailing address of the payee.
	// The street address should include number, street, apartment
	// or suite number, or P.O. Box if mail is not delivered to a
	// street address. Left justify the information and fill unused
	// positions with blanks.
	// Do not enter data other than the payee’s mailing address.
	PayeeMailingAddress string `json:"payee_mailing_address" validate:"required"`

	// Required. Enter the city, town or post office. Enter APO or
	// FPO if applicable. Do not enter state and ZIP Code
	// information in this field. Left justify the information and fill
	// unused positions with blanks.
	PayeeCity string `json:"payee_city" validate:"required"`

	// Required. Enter the valid U.S. Postal Service state
	// abbreviations for states or the appropriate postal identifier
	// (AA, AE, or AP).
	PayeeState string `json:"payee_state" validate:"required"`

	// Required. Enter the valid ZIP Code (nine-digit or five-digit)
	// assigned by the U.S. Postal Service.
	// For foreign countries, alpha characters are acceptable as
	// long as the filer has entered a “1” (one) in the Foreign
	// Country Indicator, located in position 247 of the “B” Record. If
	// only the first five-digits are known, left justify the information
	// and fill the unused positions with blanks.
	PayeeZipCode string `json:"payee_zip_code" validate:"required"`

	// Required. Enter the number of the record as it appears
	//within the file. The record sequence number for the “T”
	//Record will always be one (1), since it is the first record on
	//the file and the file can have only one “T” Record in a file.
	//Each record, thereafter, must be increased by one in
	//ascending numerical sequence, that is, 2, 3, 4, etc. Right
	//justify numbers with leading zeros in the field. For example,
	//the “T” Record sequence number would appear as
	//“00000001” in the field, the first “A” Record would be
	//“00000002,” the first “B” Record, “00000003,” the second “B”
	//Record, “00000004”, and so on until the final record of the
	//file, the “F” Record.
	RecordSequenceNumber int `json:"record_sequence_number" validate:"required"`
	// contains filtered or unexported fields
}

func (*BRecord) Ascii

func (r *BRecord) Ascii() []byte

Ascii returns fire ascii of “B” record

func (*BRecord) DirectSales added in v0.1.4

func (r *BRecord) DirectSales() (*string, error)

Type returns direct sales of “B” record

func (*BRecord) Fatca added in v0.1.4

func (r *BRecord) Fatca() (*string, error)

Type returns fatca of “B” record

func (*BRecord) FederalState added in v0.1.4

func (r *BRecord) FederalState() int

Type returns FS code of “B” record

func (*BRecord) IncomeTax added in v0.1.4

func (r *BRecord) IncomeTax() (int, int, error)

Type returns income tax of “B” record

func (*BRecord) MarshalJSON

func (r *BRecord) MarshalJSON() ([]byte, error)

Marshal returns the JSON encoding

func (*BRecord) Parse

func (r *BRecord) Parse(buf []byte) error

Parse parses the “B” record from fire ascii

func (*BRecord) PaymentAmount

func (r *BRecord) PaymentAmount(index string) (int, error)

PaymentAmount returns payment amount

func (*BRecord) PaymentCodes

func (r *BRecord) PaymentCodes() string

PaymentAmount returns payment codes

func (*BRecord) SecondTIN added in v0.1.4

func (r *BRecord) SecondTIN() (*string, error)

Type returns second tin of “B” record

func (*BRecord) SequenceNumber

func (r *BRecord) SequenceNumber() int

SequenceNumber returns sequence number of the record

func (*BRecord) SetSequenceNumber

func (r *BRecord) SetSequenceNumber(number int)

SequenceNumber set sequence number of the record

func (*BRecord) SetTypeOfReturn

func (r *BRecord) SetTypeOfReturn(typeOfReturn string) error

SetTypeOfReturn set type of return of the record

func (*BRecord) Type

func (r *BRecord) Type() string

Type returns type of “B” record

func (*BRecord) TypeOfReturn

func (r *BRecord) TypeOfReturn() string

SetTypeOfReturn returns type of return of the record

func (*BRecord) UnmarshalJSON

func (r *BRecord) UnmarshalJSON(data []byte) error

Unmarshal parses the JSON-encoded data

func (*BRecord) Validate

func (r *BRecord) Validate() error

Validate performs some checks on the record and returns an error if not Validated

func (*BRecord) ValidateCorrectedReturnIndicator

func (r *BRecord) ValidateCorrectedReturnIndicator() error

func (*BRecord) ValidateForeignCountryIndicator

func (r *BRecord) ValidateForeignCountryIndicator() error

func (*BRecord) ValidatePayeeState

func (r *BRecord) ValidatePayeeState() error

func (*BRecord) ValidatePayeeZipCode added in v0.1.4

func (r *BRecord) ValidatePayeeZipCode() error

func (*BRecord) ValidateRecordSequenceNumber

func (r *BRecord) ValidateRecordSequenceNumber() error

func (*BRecord) ValidateTypeOfTIN

func (r *BRecord) ValidateTypeOfTIN() error

type CRecord

type CRecord struct {
	// Required. Enter “C.”
	RecordType string `json:"record_type" validate:"required"`

	// Required. Enter the total number of “B” Records covered by
	// the preceding “A” Record.
	// Right justify the information and fill unused positions with
	// zeros.
	NumberPayees int `json:"number_of_payees" validate:"required"`

	// Required. Accumulate totals of any payment amount fields
	// in the “B” Records into the appropriate control total fields of
	// the “C” Record. Control totals must be right justified and
	// unused control total fields zero-filled. All control total fields
	// are 18 positions in length. Each payment amount must
	// contain U.S. dollars and cents. The right-most two positions
	// represent cents in the payment amount fields. Do not enter
	// dollar signs, commas, decimal points, or negative payments,
	// except those items that reflect a loss on Form 1099-B, 1099-
	// OID, or 1099-Q. Positive and negative amounts are indicated
	// by placing a “+” (plus) or “-” (minus) sign in the left-most
	// position of the payment amount field.
	ControlTotal1 int `json:"control_total_1"`
	ControlTotal2 int `json:"control_total_2"`
	ControlTotal3 int `json:"control_total_3"`
	ControlTotal4 int `json:"control_total_4"`
	ControlTotal5 int `json:"control_total_5"`
	ControlTotal6 int `json:"control_total_6"`
	ControlTotal7 int `json:"control_total_7"`
	ControlTotal8 int `json:"control_total_8"`
	ControlTotal9 int `json:"control_total_9"`
	ControlTotalA int `json:"control_total_A"`
	ControlTotalB int `json:"control_total_B"`
	ControlTotalC int `json:"control_total_C"`
	ControlTotalD int `json:"control_total_D"`
	ControlTotalE int `json:"control_total_E"`
	ControlTotalF int `json:"control_total_F"`
	ControlTotalG int `json:"control_total_G"`
	ControlTotalH int `json:"control_total_H"`
	ControlTotalJ int `json:"control_total_J"`

	// Required. Enter the number of the record as it appears
	// within the file. The record sequence number for the “T”
	// Record will always be “1” (one), since it is the first record on
	// the file and the file can have only one “T” Record in a file.
	// Each record, thereafter, must be increased by one in
	// ascending numerical sequence, that is, 2, 3, 4, etc. Right
	// justify numbers with leading zeros in the field. For example,
	// the “T” Record sequence number would appear as
	// “00000001” in the field, the first “A” Record would be
	// “00000002,” the first “B” Record, “00000003,” the second “B”
	// Record, “00000004” and so on until the final record of the
	// file, the “F” Record.
	RecordSequenceNumber int `json:"record_sequence_number" validate:"required"`
}

func (*CRecord) Ascii

func (r *CRecord) Ascii() []byte

Ascii returns fire ascii of “C” record

func (*CRecord) ControlTotal

func (r *CRecord) ControlTotal(index string) (int, error)

ControlTotal returns total of any payment amount field

func (*CRecord) Parse

func (r *CRecord) Parse(buf []byte) error

Parse parses the “C” record from fire ascii

func (*CRecord) SequenceNumber

func (r *CRecord) SequenceNumber() int

SequenceNumber returns sequence number of the record

func (*CRecord) SetSequenceNumber

func (r *CRecord) SetSequenceNumber(number int)

SequenceNumber set sequence number of the record

func (*CRecord) TotalCodes

func (r *CRecord) TotalCodes() string

TotalCodes returns total codes

func (*CRecord) Type

func (r *CRecord) Type() string

Type returns type of “C” record

func (*CRecord) Validate

func (r *CRecord) Validate() error

Validate performs some checks on the record and returns an error if not Validated

func (*CRecord) ValidateRecordSequenceNumber

func (r *CRecord) ValidateRecordSequenceNumber() error

type FRecord

type FRecord struct {
	// Required. Enter “F.”
	RecordType string `json:"record_type" validate:"required"`

	// Enter zeros.
	Zero int `json:"zero"`

	// Enter the total number of Payer “A” Records in the entire file.
	// Right justify the information and fill unused positions with
	// zeros or enter all zeros.
	NumberPayerRecords int `json:"number_of_payer_records"`

	// If this total was entered in the “T” Record, this field may be
	// blank filled. Enter the total number of Payee “B” Records
	// reported in the file. Right justify the information and fill
	// unused positions with zeros.
	TotalNumberPayees int `json:"total_number_of_payees"`

	// Required. Enter the number of the record as it appears
	// within the file. The record sequence number for the “T”
	// Record will always be “1” (one), since it is the first record on
	// the file and the file can have only one “T” Record in a file.
	// Each record, thereafter, must be increased by one in
	// ascending numerical sequence, that is, 2, 3, 4, etc. Right
	// justify numbers with leading zeros in the field. For example,
	// the “T” Record sequence number would appear as
	// “00000001” in the field, the first “A” Record would be
	// “00000002,” the first “B” Record, “00000003,” the second “B”
	// Record, “00000004” and so on until the final record of the
	// file, the “F” Record.
	RecordSequenceNumber int `json:"record_sequence_number" validate:"required"`
}

func (*FRecord) Ascii

func (r *FRecord) Ascii() []byte

Ascii returns fire ascii of “F” record

func (*FRecord) Parse

func (r *FRecord) Parse(buf []byte) error

Parse parses the “F” record from fire ascii

func (*FRecord) SequenceNumber

func (r *FRecord) SequenceNumber() int

SequenceNumber returns sequence number of the record

func (*FRecord) SetSequenceNumber

func (r *FRecord) SetSequenceNumber(number int)

SequenceNumber set sequence number of the record

func (*FRecord) Type

func (r *FRecord) Type() string

Type returns type of “F” record

func (*FRecord) Validate

func (r *FRecord) Validate() error

Validate performs some checks on the record and returns an error if not Validated

func (*FRecord) ValidateRecordSequenceNumber

func (r *FRecord) ValidateRecordSequenceNumber() error

type KRecord

type KRecord struct {
	// Required. Enter “K.”
	RecordType string `json:"record_type" validate:"required"`

	// Required. Enter the total number of “B” Records being
	// coded for this state. Right justify the information and fill
	// unused positions with zeros.
	NumberPayees int `json:"number_of_payees" validate:"required"`

	// Required. Accumulate totals of any payment amount fields
	// in the “B” Records for each state being reported into the
	// appropriate control total fields of the appropriate “K” Record.
	// Each payment amount must contain U.S. dollars and cents.
	// The right-most two positions represent cents in the payment
	// amount fields. Control totals must be right justified and fill
	// unused positions with zeros. All control total fields are
	// eighteen positions in length. Do not enter dollar signs,
	// commas, decimal points, or negative payments, except those
	// items that reflect a loss on Form 1099-B or 1099-OID.
	// Positive and negative amounts are indicated by placing a “+”
	// (plus) or “-” (minus) sign in the left-most position of the
	// payment amount field.
	ControlTotal1 int `json:"control_total_1"`
	ControlTotal2 int `json:"control_total_2"`
	ControlTotal3 int `json:"control_total_3"`
	ControlTotal4 int `json:"control_total_4"`
	ControlTotal5 int `json:"control_total_5"`
	ControlTotal6 int `json:"control_total_6"`
	ControlTotal7 int `json:"control_total_7"`
	ControlTotal8 int `json:"control_total_8"`
	ControlTotal9 int `json:"control_total_9"`
	ControlTotalA int `json:"control_total_A"`
	ControlTotalB int `json:"control_total_B"`
	ControlTotalC int `json:"control_total_C"`
	ControlTotalD int `json:"control_total_D"`
	ControlTotalE int `json:"control_total_E"`
	ControlTotalF int `json:"control_total_F"`
	ControlTotalG int `json:"control_total_G"`
	ControlTotalH int `json:"control_total_H"`
	ControlTotalJ int `json:"control_total_J"`

	// Required. Enter the number of the record as it appears
	// within the file. The record sequence number for the “T”
	// Record will always be “1” (one), since it is the first record on
	// the file and the file can have only one “T” Record in a file.
	// Each record, thereafter, must be increased by one in
	// ascending numerical sequence, that is, 2, 3, 4, etc. Right
	// justify numbers with leading zeros in the field. For example,
	// the “T” Record sequence number would appear as
	// “00000001” in the field, the first “A” Record would be
	// “00000002,” the first “B” Record, “00000003,” the second “B”
	// Record, “00000004” and so on through the final record of the
	// file, the “F” Record.
	RecordSequenceNumber int `json:"record_sequence_number" validate:"required"`

	// Aggregate totals of the state income tax withheld field in the
	// Payee “B” Records. Otherwise, enter blanks. (This field is for
	// the convenience of filers.)
	StateIncomeTaxWithheldTotal string `json:"state_income_tax_withheld_total"`

	// Aggregate totals of the local income tax withheld field in the
	// Payee “B” Records. Otherwise, enter blanks. (This field is for
	// the convenience of filers.)
	LocalIncomeTaxWithheldTotal string `json:"local_income_tax_withheld_total"`

	// Required. Enter the CF/SF code assigned to the state which
	// is to receive the information.
	CombinedFederalStateCode string `json:"combined_federal_state_code" validate:"required"`
}

func (*KRecord) Ascii

func (r *KRecord) Ascii() []byte

Ascii returns fire ascii of “K” record

func (*KRecord) ControlTotal

func (r *KRecord) ControlTotal(index string) (int, error)

ControlTotal returns total of any payment amount field

func (*KRecord) Parse

func (r *KRecord) Parse(buf []byte) error

Parse parses the “K” record from fire ascii

func (*KRecord) PaymentCodes

func (r *KRecord) PaymentCodes() string

PaymentAmount returns payment codes

func (*KRecord) SequenceNumber

func (r *KRecord) SequenceNumber() int

SequenceNumber returns sequence number of the record

func (*KRecord) SetSequenceNumber

func (r *KRecord) SetSequenceNumber(number int)

SequenceNumber set sequence number of the record

func (*KRecord) Type

func (r *KRecord) Type() string

Type returns type of “K” record

func (*KRecord) Validate

func (r *KRecord) Validate() error

Validate performs some checks on the record and returns an error if not Validated

func (*KRecord) ValidateCombinedFederalStateCode

func (r *KRecord) ValidateCombinedFederalStateCode() error

func (*KRecord) ValidateRecordSequenceNumber

func (r *KRecord) ValidateRecordSequenceNumber() error

type Record

type Record interface {
	Type() string
	SequenceNumber() int
	SetSequenceNumber(int)
	Parse([]byte) error
	Ascii() []byte
	Validate() error
}

General record interface

func NewARecord

func NewARecord() Record

func NewBRecord

func NewBRecord(typeOfReturn string) (Record, error)

func NewCRecord

func NewCRecord() Record

func NewFRecord

func NewFRecord() Record

func NewKRecord

func NewKRecord() Record

func NewTRecord

func NewTRecord() Record

type TRecord

type TRecord struct {
	// Required. Enter “T.”
	RecordType string `json:"record_type" validate:"required"`

	// Required. Enter “2019.”Foreign
	// If reporting prior year data, report the year which applies (2018, 2017, etc.) and set the Prior Year Data Indicator in field position 6.
	PaymentYear int `json:"payment_year" validate:"required"`

	// Required. Enter “P” only if reporting prior year data. Otherwise, enter a blank.
	// Do not enter a “P” if the tax year is 2019.
	// The FIRE System accepts 2010 through 2018 for prior years. You cannot mix tax years within a file.
	PriorYearDataIndicator string `json:"prior_year_data_indicator" validate:"required"`

	// Required. Enter the transmitter’s nine-digit taxpayer identification number (TIN).
	TIN string `json:"transmitter_tin" validate:"required"`

	// Required. Enter the five-character alphanumeric Transmitter Control Code (TCC) assigned by the IRS.
	TCC string `json:"transmitter_control_code" validate:"required"`

	// Required for test files only. Enter a “T” if this is a test file. Otherwise, enter a blank.
	TestFileIndicator string `json:"test_file_indicator"`

	// Enter “1” (one) if the transmitter is a foreign entity. If the transmitter is not a foreign entity, enter a blank.
	ForeignEntityIndicator string `json:"foreign_entity_indicator"`

	// Required. Enter the transmitter name.
	// Left justify the information and fill unused positions with blanks
	TransmitterName string `json:"transmitter_name" validate:"required"`

	// Enter any additional information that may be part of the name.
	// Left justify the information and fill unused positions with blanks.
	TransmitterNameContinuation string `json:"transmitter_name_contd"`

	// Required. Enter company name associated with the address in field positions 190-229.
	CompanyName string `json:"company_name" validate:"required"`

	// Enter any additional information that may be part of the company name.
	CompanyNameContinuation string `json:"company_name_contd"`

	// Required. Enter the mailing address associated with the Company Name in field positions 110-149 where correspondence should be sent.
	// For U.S. address, the payer city, state, and ZIP Code must be reported as a 40-, 2-, and 9-position field, respectively.
	// Filers must adhere to the correct format for the payer city, state, and ZIP Code.
	// For foreign address, filers may use the payer city, state, and ZIP Code as a continuous 51-position field.
	// Enter information in the following order: city, province or state, postal code, and the name of the country.
	// When reporting a foreign address, the Foreign Entity Indicator in position 29 must contain a “1” (one).
	CompanyMailingAddress string `json:"company_mailing_address" validate:"required"`

	// Required. Enter the city, town, or post office where correspondence should be sent.
	CompanyCity string `json:"company_city" validate:"required"`

	// Required. Enter U.S. Postal Service state abbreviation.
	CompanyState string `json:"company_state" validate:"required"`

	// Required. Enter the nine-digit ZIP Code assigned by the U.S.
	// Postal Service. If only the first five digits are known, left justify the information and fill unused positions with blanks.
	CompanyZipCode string `json:"company_zip_code" validate:"required"`

	// Enter the total number of Payee “B” Records reported in the file.
	// Right justify the information and fill unused positions with zeros.
	TotalNumberPayees int `json:"total_number_of_payees"`

	// Required. Enter the name of the person to contact when problems with the file or transmission are encountered.
	ContactName string `json:"contact_name" validate:"required"`

	// Required. Enter the telephone number of the person to contact regarding electronic files. Omit hyphens.
	// If no extension is available, left justify the information and fill unused positions with blanks.
	// Example: The IRS telephone number of 866-455-7438 with an extension of 52345 would be 866455743852345.
	ContactTelephoneNumber string `json:"contact_telephone_number_and_ext" validate:"required"`

	// Required if available. Enter the email address of the person to contact regarding electronic files.
	// If no email address is available, enter blanks. Left justify.
	ContactEmailAddress string `json:"contact_email_address"`

	// Required. Enter the number of the record as it appears within the
	// file. The record sequence number for the “T” Record will always be
	// one (1) since it is the first record on the file and the file can have
	// only one “T” Record. Each record thereafter must be increased by
	// one in ascending numerical sequence, that is, 2, 3, 4, etc. Right
	// justify numbers with leading zeros in the field. For example, the “T”
	// Record sequence number would appear as “00000001” in the field,
	// the first “A” Record would be “00000002,” the first “B” Record,
	// “00000003,” the second “B” Record, “00000004” and so on through
	// the final record of the file, the “F” Record.
	RecordSequenceNumber int `json:"record_sequence_number" validate:"required"`

	// Required. If the software used to produce this file was provided by
	// a vendor or produced in-house, enter the appropriate code from the
	// table below.
	// V: Software was purchased from a vendor or other source.
	// I: Software was produced by in-house programmers.
	VendorIndicator string `json:"vendor_indicator" validate:"required"`

	// Required. Enter the name of the company from whom the software
	// was purchased. If the software is produced in-house, enter blanks
	VendorName string `json:"vendor_name" validate:"required"`

	// Required. Enter the mailing address. If the software is produced
	// in-house, enter blanks.
	// For U.S. address, the payer city, state, and ZIP Code must be
	// reported as a 40-, 2-, and 9-position field, respectively. Filers must
	// adhere to the correct format for the payer city, state, and ZIP Code.
	// For foreign address, filers may use the payer city, state, and ZIP
	// Code as a continuous 51-position field. Enter information in the
	// following order: city, province or state, postal code, and the name of
	// the country. When reporting a foreign address, the Foreign Entity
	// Indicator in position 29 must contain a “1” (one).
	VendorMailingAddress string `json:"vendor_mailing_address" validate:"required"`

	// Required. Enter the city, town, or post office. If the software is
	// produced in-house, enter blanks.
	VendorCity string `json:"vendor_city" validate:"required"`

	// Required. Enter U.S. Postal Service state abbreviation.
	VendorState string `json:"vendor_state" validate:"required"`

	// Required. Enter the valid nine-digit ZIP Code assigned by the U.S.
	// Postal Service. If only the first five digits are known, fill unused
	// positions with blanks. Left justify. If the software is produced inhouse, enter blanks.
	VendorZipCode string `json:"vendor_zip_code" validate:"required"`

	// Required. Enter the name of the person to contact concerning
	// software questions. If the software is produced in-house, enter
	// blanks.
	VendorContactName string `json:"vendor_contact_name" validate:"required"`

	// Required. Enter the telephone number of the person to contact
	// concerning software questions. Omit hyphens. If no extension is
	// available, left justify the information and fill unused positions with
	// blanks. If the software is produced in-house, enter blanks.
	VendorContactTelephoneNumber string `json:"vendor_contact_telephone_and_ext" validate:"required"`

	// Enter “1” (one) if the vendor is a foreign entity. Otherwise, enter a blank.
	VendorForeignEntityIndicator string `json:"vendor_foreign_entity_indicator" validate:"required"`
}

func (*TRecord) Ascii

func (r *TRecord) Ascii() []byte

Ascii returns fire ascii of “T” record

func (*TRecord) Parse

func (r *TRecord) Parse(buf []byte) error

Parse parses the “T” record from fire ascii

func (*TRecord) SequenceNumber

func (r *TRecord) SequenceNumber() int

SequenceNumber returns sequence number of the record

func (*TRecord) SetSequenceNumber

func (r *TRecord) SetSequenceNumber(number int)

SequenceNumber set sequence number of the record

func (*TRecord) Type

func (r *TRecord) Type() string

Type returns type of “T” record

func (*TRecord) Validate

func (r *TRecord) Validate() error

Validate performs some checks on the record and returns an error if not Validated

func (*TRecord) ValidateCompanyState

func (r *TRecord) ValidateCompanyState() error

func (*TRecord) ValidateCompanyZipCode added in v0.1.4

func (r *TRecord) ValidateCompanyZipCode() error

func (*TRecord) ValidateForeignEntityIndicator

func (r *TRecord) ValidateForeignEntityIndicator() error

func (*TRecord) ValidatePriorYearDataIndicator

func (r *TRecord) ValidatePriorYearDataIndicator() error

func (*TRecord) ValidateRecordSequenceNumber

func (r *TRecord) ValidateRecordSequenceNumber() error

func (*TRecord) ValidateTestFileIndicator

func (r *TRecord) ValidateTestFileIndicator() error

func (*TRecord) ValidateVendorForeignEntityIndicator

func (r *TRecord) ValidateVendorForeignEntityIndicator() error

func (*TRecord) ValidateVendorIndicator

func (r *TRecord) ValidateVendorIndicator() error

func (*TRecord) ValidateVendorState

func (r *TRecord) ValidateVendorState() error

func (*TRecord) ValidateVendorZipCode added in v0.1.4

func (r *TRecord) ValidateVendorZipCode() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL