Jump to content

scanner lettre suivie


Recommended Posts

Pour ma part j'ai ceci: https://www.amazon.fr/gp/product/B00IOGSZ04/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

 

pas de module, tu configure la douchette au départ, après tu l'utilise dans ton bo, mais sur ton ordi dans excel ou autres.

 

un gains de temps rapide quand tu fait 2000 lettres/mois.

 

A noter que la douchette doit pouvoir scanner un certain type de code pour les lettres suivie, mais je ne sais plus lequel.

Et ma douchette est sans fil, pratique aussi.

A+

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
  • 7 months later...
  • 2 weeks later...
On 29/12/2017 at 11:49 AM, jd440 said:

tu ouvre ta commande en B-O

Tu te met sur le champ de suivi

 

Cela signifie qu'il faut ouvrir chaque commande sur le BO ? Dans ce cas à quoi sert la douchette ? Mon but est justement de ne pas à avoir à aller dans le BO !

Link to comment
Share on other sites

  • 1 month later...

Hello,

J'ai testé le bout de code dans PDFGenerator.php mais aucun code barre n'arrive sur la facture.

Je suis sur prestashop 1.6.1, il y peut-être quelque chose à rajouter ?

Sinon pour les nouveaux il y a une promo sur cette douchette (15 € de réduc) https://www.amazon.fr/gp/product/B075XKWG9M/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1

Edit : je me rends compte que cela vient du fait que le code concerne les BL et non les factures > comment gérer cela pour les factures ?

Merci =)

Edited by dkbane (see edit history)
Link to comment
Share on other sites

27 minutes ago, okom3pom said:

 

Lol je viens justement de tomber sur cet article ^^

Le souci doit être ailleurs : cela ne marche toujours pas sur la facture, j'ai donc testé sur le bon de livraison mais idem, rien ne s'affiche et mon logo est toujours là.

Edit : j'ouvre pourtant bien le fichier deliveries.pdf !

 

Edited by dkbane (see edit history)
Link to comment
Share on other sites

6 hours ago, okom3pom said:

Colle ton fichier dans la balise code tu as du mettre le d(); au mauvais endroit.

 

Je me retrouve avec le message END (page blanche, juste END).

