Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2019-06-29 02:04:16 +02:00
commit d71330c00b
16 changed files with 264 additions and 184 deletions

View File

@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("accountancy")); $langs->loadLangs(array("accountancy"));
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$search_mvt_num = GETPOST('search_mvt_num', 'int'); $search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_type = GETPOST("search_doc_type", 'alpha');
@ -97,8 +99,9 @@ $pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC"; if ($sortorder == "") $sortorder = "ASC";
if ($sortfield == "") $sortfield = "t.piece_num,t.rowid"; if ($sortfield == "") $sortfield = "t.piece_num,t.rowid";
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new BookKeeping($db); $object = new BookKeeping($db);
$hookmanager->initHooks(array('bookkeepinglist'));
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
$formother = new FormOther($db); $formother = new FormOther($db);
@ -160,6 +163,12 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.let
if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
@ -298,7 +307,7 @@ if (! empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code; $filter['t.lettering_code'] = $search_lettering_code;
$param .= '&search_lettering_code=' . urlencode($search_lettering_code); $param .= '&search_lettering_code=' . urlencode($search_lettering_code);
} }
}
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) { if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
@ -527,6 +536,11 @@ $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste" width="100%">'; print '<table class="tagtable liste" width="100%">';
@ -635,6 +649,13 @@ if (! empty($arrayfields['t.code_journal']['checked']))
{ {
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>'; print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
} }
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation // Date creation
if (! empty($arrayfields['t.date_creation']['checked'])) if (! empty($arrayfields['t.date_creation']['checked']))
{ {
@ -695,6 +716,10 @@ if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arr
if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
// Hook fields
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['t.date_export']['checked'])) print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
@ -796,6 +821,11 @@ if ($num > 0)
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Creation operation date // Creation operation date
if (! empty($arrayfields['t.date_creation']['checked'])) if (! empty($arrayfields['t.date_creation']['checked']))
{ {
@ -853,10 +883,15 @@ if ($num > 0)
elseif ($totalarray['totalcreditfield'] == $i) print '<td class="right">'.price($totalarray['totalcredit']).'</td>'; elseif ($totalarray['totalcreditfield'] == $i) print '<td class="right">'.price($totalarray['totalcredit']).'</td>';
else print '<td></td>'; else print '<td></td>';
} }
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</tr>'; print '</tr>';
} }
} }
print "</table>"; print "</table>";
print '</div>'; print '</div>';

View File

