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

This commit is contained in:
Laurent Destailleur 2013-04-20 23:43:19 +02:00
commit a7f169d102
33 changed files with 2699 additions and 3145 deletions

View File

@ -105,6 +105,7 @@ WARNING: If you used external modules, some of them may need to be upgraded due
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #810 ] Cannot update ODT template path
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
***** ChangeLog for 3.3.1 compared to 3.3 *****

View File

@ -1,222 +0,0 @@
<?php
/*
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/carrier.php
* \ingroup expedition
* \brief Page to setup carriers. TODO Delete this page. We mut use dictionnary instead.
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
$langs->load("admin");
$langs->load("sendings");
$langs->load("deliveries");
$langs->load('other');
if (! $user->admin)
accessforbidden();
$action=GETPOST('action','alpha');
$carrier=GETPOST('carrier','int');
$object = new Expedition($db);
/*
* Actions
*/
//if ($action==setvalue AND $carrier)
if ($action=='setvalue')
{
// need to add check on values
$object->update['code']=GETPOST('code','alpha');
$object->update['libelle']=GETPOST('libelle','alpha');
$object->update['description']=GETPOST('description','alpha');
$object->update['tracking']=GETPOST('tracking','alpha');
$object->update_delivery_method($carrier);
header("Location: carrier.php");
exit;
}
if ($action=='activate_carrier' && $carrier!='')
{
$object->activ_delivery_method($carrier);
}
if ($action=='disable_carrier' && $carrier!='')
{
$object->disable_delivery_method($carrier);
}
/*
* View
*/
$form=new Form($db);
llxHeader("","");
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("SendingsSetup"),$linkback,'setup');
print '<br>';
//if ($mesg) print $mesg.'<br>';
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
$head[$h][1] = $langs->trans("Setup");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
$head[$h][1] = $langs->trans("Carriers");
$hselected=$h;
$h++;
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$h++;
}
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
{
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
$head[$h][1] = $langs->trans("Receivings");
$h++;
}
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
/*
* Carrier List
*/
if ($action=='edit_carrier' || $action=='setvalue')
{
// Carrier Edit
if ($carrier!='') $object->list_delivery_methods($carrier);
print_titre($langs->trans("CarrierEdit"));
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?carrier='.$carrier.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setvalue">';
print '<table class="nobordernopadding" width="100%">';
$var=true;
print '<tr class="liste_titre">';
print '<td width="150">'.$langs->trans("CarrierParameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print $langs->trans("Code").'</td><td>';
print '<input size="32" type="text" name="code" value="'.$object->listmeths[0]['code'].'">';
print ' &nbsp; '.$langs->trans("Example").': CODE';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print $langs->trans("Name").'</td><td>';
print '<input size="32" type="text" name="libelle" value="'.$object->listmeths[0]['libelle'].'">';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print $langs->trans("Description").'</td><td>';
print '<input size="64" type="text" name="description" value="'.$object->listmeths[0]['description'].'">';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print $langs->trans("Tracking").'</td><td>';
print '<input size="80" type="text" name="tracking" value="'.$object->listmeths[0]['tracking'].'">';
print ' &nbsp; '.$langs->trans("Example").': http://www.website.com/dir/{TRACKID}';
print '</td></tr>';
if ($carrier)
{
print '<tr><td colspan="2" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
}
else
{
print '<tr><td colspan="2" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
}
print '</table>';
print '</form>';
}
else
{
// Display List
$object->list_delivery_methods();
$var=true;
print_titre($langs->trans("CarrierList"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="80">'.$langs->trans("Code").'</td>';
print '<td width="150">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("TrackingUrl").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="30">'.$langs->trans("Edit").'</td>';
print "</tr>\n";
$numlistmeths=count($object->listmeths);
for ($i=0; $i<$numlistmeths; $i++)
{
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td>'.$object->listmeths[$i]['code'].'</td>';
print '<td>'.$object->listmeths[$i]['libelle'].'</td>';
print '<td>'.$object->listmeths[$i]['description'].'</td>';
print '<td>'.dol_trunc($object->listmeths[$i]['tracking'],92,'middle').'</td>';
print '<td align="center">';
if($object->listmeths[$i]['active'] == 0)
{
print '<a href="carrier.php?action=activate_carrier&amp;carrier='.$object->listmeths[$i]['rowid'].'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else
{
print '<a href="carrier.php?action=disable_carrier&amp;carrier='.$object->listmeths[$i]['rowid'].'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
print '</td><td align="center">';
print '<a href="carrier.php?action=edit_carrier&amp;carrier='.$object->listmeths[$i]['rowid'].'">'.img_picto($langs->trans("Edit"),'edit').'</a>';
print '</td>';
print "</tr>\n";
}
print '<tr><td align="center"><a href="carrier.php?action=edit_carrier"><br>'.$langs->trans("Add").'</a></td><tr>';
print '</table><br>';
print '</div>';
}
llxFooter();
$db->close();
?>

View File

@ -107,7 +107,7 @@ print '<br>';
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/compta.php";
$head[$h][1] = $langs->trans("Compta");
$head[$h][1] = $langs->trans("Accountancy");
$head[$h][2] = 'Compta';
$hselected=$h;
$h++;

View File

@ -84,10 +84,6 @@ $head[$h][1] = $langs->trans("Setup");
$hselected=$h;
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
$head[$h][1] = $langs->trans("Carriers");
$h++;
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";

View File

@ -6,9 +6,9 @@
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
@ -147,7 +147,7 @@ $tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.org
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
$tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
$tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
$tabsql[18]= "SELECT rowid as rowid, code, libelle, tracking, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
$tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_input_method";
$tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
@ -203,7 +203,7 @@ $tabfield[14]= "code,libelle,price,organization,country_id,country";
$tabfield[15]= "code,libelle,width,height,unit";
$tabfield[16]= "code,libelle";
$tabfield[17]= "code,libelle";
$tabfield[18]= "code,libelle";
$tabfield[18]= "code,libelle,tracking";
$tabfield[19]= "code,libelle";
$tabfield[20]= "code,libelle";
$tabfield[21]= "code,label";
@ -231,7 +231,7 @@ $tabfieldvalue[14]= "code,libelle,price,organization,country";
$tabfieldvalue[15]= "code,libelle,width,height,unit";
$tabfieldvalue[16]= "code,libelle";
$tabfieldvalue[17]= "code,libelle";
$tabfieldvalue[18]= "code,libelle";
$tabfieldvalue[18]= "code,libelle,tracking";
$tabfieldvalue[19]= "code,libelle";
$tabfieldvalue[20]= "code,libelle";
$tabfieldvalue[21]= "code,label";
@ -259,7 +259,7 @@ $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
$tabfieldinsert[15]= "code,label,width,height,unit";
$tabfieldinsert[16]= "code,label";
$tabfieldinsert[17]= "code,libelle";
$tabfieldinsert[18]= "code,libelle";
$tabfieldinsert[18]= "code,libelle,tracking";
$tabfieldinsert[19]= "code,libelle";
$tabfieldinsert[20]= "code,libelle";
$tabfieldinsert[21]= "code,label";
@ -1084,15 +1084,23 @@ if ($id)
}
// Est-ce une entree du dictionnaire qui peut etre desactivee ?
$iserasable=1; // Oui par defaut
if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0;
if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0;
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
// True by default
$iserasable=1;
if (isset($obj->code))
{
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable = 0;
else if ($obj->code == 'RECEP') $iserasable = 0;
else if ($obj->code == 'EF0') $iserasable = 0;
}
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;';
// Active
print '<td align="center" nowrap="nowrap">';
if ($iserasable) print '<a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
else
{
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
@ -1101,11 +1109,11 @@ if ($id)
print "</td>";
// Modify link
if ($iserasable) print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action=edit#'.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'">'.img_edit().'</a></td>';
if ($iserasable) print '<td align="center"><a href="'.$url.'action=edit#'.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>';
// Delete link
if ($iserasable) print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action=delete">'.img_delete().'</a></td>';
if ($iserasable) print '<td align="center"><a href="'.$url.'action=delete">'.img_delete().'</a></td>';
else print '<td>&nbsp;</td>';
print "</tr>\n";
@ -1153,7 +1161,7 @@ else
$var=!$var;
$value=$tabname[$i];
print '<tr '.$bc[$var].'><td width="30%">';
print '<tr '.$bc[$var].'><td width="50%">';
if (! empty($tabcond[$i]))
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
@ -1299,6 +1307,7 @@ function fieldList($fieldlist,$obj='',$tabname='')
print '<td>';
$size='';
if ($fieldlist[$field]=='libelle') $size='size="32" ';
if ($fieldlist[$field]=='tracking') $size='size="92" ';
if ($fieldlist[$field]=='accountancy_code') $size='size="15" ';
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" ';
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" ';

View File

@ -201,10 +201,6 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
$head[$h][1] = $langs->trans("Setup");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
$head[$h][1] = $langs->trans("Carriers");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$hselected=$h;

View File

@ -189,10 +189,6 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
$head[$h][1] = $langs->trans("Setup");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
$head[$h][1] = $langs->trans("Carriers");
$h++;
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";

View File

@ -194,7 +194,7 @@ asort($orders);
$nbofactivatedmodules=count($conf->modules);
$moreinfo=$langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1));
if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule"));
print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'setup');
// Start to show page
@ -206,7 +206,7 @@ if ($mode==='functional') print $langs->trans("ModulesJobDesc")."<br>\n";
if ($mode==='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."<br>\n";
if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."<br>\n";
if ($nbofactivatedmodules <= 1) print ' '.img_warning($langs->trans("YouMustEnableOneModule"));
//print '<br>'."\n";

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,8 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2011-2012 Alexandre spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -99,12 +100,9 @@ $sql = "SELECT f.rowid, f.ref_supplier, f.type, f.datef, f.libelle,";
$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,";
$sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,";
$sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,";
$sql.= " ct.accountancy_code_buy as account_tva, ct.recuperableonly,";
$sql.= " ctl1.accountancy_code_buy as account_localtax1, ctl2.accountancy_code_buy as account_localtax2";
$sql.= " ct.accountancy_code_buy as account_tva, ct.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn_det fd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl1 ON fd.localtax1_tx = ctl1.localtax1 AND ctl1.fk_pays = '".$idpays."'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl2 ON fd.localtax2_tx = ctl2.localtax2 AND ctl2.fk_pays = '".$idpays."'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product";
$sql.= " JOIN ".MAIN_DB_PREFIX."facture_fourn f ON f.rowid = fd.fk_facture_fourn";
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc" ;
@ -145,6 +143,11 @@ if ($result)
$compta_localtax1 = (! empty($obj->account_localtax1)?$obj->account_localtax1:$langs->trans("CodeNotDef"));
$compta_localtax2 = (! empty($obj->account_localtax2)?$obj->account_localtax2:$langs->trans("CodeNotDef"));
$account_localtax1=getLocalTaxesFromRate($obj->tva_tx, 1, $mysoc);
$compta_localtax1= (! empty($account_localtax1[2])?$account_localtax1[2]:$langs->trans("CodeNotDef"));
$account_localtax2=getLocalTaxesFromRate($obj->tva_tx, 2, $mysoc);
$compta_localtax2= (! empty($account_localtax2[2])?$account_localtax2[2]:$langs->trans("CodeNotDef"));
$tabfac[$obj->rowid]["date"] = $obj->datef;
$tabfac[$obj->rowid]["ref"] = $obj->ref_supplier;
$tabfac[$obj->rowid]["type"] = $obj->type;
@ -166,7 +169,6 @@ else {
/*
* Show result array
*/
$i = 0;
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
///print "<td>".$langs->trans("JournalNum")."</td>";
@ -177,96 +179,71 @@ print "<td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debi
print "</tr>\n";
$var=true;
$r='';
$invoicestatic=new FactureFournisseur($db);
$companystatic=new Fournisseur($db);
foreach ($tabfac as $key => $val)
{
$invoicestatic->id=$key;
$invoicestatic->ref=$val["ref"];
$invoicestatic->type=$val["type"];
$invoicestatic->id = $key;
$invoicestatic->ref = $val["ref"];
$invoicestatic->type = $val["type"];
// product
foreach ($tabht[$key] as $k => $mt)
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$lines = array(
array(
'var' => $tabht[$key],
'label' => $langs->trans('Products'),
),
array(
'var' => $tabtva[$key],
'label' => $langs->trans('VAT')
),
array(
'var' => $tablocaltax1[$key],
'label' => $langs->transcountry('LT1', $mysoc->country_code)
),
array(
'var' => $tablocaltax2[$key],
'label' => $langs->transcountry('LT2', $mysoc->country_code)
),
array(
'var' => $tabttc[$key],
'label' => $langs->trans('ThirdParty').' ('.$companystatic->getNomUrl(0, 'supplier', 16).')',
'nomtcheck' => true,
'inv' => true
)
);
foreach ($lines as $line)
{
if ($mt)
foreach ($line['var'] as $k => $mt)
{
print "<tr ".$bc[$var]." >";
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$langs->trans("Products")."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
print "</tr>";
if (isset($line['nomtcheck']) || $mt)
{
print "<tr ".$bc[$var]." >";
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$line['label']."</td>";
if (isset($line['inv']))
{
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
}
else
{
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
}
print "</tr>";
}
}
}
// vat
foreach ($tabtva[$key] as $k => $mt)
{
if ($mt)
{
print "<tr ".$bc[$var]." >";
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$langs->trans("VAT")."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
print "</tr>";
}
}
// localtax1
foreach ($tablocaltax1[$key] as $k => $mt)
{
if ($mt)
{
print "<tr ".$bc[$var].">";
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$langs->transcountrynoentities("LT1",$mysoc->country_code)."</td>";
print "<td align='right'>".($mt>=0?price($mt):'')."</td>";
print "<td align='right'>".($mt<0?price(-$mt):'')."</td>";
print "</tr>";
}
}
// localtax2
foreach ($tablocaltax2[$key] as $k => $mt)
{
if ($mt)
{
print "<tr ".$bc[$var].">";
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$langs->transcountrynoentities("LT2",$mysoc->country_code)."</td>";
print "<td align='right'>".($mt>=0?price($mt):'')."</td>";
print "<td align='right'>".($mt<0?price(-$mt):'')."</td>";
print "</tr>";
}
}
print "<tr ".$bc[$var].">";
// third party
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
foreach ($tabttc[$key] as $k => $mt)
{
$companystatic->id=$tabcompany[$key]['id'];
$companystatic->name=$tabcompany[$key]['name'];
print "<td>".$k;
print "</td><td>".$langs->trans("ThirdParty");
print ' ('.$companystatic->getNomUrl(0,'supplier',16).')';
print "</td>";
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
}
print "</tr>";
$var = !$var;
}

View File

@ -3,8 +3,8 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -102,15 +102,12 @@ $sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
$sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,";
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.client,";
$sql.= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell,";
$sql.= " ct.accountancy_code_sell as account_tva, ct.recuperableonly,";
$sql.= " ctl1.accountancy_code_sell as account_localtax1, ctl2.accountancy_code_sell as account_localtax2";
$sql.= " ct.accountancy_code_sell as account_tva, ct.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet fd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product";
$sql.= " JOIN ".MAIN_DB_PREFIX."facture f ON f.rowid = fd.fk_facture";
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = '".$idpays."'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl1 ON fd.localtax1_tx = ctl1.localtax1 AND ctl1.fk_pays = '".$idpays."'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl2 ON fd.localtax2_tx = ctl2.localtax2 AND ctl2.fk_pays = '".$idpays."'";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_statut > 0";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)";
@ -129,6 +126,8 @@ if ($result)
$tablocaltax2 = array();
$tabttc = array();
$tabcompany = array();
$account_localtax1=0;
$account_localtax2=0;
$num = $db->num_rows($result);
$i=0;
@ -147,9 +146,12 @@ if ($result)
}
$cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)?$conf->global->COMPTA_VAT_ACCOUNT:$langs->trans("CodeNotDef"));
$compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva);
$compta_localtax1 = (! empty($obj->account_localtax1)?$obj->account_localtax1:$langs->trans("CodeNotDef"));
$compta_localtax2 = (! empty($obj->account_localtax2)?$obj->account_localtax2:$langs->trans("CodeNotDef"));
$account_localtax1=getLocalTaxesFromRate($obj->tva_tx, 1, $mysoc);
$compta_localtax1= (! empty($account_localtax1[3])?$account_localtax1[3]:$langs->trans("CodeNotDef"));
$account_localtax2=getLocalTaxesFromRate($obj->tva_tx, 2, $mysoc);
$compta_localtax2= (! empty($account_localtax2[3])?$account_localtax2[3]:$langs->trans("CodeNotDef"));
//la ligne facture
$tabfac[$obj->rowid]["date"] = $obj->datef;
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
@ -178,17 +180,15 @@ else {
*/
$i = 0;
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
//print "<td>".$langs->trans("JournalNum")."</td>";
print "<td>".$langs->trans("Date")."</td><td>".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").")</td>";
print "<td>".$langs->trans("Account")."</td>";
print "<td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
print '<td>'.$langs->trans('Date').'</td><td>'.$langs->trans('Piece').' ('.$langs->trans('InvoiceRef').')</td>';
print '<td>'.$langs->trans('Account').'</td>';
print '<td>'.$langs->trans('Type').'</td><td align="right">'.$langs->trans('Debit').'</td><td align="right">'.$langs->trans('Credit').'</td>';
print "</tr>\n";
$var=true;
$r='';
$invoicestatic=new Facture($db);
$companystatic=new Client($db);
@ -199,74 +199,62 @@ foreach ($tabfac as $key => $val)
$invoicestatic->ref=$val["ref"];
$invoicestatic->type=$val["type"];
print "<tr ".$bc[$var].">";
// third party
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
foreach ($tabttc[$key] as $k => $mt)
$companystatic->id=$tabcompany[$key]['id'];
$companystatic->name=$tabcompany[$key]['name'];
$companystatic->client=$tabcompany[$key]['client'];
$lines = array(
array(
'var' => $tabttc[$key],
'label' => $langs->trans('ThirdParty').' ('.$companystatic->getNomUrl(0, 'customer', 16).')',
'nomtcheck' => true,
'inv' => true
),
array(
'var' => $tabht[$key],
'label' => $langs->trans('Products'),
),
array(
'var' => $tabtva[$key],
'label' => $langs->trans('VAT')
),
array(
'var' => $tablocaltax1[$key],
'label' => $langs->transcountry('LT1', $mysoc->country_code)
),
array(
'var' => $tablocaltax2[$key],
'label' => $langs->transcountry('LT2', $mysoc->country_code)
)
);
foreach ($lines as $line)
{
$companystatic->id=$tabcompany[$key]['id'];
$companystatic->name=$tabcompany[$key]['name'];
$companystatic->client=$tabcompany[$key]['client'];
print "<td>".$k;
print "</td><td>".$langs->trans("ThirdParty");
print ' ('.$companystatic->getNomUrl(0,'customer',16).')';
print "</td><td align='right'>".($mt>=0?price($mt):'')."</td><td align='right'>".($mt<0?price(-$mt):'')."</td>";
}
print "</tr>";
// product
foreach ($tabht[$key] as $k => $mt)
{
if ($mt)
foreach ($line['var'] as $k => $mt)
{
print "<tr ".$bc[$var].">";
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k;
print "</td><td>".$langs->trans("Products")."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
if (isset($line['nomtcheck']) || $mt)
{
print "<tr ".$bc[$var]." >";
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$line['label']."</td>";
if (isset($line['inv']))
{
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
}
else
{
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
}
print "</tr>";
}
}
}
// vat
foreach ($tabtva[$key] as $k => $mt)
{
if ($mt)
{
print "<tr ".$bc[$var].">";
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k;
print "</td><td>".$langs->trans("VAT")."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
}
}
// localtax1
foreach ($tablocaltax1[$key] as $k => $mt)
{
if ($mt)
{
print "<tr ".$bc[$var].">";
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k;
print "</td><td>".$langs->transcountrynoentities("LT1",$mysoc->country_code)."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
}
}
// localtax2
foreach ($tablocaltax2[$key] as $k => $mt)
{
if ($mt)
{
print "<tr ".$bc[$var].">";
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k;
print "</td><td>".$langs->transcountrynoentities("LT2",$mysoc->country_code)."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
}
}
$var = !$var;
}

