Merge branch 'develop' into develop_orderextrafield

Conflicts:
	htdocs/commande/fiche.php
	htdocs/install/mysql/migration/3.3.0-3.4.0.sql

Change-Id: If57a2f2a386a2903b976178eb63aef2c8b09473d
This commit is contained in:
fhenry 2013-04-06 10:41:29 +02:00
commit b7137606ee
66 changed files with 631 additions and 419 deletions

View File

@ -73,6 +73,14 @@ WARNING: If you used external modules, some of them may need to be upgraded due
***** ChangeLog for 3.3.2 compared to 3.3.1 *****
-Fix: Ducth (nl_NL) translation
-Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
-Generalize fix: file with a specific mask not found, again
***** ChangeLog for 3.3.1 compared to 3.3 *****
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag

View File

@ -44,24 +44,24 @@ $object = new Expedition($db);
* Actions
*/
//if ($action==setvalue AND $carrier)
if ($action==setvalue)
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['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 AND $carrier!='')
if ($action=='activate_carrier' && $carrier!='')
{
$object->activ_delivery_method($carrier);
}
if ($action==disable_carrier AND $carrier!='')
if ($action=='disable_carrier' && $carrier!='')
{
$object->disable_delivery_method($carrier);
}
@ -134,26 +134,26 @@ if ($action=='edit_carrier' || $action=='setvalue')
$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 '<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 '<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 '<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="128" type="text" name="tracking" value="'.$object->listmeths[0][tracking].'">';
print '<input size="128" type="text" name="tracking" value="'.$object->listmeths[0]['tracking'].'">';
print ' &nbsp; '.$langs->trans("Example").': http://www.website.com/dir/{TRACKID}';
print '</td></tr>';
@ -186,25 +186,26 @@ else
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="30">'.$langs->trans("Edit").'</td>';
print "</tr>\n";
for ($i=0; $i<sizeof($object->listmeths); $i++)
$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>'.$object->listmeths[$i][tracking].'</td>';
print '<td>'.$object->listmeths[$i]['code'].'</td>';
print '<td>'.$object->listmeths[$i]['libelle'].'</td>';
print '<td>'.$object->listmeths[$i]['description'].'</td>';
print '<td>'.$object->listmeths[$i]['tracking'].'</td>';
print '<td align="center">';
if($object->listmeths[$i][active] == 0)
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>';
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 '<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 '<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";
}

View File

@ -415,7 +415,7 @@ if ($action == 'create')
$(".fulldaystartmin").attr("disabled","disabled").val("00");
$(".fulldayendhour").attr("disabled","disabled").val("23");
$(".fulldayendmin").attr("disabled","disabled").val("59");
$("#p2").attr("disabled","disabled").val("");
$("#p2").removeAttr("disabled");
}
}
setdatefields();
@ -869,7 +869,7 @@ if ($id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -878,7 +878,7 @@ if ($id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -887,7 +887,7 @@ if ($id > 0)
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '</td>';
print '</tr>';

View File

@ -178,7 +178,7 @@ if ($result)
print "<tr $bc[$var]>";
print '<td nowrap="nowrap"><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>';
print '<td>'.dol_trunc($obj->titre,38).'</td>';
print '<td align="center">'.dol_print_date($obj->date_creat,'day').'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_creat),'day').'</td>';
print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>';
$mailstatic=new Mailing($db);
print '<td align="right">'.$mailstatic->LibStatut($obj->statut,5).'</td>';

View File

@ -1199,7 +1199,6 @@ class Propal extends CommonObject
* Update value of extrafields on the proposal
*
* @param User $user Object user that modify
* @param double $remise Amount discount
* @return int <0 if ko, >0 if ok
*/
function update_extrafields($user)

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
@ -242,8 +243,7 @@ if ($resql)
llxHeader('',$langs->trans("ThirdParty"),$help_url);
}
$param='&amp;stcomm='.$stcomm.'&amp;search_nom='.urlencode($search_nom).'&amp;search_zipcode='.urlencode($search_code).'&amp;search_town='.urlencode($search_town);
// Added by Matelli
$param='&amp;stcomm='.$stcomm.'&amp;search_nom='.urlencode($search_nom).'&amp;search_zipcode='.urlencode($search_zipcode).'&amp;search_ville='.urlencode($search_ville);
// Store the status filter in the URL
if (isSet($search_cstc))
{
@ -449,4 +449,4 @@ else
llxFooter();
$db->close();
?>
?>

View File

@ -1120,7 +1120,7 @@ else if ($action == 'print_file' AND $user->rights->printipp->use)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php';
$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
$printer->print_file(GETPOST('file',alpha),GETPOST('printer',alpha));
$printer->print_file(GETPOST('file','alpha'),GETPOST('printer','alpha'));
}
else if ($action == 'update_extras')

View File

@ -559,7 +559,6 @@ class Facture extends CommonInvoice
* Load an object from its id and create a new one in database
*
* @param int $socid Id of thirdparty
* @param HookManager $hookmanager Hook manager instance
* @return int New id of clone
*/
function createFromClone($socid=0)

View File

@ -97,9 +97,9 @@ $sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.libelle,";
$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type,";
$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";
$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 ct.fk_pays = '".$idpays."'";
$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."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" ;
@ -142,7 +142,8 @@ if ($result)
$tabfac[$obj->rowid]["lib"] = $obj->libelle;
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc;
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht;
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
if($obj->recuperableonly != 1)
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
$tabcompany[$obj->rowid]=array('id'=>$obj->socid,'name'=>$obj->name);
$i++;
@ -238,4 +239,4 @@ print "</table>";
llxFooter();
$db->close();
?>
?>

View File

@ -99,12 +99,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,";
$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";
$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 ct.fk_pays = '".$idpays."'";
$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.= " 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)";
@ -149,7 +149,8 @@ if ($result)
if (! isset($tabtva[$obj->rowid][$compta_tva])) $tabtva[$obj->rowid][$compta_tva]=0;
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc;
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht;
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
if($obj->recuperableonly != 1)
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
$tabcompany[$obj->rowid]=array('id'=>$obj->socid, 'name'=>$obj->name, 'client'=>$obj->client);
$i++;
}

View File

@ -110,7 +110,7 @@ else
// Search criteria
if (GETPOST("search_ref")) $sql .=" AND p.rowid=".GETPOST("search_ref",'int');
if (GETPOST("search_account") > 0) $sql .=" AND b.fk_account=".GETPOST("search_account",'int');
if (GETPOST("search_paymenttype") > 0) $sql .=" AND c.code='".GETPOST("search_paymenttype",'int')."'";
if (GETPOST("search_paymenttype") != "") $sql .=" AND c.code='".GETPOST("search_paymenttype")."'";
if (GETPOST("search_amount")) $sql .=" AND p.amount=".price2num(GETPOST("search_amount"));
if (GETPOST("search_company")) $sql .=" AND s.nom LIKE '%".$db->escape(GETPOST("search_company"))."%'";
}

View File

@ -62,7 +62,8 @@ class Contact extends CommonObject
var $email;
var $birthday;
var $default_lang;
var $note; // Private note
var $note_public; // Public note
var $note; // Private note
var $no_email; // 1=Don't send e-mail to this contact, 0=do
var $ref_facturation; // Nb de reference facture pour lequel il est contact
@ -725,7 +726,7 @@ class Contact extends CommonObject
$this->error=$this->db->error().' sql='.$sql;
}
}
// Removed extrafields
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { // For avoid conflicts if trigger used
$result=$this->deleteExtraFields($this);
@ -1028,13 +1029,17 @@ class Contact extends CommonObject
$this->specimen=1;
$this->lastname = 'DOLIBARR';
$this->firstname = 'SPECIMEN';
$this->address = '61 jump street';
$this->zip = '75000';
$this->town = 'Paris';
$this->address = '21 jump street';
$this->zip = '99999';
$this->town = 'MyTown';
$this->country_id = 1;
$this->country_code = 'FR';
$this->country = 'France';
$this->email = 'specimen@specimen.com';
$this->note_public='This is a comment (public)';
$this->note='This is a comment (private)';
$socid = rand(1, $num_socs);
$this->socid = $socids[$socid];
}

View File

@ -894,6 +894,8 @@ class Contrat extends CommonObject
* @param float $price_base_type HT or TTC
* @param float $pu_ttc Prix unitaire TTC
* @param int $info_bits Bits de type de lignes
* @param int $fk_fournprice Fourn price id
* @param int $pa_ht Buying price HT
* @return int <0 si erreur, >0 si ok
*/
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
@ -1034,6 +1036,8 @@ class Contrat extends CommonObject
* @param timestamp $date_fin_reel Date de fin reelle
* @param float $price_base_type HT or TTC
* @param int $info_bits Bits de type de lignes
* @param int $fk_fournprice Fourn price id
* @param int $pa_ht Buying price HT
* @return int < 0 si erreur, > 0 si ok
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0)

View File

