gs1_128.js

This object decode a GS1-128 code bar and return each IA found in the bar code as an associative array

 

To include this library in your app, just add this code to your app source code in beas, between the "_header()" and "_footer()":

<script src="assets21/js/gs1_128.js"></script>

 

Object members

Method Summary


decode

decode( bc )

Decode a GS1-128 barcode

getdate

getdate( yymmdd )

Format the barcode date as a date with the format YYYY-MM-DD

 

 

 

 

 

Method Detail


decode

decode( bc )

Decode a GS1-128 bar-code and return an associative array with all IA detected and the values for them

 

Parameters:

{string} bc

 

Returns:

{associative array}

 

Example

getdate

getdate( yymmdd )

Format the bar-code date as a date with the format YYYY-MM-DD

 

Parameters:

{string} yymmdd

 

 

Returns:

{string}

The date with the format YYYY-MM-DD

 

Example

 

 

 

Additional Info

 

This is the list of AI supported by this object

AI

Description

Type

Length

00

Serial Shipping Container Code (SSCC)

string

18

01

Global Trade Item Number (GTIN) ( Item Code )

number

14

02

GTIN of Contained Trade Items

number

14

10

Batch/Lot Number (DistNumber)

string

1-20

11

Production Date

date

6

12

Due Date

date

6

13

Packaging Date

date

6

15

Best Before Date (YYMMDD)

date

6

17

Expiration Date

date

6

20

Product Variant

numeric

2

21

Serial Number

string

1-20

22

Secondary Data Fields

string

1-20

240

Additional Product Identification

string

1-30

241

Customer Part Number

string

1-30

250

Secondary Serial Number

string

1-30

30

Count of items

number

1-8

310n-369n

Other information about the item

string

1-6

37

Number of Units Contained

string

1-8

390n

Amount payable (local currency)

string

1-15

391n

Amount payable (with ISO currency code)

string

3-8

392n

Amount payable per single item (local currency)

string

1-15

393n

Amount payable per single item (with ISO currency code)

string

3-18

400

Customer Purchase Order Number

string

1-30

401

Consignment Number

string

1-30

402

Bill of Lading

number

17

403

Routing code

string

1-30

410

Ship To/Deliver To Location Code (Global Location Number)

number

13

411

Bill To/Invoice Location Code (Global Location Number)

number

13

412

Purchase From Location Code (Global Location Number)

number

13

413

Ship for, Deliver for, or Forward to Location Code (Global Location Number)

number

13

414

Identification of a physical location (Global Location Number)

number

13

420

Ship To/Deliver To Postal Code (Single Postal Authority)

string

1-20

421

Ship To/Deliver To Postal Code (with ISO country code)

string

3-15

422

Country of Origin (ISO country code)

string

3

423

Country or countries of initial processing

string

3-15

424

Country of processing

string

3

425

Country of disassembly

string

3

426

Country of full process chain

string

3

7001

NATO Stock Number (NSN)

string

13

7002

UN/ECE Meat Carcasses and cuts classification

string

1-30

7003

expiration date and time

string

10

703x

Processor approval (with ISO country code); n indicates sequence number of several processors

string

3-30

8001

Roll Products: Width/Length/Core Diameter/Direction/Splices

string

14

8002

Mobile phone identifier        

string

1-20

8003

Global Returnable Asset Identifier

string

14-30

8004

Global Individual Asset Identifier

string

1-30

8005

Price per Unit of Measure

string

6

8006

identification of the components of an item

string

18

8007

International Bank Account Number

string

1-30

8008

Date/time of production

string

8-12

8018

Global Service Relationship Number

string

18

8020

Payment slip reference

string

1-25

8100

Coupon Extended Code: Number System and Offer

string

6

8101

Coupon Extended Code: Number System, Offer, End of Offer

string

10

8102

Coupon Extended Code: Number System preceded by 0

string

2

90

Mutually Agreed Between Trading Partners

string

1-30

91-99

Internal Company Codes

string

 

x