View File

@ -2848,7 +2848,7 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty)
dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local." thirdparty id=".(is_object($thirdparty)?$thirdparty->id:''));
// Search local taxes
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type";
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type,t.accountancy_code_sell,t.accountancy_code_buy";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'";
$sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
@ -2857,9 +2857,9 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty)
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($local == 1) return array($obj->localtax1_type, $obj->localtax1);
elseif ($local == 2) return array($obj->localtax2_type, $obj->localtax2);
else return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2);
if ($local == 1) return array($obj->localtax1_type, $obj->localtax1,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
elseif ($local == 2) return array($obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
else return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
}
return 0;

View File

@ -519,8 +519,12 @@ class doc_generic_order_odt extends ModelePDFCommandes
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
$odfHandler->saveToDisk($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -1,68 +0,0 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/modules/expedition/methode_expedition.modules.php
* \ingroup expedition
* \brief Fichier contenant la classe mere de generation de bon de livraison en PDF
* et la classe mere de numerotation des bons de livraisons
*/
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/**
* Parent class for shipping method classes
*/
class ModeleShippingMethod
{
/**
* Constructo
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
$this->db = $db;
$this->name = "NOT DEFINED";
$this->description = "ERROR IN MODULE DESCRIPTION";
}
/**
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/
static function liste_modeles($db,$maxfilenamelength=0)
{
global $conf;
$type='???';
$liste=array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}
}
?>

View File

@ -1,56 +0,0 @@
<?php
/* Copyright (C) 2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2008 Bearstech - http://bearstech.com/
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/modules/expedition/methode_expedition_colsui.modules.php
* \ingroup expedition
*/
include_once 'methode_expedition.modules.php';
/**
* Class to manage shipment Colsui
*/
class methode_expedition_colsui extends ModeleShippingMethod
{
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db=0)
{
$this->db = $db;
$this->id = 3; // Do not change this value
$this->code = "COLSUI"; // Do not change this value
$this->name = "Colissimo Suivi";
$this->description = "Colissimo Suivi";
}
/**
* Return URL of provider
*
* @param string $tracking_number Tracking number
* @return string URL for tracking
*/
function provider_url_status($tracking_number)
{
return sprintf("http://www.coliposte.net/particulier/suivi_particulier.jsp?colispart=%s",$tracking_number);
}
}
?>

View File

@ -1,57 +0,0 @@
<?php
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/modules/expedition/methode_expedition_enl.modules.php
* \ingroup expedition
*/
include_once 'methode_expedition.modules.php';
/**
* Class to manage shipment Enl
*/
class methode_expedition_enl extends ModeleShippingMethod
{
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db=0)
{
global $langs;
$this->db = $db;
$this->id = 1; // Do not change this value
$this->name = "Enlevement";
$this->code = "ENL";
$this->description = $langs->trans("Enlevement");
}
/**
* Return URL of provider
*
* @param string $tracking_number Tracking number
* @return string URL for tracking
*/
function provider_url_status($tracking_number)
{
return '';
}
}
?>

View File

@ -1,57 +0,0 @@
<?php
/* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/modules/expedition/methode_expedition_lettremax.modules.php
* \ingroup expedition
*/
include_once 'methode_expedition.modules.php';
/**
* Class to manage shipment lettremax
*/
class methode_expedition_lettremax extends ModeleShippingMethod
{
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db=0)
{
$this->db = $db;
$this->id = 4; // Do not change this value
$this->code = "LETTREMAX"; // Do not change this value
$this->name = "Lettre max";
$this->description = "Courrier suivi et lettre max";
}
/**
* Return URL of provider
*
* @param string $tracking_number Tracking number
* @return string URL for tracking
*/
function provider_url_status($tracking_number)
{
return sprintf("http://www.csuivi.courrier.laposte.fr/default.asp?EZ_ACTION=rechercheRapide&numObjet=%s",$tracking_number);
}
}
?>

