<?php

require __DIR__ . '/../vendor/autoload.php';
use YellowCube\Config;
$service = new YellowCube\Service(Config::testConfig());
$response = $service->getYCCustomerOrderStatus(5523);
var_dump($response);
assert($response->isSuccess(), 'Getting status for order failed.');
echo "Successfully retrieved status for order with reference " . $response->getReference();
<?php

require __DIR__ . '/../../../../../../vendor/autoload.php';
### "create-article"
use YellowCube\ART\Article;
use YellowCube\ART\ChangeFlag;
use YellowCube\ART\UnitsOfMeasure\ISO;
$article = new Article();
$article->setChangeFlag(ChangeFlag::INSERT)->setPlantID('Y012')->setDepositorNo('0000040750')->setArticleNo('47686-3009-35/38')->setBaseUOM(ISO::PCE)->setNetWeight(0.042, ISO::KGM)->setAlternateUnitISO(ISO::PCE)->addArticleDescription('Ich wars nicht.', 'de');
### "insert-article"
$service = new YellowCube\Service(YellowCube\Config::testConfig());
$response = $service->insertArticleMasterData($article);
echo "Successfully added article with reference {$response->getReference()}." . PHP_EOL . PHP_EOL;
print_r($response);
<?php

require __DIR__ . '/../vendor/autoload.php';
use YellowCube\Config;
$service = new YellowCube\Service(Config::testConfig());
$articleList = $service->getInventory();
var_dump($articleList);
assert(count($articleList), 'Getting inventory failed.');
echo "Successfully retrieved " . count($articleList) . " articles from inventory.";
<?php

require __DIR__ . '/../vendor/autoload.php';
use YellowCube\Config;
$service = new YellowCube\Service(Config::testConfig());
$response = $service->getInsertArticleMasterDataStatus(5522);
var_dump($response);
assert($response->isSuccess(), 'Getting status for article failed.');
echo "Successfully retrieved status for article with reference " . $response->getReference();
use YellowCube\WAB\AdditionalService\DeliveryTimeJIT;
use YellowCube\WAB\AdditionalService\DeliveryTimeTo;
use YellowCube\WAB\AdditionalService\FloorNo;
use YellowCube\WAB\AdditionalService\FrightShippingFlag;
use YellowCube\WAB\AdditionalService\NotificationServiceCode;
use YellowCube\WAB\AdditionalService\NotificationType;
use YellowCube\WAB\Order;
use YellowCube\WAB\OrderHeader;
use YellowCube\WAB\Partner;
use YellowCube\WAB\Position;
### "order-header"
$order = new Order();
$order->setOrderHeader(new OrderHeader('0000040730', \uniqid('yc'), date('Ymd')));
### "partner-address"
$partner = new Partner();
$partner->setPartnerType('WE')->setPartnerNo('0000300020')->setPartnerReference('LiiP AG')->setTitle('Madame')->setName1('We Name')->setName2('c/o Cailler')->setStreet('Strasse')->setCountryCode('CH')->setZIPCode('8057')->setCity('Zurich')->setPOBox('po box')->setPhoneNo('0041793020467')->setSMSAvisMobNo('0041793020467')->setFaxNo('0041793020467')->setEmail('*****@*****.**')->setLanguageCode('en');
$order->setPartnerAddress($partner);
### "order-position"
$position = new Position();
$position->setPosNo(10)->setArticleNo('200522004')->setEAN('714718003580')->setPlant('Y010')->setQuantity(1.0)->setQuantityISO('PCE')->setShortDescription('loral Pasty Daisie');
$order->addOrderPosition($position);
### "order-document"
$exampleDocument = YellowCube\WAB\Doc::fromFile('LS', 'pdf', '../../../../../order/example-file.pdf');
$order->addOrderDocument($exampleDocument);
### "additional-services"
$order->addValueAddedService(new AdditionalShippingServices())->addValueAddedService(new BasicShippingServices(BasicShippingServices::ECO))->addValueAddedService(new DeliveryInstructions('ZAW3219;ZAW3222'))->addValueAddedService(new DeliveryLocation('Last house in the street.'))->addValueAddedService(new DeliveryPeriodeCode(DeliveryPeriodeCode::MORNING))->addValueAddedService(new DeliveryTimeFrom('13:00'))->addValueAddedService(new DeliveryTimeTo('15:00'))->addValueAddedService(new DeliveryTimeJIT('14:00'))->addValueAddedService(new DeliveryDate(date('Ymd', strtotime('+4 days'))))->addValueAddedService(new CODAmount('150.00'))->addValueAddedService(new CODAccountNo('010683242'))->addValueAddedService(new CODRefNo('897201301070000097673'))->addValueAddedService(new FrightShippingFlag('1'))->addValueAddedService(new FloorNo('3'))->addValueAddedService(new NotificationType(NotificationType::EMAIL))->addValueAddedService(new NotificationServiceCode('2'));
### "create-order"
$service = new YellowCube\Service(Config::testConfig());
$response = $service->createYCCustomerOrder($order);
echo "Successfully created order with reference {$response->getReference()}" . PHP_EOL . PHP_EOL;
print_r($response);
<?php

require __DIR__ . '/../../../../../../vendor/autoload.php';
### "order-reply"
$service = new YellowCube\Service(YellowCube\Config::testConfig());
$goodsIssueList = $service->getYCCustomerOrderReply();
foreach ($goodsIssueList as $goodsIssue) {
    $header = $goodsIssue->getCustomerOrderHeader();
    echo "Order number: " . $header->getCustomerOrderNo() . PHP_EOL;
    echo "PostalShipmentNo: " . $header->getPostalShipmentNo() . PHP_EOL;
    foreach ($goodsIssue->getCustomerOrderList() as $orderDetail) {
        echo "\tPosition: " . $orderDetail->getCustomerOrderPosNo();
        echo ", EAN: " . $orderDetail->getEAN();
        echo ", ArticleNo: " . $orderDetail->getArticleNo();
        echo PHP_EOL;
    }
    echo PHP_EOL . PHP_EOL;
}
echo "All information:" . PHP_EOL;
print_r($goodsIssueList);
<?php

require __DIR__ . '/../vendor/autoload.php';
use YellowCube\Config;
$service = new YellowCube\Service(Config::testConfig());
$response = $service->getYCCustomerOrderReply('SOAP-005');
var_dump($response);