Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
b601a87a2a
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -27,19 +27,23 @@
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
// langs
|
||||
$langs->load("bills");
|
||||
$langs->load("compta");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
|
||||
$account_parent = GETPOST('account_parent');
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
$search_ref = GETPOST('search_ref','alpha');
|
||||
$search_facture = GETPOST('search_facture','alpha');
|
||||
$search_label = GETPOST('search_label','alpha');
|
||||
$search_desc = GETPOST('search_desc','alpha');
|
||||
$search_amount = GETPOST('search_amount','alpha');
|
||||
$search_acount = GETPOST('search_account','alpha');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
@ -49,13 +53,18 @@ if (! $user->rights->accounting->ventilation->dispatch)
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
// change account
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref='';
|
||||
$search_facture='';
|
||||
$search_label='';
|
||||
$search_desc='';
|
||||
$search_amount='';
|
||||
$search_account='';
|
||||
}
|
||||
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
|
||||
$is_search = GETPOST('button_search_x');
|
||||
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search)) {
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
@ -110,17 +119,20 @@ $sql .= " AND aa.rowid = l.fk_code_ventilation";
|
||||
if (strlen(trim(GETPOST("search_facture")))) {
|
||||
$sql .= " AND f.facnumber like '%" . GETPOST("search_facture") . "%'";
|
||||
}
|
||||
if (strlen(trim(GETPOST("search_ref")))) {
|
||||
$sql .= " AND p.ref like '%" . GETPOST("search_ref") . "%'";
|
||||
if (strlen(trim($search_ref))) {
|
||||
$sql .= " AND p.ref like '%" . $search_ref . "%'";
|
||||
}
|
||||
if (strlen(trim(GETPOST("search_label")))) {
|
||||
$sql .= " AND p.label like '%" . GETPOST("search_label") . "%'";
|
||||
if (strlen(trim($search_label))) {
|
||||
$sql .= " AND p.label like '%" . $search_label . "%'";
|
||||
}
|
||||
if (strlen(trim(GETPOST("search_desc")))) {
|
||||
$sql .= " AND l.description like '%" . GETPOST("search_desc") . "%'";
|
||||
if (strlen(trim($search_desc))) {
|
||||
$sql .= " AND l.description like '%" . $search_desc . "%'";
|
||||
}
|
||||
if (strlen(trim(GETPOST("search_account")))) {
|
||||
$sql .= " AND aa.account_number like '%" . GETPOST("search_account") . "%'";
|
||||
if (strlen(trim($search_amount))) {
|
||||
$sql .= " AND l.total_ht like '%" . $search_amount . "%'";
|
||||
}
|
||||
if (strlen(trim($search_account))) {
|
||||
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
||||
}
|
||||
|
||||
if (! empty($conf->multicompany->enabled)) {
|
||||
@ -161,18 +173,17 @@ if ($result) {
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . GETPOST("search_facture") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . GETPOST("search_ref") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . GETPOST("search_label") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . GETPOST("search_desc") . '"></td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . GETPOST("search_account") . '"></td>';
|
||||
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $search_facture . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_amount" value="' . $search_amount. '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" alt="' . $langs->trans("Search") . '">';
|
||||
print '</td>';
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
$facture_static = new Facture($db);
|
||||
$product_static = new Product($db);
|
||||
@ -180,7 +191,7 @@ if ($result) {
|
||||
$var = True;
|
||||
while ( $objp = $db->fetch_object($result) ) {
|
||||
$var = ! $var;
|
||||
$codeCompta = $objp->account_number . ' ' . $objp->label;
|
||||
$codecompta = $objp->account_number . ' ' . $objp->label;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
@ -202,8 +213,8 @@ if ($result) {
|
||||
|
||||
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
|
||||
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
|
||||
print '<td align="left">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="left">' . $codeCompta . '</td>';
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="left">' . $codecompta . '</td>';
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
print '<td><a href="./card.php?id=' . $objp->rowid . '">';
|
||||
print img_edit();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -26,34 +26,46 @@
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
|
||||
$account_parent = GETPOST('account_parent');
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
$search_ref = GETPOST('search_ref','alpha');
|
||||
$search_facture = GETPOST('search_facture','alpha');
|
||||
$search_label = GETPOST('search_label','alpha');
|
||||
$search_desc = GETPOST('search_desc','alpha');
|
||||
$search_amount = GETPOST('search_amount','alpha');
|
||||
$search_acount = GETPOST('search_account','alpha');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->ventilation->dispatch)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref='';
|
||||
$search_facture='';
|
||||
$search_label='';
|
||||
$search_desc='';
|
||||
$search_amount='';
|
||||
$search_account='';
|
||||
}
|
||||
|
||||
$is_search = GETPOST('button_search_x');
|
||||
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search)) {
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
@ -83,7 +95,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && empty($is_search))
|
||||
|
||||
llxHeader('', $langs->trans("SuppliersVentilation") . ' - ' . $langs->trans("Dispatched"));
|
||||
|
||||
$page = $_GET["page"];
|
||||
$page = GETPOST("page");
|
||||
if ($page < 0)
|
||||
$page = 0;
|
||||
|
||||
@ -105,20 +117,23 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||
$sql .= " AND aa.rowid = l.fk_code_ventilation";
|
||||
if (strlen(trim($_GET["search_facture"]))) {
|
||||
$sql .= " AND f.ref like '%" . $_GET["search_facture"] . "%'";
|
||||
if (strlen(trim($search_facture))) {
|
||||
$sql .= " AND f.ref like '%" . $search_facture . "%'";
|
||||
}
|
||||
if (strlen(trim($_GET["search_ref"]))) {
|
||||
$sql .= " AND p.ref like '%" . $_GET["search_ref"] . "%'";
|
||||
if (strlen(trim($search_ref))) {
|
||||
$sql .= " AND p.ref like '%" . $search_ref . "%'";
|
||||
}
|
||||
if (strlen(trim($_GET["search_label"]))) {
|
||||
$sql .= " AND p.label like '%" . $_GET["search_label"] . "%'";
|
||||
if (strlen(trim($search_label))) {
|
||||
$sql .= " AND p.label like '%" . $search_label . "%'";
|
||||
}
|
||||
if (strlen(trim($_GET["search_desc"]))) {
|
||||
$sql .= " AND l.description like '%" . $_GET["search_desc"] . "%'";
|
||||
if (strlen(trim($search_desc))) {
|
||||
$sql .= " AND l.description like '%" . $search_desc . "%'";
|
||||
}
|
||||
if (strlen(trim($_GET["search_account"]))) {
|
||||
$sql .= " AND aa.account_number like '%" . $_GET["search_account"] . "%'";
|
||||
if (strlen(trim($search_amount))) {
|
||||
$sql .= " AND l.total_ht like '%" . $search_amount . "%'";
|
||||
}
|
||||
if (strlen(trim($search_account))) {
|
||||
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
||||
}
|
||||
if (! empty($conf->multicompany->enabled)) {
|
||||
$sql .= " AND f.entity = '" . $conf->entity . "'";
|
||||
@ -159,18 +174,17 @@ if ($result) {
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $_GET["search_facture"] . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . GETPOST("search_ref") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . GETPOST("search_label") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . GETPOST("search_desc") . '"></td>';
|
||||
print '<td align="right"> </td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . GETPOST("search_account") . '"></td>';
|
||||
print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="' . $search_facture . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_amount" value="' . $search_amount . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" alt="' . $langs->trans("Search") . '">';
|
||||
print '</td>';
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
$facturefournisseur_static = new FactureFournisseur($db);
|
||||
$product_static = new Product($db);
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -604,6 +605,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
||||
global $conf;
|
||||
|
||||
if (! is_object($objsoc)) $valueforccc=$objsoc;
|
||||
else if($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=$objsoc->code_fournisseur;
|
||||
else $valueforccc=$objsoc->code_client;
|
||||
|
||||
// Clean parameters
|
||||
|
||||
@ -152,7 +152,7 @@ abstract class ModelNumRefExpedition
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @deprecated Use the new function generateDocument of Expedition class
|
||||
*/
|
||||
function expedition_pdf_create(DoliDB $db, Expedition $object, $modele, $outputlangs)
|
||||
function expedition_pdf_create(DoliDB $db, Expedition $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
return $object->generateDocument($modele, $outputlangs);
|
||||
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
@ -406,7 +406,7 @@ if (empty($reshook))
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs);
|
||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db,$result);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
@ -1639,13 +1639,16 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Cree un bon d'expedition sur disque
|
||||
* Create a document onto disk accordign to template module.
|
||||
*
|
||||
* @param string $modele Force le modele a utiliser ('' to not force)
|
||||
* @param Translate $outputlangs Objet lang a utiliser pour traduction
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @param string $modele Force the model to using ('' to not force)
|
||||
* @param Translate $outputlangs object lang to use for translations
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @return int 0 if KO, 1 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs)
|
||||
public function generateDocument($modele, $outputlangs,$hidedetails=0, $hidedesc=0, $hideref=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
@ -1668,7 +1671,7 @@ class Expedition extends CommonObject
|
||||
|
||||
$this->fetch_origin();
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, 0, 0, 0);
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user