View File

@ -1,59 +0,0 @@
<?php
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/modules/expedition/methode_expedition_trans.modules.php
* \ingroup expedition
*/
include_once 'methode_expedition.modules.php';
/**
* Class to manage shipment Trans
*/
class methode_expedition_trans extends ModeleShippingMethod
{
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db=0)
{
global $langs;
$this->db = $db;
$this->id = 2; // Ne pas changer cette valeur
$this->code = "TRANS";
$this->name = "Transporteur";
$this->description = $langs->trans("GenericTransport");
}
/**
* Return URL of provider
*
* @param string $tracking_number Tracking number
* @return string URL for tracking
*/
function provider_url_status($tracking_number)
{
return '';
}
}
?>

View File

@ -497,8 +497,12 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
$odfHandler->saveToDisk($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -650,7 +650,7 @@ class doc_generic_project_odt extends ModelePDFProjects
//Time ressources
$sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
$sql.= ", u.name, u.firstname";
$sql.= ", u.lastname, u.firstname";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
$sql .= " , ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE t.fk_task =".$task->id;
@ -973,8 +973,12 @@ class doc_generic_project_odt extends ModelePDFProjects
// Write new file
$odfHandler->saveToDisk($file);
//$odfHandler->exportAsAttachedPDF($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -482,8 +482,12 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
$odfHandler->saveToDisk($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -313,8 +313,12 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
$odfHandler->saveToDisk($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -1199,7 +1199,7 @@ class Expedition extends CommonObject
{
global $langs;
$listmeths = array();
$this->listmeths = array();
$i=0;
$sql = "SELECT em.rowid, em.code, em.libelle, em.description, em.tracking, em.active";
@ -1216,29 +1216,11 @@ class Expedition extends CommonObject
$label=$langs->trans('SendingMethod'.$obj->code);
$this->listmeths[$i]['libelle'] = ($label != 'SendingMethod'.$obj->code?$label:$obj->libelle);
$this->listmeths[$i]['description'] = $obj->description;
if ($obj->tracking)
{
$this->listmeths[$i]['tracking'] = $obj->tracking;
}
else
{
if ($obj->code)
{
$classname = "methode_expedition_".strtolower($obj->code);
if (file_exists(DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($obj->code).".modules.php") )
{
require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($obj->code).'.modules.php';
$shipmethod = new $classname();
$this->listmeths[$i]['tracking'] = $shipmethod->provider_url_status('{TRACKID}');
}
}
}
$this->listmeths[$i]['tracking'] = $obj->tracking;
$this->listmeths[$i]['active'] = $obj->active;
$i++;
}
}
else dol_print_error($this->db,'');
}
/**
@ -1309,8 +1291,6 @@ class Expedition extends CommonObject
*/
function GetUrlTrackingStatus($value='')
{
$code='';
if (! empty($this->shipping_method_id))
{
$sql = "SELECT em.code, em.tracking";
@ -1322,46 +1302,21 @@ class Expedition extends CommonObject
{
if ($obj = $this->db->fetch_object($resql))
{
$code = $obj->code;
$tracking = $obj->tracking;
$tracking = $obj->tracking;
}
}
}
if ($tracking)
{
$url = str_replace('{TRACKID}', $value, $tracking);
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value?$value:'url').'</a>',$url,$url);
}
else
{
if ($code)
{
$classname = "methode_expedition_".strtolower($code);
$url='';
if (file_exists(DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($code).".modules.php") && ! empty($this->tracking_number))
{
require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($code).'.modules.php';
$shipmethod = new $classname();
$url = $shipmethod->provider_url_status($this->tracking_number);
}
if ($url)
{
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value?$value:'url').'</a>',$url,$url);
}
else
{
$this->tracking_url = $value;
}
}
else
{
$this->tracking_url = $value;
}
}
}
if (!empty($tracking) && !empty($value))
{
$url = str_replace('{TRACKID}', $value, $tracking);
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value?$value:'url').'</a>',$url,$url);
}
else
{
$this->tracking_url = $value;
}
}
/**
* Classify the shipping as invoiced

View File

@ -141,6 +141,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", fk_soc";
$sql.= ", datec";
$sql.= ", datef";
$sql.= ", fk_projet";
$sql.= ", note_private";
$sql.= ", note_public";
$sql.= ", fk_user_author";
@ -154,6 +155,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", ".$this->socid;
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", '".$this->db->idate($this->date)."'";
$sql.= ", ".$this->fk_project;
$sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->db->escape($this->note_public)."'";
$sql.= ", ".$user->id.",";

View File

@ -41,6 +41,8 @@ if (!empty($conf->produit->enabled))
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (!empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
$langs->load('bills');
@ -271,6 +273,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
// Creation facture
$object->ref = $_POST['ref'];
$object->ref_supplier = $_POST['ref_supplier'];
$object->fk_project = GETPOST('projectid');
$object->socid = $_POST['socid'];
$object->libelle = $_POST['libelle'];
$object->date = $datefacture;
@ -1153,6 +1156,15 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
$form->select_date($datedue,'ech','','','',"add",1,1);
print '</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
select_projects(-1, $projectid, 'projectid');
print '</td></tr>';
}
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
print '<td>';

View File

@ -278,7 +278,7 @@ $var=true;
/*$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td style="padding:5px; width: 40%;">'.$langs->trans('GroupToValidateCP').'</td>'."\n";
print '<td style="padding:5px;">'.$langs->trans('GroupToValidateCP').'</td>'."\n";
print '<td style="padding:5px;">'.$cp->selectUserGroup('userGroup').'</td>'."\n";
print '</tr>'."\n";
*/

