55
Invoice Transfer Documentation Yue Ji October 16, 2006 Updated on June 14, 2007, October 15, 2007 Table of Contents: Introduction………………………………………………………………..….……………. page 2 1. Library Invoice Transfer Files …………………………………………………………. page 2-6 1.1 The represent symbols of eleven library paying units ………………………. page 2-3 1.2 Invoice Transfer File Name ……………………………………………………….. page 3 1.3 Sample of library’s invoice transfer file “API_ORBISG_2006_08_30_01.dat..page 3 1.4 The file includes three record types ……………………………………………. Page 4 1.5 The relations of three record types …………………………………………….. page 4 1.6 APH data …………………………………………………………………………….. page 4 1.7 API data ………………………………………………………………………..……. page 4-5 1.8 APD data ……………………………………………………………………………..page 5-6 1.9 Mapping fields between Library Voyager and YAP Sal ……………………. page 6 1.10 Snapshot Excel report ……………………………………………………………. page 6 2. The Analysis of How to Find Invoice Transfer Data ……………………..………..page 6-13 2.1 Find all of invoice line item records for each invoice records …………....page 6-9 2.2 Find all of invoice other charge records for each invoice records …….. page 9-13 3. The Invoice Note Field …………………………………………………………….…… page 13-15 3.1 What will happen if word “INTERNAL” exists in the note? .............................page 13-14 3.2 Invoice Notes in Snapshot Excel Reports……………………………………......page 14 3.3 Invoice Notes in Invoice Transfer Files..............................................................page 14 3.4 What will happen if word “ATT=Y” exists in the note? ...................................page 14-15 4. Foreign Currency Conversion.............................................................. ..................page 15-16 1

Invoice Transfer Fields Match between Voyager and Salyuej/doc/InvoiceTransferManual.doc · Web view... 500048 Voyager INVOICE.INVOICE_NUMBER = 500048 INVOICE TYPE VARCHAR2(25) STANDARD

Embed Size (px)

Citation preview

Invoice Transfer DocumentationYue Ji

October 16, 2006Updated on June 14, 2007, October 15, 2007

Table of Contents:

Introduction………………………………………………………………..….……………. page 21. Library Invoice Transfer Files …………………………………………………………. page 2-6 1.1 The represent symbols of eleven library paying units ………………………. page 2-3 1.2 Invoice Transfer File Name ……………………………………………………….. page 3 1.3 Sample of library’s invoice transfer file “API_ORBISG_2006_08_30_01.dat..page 3 1.4 The file includes three record types ……………………………………………. Page 4 1.5 The relations of three record types …………………………………………….. page 4 1.6 APH data …………………………………………………………………………….. page 4 1.7 API data ………………………………………………………………………..……. page 4-5 1.8 APD data ……………………………………………………………………………..page 5-6 1.9 Mapping fields between Library Voyager and YAP Sal ……………………. page 6 1.10 Snapshot Excel report ……………………………………………………………. page 6

2. The Analysis of How to Find Invoice Transfer Data ……………………..………..page 6-13 2.1 Find all of invoice line item records for each invoice records …………....page 6-9 2.2 Find all of invoice other charge records for each invoice records …….. page 9-13

3. The Invoice Note Field …………………………………………………………….…… page 13-15 3.1 What will happen if word “INTERNAL” exists in the note? .............................page 13-14 3.2 Invoice Notes in Snapshot Excel Reports……………………………………......page 14 3.3 Invoice Notes in Invoice Transfer Files..............................................................page 14 3.4 What will happen if word “ATT=Y” exists in the note? ...................................page 14-15

4. Foreign Currency Conversion................................................................................page 15-16

5. Relationships among invoice line items, invoice line item funds, and invoice funds.........................................................................................................................page 16-26 5.1 One invoice contains five invoice line items, and each has one copy......page16-18 5.2 One invoice has multiple funds for its different invoice line items................page 19-23 5.3 One invoice line item has multiple funds........................................................page 23-24

1

5.4 One invoice contains one invoice line item with two copies…………….....page 25-26

6. Voyager Bugs Related With Invoice Record........................................................page 26-31 6.1 Invoice Total Amount is zero............................................................................page 26-27 6.2 The number of approved line items sometimes is wrong if this invoice line item has multiple copies...........................................................................................page 27-31

7. Application Information on Server........................................................................page 31-35

8. Programming analysis............................................................................................page 35-37 8.1 Where to get APD data………………………………………………………........ page 35 8.2 The rules to convert foreign currency amount...............................................page 35-36 8.3 The impact of Voyager bug on using Voyager tables…………………….... page 36-37 8.4 Create Invoice Transfer Files…………………………………………………........ page 37 8.5 Create Invoice Transfer File’s snapshot excel reports………………………… page 37

9. Programs summary………………………………………………………………………page 38

10. JAR files.…………….…………………………………………………………………… page 39-40

11. Related documentations.....................................................................................page 40

12. Contact Staff………………………………………………………….………………… page 40

Introduction.

This Java version of Invoice Transfer is a replacement for current running Visual Basic version of Invoice Transfer.

Invoice Transfer Programs has three functions:- Create invoice transfer files of YAP.- Create snapshot excel reports of invoice transfer files.- Email snapshot excel reports to ACQ staff.

Yale Accounts Payable (YAP) has a standard requirement for the invoice transfer file. See Yale University Accounts Payable Documentation (available as paper print).

2

The printed forms include three parts:- Batch Record Layout- Header Record Layout- Line Record layout

1. Library Invoice Transfer Files.

The libraries are defined eleven paying units for transferring the invoices. Each unit includes one or more libraries. There are eleven files for these eleven paying units. Library sends invoice transfer files to YAP every night of weekdays (M–F). The number of files being sent every day depends on the invoice approved transactions in each library. If no invoice approved transaction happens in one or some libraries, there is no transfer files for those libraries.

