fix: Warning : Invalid argument supplied for foreach()
This commit is contained in:
commit
aa7cd880c0
@ -57,7 +57,6 @@ if ($action == 'update')
|
|||||||
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"],'chaine',0,'',$conf->entity);
|
|
||||||
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
|
||||||
@ -74,7 +73,9 @@ if ($action == 'update')
|
|||||||
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
|
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
|
||||||
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
|
|
||||||
|
// This one is not always defined
|
||||||
|
if (isset($_POST["MAIN_USE_PREVIEW_TABS"])) dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["MAIN_USE_PREVIEW_TABS"],'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
$_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
|
$_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
|
||||||
|
|
||||||
@ -187,7 +188,7 @@ if ($action == 'edit') // Edit
|
|||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
||||||
print $form->selectyesno('main_use_preview_tabs',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
|
print $form->selectyesno('MAIN_USE_PREVIEW_TABS',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -252,16 +253,6 @@ if ($action == 'edit') // Edit
|
|||||||
|
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
/*
|
|
||||||
// Show bugtrack link
|
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
|
|
||||||
print $form->selectyesno('main_show_bugtrack_link',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
|
||||||
|
|
||||||
@ -401,15 +392,6 @@ else // Show
|
|||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
/*
|
|
||||||
// Show bugtrack link
|
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
|
|
||||||
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print "</tr>";
|
|
||||||
*/
|
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|||||||
@ -912,7 +912,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
|
|||||||
0,
|
0,
|
||||||
$fournprice,
|
$fournprice,
|
||||||
$buying_price,
|
$buying_price,
|
||||||
$label
|
$label,
|
||||||
|
$type
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
*
|
*
|
||||||
@ -352,7 +352,7 @@ class Propal extends CommonObject
|
|||||||
// qty, pu, remise_percent et txtva
|
// qty, pu, remise_percent et txtva
|
||||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||||
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
|
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits,$type);
|
||||||
$total_ht = $tabprice[0];
|
$total_ht = $tabprice[0];
|
||||||
$total_tva = $tabprice[1];
|
$total_tva = $tabprice[1];
|
||||||
$total_ttc = $tabprice[2];
|
$total_ttc = $tabprice[2];
|
||||||
@ -463,9 +463,10 @@ class Propal extends CommonObject
|
|||||||
* @param int $fk_fournprice Id supplier price
|
* @param int $fk_fournprice Id supplier price
|
||||||
* @param int $pa_ht Buying price without tax
|
* @param int $pa_ht Buying price without tax
|
||||||
* @param string $label ???
|
* @param string $label ???
|
||||||
|
* @param int $type 0/1=Product/service
|
||||||
* @return int 0 if OK, <0 if KO
|
* @return int 0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='')
|
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0)
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs;
|
global $conf,$user,$langs;
|
||||||
|
|
||||||
@ -491,7 +492,7 @@ class Propal extends CommonObject
|
|||||||
// qty, pu, remise_percent et txtva
|
// qty, pu, remise_percent et txtva
|
||||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||||
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
|
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type);
|
||||||
$total_ht = $tabprice[0];
|
$total_ht = $tabprice[0];
|
||||||
$total_tva = $tabprice[1];
|
$total_tva = $tabprice[1];
|
||||||
$total_ttc = $tabprice[2];
|
$total_ttc = $tabprice[2];
|
||||||
|
|||||||
@ -999,6 +999,7 @@ class Commande extends CommonOrder
|
|||||||
* @param int $fk_parent_line Parent line
|
* @param int $fk_parent_line Parent line
|
||||||
* @param int $fk_fournprice Id supplier price
|
* @param int $fk_fournprice Id supplier price
|
||||||
* @param int $pa_ht Buying price (without tax)
|
* @param int $pa_ht Buying price (without tax)
|
||||||
|
* @param string $label Label
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*
|
*
|
||||||
* @see add_product
|
* @see add_product
|
||||||
@ -1054,7 +1055,7 @@ class Commande extends CommonOrder
|
|||||||
// qty, pu, remise_percent et txtva
|
// qty, pu, remise_percent et txtva
|
||||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||||
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
|
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits,$type);
|
||||||
$total_ht = $tabprice[0];
|
$total_ht = $tabprice[0];
|
||||||
$total_tva = $tabprice[1];
|
$total_tva = $tabprice[1];
|
||||||
$total_ttc = $tabprice[2];
|
$total_ttc = $tabprice[2];
|
||||||
@ -2159,6 +2160,7 @@ class Commande extends CommonOrder
|
|||||||
* @param int $skip_update_total Skip update of total
|
* @param int $skip_update_total Skip update of total
|
||||||
* @param int $fk_fournprice Id supplier price
|
* @param int $fk_fournprice Id supplier price
|
||||||
* @param int $pa_ht Buying price (without tax)
|
* @param int $pa_ht Buying price (without tax)
|
||||||
|
* @param string $label Label
|
||||||
* @return int < 0 if KO, > 0 if OK
|
* @return int < 0 if KO, > 0 if OK
|
||||||
*/
|
*/
|
||||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='')
|
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='')
|
||||||
@ -2192,7 +2194,7 @@ class Commande extends CommonOrder
|
|||||||
// qty, pu, remise_percent et txtva
|
// qty, pu, remise_percent et txtva
|
||||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||||
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
|
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type);
|
||||||
$total_ht = $tabprice[0];
|
$total_ht = $tabprice[0];
|
||||||
$total_tva = $tabprice[1];
|
$total_tva = $tabprice[1];
|
||||||
$total_ttc = $tabprice[2];
|
$total_ttc = $tabprice[2];
|
||||||
@ -2682,7 +2684,7 @@ class Commande extends CommonOrder
|
|||||||
$line->total_ht=100;
|
$line->total_ht=100;
|
||||||
$line->total_ttc=119.6;
|
$line->total_ttc=119.6;
|
||||||
$line->total_tva=19.6;
|
$line->total_tva=19.6;
|
||||||
$line->remise_percent=00;
|
$line->remise_percent=0;
|
||||||
}
|
}
|
||||||
$prodid = rand(1, $num_prods);
|
$prodid = rand(1, $num_prods);
|
||||||
$line->fk_product=$prodids[$prodid];
|
$line->fk_product=$prodids[$prodid];
|
||||||
@ -2841,6 +2843,7 @@ class OrderLine
|
|||||||
var $localtax2_tx; // Local tax 2
|
var $localtax2_tx; // Local tax 2
|
||||||
var $subprice; // U.P. HT (example 100)
|
var $subprice; // U.P. HT (example 100)
|
||||||
var $remise_percent; // % for line discount (example 20%)
|
var $remise_percent; // % for line discount (example 20%)
|
||||||
|
var $fk_remise_except;
|
||||||
var $rang = 0;
|
var $rang = 0;
|
||||||
var $fk_fournprice;
|
var $fk_fournprice;
|
||||||
var $pa_ht;
|
var $pa_ht;
|
||||||
@ -2848,6 +2851,7 @@ class OrderLine
|
|||||||
var $marque_tx;
|
var $marque_tx;
|
||||||
var $info_bits = 0; // Bit 0: 0 si TVA normal - 1 si TVA NPR
|
var $info_bits = 0; // Bit 0: 0 si TVA normal - 1 si TVA NPR
|
||||||
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
|
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
|
||||||
|
var $special_code = 0;
|
||||||
var $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
|
var $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
|
||||||
var $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
|
var $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
|
||||||
var $total_localtax1; // Total local tax 1 for the line
|
var $total_localtax1; // Total local tax 1 for the line
|
||||||
|
|||||||
@ -24,8 +24,11 @@
|
|||||||
include '../../main.inc.php';
|
include '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/commissions/lib/commissions.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/commissions/lib/commissions.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
$langs->load("bills");
|
||||||
$langs->load("commissions");
|
$langs->load("commissions");
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
@ -69,6 +72,17 @@ if (GETPOST('serviceCommissionRate'))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GETPOST('AGENT_CONTACT_TYPE'))
|
||||||
|
{
|
||||||
|
if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', GETPOST('AGENT_CONTACT_TYPE'), 'chaine', 0, '', $conf->entity) > 0)
|
||||||
|
{
|
||||||
|
$conf->global->AGENT_CONTACT_TYPE = GETPOST('AGENT_CONTACT_TYPE');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -146,6 +160,18 @@ print '</td>';
|
|||||||
print '<td>'.$langs->trans('ServiceCommissionRateDetails').'</td>';
|
print '<td>'.$langs->trans('ServiceCommissionRateDetails').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td>'.$langs->trans("AgentContactType").'</td>';
|
||||||
|
print '<td align="left">';
|
||||||
|
$formcompany = new FormCompany($db);
|
||||||
|
$facture = new Facture($db);
|
||||||
|
print $formcompany->selectTypeContact($facture, $conf->global->AGENT_CONTACT_TYPE, "AGENT_CONTACT_TYPE","internal","code",1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>'.$langs->trans('AgentContactTypeDetails').'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td align="center" colspan="3">';
|
print '<td align="center" colspan="3">';
|
||||||
@ -153,7 +179,6 @@ print '<input type="submit" class="button" />';
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -134,25 +134,27 @@ print '</td></tr>';
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,";
|
$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,";
|
||||||
$sql.= " u.login,";
|
$sql.= " u.login,";
|
||||||
$sql.= " f.facnumber, f.total as total_ht,";
|
|
||||||
if ($conf->global->COMMISSION_BASE == "MARGIN") {
|
if ($conf->global->COMMISSION_BASE == "MARGIN") {
|
||||||
$sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) end) as productBase," ;
|
$sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) end) as productBase," ;
|
||||||
$sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) else 0 end) as serviceBase," ;
|
$sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) else 0 end) as serviceBase" ;
|
||||||
}
|
}
|
||||||
elseif ($conf->global->COMMISSION_BASE == "TURNOVER") {
|
elseif ($conf->global->COMMISSION_BASE == "TURNOVER") {
|
||||||
$sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) end) as productBase," ;
|
$sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) end) as productBase," ;
|
||||||
$sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) else 0 end) as serviceBase," ;
|
$sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) else 0 end) as serviceBase" ;
|
||||||
}
|
}
|
||||||
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE);
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."user as u";
|
$sql.= ", ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||||
$sql.= " AND sc.fk_soc = f.fk_soc";
|
$sql.= " AND sc.fk_soc = f.fk_soc";
|
||||||
|
if (! empty($conf->global->AGENT_CONTACT_TYPE))
|
||||||
|
$sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))";
|
||||||
|
else
|
||||||
$sql .= " AND sc.fk_user = u.rowid";
|
$sql .= " AND sc.fk_user = u.rowid";
|
||||||
if (GETPOST('unpayed') == 'on')
|
if (GETPOST('unpayed') == 'on')
|
||||||
$sql.= " AND f.fk_statut > 0";
|
$sql.= " AND f.fk_statut > 0";
|
||||||
@ -160,18 +162,24 @@ else
|
|||||||
$sql.= " AND f.fk_statut > 1";
|
$sql.= " AND f.fk_statut > 1";
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
if ($agentid > 0)
|
if ($agentid > 0) {
|
||||||
$sql.= " AND sc.fk_user = $agentid";
|
if (! empty($conf->global->AGENT_CONTACT_TYPE))
|
||||||
|
$sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))";
|
||||||
|
else
|
||||||
|
$sql .= " AND sc.fk_user = ".$agentid;
|
||||||
|
}
|
||||||
if (!empty($startdate))
|
if (!empty($startdate))
|
||||||
$sql.= " AND f.datef >= '".$startdate."'";
|
$sql.= " AND f.datef >= '".$startdate."'";
|
||||||
if (!empty($enddate))
|
if (!empty($enddate))
|
||||||
$sql.= " AND f.datef <= '".$enddate."'";
|
$sql.= " AND f.datef <= '".$enddate."'";
|
||||||
|
if ($conf->global->COMMISSION_BASE == "MARGIN")
|
||||||
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (($conf->global->COMMISSION_BASE == "MARGIN") && isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (($conf->global->COMMISSION_BASE == "MARGIN") && isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql .= " AND d.buy_price_ht <> 0";
|
||||||
if ($agentid > 0)
|
if ($agentid > 0)
|
||||||
$sql.= " GROUP BY s.rowid";
|
$sql.= " GROUP BY s.rowid";
|
||||||
else
|
else
|
||||||
$sql.= " GROUP BY sc.fk_user";
|
$sql.= " GROUP BY u.rowid";
|
||||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|
||||||
@ -219,6 +227,7 @@ if ($result)
|
|||||||
$cumul_base_service = 0;
|
$cumul_base_service = 0;
|
||||||
$cumul_commission_produit = 0;
|
$cumul_commission_produit = 0;
|
||||||
$cumul_commission_service = 0;
|
$cumul_commission_service = 0;
|
||||||
|
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -260,22 +269,22 @@ if ($result)
|
|||||||
// total commission
|
// total commission
|
||||||
print "<td align=\"right\">".price($productCommission + $serviceCommission)."</td>\n";
|
print "<td align=\"right\">".price($productCommission + $serviceCommission)."</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$cumul_base_produit += $productBase;
|
|
||||||
$cumul_base_service += $serviceBase;
|
$cumul_base_produit += round($productBase, $rounding);
|
||||||
$cumul_commission_produit += $productCommission;
|
$cumul_base_service += round($serviceBase, $rounding);
|
||||||
$cumul_commission_service += $serviceCommission;
|
$cumul_commission_produit += round($productCommission, $rounding);
|
||||||
|
$cumul_commission_service += round($serviceCommission, $rounding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// affichage totaux commission
|
// affichage totaux commission
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].' style="border-top: 1px solid #ccc; font-weight: bold">';
|
print '<tr '.$bc[$var].' style="border-top: 1px solid #ccc; font-weight: bold">';
|
||||||
if (! empty($client))
|
|
||||||
print '<td colspan=2>';
|
|
||||||
else
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans('TotalCommission')."</td>";
|
print $langs->trans('Total');
|
||||||
|
print "</td>";
|
||||||
// product commission
|
// product commission
|
||||||
print "<td align=\"right\">".price($cumul_base_produit)."</td>\n";
|
print "<td align=\"right\">".price($cumul_base_produit)."</td>\n";
|
||||||
print "<td align=\"right\">".price((! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:0))."</td>\n";
|
print "<td align=\"right\">".price((! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:0))."</td>\n";
|
||||||
@ -289,6 +298,7 @@ if ($result)
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print "</td>";
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -691,7 +691,7 @@ class Facture extends CommonInvoice
|
|||||||
|
|
||||||
// Possibility to add external linked objects with hooks
|
// Possibility to add external linked objects with hooks
|
||||||
$this->linked_objects[$this->origin] = $this->origin_id;
|
$this->linked_objects[$this->origin] = $this->origin_id;
|
||||||
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
|
if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects))
|
||||||
{
|
{
|
||||||
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
|
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
|
||||||
}
|
}
|
||||||
@ -1330,6 +1330,8 @@ class Facture extends CommonInvoice
|
|||||||
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code;
|
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code;
|
||||||
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_id;
|
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_id;
|
||||||
|
|
||||||
|
$cdr_nbjour=0; $cdr_fdm=0; $cdr_decalage=0;
|
||||||
|
|
||||||
$sqltemp = 'SELECT c.fdm,c.nbjour,c.decalage';
|
$sqltemp = 'SELECT c.fdm,c.nbjour,c.decalage';
|
||||||
$sqltemp.= ' FROM '.MAIN_DB_PREFIX.'c_payment_term as c';
|
$sqltemp.= ' FROM '.MAIN_DB_PREFIX.'c_payment_term as c';
|
||||||
if (is_numeric($cond_reglement)) $sqltemp.= " WHERE c.rowid=".$cond_reglement;
|
if (is_numeric($cond_reglement)) $sqltemp.= " WHERE c.rowid=".$cond_reglement;
|
||||||
@ -1925,7 +1927,7 @@ class Facture extends CommonInvoice
|
|||||||
// qty, pu, remise_percent et txtva
|
// qty, pu, remise_percent et txtva
|
||||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||||
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
|
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type);
|
||||||
$total_ht = $tabprice[0];
|
$total_ht = $tabprice[0];
|
||||||
$total_tva = $tabprice[1];
|
$total_tva = $tabprice[1];
|
||||||
$total_ttc = $tabprice[2];
|
$total_ttc = $tabprice[2];
|
||||||
@ -2063,7 +2065,7 @@ class Facture extends CommonInvoice
|
|||||||
// Calculate total with, without tax and tax from qty, pu, remise_percent and txtva
|
// Calculate total with, without tax and tax from qty, pu, remise_percent and txtva
|
||||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||||
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
|
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type);
|
||||||
$total_ht = $tabprice[0];
|
$total_ht = $tabprice[0];
|
||||||
$total_tva = $tabprice[1];
|
$total_tva = $tabprice[1];
|
||||||
$total_ttc = $tabprice[2];
|
$total_ttc = $tabprice[2];
|
||||||
|
|||||||
@ -24,8 +24,7 @@
|
|||||||
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class CommonInvoice
|
* Superclass for invoices classes
|
||||||
* \brief Superclass for invoices classes
|
|
||||||
*/
|
*/
|
||||||
abstract class CommonInvoice extends CommonObject
|
abstract class CommonInvoice extends CommonObject
|
||||||
{
|
{
|
||||||
|
|||||||
@ -665,7 +665,7 @@ class FormFile
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
|
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
|
||||||
print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>';
|
print '<td align="center">'.dol_print_date($file['date'],"dayhour","tzuser").'</td>';
|
||||||
// Preview
|
// Preview
|
||||||
if (empty($useinecm))
|
if (empty($useinecm))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -47,15 +47,24 @@ function dol_basename($pathfile)
|
|||||||
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
|
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
|
||||||
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
|
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
|
||||||
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
|
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
|
||||||
|
* @param int $nohook Disable all hooks
|
||||||
* @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file')
|
* @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file')
|
||||||
*/
|
*/
|
||||||
function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0)
|
function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter="", $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=false)
|
||||||
{
|
{
|
||||||
global $db, $hookmanager;
|
global $db, $hookmanager;
|
||||||
global $object;
|
global $object;
|
||||||
|
|
||||||
dol_syslog("files.lib.php::dol_dir_list path=".$path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter));
|
dol_syslog("files.lib.php::dol_dir_list path=".$path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter));
|
||||||
|
|
||||||
|
$loaddate=($mode==1||$mode==2)?true:false;
|
||||||
|
$loadsize=($mode==1||$mode==3)?true:false;
|
||||||
|
|
||||||
|
// Clean parameters
|
||||||
|
$path=preg_replace('/([\\/]+)$/i','',$path);
|
||||||
|
$newpath=dol_osencode($path);
|
||||||
|
|
||||||
|
if (! $nohook) {
|
||||||
if (! is_object($hookmanager))
|
if (! is_object($hookmanager))
|
||||||
{
|
{
|
||||||
if (! class_exists('HookManager')) {
|
if (! class_exists('HookManager')) {
|
||||||
@ -66,13 +75,6 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
|||||||
}
|
}
|
||||||
$hookmanager->initHooks(array('fileslib'));
|
$hookmanager->initHooks(array('fileslib'));
|
||||||
|
|
||||||
$loaddate=($mode==1||$mode==2)?true:false;
|
|
||||||
$loadsize=($mode==1||$mode==3)?true:false;
|
|
||||||
|
|
||||||
// Clean parameters
|
|
||||||
$path=preg_replace('/([\\/]+)$/i','',$path);
|
|
||||||
$newpath=dol_osencode($path);
|
|
||||||
|
|
||||||
$parameters=array(
|
$parameters=array(
|
||||||
'path' => $newpath,
|
'path' => $newpath,
|
||||||
'types'=> $types,
|
'types'=> $types,
|
||||||
@ -85,11 +87,12 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
|||||||
'loadsize' => $loadsize
|
'loadsize' => $loadsize
|
||||||
);
|
);
|
||||||
$reshook=$hookmanager->executeHooks('getNodesList', $parameters, $object);
|
$reshook=$hookmanager->executeHooks('getNodesList', $parameters, $object);
|
||||||
|
}
|
||||||
|
|
||||||
// $reshook may contain returns stacked by other modules
|
// $reshook may contain returns stacked by other modules
|
||||||
// $reshook is always empty with an array for can not lose returns stacked with other modules
|
// $reshook is always empty with an array for can not lose returns stacked with other modules
|
||||||
// $hookmanager->resArray may contain array stacked by other modules
|
// $hookmanager->resArray may contain array stacked by other modules
|
||||||
if (! empty($hookmanager->resArray)) // forced to use $hookmanager->resArray even if $hookmanager->resArray['nodes'] is empty
|
if (! $nohook && ! empty($hookmanager->resArray)) // forced to use $hookmanager->resArray even if $hookmanager->resArray['nodes'] is empty
|
||||||
{
|
{
|
||||||
return $hookmanager->resArray['nodes'];
|
return $hookmanager->resArray['nodes'];
|
||||||
}
|
}
|
||||||
@ -512,13 +515,13 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Move a file into another name.
|
* Move a file into another name.
|
||||||
|
* This function differs from dol_move_uploaded_file, because it can be called in any context.
|
||||||
*
|
*
|
||||||
* @param string $srcfile Source file (can't be a directory)
|
* @param string $srcfile Source file (can't be a directory)
|
||||||
* @param string $destfile Destination file (can't be a directory)
|
* @param string $destfile Destination file (can't be a directory)
|
||||||
* @param string $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK)
|
* @param string $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK)
|
||||||
* @param int $overwriteifexists Overwrite file if exists (1 by default)
|
* @param int $overwriteifexists Overwrite file if exists (1 by default)
|
||||||
* @return boolean True if OK, false if KO
|
* @return boolean True if OK, false if KO
|
||||||
* @see dol_move_uploaded_file
|
|
||||||
*/
|
*/
|
||||||
function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
|
||||||
{
|
{
|
||||||
@ -840,6 +843,7 @@ function dol_delete_preview($object)
|
|||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
|
// Define parent dir of elements
|
||||||
$element = $object->element;
|
$element = $object->element;
|
||||||
|
|
||||||
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande';
|
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande';
|
||||||
@ -848,8 +852,7 @@ function dol_delete_preview($object)
|
|||||||
elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending';
|
elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending';
|
||||||
elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt';
|
elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt';
|
||||||
elseif ($object->element == 'fichinter') $dir = $conf->ficheinter->dir_output;
|
elseif ($object->element == 'fichinter') $dir = $conf->ficheinter->dir_output;
|
||||||
else
|
else $dir=empty($conf->$element->dir_output)?'':$conf->$element->dir_output;
|
||||||
$dir = $conf->$element->dir_output;
|
|
||||||
|
|
||||||
if (empty($dir)) return 'ErrorObjectNoSupportedByFunction';
|
if (empty($dir)) return 'ErrorObjectNoSupportedByFunction';
|
||||||
|
|
||||||
@ -898,11 +901,18 @@ function dol_meta_create($object)
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DOC_CREATE_METAFILE)) return 0;
|
if (empty($conf->global->MAIN_DOC_CREATE_METAFILE)) return 0; // By default, no metafile.
|
||||||
|
|
||||||
// Define parent dir of elements
|
// Define parent dir of elements
|
||||||
$element=$object->element;
|
$element=$object->element;
|
||||||
$dir=empty($conf->$element->dir_output)?'':$conf->$element->dir_output;
|
|
||||||
|
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande';
|
||||||
|
elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->dir_output.'/facture';
|
||||||
|
elseif ($object->element == 'project') $dir = $conf->projet->dir_output;
|
||||||
|
elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending';
|
||||||
|
elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt';
|
||||||
|
elseif ($object->element == 'fichinter') $dir = $conf->ficheinter->dir_output;
|
||||||
|
else $dir=empty($conf->$element->dir_output)?'':$conf->$element->dir_output;
|
||||||
|
|
||||||
if ($dir)
|
if ($dir)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4003,7 +4003,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
|||||||
if (verifCond($values[4]))
|
if (verifCond($values[4]))
|
||||||
{
|
{
|
||||||
if ($values[3]) $langs->load($values[3]);
|
if ($values[3]) $langs->load($values[3]);
|
||||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[5]),1);
|
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[5]), 1);
|
||||||
$head[$h][1] = $langs->trans($values[2]);
|
$head[$h][1] = $langs->trans($values[2]);
|
||||||
$head[$h][2] = str_replace('+','',$values[1]);
|
$head[$h][2] = str_replace('+','',$values[1]);
|
||||||
$h++;
|
$h++;
|
||||||
@ -4013,7 +4013,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
|||||||
{
|
{
|
||||||
if ($values[0] != $type) continue;
|
if ($values[0] != $type) continue;
|
||||||
if ($values[3]) $langs->load($values[3]);
|
if ($values[3]) $langs->load($values[3]);
|
||||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[4]),1);
|
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[4]), 1);
|
||||||
$head[$h][1] = $langs->trans($values[2]);
|
$head[$h][1] = $langs->trans($values[2]);
|
||||||
$head[$h][2] = str_replace('+','',$values[1]);
|
$head[$h][2] = str_replace('+','',$values[1]);
|
||||||
$h++;
|
$h++;
|
||||||
@ -4022,7 +4022,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
|||||||
{
|
{
|
||||||
if ($values[0] != $type) continue;
|
if ($values[0] != $type) continue;
|
||||||
if ($values[2]) $langs->load($values[2]);
|
if ($values[2]) $langs->load($values[2]);
|
||||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[3]), 1);
|
||||||
$head[$h][1] = $langs->trans($values[1]);
|
$head[$h][1] = $langs->trans($values[1]);
|
||||||
$head[$h][2] = 'tab'.$values[1];
|
$head[$h][2] = 'tab'.$values[1];
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -1230,7 +1230,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
|
|||||||
if (! $tmpdir) { unset($listofdir[$key]); continue; }
|
if (! $tmpdir) { unset($listofdir[$key]); continue; }
|
||||||
if (is_dir($tmpdir))
|
if (is_dir($tmpdir))
|
||||||
{
|
{
|
||||||
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt');
|
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt','','name',SORT_ASC,0,true); // Disable hook for the moment
|
||||||
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
|
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -267,7 +267,7 @@ function _unval($val)
|
|||||||
{
|
{
|
||||||
// single, escaped unicode character
|
// single, escaped unicode character
|
||||||
$utf16 = chr(hexdec($reg[1])) . chr(hexdec($reg[2]));
|
$utf16 = chr(hexdec($reg[1])) . chr(hexdec($reg[2]));
|
||||||
$utf8 .= utf162utf8($utf16);
|
$utf8 = utf162utf8($utf16);
|
||||||
$val=preg_replace('/\\\u'.$reg[1].$reg[2].'/i',$utf8,$val);
|
$val=preg_replace('/\\\u'.$reg[1].$reg[2].'/i',$utf8,$val);
|
||||||
}
|
}
|
||||||
return $val;
|
return $val;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.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
|
||||||
@ -58,7 +58,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1
|
|||||||
// TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller.
|
// TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller.
|
||||||
if ($localtax1_type == '?')
|
if ($localtax1_type == '?')
|
||||||
{
|
{
|
||||||
if ($mysoc->country_code=='ES') $localtax1_type='1';
|
if ($mysoc->country_code=='ES') $localtax1_type='3';
|
||||||
else $localtax1_type='0';
|
else $localtax1_type='0';
|
||||||
}
|
}
|
||||||
if ($localtax2_type == '?')
|
if ($localtax2_type == '?')
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
*/
|
*/
|
||||||
function check_user_password_http($usertotest,$passwordtotest,$entitytotest)
|
function check_user_password_http($usertotest,$passwordtotest,$entitytotest)
|
||||||
{
|
{
|
||||||
dol_syslog("functions_http::check_user_password_http _SERVER[REMOTE_USER]=".$_SERVER["REMOTE_USER"]);
|
dol_syslog("functions_http::check_user_password_http _SERVER[REMOTE_USER]=".(empty($_SERVER["REMOTE_USER"])?'':$_SERVER["REMOTE_USER"]));
|
||||||
|
|
||||||
$login='';
|
$login='';
|
||||||
if (! empty($_SERVER["REMOTE_USER"]))
|
if (! empty($_SERVER["REMOTE_USER"]))
|
||||||
|
|||||||
@ -112,7 +112,7 @@ class CommActionRapport
|
|||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
|
|
||||||
// Create PDF instance
|
// Create PDF instance
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -177,7 +177,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part (value include bottom margin)
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -262,6 +262,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -379,13 +380,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Affiche zone infos
|
||||||
@ -620,7 +621,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + $object->remise), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
|
||||||
|
|
||||||
// Show VAT by rates and total
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248,248,248);
|
||||||
@ -628,7 +629,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||||
{
|
{
|
||||||
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && is_float($this->tva['0.000'])) ? true : false);
|
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||||
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
|
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
|
||||||
{
|
{
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
@ -694,7 +695,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
//Local tax 1
|
//Local tax 1
|
||||||
foreach($this->localtax1 as $tvakey => $tvaval)
|
foreach($this->localtax1 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey!=0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
//$this->atleastoneratenotnull++;
|
//$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
@ -722,7 +723,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
//Local tax 2
|
//Local tax 2
|
||||||
foreach($this->localtax2 as $tvakey => $tvaval)
|
foreach($this->localtax2 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey!=0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
//$this->atleastoneratenotnull++;
|
//$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
@ -760,7 +761,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$resteapayer = price2num($object->total_ttc - $deja_regle);
|
$creditnoteamount=0;
|
||||||
|
$depositsamount=0;
|
||||||
|
//$creditnoteamount=$object->getSumCreditNotesUsed();
|
||||||
|
//$depositsamount=$object->getSumDepositsUsed();
|
||||||
|
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
||||||
|
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||||
|
if (! empty($object->paye)) $resteapayer=0;
|
||||||
|
|
||||||
if ($deja_regle > 0)
|
if ($deja_regle > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.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
|
||||||
@ -70,13 +70,18 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fonction generant le document sur le disque
|
* Function to build pdf onto disk
|
||||||
*
|
*
|
||||||
* @param Object &$object Objet expedition a generer (ou id si ancienne methode)
|
* @param Object &$object Object expedition to generate (or id if old method)
|
||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @return int 1=ok, 0=ko
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
|
* @param int $hidedetails Do not show line details
|
||||||
|
* @param int $hidedesc Do not show desc
|
||||||
|
* @param int $hideref Do not show ref
|
||||||
|
* @param object $hookmanager Hookmanager object
|
||||||
|
* @return int 1=OK, 0=KO
|
||||||
*/
|
*/
|
||||||
function write_file(&$object, $outputlangs)
|
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs,$mysoc;
|
global $user,$conf,$langs,$mysoc;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
@ -108,12 +113,12 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
//Creation du destinataire
|
//Creation du destinataire
|
||||||
$idcontact = $object->$origin->getIdContact('external','SHIPPING');
|
$idcontact = $object->$origin->getIdContact('external','SHIPPING');
|
||||||
$this->destinataire = new Contact($this->db);
|
$this->destinataire = new Contact($this->db);
|
||||||
if ($idcontact[0]) $this->destinataire->fetch($idcontact[0]);
|
if (! empty($idcontact[0])) $this->destinataire->fetch($idcontact[0]);
|
||||||
|
|
||||||
//Creation du livreur
|
//Creation du livreur
|
||||||
$idcontact = $object->$origin->getIdContact('internal','LIVREUR');
|
$idcontact = $object->$origin->getIdContact('internal','LIVREUR');
|
||||||
$this->livreur = new User($this->db);
|
$this->livreur = new User($this->db);
|
||||||
if ($idcontact[0]) $this->livreur->fetch($idcontact[0]);
|
if (! empty($idcontact[0])) $this->livreur->fetch($idcontact[0]);
|
||||||
|
|
||||||
// Definition de $dir et $file
|
// Definition de $dir et $file
|
||||||
if ($object->specimen)
|
if ($object->specimen)
|
||||||
@ -142,6 +147,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format,'mm','l');
|
$pdf=pdf_getInstance($this->format,'mm','l');
|
||||||
|
$heightforinfotot = 0; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 28; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 28; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -195,10 +201,12 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$nexY = $tab_top + 7;
|
$nexY = $tab_top + 7;
|
||||||
|
|
||||||
$num=count($object->lines);
|
$num=count($object->lines);
|
||||||
|
// Loop on each lines
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 3);
|
$pdf->SetFont('','', $default_font_size - 3);
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -273,13 +281,13 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.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
|
||||||
@ -73,13 +73,18 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fonction generant le document sur le disque
|
* Function to build pdf onto disk
|
||||||
*
|
*
|
||||||
* @param Object &$object Objet expedition a generer (ou id si ancienne methode)
|
* @param Object &$object Object expedition to generate (or id if old method)
|
||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @return int 1=ok, 0=ko
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
|
* @param int $hidedetails Do not show line details
|
||||||
|
* @param int $hidedesc Do not show desc
|
||||||
|
* @param int $hideref Do not show ref
|
||||||
|
* @param object $hookmanager Hookmanager object
|
||||||
|
* @return int 1=OK, 0=KO
|
||||||
*/
|
*/
|
||||||
function write_file(&$object, $outputlangs)
|
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs;
|
global $user,$conf,$langs;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
@ -128,7 +133,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 0; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 0; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -223,10 +228,12 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
$nexY = $tab_top + 7;
|
$nexY = $tab_top + 7;
|
||||||
|
|
||||||
$num=count($object->lines);
|
$num=count($object->lines);
|
||||||
|
// Loop on each lines
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -119,8 +119,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
/**
|
/**
|
||||||
* Function to build pdf onto disk
|
* Function to build pdf onto disk
|
||||||
*
|
*
|
||||||
* @param int $object Id of object to generate
|
* @param Object $object Object to generate
|
||||||
* @param object $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
* @param int $hidedesc Do not show desc
|
* @param int $hidedesc Do not show desc
|
||||||
@ -178,7 +178,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -265,6 +265,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -382,12 +383,12 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Affiche zone infos
|
||||||
@ -744,7 +745,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||||
{
|
{
|
||||||
|
|
||||||
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||||
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
|
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
|
||||||
{
|
{
|
||||||
@ -809,7 +809,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
//Local tax 1
|
//Local tax 1
|
||||||
foreach($this->localtax1 as $tvakey => $tvaval)
|
foreach($this->localtax1 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey!=0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
//$this->atleastoneratenotnull++;
|
//$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
@ -837,7 +837,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
//Local tax 2
|
//Local tax 2
|
||||||
foreach($this->localtax2 as $tvakey => $tvaval)
|
foreach($this->localtax2 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey!=0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
//$this->atleastoneratenotnull++;
|
//$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
|
|||||||
@ -246,6 +246,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -310,12 +311,12 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
|
|||||||
@ -31,8 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class pdf_sirocco
|
* Classe permettant de generer les bons de livraison au modele Sirocco
|
||||||
* \brief Classe permettant de generer les bons de livraison au modele Sirocco
|
|
||||||
*/
|
*/
|
||||||
class pdf_sirocco extends ModelePDFDeliveryOrder
|
class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||||
{
|
{
|
||||||
@ -120,7 +119,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -180,10 +179,12 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
$curY = $tab_top + 7;
|
$curY = $tab_top + 7;
|
||||||
$nexY = $tab_top + 7;
|
$nexY = $tab_top + 7;
|
||||||
|
|
||||||
|
// Loop on each lines
|
||||||
for ($i = 0 ; $i < $nblines ; $i++)
|
for ($i = 0 ; $i < $nblines ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -268,13 +269,13 @@ if ($pageposafter > $pageposbefore) {
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -34,10 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class pdf_typhon
|
* Classe permettant de generer les bons de livraison au modele Typho
|
||||||
* \brief Classe permettant de generer les bons de livraison au modele Typho
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class pdf_typhon extends ModelePDFDeliveryOrder
|
class pdf_typhon extends ModelePDFDeliveryOrder
|
||||||
{
|
{
|
||||||
var $emetteur; // Objet societe qui emet
|
var $emetteur; // Objet societe qui emet
|
||||||
@ -143,7 +141,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 50; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 50; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -236,11 +234,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$curY = $tab_top + 7;
|
$curY = $tab_top + 7;
|
||||||
$nexY = $tab_top + 7;
|
$nexY = $tab_top + 7;
|
||||||
|
|
||||||
// Boucle sur les lignes
|
// Loop on each lines
|
||||||
for ($i = 0 ; $i < $nblines ; $i++)
|
for ($i = 0 ; $i < $nblines ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot-50); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot-50); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -336,13 +335,13 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -127,7 +127,7 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -265,13 +265,13 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -117,8 +117,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
/**
|
/**
|
||||||
* Function to build pdf onto disk
|
* Function to build pdf onto disk
|
||||||
*
|
*
|
||||||
* @param int $object Id of object to generate
|
* @param Object $object Object to generate
|
||||||
* @param object $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
* @param int $hidedesc Do not show desc
|
* @param int $hidedesc Do not show desc
|
||||||
@ -147,7 +147,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$deja_regle = ""; // FIXME not use in proposal?
|
// $deja_regle = 0;
|
||||||
|
|
||||||
// Definition of $dir and $file
|
// Definition of $dir and $file
|
||||||
if ($object->specimen)
|
if ($object->specimen)
|
||||||
@ -177,7 +177,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
// Create pdf instance
|
// Create pdf instance
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -263,6 +263,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -379,26 +380,29 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Affiche zone infos
|
||||||
$posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
|
$posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
// Affiche zone totaux
|
// Affiche zone totaux
|
||||||
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
//$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
||||||
|
$posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
// Affiche zone versements
|
// Affiche zone versements
|
||||||
|
/*
|
||||||
if ($deja_regle)
|
if ($deja_regle)
|
||||||
{
|
{
|
||||||
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); // FIXME not use in proposal?
|
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||||
@ -726,7 +730,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
//Local tax 1
|
//Local tax 1
|
||||||
foreach($this->localtax1 as $tvakey => $tvaval)
|
foreach($this->localtax1 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey!=0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
//$this->atleastoneratenotnull++;
|
//$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
@ -754,7 +758,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
//Local tax 2
|
//Local tax 2
|
||||||
foreach($this->localtax2 as $tvakey => $tvaval)
|
foreach($this->localtax2 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey!=0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
//$this->atleastoneratenotnull++;
|
//$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
@ -795,8 +799,10 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$resteapayer = $object->total_ttc - $deja_regle; // FIXME not use in proposal?
|
/*
|
||||||
if (! empty($object->paye)) $resteapayer=0; // FIXME not use in proposal?
|
$resteapayer = $object->total_ttc - $deja_regle;
|
||||||
|
if (! empty($object->paye)) $resteapayer=0;
|
||||||
|
*/
|
||||||
|
|
||||||
if ($deja_regle > 0)
|
if ($deja_regle > 0)
|
||||||
{
|
{
|
||||||
@ -808,7 +814,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
|
||||||
|
|
||||||
// FIXME not use in proposal?
|
/*
|
||||||
if ($object->close_code == 'discount_vat')
|
if ($object->close_code == 'discount_vat')
|
||||||
{
|
{
|
||||||
$index++;
|
$index++;
|
||||||
@ -822,6 +828,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
$resteapayer=0;
|
$resteapayer=0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0);
|
if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt');
|
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt','','name',SORT_ASC,0,true); // Disable hook for the moment
|
||||||
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
|
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,7 +176,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -260,6 +260,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -367,13 +368,13 @@ if ($pageposafter > $pageposbefore) {
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone totaux
|
// Affiche zone totaux
|
||||||
|
|||||||
@ -188,7 +188,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -272,6 +272,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$pdf->setTopMargin($tab_top_newpage);
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -328,15 +329,18 @@ if ($pageposafter > $pageposbefore) {
|
|||||||
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
||||||
$localtax2ligne=$object->lines[$i]->total_localtax2;
|
$localtax2ligne=$object->lines[$i]->total_localtax2;
|
||||||
|
|
||||||
if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
|
if (! empty($object->remise_percent)) $tvaligne-=($tvaligne*$object->remise_percent)/100;
|
||||||
if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
|
if (! empty($object->remise_percent)) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
|
||||||
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
if (! empty($object->remise_percent)) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
||||||
|
|
||||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||||
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
|
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
|
||||||
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
|
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
|
||||||
|
|
||||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||||
|
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
||||||
|
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
|
||||||
|
if (! isset($this->localtax2[$localtax2rate])) $this->localtax2[$localtax2rate]='';
|
||||||
$this->tva[$vatrate] += $tvaligne;
|
$this->tva[$vatrate] += $tvaligne;
|
||||||
$this->localtax1[$localtax1rate]+=$localtax1ligne;
|
$this->localtax1[$localtax1rate]+=$localtax1ligne;
|
||||||
$this->localtax2[$localtax2rate]+=$localtax2ligne;
|
$this->localtax2[$localtax2rate]+=$localtax2ligne;
|
||||||
@ -381,13 +385,13 @@ if ($pageposafter > $pageposbefore) {
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche zone infos
|
// Affiche zone infos
|
||||||
@ -626,7 +630,7 @@ if ($pageposafter > $pageposbefore) {
|
|||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + $object->remise), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
|
||||||
|
|
||||||
// Show VAT by rates and total
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248,248,248);
|
||||||
@ -763,7 +767,7 @@ if ($pageposafter > $pageposbefore) {
|
|||||||
//$depositsamount=$object->getSumDepositsUsed();
|
//$depositsamount=$object->getSumDepositsUsed();
|
||||||
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
//print "x".$creditnoteamount."-".$depositsamount;exit;
|
||||||
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||||
if ($object->paye) $resteapayer=0;
|
if (! empty($object->paye)) $resteapayer=0;
|
||||||
|
|
||||||
if ($deja_regle > 0)
|
if ($deja_regle > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -330,8 +330,8 @@ $(document).ready(function() {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if (! empty($conf->margin->enabled)) { ?>
|
<?php if (! empty($conf->margin->enabled)) { ?>
|
||||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product; ?>}, function(data) {
|
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': <?php echo $line->fk_product?$line->fk_product:0; ?>}, function(data) {
|
||||||
if (data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
var options = '';
|
var options = '';
|
||||||
var trouve=false;
|
var trouve=false;
|
||||||
$(data).each(function() {
|
$(data).each(function() {
|
||||||
|
|||||||
@ -140,10 +140,12 @@ if (! empty($conf->margin->enabled)) {
|
|||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#idprod").change(function() {
|
$("#idprod").change(function() {
|
||||||
$("#np_fournprice options").remove();
|
$("#fournprice options").remove();
|
||||||
$("#np_buying_price").show();
|
$("#fournprice").hide();
|
||||||
|
$("#buying_price").val("");
|
||||||
|
$("#buying_price").show();
|
||||||
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': $(this).val()}, function(data) {
|
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', {'idprod': $(this).val()}, function(data) {
|
||||||
if (data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
var options = '';
|
var options = '';
|
||||||
var i = 0;
|
var i = 0;
|
||||||
$(data).each(function() {
|
$(data).each(function() {
|
||||||
@ -151,20 +153,20 @@ $("#idprod").change(function() {
|
|||||||
options += '<option value="'+this.id+'" price="'+this.price+'"';
|
options += '<option value="'+this.id+'" price="'+this.price+'"';
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
options += ' selected';
|
options += ' selected';
|
||||||
$("#np_buying_price").val(this.price);
|
$("#buying_price").val(this.price);
|
||||||
}
|
}
|
||||||
options += '>'+this.label+'</option>';
|
options += '>'+this.label+'</option>';
|
||||||
});
|
});
|
||||||
options += '<option value=null><?php echo $langs->trans("InputPrice"); ?></option>';
|
options += '<option value=null><?php echo $langs->trans("InputPrice"); ?></option>';
|
||||||
$("#np_fournprice").html(options);
|
$("#fournprice").html(options);
|
||||||
$("#np_buying_price").hide();
|
$("#buying_price").hide();
|
||||||
$("#np_fournprice").show();
|
$("#fournprice").show();
|
||||||
$("#np_fournprice").change(function() {
|
$("#fournprice").change(function() {
|
||||||
var selval = $(this).find('option:selected').attr("price");
|
var selval = $(this).find('option:selected').attr("price");
|
||||||
if (selval)
|
if (selval)
|
||||||
$("#np_buying_price").val(selval).hide();
|
$("#buying_price").val(selval).hide();
|
||||||
else
|
else
|
||||||
$('#np_buying_price').show();
|
$('#buying_price').show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1904,6 +1904,8 @@ class CommandeFournisseurLigne
|
|||||||
var $total_localtax1;
|
var $total_localtax1;
|
||||||
var $total_localtax2;
|
var $total_localtax2;
|
||||||
var $total_ttc;
|
var $total_ttc;
|
||||||
|
var $info_bits;
|
||||||
|
var $special_code;
|
||||||
|
|
||||||
// From llx_product
|
// From llx_product
|
||||||
var $libelle; // Label produit
|
var $libelle; // Label produit
|
||||||
|
|||||||
@ -77,7 +77,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
var $propalid;
|
var $propalid;
|
||||||
|
|
||||||
var $lines;
|
var $lines;
|
||||||
var $fournisseur;
|
var $fournisseur; // deprecated
|
||||||
|
var $thirdparty; // To store thirdparty
|
||||||
|
|
||||||
var $extraparams=array();
|
var $extraparams=array();
|
||||||
|
|
||||||
|
|||||||
@ -238,7 +238,20 @@ create table llx_socpeople_extrafields
|
|||||||
|
|
||||||
ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_object);
|
ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_object);
|
||||||
|
|
||||||
-- update type of localtax for spain
|
-- update type of localtax1 for spain
|
||||||
UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 41 AND fk_pays = 4 AND localtax1_type = '0';
|
UPDATE llx_c_tva SET localtax1_type = '3' WHERE rowid = 41 AND fk_pays = 4 AND (localtax1_type = '0' OR localtax1_type='1');
|
||||||
UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 42 AND fk_pays = 4 AND localtax1_type = '0';
|
UPDATE llx_c_tva SET localtax1_type = '3' WHERE rowid = 42 AND fk_pays = 4 AND (localtax1_type = '0' OR localtax1_type='1');
|
||||||
UPDATE llx_c_tva SET localtax1_type = '1' WHERE rowid = 43 AND fk_pays = 4 AND localtax1_type = '0';
|
UPDATE llx_c_tva SET localtax1_type = '3' WHERE rowid = 43 AND fk_pays = 4 AND (localtax1_type = '0' OR localtax1_type='1');
|
||||||
|
|
||||||
|
-- update type of localtax2 for spain
|
||||||
|
UPDATE llx_c_tva SET localtax2_type = '1' WHERE rowid = 41 AND fk_pays = 4 AND localtax2_type = '0';
|
||||||
|
UPDATE llx_c_tva SET localtax2_type = '1' WHERE rowid = 42 AND fk_pays = 4 AND localtax2_type = '0';
|
||||||
|
UPDATE llx_c_tva SET localtax2_type = '1' WHERE rowid = 43 AND fk_pays = 4 AND localtax2_type = '0';
|
||||||
|
|
||||||
|
UPDATE llx_c_tva set localtax1 = 1, localtax1_type = '4', localtax2 = 0.4, localtax2_type = '7' where rowid= 101 and fk_pays= 10 AND localtax1_type='0';
|
||||||
|
UPDATE llx_c_tva set localtax1 = 1, localtax1_type = '4', localtax2 = 0.4, localtax2_type = '7' where rowid= 102 and fk_pays= 10 AND localtax1_type='0';
|
||||||
|
UPDATE llx_c_tva set localtax1 = 1, localtax1_type = '4', localtax2 = 0.4, localtax2_type = '7' where rowid= 103 and fk_pays= 10 AND localtax1_type='0';
|
||||||
|
UPDATE llx_c_tva set localtax1 = 1, localtax1_type = '4', localtax2 = 0.4, localtax2_type = '7' where rowid= 104 and fk_pays= 10 AND localtax1_type='0';
|
||||||
|
UPDATE llx_c_tva set localtax1 = 1, localtax1_type = '4', localtax2 = 0.4, localtax2_type = '7' where rowid= 105 and fk_pays= 10 AND localtax1_type='0';
|
||||||
|
UPDATE llx_c_tva set localtax1 = 1, localtax1_type = '4', localtax2 = 0.4, localtax2_type = '7' where rowid= 106 and fk_pays= 10 AND localtax1_type='0';
|
||||||
|
UPDATE llx_c_tva set localtax1 = 1, localtax1_type = '4', localtax2 = 0.4, localtax2_type = '7' where rowid= 107 and fk_pays= 10 AND localtax1_type='0';
|
||||||
|
|||||||
@ -345,7 +345,13 @@ OldVATRates=Taxa d'IVA antiga
|
|||||||
NewVATRates=Taxa d'IVA nova
|
NewVATRates=Taxa d'IVA nova
|
||||||
PriceBaseTypeToChange=Canviar el preu on la referència de base és
|
PriceBaseTypeToChange=Canviar el preu on la referència de base és
|
||||||
MassConvert=Convertir massivament
|
MassConvert=Convertir massivament
|
||||||
# Modules= undefined==
|
String=Cadena
|
||||||
|
TextLong=Text llarg
|
||||||
|
Int=numèric enter
|
||||||
|
Float=Decimal
|
||||||
|
DateAndTime=Data i hora
|
||||||
|
|
||||||
|
# Modules
|
||||||
Module0Name=Usuaris y grups
|
Module0Name=Usuaris y grups
|
||||||
Module0Desc=Gestió d'usuaris i grups
|
Module0Desc=Gestió d'usuaris i grups
|
||||||
Module1Name=Tercers
|
Module1Name=Tercers
|
||||||
@ -455,6 +461,8 @@ Module2900Name=GeoIPMaxmind
|
|||||||
Module2900Desc=Capacitats de conversió GeoIP Maxmind
|
Module2900Desc=Capacitats de conversió GeoIP Maxmind
|
||||||
Module5000Name=Multi-empresa
|
Module5000Name=Multi-empresa
|
||||||
Module5000Desc=Permet gestionar diverses empreses
|
Module5000Desc=Permet gestionar diverses empreses
|
||||||
|
Module20000Name=Dies lliures
|
||||||
|
Module20000Desc=Gestió dels dies lliures dels empleats
|
||||||
Module50000Name=PayBox
|
Module50000Name=PayBox
|
||||||
Module50000Desc=Mòdul per a proporcionar un pagament en línia amb targeta de crèdit mitjançant Paybox
|
Module50000Desc=Mòdul per a proporcionar un pagament en línia amb targeta de crèdit mitjançant Paybox
|
||||||
Module50100Name=TPV
|
Module50100Name=TPV
|
||||||
@ -899,6 +907,8 @@ MAIN_PROXY_USER=Login del servidor proxy
|
|||||||
MAIN_PROXY_PASS=Contrasenya del servidor proxy
|
MAIN_PROXY_PASS=Contrasenya del servidor proxy
|
||||||
DefineHereComplementaryAttributes=Definiu aquí la llista d'atributs addicionals, no disponibles a estàndard, i que vol gestionar per %s.
|
DefineHereComplementaryAttributes=Definiu aquí la llista d'atributs addicionals, no disponibles a estàndard, i que vol gestionar per %s.
|
||||||
ExtraFields=Atributs addicionals
|
ExtraFields=Atributs addicionals
|
||||||
|
ExtraFieldsThirdParties=Atributs adicionals (tercers)
|
||||||
|
ExtraFieldsContacts=Atributs adicionals (contactes/adreçes)
|
||||||
ExtraFieldHasWrongValue=L'atribut %s te un valor incorrecte.
|
ExtraFieldHasWrongValue=L'atribut %s te un valor incorrecte.
|
||||||
AlphaNumOnlyCharsAndNoSpace=només carateres alfanumèrics sense espais
|
AlphaNumOnlyCharsAndNoSpace=només carateres alfanumèrics sense espais
|
||||||
SendingMailSetup=Configuració de l'enviament per mail
|
SendingMailSetup=Configuració de l'enviament per mail
|
||||||
@ -908,7 +918,7 @@ PathDirectory=Catàleg
|
|||||||
SendmailOptionMayHurtBuggedMTA=La funcionalitat d'enviar correu electrònic a través del "correu directe PHP" genera una sol·licitud que pot ser mal interpretada per alguns servidors de correu. Això es tradueix en missatges de correu electrònic il·legibles per a les persones allotjades en aquestes plataformes. Aquest és el cas de clients en certs proveïdors de serveis d'Internet (Ex: Orange). Això no és un problema ni de Dolibarr ni de PHP, però sí del servidor de correu. No obstant això, podeu afegir l'opció MAIN_FIX_FOR_BUGGED_MTA amb valor 1 en configuració-varis per tractar que Dolibarr eviti l'error. Una altra solució (recomanada) és utilitzar el mètode d'enviament per SMTP que no té aquest inconvenient.
|
SendmailOptionMayHurtBuggedMTA=La funcionalitat d'enviar correu electrònic a través del "correu directe PHP" genera una sol·licitud que pot ser mal interpretada per alguns servidors de correu. Això es tradueix en missatges de correu electrònic il·legibles per a les persones allotjades en aquestes plataformes. Aquest és el cas de clients en certs proveïdors de serveis d'Internet (Ex: Orange). Això no és un problema ni de Dolibarr ni de PHP, però sí del servidor de correu. No obstant això, podeu afegir l'opció MAIN_FIX_FOR_BUGGED_MTA amb valor 1 en configuració-varis per tractar que Dolibarr eviti l'error. Una altra solució (recomanada) és utilitzar el mètode d'enviament per SMTP que no té aquest inconvenient.
|
||||||
TranslationSetup=Configuració traducció
|
TranslationSetup=Configuració traducció
|
||||||
TranslationDesc=L'elecció de l'idioma mostrat en pantalla es modifica:<br>* A nivell global des del menú <strong>Inici - Configuració - Entorn</strong><br>* De manera específica a l'usuari des de la pestanya <strong>interface usuari</strong> de la seva fitxa d'usuari (fer clic al seu login a la part superior esquerra de la pantalla).
|
TranslationDesc=L'elecció de l'idioma mostrat en pantalla es modifica:<br>* A nivell global des del menú <strong>Inici - Configuració - Entorn</strong><br>* De manera específica a l'usuari des de la pestanya <strong>interface usuari</strong> de la seva fitxa d'usuari (fer clic al seu login a la part superior esquerra de la pantalla).
|
||||||
##### Module password generation= undefined==
|
##### Module password generation
|
||||||
PasswordGenerationStandard=Retorna una contrasenya generada per l'algoritme intern Dolibarr: 8 caràcters, números i caràcters en minúscules barrejades.
|
PasswordGenerationStandard=Retorna una contrasenya generada per l'algoritme intern Dolibarr: 8 caràcters, números i caràcters en minúscules barrejades.
|
||||||
PasswordGenerationNone=No ofereix contrasenyes. La contrasenya s'introdueix manualment.
|
PasswordGenerationNone=No ofereix contrasenyes. La contrasenya s'introdueix manualment.
|
||||||
##### Users setup #####
|
##### Users setup #####
|
||||||
|
|||||||
@ -318,9 +318,9 @@ PaymentTypeTRA=Lletra de canvi
|
|||||||
PaymentTypeShortTRA=Lletra
|
PaymentTypeShortTRA=Lletra
|
||||||
BankDetails=Dades bancàries
|
BankDetails=Dades bancàries
|
||||||
BankCode=Codi banc
|
BankCode=Codi banc
|
||||||
DeskCode=Codi sucursal
|
DeskCode=Cod. sucursal
|
||||||
BankAccountNumber=Número compte
|
BankAccountNumber=Número compte
|
||||||
BankAccountNumberKey=Dígit control
|
BankAccountNumberKey=D. C.
|
||||||
Residence=Domiciliació
|
Residence=Domiciliació
|
||||||
IBANNumber=Codi IBAN
|
IBANNumber=Codi IBAN
|
||||||
IBAN=IBAN
|
IBAN=IBAN
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
# Dolibarr language file - ca_ES - commissions
|
# Dolibarr language file - ca_ES - commissions
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
|
|
||||||
|
Module60000Desc=Gestió de comissions
|
||||||
commissionsSetup=Configuració de la gestió de comissions
|
commissionsSetup=Configuració de la gestió de comissions
|
||||||
|
|
||||||
ProductCommissionRate=Taxa de comissió sobre els productes
|
ProductCommissionRate=Taxa de comissió sobre els productes
|
||||||
|
|||||||
@ -250,6 +250,8 @@ Quadri=Trimistre
|
|||||||
MonthOfDay=Mes del dia
|
MonthOfDay=Mes del dia
|
||||||
HourShort=H
|
HourShort=H
|
||||||
Rate=Tipus
|
Rate=Tipus
|
||||||
|
UseLocalTax=Incloure taxes
|
||||||
|
LocalTaxDesc=Alguns països apliquen 2 o 3 taxes a cada línia de factura. Si és el cas, escolliu el tipus de la segona i tercera taxa i el seu valor. Els possibles tipus són: <br> 1: taxa local aplicable a productes i serveis sense IVA (IVA no s'aplica a la taxa local) <br> 2: taxa local s'aplica a productes i serveis abans de l'IVA (IVA es calcula sobre import + taxa local) <br> 3: taxa local s'aplica a productes sense IVA (IVA no s'aplica a la taxa local) <br> 4: taxa local s'aplica a productes abans de l'IVA (IVA es calcula sobre l'import + taxa local) <br> 5: taxa local s'aplica a serveis sense IVA (IVA no s'aplica a la taxa local) <br> 6: taxa local s'aplica a serveis abans de l'IVA (IVA es calcula sobre import + taxa local) <br> 7: la taxa local és un import fix aplicat al total de la factura
|
||||||
Bytes=Bytes
|
Bytes=Bytes
|
||||||
KiloBytes=Kilobytes
|
KiloBytes=Kilobytes
|
||||||
MegaBytes=Megabytes
|
MegaBytes=Megabytes
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
# Dolibarr language file - ca_ES - margins
|
# Dolibarr language file - ca_ES - margins
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
|
|
||||||
|
Module59000Name=Marges
|
||||||
|
Module59000Desc=Gestió de marges comercials
|
||||||
Margin=Marge
|
Margin=Marge
|
||||||
Margins=Marges
|
Margins=Marges
|
||||||
TotalMargin=Marge total
|
TotalMargin=Marge total
|
||||||
|
|||||||
@ -176,3 +176,6 @@ AddThisProductCard=Crear fitxa producte
|
|||||||
HelpAddThisProductCard=Aquesta opció permet crear o clonar una fitxa de producte en cas que no hi hagi
|
HelpAddThisProductCard=Aquesta opció permet crear o clonar una fitxa de producte en cas que no hi hagi
|
||||||
AddThisServiceCard=Crear fitxa servei
|
AddThisServiceCard=Crear fitxa servei
|
||||||
HelpAddThisServiceCard=Aquesta opció permet crear o clonar una fitxa de servei en cas que no hi hagi
|
HelpAddThisServiceCard=Aquesta opció permet crear o clonar una fitxa de servei en cas que no hi hagi
|
||||||
|
CurrentProductPrice=Preu actual
|
||||||
|
AlwaysUseNewPrice=Utilitzar sempre el preu actual
|
||||||
|
AlwaysUseFixedPrice=Utilitzar el preu fixat
|
||||||
@ -8,6 +8,8 @@ MenuNewWarehouse=Nou magatzem
|
|||||||
WarehouseOpened=Magatzem obert
|
WarehouseOpened=Magatzem obert
|
||||||
WarehouseClosed=Magatzem tancat
|
WarehouseClosed=Magatzem tancat
|
||||||
WarehouseSource=Magatzem origen
|
WarehouseSource=Magatzem origen
|
||||||
|
WarehouseSourceNotDefined=Sense magatzems definits,
|
||||||
|
AddOne=Afegir un
|
||||||
WarehouseTarget=Magatzem destinació
|
WarehouseTarget=Magatzem destinació
|
||||||
ValidateSending=Validar enviament
|
ValidateSending=Validar enviament
|
||||||
CancelSending=Anul·lar enviament
|
CancelSending=Anul·lar enviament
|
||||||
|
|||||||
@ -39,3 +39,6 @@ CommercialAgent=Commercial agent
|
|||||||
StartDate=Start date
|
StartDate=Start date
|
||||||
EndDate=End date
|
EndDate=End date
|
||||||
Launch=Start
|
Launch=Start
|
||||||
|
|
||||||
|
AgentContactType=Contact type used for commissioning
|
||||||
|
AgentContactTypeDetails=Défine what contact type (linked on invoices) will be associated with commercial agents
|
||||||
@ -47,3 +47,6 @@ MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price<br/>Net margin : S
|
|||||||
|
|
||||||
BuyingCost=Cost price
|
BuyingCost=Cost price
|
||||||
UnitCharges=Unit charges
|
UnitCharges=Unit charges
|
||||||
|
|
||||||
|
AgentContactType=Contact type used for commissioning
|
||||||
|
AgentContactTypeDetails=Défine what contact type (linked on invoices) will be associated with commercial agents
|
||||||
@ -346,7 +346,13 @@ OldVATRates=Tasa de IVA antigua
|
|||||||
NewVATRates=Tasa de IVA nueva
|
NewVATRates=Tasa de IVA nueva
|
||||||
PriceBaseTypeToChange=Cambiar el precio cuya referencia de base es
|
PriceBaseTypeToChange=Cambiar el precio cuya referencia de base es
|
||||||
MassConvert=Convertir masivamente
|
MassConvert=Convertir masivamente
|
||||||
# Modules= undefined=
|
String=Cadena
|
||||||
|
TextLong=Texto largo
|
||||||
|
Int=Numérico entero
|
||||||
|
Float=Decimal
|
||||||
|
DateAndTime=Fecha y hora
|
||||||
|
|
||||||
|
# Modules
|
||||||
Module0Name=Usuarios y grupos
|
Module0Name=Usuarios y grupos
|
||||||
Module0Desc=Gestión de usuarios y grupos
|
Module0Desc=Gestión de usuarios y grupos
|
||||||
Module1Name=Terceros
|
Module1Name=Terceros
|
||||||
@ -456,6 +462,8 @@ Module2900Name=GeoIPMaxmind
|
|||||||
Module2900Desc=Capacidades de conversión GeoIP Maxmind
|
Module2900Desc=Capacidades de conversión GeoIP Maxmind
|
||||||
Module5000Name=Multi-empresa
|
Module5000Name=Multi-empresa
|
||||||
Module5000Desc=Permite gestionar varias empresas
|
Module5000Desc=Permite gestionar varias empresas
|
||||||
|
Module20000Name=Días libres
|
||||||
|
Module20000Desc=Gestión de los días libres de los empleados
|
||||||
Module50000Name=PayBox
|
Module50000Name=PayBox
|
||||||
Module50000Desc=Módulo para proporcionar un pago en línea con tarjeta de crédito mediante Paybox
|
Module50000Desc=Módulo para proporcionar un pago en línea con tarjeta de crédito mediante Paybox
|
||||||
Module50100Name=TPV
|
Module50100Name=TPV
|
||||||
@ -901,6 +909,8 @@ MAIN_PROXY_USER=Login del servidor proxy
|
|||||||
MAIN_PROXY_PASS=Contraseña del servidor proxy
|
MAIN_PROXY_PASS=Contraseña del servidor proxy
|
||||||
DefineHereComplementaryAttributes=Defina aquí la lista de atributos adicionales, no disponibles por defecto, y que desea gestionar para %s.
|
DefineHereComplementaryAttributes=Defina aquí la lista de atributos adicionales, no disponibles por defecto, y que desea gestionar para %s.
|
||||||
ExtraFields=Atributos adicionales
|
ExtraFields=Atributos adicionales
|
||||||
|
ExtraFieldsThirdParties=Atributos adicionales (terceros)
|
||||||
|
ExtraFieldsContacts=Atributos adicionales (contactos/direcciones)
|
||||||
ExtraFieldHasWrongValue=El atributo %s tiene un valor incorrecto.
|
ExtraFieldHasWrongValue=El atributo %s tiene un valor incorrecto.
|
||||||
AlphaNumOnlyCharsAndNoSpace=solamente caracteres alfanuméricos sin espacios
|
AlphaNumOnlyCharsAndNoSpace=solamente caracteres alfanuméricos sin espacios
|
||||||
SendingMailSetup=Configuración del envío por mail
|
SendingMailSetup=Configuración del envío por mail
|
||||||
|
|||||||
@ -318,9 +318,9 @@ PaymentTypeTRA=Letra de cambio
|
|||||||
PaymentTypeShortTRA=Letra
|
PaymentTypeShortTRA=Letra
|
||||||
BankDetails=Datos bancarios
|
BankDetails=Datos bancarios
|
||||||
BankCode=Código banco
|
BankCode=Código banco
|
||||||
DeskCode=Código sucursal
|
DeskCode=Cód. sucursal
|
||||||
BankAccountNumber=Número cuenta
|
BankAccountNumber=Número cuenta
|
||||||
BankAccountNumberKey=Dígito Control
|
BankAccountNumberKey=D. C.
|
||||||
Residence=Domiciliación
|
Residence=Domiciliación
|
||||||
IBANNumber=Código IBAN
|
IBANNumber=Código IBAN
|
||||||
IBAN=IBAN
|
IBAN=IBAN
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
# Dolibarr language file - es_ES - commissions
|
# Dolibarr language file - es_ES - commissions
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
|
|
||||||
|
Module60000Desc=Gestión de comisiones
|
||||||
commissionsSetup=Configuración de la gestión de comisiones
|
commissionsSetup=Configuración de la gestión de comisiones
|
||||||
|
|
||||||
ProductCommissionRate=Tasa de comisión sobre los productos
|
ProductCommissionRate=Tasa de comisión sobre los productos
|
||||||
|
|||||||
@ -250,6 +250,8 @@ Quadri=Trimestre
|
|||||||
MonthOfDay=Mes del día
|
MonthOfDay=Mes del día
|
||||||
HourShort=H
|
HourShort=H
|
||||||
Rate=Tipo
|
Rate=Tipo
|
||||||
|
UseLocalTax=Incluir tasas
|
||||||
|
LocalTaxDesc=Algunos países aplican 2 o 3 tasas a cada línea de factura. Si es el caso, escoja el tipo de la segunda y tercera tasa y su valor. Los posibles tipos son:<br>1 : tasa local aplicable a productos y servicios sin IVA (IVA no se aplica en la tasa local)<br>2 : tasa local se aplica a productos y servicios antes del IVA (IVA se calcula sobre importe+tasa local)<br>3 : tasa local se aplica a productos sin IVA (IVA no se aplica en la tasa local)<br>4 : tasa local se aplica a productos antes del IVA (IVA se calcula sobre el importe+tasa local)<br>5 : tasa local se aplica a servicios sin IVA (IVA no se aplica a la tasa local)<br>6 : tasa local se aplica a servicios antes del IVA (IVA se calcula sobre importe + tasa local)<br>7 : la tasa local es un importe fijo aplicado al total de la factura
|
||||||
Bytes=Bytes
|
Bytes=Bytes
|
||||||
KiloBytes=Kilobytes
|
KiloBytes=Kilobytes
|
||||||
MegaBytes=Megabytes
|
MegaBytes=Megabytes
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
# Dolibarr language file - es_ES - margins
|
# Dolibarr language file - es_ES - margins
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
|
|
||||||
|
Module59000Name=Márgenes
|
||||||
|
Module59000Desc=Gestión de márgenes comerciales
|
||||||
Margin=Margen
|
Margin=Margen
|
||||||
Margins=Márgenes
|
Margins=Márgenes
|
||||||
TotalMargin=Margen total
|
TotalMargin=Margen total
|
||||||
|
|||||||
@ -176,3 +176,6 @@ AddThisProductCard=Crear ficha producto
|
|||||||
HelpAddThisProductCard=Esta opción permite crear o clonar una ficha de producto en caso de que no exista
|
HelpAddThisProductCard=Esta opción permite crear o clonar una ficha de producto en caso de que no exista
|
||||||
AddThisServiceCard=Crear ficha servicio
|
AddThisServiceCard=Crear ficha servicio
|
||||||
HelpAddThisServiceCard=Esta opción permite crear o clonar una ficha de servicio en caso de que no exista
|
HelpAddThisServiceCard=Esta opción permite crear o clonar una ficha de servicio en caso de que no exista
|
||||||
|
CurrentProductPrice=Precio actual
|
||||||
|
AlwaysUseNewPrice=Usar siempre el precio actual
|
||||||
|
AlwaysUseFixedPrice=Usar el precio fijado
|
||||||
@ -8,6 +8,8 @@ MenuNewWarehouse=Nuevo almacén
|
|||||||
WarehouseOpened=Almacén abierto
|
WarehouseOpened=Almacén abierto
|
||||||
WarehouseClosed=Almacén cerrado
|
WarehouseClosed=Almacén cerrado
|
||||||
WarehouseSource=Almacén origen
|
WarehouseSource=Almacén origen
|
||||||
|
WarehouseSourceNotDefined=Sin almacenes definidos,
|
||||||
|
AddOne=Añadir uno
|
||||||
WarehouseTarget=Almacén destino
|
WarehouseTarget=Almacén destino
|
||||||
ValidateSending=Validar envío
|
ValidateSending=Validar envío
|
||||||
CancelSending=Anular envío
|
CancelSending=Anular envío
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
# Dolibarr language file - fr_FR - commissions
|
# Dolibarr language file - fr_FR - commissions
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
|
|
||||||
|
Module60000Desc=Gestion des commissions
|
||||||
commissionsSetup=Paramétrage de la gestion des commissions
|
commissionsSetup=Paramétrage de la gestion des commissions
|
||||||
|
|
||||||
ProductCommissionRate=Taux de commissionnement sur les produits
|
ProductCommissionRate=Taux de commissionnement sur les produits
|
||||||
@ -38,3 +39,6 @@ CommercialAgent=Agent commercial
|
|||||||
StartDate=Date de début
|
StartDate=Date de début
|
||||||
EndDate=Date de fin
|
EndDate=Date de fin
|
||||||
Launch=Démarrer
|
Launch=Démarrer
|
||||||
|
|
||||||
|
AgentContactType=Type de contact commissionné
|
||||||
|
AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux
|
||||||
@ -1,6 +1,8 @@
|
|||||||
# Dolibarr language file - fr_FR - margins
|
# Dolibarr language file - fr_FR - margins
|
||||||
CHARSET=UTF-8
|
CHARSET=UTF-8
|
||||||
|
|
||||||
|
Module59000Name=Marges
|
||||||
|
Module59000Desc=Gestion des marges commerciales
|
||||||
Margin=Marge
|
Margin=Marge
|
||||||
Margins=Marges
|
Margins=Marges
|
||||||
TotalMargin=Marge totale
|
TotalMargin=Marge totale
|
||||||
@ -45,3 +47,6 @@ MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT<br/>Marge n
|
|||||||
|
|
||||||
BuyingCost=Coût de revient
|
BuyingCost=Coût de revient
|
||||||
UnitCharges=Charge unitaire
|
UnitCharges=Charge unitaire
|
||||||
|
|
||||||
|
AgentContactType=Type de contact commissionné
|
||||||
|
AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux
|
||||||
@ -25,8 +25,11 @@ include '../../main.inc.php';
|
|||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
$langs->load("bills");
|
||||||
$langs->load("margins");
|
$langs->load("margins");
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
@ -91,6 +94,18 @@ if ($action == 'typemarges')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'contact')
|
||||||
|
{
|
||||||
|
if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', $_POST['AGENT_CONTACT_TYPE'], 'chaine', 0, '', $conf->entity) > 0)
|
||||||
|
{
|
||||||
|
$conf->global->AGENT_CONTACT_TYPE = $_POST['AGENT_CONTACT_TYPE'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -246,6 +261,25 @@ print '<td>'.$langs->trans('MARGIN_METHODE_FOR_DISCOUNT_DETAILS').'</td>';
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT
|
||||||
|
$var=!$var;
|
||||||
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print "<input type=\"hidden\" name=\"action\" value=\"contact\">";
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td>'.$langs->trans("AgentContactType").'</td>';
|
||||||
|
print '<td align="left">';
|
||||||
|
$formcompany = new FormCompany($db);
|
||||||
|
$facture = new Facture($db);
|
||||||
|
print $formcompany->selectTypeContact($facture, $conf->global->AGENT_CONTACT_TYPE, "AGENT_CONTACT_TYPE","internal","code",1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td>'.$langs->trans('AgentContactTypeDetails').'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
@ -118,35 +118,42 @@ if (! empty($conf->global->DISPLAY_MARK_RATES)) {
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,";
|
$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,";
|
||||||
$sql.= " u.login,";
|
$sql.= " u.login,";
|
||||||
$sql.= " f.facnumber, f.total as total_ht,";
|
|
||||||
$sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price,";
|
$sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price,";
|
||||||
$sql.= " sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge," ;
|
$sql.= " sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge" ;
|
||||||
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE);
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."user as u";
|
$sql.= ", ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||||
$sql.= " AND sc.fk_soc = f.fk_soc";
|
$sql.= " AND sc.fk_soc = f.fk_soc";
|
||||||
|
if (! empty($conf->global->AGENT_CONTACT_TYPE))
|
||||||
|
$sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))";
|
||||||
|
else
|
||||||
$sql .= " AND sc.fk_user = u.rowid";
|
$sql .= " AND sc.fk_user = u.rowid";
|
||||||
$sql.= " AND f.fk_statut > 0";
|
$sql.= " AND f.fk_statut > 0";
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
if ($agentid > 0)
|
if ($agentid > 0) {
|
||||||
$sql.= " AND sc.fk_user = $agentid";
|
if (! empty($conf->global->AGENT_CONTACT_TYPE))
|
||||||
|
$sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))";
|
||||||
|
else
|
||||||
|
$sql .= " AND sc.fk_user = ".$agentid;
|
||||||
|
}
|
||||||
if (!empty($startdate))
|
if (!empty($startdate))
|
||||||
$sql.= " AND f.datef >= '".$startdate."'";
|
$sql.= " AND f.datef >= '".$startdate."'";
|
||||||
if (!empty($enddate))
|
if (!empty($enddate))
|
||||||
$sql.= " AND f.datef <= '".$enddate."'";
|
$sql.= " AND f.datef <= '".$enddate."'";
|
||||||
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql .= " AND d.buy_price_ht <> 0";
|
||||||
if ($agentid > 0)
|
if ($agentid > 0)
|
||||||
$sql.= " GROUP BY s.rowid";
|
$sql.= " GROUP BY s.rowid";
|
||||||
else
|
else
|
||||||
$sql.= " GROUP BY sc.fk_user";
|
$sql.= " GROUP BY u.rowid";
|
||||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||||
$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|
||||||
@ -168,17 +175,19 @@ if ($result)
|
|||||||
print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.login","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.login","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder);
|
||||||
|
|
||||||
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buyng_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"d.marge_tx","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"d.marque_tx","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$cumul_achat = 0;
|
$cumul_achat = 0;
|
||||||
$cumul_vente = 0;
|
$cumul_vente = 0;
|
||||||
$cumul_qty = 0;
|
$cumul_qty = 0;
|
||||||
|
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$var=true;
|
$var=true;
|
||||||
@ -211,9 +220,11 @@ if ($result)
|
|||||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||||
print "<td align=\"right\">".(($markRate === '')?'n/a':price($markRate)."%")."</td>\n";
|
print "<td align=\"right\">".(($markRate === '')?'n/a':price($markRate)."%")."</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$cumul_achat += $objp->buying_price;
|
|
||||||
$cumul_vente += $objp->selling_price;
|
$cumul_achat += round($objp->buying_price, $rounding);
|
||||||
|
$cumul_vente += round($objp->selling_price, $rounding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,11 +234,9 @@ if ($result)
|
|||||||
$marginRate = ($cumul_achat != 0)?(100 * round($totalMargin / $cumul_achat, 5)):'';
|
$marginRate = ($cumul_achat != 0)?(100 * round($totalMargin / $cumul_achat, 5)):'';
|
||||||
$markRate = ($cumul_vente != 0)?(100 * round($totalMargin / $cumul_vente, 5)):'';
|
$markRate = ($cumul_vente != 0)?(100 * round($totalMargin / $cumul_vente, 5)):'';
|
||||||
print '<tr '.$bc[$var].' style="border-top: 1px solid #ccc; font-weight: bold">';
|
print '<tr '.$bc[$var].' style="border-top: 1px solid #ccc; font-weight: bold">';
|
||||||
if (! empty($client))
|
|
||||||
print '<td colspan=2>';
|
|
||||||
else
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans('TotalMargin')."</td>";
|
print $langs->trans('Total');
|
||||||
|
print "</td>";
|
||||||
print "<td align=\"right\">".price($cumul_vente)."</td>\n";
|
print "<td align=\"right\">".price($cumul_vente)."</td>\n";
|
||||||
print "<td align=\"right\">".price($cumul_achat)."</td>\n";
|
print "<td align=\"right\">".price($cumul_achat)."</td>\n";
|
||||||
print "<td align=\"right\">".price($totalMargin)."</td>\n";
|
print "<td align=\"right\">".price($totalMargin)."</td>\n";
|
||||||
|
|||||||
@ -158,6 +158,7 @@ if (!empty($startdate))
|
|||||||
$sql.= " AND f.datef >= '".$startdate."'";
|
$sql.= " AND f.datef >= '".$startdate."'";
|
||||||
if (!empty($enddate))
|
if (!empty($enddate))
|
||||||
$sql.= " AND f.datef <= '".$enddate."'";
|
$sql.= " AND f.datef <= '".$enddate."'";
|
||||||
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql .= " AND d.buy_price_ht <> 0";
|
||||||
if ($client)
|
if ($client)
|
||||||
@ -186,17 +187,19 @@ if ($result)
|
|||||||
else
|
else
|
||||||
print_liste_field_titre($langs->trans("Customer"),$_SERVER["PHP_SELF"],"s.nom","","&socid=".$socid,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Customer"),$_SERVER["PHP_SELF"],"s.nom","","&socid=".$socid,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buyng_price","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"d.marge_tx","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"d.marque_tx","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"","","&socid=".$socid,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$cumul_achat = 0;
|
$cumul_achat = 0;
|
||||||
$cumul_vente = 0;
|
$cumul_vente = 0;
|
||||||
$cumul_qty = 0;
|
$cumul_qty = 0;
|
||||||
|
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -234,8 +237,8 @@ if ($result)
|
|||||||
print "<td align=\"right\">".(($markRate === '')?'n/a':price($markRate)."%")."</td>\n";
|
print "<td align=\"right\">".(($markRate === '')?'n/a':price($markRate)."%")."</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
$cumul_achat += $objp->buying_price;
|
$cumul_achat += round($objp->buying_price, $rounding);
|
||||||
$cumul_vente += $objp->selling_price;
|
$cumul_vente += round($objp->selling_price, $rounding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -162,6 +162,7 @@ if (!empty($startdate))
|
|||||||
$sql.= " AND f.datef >= '".$startdate."'";
|
$sql.= " AND f.datef >= '".$startdate."'";
|
||||||
if (!empty($enddate))
|
if (!empty($enddate))
|
||||||
$sql.= " AND f.datef <= '".$enddate."'";
|
$sql.= " AND f.datef <= '".$enddate."'";
|
||||||
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql .= " AND d.buy_price_ht <> 0";
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
@ -190,17 +191,19 @@ if ($result)
|
|||||||
else
|
else
|
||||||
print_liste_field_titre($langs->trans("ProductService"),$_SERVER["PHP_SELF"],"p.ref","","&id=".$id,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("ProductService"),$_SERVER["PHP_SELF"],"p.ref","","&id=".$id,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buyng_price","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"d.marge_tx","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"d.marque_tx","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"","","&id=".$id,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$cumul_achat = 0;
|
$cumul_achat = 0;
|
||||||
$cumul_vente = 0;
|
$cumul_vente = 0;
|
||||||
$cumul_qty = 0;
|
$cumul_qty = 0;
|
||||||
|
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -241,8 +244,8 @@ if ($result)
|
|||||||
print "<td align=\"right\">".(($markRate === '')?'n/a':price($markRate)."%")."</td>\n";
|
print "<td align=\"right\">".(($markRate === '')?'n/a':price($markRate)."%")."</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
$cumul_achat += $objp->buying_price;
|
$cumul_achat += round($objp->buying_price, $rounding);
|
||||||
$cumul_vente += $objp->selling_price;
|
$cumul_vente += round($objp->selling_price, $rounding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -142,10 +142,11 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
$sql.= " AND d.fk_product =".$object->id;
|
$sql.= " AND d.fk_product =".$object->id;
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if (! empty($socid)) $sql.= " AND f.fk_soc = $socid";
|
if (! empty($socid)) $sql.= " AND f.fk_soc = $socid";
|
||||||
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
||||||
|
$sql .= " AND d.buy_price_ht <> 0";
|
||||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||||
$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||||
|
|
||||||
@ -165,19 +166,21 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$object->id,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$object->id,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&id=".$object->id,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&id=".$object->id,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buyng_price","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"d.marge_tx","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"d.marque_tx","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&id=".$object->id,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$cumul_achat = 0;
|
$cumul_achat = 0;
|
||||||
$cumul_vente = 0;
|
$cumul_vente = 0;
|
||||||
$cumul_qty = 0;
|
$cumul_qty = 0;
|
||||||
|
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -209,8 +212,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
$cumul_achat += $objp->buying_price;
|
$cumul_achat += round($objp->buying_price, $rounding);
|
||||||
$cumul_vente += $objp->selling_price;
|
$cumul_vente += round($objp->selling_price, $rounding);
|
||||||
$cumul_qty += $objp->qty;
|
$cumul_qty += $objp->qty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,6 +138,7 @@ if ($socid > 0)
|
|||||||
$sql.= " AND s.entity = ".$conf->entity;
|
$sql.= " AND s.entity = ".$conf->entity;
|
||||||
$sql.= " AND d.fk_facture = f.rowid";
|
$sql.= " AND d.fk_facture = f.rowid";
|
||||||
$sql.= " AND f.fk_soc = $socid";
|
$sql.= " AND f.fk_soc = $socid";
|
||||||
|
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||||
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
||||||
$sql .= " AND d.buy_price_ht <> 0";
|
$sql .= " AND d.buy_price_ht <> 0";
|
||||||
$sql.= " GROUP BY f.rowid";
|
$sql.= " GROUP BY f.rowid";
|
||||||
@ -158,18 +159,20 @@ if ($socid > 0)
|
|||||||
print_liste_field_titre($langs->trans("Invoice"),$_SERVER["PHP_SELF"],"f.facnumber","","&socid=".$_REQUEST["socid"],'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Invoice"),$_SERVER["PHP_SELF"],"f.facnumber","","&socid=".$_REQUEST["socid"],'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&socid=".$_REQUEST["socid"],'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&socid=".$_REQUEST["socid"],'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buyng_price","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"d.marge_tx","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||||
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"d.marque_tx","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&socid=".$_REQUEST["socid"],'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$cumul_achat = 0;
|
$cumul_achat = 0;
|
||||||
$cumul_vente = 0;
|
$cumul_vente = 0;
|
||||||
$cumul_qty = 0;
|
$cumul_qty = 0;
|
||||||
|
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -200,8 +203,8 @@ if ($socid > 0)
|
|||||||
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
$cumul_achat += $objp->buying_price;
|
$cumul_achat += round($objp->buying_price, $rounding);
|
||||||
$cumul_vente += $objp->selling_price;
|
$cumul_vente += round($objp->selling_price, $rounding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -524,6 +524,7 @@ class Product extends CommonObject
|
|||||||
$newdir = $conf->product->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
$newdir = $conf->product->dir_output . "/" . dol_sanitizeFileName($this->ref);
|
||||||
if (file_exists($olddir))
|
if (file_exists($olddir))
|
||||||
{
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
$res=@dol_move($olddir, $newdir);
|
$res=@dol_move($olddir, $newdir);
|
||||||
if (! $res)
|
if (! $res)
|
||||||
{
|
{
|
||||||
@ -550,11 +551,13 @@ class Product extends CommonObject
|
|||||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
{
|
{
|
||||||
$this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
|
$this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
|
||||||
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql;
|
$this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql;
|
||||||
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -548,7 +548,7 @@ if (empty($reshook))
|
|||||||
$prod->id,
|
$prod->id,
|
||||||
GETPOST('remise_percent'),
|
GETPOST('remise_percent'),
|
||||||
'',
|
'',
|
||||||
'', // TODO voir si fk_remise_except est encore valable car n'apparait plus dans les propales
|
'',
|
||||||
$price_base_type,
|
$price_base_type,
|
||||||
$pu_ttc
|
$pu_ttc
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1817,7 +1817,7 @@ else
|
|||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang);
|
$somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang,$hookmanager);
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
|||||||
@ -1416,7 +1416,8 @@ class User extends CommonObject
|
|||||||
{
|
{
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
||||||
}
|
}
|
||||||
if (! empty($dolibarr_main_force_https)) $urlwithouturlroot=preg_replace('/http:/i','https:',$urlwithouturlroot);
|
if (! empty($dolibarr_main_force_https)
|
||||||
|
|| (! empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on')) $urlwithouturlroot=preg_replace('/http:/i','https:',$urlwithouturlroot);
|
||||||
|
|
||||||
// TODO Use outputlangs to translate messages
|
// TODO Use outputlangs to translate messages
|
||||||
if (! $changelater)
|
if (! $changelater)
|
||||||
|
|||||||
@ -81,9 +81,9 @@ else
|
|||||||
if (!empty($socid)) $sql.= " AND u.fk_societe = ".$socid;
|
if (!empty($socid)) $sql.= " AND u.fk_societe = ".$socid;
|
||||||
if ($search_user)
|
if ($search_user)
|
||||||
{
|
{
|
||||||
$sql.= " AND (u.login like '%".$search_user."%' OR u.name like '%".$search_user."%' OR u.firstname like '%".$search_user."%')";
|
$sql.= " AND (u.login LIKE '%".$search_user."%' OR u.name LIKE '%".$search_user."%' OR u.firstname LIKE '%".$search_user."%')";
|
||||||
}
|
}
|
||||||
if ($sall) $sql.= " AND (u.login like '%".$db->escape($sall)."%' OR u.name like '%".$db->escape($sall)."%' OR u.firstname like '%".$db->escape($sall)."%' OR u.email like '%".$db->escape($sall)."%' OR u.note like '%".$db->escape($sall)."%')";
|
if ($sall) $sql.= " AND (u.login LIKE '%".$db->escape($sall)."%' OR u.name LIKE '%".$db->escape($sall)."%' OR u.firstname LIKE '%".$db->escape($sall)."%' OR u.email LIKE '%".$db->escape($sall)."%' OR u.note LIKE '%".$db->escape($sall)."%')";
|
||||||
$sql.=$db->order($sortfield,$sortorder);
|
$sql.=$db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -130,6 +130,7 @@ if ($result)
|
|||||||
$companystatic->canvas=$obj->canvas;
|
$companystatic->canvas=$obj->canvas;
|
||||||
print $companystatic->getNomUrl(1);
|
print $companystatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
|
// Multicompany enabled
|
||||||
else if (! empty($conf->multicompany->enabled))
|
else if (! empty($conf->multicompany->enabled))
|
||||||
{
|
{
|
||||||
if (! $obj->entity)
|
if (! $obj->entity)
|
||||||
@ -137,11 +138,15 @@ if ($result)
|
|||||||
print $langs->trans("AllEntities");
|
print $langs->trans("AllEntities");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
// $mc is defined in conf.class.php if multicompany enabled.
|
||||||
|
if (is_object($mc))
|
||||||
{
|
{
|
||||||
$mc->getInfo($obj->entity);
|
$mc->getInfo($obj->entity);
|
||||||
print $mc->label;
|
print $mc->label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if ($obj->ldap_sid)
|
else if ($obj->ldap_sid)
|
||||||
{
|
{
|
||||||
print $langs->trans("DomainUser");
|
print $langs->trans("DomainUser");
|
||||||
@ -172,7 +177,7 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -302,8 +302,7 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
|
|||||||
$user=$this->savuser;
|
$user=$this->savuser;
|
||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
$db=$this->savdb;
|
$db=$this->savdb;
|
||||||
|
$conf->projet->dir_output.='/temp';
|
||||||
$conf->project->dir_output.='/temp';
|
|
||||||
$localobject=new Project($this->savdb);
|
$localobject=new Project($this->savdb);
|
||||||
$localobject->initAsSpecimen();
|
$localobject->initAsSpecimen();
|
||||||
|
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class ImagesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($tmp['width'],250);
|
$this->assertEquals($tmp['width'],250);
|
||||||
$this->assertEquals($tmp['height'],20);*/
|
$this->assertEquals($tmp['height'],20);*/
|
||||||
|
|
||||||
return $result;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,7 +120,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFactureMercure()
|
public function testFactureMercure()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db,$mysoc;
|
||||||
$conf=$this->savconf;
|
$conf=$this->savconf;
|
||||||
$user=$this->savuser;
|
$user=$this->savuser;
|
||||||
$langs=$this->savlangs;
|
$langs=$this->savlangs;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user