qb_iif 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/qb_iif/iif.rb +6 -13
- data/lib/qb_iif/version.rb +1 -1
- data/spec/fixtures/accnt.iif +1 -1
- data/spec/fixtures/bud.iif +1 -1
- data/spec/fixtures/class.iif +1 -1
- data/spec/fixtures/ctype.iif +1 -1
- data/spec/fixtures/cust.iif +1 -1
- data/spec/fixtures/emp.iif +1 -1
- data/spec/fixtures/invitem.iif +1 -1
- data/spec/fixtures/invmemo.iif +1 -1
- data/spec/fixtures/mixed.iif +1 -1
- data/spec/fixtures/othername.iif +1 -1
- data/spec/fixtures/paymeth.iif +1 -1
- data/spec/fixtures/rails/invoices.iif +1 -1
- data/spec/fixtures/shipmeth.iif +1 -1
- data/spec/fixtures/terms.iif +1 -1
- data/spec/fixtures/timeact.iif +1 -1
- data/spec/fixtures/todo.iif +1 -1
- data/spec/fixtures/trns.iif +2 -2
- data/spec/fixtures/vend.iif +1 -1
- data/spec/fixtures/vtype.iif +1 -1
- data/spec/qb_iif/dsl/trns_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c21d3e7bf0ce16d4029b99d9710affbb8910611
|
4
|
+
data.tar.gz: 54f80b039098c2973eb22d4836f0e7cead3b8eb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbada754db515d83ee805ae1061c83804bfd423fe7c3368f7914159eb98e65caa08dd3e1c09d06c247997d08216e91ad3757b8fedda0a383e246baf6907e665d
|
7
|
+
data.tar.gz: ec6dd1c216c688acf2bda5cc8da08e7363af4537765a5715d650a93a1ce890bcd4ff78ec6d195cdf4f9c3ce0aea506143476472d8f17a5d97ab0261521fc7a8f
|
data/CHANGELOG.md
CHANGED
data/lib/qb_iif/iif.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'csv'
|
2
|
-
|
3
1
|
require 'qb_iif/keywords'
|
4
2
|
require 'qb_iif/dsl/base'
|
5
3
|
|
@@ -26,7 +24,7 @@ require 'qb_iif/dsl/vtype'
|
|
26
24
|
module QbIif
|
27
25
|
class IIF
|
28
26
|
include QbIif::Keywords
|
29
|
-
|
27
|
+
COL_SEP = "\t"
|
30
28
|
def initialize(&block)
|
31
29
|
@output = {}
|
32
30
|
if block_given?
|
@@ -39,17 +37,12 @@ module QbIif
|
|
39
37
|
end
|
40
38
|
|
41
39
|
def output
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
tsv << header
|
47
|
-
end
|
48
|
-
list[:rows].each do |row|
|
49
|
-
tsv << row
|
50
|
-
end
|
51
|
-
end
|
40
|
+
lines = []
|
41
|
+
@output.values.each do |values|
|
42
|
+
values[:headers].uniq.each{|header| lines << header.join(COL_SEP) }
|
43
|
+
values[:rows].each{|row| lines << row.join(COL_SEP) }
|
52
44
|
end
|
45
|
+
lines.join("\n")
|
53
46
|
end
|
54
47
|
|
55
48
|
def method_missing(method_name, *args, &block)
|
data/lib/qb_iif/version.rb
CHANGED
data/spec/fixtures/accnt.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!ACCNT NAME ACCNTTYPE OBAMOUNT DESC SCD ACCNUM EXTRA
|
2
|
-
ACCNT Jun Lin AR 47
|
2
|
+
ACCNT Jun Lin AR 47
|
data/spec/fixtures/bud.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!BUD ACCNT PERIOD AMOUNT STARTDATE CLASS CUSTOMER
|
2
|
-
BUD Accounts Receivable MONTH foo 3/14/12
|
2
|
+
BUD Accounts Receivable MONTH foo 3/14/12
|
data/spec/fixtures/class.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!CLASS NAME
|
2
|
-
CLASS Foo
|
2
|
+
CLASS Foo
|
data/spec/fixtures/ctype.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!CTYPE NAME
|
2
|
-
CTYPE Bar
|
2
|
+
CTYPE Bar
|
data/spec/fixtures/cust.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!CUST NAME BADDR1 BADDR2 BADDR3 BADDR4 BADDR5 SADDR1 SADDR2 SADDR3 SADDR4 SADDR5 PHONE1 PHONE2 FAXNUM CONT1 CONT2 CTYPE TERMS TAXABLE LIMIT RESALENUM REP TAXITEM NOTEPAD SALUTATION COMPANYNAME FIRSTNAME MIDINIT LASTNAME CUSTFLD1 CUSTFLD2 CUSTFLD3 CUSTFLD4 CUSTFLD5 CUSTFLD6 CUSTFLD7 JOBDESC JOBTYPE JOBSTATUS JOBSTART JOBPROJEND JOBEND NOTE
|
2
|
-
CUST Jun Lin 12312323242
|
2
|
+
CUST Jun Lin 12312323242
|
data/spec/fixtures/emp.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!EMP NAME INIT ADDR1 ADDR2 ADDR3 ADDR4 ADDR5 SSNO PHONE1 PHONE2 NOTEPAD FIRSTNAME MIDINIT LASTNAME SALUTATION CUSTFLD1 CUSTFLD2 CUSTFLD3 CUSTFLD4 CUSTFLD5 CUSTFLD6 CUSTFLD7 NOTE
|
2
|
-
EMP Alfred Master Backer 37 Doctor
|
2
|
+
EMP Alfred Master Backer 37 Doctor
|
data/spec/fixtures/invitem.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!INVITEM NAME INVITEMTYPE DESC PURCHASEDESC ACCNT ASSETACCNT COGSACCNT PRICE COST TAXABLE PAYMETH TAXVEND TAXDIST TOPRINT PREFVEND REORDERPOINT EXTRA CUSTFLD1 CUSTFLD2 CUSTFLD3 CUSTFLD4 CUSTFLD5 DEP_TYPE ISPASSEDTHRU
|
2
|
-
INVITEM invitem 1 INVENTORY 1
|
2
|
+
INVITEM invitem 1 INVENTORY 1
|
data/spec/fixtures/invmemo.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!INVMEMO NAME
|
2
|
-
INVMEMO invmemo 1
|
2
|
+
INVMEMO invmemo 1
|
data/spec/fixtures/mixed.iif
CHANGED
data/spec/fixtures/othername.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!OTHERNAME NAME BADDR1 BADDR2 BADDR3 BADDR4 BADDR5 PHONE1 PHONE2 FAXNUM CONT1 NOTEPAD SALUTATION COMPANYNAME FIRSTNAME MIDINIT LASTNAME NOTE
|
2
|
-
OTHERNAME Alfred Backer 37 123
|
2
|
+
OTHERNAME Alfred Backer 37 123
|
data/spec/fixtures/paymeth.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!PAYMETH NAME
|
2
|
-
PAYMETH paymeth 1
|
2
|
+
PAYMETH paymeth 1
|
data/spec/fixtures/shipmeth.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!SHIPMETH NAME
|
2
|
-
SHIPMETH shipmeth 1
|
2
|
+
SHIPMETH shipmeth 1
|
data/spec/fixtures/terms.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!TERMS NAME DUEDAYS DISCPER DISCDAYS TERMSTYPE
|
2
|
-
TERMS terms 1 10 0.3 1 0
|
2
|
+
TERMS terms 1 10 0.3 1 0
|
data/spec/fixtures/timeact.iif
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
!TIMERHDR VER REL COMPANYNAME IMPORTEDBEFORE FROMTIMER COMPANYCREATETIME
|
2
2
|
TIMERHDR 8 0 Import Test Company N Y 1208544781
|
3
3
|
!TIMEACT DATE JOB EMP ITEM PITEM DURATION PROJ NOTE BILLINGSTATUS
|
4
|
-
TIMEACT 06/21/97 job 1 Jun item 1 13:40 klass 1 0
|
4
|
+
TIMEACT 06/21/97 job 1 Jun item 1 13:40 klass 1 0
|
data/spec/fixtures/todo.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!TODO REFNUM ISDONE DATE DESC
|
2
|
-
TODO 1234234 Y 7/11/2013 Pickup
|
2
|
+
TODO 1234234 Y 7/11/2013 Pickup
|
data/spec/fixtures/trns.iif
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
!TRNS TRNSID TRNSTYPE DATE ACCNT NAME CLASS AMOUNT DOCNUM MEMO CLEAR TOPRINT ADDR1 ADDR2 ADDR3 ADDR4 ADDR5 SADDR1 SADDR2 SADDR3 SADDR4 SADDR5 DUEDATE TERMS PAID PAYMETH SHIPDATE REP PONUM INVTITLE INVMEMO
|
2
2
|
!SPL SPLID TRNSTYPE DATE ACCNT NAME CLASS AMOUNT DOCNUM MEMO CLEAR QNTY PRICE INVITEM PAYMETH TAXABLE REIMBEXP EXTRA
|
3
3
|
!ENDTRNS
|
4
|
-
TRNS 123 INVOICE 8/31/1988 Accounts Receivable Customer tires:deeptread 20 1 N N Baker Customer Watson Recipient BOB
|
4
|
+
TRNS 123 INVOICE 8/31/1988 Accounts Receivable Customer "HSBC" tires:deeptread 20 1 N N Baker Customer Watson Recipient BOB
|
5
5
|
SPL 777 INVOICE 8/31/1988 Income Account -20 N -2 10 Sales Item N
|
6
6
|
SPL 888
|
7
|
-
ENDTRNS
|
7
|
+
ENDTRNS
|
data/spec/fixtures/vend.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!VEND NAME PRINTAS ADDR1 ADDR2 ADDR3 ADDR4 ADDR5 VTYPE CONT1 PHONE1 PHONE2 FAXNUM NOTE TAXID LIMIT TERMS NOTEPAD SALUTATION COMPANYNAME FIRSTNAME MIDINIT LASTNAME CUSTFLD1 CUSTFLD2 CUSTFLD3 CUSTFLD4 CUSTFLD5 CUSTFLD6 CUSTFLD7 1099 NOTE
|
2
|
-
VEND Jun Lin 12312323242 Y
|
2
|
+
VEND Jun Lin 12312323242 Y
|
data/spec/fixtures/vtype.iif
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
!VTYPE NAME
|
2
|
-
VTYPE vtype 1
|
2
|
+
VTYPE vtype 1
|