1.1 The represent symbols of eleven library paying units.

Please see the “BilLocGroup.doc” for the most current updates.Source Name, Sending ORG, and Source ID are assigned by YAP.Library name and its bill location id are defined by library.If the invoice’s bill location id is not in this table, its invoice will go to ORBISL (Sterling library).

Source Name Sending ORG Source ID Library Name (Bill Location ID)ORBISA 620001 44 Astronomy Library(473)ORBISC 855001 28 Music Library(477)ORBISD 851001 29 Divinity Library Books(471),

Divinity Library Serials(470)ORBISE 731075 30 Epidemiology Library(476)

ORBISF 837001 31 F&ES Library(513)ORBISG 834001 32 Geology Library(493)ORBISK 835001 34 Kline Library Books(492),

Kline Library Serials(502), Chemistry Library(499), Engineering Library(498), Kline Lib Anthropology(510)

ORBISL 809001 5 SML Fiscal Support Team(488), Lewis Walpole Library(472),All other locations that are not listed in this table.**

ORBISM 854001 35 Medical Library Books(485), Medical Library Serials(486)

ORBISS 840001 36 Social Science Libraries(474), SSL Economic Growth CNTR(484), Statistics Library(482),Government Docs & Info Center(494),Social Science Library, Economic Growth Center Collection(438)

ORBIST 836001 37 Mathematics Library(495)

3

** These Receiving Locations in Acquisitions are grouped under SML:Art&Architecture DramaArt of the Book Manuscripts and ArchivesClassics OrnithologyCross Campus Library All other locations that are not listed

in above table

1.2 Invoice Transfer File Name.

The file name is date-stamped. It is the batch job running date. Batch number is the unique number for the given date. For routine’s running, use

the default ‘01’. If running the same date repeatly, the batch number should be given any different number, other than ‘01’. Go to the properties file to change batch number.

Suffix: The file from library is ‘dat’. The file from YAP that after process is ‘rsv’. File name patten:

API_Source Name_YYYY_MM_DD_Batch Number.dat (from library)API_Source Name_YYYY_MM_DD_Batch Number.rsv (from YAP)

1.3 Sample of library’s invoice transfer file “API_ORBISG_2006_08_30_01.dat”.

APH 3230080601 834001 ORBISG 30-AUG-2006 000000007375.00000000000000002

API 500048 STANDARD 01-JUL-200610495201 000000004875.00 Acct 23600, deposit for 2006/2007

80778

APD 00001 ITEM 000000004875.00 TITLETITLETITLETALL 02

0032746 00 29385A 850800 809001API VG 2814 STANDARD 03-JUL-2006

10738101 000000002500.00 FG/Y-geol(2122)/ERO 81666

APD 00001 ITEM 000000002500.00 TITLETITLETITLETALL 02

0032804 00 0001BC 850205 834001

1.4 The file includes three record types.

APH: YAP’s “Batch Record”. This is the batch header that can only have one APH record in one paying unit file. It can be considered as the summary record.

API: YAP’s “Header Record”. This is the invoice record. The count of API record in one paying unit file is written in the APH record.

APD: YAP’s “Line Record”. This is the invoice line item record. Each of API records has its own APD records.

1.5 The relations of three record types.

4

APH - Batch Header         API  - Invoice Header                   APD - Invoice Distribution line

There are two level match for their amounts:(1). For each Invoice Header (API) amount,  Adding all the Invoice distribution lines amount (APD) for that invoice should match.          SUM(APD) (for that invoice)   = API amount (for that Invoice)

(2). Adding all the Invoice Header (API) amount should match the Batch Header (APH) total.          SUM(API) = APH amount

1.6 APH data.

YAP Field Name YAP Data Type Library Data ExplanationRECORD_TYPE VARCHAR2(3) APH Must be “APH”BATCH # VARCHAR2(10) 3230080601 Source ID

+DDMMYY(Invoice Approved Date)+Batch number

BATCH SENDING ORG VARCHAR2(6) 834001 Sending ORGSOURCE NAME VARCHAR2(6) ORBISG Source NameBATCH DATE VARCHAR2(11) 30-AUG-2006 DD-MON-YYYY

(Invoice Approved Date)TOTAL DOLLAR AMOUNT

NUMBER(15,2) 000000007375.00 Total amount of all the invoices within this BATCH

RECORD COUNT NUMBER(15,0) 000000000000002 The number of invoices in this batch

1.7 API data.

YAP Field Name YAP Data Type Library Data ExplanationRECORD_TYPE VARCHAR2(3) API Must be “API”INVOICE # VARCHAR2(50) 500048 Voyager

INVOICE.INVOICE_NUMBER = 500048

INVOICE TYPE VARCHAR2(25) STANDARD Must be “STANDARD” or “CREDIT”. CREDIT Invoices must have invoice amounts less than zero

INVOICE DATE VARCHAR2(11) 01-JUL-2006 DD-MON-YYYYVoyagerINVOICE.INVOICE_DATE = 2006-07-01 00:00:00.0

PO# VARCHAR2(20) Blank Leave blank for future enhancements

SUPPLIER/SITE # VARCHAR2(8) 10495201 VoyagerVENDOR.INSTITUTION_ID = 10495201

5

INVOICE AMOUNT VARCHAR2(15) 000000004875.00

Voyager INVOICE.TOTAL = 487500

INVOICE DESCRIPTION

VARCHAR2(240) Acct 23600, deposit for 2006/2007

VoyagerINVOICE_NOTE.NOTE = cmt=Acct 23600, deposit for 2006/2007; JmorganOnly get the first line of note without “cmt=”

AWT GROUP NAME VARCHAR2(25) Blank Leave blank for future enhancements

SOURCE SYSTEM VOUCHER ID

