Merge pull request #16225 from frederic34/facturerec

clean deprecated modelpdf to model_pdf
This commit is contained in:
Laurent Destailleur 2021-02-09 13:23:25 +01:00 committed by GitHub
commit a5386246cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 67 additions and 56 deletions

View File

@ -1630,7 +1630,7 @@ class Propal extends CommonObject
$sql .= " fk_input_reason=".(isset($this->demand_reason_id) ? $this->demand_reason_id : "null").","; $sql .= " fk_input_reason=".(isset($this->demand_reason_id) ? $this->demand_reason_id : "null").",";
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
$sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").","; $sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").",";
$sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null").""; $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null")."";
$sql .= " WHERE rowid=".$this->id; $sql .= " WHERE rowid=".$this->id;

View File

@ -3271,7 +3271,7 @@ class Commande extends CommonOrder
$sql .= " fk_input_reason=".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null").","; $sql .= " fk_input_reason=".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null").",";
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
$sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").","; $sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").",";
$sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null").""; $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null")."";
$sql .= " WHERE rowid=".$this->id; $sql .= " WHERE rowid=".$this->id;
@ -3921,7 +3921,7 @@ class Commande extends CommonOrder
if (!empty($this->model_pdf)) { if (!empty($this->model_pdf)) {
$modele = $this->model_pdf; $modele = $this->model_pdf;
} elseif (!empty($this->modelpdf)) { // dperecated } elseif (!empty($this->modelpdf)) { // deprecated
$modele = $this->modelpdf; $modele = $this->modelpdf;
} elseif (!empty($conf->global->COMMANDE_ADDON_PDF)) { } elseif (!empty($conf->global->COMMANDE_ADDON_PDF)) {
$modele = $conf->global->COMMANDE_ADDON_PDF; $modele = $conf->global->COMMANDE_ADDON_PDF;

View File

@ -14,7 +14,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014-2019 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014-2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -280,7 +280,7 @@ class FactureRec extends CommonInvoice
$sql .= ", ".(!empty($facsrc->remise) ? $this->remise : '0'); $sql .= ", ".(!empty($facsrc->remise) ? $this->remise : '0');
$sql .= ", ".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL"); $sql .= ", ".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL");
$sql .= ", ".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL"); $sql .= ", ".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL");
$sql .= ", ".(!empty($this->modelpdf) ? ("'".$this->db->escape($this->modelpdf)."'") : "NULL"); $sql .= ", ".(!empty($this->model_pdf) ? ("'".$this->db->escape($this->model_pdf)."'") : "NULL");
$sql .= ", '".$this->db->escape($user->id)."'"; $sql .= ", '".$this->db->escape($user->id)."'";
$sql .= ", ".(!empty($facsrc->fk_project) ? "'".$this->db->escape($facsrc->fk_project)."'" : "null"); $sql .= ", ".(!empty($facsrc->fk_project) ? "'".$this->db->escape($facsrc->fk_project)."'" : "null");
$sql .= ", ".(!empty($facsrc->fk_account) ? "'".$this->db->escape($facsrc->fk_account)."'" : "null"); $sql .= ", ".(!empty($facsrc->fk_account) ? "'".$this->db->escape($facsrc->fk_account)."'" : "null");
@ -347,7 +347,7 @@ class FactureRec extends CommonInvoice
{ {
// Extrafields // Extrafields
if (method_exists($facsrc->lines[$i], 'fetch_optionals')) { if (method_exists($facsrc->lines[$i], 'fetch_optionals')) {
$facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid); $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->id);
$objectline->array_options = $facsrc->lines[$i]->array_options; $objectline->array_options = $facsrc->lines[$i]->array_options;
} }
@ -562,7 +562,7 @@ class FactureRec extends CommonInvoice
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->user_author = $obj->fk_user_author; $this->user_author = $obj->fk_user_author;
$this->modelpdf = $obj->model_pdf; // deprecatd $this->modelpdf = $obj->model_pdf; // deprecated
$this->model_pdf = $obj->model_pdf; $this->model_pdf = $obj->model_pdf;
$this->rang = $obj->rang; $this->rang = $obj->rang;
$this->special_code = $obj->special_code; $this->special_code = $obj->special_code;
@ -1280,9 +1280,8 @@ class FactureRec extends CommonInvoice
{ {
// We refresh the object in order to have all necessary data (like date_lim_reglement) // We refresh the object in order to have all necessary data (like date_lim_reglement)
$facture->fetch($facture->id); $facture->fetch($facture->id);
$result = $facture->generateDocument($facturerec->modelpdf, $langs); $result = $facture->generateDocument($facturerec->model_pdf, $langs);
if ($result <= 0) if ($result <= 0) {
{
$this->errors = $facture->errors; $this->errors = $facture->errors;
$this->error = $facture->error; $this->error = $facture->error;
$error++; $error++;
@ -1873,7 +1872,7 @@ class FactureRec extends CommonInvoice
dol_syslog(get_class($this)."::setModelPdf", LOG_DEBUG); dol_syslog(get_class($this)."::setModelPdf", LOG_DEBUG);
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$this->modelpdf = $model; $this->model_pdf = $model;
return 1; return 1;
} else { } else {
dol_print_error($this->db); dol_print_error($this->db);

View File

@ -498,7 +498,7 @@ class Facture extends CommonInvoice
$this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_project; $this->fk_project = GETPOST('projectid', 'int') > 0 ? ((int) GETPOST('projectid', 'int')) : $_facrec->fk_project;
$this->note_public = GETPOST('note_public', 'none') ? GETPOST('note_public', 'restricthtml') : $_facrec->note_public; $this->note_public = GETPOST('note_public', 'none') ? GETPOST('note_public', 'restricthtml') : $_facrec->note_public;
$this->note_private = GETPOST('note_private', 'none') ? GETPOST('note_private', 'restricthtml') : $_facrec->note_private; $this->note_private = GETPOST('note_private', 'none') ? GETPOST('note_private', 'restricthtml') : $_facrec->note_private;
$this->modelpdf = GETPOST('model', 'alpha') ? GETPOST('model', 'alpha') : $_facrec->modelpdf; $this->model_pdf = GETPOST('model', 'alpha') ? GETPOST('model', 'alpha') : $_facrec->model_pdf;
$this->cond_reglement_id = GETPOST('cond_reglement_id', 'int') > 0 ? ((int) GETPOST('cond_reglement_id', 'int')) : $_facrec->cond_reglement_id; $this->cond_reglement_id = GETPOST('cond_reglement_id', 'int') > 0 ? ((int) GETPOST('cond_reglement_id', 'int')) : $_facrec->cond_reglement_id;
$this->mode_reglement_id = GETPOST('mode_reglement_id', 'int') > 0 ? ((int) GETPOST('mode_reglement_id', 'int')) : $_facrec->mode_reglement_id; $this->mode_reglement_id = GETPOST('mode_reglement_id', 'int') > 0 ? ((int) GETPOST('mode_reglement_id', 'int')) : $_facrec->mode_reglement_id;
$this->fk_account = GETPOST('fk_account') > 0 ? ((int) GETPOST('fk_account')) : $_facrec->fk_account; $this->fk_account = GETPOST('fk_account') > 0 ? ((int) GETPOST('fk_account')) : $_facrec->fk_account;
@ -1062,8 +1062,8 @@ class Facture extends CommonInvoice
$facture->note_public = $this->note_public; $facture->note_public = $this->note_public;
$facture->note_private = $this->note_private; $facture->note_private = $this->note_private;
$facture->ref_client = $this->ref_client; $facture->ref_client = $this->ref_client;
$facture->modelpdf = $this->modelpdf; // deprecated $facture->modelpdf = $this->model_pdf; // deprecated
$facture->model_pdf = $this->modelpdf; $facture->model_pdf = $this->model_pdf;
$facture->fk_project = $this->fk_project; $facture->fk_project = $this->fk_project;
$facture->cond_reglement_id = $this->cond_reglement_id; $facture->cond_reglement_id = $this->cond_reglement_id;
$facture->mode_reglement_id = $this->mode_reglement_id; $facture->mode_reglement_id = $this->mode_reglement_id;
@ -3370,8 +3370,8 @@ class Facture extends CommonInvoice
} }
$this->line->id = $rowid; $this->line->id = $rowid;
$this->line->rowid = $rowid; $this->line->rowid = $rowid;
$this->line->label = $label; $this->line->label = $label;
$this->line->desc = $desc; $this->line->desc = $desc;
$this->line->ref_ext = $ref_ext; $this->line->ref_ext = $ref_ext;
$this->line->qty = ($this->type == self::TYPE_CREDIT_NOTE ?abs($qty) : $qty); // For credit note, quantity is always positive and unit price negative $this->line->qty = ($this->type == self::TYPE_CREDIT_NOTE ?abs($qty) : $qty); // For credit note, quantity is always positive and unit price negative
@ -3732,7 +3732,7 @@ class Facture extends CommonInvoice
} }
if (!empty($addon)) { if (!empty($addon)) {
dol_syslog("Call getNextNumRef with ".$addonConstName." = ".$conf->global->FACTURE_ADDON.", thirdparty=".$soc->nom.", type=".$soc->typent_code, LOG_DEBUG); dol_syslog("Call getNextNumRef with ".$addonConstName." = ".$conf->global->FACTURE_ADDON.", thirdparty=".$soc->name.", type=".$soc->typent_code, LOG_DEBUG);
$mybool = false; $mybool = false;

View File

@ -119,7 +119,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$fac->generateDocument($fac->modelpdf, $outputlangs); $fac->generateDocument($fac->model_pdf, $outputlangs);
} }
} }

