-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from moov-io/support-4010-810
support 4010 810, code refactoring
- Loading branch information
Showing
185 changed files
with
5,599 additions
and
3,222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2020 The Moov Authors | ||
// Use of this source code is governed by an Apache License | ||
// license that can be found in the LICENSE file. | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
"path" | ||
"strings" | ||
|
||
"github.com/moov-io/x12/pkg/file" | ||
. "github.com/moov-io/x12/rules/rule_4010_810" | ||
) | ||
|
||
func main() { | ||
reader, err := os.Open(path.Join("examples", "example_4010_810", "sample.txt")) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
defer reader.Close() | ||
|
||
newChange := file.NewFile(&InterchangeRule, "~") | ||
|
||
if err = newChange.Parse(file.NewScanner(reader, "~")); err != nil { | ||
log.Fatal(err.Error()) | ||
return | ||
} | ||
|
||
if err = newChange.Validate(); err != nil { | ||
log.Fatal(err.Error()) | ||
return | ||
} | ||
|
||
fmt.Println(" REGENERATED FILE ") | ||
fmt.Println(strings.ReplaceAll(newChange.String(), "~", "~\n")) | ||
|
||
newChange.Print(os.Stdout) | ||
|
||
InterchangeRule.Print(os.Stdout, true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
ISA*00* *00* *12*8004171844 *ZZ*DoETEMPID *121031*1703*U*00401*000000001*0*P*|~ | ||
GS*IN*8004171844*DDDss*20121031*17030169*100000001*X*004010~ | ||
ST*810*0001~ | ||
BIG*20120926*654983115**246322946*BILL-TO-ACCOUNT NUMBER***53**3179144866093189~ | ||
CUR*ZZ*USD~ | ||
REF*BM*W44FNZ1179123~ | ||
REF*IV*204841~ | ||
REF*8X*PRO*MATCHING~ | ||
REF*06*27231~ | ||
REF*4C*INBOUND~ | ||
REF*1Z*PI*Payment Initiated~ | ||
REF*ACC*DV~ | ||
REF*ZZ*LT~ | ||
N1*PR*JILL BROWN*PI*NOT PROVIDED~ | ||
N3*VIRGINIA AVE~ | ||
N4*BISMARCK*ND*585027116~ | ||
PER*CN*Ralph Joy*TE*1-331-5555003~ | ||
N1*PE*TrimFast*1*532768026~ | ||
N3*Routing Number: 12345*Account No: Customers 16-digit~ | ||
REF*I5*45666~ | ||
PER*CN*Help Desk*TE*(800)-1223-8441~ | ||
N1*BY*SCJCO*PI*KMUZ~ | ||
N3*VIRGINIA AVE*Mail stop 852.33~ | ||
N4*BISMARCK*ND*58502*USA~ | ||
PER*CN*Ralph Joy*TE*1-331-5555003~ | ||
N1*SE*Volunteer*ZZ*AADD~ | ||
N3*Hwy 45~ | ||
N4*Dresden*TN*38344*USA~ | ||
PER*CN*Randall Der*TE*1-833-5558585~ | ||
N1*SF*Wallace Ford~ | ||
N3*1 C Tree Road*Bldg 8~ | ||
N4*Baton Rouge*LA*708019002*USA~ | ||
N1*ST*Memphis Zoo~ | ||
N3*790 Any Street~ | ||
N4*Memphis*TN*38103*USA~ | ||
ITD**ZZ****20121026~ | ||
ITD**4****20121003~ | ||
ITD**11****20120917~ | ||
ITD**3****20121029~ | ||
ITD**7****20121113~ | ||
DTM*011*20120914~ | ||
DTM*003*20120926~ | ||
DTM*095*20120926~ | ||
DTM*097*20120926~ | ||
IT1*1*1*EA*807.5****IN*ARFW 007529-00*VN*852*KF*FREIGHT*OT*1~ | ||
QTY*T5***LB~ | ||
QTY*39**ZZ||1*EA~ | ||
CTP**INV*3.535*228.43*ZZ***807.5~ | ||
FA1*ZZ~ | ||
FA2*84*1395.5~ | ||
FA2*ZZ*45000-98Z890-2012-81-12345-21620-5580889~ | ||
TDS*139550~ | ||
AMT*2*2223.25*D~ | ||
CTT*1~ | ||
SE*53*0001~ | ||
ST*810*0002~ | ||
BIG*20121005*658089516**246322946*BILL-TO-ACCOUNT NUMBER***53**3179144866093189~ | ||
CUR*ZZ*USD~ | ||
REF*BM*COL 12022~ | ||
REF*IV*0056908~ | ||
REF*8X*PRO*MATCHING~ | ||
REF*06*27231~ | ||
REF*4C*OUTBOUND~ | ||
REF*1Z*PI*Payment Initiated~ | ||
REF*ACC*DV~ | ||
REF*ZZ*LT~ | ||
N1*PR*JILL BROWNY*PI*NOT PROVIDED~ | ||
N3*VIRGINIA AVE~ | ||
N4*BISMARCK*ND*58502~ | ||
PER*CN*Ralph Joy*TE*1-331-5555003~ | ||
N1*PE*TrimFast*1*532768026~ | ||
N3*Routing Number: 7777*Account No: Customers 16-digit~ | ||
REF*I5*3179144866093189107482~ | ||
PER*CN*TrimFast Help Desk*TE*(800)-555-8441~ | ||
N1*BY*SCJCO*PI*KMUZ~ | ||
N3*Virginia Ave*Mail stop 852.33~ | ||
N4*Bismarck*ND*58502*USA~ | ||
PER*CN*Ralph Miller*TE*1-331-5555003~ | ||
N1*SE*Arkansas Freightways*ZZ*SLTW~ | ||
N3*969 Hwy 70~ | ||
N4*Little ROck*AR*72205*USA~ | ||
PER*CN*Cristopher Bob*TE*1-331-123-6256~ | ||
N1*SF*TRANSPORTATION MGR~ | ||
N3*HOME DEPOT*WHSE 1~ | ||
N4*MILAN*TN*38358*USA~ | ||
N1*ST*NEW YANKEE WORKSHOP~ | ||
N3*HWY 441 E*919 SUITE A MS 528~ | ||
N4*BOSTON*MA*87123*USA~ | ||
N1*RC*OLD YANKEE HOUSE*ZZ*01~ | ||
N4*BALTIC*CT*06330-9001*USA~ | ||
PER*CN**TE*1-331-555-4666~ | ||
ITD**ZZ****20121026~ | ||
ITD**4****20121015~ | ||
ITD**11****20121004~ | ||
ITD**3****20121029~ | ||
ITD**7****20121113~ | ||
DTM*035*20121004*17000000~ | ||
DTM*003*20121005~ | ||
DTM*095*20121015~ | ||
DTM*097*20121005~ | ||
N9*ZZ*System Generated~ | ||
MSG*Equipment Type= ICKY;Trailer Number= UNWT;40032 Seal # = 155613~ | ||
IT1*1*1*EA*827.75****IN*UNWT-001385-00*VN*830*KF*FREIGHT*OT*1~ | ||
QTY*T5*10*~ | ||
QTY*39*100*~ | ||
CTP**INV*827.75*1*ZZ***827.75~ | ||
FA1*ZZ~ | ||
FA2*84*827.75~ | ||
FA2*ZZ*45000-82-67O0240-2012-81-1524286-22020-2430824~ | ||
TDS*82775~ | ||
AMT*2*2223.25*D~ | ||
CTT*1~ | ||
SE*58*0002~ | ||
GE*2*100000001~ | ||
IEA*1*000000001~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.