public function loadDeposit(Deposit $deposit) { $vars = []; $vars['wtVersion'] = $deposit->getShipment()->getDBParams()->getVersion(); $vars['afMode'] = $deposit->getPostageMethod() == Shipment::POSTAGE_METHOD_MA ? 'MA' : ($deposit->getPostageMethod() == Shipment::POSTAGE_METHOD_POST_PAID ? 'PP' : ($deposit->getPostageMethod() == Shipment::POSTAGE_METHOD_CE_MONO || $deposit->getPostageMethod() == Shipment::POSTAGE_METHOD_CE_MULTI ? 'CE' : 'CE')); $vars['deposeNumber'] = $deposit->getNumber(); $vars['coclicoFacturation'] = $deposit->getSiteParams()->getContractor()->getBilling()->getCOCLICO(); $vars['coclicoContactant'] = $deposit->getSiteParams()->getContractor()->getCOCLICO(); $vars['coclicoDeposant'] = $deposit->getSiteParams()->getDepositor()->getCOCLICO(); $today = date("d/m/Y"); $vars['depositLabel'] = 'DEPOT ' . $deposit->getSiteParams()->getContractor()->getCorpName() . ' du ' . $today; $vars['depositSite'] = $deposit->getSiteParams()->getEstablishment()->getS3CCode(); $vars['prodCom'] = $deposit->getProduct()->getProductCode(); $vars['noMachine'] = $deposit->getSiteParams()->getMANumber(); $vars['noCtrProduct'] = $deposit->getSiteParams()->getContractor()->getPostageContractNumber(); $vars['coclicoEmeteur'] = $deposit->getSiteParams()->getContractor()->getCOCLICO(); $vars['codeProd'] = '2L'; $vars['suivAccount'] = $deposit->getSiteParams()->getContractor()->getPostageAccountNumber(); $vars['socName'] = $deposit->getSiteParams()->getContractor()->getCorpName(); $vars['socAdd'] = $deposit->getSiteParams()->getContractor()->getAddress(); $vars['socCP'] = $deposit->getSiteParams()->getContractor()->getPostalCode(); $vars['socCity'] = $deposit->getSiteParams()->getContractor()->getCity(); $vars['socTel'] = $deposit->getSiteParams()->getContractor()->getPhone(); $vars['socMail'] = $deposit->getSiteParams()->getContractor()->getMail(); $vars['envelops'] = $deposit->getEnveloppes()->getEnvelopes(); $blade = $this->getBlade(); return $blade->view()->make('webserviceslip', $vars); }
public function loadDeposit(Deposit $deposit) { $this->deposit = $deposit; $this->modifySheet('CONTACTOR_NAME', $deposit->getSiteParams()->getContractor()->getCorpName()); $this->modifySheet('CONTACTOR_COCLICO', $deposit->getSiteParams()->getContractor()->getCOCLICO()); $this->modifySheet('CONTACTOR_CONTRACT', $deposit->getSiteParams()->getContractor()->getPostageContractNumber()); $this->modifySheet('CONTACTOR_ACCOUNT', $deposit->getSiteParams()->getContractor()->getPostageAccountNumber()); $this->modifySheet('CONTACTOR_PHONE', $deposit->getSiteParams()->getContractor()->getPhone()); $this->modifySheet('CONTACTOR_ADDRESS', $deposit->getSiteParams()->getContractor()->getAddress()); $this->modifySheet('CONTACTOR_CP', $deposit->getSiteParams()->getContractor()->getPostalCode()); $this->modifySheet('CONTACTOR_CITY', $deposit->getSiteParams()->getContractor()->getCity()); $this->modifySheet('CONTACTOR_MAIL', $deposit->getSiteParams()->getContractor()->getMail()); if ($deposit->getSiteParams()->getContractor()->getBilling()->getCOCLICO() != $deposit->getSiteParams()->getContractor()->getCOCLICO()) { $this->modifySheet('CONTACTOR_BILL_COCLICO', $deposit->getSiteParams()->getContractor()->getBilling()->getCOCLICO()); } $this->modifySheet('DEPOSITOR_NAME', $deposit->getSiteParams()->getDepositor()->getCorpName()); $this->modifySheet('DEPOSITOR_COCLICO', $deposit->getSiteParams()->getDepositor()->getCOCLICO()); $this->modifySheet('DEPOSITOR_PHONE', $deposit->getSiteParams()->getDepositor()->getPhone()); $this->modifySheet('DEPOSITOR_ADDRESS', $deposit->getSiteParams()->getDepositor()->getAddress()); $this->modifySheet('DEPOSITOR_CP', $deposit->getSiteParams()->getDepositor()->getPostalCode()); $this->modifySheet('DEPOSITOR_CITY', $deposit->getSiteParams()->getDepositor()->getCity()); $this->modifySheet('ETABLISHMENT_LABEL', $deposit->getSiteParams()->getEstablishment()->getLabel()); $this->modifySheet('ETABLISHMENT_CODE', $deposit->getSiteParams()->getEstablishment()->getS3CCode()); $today = date("d/m/Y"); $this->modifySheet('DEPOSIT_DATE', $today); $this->modifySheet('DEPOSIT_TIME', date('H:i')); $this->modifySheet('DEPOSIT_NUMBER', $deposit->getNumber()); $this->modifySheet('DEPOSIT_LABEL', 'DEPOT ' . $deposit->getSiteParams()->getContractor()->getCorpName() . ' du ' . $today); if ($deposit->getPostageMethod() == Shipment::POSTAGE_METHOD_MA) { $this->modifySheet('DEPOSIT_MODE_MA', 'X'); $this->modifySheet('DEPOSIT_MA_NUMBER', $deposit->getSiteParams()->getMANumber()); } $product = $deposit->getProduct(); if ($product !== false) { switch ($product->getProductCode()) { case '75': $this->modifySheet('PRODUCT_SUIVI', 'X'); break; } } $this->modifySheet('ENVELOPS_NUMBER', $deposit->getEnveloppes()->count()); $path = $this->writeDatamatrix($deposit); }