-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathnc_d400_schedule_s_pdf.rb
30 lines (26 loc) · 1.14 KB
/
nc_d400_schedule_s_pdf.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module PdfFiller
class NcD400ScheduleSPdf
include PdfHelper
def source_pdf_name
"ncD400-Schedule-S-TY2024"
end
def initialize(submission)
@submission = submission
# Most PDF fields are grabbed right off the XML
builder = StateFile::StateInformationService.submission_builder_class(:nc)
@xml_document = builder.new(submission).document
end
def hash_for_pdf
{
y_d400schswf_ssn: @xml_document.at('Primary TaxpayerSSN')&.text,
y_d400wf_lname2_PG2: @xml_document.at('Primary TaxpayerName LastName')&.text,
y_d400schswf_li18_good: @xml_document.at('DedFedAGI USInterestInc')&.text || '0',
y_d400schswf_li19_good: @xml_document.at('DedFedAGI TaxPortSSRRB')&.text || '0',
y_d400schswf_li20_good: @xml_document.at('DedFedAGI BaileyRetireBenef')&.text || '0',
y_d400schswf_li21_good: @xml_document.at('DedFedAGI CertRetireBeneByMember')&.text || '0',
y_d400schswf_li27_good: @xml_document.at('DedFedAGI ExmptIncFedRecInd')&.text || '0',
y_d400schswf_li41_good: @xml_document.at('DedFedAGI TotDedFromFAGI')&.text || '0',
}
end
end
end