2017 © Pedro Peláez
 

library gs1

Support for GS1 system

image

ayeo/gs1

Support for GS1 system

  • Monday, February 1, 2016
  • by ayeo
  • Repository
  • 4 Watchers
  • 2 Stars
  • 4,654 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 5 Versions
  • 10 % Grown

The README.md

GS1 support

Library supports gs1 systems. Provides ability to generate logistic labels and impose usage of valid gs1 objects. All functionality is availaible through Gs1Facade object. Library takes care about generating barcode, sscc numbers and calculating check digits., (*1)

Company and Location objects

Library is delivered only with location and company interfaces. You must use your own objects. That is done for purpose ypu probably want to work with existing classes. Example implementation below:, (*2)

class MyCustomCompany implements CompanyInterface
{
    public function getGcp()
    {
       return new Model\Gcp('123456');
    }

    public function getName()
    {
       return "My Custom Name";
    }


    public function getLocation()
    {
        $location = new MyCustomLocation();
    } 
}
class MyCustomLocation implements LocationInterface
{
    public function getAddress()
    {
        $address = new Model\Address;
        $address->streetName = 'Secret Avenue';
        $address->buildingNumber = 10;
        $address->countryName = "England";
        $address->postcode = 'NG10 5GH';
    }

    public function getLocationNumber()
    {
        return '00';
    }


    public function getTelephoneNumber()
    {
        return '560 560 506';
    }


    public function getFaxNumber()
    {
        return '';
    }


    public function getWebsiteAddress()
    {
        return 'ayeo.pl';
    }
}

Content object

$content = new Model\Content;
$content->setName('test product');
$content->setBatchSymbol('abc12345');
$content->setGrossWeight(2);
$content->setGtin('1234512345123');
$content->setQuantity(120);
$content->setBestBefore(new DateTime);

Example use

$gs1 = new Gs1Facade($company);
$label = $gs1->buildLabel($content, $orderNumber = '000102', $logicticCounter = 232);

Label contains all nessecary data such as SSCC, barcode, GTIN, full company data etc, (*3)

Custom Barcode structure

See code (docs to do), (*4)

The Versions

01/02 2016

dev-master

9999999-dev https://github.com/ayeo/gs1

Support for GS1 system

  Sources   Download

MIT

The Requires

 

The Development Requires

gs1 sscc gcp gln logistic label

01/02 2016

1.1.0

1.1.0.0 https://github.com/ayeo/gs1

Support for GS1 system

  Sources   Download

MIT

The Requires

 

The Development Requires

gs1 sscc gcp gln logistic label

14/06 2015

1.0.3

1.0.3.0 https://github.com/ayeo/gs1

Support for GS1 system

  Sources   Download

MIT

The Requires

 

The Development Requires

gs1 sscc gcp gln logistic label

05/06 2015

1.0.2

1.0.2.0 https://github.com/ayeo/gs1

Support for GS1 system

  Sources   Download

MIT

The Requires

 

The Development Requires

gs1 sscc gcp gln logistic label

28/05 2015

1.0.0

1.0.0.0 https://github.com/ayeo/gs1

Support for GS1 system

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

gs1 sscc gcp gln logistic label