@ -45,7 +45,9 @@ class box_comptes extends ModeleBoxes
/**
* Constructor
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{

View File

@ -73,7 +73,7 @@ class box_factures_fourn_imp extends ModeleBoxes
$sql.= " AND fk_statut = 1";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " ORDER BY datelimite DESC, f.facnumber DESC ";
$sql.= " ORDER BY datelimite DESC, f.ref_supplier DESC ";
$sql.= $db->plimit($max, 0);
$result = $db->query($sql);

View File

@ -45,7 +45,9 @@ class box_members extends ModeleBoxes
/**
* Constructor
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{

View File

@ -2196,7 +2196,7 @@ abstract class CommonObject
* @param object $extrafields extrafield Object
* @param string $mode Show output (view) or input (edit) for extrafield
*
* return string
* @return string
*/
function showOptionals($extrafields,$mode='view')
{

View File

@ -65,7 +65,7 @@ class DolEditor
{
global $conf,$langs;
dol_syslog(get_class($this)."::DolEditor htmlname=".$htmlname." toolbarname=".$toolbarname);
dol_syslog(get_class($this)."::DolEditor htmlname=".$htmlname." width=".$width." height=".$height." toolbarname=".$toolbarname);
if (! $rows) $rows=round($height/20);
if (! $cols) $cols=($width?round($width/6):80);
@ -77,10 +77,8 @@ class DolEditor
$this->uselocalbrowser=$uselocalbrowser;
// Check if extended editor is ok. If not we force textarea
if (empty($conf->fckeditor->enabled) || ! $okforextendededitor)
{
$this->tool = 'textarea';
}
if (empty($conf->fckeditor->enabled) || ! $okforextendededitor) $this->tool = 'textarea';
if ($conf->browser->phone) $this->tool = 'textarea';
// Define content and some properties
if ($this->tool == 'ckeditor')

View File

@ -42,6 +42,9 @@ class dolprintIPP
* @param DoliDB $db database
* @param string $host host of Cups
* @param string $port port
* @param string $userid userid
* @param string $user user
* @param string $password password
* @return printIPP
*/
function __construct($db,$host,$port,$userid,$user,$password)
@ -76,7 +79,11 @@ class dolprintIPP
/**
* Print selected file
*
* @param string $file file
* @param string $module module
*
* @return void
*/
function print_file($file,$module)
{
@ -112,6 +119,9 @@ class dolprintIPP
/**
* List jobs print
*
* @param string $module module
*
* @return void
*/
function list_jobs($module)
{

View File

@ -97,6 +97,7 @@ class ExtraFields
* @param string $elementtype Element type ('member', 'product', 'company', ...)
* @param int $unique Is field unique or not
* @param int $required Is field required or not
* @param string $default_value Defaulted value
* @param array $param Params for field
* @return int <=0 if KO, >0 if OK
*/
@ -219,7 +220,7 @@ class ExtraFields
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
* @return int <=0 if KO, >0 if OK
*/
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0,$param)
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='')
{
global $conf;
@ -356,7 +357,7 @@ class ExtraFields
* @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) )
* @return int >0 if OK, <=0 if KO
*/
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos,$param='')
function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='')
{
$table=$elementtype.'_extrafields';
// Special case for not normalized table names
@ -814,7 +815,7 @@ class ExtraFields
* Fill array_options array for object by extrafields value (using for data send by forms)
*
* @param array $extralabels $array of extrafields
* @param object $object object
* @param object &$object object
* @return int 1 if array_options set / 0 if no value
*/
function setOptionalsFromPost($extralabels,&$object)

View File

@ -3321,8 +3321,12 @@ class Form
if ($d)
{
$usecalendar='combo';
if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) $usecalendar=empty($conf->global->MAIN_POPUP_CALENDAR)?'eldy':$conf->global->MAIN_POPUP_CALENDAR;
if ($conf->browser->phone) $usecalendar='combo';
// Show date with popup
if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none"))
if ($usecalendar != 'combo')
{
$formated_date='';
//print "e".$set_time." t ".$conf->format_date_short;
@ -3333,7 +3337,7 @@ class Form
}
// Calendrier popup version eldy
if (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR == "eldy")
if ($usecalendar == "eldy")
{
// Zone de saisie manuelle de la date
$retstring.='<input id="'.$prefix.'" name="'.$prefix.'" type="text" size="9" maxlength="11" value="'.$formated_date.'"';
@ -3355,14 +3359,13 @@ class Form
$retstring.='<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n";
}
else
{
print "Bad value of calendar";
{
print "Bad value of MAIN_POPUP_CALENDAR";
}
}
// Show date with combo selects
if (empty($conf->use_javascript_ajax) || $conf->global->MAIN_POPUP_CALENDAR == "none")
{
else
{
// Day
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'day">';
@ -3373,15 +3376,7 @@ class Form
for ($day = 1 ; $day <= 31; $day++)
{
if ($day == $sday)
{
$retstring.="<option value=\"$day\" selected=\"selected\">$day";
}
else
{
$retstring.="<option value=\"$day\">$day";
}
$retstring.="</option>";
$retstring.='<option value="'.$day.'"'.($day == $sday ? ' selected="selected"':'').'>'.$day.'</option>';
}
$retstring.="</select>";
@ -3412,15 +3407,7 @@ class Form
for ($year = $syear - 5; $year < $syear + 10 ; $year++)
{
if ($year == $syear)
{
$retstring.="<option value=\"$year\" selected=\"true\">".$year;
}
else
{
$retstring.="<option value=\"$year\">".$year;
}
$retstring.="</option>";
$retstring.='<option value="'.$year.'"'.($year == $syear ? ' selected="true"':'').'>'.$year.'</option>';
}
$retstring.="</select>\n";
}
@ -3436,21 +3423,11 @@ class Form
if ($empty) $retstring.='<option value="-1">&nbsp;</option>';
for ($hour = 0; $hour < 24; $hour++)
{
if (dol_strlen($hour) < 2)
{
$hour = "0" . $hour;
}
if ($hour == $shour)
{
$retstring.="<option value=\"$hour\" selected=\"true\">$hour</option>";
}
else
{
$retstring.="<option value=\"$hour\">$hour</option>";
}
if (strlen($hour) < 2) $hour = "0" . $hour;
$retstring.='<option value="'.$hour.'"'.(($hour == $shour)?' selected="true"':'').'>'.$hour.(empty($conf->dol_optimize_smallscreen)?'':'H').'</option>';
}
$retstring.="</select>";
$retstring.="H\n";
$retstring.='</select>';
if (empty($conf->dol_optimize_smallscreen)) $retstring.=":";
}
if ($m)
@ -3460,21 +3437,10 @@ class Form
if ($empty) $retstring.='<option value="-1">&nbsp;</option>';
for ($min = 0; $min < 60 ; $min++)
{
if (dol_strlen($min) < 2)
{
$min = "0" . $min;
}
if ($min == $smin)
{
$retstring.="<option value=\"$min\" selected=\"true\">$min</option>";
}
else
{
$retstring.="<option value=\"$min\">$min</option>";
}
if (strlen($min) < 2) $min = "0" . $min;
$retstring.='<option value="'.$min.'"'.(($min == $smin)?' selected="true"':'').'>'.$min.(empty($conf->dol_optimize_smallscreen)?'':'').'</option>';
}
$retstring.="</select>";
$retstring.="M\n";
$retstring.='</select>';
}
// Add a "Now" button

View File

@ -211,9 +211,10 @@ class FormOther
/**
* Return list of revenue stamp for country
*
* @param string $selected Value of preselected revenue stamp
* @param string $htmlname Name of combo list
* @return string HTML select list
* @param string $selected Value of preselected revenue stamp
* @param string $htmlname Name of combo list
* @param string $country_code Country Code
* @return string HTML select list
*/
function select_revenue_stamp($selected='',$htmlname='revenuestamp',$country_code='')
{

View File

@ -694,6 +694,7 @@ class Translate
/**
* Return a currency code into its symbol
*
* @param string $currency_code Currency Code
* @param string $amount If not '', show currency + amount according to langs ($10, 10).
* @return string Amount + Currency symbol encoded into UTF8
*/

View File

@ -299,9 +299,10 @@ function ajax_dialog($title,$message,$w=350,$h=150)
/**
* Convert a html select field into an ajax combobox
*
* @param string $htmlname Name of html select field
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @return string Return html string to convert a select field into a combo
* @param string $htmlname Name of html select field
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
* @return string Return html string to convert a select field into a combo
*/
function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0)
{

View File

@ -2752,7 +2752,18 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
// Some test to guess with no need to make database access
if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe
{
if ($local == 1 && ! $thirdparty_buyer->localtax1_assuj) return 0;
if ($local == 1)
{
if ($thirdparty_seller->id==$mysoc->id)
{
if (! $thirdparty_buyer->localtax1_assuj) return 0;
}
else
{
if (! $thirdparty_seller->localtax1_assuj) return 0;
}
}
if ($local == 2 && ! $thirdparty_buyer->localtax2_assuj) return 0;
}
else
@ -3049,13 +3060,29 @@ function get_default_tva($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
/**
* Fonction qui renvoie si tva doit etre tva percue recuperable
*
* @param Societe $thirdparty_seller Objet societe vendeuse
* @param Societe $thirdparty_buyer Objet societe acheteuse
* @param Societe $thirdparty_seller Thirdparty seller
* @param Societe $thirdparty_buyer Thirdparty buyer
* @param int $idprod Id product
* @param int $idprodfournprice Id supplier price for product
* @return float 0 or 1
*/
function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod)
function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
{
global $db;
if ($idprodfournprice > 0)
{
$prodprice = new ProductFournisseur($db);
$prodprice->fetch_product_fournisseur_price($idprodfournprice);
return $prodprice->fourn_tva_npr;
}
elseif ($idprod > 0)
{
$prod = new Product($db);
$prod->fetch($idprod);
return $prod->tva_npr;
}
return 0;
}
@ -3065,8 +3092,8 @@ function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod)
* Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle.
* Sinon TVA proposee par defaut=0. Fin de regle.
*
* @param Societe $thirdparty_seller Objet societe vendeuse
* @param Societe $thirdparty_buyer Objet societe acheteuse
* @param Societe $thirdparty_seller Thirdparty seller
* @param Societe $thirdparty_buyer Thirdparty buyer
* @param int $local Localtax to process (1 or 2)
* @param int $idprod Id product
* @return float localtax, -1 si ne peut etre determine