@ -1616,10 +1616,13 @@ class Propal extends CommonObject
* Load array lines * Load array lines
* *
* @param int $only_product Return only physical products * @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for products
*
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function fetch_lines($only_product = 0) public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
{ {
global $langs, $conf;
// phpcs:enable // phpcs:enable
$this->lines=array(); $this->lines=array();
@ -1713,6 +1716,13 @@ class Propal extends CommonObject
$line->fetch_optionals(); $line->fetch_optionals();
// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}
$this->lines[$i] = $line; $this->lines[$i] = $line;
//dol_syslog("1 ".$line->fk_product); //dol_syslog("1 ".$line->fk_product);
//print "xx $i ".$this->lines[$i]->fk_product; //print "xx $i ".$this->lines[$i]->fk_product;

View File

@ -1888,10 +1888,12 @@ class Commande extends CommonOrder
* Load array lines * Load array lines
* *
* @param int $only_product Return only physical products * @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for products
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function fetch_lines($only_product = 0) public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
{ {
global $langs, $conf;
// phpcs:enable // phpcs:enable
$this->lines=array(); $this->lines=array();
@ -1984,6 +1986,13 @@ class Commande extends CommonOrder
$line->fetch_optionals(); $line->fetch_optionals();
// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}
$this->lines[$i] = $line; $this->lines[$i] = $line;
$i++; $i++;

View File

@ -1467,10 +1467,14 @@ class Facture extends CommonInvoice
/** /**
* Load all detailed lines into this->lines * Load all detailed lines into this->lines
* *
* @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for products
*
* @return int 1 if OK, < 0 if KO * @return int 1 if OK, < 0 if KO
*/ */
public function fetch_lines() public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
{ {
global $langs, $conf;
// phpcs:enable // phpcs:enable
$this->lines=array(); $this->lines=array();
@ -1560,6 +1564,13 @@ class Facture extends CommonInvoice
$line->fetch_optionals(); $line->fetch_optionals();
// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}
$this->lines[$i] = $line; $this->lines[$i] = $line;
$i++; $i++;

View File

@ -716,10 +716,14 @@ class Contrat extends CommonObject
* Load lines array into this->lines. * Load lines array into this->lines.
* This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed * This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed
* *
* @param int $only_product Return only physical products
* @param int $loadalsotranslation Return translation for products
*
* @return ContratLigne[] Return array of contract lines * @return ContratLigne[] Return array of contract lines
*/ */
public function fetch_lines() public function fetch_lines($only_product = 0, $loadalsotranslation = 0)
{ {
global $langs, $conf;
// phpcs:enable // phpcs:enable
$this->nbofserviceswait=0; $this->nbofserviceswait=0;
$this->nbofservicesopened=0; $this->nbofservicesopened=0;
@ -829,6 +833,13 @@ class Contrat extends CommonObject
// fetch optionals attributes and labels // fetch optionals attributes and labels
$line->fetch_optionals(); $line->fetch_optionals();
// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}
$this->lines[$pos] = $line; $this->lines[$pos] = $line;
$this->lines_id_index_mapper[$line->id] = $pos; $this->lines_id_index_mapper[$line->id] = $pos;

View File

@ -27,7 +27,7 @@ $maxsizestring=255;
$maxsizeint=10; $maxsizeint=10;
$mesg=array(); $mesg=array();
$extrasize=GETPOST('size', 'int'); $extrasize=GETPOST('size', 'intcomma');
$type=GETPOST('type', 'alpha'); $type=GETPOST('type', 'alpha');
$param=GETPOST('param', 'alpha'); $param=GETPOST('param', 'alpha');

View File

@ -1645,7 +1645,10 @@ class ExtraFields
elseif ($type == 'double') elseif ($type == 'double')
{ {
if (!empty($value)) { if (!empty($value)) {
$value=price($value); //$value=price($value);
$sizeparts = explode(",", $size);
$number_decimals = $sizeparts[1];
$value=price($value, 0, $langs, 0, 0, $number_decimals, '');
} }
} }
elseif ($type == 'boolean') elseif ($type == 'boolean')

View File

@ -27,7 +27,7 @@
/** /**
* \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php * \file htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
* \ingroup commande * \ingroup commande
* \brief File of the class allowing to generate the orders to the Eratosthene model * \brief File of Class to generate PDF orders with template Eratosthène
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
@ -149,13 +149,13 @@ class pdf_eratosthene extends ModelePDFCommandes
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
$this->option_logo = 1; // Affiche logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement $this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Affiche conditions reglement $this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Dispo en plusieurs langues $this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Affiche si il y a eu escompte $this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes $this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text $this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -25,7 +25,7 @@
/** /**
* \file htdocs/core/modules/commande/doc/pdf_proforma.modules.php * \file htdocs/core/modules/commande/doc/pdf_proforma.modules.php
* \ingroup commande * \ingroup commande
* \brief Fichier de la classe permettant de generer les commandes au modele Proforma * \brief File of Class to generate PDF orders with template Proforma
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_einstein.modules.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_einstein.modules.php';
@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/** /**
* Classe permettant de generer les commandes au modele Proforma * Class to generate PDF orders with template Proforma
*/ */
class pdf_proforma extends pdf_einstein class pdf_proforma extends pdf_einstein
{ {

View File

@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011 Fabrice CHERRIER * Copyright (C) 2011 Fabrice CHERRIER
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* *
@ -144,12 +144,12 @@ class pdf_strato extends ModelePDFContract
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
$this->option_logo = 1; // Affiche logo $this->option_logo = 1; // Display logo
$this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 0; // Affiche mode reglement $this->option_modereg = 0; // Display payment mode
$this->option_condreg = 0; // Affiche conditions reglement $this->option_condreg = 0; // Display payment terms
$this->option_codeproduitservice = 0; // Affiche code produit-service $this->option_codeproduitservice = 0; // Display product-service code
$this->option_multilang = 0; // Dispo en plusieurs langues $this->option_multilang = 0; // Available in several languages
$this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->option_draft_watermark = 1; // Support add of a watermark on drafts
// Get source company // Get source company

View File

@ -23,7 +23,7 @@
/** /**
* \file htdocs/core/modules/expedition/doc/pdf_merou.modules.php * \file htdocs/core/modules/expedition/doc/pdf_merou.modules.php
* \ingroup expedition * \ingroup expedition
* \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Merou * \brief Class file used to generate the dispatch slips for the Merou model
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
@ -134,7 +134,7 @@ class pdf_merou extends ModelePdfExpedition
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
$this->option_logo = 1; $this->option_logo = 1; // Display logo
// Get source company // Get source company
$this->emetteur=$mysoc; $this->emetteur=$mysoc;

View File

@ -23,7 +23,7 @@
/** /**
* \file htdocs/core/modules/expedition/doc/pdf_rouget.modules.php * \file htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
* \ingroup expedition * \ingroup expedition
* \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Rouget * \brief Class file used to generate the dispatch slips for the Rouget model
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
@ -133,7 +133,7 @@ class pdf_rouget extends ModelePdfExpedition
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
$this->option_logo = 1; $this->option_logo = 1; // Display logo
// Get source company // Get source company
$this->emetteur=$mysoc; $this->emetteur=$mysoc;

View File

@ -160,13 +160,13 @@ class pdf_crabe extends ModelePDFFactures
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
$this->option_logo = 1; // Affiche logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement $this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Affiche conditions reglement $this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Dispo en plusieurs langues $this->option_multilang = 1; // Available in several languages
$this->option_escompte = 1; // Affiche si il y a eu escompte $this->option_escompte = 1; // Displays if there has been a discount
$this->option_credit_note = 1; // Support credit notes $this->option_credit_note = 1; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text $this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -160,13 +160,13 @@ class pdf_sponge extends ModelePDFFactures
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
$this->option_logo = 1; // Affiche logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement $this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Affiche conditions reglement $this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Dispo en plusieurs langues $this->option_multilang = 1; // Available in several languages
$this->option_escompte = 1; // Affiche si il y a eu escompte $this->option_escompte = 1; // Displays if there has been a discount
$this->option_credit_note = 1; // Support credit notes $this->option_credit_note = 1; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text $this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -235,6 +235,7 @@ if ($id > 0 || ! empty($ref))
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
if ($objp->type == Facture::TYPE_CREDIT_NOTE) $objp->qty=-($objp->qty);
$total_ht+=$objp->total_ht; $total_ht+=$objp->total_ht;
$total_qty+=$objp->qty; $total_qty+=$objp->qty;

View File

@ -595,7 +595,7 @@ if ($sql_select)
print '</td>'; print '</td>';
//print '<td class="left">'.$prodreftxt.'</td>'; //print '<td class="left">'.$prodreftxt.'</td>';
if ($type_element == 'invoice' && $objp->doc_type == Facture::TYPE_CREDIT_NOTE) $objp->prod_qty=-($objp->prod_qty);
print '<td class="right">'.$objp->prod_qty.'</td>'; print '<td class="right">'.$objp->prod_qty.'</td>';
$total_qty+=$objp->prod_qty; $total_qty+=$objp->prod_qty;