View File

@ -425,7 +425,7 @@ class Paiement extends CommonObject
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret = $invoice->fetch($facid); // Reload to get new records $ret = $invoice->fetch($facid); // Reload to get new records
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs); $result = $invoice->generateDocument($invoice->model_pdf, $outputlangs);
if ($result < 0) { if ($result < 0) {
setEventMessages($invoice->error, $invoice->errors, 'errors'); setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++; $error++;

View File

@ -304,7 +304,7 @@ if (!$error && $massaction == 'confirm_presend')
if ($_POST['addmaindocfile']) if ($_POST['addmaindocfile'])
{ {
// TODO Use future field $objectobj->fullpathdoc to know where is stored default file // TODO Use future field $objectobj->fullpathdoc to know where is stored default file
// TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc. // TODO If not defined, use $objectobj->model_pdf (or defaut invoice config) to know what is template to use to regenerate doc.
$filename = dol_sanitizeFileName($objectobj->ref).'.pdf'; $filename = dol_sanitizeFileName($objectobj->ref).'.pdf';
$subdir = ''; $subdir = '';
// TODO Set subdir to be compatible with multi levels dir trees // TODO Set subdir to be compatible with multi levels dir trees
@ -1281,7 +1281,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread)
if (empty($hideref)) $hideref = 0; if (empty($hideref)) $hideref = 0;
if (empty($moreparams)) $moreparams = null; if (empty($moreparams)) $moreparams = null;
$result = $objecttmp->generateDocument($objecttmp->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); $result = $objecttmp->generateDocument($objecttmp->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
if ($result <= 0) if ($result <= 0)
{ {

View File

@ -55,6 +55,11 @@ abstract class CommonDocGenerator
*/ */
public $extrafieldsCache; public $extrafieldsCache;
/**
* @var int If set to 1, save the fullname of generated file with path as the main doc when generating a doc with this template.
*/
public $update_main_doc_field;
/** /**
* Constructor * Constructor
* *

View File

@ -355,6 +355,13 @@ abstract class CommonObject
*/ */
public $model_pdf; public $model_pdf;
/**
* @var string
* @deprecated
* @see model_pdf
*/
public $modelpdf;
/** /**
* @var string * @var string
* Contains relative path of last generated main file * Contains relative path of last generated main file

View File

@ -175,7 +175,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
if ($regenerate || !dol_is_file($filename)) if ($regenerate || !dol_is_file($filename))
{ {
if ($usestdout) print "Build PDF for invoice ".$obj->ref." - Lang = ".$outputlangs->defaultlang."\n"; if ($usestdout) print "Build PDF for invoice ".$obj->ref." - Lang = ".$outputlangs->defaultlang."\n";
$result = $fac->generateDocument($regenerate ? $regenerate : $fac->modelpdf, $outputlangs); $result = $fac->generateDocument($regenerate ? $regenerate : $fac->model_pdf, $outputlangs);
} else { } else {
if ($usestdout) print "PDF for invoice ".$obj->ref." already exists\n"; if ($usestdout) print "PDF for invoice ".$obj->ref." already exists\n";
} }

View File

@ -581,7 +581,7 @@ class Expedition extends CommonObject
$this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed $this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed
$this->fk_delivery_address = $obj->fk_address; $this->fk_delivery_address = $obj->fk_address;
$this->model_pdf = $obj->model_pdf; $this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf; // deprecated
$this->shipping_method_id = $obj->fk_shipping_method; $this->shipping_method_id = $obj->fk_shipping_method;
$this->shipping_method = $obj->shipping_method; $this->shipping_method = $obj->shipping_method;
$this->tracking_number = $obj->tracking_number; $this->tracking_number = $obj->tracking_number;
@ -1116,7 +1116,7 @@ class Expedition extends CommonObject
$sql .= " weight=".(($this->trueWeight != '') ? $this->trueWeight : "null").","; $sql .= " weight=".(($this->trueWeight != '') ? $this->trueWeight : "null").",";
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
$sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").","; $sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").",";
$sql .= " entity=".$conf->entity; $sql .= " entity=".$conf->entity;
$sql .= " WHERE rowid=".$this->id; $sql .= " WHERE rowid=".$this->id;

View File

@ -1699,13 +1699,13 @@ class SupplierProposal extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED : (empty($this->modelpdf) ? '' : $this->modelpdf); $modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED : (empty($this->model_pdf) ? '' : $this->model_pdf);
$triggerName = 'PROPOSAL_SUPPLIER_CLOSE_REFUSED'; $triggerName = 'PROPOSAL_SUPPLIER_CLOSE_REFUSED';
if ($status == 2) if ($status == 2)
{ {
$triggerName = 'PROPOSAL_SUPPLIER_CLOSE_SIGNED'; $triggerName = 'PROPOSAL_SUPPLIER_CLOSE_SIGNED';
$modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL : (empty($this->modelpdf) ? '' : $this->modelpdf); $modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL : (empty($this->model_pdf) ? '' : $this->model_pdf);
if (!empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists if (!empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists
{ {

View File

@ -200,56 +200,56 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$localobject->date_lim_reglement = dol_now() + 3600 * 24 *30; $localobject->date_lim_reglement = dol_now() + 3600 * 24 *30;
// Crabe (english) // Crabe (english)
$localobject->modelpdf='crabe'; $localobject->model_pdf='crabe';
$result = $localobject->generateDocument($localobject->modelpdf, $langs); $result = $localobject->generateDocument($localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
// Crabe (japanese) // Crabe (japanese)
$newlangs1=new Translate("", $conf); $newlangs1=new Translate("", $conf);
$newlangs1->setDefaultLang('ja_JP'); $newlangs1->setDefaultLang('ja_JP');
$localobject->modelpdf='crabe'; $localobject->model_pdf='crabe';
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs1); $result = $localobject->generateDocument($localobject->model_pdf, $newlangs1);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
// Crabe (saudiarabia) // Crabe (saudiarabia)
$newlangs2a=new Translate("", $conf); $newlangs2a=new Translate("", $conf);
$newlangs2a->setDefaultLang('sa_SA'); $newlangs2a->setDefaultLang('sa_SA');
$localobject->modelpdf='crabe'; $localobject->model_pdf='crabe';
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs2a); $result = $localobject->generateDocument($localobject->model_pdf, $newlangs2a);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
// Crabe (english_saudiarabia) // Crabe (english_saudiarabia)
$newlangs2b=new Translate("", $conf); $newlangs2b=new Translate("", $conf);
$newlangs2b->setDefaultLang('en_SA'); $newlangs2b->setDefaultLang('en_SA');
$localobject->modelpdf='crabe'; $localobject->model_pdf='crabe';
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs2b); $result = $localobject->generateDocument($localobject->model_pdf, $newlangs2b);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
// Crabe (greek) // Crabe (greek)
$newlangs3=new Translate("", $conf); $newlangs3=new Translate("", $conf);
$newlangs3->setDefaultLang('el_GR'); $newlangs3->setDefaultLang('el_GR');
$localobject->modelpdf='crabe'; $localobject->model_pdf='crabe';
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs3); $result = $localobject->generateDocument($localobject->model_pdf, $newlangs3);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
// Crabe (chinese) // Crabe (chinese)
$newlangs4=new Translate("", $conf); $newlangs4=new Translate("", $conf);
$newlangs4->setDefaultLang('zh_CN'); $newlangs4->setDefaultLang('zh_CN');
$localobject->modelpdf='crabe'; $localobject->model_pdf='crabe';
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs4); $result = $localobject->generateDocument($localobject->model_pdf, $newlangs4);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
// Crabe (russian) // Crabe (russian)
$newlangs5=new Translate("", $conf); $newlangs5=new Translate("", $conf);
$newlangs5->setDefaultLang('ru_RU'); $newlangs5->setDefaultLang('ru_RU');
$localobject->modelpdf='crabe'; $localobject->model_pdf='crabe';
$result = $localobject->generateDocument($localobject->modelpdf, $newlangs5); $result = $localobject->generateDocument($localobject->model_pdf, $newlangs5);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
@ -274,8 +274,8 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
// Canelle // Canelle
$localobject->modelpdf='canelle'; $localobject->model_pdf='canelle';
$result = $localobject->generateDocument($localobject->modelpdf, $langs); $result = $localobject->generateDocument($localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
@ -301,8 +301,8 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
// Einstein // Einstein
$localobject->modelpdf='einstein'; $localobject->model_pdf='einstein';
$result = $localobject->generateDocument($localobject->modelpdf, $langs); $result = $localobject->generateDocument($localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
@ -329,8 +329,8 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
// Muscadet // Muscadet
$localobject->modelpdf='muscadet'; $localobject->model_pdf='muscadet';
$result= $localobject->generateDocument($localobject->modelpdf, $langs); $result= $localobject->generateDocument($localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
@ -356,8 +356,8 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
// Azur // Azur
$localobject->modelpdf='azur'; $localobject->model_pdf='azur';
$result = $localobject->generateDocument($localobject->modelpdf, $langs); $result = $localobject->generateDocument($localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
@ -382,8 +382,8 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
// Baleine // Baleine
$localobject->modelpdf='baleine'; $localobject->model_pdf='baleine';
$result = $localobject->generateDocument($localobject->modelpdf, $langs); $result = $localobject->generateDocument($localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
@ -409,8 +409,8 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
// Soleil // Soleil
$localobject->modelpdf='soleil'; $localobject->model_pdf='soleil';
$result=fichinter_create($db, $localobject, $localobject->modelpdf, $langs); $result=fichinter_create($db, $localobject, $localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
@ -436,15 +436,15 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
// Merou // Merou
$localobject->modelpdf='merou'; $localobject->model_pdf='merou';
$result= $localobject->generateDocument($localobject->modelpdf, $langs); $result= $localobject->generateDocument($localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
// Rouget // Rouget
$localobject->modelpdf='rouget'; $localobject->model_pdf='rouget';
$result= $localobject->generateDocument($localobject->modelpdf, $langs); $result= $localobject->generateDocument($localobject->model_pdf, $langs);
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";