File diff suppressed because it is too large Load Diff

0
htdocs/includes/odtphp/odt2pdf.sh Normal file → Executable file
View File

View File

@ -311,6 +311,8 @@ PaymentConditionShortPT_ORDER=On order
PaymentConditionPT_ORDER=On order
PaymentConditionShortPT_5050=50-50
PaymentConditionPT_5050=50%% in advance, 50%% on delivery
FixAmount=Fix amount
VarAmount=Variable amount (%% tot.)
# PaymentType
PaymentTypeVIR=Bank deposit

View File

@ -336,7 +336,7 @@ EnterRefToBuildUrl=Introduzca la referencia del objeto %s
GetSecuredUrl=Obtener la URL calculada
ButtonHideUnauthorized=Ocultar los botones de acciones no autorizadas en vez de mostrarlos atenuados
TotalNumberOfActivatedModules=Número total de módulos activados: <b>%s</b>
YouMustEnableOneModule=Debe activar al menos 1 módulo.
YouMustEnableOneModule=Debe activar al menos un módulo.
ProductVatMassChange=Modificar IVA en masa
ProductVatMassChangeDesc=Esta página le permite cambiar el tipo de IVA definido en los productos o servicios de un valor a otro. Tenga en cuenta que el cambio se lleva a cabo en masa sobre toda la base de datos.
OldVATRates=Tasa de IVA antigua

View File

@ -287,6 +287,8 @@ TotalOfTwoDiscountMustEqualsOriginal=La suma del importe de los 2 nuevos descuen
ConfirmRemoveDiscount=¿Está seguro de querer eliminar este descuento?
RelatedBill=Factura asociada
RelatedBills=Facturas asociadas
FixAmount=Importe fijo
VarAmount=Importe variable (%% total)
# PaymentConditions
PaymentConditionShortRECEP=A la recepción

View File

@ -322,6 +322,8 @@ PaymentTypeVAD=Paiement en ligne
PaymentTypeShortVAD=Paiement en ligne
PaymentTypeTRA=Paiement par traite
PaymentTypeShortTRA=Traite
FixAmount=Montant Fixe
VarAmount=Montant variable (%% tot.)
BankDetails=Coordonnées bancaires
BankCode=Code banque

View File

@ -295,14 +295,13 @@ if ($sql_select)
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
$this->fetch_thirdparty();
$prod = new Product($db);
$prod->fetch($objp->fk_product);
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if (empty($newlang)) $newlang=$this->client->default_lang;
if (empty($newlang)) $newlang=$object->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);