View File

@ -72,13 +72,15 @@ function dol_json_encode($elements)
$output = '{';
$last = $num - 1;
$i = 0;
foreach($elements as $key => $value)
{
$output .= '"'.$key.'":';
if (is_array($value)) $output.= json_encode($value);
else $output .= _val($value);
if ($i !== $last) $output.= ',';
++$i;
if (is_array($elements) && count($elements)>0) {
foreach($elements as $key => $value)
{
$output .= '"'.$key.'":';
if (is_array($value)) $output.= json_encode($value);
else $output .= _val($value);
if ($i !== $last) $output.= ',';
++$i;
}
}
$output.= '}';
}

View File

@ -1,38 +1,38 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* 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/
*/
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* 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/lib/pdf.lib.php
* \brief Set of functions used for PDF generation
* \ingroup core
*/
* \brief Set of functions used for PDF generation
* \ingroup core
*/
/**
* Return array with format properties of default PDF format
*
* @return array Array('width'=>w,'height'=>h,'unit'=>u);
*/
*
* @return array Array('width'=>w,'height'=>h,'unit'=>u);
*/
function pdf_getFormat()
{
global $conf,$db;
@ -78,7 +78,7 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
global $conf;
if (! empty($conf->global->MAIN_USE_FPDF) && ! empty($conf->global->MAIN_DISABLE_FPDI))
return "Error MAIN_USE_FPDF and MAIN_DISABLE_FPDI can't be set together";
return "Error MAIN_USE_FPDF and MAIN_DISABLE_FPDI can't be set together";
// We use by default TCPDF else FPDF
if (empty($conf->global->MAIN_USE_FPDF)) require_once TCPDF_PATH.'tcpdf.php';
@ -96,15 +96,15 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
{
/* Permission supported by TCPDF
- print : Print the document;
- modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
- copy : Copy or otherwise extract text and graphics from the document;
- annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
- fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
- extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
- assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
- print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
- owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
*/
- modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
- copy : Copy or otherwise extract text and graphics from the document;
- annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
- fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
- extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
- assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
- print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
- owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
*/
if (class_exists('FPDI')) $pdf = new FPDI($pagetype,$metric,$format);
else $pdf = new TCPDF($pagetype,$metric,$format);
// For TCPDF, we specify permission we want to block
@ -125,10 +125,10 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
{
// Declare here a class to overwrite FPDI to add method writeHTMLCell
/**
* This class if a enhanced FPDI class that support method writeHTMLCell
*/
* This class if a enhanced FPDI class that support method writeHTMLCell
*/
class FPDI_DolExtended extends FPDI
{
{
/**
* __call
*
@ -230,16 +230,16 @@ function pdf_getPDFFontSize($outputlangs)
*/
function pdf_getHeightForLogo($logo)
{
$height=22; $maxwidth=130;
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
$tmp=dol_getImageSize($logo);
if ($tmp['height'])
{
$width=round($height*$tmp['width']/$tmp['height']);
if ($width > $maxwidth) $height=$height*$maxwidth/$width;
}
//print $tmp['width'].' '.$tmp['height'].' '.$width; exit;
return $height;
$height=22; $maxwidth=130;
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
$tmp=dol_getImageSize($logo);
if ($tmp['height'])
{
$width=round($height*$tmp['width']/$tmp['height']);
if ($width > $maxwidth) $height=$height*$maxwidth/$width;
}
//print $tmp['width'].' '.$tmp['height'].' '.$width; exit;
return $height;
}
@ -275,15 +275,15 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
{
// Tel
if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel);
// Fax
if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax);
// EMail
if ($sourcecompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email);
// Web
if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url);
}
// Tel
if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel);
// Fax
if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax);
// EMail
if ($sourcecompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email);
// Web
if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url);
}
}
if ($mode == 'target')
@ -307,16 +307,16 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
{
// Tel
if ($targetcontact->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->tel);
// Fax
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
// EMail
if ($targetcontact->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email);
// Web
if ($targetcontact->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url);
}
{
// Tel
if ($targetcontact->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->tel);
// Fax
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
// EMail
if ($targetcontact->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email);
// Web
if ($targetcontact->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url);
}
}
else
{
@ -325,16 +325,16 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS))
{
// Tel
if ($targetcompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->tel);
// Fax
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
// EMail
if ($targetcompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email);
// Web
if ($targetcompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url);
}
{
// Tel
if ($targetcompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->tel);
// Fax
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
// EMail
if ($targetcompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email);
// Web
if ($targetcompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url);
}
}
// Intra VAT
@ -575,7 +575,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
$pdf->MultiCell(100, 3, $val, 0, 'L', 0);
//$nboflines=dol_nboflines_bis($val,120);
//$cury+=($nboflines*3)+2;
$tmpy=$pdf->getStringHeight (100, $val);
$tmpy=$pdf->getStringHeight(100, $val);
$cury+=$tmpy;
}
else if (! $usedetailedbban) $cury+=1;
@ -626,11 +626,11 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
{
// Make substitution
$substitutionarray=array(
'__FROM_NAME__' => $fromcompany->nom,
'__FROM_EMAIL__' => $fromcompany->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
'__FROM_NAME__' => $fromcompany->nom,
'__FROM_EMAIL__' => $fromcompany->email,
'__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht,
'__TOTAL_VAT__' => $object->total_vat
);
complete_substitutions_array($substitutionarray,$outputlangs,$object);
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
@ -937,11 +937,11 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
}
elseif ($desc == '(DEPOSIT)' && $object->lines[$i]->fk_remise_except)
{
$discount=new DiscountAbsolute($db);
$discount->fetch($object->lines[$i]->fk_remise_except);
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit",$discount->ref_facture_source);
// Add date of deposit
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
$discount=new DiscountAbsolute($db);
$discount->fetch($object->lines[$i]->fk_remise_except);
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit",$discount->ref_facture_source);
// Add date of deposit
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
}
else
{
@ -1024,7 +1024,6 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
* @return void
*/
function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
@ -1132,12 +1131,12 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
*/
function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
{
global $conf, $hookmanager;
global $conf, $hookmanager;
$sign=1;
if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
$sign=1;
if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@ -1164,19 +1163,19 @@ function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
{
global $hookmanager;
if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
foreach($object->hooks as $modules)
{
if (method_exists($modules[$special_code],'pdf_getlineupwithtax')) return $modules[$special_code]->pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails);
if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
foreach($object->hooks as $modules)
{
if (method_exists($modules[$special_code],'pdf_getlineupwithtax')) return $modules[$special_code]->pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails);
}
}
else
{
if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->subprice) + ($object->lines[$i]->subprice)*($object->lines[$i]->tva_tx)/100);
}
}
else
{
if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->subprice) + ($object->lines[$i]->subprice)*($object->lines[$i]->tva_tx)/100);
}
}
/**
@ -1342,10 +1341,10 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
*/
function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
{
global $conf, $hookmanager;
global $conf, $hookmanager;
$sign=1;
if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
$sign=1;
if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
if ($object->lines[$i]->special_code == 3)
{
@ -1381,27 +1380,27 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
{
global $hookmanager;
if ($object->lines[$i]->special_code == 3)
{
return $outputlangs->transnoentities("Option");
}
else
{
if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
foreach($object->hooks as $modules)
{
if (method_exists($modules[$special_code],'pdf_getlinetotalwithtax')) return $modules[$special_code]->pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails);
if ($object->lines[$i]->special_code == 3)
{
return $outputlangs->transnoentities("Option");
}
else
{
if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
foreach($object->hooks as $modules)
{
if (method_exists($modules[$special_code],'pdf_getlinetotalwithtax')) return $modules[$special_code]->pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails);
}
}
else
{
if (empty($hidedetails) || $hidedetails > 1) return
price(($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100);
}
}
}
else
{
if (empty($hidedetails) || $hidedetails > 1) return
price(($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100);
}
}
}
/**

View File

@ -118,7 +118,7 @@ class MenuManager
if ($leftmenu=="modulesadmintools" && $user->admin)
{
$langs->load("products");
array_unshift($tabMenu,array(
$array_menu_product=array(
'url'=>"/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools",
'titre'=>$langs->trans("ProductVatMassChange"),
'enabled'=>($user->admin?true:false),
@ -130,10 +130,11 @@ class MenuManager
'leftmenu'=>'modulesadmintools_massvat',
'type'=>'left',
'position'=>20
));
);
array_unshift($tabMenu,$array_menu_product);
//$newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ProductVatMassChange"), 1, $user->admin);
}
array_unshift($tabMenu,array(
$array_menu_product=array(
'url'=>"/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools",
'titre'=>$langs->trans("ModulesSystemTools"),
'enabled'=>($user->admin?true:false),
@ -144,7 +145,8 @@ class MenuManager
'leftmenu'=>'modulesadmintools',
'type'=>'left',
'position'=>20
));
);
array_unshift($tabMenu,$array_menu_product);
}
}

View File

@ -88,9 +88,10 @@ class mailing_contacts1 extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int
*/
function getNbOfRecipients()
function getNbOfRecipients($sql='')
{
global $conf;

View File

@ -151,9 +151,10 @@ class mailing_contacts2 extends MailingTargets
/**
* Return here number of distinct emails returned by your selector.
*
* @param string $sql Requete sql de comptage
* @return int
*/
function getNbOfRecipients()
function getNbOfRecipients($sql='')
{
global $conf;
@ -218,4 +219,4 @@ class mailing_contacts2 extends MailingTargets
}
?>
?>

View File

@ -157,9 +157,10 @@ class mailing_contacts3 extends MailingTargets
/**
* Return here number of distinct emails returned by your selector.
*
* @param string $sql Requete sql de comptage
* @return int Number of recipients
*/
function getNbOfRecipients()
function getNbOfRecipients($sql='')
{
global $conf;
@ -239,4 +240,4 @@ class mailing_contacts3 extends MailingTargets
}
?>
?>

View File

@ -100,9 +100,10 @@ class mailing_example extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int
*/
function getNbOfRecipients()
function getNbOfRecipients($sql='')
{
// CHANGE THIS: Optionnal

View File

@ -82,13 +82,15 @@ class mailing_fraise extends MailingTargets
}
/*
* \brief Return here number of distinct emails returned by your selector.
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
* \return int
*/
function getNbOfRecipients()
/**
* Return here number of distinct emails returned by your selector.
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int Nb of recipients
*/
function getNbOfRecipients($sql='')
{
$sql = "SELECT count(distinct(a.email)) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";

View File

@ -143,9 +143,10 @@ class mailing_framboise extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int Nb of recipients
*/
function getNbOfRecipients()
function getNbOfRecipients($sql='')
{
global $conf;

View File

@ -77,13 +77,15 @@ class mailing_pomme extends MailingTargets
}
/*
* \brief Return here number of distinct emails returned by your selector.
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
* \return int
*/
function getNbOfRecipients()
/**
* Return here number of distinct emails returned by your selector.
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int Number of recipients
*/
function getNbOfRecipients($sql='')
{
global $conf;

View File

@ -153,9 +153,10 @@ class mailing_thirdparties extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int Nb of recipients
*/
function getNbOfRecipients()
function getNbOfRecipients($sql='')
{
global $conf;

View File

@ -179,7 +179,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
* @param string $option Option
* @return int Number of recipients
*/
function getNbOfRecipients($filter=1,$option='')
function getNbOfRecipients($sql,$filter=1,$option='')
{
$now=dol_now();

View File

@ -73,9 +73,10 @@ class mailing_xinputfile extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int '' means NA
*/
function getNbOfRecipients()
function getNbOfRecipients($sql='')
{
return '';
}

View File

@ -73,9 +73,10 @@ class mailing_xinputuser extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int '' means NA
*/
function getNbOfRecipients()
function getNbOfRecipients($sql='')
{
return '';
}

View File

@ -35,10 +35,12 @@ include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
class modPrintIPP extends DolibarrModules
{
/**
* \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'acces base
*/
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
$this->db = $db ;
@ -120,25 +122,33 @@ class modPrintIPP extends DolibarrModules
}
/**
* \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module.
* Definit egalement les repertoires de donnees a creer pour ce module.
*/
function init()
{
$sql = array("CREATE TABLE IF NOT EXISTS llx_printer_ipp (rowid int(11) NOT NULL AUTO_INCREMENT,printer_name text NOT NULL, printer_location text NOT NULL,printer_uri varchar(256) NOT NULL,copy int(11) NOT NULL DEFAULT '1',module varchar(16) NOT NULL,login varchar(32) NOT NULL,PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
return $this->_init($sql);
}
/**
* \brief Fonction appelee lors de la desactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module.
*/
function remove()
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
function init($options='')
{
$sql = array();
return $this->_remove($sql);
return $this->_init($sql, $options);
}
/**
* Function called when module is disabled.
* Remove from database constants, boxes and permissions from Dolibarr database.
* Data directories are not deleted
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
function remove($options='')
{
$sql = array();
return $this->_remove($sql, $options);
}
}

View File

@ -31,9 +31,34 @@ print '<head>
<meta name="author" content="Dolibarr Development Team">
<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>
<title>'.$langs->trans('Login').' '.$title.'</title>'."\n";
print '<!-- Includes for JQuery (Ajax library) -->'."\n";
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
print '<!-- Includes CSS for JQuery (Ajax library) -->'."\n";
$jquerytheme = 'smoothness';
if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/tipTip.css" />'."\n"; // Tooltip
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css" />'."\n"; // JNotify
// jQuery jMobile
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('dol_use_jmobile'))
{
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css" />'."\n";
}
print '<!-- Includes CSS for Dolibarr theme -->'."\n";
// Includes CSS for Dolibarr theme
$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
$themesubdir='';
if (! empty($conf->modules_parts['theme'])) // This slow down
{
foreach($conf->modules_parts['theme'] as $reldir)
{
if (file_exists(dol_buildpath($reldir.$conf->css, 0)))
{
$themepath=dol_buildpath($reldir.$conf->css, 1);
$themesubdir=$reldir;
break;
}
}
}
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
@ -51,13 +76,19 @@ if (isset($conf->modules_parts['css']))
}
}
}
// JQuery. Must be before other includes
if (! empty($conf_css)) print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />'."\n";
// JQuery. Must be before other js includes
$ext='.js';
print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/dst.js"></script>'."\n";
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />'."\n";
// jQuery jMobile
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('dol_use_jmobile'))
{
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js"></script>'."\n";
}
if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER;
print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
</head>';
@ -107,13 +138,13 @@ $(document).ready(function () {
<table class="left" summary="Login pass" cellpadding="2">
<!-- Login -->
<tr>
<td valign="bottom"> &nbsp; <strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong> &nbsp; </td>
<td valign="bottom" class="loginfield"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong></td>
<td valign="bottom" nowrap="nowrap">
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" />
</td>
</tr>
<!-- Password -->
<tr><td valign="top" nowrap="nowrap"> &nbsp; <strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong> &nbsp; </td>
<tr><td valign="top" class="loginfield" nowrap="nowrap"><strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong></td>
<td valign="top" nowrap="nowrap">
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo dol_escape_htmltag($password); ?>" tabindex="2" autocomplete="off" />
</td></tr>
@ -130,7 +161,7 @@ if (! empty($hookmanager->resArray['options'])) {
?>
<?php if ($captcha) { ?>
<!-- Captcha -->
<tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td>
<tr><td valign="middle" class="loginfield" nowrap="nowrap"><b><?php echo $langs->trans('SecurityCode'); ?></b></td>
<td valign="top" nowrap="nowrap" align="left" class="none">
<table class="login_table_securitycode" style="width: 100px;"><tr>
@ -160,10 +191,16 @@ if (! empty($hookmanager->resArray['options'])) {
<?php
if ($forgetpasslink || $helpcenterlink)
{
$moreparam='';
if ($dol_hide_topmenu) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$dol_hide_topmenu;
if ($dol_hide_leftmenu) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$dol_hide_leftmenu;
if ($dol_no_mouse_hover) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$dol_no_mouse_hover;
if ($dol_use_jmobile) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$dol_use_jmobile;
echo '<br>';
echo '<div align="center" style="margin-top: 4px;">';
if ($forgetpasslink) {
echo '<a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/user/passwordforgotten.php">(';
echo '<a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/user/passwordforgotten.php'.$moreparam.'">(';
echo $langs->trans('PasswordForgotten');
if (! $helpcenterlink) {
echo ')';
@ -172,7 +209,7 @@ if ($forgetpasslink || $helpcenterlink)
}
if ($helpcenterlink) {
$url=DOL_URL_ROOT.'/support/index.php';
$url=DOL_URL_ROOT.'/support/index.php'.$moreparam;
if (! empty($conf->global->MAIN_HELPCENTER_LINKTOUSE)) $url=$conf->global->MAIN_HELPCENTER_LINKTOUSE;
echo '<a style="color: #888888; font-size: 10px" href="'.dol_escape_htmltag($url).'" target="_blank">';
if ($forgetpasslink) {

View File

@ -81,7 +81,7 @@ if (! empty($conf->margin->enabled)) {
'origin_tva_tx_cache' => 'tva_tx',
'origin_price_ttc_cache' => 'price_ttc',
'qty' => 'qty'
//'remise_percent' => 'discount'
,'remise_percent' => 'discount'
),
'update_textarea' => array(
'product_desc' => 'desc'
@ -242,7 +242,7 @@ $(document).ready(function() {
$('#select_type').val(data.type).attr('disabled','disabled').trigger('change');
//$('#price_base_type_area').show();
$('#qty').val(data.qty);
//$('#remise_percent').val(data.discount);
if($('#remise_percent').val() < data.discount) $('#remise_percent').val(data.discount);
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances['product_desc'] != "undefined") {
CKEDITOR.instances['product_desc'].setData(data.desc).focus();

View File

@ -31,9 +31,34 @@ print '<head>
<meta name="author" content="Dolibarr Development Team">
<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>
<title>'.$langs->trans('Login').' '.$title.'</title>'."\n";
print '<!-- Includes for JQuery (Ajax library) -->'."\n";
print '<!-- Includes CSS for JQuery (Ajax library) -->'."\n";
$jquerytheme = 'smoothness';
if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/tipTip.css" />'."\n"; // Tooltip
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css" />'."\n"; // JNotify
// jQuery jMobile
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('dol_use_jmobile'))
{
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css" />'."\n";
}
print '<!-- Includes CSS for Dolibarr theme -->'."\n";
// Includes CSS for Dolibarr theme
$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
$themesubdir='';
if (! empty($conf->modules_parts['theme'])) // This slow down
{
foreach($conf->modules_parts['theme'] as $reldir)
{
if (file_exists(dol_buildpath($reldir.$conf->css, 0)))
{
$themepath=dol_buildpath($reldir.$conf->css, 1);
$themesubdir=$reldir;
break;
}
}
}
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
@ -51,13 +76,19 @@ if (isset($conf->modules_parts['css']))
}
}
}
// JQuery. Must be before other includes
if (! empty($conf_css)) print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />'."\n";
// JQuery. Must be before other js includes
$ext='.js';
print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/dst.js"></script>'."\n";
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />'."\n";
// jQuery jMobile
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('dol_use_jmobile'))
{
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js"></script>'."\n";
}
if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER;
print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
</head>';
@ -95,7 +126,7 @@ $(document).ready(function () {
<!-- Login -->
<tr>
<td valign="bottom"> &nbsp; <strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong> &nbsp; </td>
<td valign="bottom" class="loginfield" nowrap="nowrap"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong></td>
<td valign="bottom" nowrap="nowrap">
<input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" />
</td>
@ -115,7 +146,7 @@ if (! empty($hookmanager->resArray['options'])) {
<?php if ($captcha) { ?>
<!-- Captcha -->
<tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td>
<tr><td valign="middle" class="loginfield" nowrap="nowrap"><b><?php echo $langs->trans('SecurityCode'); ?></b></td>
<td valign="top" nowrap="nowrap" align="left" class="none">
<table class="login_table_securitycode" style="width: 100px;"><tr>
@ -145,9 +176,15 @@ if (! empty($hookmanager->resArray['options'])) {
<br>
<div align="center" style="margin-top: 4px;">
<a style="color: #888888; font-size: 10px" href="<?php echo $dol_url_root; ?>/">
<?php echo '('.$langs->trans('BackToLoginPage').')'; ?>
</a>
<?php
$moreparam='';
if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu;
if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile;
print '<a style="color: #888888; font-size: 10px" href="'.$dol_url_root.$moreparam.'">('.$langs->trans('BackToLoginPage').')</a>';
?>
</div>
</div>

View File

@ -54,7 +54,7 @@ if(!empty($cancel)) {
if (!empty($id)) {
$action='';
}else {
Header ( "Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1');
Header("Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1');
}
}
@ -69,7 +69,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del
setEventMessage($object->error,'errors');
$action='edit';
}else {
Header ( "Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1');
Header("Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1');
}
}

View File

@ -407,7 +407,7 @@ class Cronjob extends CommonObject
$sql.= " ORDER BY $sortfield $sortorder ";
if (!empty($limit) && !empty($offset)) {
$sql.= $this->db->plimit( $limit + 1 ,$offset);
$sql.= $this->db->plimit($limit + 1,$offset);
}
$sqlwhere = array();
@ -1061,7 +1061,8 @@ class Cronjob extends CommonObject
/**
* Crob Job line class
*/
class Cronjobline{
class Cronjobline
{
var $id;
var $ref;

View File

@ -1195,14 +1195,14 @@ class Expedition extends CommonObject
{
while ($obj = $this->db->fetch_object($resql))
{
$this->listmeths[$i][rowid] = $obj->rowid;
$this->listmeths[$i][code] = $obj->code;
$this->listmeths[$i]['rowid'] = $obj->rowid;
$this->listmeths[$i]['code'] = $obj->code;
$label=$langs->trans('SendingMethod'.$obj->code);
$this->listmeths[$i][libelle] = ($label != 'SendingMethod'.$obj->code?$label:$obj->libelle);
$this->listmeths[$i][description] = $obj->description;
$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;
$this->listmeths[$i]['tracking'] = $obj->tracking;
}
else
{
@ -1214,11 +1214,11 @@ class Expedition extends CommonObject
{
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'] = $shipmethod->provider_url_status('{TRACKID}');
}
}
}
$this->listmeths[$i][active] = $obj->active;
$this->listmeths[$i]['active'] = $obj->active;
$i++;
}
}
@ -1227,7 +1227,9 @@ class Expedition extends CommonObject
/**
* Update/create delivery method.
* @param id $id id method to activate
*
* @param string $id id method to activate
*
* @return void
*/
function update_delivery_method($id='')
@ -1235,16 +1237,16 @@ class Expedition extends CommonObject
if ($id=='')
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)";
$sql.=" VALUES ('".$this->update[code]."','".$this->update[libelle]."','".$this->update[description]."','".$this->update[tracking]."')";
$sql.=" VALUES ('".$this->update['code']."','".$this->update['libelle']."','".$this->update['description']."','".$this->update['tracking']."')";
$resql = $this->db->query($sql);
}
else
{
$sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET";
$sql.= " code='".$this->update[code]."'";
$sql.= ",libelle='".$this->update[libelle]."'";
$sql.= ",description='".$this->update[description]."'";
$sql.= ",tracking='".$this->update[tracking]."'";
$sql.= " code='".$this->update['code']."'";
$sql.= ",libelle='".$this->update['libelle']."'";
$sql.= ",description='".$this->update['description']."'";
$sql.= ",tracking='".$this->update['tracking']."'";
$sql.= " WHERE rowid=".$id;
$resql = $this->db->query($sql);
}
@ -1253,7 +1255,9 @@ class Expedition extends CommonObject
/**
* Activate delivery method.
*
* @param id $id id method to activate
*
* @return void
*/
function activ_delivery_method($id)
@ -1267,7 +1271,9 @@ class Expedition extends CommonObject
/**
* DesActivate delivery method.
*
* @param id $id id method to desactivate
*
* @return void
*/
function disable_delivery_method($id)

View File

@ -392,7 +392,7 @@ class FactureFournisseur extends CommonInvoice
{
$sql = 'SELECT f.rowid, f.description, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx, f.tva';
$sql.= ', f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 ';
$sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type';
$sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits';
$sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
@ -433,6 +433,7 @@ class FactureFournisseur extends CommonInvoice
$this->lines[$i]->total_ttc = $obj->total_ttc;
$this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->product_type = $obj->product_type;
$this->lines[$i]->info_bits = $obj->info_bits;
$i++;
}
@ -1077,6 +1078,7 @@ class FactureFournisseur extends CommonInvoice
$pu_ttc = $tabprice[5];
$total_localtax1 = $tabprice[9];
$total_localtax2 = $tabprice[10];
$info_bits = empty($info_bits) ? 0 : $info_bits;
if ($idproduct)
{
@ -1106,6 +1108,7 @@ class FactureFournisseur extends CommonInvoice
if ($idproduct) $sql.= ", fk_product = ".$idproduct;
else $sql.= ", fk_product = null";
$sql.= ", product_type = ".$product_type;
$sql.= ", infos_bits = ".$infos_bits;
$sql.= " WHERE rowid = ".$id;
dol_syslog(get_class($this)."::updateline sql=".$sql);

View File

@ -48,6 +48,7 @@ class ProductFournisseur extends Product
var $product_fourn_id; // supplier id
var $fk_availability; // availability delay
var $fourn_unitprice;
var $fourn_tva_npr;
/**
@ -147,7 +148,7 @@ class ProductFournisseur extends Product
* @param float $remise Discount regarding qty (amount)
* @return int <0 if KO, >=0 if OK
*/
function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0)
function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0)
{
global $conf,$mysoc;
@ -188,6 +189,7 @@ class ProductFournisseur extends Product
$sql.= " tva_tx = ".$tva_tx.",";
$sql.= " fk_availability = ".$availability.",";
$sql.= " entity = ".$conf->entity.",";
$sql.= " info_bits = ".$newnpr.",";
$sql.= " charges = ".$charges;
$sql.= " WHERE rowid = ".$this->product_fourn_price_id;
// TODO Add price_base_type and price_ttc
@ -218,7 +220,7 @@ class ProductFournisseur extends Product
{
// Add price for this quantity to supplier
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price(";
$sql.= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, unitcharges, fk_availability, entity)";
$sql.= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, unitcharges, fk_availability, entity, info_bits)";
$sql.= " values('".$this->db->idate($now)."',";
$sql.= " ".$this->id.",";
$sql.= " ".$fourn->id.",";
@ -233,6 +235,7 @@ class ProductFournisseur extends Product
$sql.= " ".$charges.",";
$sql.= " ".$unitCharges.",";
$sql.= " ".$availability.",";
$sql.= " ".$newnpr.",";
$sql.= $conf->entity;
$sql.=")";
@ -292,7 +295,7 @@ class ProductFournisseur extends Product
function fetch_product_fournisseur_price($rowid)
{
$sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability,";
$sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.unitcharges";
$sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.unitcharges, pfp.recuperableonly as fourn_tva_npr";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= " WHERE pfp.rowid = ".$rowid;
@ -303,20 +306,21 @@ class ProductFournisseur extends Product
$obj = $this->db->fetch_object($resql);
if ($obj)
{
$this->product_fourn_price_id = $rowid;
$this->fourn_ref = $obj->ref_fourn;
$this->fourn_price = $obj->price;
$this->fourn_charges = $obj->charges;
$this->fourn_qty = $obj->quantity;
$this->fourn_remise_percent = $obj->remise_percent;
$this->fourn_remise = $obj->remise;
$this->fourn_unitprice = $obj->unitprice;
$this->fourn_unitcharges = $obj->unitcharges;
$this->tva_tx = $obj->tva_tx;
$this->product_id = $obj->fk_product; // deprecated
$this->fk_product = $obj->fk_product;
$this->fk_availability = $obj->fk_availability;
return 1;
$this->product_fourn_price_id = $rowid;
$this->fourn_ref = $obj->ref_fourn;
$this->fourn_price = $obj->price;
$this->fourn_charges = $obj->charges;
$this->fourn_qty = $obj->quantity;
$this->fourn_remise_percent = $obj->remise_percent;
$this->fourn_remise = $obj->remise;
$this->fourn_unitprice = $obj->unitprice;
$this->fourn_unitcharges = $obj->unitcharges;
$this->tva_tx = $obj->tva_tx;
$this->product_id = $obj->fk_product; // deprecated
$this->fk_product = $obj->fk_product;
$this->fk_availability = $obj->fk_availability;
$this->fourn_tva_npr = $obj->fourn_tva_npr;
return 1;
}
else
{
@ -346,7 +350,7 @@ class ProductFournisseur extends Product
$sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,";
$sql.= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.fk_product as product_fourn_id,";
$sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.unitcharges";
$sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.unitcharges, pfp.info_bits";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE pfp.entity IN (".getEntity('product', 1).")";
@ -381,6 +385,7 @@ class ProductFournisseur extends Product
$prodfourn->fourn_name = $record["supplier_name"];
$prodfourn->fk_availability = $record["fk_availability"];
$prodfourn->id = $prodid;
$prodfourn->fourn_tva_npr = $record["info_bits"];
if (!isset($prodfourn->fourn_unitprice))
{
@ -501,4 +506,4 @@ class ProductFournisseur extends Product
}
?>
?>

View File

@ -512,13 +512,14 @@ elseif ($action == 'addline')
$label.= $_POST['np_desc'];
$tvatx=get_default_tva($object->thirdparty, $mysoc, $product->id, $_POST['idprodfournprice']);
$npr = get_default_npr($object->thirdparty, $mysoc, $product->id, $_POST['idprodfournprice']);
$localtax1tx= get_localtax($tvatx, 1, $mysoc,$object->thirdparty);
$localtax2tx= get_localtax($tvatx, 2, $mysoc,$object->thirdparty);
$remise_percent=GETPOST('remise_percent');
$type = $product->type;
$result=$object->addline($label, $product->fourn_pu, $tvatx, $localtax1tx, $localtax2tx, $_POST['qty'], $idprod, $remise_percent);
$result=$object->addline($label, $product->fourn_pu, $tvatx, $localtax1tx, $localtax2tx, $_POST['qty'], $idprod, $remise_percent, '', '', 0, $npr);
}
if ($idprod == -1)
@ -530,7 +531,9 @@ elseif ($action == 'addline')
}
else
{
$tauxtva = price2num($_POST['tauxtva']);
$npr = preg_match('/\*/', $_POST['tauxtva']) ? 1 : 0 ;
$tauxtva = str_replace('*','',$_POST["tauxtva"]);
$tauxtva = price2num($tauxtva);
$localtax1tx= get_localtax($tauxtva, 1, $mysoc,$object->thirdparty);
$localtax2tx= get_localtax($tauxtva, 2, $mysoc,$object->thirdparty);
$remise_percent=GETPOST('remise_percent');
@ -548,14 +551,14 @@ elseif ($action == 'addline')
$price_base_type = 'HT';
//$desc, $pu, $txtva, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0)
$result=$object->addline($_POST['dp_desc'], $ht, $tauxtva, $localtax1tx, $localtax2tx, $_POST['qty'], 0, $remise_percent, $datestart, $dateend, 0, 0, $price_base_type, $type);
$result=$object->addline($_POST['dp_desc'], $ht, $tauxtva, $localtax1tx, $localtax2tx, $_POST['qty'], 0, $remise_percent, $datestart, $dateend, 0, $npr, $price_base_type, $type);
}
else
{
$ttc = price2num($_POST['amountttc']);
$ht = $ttc / (1 + ($tauxtva / 100));
$price_base_type = 'HT';
$result=$object->addline($_POST['dp_desc'], $ht, $tauxtva,$localtax1tx, $localtax2tx, $_POST['qty'], 0, $remise_percent, $datestart, $dateend, 0, 0, $price_base_type, $type);
$result=$object->addline($_POST['dp_desc'], $ht, $tauxtva,$localtax1tx, $localtax2tx, $_POST['qty'], 0, $remise_percent, $datestart, $dateend, 0, $npr, $price_base_type, $type);
}
}
}
@ -1774,7 +1777,7 @@ else
print '</td>';
// VAT
print '<td align="right">'.vatrate($object->lines[$i]->tva_tx).'%</td>';
print '<td align="right">'.vatrate($object->lines[$i]->tva_tx, true, $object->lines[$i]->info_bits).'%</td>';
// Unit price
print '<td align="right" nowrap="nowrap">'.price($object->lines[$i]->pu_ht,'MU').'</td>';

View File

@ -210,6 +210,18 @@ ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0;
ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0;
ALTER TABLE llx_product_price ADD COLUMN import_key varchar(14) AFTER price_by_qty;
CREATE TABLE llx_printer_ipp
(
rowid int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
printer_name text NOT NULL,
printer_location text NOT NULL,
printer_uri varchar(256) NOT NULL,
copy int(11) NOT NULL DEFAULT '1',
module varchar(16) NOT NULL,
login varchar(32) NOT NULL,
)ENGINE=innodb;
ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity;
create table llx_commande_extrafields
@ -220,3 +232,8 @@ create table llx_commande_extrafields
import_key varchar(14)
) ENGINE=innodb;
ALTER TABLE llx_commande_extrafields ADD INDEX idx_commande_extrafields (fk_object);
ALTER TABLE llx_socpeople ADD COLUMN note_public text after note;
ALTER TABLE llx_societe ADD COLUMN note_public text after note;
>>>>>>> refs/heads/develop

View File

@ -22,8 +22,8 @@
create table llx_facture_fourn
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
facnumber varchar(50) NOT NULL,
ref varchar(30),
ref_supplier varchar(50) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(30), -- reference into an external system (not used by dolibarr)

View File

@ -43,6 +43,7 @@ create table llx_facture_fourn_det
product_type integer DEFAULT 0,
date_start datetime DEFAULT NULL, -- date debut si service
date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non
fk_code_ventilation integer DEFAULT 0 NOT NULL,
import_key varchar(14)
)ENGINE=innodb;

View File

@ -0,0 +1,28 @@
-- ============================================================================
-- Copyright (C) 2013 Florian HENRY <florian.henry@open-concept.pro>
--
-- 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/>.
--
-- ============================================================================
CREATE TABLE llx_printer_ipp
(
rowid int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
printer_name text NOT NULL,
printer_location text NOT NULL,
printer_uri varchar(256) NOT NULL,
copy int(11) NOT NULL DEFAULT '1',
module varchar(16) NOT NULL,
login varchar(32) NOT NULL,
)ENGINE=innodb;

View File

@ -37,6 +37,7 @@ create table llx_product_fournisseur_price
charges double(24,8) DEFAULT 0,
unitcharges double(24,8) DEFAULT 0,
tva_tx double(6,3) NOT NULL,
info_bits integer NOT NULL DEFAULT 0,
fk_user integer,
import_key varchar(14) -- Import key
)ENGINE=innodb;