VARCHAR2(20) 80778 Voyager INVOICE.VOUCHER_NUMBER = 80778

SPECIAL HANDLING

VARCHAR2(1) ‘S’ or blank If ATT=Y from note, then ‘S’Otherwise blank

Remaining fields 12 – 22

Leave as blanks

1.8 APD data.

YAP Field Name YAP Data Type Library data ExplanationRECORD_TYPE VARCHAR2(3) APD Must be “APD”LINE NUMBER VARCHAR2(15) 00001 Roy used this max lengthLINE TYPE VARCHAR2(25) ITEM Always “ITEM” for libraryAMOUNT VARCHAR2(15) 000000004875.00 The sum of this field for

all invoice lines must equal Invoice Amount in the APH

ACCOUNTING DATE VARCHAR2(11) BlankITEM DESCRIPTION

VARCHAR2(240) LINEITEMTITLE Always this value to avoid diacritic title.

Fields 7 – 15 Leave as blanks with delimiter X’09’

INVOICE CHARGING CATEGORY

VARCHAR2(25) ALL Always “ALL” for library

BALANCING SEGMENT

VARCHAR2(2) 02 Always “02” for library

PROJECT VARCHAR2(7) 0032746 FUND.INSTITUTION_FUND_ID(PTAEO) Part 1

TASK VARCHAR2(8) 00 FUND.INSTITUTION_FUND_ID(PTAEO) Part 2

SOURCE / AWARD VARCHAR2(6) 29385A FUND.INSTITUTION_FUND_ID(PTAEO) Part 3

OBJECT CODE / EXPENDITURE TYPE

VARCHAR2(6) 850800 FUND.INSTITUTION_FUND_ID(PTAEO) Part 4

ORGANIZATIONAL UNIT

VARCHAR2(6) 809001 FUND.INSTITUTION_FUND_ID(PTAEO) Part 5

AWT GROUP NAME VARCHAR2(25) Leave the blank

All fields in the file are separated by the delimiter X’09’.

1.9 Mapping fields between Library Voyager and YAP Sal.

6

Library Voyager Oracle Table / Fields: YAP Sal Fields:INVOICE / invoice_id = voucher_number = voucher id

Voucher number

INVOICE / invoice_number Vendor Invoice NumberVENDOR – istitution_id Vendor Number = Oracle Number

1.10 Snapshot Excel report.

Name of each paying unit in one excel sheet:Library Name_ InvSummary_YYYY_MM_DD_Batch Number.xls.

Name of all paying units in one excel sheet:All_Libraries_ InvSummary_YYYY_MM_DD_Batch Number.xls.

Each snapshot will be emailed to each paying unit’s Acquisition responsible staff. The all libraries in one snapshot will be emailed to Marcia Romanansky and

Melissa Wisner. All emails data are assigned in the properties file.

2. The Analysis of How to Find Invoice Transfer Data.

Find all invoice records whose INVOICE STATUS is “approved” on the current day.

Each of these invoice record has unique invoice id. Each of these invoice record has one or more invoice line items that associate

with its invoice record. Each of these invoice record has 0, one or more other charges that associate with

its invoice record.

2.1 Find all of invoice line item records for each invoice records.

Go to INVOICE_LINE_ITEM table to grab all qualified invoice line items. Check each line item records if it is paid by multiple funds. If so, this line item needs to be split as many as the count of multiple funds with each different fund. Here is the explanation how to check one line item paid by multiple funds:

(1). In the Voyager Oracle tables: Use INV_LINE_ITEM_ID to match INV_LINE_ITEM_ID in INVOICE_LINE_ITEM_FUNDS table to get LEDGER_ID, FUND_ID, and AMOUNT:

Find this line item is paid by two funds, split percentage is 50% for each.

7

Figure 2.1.1

(2). Use LEDGER_ID, FUND_ID to match LEDGER_ID, FUND_ID in FUND table to get INSTITUTION_FUND_ID (PTAEO) for each fund:

Figure 2.1.2

8

Figure 2.1.3

(3). On the Voyager client, it will show as following screen shots:

Figure 2.1.4

9

Figure 2.1.5

(4). This invoice record’s split line items in Invoice Transfer File will be:

API 10140 STANDARD 20-SEP-2002 10320404000000009283.00 2218

APD 00001 ITEM 000000004641.50 LINEITEMTITLEALL

02 0032818 00 0001BC 850225 854001

APD 00002 ITEM 000000004641.50 LINEITEMTITLEALL

02 0032805 00 0001BC 850225 835001

2.2 Find all of invoice other charge records for each invoice records.

Check each invoice record if it has any other charges. The other charges include adjustment price, tax, shipping cost, discount, etc.

If so, besides all its line items, the other charges of this invoice record will be added into APD lines as line items which belong to this invoice record.

Here is the explanation how to check if one invoice record has the other charges:

10

(1). In the Voyager Oracle tables:

Use INVOICE_ID to match OBJECT_ID in PRICE_ADJUSTMENT table to get PAYMENT_ID: INVOICE_ID = OBJECT_ID, and OBJECT_TYPE = ‘C’ Why select ‘C’? No clear answer, because no Voyager table is available to explain what is ‘C’. This is from Roy Lechnich’s trouble shooting experiences.

Figure 2.2.1

(2). Use PAYMENT_ID to match PAYMENT_ID in FUND_PAYMENT table to get LEDGER_ID, FUND_ID, and AMOUNT:

11

Figure 2.2.2

Figure 2.2.3

(3). Use LEDGER_ID, FUND_ID to match LEDGER_ID, FUND_ID in FUND table to get INSTITUTION_FUND_ID (PTAEO):

12

Figure 2.2.4

(4). On the Voyager client, it will show as following screen shots:

13

Figure 2.2.5

(5). By clicking “Other Charges”, get adjusted price line items:

Figure 2.2.6

(6). All invoice line items of this invoice record in Invoice Transfer File will be:

14

API 440-31189640 STANDARD 15-JUN-2006 10748501000000001388.34 81541

APD 00001 ITEM 000000001071.42 LINEITEMTITLEALL

02 0032746 00 27400A 850205 809001

APD 00002 ITEM 000000000016.96 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

APD 00003 ITEM 000000000032.13 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

APD 00004 ITEM 000000000087.50 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

APD 00005 ITEM 000000000085.70 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

APD 00006 ITEM 000000000023.21 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

APD 00007 ITEM 000000000019.64 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

APD 00008 ITEM 000000000083.03 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

APD 00009 ITEM -00000000070.98 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

APD 00010 ITEM 000000000039.73 LINEITEMTITLEALL

02 0032746 00 27400A 850200 809001

The last two colored in blue are the adjustment price line items.

3. The Invoice Note Field.

3.1 What will happen if word “INTERNAL” exists in the note?

(1). If the FIRST word in the INVOICE NOTE field is "INTERNAL" (or "Internal" or "internal", not case sensitive): The invoice will NOT be included in the Invoice Transfer file and Snapshot

excel sheet report. and NOT sent to Accounts Payable. Be attention here: "INTERNAL" MUST appear at the FIRST word for not

being sent to YAP; otherwise, the invoice will be sent to YAP.

15

For example, the note is: CMT=INTERNAL, "INTERNAL". Here "INTERNAL" is not at the first word, this invoice will be sent to YAP, no matter what is credit or debit invoice.

(2). "INTERNAL" invoice usually is used to credit the mistake in the invoice. If the invoice is rejected by YAP, library ACQ will create another two new

invoice to correct this rejection: One is internal credit / adjust invoice to balance the mistake invoice; The other one is the correct invoice.

3.2 Invoice Notes in Snapshot Excel Reports.

All texts from the INVOICE NOTE field gets transcribed into the Snapshot Excel Report.

Snapshot excel reports copy all exact notes from Voyager Oracle INOICE_NOTE field, even just someone’s initals.

For example, from January 11, 2006's invoices, see Invoice Number 14217978. The characters "jga" (someone's initials) are present in the NOTE field of the Snapshot excel sheet report.

See following more examples.

3.3 Invoice Notes in Invoice Transfer Files.

The Invoice Notes are only written into the invoice transfer files when the Voyager notes include “CMT=”.

“CMT=” is not case sensitive, and can be in any positions in the notes. But “CMT=” itself CAN’T be written into the transfer file. Any texts following "CMT=", and in the note’s first line (ended by ‘\n’),

exclude ‘;’ will be transcribed in the transfer file’s Invoice Description (or Note field).

This text will appear on the check stub. Library staff will type everything whatever they want for the vendor to know.

For example, libraries put here their account numbers. From January 11, 2006's invoices, see Invoice Number 20196552 (Geology) where the Note says: cmt=A/R # 0065938, BYAL+G;  JMorgan.

- Invoice Notes in transfer file with blue marked here, only include the texts following “CMT=”, and before ‘:’ :

API 20196552 STANDARD 04-JAN-2006 10061202000000000049.66 A/R # 0065938, BYAL+G 69570

- Invoice Notes in Snapshot excel sheet report, include everything from Voyager INOICE_NOTE:

cmt=A/R # 0065938, BYAL+G; JMorgan

3.4 What will happen if word “ATT=Y” exists in the note?

16