J'ai "codé" comme ceci :

    /**
     * @see TCPDF::Header()
     */
    public function Header()
	    {
d($this->filename);

 

Link to comment
Share on other sites

<?php
/**
 * 2007-2016 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 *  @author 	PrestaShop SA <[email protected]>
 *  @copyright  2007-2016 PrestaShop SA
 *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 *  International Registered Trademark & Property of PrestaShop SA
 */

require_once(_PS_TOOL_DIR_.'tcpdf/config/lang/eng.php');
require_once(_PS_TOOL_DIR_.'tcpdf/tcpdf.php');

/**
 * @since 1.5
 */
class PDFGeneratorCore extends TCPDF
{
    const DEFAULT_FONT = 'helvetica';

    public $header;
    public $footer;
    public $pagination;
    public $content;
    public $font;

    public $font_by_lang = array(
        'ja' => 'cid0jp',
        'bg' => 'freeserif',
        'ru' => 'freeserif',
        'uk' => 'freeserif',
        'mk' => 'freeserif',
        'el' => 'freeserif',
        'en' => 'dejavusans',
        'vn' => 'dejavusans',
        'pl' => 'dejavusans',
        'ar' => 'dejavusans',
        'fa' => 'dejavusans',
        'fr' => 'dejavusans',
        'ur' => 'dejavusans',
        'az' => 'dejavusans',
        'ca' => 'dejavusans',
        'gl' => 'dejavusans',
        'hr' => 'dejavusans',
        'sr' => 'dejavusans',
        'si' => 'dejavusans',
        'cs' => 'dejavusans',
        'sk' => 'dejavusans',
        'ka' => 'dejavusans',
        'he' => 'dejavusans',
        'lo' => 'dejavusans',
        'lt' => 'dejavusans',
        'lv' => 'dejavusans',
        'tr' => 'dejavusans',
        'ko' => 'cid0kr',
        'zh' => 'cid0cs',
        'tw' => 'cid0cs',
        'th' => 'freeserif'
    );

    /**
     * @param bool $use_cache
     * @param string $orientation
     */
    public function __construct($use_cache = false, $orientation = 'P')
    {
        parent::__construct($orientation, 'mm', 'A4', true, 'UTF-8', $use_cache, false);
        $this->setRTL(Context::getContext()->language->is_rtl);
    }

    /**
     * set the PDF encoding
     *
     * @param string $encoding
     */
    public function setEncoding($encoding)
    {
        $this->encoding = $encoding;
    }

    /**
     *
     * set the PDF header
     *
     * @param string $header HTML
     */
    public function createHeader($header)
    {
        $this->header = $header;
    }

    /**
     *
     * set the PDF footer
     *
     * @param string $footer HTML
     */
    public function createFooter($footer)
    {
        $this->footer = $footer;
    }

    /**
     *
     * create the PDF content
     *
     * @param string $content HTML
     */
    public function createContent($content)
    {
        $this->content = $content;
    }

    /**
     *
     * create the PDF pagination
     *
     * @param string $pagination HTML
     */
    public function createPagination($pagination)
    {
        $this->pagination = $pagination;
    }

    /**
     * Change the font
     *
     * @param string $iso_lang
     */
    public function setFontForLang($iso_lang)
    {
        if (array_key_exists($iso_lang, $this->font_by_lang)) {
            $this->font = $this->font_by_lang[$iso_lang];
        }else {
            $this->font = 'dejavusans';
        }

        $this->setHeaderFont(array($this->font, '', PDF_FONT_SIZE_MAIN, '', false));
        $this->setFooterFont(array($this->font, '', PDF_FONT_SIZE_MAIN, '', false));

        $this->setFont($this->font, '', PDF_FONT_SIZE_MAIN, '', false);
    }

    /**
     * @see TCPDF::Header()
     */
    public function Header()
	    {
d($this->filename);
		$style = array(
	'position' => '',
	'align' => 'C',
	'stretch' => false,
	'fitwidth' => true,
	'cellfitalign' => '',
	'border' => true,
	'hpadding' => 'auto',
	'vpadding' => 'auto',
	'fgcolor' => array(0,0,0),
	'bgcolor' => false, //array(255,255,255),
	'text' => true,
	'font' => 'helvetica',
	'fontsize' => 8,
	'stretchtext' => 4
		);
		
		if( $this->filename == 'deliveries.pdf' || substr($this->filename,0,3) == '#LI'  ) {
		   $this->write1DBarcode($this->id_customer.' '.$this->id_order, 'C128', '', '', '', 18, 0.4, $style, 'N');
		} else {		
		   $this->writeHTML($this->header);
		}	
    }


    /**
     * @see TCPDF::Footer()
     */
    public function Footer()
    {
        $this->writeHTML($this->footer);
        $this->FontFamily = self::DEFAULT_FONT;
        $this->writeHTML($this->pagination);
    }

    /**
     * Render HTML template
     * @param string $filename
     * @param bool $display true:display to user, false:save, 'I','D','S' as fpdf display
     * @throws PrestaShopException
     *
     * @return string HTML rendered
     */
    public function render($filename, $display = true)
    {
        if (empty($filename)) {
            throw new PrestaShopException('Missing filename.');
        }

        $this->lastPage();

        if ($display === true) {
            $output = 'D';
        } elseif ($display === false) {
            $output = 'S';
        } elseif ($display == 'D') {
            $output = 'D';
        } elseif ($display == 'S') {
            $output = 'S';
        } elseif ($display == 'F') {
            $output = 'F';
        } else {
            $output = 'I';
        }

        return $this->output($filename, $output);
    }

    /**
     * Write a PDF page
     */
    public function writePage()
    {
        $this->SetHeaderMargin(5);
        $this->SetFooterMargin(21);
        $this->setMargins(10, 40, 10);
        $this->AddPage();
        $this->writeHTML($this->content, true, false, true, false, '');
    }

    /**
     * Override of TCPDF::getRandomSeed() - getmypid() is blocked on several hosting
    */
    protected function getRandomSeed($seed = '')
    {
        $seed .= microtime();

        if (function_exists('openssl_random_pseudo_bytes') && (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) {
            // this is not used on windows systems because it is very slow for a know bug
            $seed .= openssl_random_pseudo_bytes(512);
        } else {
            for ($i = 0; $i < 23; ++$i) {
                $seed .= uniqid('', true);
            }
        }

        $seed .= uniqid('', true);
        $seed .= rand();
        $seed .= __FILE__;
        $seed .= $this->bufferlen;

        if (isset($_SERVER['REMOTE_ADDR'])) {
            $seed .= $_SERVER['REMOTE_ADDR'];
        }
        if (isset($_SERVER['HTTP_USER_AGENT'])) {
            $seed .= $_SERVER['HTTP_USER_AGENT'];
        }
        if (isset($_SERVER['HTTP_ACCEPT'])) {
            $seed .= $_SERVER['HTTP_ACCEPT'];
        }
        if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
            $seed .= $_SERVER['HTTP_ACCEPT_ENCODING'];
        }
        if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
            $seed .= $_SERVER['HTTP_ACCEPT_LANGUAGE'];
        }
        if (isset($_SERVER['HTTP_ACCEPT_CHARSET'])) {
            $seed .= $_SERVER['HTTP_ACCEPT_CHARSET'];
        }

        $seed .= rand();
        $seed .= uniqid('', true);
        $seed .= microtime();

        return $seed;
    }
}

Et voici =)

Link to comment
Share on other sites

J'ai essayé de 3 manières :

- de commandes ayant le statut "préparation en cours" via le BO (pour bien avoir deliveries.pdf et non une commande isolée)

- d'une commande ayant le statut "préparation en cours" via le BO

- via store********* pour ne pas les citer

 

C'est désespérant lol: aucun module payant à prix raisonnable ne propose cela (le seul qui est dispo ne fonctionne pas), ce script ne fonctionne pas, et j'ai tout le reste qui est prêt pour "doucher" mes envois :(

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...