View File

@ -63,6 +63,7 @@ create table llx_societe
capital real, -- capital de la societe
fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut
note text, --
note_public text, --
prefix_comm varchar(5), -- prefix commercial
client tinyint DEFAULT 0, -- client 0/1/2
fournisseur tinyint DEFAULT 0, -- fournisseur 0/1

View File

@ -47,6 +47,7 @@ create table llx_socpeople
fk_user_creat integer DEFAULT 0, -- user qui a creel'enregistrement
fk_user_modif integer,
note text,
note_public text,
default_lang varchar(6),
canvas varchar(32), -- type of canvas if used (null by default)
import_key varchar(14)

View File

@ -259,8 +259,8 @@ LastStableVersion = Laatste stabiele versie
GenericMaskCodes = U kunt elk gewenst maskernummer invoeren. In dit masker, kunnen de volgende tags worden gebruikt:<br><b>{000000}</b> correspondeert met een nummer welke vermeerderd zal worden op elke %s. Voer zoveel nullen in als de gewenste lengte van de teller. De teller wordt aangevuld met nullen vanaf links zodat er zoveel nullen zijn als in het masker.<br><b>{000000+000}</b> hetzelfde als voorgaand maar een offset corresponderend met het nummer aan de rechterkant van het + teken is toegevoegd startend op de eerste %s. <br><b>{000000@x}</b> hetzelfde als voorgaande maar de teller wordt gereset naar nul, wanneer maand x is bereikt (x tussen 1 en 12). Als deze optie is gebruikt en x is 2 of hoger, dan is de volgorde {yy}{mm} of {yyyy}{mm} ook vereist. <br><b>{dd}</b> dag (01 t/m 31).<br><b>{mm}</b> maand (01 t/m 12).<br><b>{yy}</b>, <b>{yyyy}</b> of <b>{y}</b> jaat over 2, 4 of 1 nummer(s). <br>
GenericMaskCodes2 = <b>{cccc}</b> de afnermerscode<br><b>{cccc000}</b> de afnermerscode en n karakters wordt opgevolgd door een afnermersreferentieteller zonder offset en gereset met de globale teller.<br><b>{tttt}</b> De code van bedrijfstype op n karakters (Zie het menu 'constantent' voor de bedrijfstypes<br>
GenericMaskCodes3 = Alle andere karakters in het masker zullen intact blijven.<br>Spaties zijn niet toegestaan.<br>
GenericMaskCodes4a = <u>Voorbeeld van de 99e %s van de derde partij 'HetBedrijf' gedaan op 2007-01-31:</u><br>
GenericMaskCodes4b = <u>Voorbeeld van een derde partij gecreëerd op 2007-03-01:</u><br>
GenericMaskCodes4a = <u>Voorbeeld van de 99e %s van de Klant 'HetBedrijf' gedaan op 2007-01-31:</u><br>
GenericMaskCodes4b = <u>Voorbeeld van een Klant gecreëerd op 2007-03-01:</u><br>
GenericMaskCodes5 = <b>ABC{jj}{mm}-{000000}</b> zal <b>ABC0701-000099</b> geven<br><b>{0000+100}-ZZZ/{dd}/XXX</b> zal <b>0199-ZZZ/31/XXX</b> geven
GenericNumRefModelDesc = Geeft een aanpasbaar nummer volgens een gedefinieerd masker.
ServerAvailableOnIPOrPort = Server is beschikbaar op het IP-adres <b>%s</b> met poort <b>%s</b>
@ -523,7 +523,7 @@ PermissionAdvanced253 = Creëer / wijzig de rechten van internet / externe gebru
Permission254 = Verwijderen of uitschakelen van andere gebruikers
Permission255 = Creëren / wijzigen eigen gebruikersgegevens
Permission256 = Wijzigen eigen wachtwoord
Permission262 = Uitbreiden van de toegang tot iedereen die verbonden is aan de derde partij (niet alleen die welke verband houden met de gebruiker). Niet functioneel voor externe gebruikers (altijd beperkt tot zichzelf).
Permission262 = Uitbreiden van de toegang tot iedereen die verbonden is aan de Klant (niet alleen die welke verband houden met de gebruiker). Niet functioneel voor externe gebruikers (altijd beperkt tot zichzelf).
Permission271 = Lees CA
Permission272 = Facturen inzien
Permission273 = Facturen uitgeven
@ -827,7 +827,7 @@ UserMailRequired = E-mail verplicht om een nieuwe gebruiker creëren
CompanySetup = Derde partijenmoduleinstellingen
CompanyCodeChecker = Module voor de generatie en toetsing van codes voor derde partijen (afnemer of leverancier)
AccountCodeManager = Module voor de generatie van boekhoudkundige codes (afnemer of leverancier)
ModuleCompanyCodeAquarium = Geef een boekhoudkundige code terug opgebouwd uit "401", gevolgd door de de leverancierscode(Wanneer het een leverancier betreft) of een afnemerscode van de derde partij (Wanneer het een afnemer betreft).
ModuleCompanyCodeAquarium = Geef een boekhoudkundige code terug opgebouwd uit "401", gevolgd door de de leverancierscode(Wanneer het een leverancier betreft) of een afnemerscode van de Klant (Wanneer het een afnemer betreft).
ModuleCompanyCodePanicum = Geef een lege boekhoudkundige code terug.
ModuleCompanyCodeDigitaria = Boekhoudkundige-code is afhankelijk van derden code. De code bestaat uit het teken "C" in de eerste positie, gevolgd door de eerste 5 tekens van de derden code.
UseNotifications = Gebruik kennisgevingen
@ -1191,7 +1191,7 @@ ClickToDialDesc = Deze module maakt het mogelijk om een icoontje te tonen achter
##### Point Of Sales (CashDesk) ##### =
CashDesk = Verkooppunten
CashDeskSetup = Verkooppuntenmoduleinstellingen
CashDeskThirdPartyForSell = Algemene derde partij te gebruiken bij verkopen
CashDeskThirdPartyForSell = Algemene Klant te gebruiken bij verkopen
CashDeskBankAccountForSell = Te gebruiken rekening voor ontvangst van contacte betalingen
CashDeskBankAccountForCheque = Te gebruiken rekening voor ontvangst van betalingen per cheque
CashDeskBankAccountForCB = Te gebruiken rekening voor ontvangst van betalingen per CreditCard

View File

@ -46,9 +46,9 @@ WasAddedSuccessfully = <b>%s</b> is succesvol toegevoegd.
ObjectAlreadyLinkedToCategory = Element is al gekoppeld aan deze categorie.
CategorySuccessfullyCreated = De categorie %s is met succes toegevoegd.
ProductIsInCategories = Product / dienst is eigenaar van de volgende categorieën
SupplierIsInCategories = Derde partij is eigenaar van de volgende leverancierscategorieën
CompanyIsInCustomersCategories = Deze derde partij is eigenaar van de volgende afnemers- / prospectencategorieën
CompanyIsInSuppliersCategories = Deze derde partij is eigenaar van de volgende leverancierscategorieën
SupplierIsInCategories = Klant is eigenaar van de volgende leverancierscategorieën
CompanyIsInCustomersCategories = Deze Klant is eigenaar van de volgende afnemers- / prospectencategorieën
CompanyIsInSuppliersCategories = Deze Klant is eigenaar van de volgende leverancierscategorieën
MemberIsInCategories = Dit lid is eigenaar van de volgende ledencategorieën
ProductHasNoCategory = Dit product / dienst behoort tot geen enkele categorie
SupplierHasNoCategory = Deze leverancier behoort tot geen enkele categorie

View File

@ -3,11 +3,11 @@ CHARSET = UTF-8
ErrorCompanyNameAlreadyExists = De bedrijfsnaam %s bestaat al. kies een andere.
ErrorPrefixAlreadyExists = De prefix %s bestaat al. kies een andere.
ErrorSetACountryFirst = Stel eerst het land in
DeleteThirdParty = Verwijder een derde partij
DeleteThirdParty = Verwijder een Klant
ConfirmDeleteCompany = Weet u zeker dat u dit bedrijf en alle geërfde gegevens wilt verwijderen?
DeleteContact = Contactpersoon verwijderen
ConfirmDeleteContact = Weet u zeker dat u deze contactpersoon en alle geërfde gegevens wilt verwijderen ?
MenuNewThirdParty = Nieuwe derde partij
MenuNewThirdParty = Nieuwe Klant
MenuNewCompany = Nieuwe onderneming
MenuNewCustomer = Nieuwe afnemer
MenuNewProspect = Nieuw prospect
@ -15,33 +15,33 @@ MenuNewSupplier = Nieuwe leverancier
MenuNewPrivateIndividual = Nieuwe particulier
MenuSocGroup = Groepen
NewCompany = Nieuwe bedrijf (prospect, afnemer, leverancier)
NewThirdParty = Nieuwe derde partij (prospect, afnemer, leverancier)
NewThirdParty = Nieuwe Klant (prospect, afnemer, leverancier)
NewSocGroup = Nieuwe bedrijfsgroep
NewPrivateIndividual = Nieuwe particulier (prospect, afnemer, leverancier)
ProspectionArea = Prospectenoverzicht
SocGroup = Bedrijfsgroep
IdThirdParty = ID derde partij
IdThirdParty = ID Klant
IdCompany = ID bedrijf
IdContact = ID contactpersoon
Contacts = Contactpersonen
ContactsAddresses = Contacpersonen / adressen
ThirdPartyContacts = Contacten van derde partij
ThirdPartyContact = Contactpersoon van derde partij
ThirdPartyContacts = Contacten van Klant
ThirdPartyContact = Contactpersoon van Klant
StatusContactValidated = Status van contactpersoon
CustomerContact = Afnemerscontactpersoon
Company = Bedrijf
CompanyName = Bedrijfsnaam
Companies = Bedrijven
CountryIsInEEC = Lidstaat van de Europese Unie
ThirdPartyName = Naam van derde partij
ThirdParty = Derde partij
ThirdParties = Derde partij
ThirdPartyAll = Derde partijen (alle)
ThirdPartyName = Naam van Klant
ThirdParty = Klant
ThirdParties = Klant
ThirdPartyAll = Klanten (alle)
ThirdPartyProspects = Prospecten
ThirdPartyCustomers = Afnemers
ThirdPartyCustomersWithIdProf12 = Afnemers met %s of %s
ThirdPartySuppliers = Leveranciers
ThirdPartyType = Type derde partij
ThirdPartyType = Type Klant
Company/Fundation = Bedrijf / stichting
Individual = Particulier
ToCreateContactWithSameName = Maakt automatisch een contactpersoon met dezelfde informatie
@ -173,10 +173,10 @@ Supplier = Leverancier
CompanyList = Bedrijvenoverzicht
AddContact = Contactpersoon toevoegen
Contact = Contactpersoon
NoContactDefined = Geen contactpersoon ingesteld voor deze derde partij
NoContactDefined = Geen contactpersoon ingesteld voor deze Klant
DefaultContact = Standaard contactpersoon
AddCompany = Bedrijf toevoegen
AddThirdParty = Derde partij toevoegen
AddThirdParty = Klant toevoegen
DeleteACompany = Bedrijf verwijderen
PersonalInformations = Persoonlijke gegevens
AccountancyCode = Boekhoudkundige code
@ -186,8 +186,8 @@ CustomerAccount = Afnemersrekening
SupplierAccount = Leveranciersrekening
CustomerCodeDesc = Afnemerscode, uniek voor alle afnemers
SupplierCodeDesc = Leverancierscode, uniek voor alle leveranciers
RequiredIfCustomer = Vereist als derde partij een afnemer of prospect is
RequiredIfSupplier = Vereist als derde partij een leverancier is
RequiredIfCustomer = Vereist als Klant een afnemer of prospect is
RequiredIfSupplier = Vereist als Klant een leverancier is
ValidityControledByModule = Geldigheid gecontroleerd door module
ThisIsModuleRules = Dit zijn de regels voor deze module
LastProspect = Laatste prospect
@ -234,7 +234,7 @@ ProspectLevel = Prospectpotentieel
ContactPrivate = Privé
ContactPublic = Gedeeld
ContactVisibility = Zichtbaarheid
OthersNotLinkedToThirdParty = Anderen, niet gebonden aan een derde partij
OthersNotLinkedToThirdParty = Anderen, niet gebonden aan een Klant
ProspectStatus = Prospectstatus
PL_NONE = Geen
PL_UNKNOWN = Onbekend
@ -269,7 +269,7 @@ NoRIB = Geen bank ingesteld
NoParentCompany = Geen
ExportImport = Import - Export
ExportCardToFormat = Export details naar formaat
ContactNotLinkedToCompany = Contact niet gekoppeld aan enige derde partij
ContactNotLinkedToCompany = Contact niet gekoppeld aan enige Klant
DolibarrLogin = Dolibarr login
NoDolibarrAccess = Geen Dolibarr toegang
ExportDataset_company_1 = Bedrijven / instellingen en eigenschappen
@ -292,12 +292,12 @@ DeleteFile = Bestand verwijderen
ConfirmDeleteFile = Weet u zeker dat u dit bestand wilt verwijderen?
AllocateCommercial = Toewijzing
SelectCountry = Selecteer een land
SelectCompany = Selecteer een derde partij
SelectCompany = Selecteer een Klant
Organization = Organisatie
AutomaticallyGenerated = Automatisch gegenereerd
FiscalYearInformation = Informatie over het fiscale jaar
FiscalMonthStart = Startmaand van het fiscale jaar
YouMustCreateContactFirst = U dient voor de derde partij eerst contactpersonen met een e-mailadres instellen, voordat u kennisgevingen per e-mail kunt sturen.
YouMustCreateContactFirst = U dient voor de Klant eerst contactpersonen met een e-mailadres instellen, voordat u kennisgevingen per e-mail kunt sturen.
ListSuppliersShort = Leveranciersoverzicht
ListProspectsShort = Prospectenoverzicht
ListCustomersShort = Afnemersoverzicht

View File

@ -74,7 +74,7 @@ OtherPropals = Andere offertes
CopyPropalFrom = Maak offerte door het kopiëren van een bestaande offerte
CreateEmptyPropal = Creëer een lege offerte of uit de lijst van producten / diensten
DefaultProposalDurationValidity = Standaardgeldigheid offerte (in dagen)
UseCustomerContactAsPropalRecipientIfExist = Gebruik, indien ingesteld, het afnemerscontactadres als offerteontvangstadres in plaats van het adres van de derde partij
UseCustomerContactAsPropalRecipientIfExist = Gebruik, indien ingesteld, het afnemerscontactadres als offerteontvangstadres in plaats van het adres van de Klant
ClonePropal = Kloon offerte
ConfirmClonePropal = Weet u zeker dat u deze offerte <b>%s</b> wilt klonen?
ProposalsAndProposalsLines = Offertes en offerteregels

View File

@ -1002,7 +1002,7 @@ class Product extends CommonObject
else
{
$price = price2num($newprice,'MU');
$price_ttc = price2num($newprice) * (1 + ($newvat / 100));
$price_ttc = ( $newnpr != 1 ) ? price2num($newprice) * (1 + ($newvat / 100)) : $price;
$price_ttc = price2num($price_ttc,'MU');
if ($newminprice!='' || $newminprice==0)

View File

@ -95,7 +95,9 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn");
$quantity=GETPOST("qty");
$remise_percent=price2num(GETPOST('remise_percent','alpha'));
$tva_tx=price2num(GETPOST('tva_tx','alpha'));
$npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0 ;
$tva_tx = str_replace('*','', GETPOST('tva_tx','alpha'));
$tva_tx = price2num($tva_tx);
if (empty($quantity))
{
@ -156,7 +158,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
if (isset($_POST['ref_fourn_price_id']))
$product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']);
$ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent);
$ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, $npr);
if ($ret < 0)
{
$error++;
@ -527,4 +529,4 @@ else
// End of page
llxFooter();
$db->close();
?>
?>

View File

@ -202,14 +202,14 @@ $sql.= $where;
if ($month > 0) {
if ($year > 0) {
$start = dol_mktime(0, 0, 0, $month, 1, $year);
$end = dol_time_plus_duree($start, 1 , 'm') - 1;
$end = dol_time_plus_duree($start,1,'m') - 1;
$sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'";
} else {
$sql.= " AND date_format(".$datePrint.", '%m') = '".sprintf('%02d',$month)."'";
}
} else if ($year > 0) {
$start = dol_mktime(0, 0, 0, 1, 1, $year);
$end = dol_time_plus_duree($start, 1 , 'y') - 1;
$end = dol_time_plus_duree($start,1,'y') - 1;
$sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'";
}
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'";

View File

@ -48,7 +48,12 @@ print $langs->trans("HelpCenterDesc2")."<br>\n";
print '<br>';
print $langs->trans("ToGoBackToDolibarr",DOL_URL_ROOT.'/');
$homeurl=DOL_URL_ROOT.'/';
if (GETPOST('dol_hide_toptmenu')) $homeurl.=(strpos($homeurl,'?')===false?'?':'&').'dol_hide_toptmenu=1';
if (GETPOST('dol_hide_leftmenu')) $homeurl.=(strpos($homeurl,'?')===false?'?':'&').'dol_hide_leftmenu=1';
if (GETPOST('dol_no_mouse_hover')) $homeurl.=(strpos($homeurl,'?')===false?'?':'&').'dol_no_mouse_hover=1';
if (GETPOST('dol_use_jmobile')) $homeurl.=(strpos($homeurl,'?')===false?'?':'&').'dol_use_jmobile=1';
print $langs->trans("ToGoBackToDolibarr",$homeurl);
print '<br><br>';
@ -56,8 +61,7 @@ $style1='color: #333344; font-size: 16px; font-weight: bold';
$style2='color: #5D4455; font-weight: bold;';
print "\n";
print '<table border="0" style="spacing: 4px; padding: 0px" width="100%">';
print '<tr><td width="50%" valign="top">';
print '<div style="width: 100%"><div class="inline-block">';
print "\n";
// Forum/wiki support
@ -73,12 +77,12 @@ print '<br>'.$langs->trans("TypeOfHelp").'/'.$langs->trans("Efficiency").'/'.$la
print $langs->trans("TypeHelpDev").'/'.img_picto_common('','redstar','',1).img_picto_common('','redstar','',1).'/'.img_picto_common('','star','',1).img_picto_common('','star','',1).img_picto_common('','star','',1).img_picto_common('','star','',1);
print '</td></tr></table>';
print '</td>';
print '</tr>';
print '<tr>';
print '<td align="center" valign="top">';
print '<table class="nocellnopadd">';
/*print '<tr><td align="center" valign="top">';
print img_picto_common('','who.png','',1);
@ -99,8 +103,7 @@ print '</table>'."\n";
print "\n";
print '</td><td width="50%" valign="top">'."\n";
print "\n";
print '</div><div class="inline-block">';
// Online support
@ -134,9 +137,10 @@ print '</td>';
print '</tr>';
print '</table>'."\n";
print '</td></tr>';
print '<tr><td width="50%" valign="top">'."\n";
print "\n";
print '</div><div class="inline-block">';
// EMail support
print '<table class="login" width="100%">';
@ -170,8 +174,9 @@ print '</td>';
print '</tr>';
print '</table>'."\n";
print '</td><td width="50%" valign="top">'."\n";
print "\n";
print '</div><div class="inline-block">';
// Other support
print '<table class="login" width="100%">';
@ -207,9 +212,10 @@ print '</tr>';
print '</table>'."\n";
print "\n";
print '</td>';
print '</tr>';
print '</table>';
print '<div style="clear: both"></div>';
print '</div>';
pFooter();
?>

View File

@ -2090,11 +2090,15 @@ class User extends CommonObject
}
/**
* Update user using data from the LDAP
* // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?)
* Update user using data from the LDAP
*
* @param ldapuser &$ldapuser Ladp User
*
* @return int <0 if KO, >0 if OK
*/
function update_ldap2dolibarr(&$ldapuser)
{
// TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?)
global $user, $conf;
$this->firstname=$ldapuser->{$conf->global->LDAP_FIELD_FIRSTNAME};

View File

@ -55,6 +55,13 @@ $conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1);
$hookmanager->initHooks(array('passwordforgottenpage'));
if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1;
if (GETPOST('dol_hide_topmenu') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1;
if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1;
if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1;
if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1;
/**
* Actions
*/