If Invoice Note includes the letters “ATT=Y” (or “att=y” ", not case sensitive), then a character "S" is written in the field right after "Source system voucher id"; Otherwise leaves as a blank.

“S” means "Special Handling". “ATT=Y” can be at any positions in the notes. It doesn’t matter whether

“ATT=Y” is at the beginning of the NOTES field or not. “ATT=Y” means: Don’t send out a check yet; wait for special handling that

library will send the attachment; hold for another piece of paper from library to tell YAP what needs to do.

From January 11, 2006's invoices, see Invoice Number 1ABY9943/39. (Geology), has the following in the Voyager NOTES field: att=Y; Jmorgan

- In the following invoice transfer file, ‘S’ is written, and no note is written, because no “CMT=” is in Voyager note field:

API 1ABY9943/39 STANDARD 04-JAN-2006 10523002000000000090.00 69566 S

- In the Snapshot excel sheet report, the Voyager note is written into:att=Y; JMorgan

From January 11, 2006's invoices, Invoice Number 953462, has the following in the NOTES field: BW;ATT=Y;CMT=1 DEDUCT EUR 26.00;

- In the invoice transfer file, ‘S’ is written, and the note is written, because “CMT=” is in Voyager note field, and the texts following “CMT=”, and before ‘:’ are written into transfer file:

API 953462 STANDARD 07-NOV-2005 10752302 000000000135.98 1 DEDUCT EUR 26.00 69601 S

- The ‘ATT=Y’ cause the character "S" to be output in the Special Handling field of invoice transfer file.

- The ‘CMT=’ cause the comment to be output into invoice transfer file.

4. Foreign Currency Conversion.

All foreign currency amounts can’t be sent to YAP, they must be converted to US Dollar.

Each invoice record has its “at that time” foreign currency conversion rate that is presented as “CONVERSION_RATE” in Voyager INVOICE table. Use this rate to convert any foreign currencies, and round up to cents.

API’s amount is from Voyager Oracle INVOICE table’s TOTAL field. Make a conversion for each invoice’s foreign currency amount.

APH’s amount is the sum of all API’s amount. If API’s amount is foreign currency, it has to be converted to USD before sum.

APD’s amount is from Voyager Oracle two tables:

17

- AMOUNT field in INVOICE_LINE_ITEM_FUNDS table. This amount is invoice line item price.- AMOUNT field in FUND_PAYMENT table.

This is invoice adjustment price. If invoice record shows that its amount is the foreign currency, all of its APD’s

amounts must make a conversion when getting these prices from INVOICE_LINE_ITEM_FUNDS, and FUND_PAYMENT tables.

5. Relationships among invoice line items, invoice line item funds, and invoice funds.

Here use four cases to describe their relationships.

5.1 One invoice contains five invoice line items, and each has one copy.

Following seven figures show how this situation is stored in Voyager Oracle tables.

(1). Invoice_id = 1407 has five invoice line items in INVOICE_LINE_ITEM table:

Figure 5.1.1

(2). Invoice_id = 1407 has one fund in INVOICE_FUNDS table:

18

Figure 5.1.2 (3). Five invoice line items shown below all are paid with one same fund. Each invoice line item is paid by this fund fully, shown as PERCENTAGE = 100.

Inv_line_item_id = 9344 (Invoice_id = 1407) in INVOICE_LINE_ITEM_FUNDS table:

Figure 5.1.3

Inv_line_item_id = 9346 (Invoice_id = 1407) in INVOICE_LINE_ITEM_FUNDS table:

Figure 5.1.4

19

Inv_line_item_id = 9347 (Invoice_id = 1407) in INVOICE_LINE_ITEM_FUNDS table:

Figure 5.1.5

Inv_line_item_id = 9348 (Invoice_id = 1407) in INVOICE_LINE_ITEM_FUNDS table:

Figure 5.1.6

Inv_line_item_id = 9349 (Invoice_id = 1407) in INVOICE_LINE_ITEM_FUNDS table:

20

Figure 5.1.7

5.2 One invoice has multiple funds for its different invoice line items. The difference here with 4.3 below is: different funds are paid to different invoice

line items, but one invoice line item is only paid by one fund. Following nine figures show how this situation is stored in Voyager Oracle tables.

(1). Invoice_id = 2152 in INVOICE_LINE_ITEM table. This invoice has seven invoice line items. Shown here as seven different INV_LINE_ITEM_ID.

Figure 5.2.1

(2). Invoice_id = 2152 in INVOICE_FUNDS table. This invoice has two funds.

21

Figure 5.2.2

(3). Seven invoice line items are shown below with two funds applied to different invoice line items. Each invoice line item is paid by one fund fully, shown as PERCENTAGE = 100.

Inv_line_item_id = 8924 (Invoice_id = 2152) in INVOICE_LINE_ITEM_FUNDS table:

Figure 5.2.3

Inv_line_item_id = 8934 (Invoice_id = 2152) in INVOICE_LINE_ITEM_FUNDS table:

22

Figure 5.2.4

Inv_line_item_id = 8935 (Invoice_id = 2152) in INVOICE_LINE_ITEM_FUNDS table:

Figure 5.2.5

Inv_line_item_id = 8936 (Invoice_id = 2152) in INVOICE_LINE_ITEM_FUNDS table:

23

Figure 5.2.6

Inv_line_item_id = 8937 (Invoice_id = 2152) in INVOICE_LINE_ITEM_FUNDS table:

Figure 5.2.7

Inv_line_item_id = 8940 (Invoice_id = 2152) in INVOICE_LINE_ITEM_FUNDS table:

24

Figure 5.2.8

Inv_line_item_id = 8942 (Invoice_id = 2152) in INVOICE_LINE_ITEM_FUNDS table:

Figure 5.2.9

5.3 One invoice line item has multiple funds.

25

The difference here with 4.2 above is: Different funds are paid to partial percentage of one invoice line item. That means one invoice line item is paid by multiple funds, not only one fund.

If multiple funds pay one invoice line item, this invoice line item can only contain one copy.

If one invoice line item paid by multiple funds needs to have multiple copies, each copy has to be made as its own independent line item with a single copy included.

This is confirmed by Suzanna called Janet Prochownik, and Claire Halloran on November 7, 2006.

Following three figures show how this situation is stored in Voyager Oracle tables.

(1). Invoice_id =2218 has one invoice line item in INVOICE_LINE_ITEM table. INV_LINE_ITEM_ID = 9319.

Figure 5.3.1

(2). Invoice_id = 2218 has two funds in INVOICE_FUNDS table.

Figure 5.3.2

(3). Inv_line_item_id = 9319 (Invoice_id = 2218) has two records with two funds. Each fund is paid as partial 50%. Shown as PERCENTAGE = 50 in INVOICE_LINE_ITEM_FUNDS table. This is not two copies. This is one copy that is split paid by two funds.

26

Figure 5.3.3

5.4 One invoice contains one invoice line item with two copies.

Following three figures show how this situation is stored in Voyager Oracle tables.

(1). Invoice_id = 83001 has one invoice line item in INVOICE_LINE_ITEM table. This invoice line item has two copies, shown as QUANTITY = 2.

Figure 5.4.1

(2). Invoice_id = 83001 has one fund in INVOICE_FUNDS table.

27

Figure 5.4.2

(3). Inv_line_item_id = 415632 (Invoice_id = 83001) has two records with the same fund in INVOICE_LINE_ITEM_FUNDS table. Each copy is paid fully by the same fund.

Figure 5.4.3

6. Voyager Bugs Related With Invoice Record.

6.1 Invoice Total Amount is zero.

28

In the following screen shot Figure 5.1.1, the “Amount” with blue circled (left) is typed by the staff. The “Total Invoice Amount” with yellow circled (right) is automatically totaled by system after operator entered each line item amounts.

In Voyager Oracle INVOICE table, these two amounts are saved in two different fields. “Amount” is saved in the field “INVOICE_TOTAL”. “Total Invoice Amount” is saved in the field “TOTAL”.

In correct situation, “Amount” and “Total Invoice Amount” should be equal. However, not so often, but it could happen one error that caused by Voyager

unsolved bug: The Amount in blue circle sometimes changes to ZERO after the invoice has been approved, although the staff typed in as the correct total amount.

Here is an example showing in this screen shot: “Amount” is zero, and “Total Invoice Amount” is not zero. This bug has been reported to Endeavor.

Figure 6.1.1

6.2 The number of approved line items sometimes is wrong if this invoice line item has multiple copies.

After multiple copies of one line item are ordered, sometimes only partial copies are received which intended to be paid for. In this case, sometimes after create a new invoice to approve these partially received copies, all copies including those

29

that are not received, regardless their line item status even canceled, claimed, etc are become invoice line items.

In following example Figure 5.1.2, invoice_id=83692 was approved on October 9, 2006. Its invoice line item and another invoice Invoice_id = 83001 which was approved on September 26, 2006’s invoice line items are the copies under the same line item id = 692705.

Here are illustrations: (1). Approved only one copy from Voyager client on Oct. 9, 2006:

Figure 6.1.2

(2). From Voyager table, we can see this invoice id = 83692’s “QUANTITY” is ‘1’. Its LINE_ITEM_ID = 692705. Figure 5.1.3.

30

Figure 6.1.3

(3). From Voyager table, we can see this invoice id = 83001’s “QUANTITY” is ‘2’. Its LINE_ITEM_ID = 692705. Figure 5.1.4.

Figure 6.1.4(4). By highlight Voyager client line item which is shown as Figure 5.1.2, then click “Detailed Line Item”, four line items show up by click “Copy Status” tab: Here shows all line items, 3 invoice line items, 1 claimed line item.

31

Figure 6.1.5(5). From Figure 5.1.2 screen shot, we know only one copy got paid, so it should only have one invoice line item for this invoice. However all 4 copies are written into Voyager invoice paid funds table with the same invoice line item, invoice line item id = 419260.

32

Figure 6.1.6

(6). This will cause invoice transfer batch file to YAP rejected, because of balance is not match. For this example invoice: invoice amount from API record is one copy’s price $17.13, but it has 4 copies line items with each price $17.13 from APD records. They show in transfer file below:

The transfer file name: API_ORBISL_2006_10_09_01.rsv:

APH 0509100601 809001 ORBISL 09-OCT-2006 000000024892.14000000000000071

……

API 838905 STANDARD 05-OCT-2006 10532002000000000017.13 83692

APD 00001 ITEM 000000000017.13 LINEITEMTITLEALL

02 0032786 00 16155A 850105 822001

APD 00002 ITEM 000000000017.13 LINEITEMTITLEALL

02 0032786 00 16155A 850105 822001

APD 00003 ITEM 000000000017.13 LINEITEMTITLEALL

02 0032786 00 16155A 850105 822001

APD 00004 ITEM 000000000017.13 LINEITEMTITLE

It should be only have one APD with the price $17.13. Right now, the trouble shooting is manually deleing the extra three APD record from YAP ‘.rsv’ file; then manually FTP to YAP with the batch number changed from ‘01’ to any other number.

(7). Use above as example to explain the procedure to fix this rejected batch: Delete the extra three APD records. Find batch number 0509100601 from APH record; change to 0509100666. Change the file suffix name from ‘rsv’ to ‘dat’. Rename file name API_ORBISL_2006_10_09_01.rsv as

API_ORBISL_2006_10_09_66.dat The batch number ‘01’ is changed to ‘66’ in two places: APH record and

batch file name. If only delete APD records, no need to change the API number value from APH.

Some other rejection cases need to manually delete API record for fixing the problem. But must consult with ACQ staff. After delete API record, don’t forget subtract API number from APH record.

For example:

33

APH 3409100601 835001 ORBISK 09-OCT-2006 000000004469.30000000000000005

If this batch is deleted one API record; the 000000000000005 needs to be subtracted 1. The APH should be:APH 3409100688 835001 ORBISK 09-OCT-2006 000000004469.30

000000000000004

Also don’t forget change batch number in APH and batch file name.

Any re-submit invoice transfer batch file needs to change batch number in its APH record and file name, because YAP doesn’t accept duplicate invoice transfer files.

YAP cannot have duplicate invoice number for the same vendor. The invoice that has the same invoice number with the same vendor can only be allowed to submit to AP once. AP will reject the duplicate invoice that has the same invoice number with the same vendor.

7. Application Information on Server.

Read “ReadMe_InvoiceTransferJava.txt” before run the application. The application package is located at server:

/m1/voyager/yaledb/local/InvoiceTransferJava. The original delivery application package includes:

- invoicetransferjava.jar- Init.properties- RunInvoiceTransferJava- ReadMe_InvoiceTransferJava.txt

Init.properties contains configuration data. The example data is follows:- Oracle_database_url=magellan.library.yale.edu:1521:VGER- Orbis_database_username=xxxxxx- Orbis_database_password=xxxxxx- Invoice_status_date=today- Invoice_status_date=20050926- Batch_id=01- [email protected] [email protected] Astronomy_netid=km39- [email protected] Music_netid=helent- [email protected] Divinity_netid=mb8- [email protected] EPH_netid=sluthra- F&ES_email=- F&ES_netid=- Geology_email=

34

- Geology_netid=- [email protected] KCE_netid=kl76- [email protected],[email protected] Sterling_netid=prochow,sharlee- Medical_email=- Medical_netid=- [email protected] SocialScience_netid=azurin- Math_email=- Math_netid=- [email protected],[email protected] Master_netid=mr343,mw446

Explanation to some key-value pairs. (1). Invoice_status_date.

- Only one Invoice_status_date can be included in the properties file; either “today” or a given date, e.g. 20050926.

- If normal every weekdays’ run, use 'today'; Invoice_status_date=today 'today' criteria is from yesterday's 21:01pm to today's 21:00pm.

- For Tuesday - Sunday, yesterday is today's yesterday.- For Monday, yesterday is last Friday.- If special run, type the given date, and the date format MUST be

yyyyMMdd: e.g. Invoice_status_date=20050926(2). Batch_id.

- If normal every weekdays’ run, use '01'; Batch_id=01- If special run for the given date's invoice transfer, change '01' to

different number. e.g. '02', '99' etc; Batch_id=66(3). From_email.

- This is the email address that sends all excel snapshot reports to all libraries' recipients whose email addresses are listed in the properties file. E.g. From_email= [email protected]

(4). Outgoing email domain. If the netid’s last name in Voyager OPERATOR table is one of “Medical Library”, “Medical Library Student”, "EPH Library”, and “EPH Library Student”, the outgoing email domain is “email.med.yale.edu”; otherwise outgoing email domain is “netID.mail.yale.edu".(5). xxxxxx_email, xxxxxx_netid.

- These email addresses, and netids are used to receive the excel snapshot reports.

- If one library’s recipients are more than one, the emails/netids are separated by comma, and MUST use comma.e.g. [email protected],[email protected]_netid=prochow,sharlee

35

- The emails and their netids that are separated by comma MUST place in the same order. For example, you CAN'T put Janet’s email at the first place, and her netid is not at the first place.

- Leave email and netid as blank if the libary doesn't want to receive excel snapshot report.e.g. Math_email=Math_netid=

(6). Master_email.- This email address will receive all library's sanpshot reports from one

excel [email protected],[email protected]_netid=mr343,mw446

Jar file invoicetransferjava.jar is used to run the application. There are two ways to run this jar file.(1). Without argument:

- java -jar invoicetransferjava.jar- Go in Init.properties to directly change server configurations, but do

not remove any lines.(2). With argument:

- java -jar invoicetransferjava.jar [input file name]- [input file name] can be any names. The data should be subset from

Init.properties. - That means no necessary to copy all lines from Init.properties, just

copy those lines that need to be changed. - For example, if only Server_IP_address=magellan.library.yale.edu

need to be changed as Server_IP_address=clark.library.yale.edu,

and other lines do not need to be changed, just copy this line: Server_IP_address= clark.library.yale.edu. Then save to another name as [input file name].

- The program will read configuration data from both Init.properties and the input file, then overwrite those values of Init.properties in server memory with the values from input file if the same keys exists in both files.

- Do not change any key names in both ways, only values.

Unix script “runInvoiceTransferJava” is used to run the command. All commands that need to run this application such as FTP, save '.dat' files, run java jar file, delete '.xls', email screen messages etc, can be included in this script file. Type runInvoiceTransferJava to run the application. ITS library group adds some commands in the script file in order to complete the whole invoice files transfer process.

When running “runInvoiceTransferJava”, there is a screen display as following to show configuration data, such as on which server, user account etc.

Here are data from properties file:

36

Oracle_database_url is magellan.library.yale.edu:1521:VGEROrbis_database_username is xxxxxxOrbis_database_password is xxxxxxBatch_id is 01Invoice_status_date is 20050926From_email is [email protected]......

Output files:- Invoice transfer file’s format: ‘API_Source Name_YYYY_MM_DD_Batch Number.dat’.- The number of ‘dat’ files is different every day. If some libraries don’t

have invoice approval transaction, no those paying unit's ‘dat’ files.- ‘dat’ files will be FTPed to YAP by unix script, then saved into another

directory by unix script.- Snapshot excel files' format: ‘Library Name_ InvSummary_YYYY_MM_DD_Batch Number.xls’.- The ‘xls’ files are the snapshot of the ‘dat’ files. Each ‘dat’ file has its

corresponding ‘xls’ file.. - One special ‘xls’ file includes all libraries’ data. ‘All_Libraries_ InvSummary_YYYY_MM_DD_Batch Number.xls’.- All ‘xls’ files will be emailed to the corresponding library acquisition

staff automatically by the invoice transfer program, then deleted from server by unix script.

- Problem.alert: Save all error message with related invoice id in this file. In most of time, there is no data in this file. If there are data, Send this file to IS&P, ACQ’s contact staff.

FTP to UAP information: Check with ITS library group.

8. Programming analysis.

8.1 Where to get APD data.

Get all approved invoice data except for line items amount from INVOICE, INVOICE_NOTE, INVOICE_STATUS, VENDOR tables to generate API records. For each invoice record, generate its APD records from following two sources.

(1). Get its all line item’s financial data from INVOICE_LINE_ITEM,

37

INVOICE_LINE_ITEM_FUNDS, FUND tables. If one line item paid by multiple funds, this line item is split to multiple line items with their partial amounts, and their financial data.

(2). Check if each invoice record has its adjustment record, such as shipping fee, tax, discount, credit, etc. If it does, gets its financial data from PRICE_ADJUSTMENT, FUND_PAYMENT, FUND tables.

8.2 The rules to convert foreign currency amount.

Foreign currency amounts are saved in Voyager’s above tables. They need to be converted to US dollars for the invoice transfer file.

(1). Convert “TOTAL” amount from “INVOICE” table for API amount.

(2). Convert each invoice line item amount, and invoice adjustment fee from other tables for APD amount.

(3). Due to math rounding for conversion, the sum of APD is not always equal API for its invoice. The amount needs to be rounded to the cent. There are two rounding, up and down.

(4). The rounding up range of one APD amount is from 0.1 cent to 0.5 cent. For example, $0.669 will be rounded up to $0.67, which has $0.001 difference; $0.665 will be rounded up to $0.67, which has $0.005 difference. If one invoice has 200 APDs, the total rounding up arrange will be from $0.001x200=$0.20 to $0.005x200=$1.00.

(5). The rounding down range of one APD amount is from 0.1 cent to 0.4 cent. For example, $0.661 will be rounded down to $0.66, which has $0.001 difference; $0.664 will be rounded down to $0.66, which has $0.004 difference. If one invoice has 200 APDs, the total rounding down arrange will be from $0.001x200=$0.20 to $0.004x200=$0.80.

(6). In the program, the rounding range, regardless up or down is less than one dollar.

(6). The rounding rules that places in programming is:

38

o If the difference between API amount and sum of APD amount is less than $1.00, API amount will use the sum of APD amount.

o If the difference between API amount and sum of APD amount is greater than $1.00, API amount will remain itself, and write error message into Problem.alert file. The error message is “sum of APD is different from TOTAL of INVOICE table. The batch will be rejected, because of INVOICE_ID=xxxxxx”.

8.3 The impact of Voyager bug on using Voyager tables.

o Voyager “INVOICE_LINE_ITEM_FUNDS” table has bug which is described above at 5.2 section. Because this bug, this table can’t be used for getting all invoice line item amounts, but this table must to be used for some of invoice line item amounts. Here is the points that applied in the programming.

o When should “INVOICE_LINE_ITEM_FUNDS” table be used?

(1). If invoice line item has a single copy, and is paid by multiple funds.

(2). If invoice line item has a single copy, and is paid by one fund.

(3). The bug sometimes causes that there are multiple identical records in this table for only one line item with a single copy.

The programming use “select distinct(INVOICE_LINE_ITEM_FUNDS.FUND_ID)” in the query to avoid getting the extra identical records that are caused by the bug.

o When should “INVOICE_LINE_ITEM” table be used?

(1). If invoice line item has multiple copies, and is paid by one fund.

(2). Because the bug messes up the records in the “INVOICE_LINE_ITEM_FUNDS” table, the programming doesn’t handle the situation that invoice line item has multiple copies, and is paid by multiple funds. If this situation happens, the batch may not be rejected, but

39

fund data is not correct. The error message will be written into “Problem.alert” file: “Multiple copies with multiple funds in one invoice line item, paid fund data is not correct for INV_LINE_ITEM_ID =xxxxxx”

(3). This case should not happen, assumption that Suzanna’s confirmation with Janet Prochownik, and Claire Halloran is correct.

8.4 Create Invoice Transfer Files.

Write data into the temp paying unit’s text files. Read through each temp file to sum its invoice amounts

for header/batch amount. Generate APH record; write APH, API, APD records

into each paying unit’s ‘dat’ files. Delete all temp files.

8.5 Create Invoice Transfer File’s snapshot excel reports.

Use technique POI-HSSF which is Java API To Access Microsoft Excel Format Files. This tool’s jar file “poi-2.5.1-final-20040804.jar” needs to be placed on the compile path.

Send Snapshot Excel Reports via Emails. Use Java Mail function for sending email to the each

paying unit’s responsible staff. This function needs two jar files to be placed on the compile path, mail.jar and activation.jar.

9. Programms summary.

The module name on CVS is “InvoiceTransferJava”. The documentations are located at “edu.yale.library.doc”. This is the Java standalone application that can run on any JVM platforms. It runs

every night of weekdays (Mon – Fri). It creates invoice transfer files, invoice transfer files’ snapshot excel reports. The invoice transfer files will be ftped to Yale Accounts Payable, and the snapshot excel reports will be emailed to library related staff.

There is no input file, and no Voyager API being used in this project. There are a bunch of output files as described above, and they are located at

“/m1/voyager/yaledb/local/ InvoiceTransferJava”. Use Oracle SQL queries to get data from Voager. There is no Java Bean used in this application.

40

Reusable codes are: InitAPI.java, and LoadProperties.java.(1). InitSQL.java:

Initialize connection to Voyager Oracle Database. This is the first mandatory step if you use Oracle sql query to access Voyager tables.

(2). LoadProperties.java: Get data from external properties file. Other java codes can obtain data by calling this class.

(3). MainApplication.java: This is the main class to load other classes.

(4). ProcessInvoiceTransfer.java: Generate proper date formats. Use Oracle SQL queries to get all approved invoice records from Voyager. Separate different paying unit records. Generate API, APD, APH records associated with different paying units. Create paying unit invoice transfer file names, and write associated

records into the their files.(5). CreateSnapShot.java:

Generate proper date formats. Use Oracle SQL queries to get all approved invoice records from Voyager. Separate different paying unit records. Generate snapshot excel records associated with different paying units. Create paying unit excel file names, and write associated records into the

their files. Create one snapshot excel file that includes all invoice records.

(6). External properties file is “Init.properties”. It includes Voyager server data, batch number, email addresses.

10. JAR files.

Files that need to be added in order to make invoice transfer jar file “invoicetransferjava.jar” in NetBeans 3.5:

1. From InvoiceTransferJava.jar:edu folder.query folder.doc folder.

2. From mail.jar:com folder.javax folder.

41

javamail.charset.map of META-INF.javamail.default.address.map of META-INF. javamail.default.providers of META-INF. mailcap of META-INF.

3. From activation.jar:com folder.javax folder.mailcap.default of META-INF.mimetypes.default of META-INF.

4. From poi-2.5.1-final-20040804.jar:org folder.font_metrics.properties.

5. The whole classes12.jar

All jar file need to be placed at compile path.

Create Main-Class: edu.yale.library.MainApplication

42

11. Related documentations.

- ReadMe_InvoiceTransferJava.doc- BilLocGroup.doc- Yale University Accounts Payable Documentation (available as paper print).

12. Contact staff.

IS&P: Melissa Wisner <[email protected]> ACQ: Janet Prochownik <[email protected]> ITS: Gail Barnett <[email protected]> Send screen messages, and Problem.alert file to Melissa Wisner.

43