Merge commit 'c74bf517e2895b09738996fb55f2f509bf46e7f1' into develop-68

This commit is contained in:
aspangaro 2015-10-07 06:29:48 +02:00
commit 01a6a0ffba
1139 changed files with 9180 additions and 5827 deletions

View File

@ -351,7 +351,7 @@ For users:
Use accesskey on form search.
- New: Intervention documents are now available in ECM module.
- New: Add attachments on user card + in ECM module.
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
- New: Can add __PROJECT_REF__ and __THIRDPARTY_NAME__ into email topic or content template.
- New: [ task #1204 ] add Numering contrat module free (like leopard in product module).
- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice.
- New: Enable supplier price log table.

View File

@ -41,23 +41,21 @@ If you want to build/test package locally:
# Push/declare Dolibarr sources to Launchpad
#----------------------------------
- From Launchpad project (https://launchpad.net/dolibarr), register a series:
Call it 'trunk' or 'beta' or 'stable'
Call it 'trunk' or 'stable'
Use branch (dev):
~eldy/dolibarr/develop
~eldy/dolibarr/beta
~eldy/dolibarr/stable
https://launchpad.net/~eldy/dolibarr/develop
https://launchpad.net/~eldy/dolibarr/stable
or
Use URL pattern (beta or stable):
Use URL pattern (stable):
For stable: http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz
For beta: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_x.y.*.tar.gz
- For Dev, you can also add link serie to GIT HEAD.
- For beta and stable, you can init from command line
cd bzr/dolibarr-[beta|stable]
- For stable, you can init from command line
cd bzr/dolibarr-stable
bzr init
bzr add
bzr commit -m "Init"
bzr push lp:~yourlogin/dolibarr/[beta|stable]
bzr push lp:~yourlogin/dolibarr/stable
- List of series are visible here: https://launchpad.net/dolibarr/+series
@ -65,19 +63,19 @@ If you want to build/test package locally:
#----------------------------------
# create local repository
cd bzr
bzr branch lp:~yourlogin/dolibarr/[develop|beta|stable] dolibarr-[dev|beta|stable]
cd dolibarr-[dev|beta|stable]
bzr branch lp:~yourlogin/dolibarr/[develop|stable] dolibarr-[dev|stable]
cd dolibarr-[dev|stable]
# Update
bzr update
-- Update files here. Remove all and overwrite --
-- Update files here: Remove all (except .bzr dir) and overwrite --
bzr status
bzr add *
bzr commit -m "Description of change"
bzr commit -m "Upstream version x.y"
bzr push
# Init debian dir repository into launchpad (when repository for sources does not exist)
#----------------------------------
- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
cd bzr
mkdir debian
cd debian
@ -85,25 +83,25 @@ If you want to build/test package locally:
bzr init
bzr add
bzr commit -m "Init control files"
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name or just bzr push if into a known branch)
bzr push lp:~yourlogin/+junk/debian-[dev|stable] (put here any branch name or just bzr push if into a known branch)
- or download it from launchpad bazaar:
cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
# Get debian dir repository from launchpad (when repository for sources already exists)
#----------------------------------
cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
# To update debian dir into launchpad (when repository for sources already exists)
#----------------------------------
cd bzr
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
cd debian-[dev|beta|stable]
bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
cd debian-[dev|stable]
bzr status
-- Update files here --
bzr commit -m "Description of change"
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable]
bzr push lp:~yourlogin/+junk/debian-[dev|stable]
# Define a recipe into launchpad (a rule to build packages into a PPA)
@ -115,10 +113,6 @@ If you want to build/test package locally:
# bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
lp:dolibarr
merge packaging lp:~yourlogin/+junk/debian-dev
For beta:
# bzr-builder format 0.3 deb-version {debupstream}-1~{revno}
lp:dolibarr/beta
merge packaging lp:~yourlogin/+junk/debian-beta
For stable:
# bzr-builder format 0.3 deb-version {debupstream}-2~{revno}
lp:dolibarr/stable
@ -126,13 +120,12 @@ If you want to build/test package locally:
- Run command
cd bzr
bzr dailydeb dolibarr.recipe working-dir
This will create a directory "working-dir" with dolibarr sources and will add sources from ~yourlogin/+junk/debian-[dev|beta|stable]
This will create a directory "working-dir" with dolibarr sources and will add sources from ~yourlogin/+junk/debian-[dev|stable]
- Test package sources
sudo pbuilder build <working-dir>/<project>_<version>.dsc
List of recipes created
https://code.launchpad.net/~eldy/+recipe/dolibarr-dev
https://code.launchpad.net/~eldy/+recipe/dolibarr-beta
https://code.launchpad.net/~eldy/+recipe/dolibarr-stable
@ -147,9 +140,6 @@ https://code.launchpad.net/~eldy/+recipe/dolibarr-stable
For the development snapshot version:
deb http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
For the beta version:
deb http://ppa.launchpad.net/yourlogin/dolibarr-beta/ubuntu precise main
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-beta/ubuntu precise main
For the stable version:
deb http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

File diff suppressed because one or more lines are too long

View File

@ -30,8 +30,9 @@ then
else
for file in `find htdocs/langs/$1/*.lang -type f`
do
echo $file
export basefile=`basename $file | sed -s s/\.lang//g`
echo "tx push --skip -r dolibarr.$basfile -t -l $1 $2 $3 $4"
echo "tx push --skip -r dolibarr.$basefile -t -l $1 $2 $3 $4"
tx push --skip -r dolibarr.$basefile -t -l $1 $2 $3 $4
done
fi

View File

@ -326,25 +326,8 @@ if (empty($reshook))
if ($result >= 0 && ! count($object->errors))
{
// Categories association
// First we delete all categories association
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_member';
$sql .= ' WHERE fk_member = ' . $object->id;
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
// Then we add the associated categories
$categories = GETPOST('memcats', 'array');
if (! empty($categories))
{
$cat = new Categorie($db);
foreach ($categories as $id_category)
{
$cat->fetch($id_category);
$cat->add_type($object, 'member');
}
}
$object->setCategories($categories);
// Logo/Photo save
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1,$object,'member').'/photos';
@ -560,15 +543,7 @@ if (empty($reshook))
{
// Categories association
$memcats = GETPOST('memcats', 'array');
if (! empty($memcats))
{
$cat = new Categorie($db);
foreach ($memcats as $id_category)
{
$cat->fetch($id_category);
$cat->add_type($object, 'member');
}
}
$object->setCategories($memcats);
$db->commit();
$rowid=$object->id;
@ -1478,7 +1453,14 @@ else
// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i','*',$object->pass).'</td></tr>';
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i','*',$object->pass);
if ((! empty($object->pass) || ! empty($object->pass_crypted)) && empty($object->user_id))
{
$langs->load("errors");
$htmltext=$langs->trans("WarningPasswordSetWithNoAccount");
print ' '.$form->textwithpicto('', $htmltext,1,'warning');
}
print '</td></tr>';
}
// Address

View File

@ -520,10 +520,12 @@ class Adherent extends CommonObject
if ($result >= 0)
{
//var_dump($this->user_login);exit;
//var_dump($this->login);exit;
$luser->login=$this->login;
$luser->civility_id=$this->civility_id;
$luser->firstname=$this->firstname;
$luser->lastname=$this->lastname;
$luser->login=$this->user_login;
$luser->pass=$this->pass;
$luser->societe_id=$this->societe;
@ -1942,6 +1944,49 @@ class Adherent extends CommonObject
}
}
/**
* Sets object to supplied categories.
*
* Deletes object from existing categories not supplied.
* Adds it to non existing supplied categories.
* Existing categories are left untouch.
*
* @param int[]|int $categories Category or categories IDs
*/
public function setCategories($categories)
{
// Handle single category
if (!is_array($categories)) {
$categories = array($categories);
}
// Get current categories
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$c = new Categorie($this->db);
$existing = $c->containing($this->id, Categorie::TYPE_MEMBER, 'id');
// Diff
if (is_array($existing)) {
$to_del = array_diff($existing, $categories);
$to_add = array_diff($categories, $existing);
} else {
$to_del = array(); // Nothing to delete
$to_add = $categories;
}
// Process
foreach ($to_del as $del) {
$c->fetch($del);
$c->del_type($this, 'member');
}
foreach ($to_add as $add) {
$c->fetch($add);
$c->add_type($this, 'member');
}
return;
}
/**
* Function used to replace a thirdparty id with another one.
*

View File

@ -38,6 +38,7 @@ $search_login=GETPOST('search_login');
$search_note=GETPOST('search_note');
$search_account=GETPOST('search_account','int');
$search_amount=GETPOST('search_amount','int');
$optioncss = GETPOST('optioncss','alpha');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -139,6 +140,7 @@ if ($result)
if ($search_login) $param.="&search_login=".$search_login;
if ($search_acount) $param.="&search_account=".$search_account;
if ($search_amount) $param.="&search_amount=".$search_amount;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
if ($sall)
@ -146,10 +148,9 @@ if ($result)
print $langs->trans("Filter")." (".$langs->trans("Ref").", ".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
}
$param="";
$param.="&statut=$statut&date_select=$date_select";
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -48,6 +48,7 @@ $search_email=GETPOST("search_email");
$search_categ = GETPOST("search_categ",'int');
$catid = GETPOST("catid",'int');
$sall=GETPOST("sall");
$optioncss = GETPOST('optioncss','alpha');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -176,6 +177,7 @@ if ($resql)
if ($search_email) $param.="&search_email=".$search_email;
if ($filter) $param.="&filter=".$filter;
if ($type > 0) $param.="&type=".$type;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
if ($sall)
@ -185,6 +187,7 @@ if ($resql)
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].($param?'?'.$param:'').'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
// Filter on categories

View File

@ -204,11 +204,11 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
}
}
else if ($action == 'set_COMMANDE_FREE_TEXT')
else if ($action == 'set_ORDER_FREE_TEXT')
{
$freetext = GETPOST("COMMANDE_FREE_TEXT"); // No alpha here, we want exact string
$freetext = GETPOST("ORDER_FREE_TEXT"); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "COMMANDE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -552,10 +552,10 @@ $var=true;
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_COMMANDE_FREE_TEXT">';
print '<input type="hidden" name="action" value="set_ORDER_FREE_TEXT">';
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')<br>';
$variablename='COMMANDE_FREE_TEXT';
$variablename='ORDER_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';

View File

@ -226,11 +226,11 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK')
}
}
if ($action == 'set_FACTURE_FREE_TEXT')
if ($action == 'set_INVOICE_FREE_TEXT')
{
$freetext = GETPOST('FACTURE_FREE_TEXT'); // No alpha here, we want exact string
$freetext = GETPOST('INVOICE_FREE_TEXT'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "FACTURE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "INVOICE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -753,10 +753,10 @@ print '</form>';
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="action" value="set_FACTURE_FREE_TEXT" />';
print '<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />';
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>';
$variablename='FACTURE_FREE_TEXT';
$variablename='INVOICE_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';

View File

@ -203,7 +203,6 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
{
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -554,7 +553,7 @@ print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
print '</form>';
// print products on fichinter
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';

219
htdocs/admin/payment.php Normal file
View File

@ -0,0 +1,219 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/payment.php
* \ingroup facture
* \brief Page to setup invoices payments
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
$langs->load("admin");
$langs->load("errors");
$langs->load('other');
$langs->load('bills');
if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$type='invoice';
/*
* Actions
*/
if ($action == 'updateMask')
{
$maskconstpayment=GETPOST('maskconstpayment','alpha');
$maskpayment=GETPOST('maskpayment','alpha');
if ($maskconstpayment) $res = dolibarr_set_const($db,$maskconstpayment,$maskpayment,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
if ($action == 'setmod')
{
dolibarr_set_const($db, "PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity);
}
/*
* View
*/
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
llxHeader("",$langs->trans("BillsSetup"),'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura');
$form=new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup');
$head = invoice_admin_prepare_head();
dol_fiche_head($head, 'payment', $langs->trans("Invoices"), 0, 'invoice');
/*
* Numbering module
*/
print load_fiche_titre($langs->trans("PaymentsNumberingModule"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '</tr>'."\n";
clearstatcache();
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/payment/");
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS'))
{
$filebis = $file;
$classname = preg_replace('/\.php$/','',$file);
// For compatibility
if (! is_file($dir.$filebis))
{
$filebis = $file."/".$file.".modules.php";
$classname = "mod_payment_".$file;
}
// Check if there is a filter on country
preg_match('/\-(.*)_(.*)$/',$classname,$reg);
if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue;
$classname = preg_replace('/\-.*$/','',$classname);
if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
{
// Chargement de la classe de numerotation
require_once $dir.$filebis;
$module = new $classname($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
if ($module->isEnabled())
{
$var = !$var;
print '<tr '.$bc[$var].'><td width="100">';
echo preg_replace('/\-.*$/','',preg_replace('/mod_payment_/','',preg_replace('/\.php$/','',$file)));
print "</td><td>\n";
print $module->info();
print '</td>';
// Show example of numbering module
print '<td class="nowrap">';
$tmp=$module->getExample();
if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
else print $tmp;
print '</td>'."\n";
print '<td align="center">';
//print "> ".$conf->global->PAYMENT_ADDON." - ".$file;
if ($conf->global->PAYMENT_ADDON == $file || $conf->global->PAYMENT_ADDON.'.php' == $file)
{
print img_picto($langs->trans("Activated"),'switch_on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
print '</td>';
$payment=new Paiement($db);
$payment->initAsSpecimen();
// Example
$htmltooltip='';
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval=$module->getNextValue($mysoc,$payment);
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
$htmltooltip.=$langs->trans("NextValue").': ';
if ($nextval) {
if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
$nextval = $langs->trans($nextval);
$htmltooltip.=$nextval.'<br>';
} else {
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
if ($conf->global->PAYMENT_ADDON.'.php' == $file) // If module is the one used, we show existing errors
{
if (! empty($module->error)) dol_htmloutput_mesg($module->error,'','error',1);
}
print '</td>';
print "</tr>\n";
}
}
}
}
closedir($handle);
}
}
}
print '</table>';
dol_fiche_end();
llxFooter();
$db->close();

View File

@ -129,11 +129,11 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK')
}
}
if ($action == 'set_PROPALE_FREE_TEXT')
if ($action == 'set_PROPOSAL_FREE_TEXT')
{
$freetext = GETPOST('PROPALE_FREE_TEXT'); // No alpha here, we want exact string
$freetext = GETPOST('PROPOSAL_FREE_TEXT'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "PROPALE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
$res = dolibarr_set_const($db, "PROPOSAL_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@ -575,10 +575,10 @@ print '</form>';
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_PROPALE_FREE_TEXT">';
print '<input type="hidden" name="action" value="set_PROPOSAL_FREE_TEXT">';
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnProposal").' ('.$langs->trans("AddCRIfTooLong").')<br>';
$variablename='PROPALE_FREE_TEXT';
$variablename='PROPOSAL_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';

View File

@ -126,7 +126,9 @@ if ($action == 'activate_encryptdbpassconf')
$result = encodedecode_dbpassconf(1);
if ($result > 0)
{
// database value not required
sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
// database value not required
//dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
header("Location: security.php");
exit;
@ -141,6 +143,8 @@ else if ($action == 'disable_encryptdbpassconf')
$result = encodedecode_dbpassconf(0);
if ($result > 0)
{
sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
// database value not required
//dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity);
header("Location: security.php");

View File

@ -39,6 +39,8 @@ $showpass=GETPOST('showpass');
*/
$label=$db::LABEL;
$type=$db->type;
$help_url='EN:Restores|FR:Restaurations|ES:Restauraciones';
llxHeader('','',$help_url);
@ -91,7 +93,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
<fieldset id="exportoptions">
<legend><?php echo $langs->trans("ImportMethod"); ?></legend>
<?php
if ($label == 'MySQL')
if (in_array($type, array('mysql', 'mysqli')))
{
?>
<div class="formelementrow">
@ -100,7 +102,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
</div>
<?php
}
else if ($label == 'PostgreSQL')
else if (in_array($type, array('pgsql')))
{
?>
<div class="formelementrow">
@ -123,7 +125,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
<div id="div_container_sub_exportoptions">
<?php
if ($label == 'MySQL')
if (in_array($type, array('mysql', 'mysqli')))
{
?>
<fieldset id="mysql_options">
@ -157,7 +159,7 @@ if ($label == 'MySQL')
</fieldset>
<?php
}
else if ($label == 'PostgreSQL')
else if (in_array($type, array('pgsql')))
{
?>
<fieldset id="postgresql_options">

View File

@ -31,6 +31,7 @@ $langs->load("admin");
if (! $user->rights->bookmark->lire) {
restrictedArea($user, 'bookmarks');
}
$optioncss = GETPOST('optioncss','alpha');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -88,21 +89,23 @@ if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$param = "";
if ($optioncss != '') $param ='&optioncss='.$optioncss;
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
//print "<td>&nbsp;</td>";
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","","",'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","", $param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Title"),'','');
print "</td>";
print_liste_field_titre($langs->trans("Link"),'','');
print "</td>";
print_liste_field_titre($langs->trans("Target"),'','','','','align="center"');
print "</td>";
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","", $param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","", $param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","", $param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
print "</tr>\n";

View File

@ -1234,7 +1234,7 @@ class Categorie extends CommonObject
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode
* (0, 1, 2, ...) is deprecated.
* @param string $mode 'object'=Get array of fetched category instances, 'label'=Get array of category
* labels
* labels, 'id'= Get array of category IDs
*
* @return mixed Array of category objects or < 0 if KO
*/
@ -1251,7 +1251,7 @@ class Categorie extends CommonObject
$type = $map_type[$type];
}
$sql = "SELECT ct.fk_categorie, c.label";
$sql = "SELECT ct.fk_categorie, c.label, c.rowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . $id . " AND c.type = " . $this->MAP_ID[$type];
$sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")";
@ -1261,11 +1261,11 @@ class Categorie extends CommonObject
{
while ($obj = $this->db->fetch_object($res))
{
if ($mode == 'label')
{
if ($mode == 'id') {
$cats[] = $obj->rowid;
} else if ($mode == 'label') {
$cats[] = $obj->label;
}
else {
} else {
$cat = new Categorie($this->db);
$cat->fetch($obj->fk_categorie);
$cats[] = $cat;

View File

@ -615,7 +615,19 @@ class ActionComm extends CommonObject
$this->error=$this->db->lasterror();
$error++;
}
if (! $error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.= " WHERE fk_actioncomm=".$this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res=$this->db->query($sql);
if ($res < 0) {
$this->error=$this->db->lasterror();
$error++;
}
}
// Removed extrafields
if (! $error) {
$result=$this->deleteExtraFields();

View File

@ -43,6 +43,7 @@ $actioncode=GETPOST("actioncode","alpha",3);
$pid=GETPOST("projectid",'int',3);
$status=GETPOST("status",'alpha');
$type=GETPOST('type');
$optioncss = GETPOST('optioncss','alpha');
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear'));
@ -134,6 +135,7 @@ $userstatic=new User($db);
$nav='';
$nav.='<form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
if ($optioncss != '') $nav.= '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.='<input type="hidden" name="status" value="'.$status.'">';
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
@ -165,6 +167,7 @@ if ($showbirthday) $param.="&showbirthday=1";
if ($pid) $param.="&projectid=".$pid;
if ($type) $param.="&type=".$type;
if ($usergroup) $param.="&usergroup=".$usergroup;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
$sql = "SELECT";
if ($usergroup > 0) $sql.=" DISTINCT";
@ -272,6 +275,7 @@ if ($resql)
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?'.$param.'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
$i = 0;
print '<table class="liste" width="100%">';

View File

@ -978,7 +978,7 @@ $form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$formaskpricesupplier = new FormAskPriceSupplier($db);
$formmargin = new FormMargin($this->db);
$formmargin = new FormMargin($db);
$companystatic = new Societe($db);
$now = dol_now();
@ -1802,7 +1802,7 @@ if ($action == 'create')
// Tableau des substitutions
$formmail->substit['__ASKREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__CONTACTCIVNAME__'] = '';
$formmail->substit['__PERSONALIZED__'] = '';

View File

@ -159,6 +159,7 @@ if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql.= ", s.code_client";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -198,6 +199,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1,'customer',16);
print '</td>';
@ -230,6 +233,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
$langs->load("orders");
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql.= ", s.code_client";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -269,6 +273,8 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1,'customer',16);
print '</td>';
@ -304,6 +310,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
$langs->load("boxes");
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
$sql.= ", s.code_client";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (1, 2, 3)";
@ -333,6 +340,8 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
$companystatic->id=$objp->rowid;
$companystatic->name=$objp->name;
$companystatic->client=$objp->client;
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas=$objp->canvas;
print '<tr '.$bc[$var].'>';
print '<td class="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>';
@ -362,6 +371,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
$langs->load("boxes");
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
$sql.= ", s.code_fournisseur";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.fournisseur = 1";
@ -389,6 +399,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
$objp = $db->fetch_object($result);
$companystatic->id=$objp->rowid;
$companystatic->name=$objp->name;
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas=$objp->canvas;
print '<tr '.$bc[$var].'>';
print '<td class="nowrap">'.$companystatic->getNomUrl(1,'supplier',44).'</td>';
@ -434,6 +446,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
$langs->load("contracts");
$sql = "SELECT s.nom as name, s.rowid, s.canvas, ";
$sql.= ", s.code_client";
$sql.= " c.statut, c.rowid as contratid, p.ref, c.mise_en_service as datemes, c.fin_validite as datefin, c.date_cloture as dateclo";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
@ -468,6 +481,8 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO
print '<td>';
$companystatic->id=$objp->rowid;
$companystatic->name=$objp->name;
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas=$objp->canvas;
print $companystatic->getNomUrl(1,'customer',44);
print '</td>'."\n";
@ -492,6 +507,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$langs->load("propal");
$sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql.= ", s.code_client";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -552,6 +568,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$companystatic->id=$obj->rowid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1, 'company', 44);
print '</td>';
@ -588,6 +606,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
$langs->load("orders");
$sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
$sql.= ", s.code_client";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -648,6 +667,8 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
$companystatic->id=$obj->rowid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1, 'company', 44);
print '</td>';

View File

@ -60,6 +60,7 @@ $search_compta = GETPOST("search_compta");
$search_status = GETPOST("search_status",'int');
$search_country = GETPOST("search_country",'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty",'int');
$optioncss = GETPOST('optioncss','alpha');
// Load sale and categ filters
$search_sale = GETPOST("search_sale",'int');
@ -179,12 +180,14 @@ if ($result)
if ($search_status != '') $param.='&amp;search_status='.htmlspecialchars($search_status);
if ($search_country != '') $param.='&amp;search_country='.htmlspecialchars($search_country);
if ($search_type_thirdparty != '') $param.='&amp;search_type_thirdparty='.htmlspecialchars($search_type_thirdparty);
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;
print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies.png');
$i = 0;
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
// Filter on categories
$moreforfilter='';

View File

@ -1184,7 +1184,7 @@ $form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$formpropal = new FormPropal($db);
$formmargin = new FormMargin($this->db);
$formmargin = new FormMargin($db);
$companystatic = new Societe($db);
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
@ -2324,7 +2324,7 @@ if ($action == 'create')
$formmail->substit['__PROPREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__REFCLIENT__'] = $object->ref_client;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__PERSONALIZED__'] = '';
$formmail->substit['__CONTACTCIVNAME__'] = '';

View File

@ -364,7 +364,7 @@ class Propal extends CommonObject
* @param string $price_base_type HT or TTC
* @param float $pu_ttc Prix unitaire TTC
* @param int $info_bits Bits de type de lignes
* @param int $type Type of line (product, service)
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
* @param int $rang Position of line
* @param int $special_code Special code (also used by externals modules!)
* @param int $fk_parent_line Id of parent line
@ -417,14 +417,28 @@ class Propal extends CommonObject
{
$this->db->begin();
// Calcul du total TTC et de la TVA pour la ligne a partir de
$product_type=$type;
if (!empty($fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($fk_product);
$product_type=$product->type;
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_PROPOSAL) && $product_type == 0 && $product->stock_reel < $qty) {
$this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback();
return -3;
}
}
// Calcul du total TTC et de la TVA pour la ligne a partir de
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, '', $localtaxes_type);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, '', $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];

View File

@ -48,7 +48,7 @@ class PropaleStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param int $userid Id user for filter (creation user)
*/
function __construct($db, $socid=0, $userid=0)

View File

@ -59,6 +59,7 @@ $search_author=GETPOST('search_author','alpha');
$search_product_category=GETPOST('search_product_category','int');
$search_town=GETPOST('search_town','alpha');
$viewstatut=GETPOST('viewstatut');
$optioncss = GETPOST('optioncss','alpha');
$object_statut=GETPOST('propal_statut');
$sall=GETPOST("sall");
@ -255,11 +256,13 @@ if ($result)
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
if ($search_author) $param.='&search_author='.$search_author;
if ($search_town) $param.='&search_town='.$search_town;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->name:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_commercial.png');
// Lignes des champs de filtre
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
$i = 0;
print '<table class="liste" width="100%">';

View File

@ -89,7 +89,7 @@ $extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('ordercard','globalcard'));
@ -1432,6 +1432,8 @@ if ($action == 'create' && $user->rights->commande->creer)
$form->selectInputReason($demand_reason_id, 'demand_reason_id', '', 1);
print '</td></tr>';
// TODO How record was recorded OrderMode (llx_c_input_method)
// Project
if (! empty($conf->projet->enabled) && $socid > 0)
{
@ -1973,7 +1975,7 @@ if ($action == 'create' && $user->rights->commande->creer)
}
print '</td></tr>';
// Source
// Origin
print '<tr><td height="10">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Source');
@ -1993,6 +1995,8 @@ if ($action == 'create' && $user->rights->commande->creer)
// print '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=22&origin=order&originid='.$object->id.'">'.$langs->trans("DictionarySource").'</a>';
print '</td></tr>';
// TODO How record was recorded OrderMode (llx_c_input_method)
// Project
if (! empty($conf->projet->enabled))
{
@ -2410,7 +2414,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$formmail->substit ['__ORDERREF__'] = $object->ref;
$formmail->substit ['__SIGNATURE__'] = $user->signature;
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit ['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit ['__PERSONALIZED__'] = '';
$formmail->substit ['__CONTACTCIVNAME__'] = '';

View File

@ -1131,7 +1131,7 @@ class Commande extends CommonOrder
* @param float $txtva Taux de tva force, sinon -1
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param int $fk_product Id du produit/service predefini
* @param int $fk_product Id of product
* @param float $remise_percent Pourcentage de remise de la ligne
* @param int $info_bits Bits de type de lignes
* @param int $fk_remise_except Id remise
@ -1139,7 +1139,7 @@ class Commande extends CommonOrder
* @param float $pu_ttc Prix unitaire TTC
* @param int $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param int $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* @param int $type Type of line (0=product, 1=service)
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
* @param int $rang Position of line
* @param int $special_code Special code (also used by externals modules!)
* @param int $fk_parent_line Parent line
@ -1201,29 +1201,7 @@ class Commande extends CommonOrder
{
$this->db->begin();
// Calcul du total TTC et de la TVA pour la ligne a partir de
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'', $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
$total_localtax1 = $tabprice[9];
$total_localtax2 = $tabprice[10];
// Rang to use
$rangtouse = $rang;
if ($rangtouse == -1)
{
$rangmax = $this->line_max($fk_parent_line);
$rangtouse = $rangmax + 1;
}
$product_type=$type;
$product_type=$type;
if (!empty($fk_product))
{
$product=new Product($this->db);
@ -1238,6 +1216,27 @@ class Commande extends CommonOrder
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
}
}
// Calcul du total TTC et de la TVA pour la ligne a partir de
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type,'', $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
$total_localtax1 = $tabprice[9];
$total_localtax2 = $tabprice[10];
// Rang to use
$rangtouse = $rang;
if ($rangtouse == -1)
{
$rangmax = $this->line_max($fk_parent_line);
$rangtouse = $rangmax + 1;
}
// TODO A virer
// Anciens indicateurs: $price, $remise (a ne plus utiliser)

View File

@ -48,7 +48,7 @@ class CommandeStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param string $mode Option ('customer', 'supplier')
* @param int $userid Id user for filter (creation user)
*/

View File

@ -26,6 +26,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
if (!$user->rights->commande->lire) accessforbidden();
@ -47,6 +48,7 @@ if ($user->societe_id > 0)
*/
$commandestatic=new Commande($db);
$companystatic=new Societe($db);
$form = new Form($db);
$formfile = new FormFile($db);
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
@ -167,6 +169,9 @@ else
if (! empty($conf->commande->enabled))
{
$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
$sql.= ", s.client";
$sql.= ", s.code_client";
$sql.= ", s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -192,10 +197,23 @@ if (! empty($conf->commande->enabled))
{
$var=!$var;
$obj = $db->fetch_object($resql);
$commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client=$obj->code_client;
$companystatic->canvas=$obj->canvas;
print "<tr ".$bc[$var].">";
print '<td class="nowrap">';
print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td></tr>';
print $commandestatic->getNomUrl(1);
print "</td>";
print '<td class="nowrap">';
print $companystatic->getNomUrl(1,'company',16);
print '</td></tr>';
$i++;
}
}
@ -216,6 +234,9 @@ $max=5;
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,";
$sql.= " s.nom as name, s.rowid as socid";
$sql.= ", s.client";
$sql.= ", s.code_client";
$sql.= ", s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -250,6 +271,12 @@ if ($resql)
$commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client=$obj->code_client;
$companystatic->canvas=$obj->canvas;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding nowrap">';
print $commandestatic->getNomUrl(1);
@ -268,7 +295,9 @@ if ($resql)
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
print '<td class="nowrap">';
print $companystatic->getNomUrl(1,'company',16);
print '</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem),'day').'</td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
print '</tr>';
@ -286,6 +315,9 @@ else dol_print_error($db);
if (! empty($conf->commande->enabled))
{
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
$sql.= ", s.client";
$sql.= ", s.code_client";
$sql.= ", s.canvas";
$sql.=" FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -319,6 +351,12 @@ if (! empty($conf->commande->enabled))
$commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client=$obj->code_client;
$companystatic->canvas=$obj->canvas;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding nowrap">';
print $commandestatic->getNomUrl(1);
@ -337,7 +375,9 @@ if (! empty($conf->commande->enabled))
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
print '<td class="nowrap">';
print $companystatic->getNomUrl(1,'company',24);
print '</td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
@ -357,6 +397,9 @@ if (! empty($conf->commande->enabled))
if (! empty($conf->commande->enabled))
{
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
$sql.= ", s.client";
$sql.= ", s.code_client";
$sql.= ", s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -390,6 +433,12 @@ if (! empty($conf->commande->enabled))
$commandestatic->id=$obj->rowid;
$commandestatic->ref=$obj->ref;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client=$obj->code_client;
$companystatic->canvas=$obj->canvas;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="96" class="nobordernopadding nowrap">';
print $commandestatic->getNomUrl(1);
@ -408,7 +457,9 @@ if (! empty($conf->commande->enabled))
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
print '<td>';
print $companystatic->getNomUrl(1,'company');
print '</td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';

View File

@ -55,6 +55,7 @@ $socid=GETPOST('socid','int');
$search_user=GETPOST('search_user','int');
$search_sale=GETPOST('search_sale','int');
$search_total_ht=GETPOST('search_total_ht','alpha');
$optioncss = GETPOST('optioncss','alpha');
// Security check
$id = (GETPOST('orderid')?GETPOST('orderid'):GETPOST('id','int'));
@ -250,6 +251,7 @@ if ($resql)
if ($search_user > 0) $param.='&search_user='.$search_user;
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
if ($search_total_ht != '') $param.='&search_total_ht='.$search_total_ht;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
$num = $db->num_rows($resql);
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_commercial.png');
@ -257,6 +259,7 @@ if ($resql)
// Lignes des champs de filtre
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print '<table class="noborder" width="100%">';

View File

@ -198,10 +198,14 @@ if ($resql)
{
$numr=$db->num_rows($resqlr);
$i=0;
$last_ok=0;
while (($i < $numr) && ($i < $nbmax))
{
$objr = $db->fetch_object($resqlr);
if (! $last_ok) {
$last_releve = $objr->num_releve;
$last_ok=1;
}
$i++;
$liste='<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$acct->id.'&amp;num='.$objr->num_releve.'">'.$objr->num_releve.'</a> &nbsp; '.$liste;
}
@ -218,11 +222,11 @@ if ($resql)
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?account='.$acct->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"rappro\">";
print "<input type=\"hidden\" name=\"account\" value=\"".$acct->id."\">";
print '<input type="hidden" name="action" value="rappro">';
print '<input type="hidden" name="account" value="'.$acct->id.'">';
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
print '<input class="flat" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):$objp->num_releve).'" size="10">';
print '<input class="flat" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):$last_releve).'" size="10">';
print '<br>';
if ($options)
{

View File

@ -1801,7 +1801,7 @@ if (empty($reshook))
$form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$formmargin = new FormMargin($this->db);
$formmargin = new FormMargin($db);
$bankaccountstatic = new Account($db);
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
@ -3840,7 +3840,7 @@ else if ($id > 0 || ! empty($ref))
$formmail->substit['__FACREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__REFCLIENT__'] = $object->ref_client;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__PROJECT_NAME__'] = (is_object($object->projet)?$object->projet->title:'');
$formmail->substit['__PERSONALIZED__'] = '';

View File

@ -1995,7 +1995,7 @@ class Facture extends CommonInvoice
* @param int $fk_remise_except Id discount used
* @param string $price_base_type 'HT' or 'TTC'
* @param double $pu_ttc Unit price with tax (> 0 even for credit note)
* @param int $type Type of line (0=product, 1=service)
* @param int $type Type of line (0=product, 1=service). Not used if fk_product is defined, the type of product is used.
* @param int $rang Position of line
* @param int $special_code Special code (also used by externals modules!)
* @param string $origin 'order', ...
@ -2060,6 +2060,20 @@ class Facture extends CommonInvoice
{
$this->db->begin();
$product_type=$type;
if (!empty($fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($fk_product);
$product_type=$product->type;
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) {
$this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback();
return -3;
}
}
// Calcul du total TTC et de la TVA pour la ligne a partir de
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
@ -2067,7 +2081,7 @@ class Facture extends CommonInvoice
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc);
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, $situation_percent);
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, $situation_percent);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
@ -2084,20 +2098,6 @@ class Facture extends CommonInvoice
$rangtouse = $rangmax + 1;
}
$product_type=$type;
if (!empty($fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($fk_product);
$product_type=$product->type;
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) {
$this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback();
return -3;
}
}
// Insert line
$this->line=new FactureLigne($this->db);

View File

@ -45,7 +45,7 @@ class FactureStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param string $mode Option ('customer', 'supplier')
* @param int $userid Id user for filter (creation user)
*/
@ -168,7 +168,7 @@ class FactureStats extends Stats
$sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")";
$sql.= " FROM ".$this->from;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
$sql.= " AND ".$this->where;
$sql.= " GROUP BY dm";
@ -188,7 +188,7 @@ class FactureStats extends Stats
$sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg";
$sql.= " FROM ".$this->from;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE ".$this->where;
$sql.= " GROUP BY year";
$sql.= $this->db->order('year','DESC');

View File

@ -191,7 +191,7 @@ if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcusto
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
if ($search_status != '') $sql.= " AND f.fk_statut = ".$db->escape($search_status);
if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status);
if ($month > 0)
{
if ($year > 0 && empty($day))
@ -270,6 +270,7 @@ if ($resql)
if ($search_user > 0) $param.='&search_user=' .$search_user;
if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht;
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc;
if ($search_status > 0) $param.='&search_status='.$search_status;
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png');
$i = 0;

View File

@ -7,6 +7,7 @@
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -658,7 +659,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$text.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
print '<input type="hidden" name="closepaidinvoices" value="'.GETPOST('closepaidinvoices').'">';
}
$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
}
print "</form>\n";

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -201,7 +202,7 @@ if ($action == 'valide')
print '<table class="border" width="100%">';
// Ref
print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="3">'.$object->id.'</td></tr>';
print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="3">'.$object->ref.'</td></tr>';
// Date payment
print '<tr><td>'.$form->editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).'</td><td colspan="3">';

View File

@ -4,7 +4,8 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -81,7 +82,7 @@ class Paiement extends CommonObject
*/
function fetch($id, $ref='', $fk_bank='')
{
$sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank,';
$sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.fk_bank,';
$sql.= ' c.code as type_code, c.libelle as type_libelle,';
$sql.= ' p.num_paiement, p.note,';
$sql.= ' b.fk_account';
@ -104,7 +105,7 @@ class Paiement extends CommonObject
{
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->ref = $obj->ref;
$this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp);
$this->numero = $obj->num_paiement;
@ -173,8 +174,10 @@ class Paiement extends CommonObject
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)";
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$totalamount."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")";
$ref = $this->getNextNumRef('');
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)";
$sql.= " VALUES (".$conf->entity.", '".$ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$totalamount."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")";
dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -773,6 +776,116 @@ class Paiement extends CommonObject
}
}
/**
* Return next reference of customer invoice not already used (or last reference)
* according to numbering module defined into constant FACTURE_ADDON
*
* @param Societe $soc object company
* @param string $mode 'next' for next value or 'last' for last value
* @return string free ref or last ref
*/
function getNextNumRef($soc,$mode='next')
{
global $conf, $db, $langs;
$langs->load("bills");
// Clean parameters (if not defined or using deprecated value)
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON='mod_payment_cicada';
else if ($conf->global->PAYMENT_ADDON=='ant') $conf->global->PAYMENT_ADDON='mod_payment_ant';
else if ($conf->global->PAYMENT_ADDON=='cicada') $conf->global->PAYMENT_ADDON='mod_payment_cicada';
if (! empty($conf->global->PAYMENT_ADDON))
{
$mybool=false;
$file = $conf->global->PAYMENT_ADDON.".php";
$classname = $conf->global->PAYMENT_ADDON;
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/payment/");
// Load file with numbering class (if found)
if (is_file($dir.$file) && is_readable($dir.$file))
{
$mybool |= include_once $dir . $file;
}
}
// For compatibility
if (! $mybool)
{
$file = $conf->global->PAYMENT_ADDON.".php";
$classname = "mod_payment_".$conf->global->PAYMENT_ADDON;
$classname = preg_replace('/\-.*$/','',$classname);
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/payment/";
// Load file with numbering class (if found)
if (is_file($dir.$file) && is_readable($dir.$file)) {
$mybool |= include_once $dir . $file;
}
}
}
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
/**
* $numref can be empty in case we ask for the last value because if there is no invoice created with the
* set up mask.
*/
if ($mode != 'last' && !$numref) {
dol_print_error($db,"Payment::getNextNumRef ".$obj->error);
return "";
}
return $numref;
}
else
{
$langs->load("errors");
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
return "";
}
}
/**
* Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines
* @return void
*/
function initAsSpecimen($option='')
{
global $user,$langs,$conf;
$now=dol_now();
$arraynow=dol_getdate($now);
$nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']);
// Initialize parameters
$this->id=0;
$this->ref = 'SPECIMEN';
$this->specimen=1;
$this->facid = 1;
$this->datepaye = $nownotime;
}
/**
* Return clicable name (with picto eventually)

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -95,7 +96,7 @@ $formother=new FormOther($db);
if (GETPOST("orphelins"))
{
// Paiements lies a aucune facture (pour aide au diagnostic)
$sql = "SELECT p.rowid, p.datep as dp, p.amount,";
$sql = "SELECT p.rowid, p.ref, p.datep as dp, p.amount,";
$sql.= " p.statut, p.num_paiement,";
$sql.= " c.code as paiement_code";
// Add fields for extrafields
@ -117,7 +118,7 @@ if (GETPOST("orphelins"))
}
else
{
$sql = "SELECT DISTINCT p.rowid, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives
$sql = "SELECT DISTINCT p.rowid, p.ref, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives
$sql.= " p.statut, p.num_paiement,";
$sql.= " c.code as paiement_code,";
$sql.= " ba.rowid as bid, ba.label,";
@ -164,7 +165,7 @@ else
{
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
if ($search_ref > 0) $sql .=" AND p.rowid=".$search_ref;
if ($search_ref) $sql .=natural_search('p.ref', $search_ref);
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'";
if ($search_amount) $sql .=" AND p.amount='".$db->escape(price2num($search_amount))."'";
@ -253,7 +254,7 @@ if ($resql)
print '<td>';
$paymentstatic->id=$objp->rowid;
$paymentstatic->ref=$objp->rowid;
$paymentstatic->ref=$objp->ref;
print $paymentstatic->getNomUrl(1);
print '</td>';

View File

@ -49,6 +49,7 @@ $pagenext = $page + 1;
$limit = $conf->liste_limit;
if (! $sortfield) $sortfield="s.datep";
if (! $sortorder) $sortorder="DESC";
$optioncss = GETPOST('optioncss','alpha');
$filtre=$_GET["filtre"];
@ -120,10 +121,12 @@ if ($result)
$param='';
if ($typeid) $param.='&amp;typeid='.$typeid;
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;
print_barre_liste($langs->trans("SalariesPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines, 'title_accountancy.png');
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -224,13 +225,7 @@ if (empty($reshook))
} else {
// Categories association
$contcats = GETPOST( 'contcats', 'array' );
if (!empty( $contcats )) {
$cat = new Categorie( $db );
foreach ($contcats as $id_category) {
$cat->fetch( $id_category );
$cat->add_type( $object, 'contact' );
}
}
$object->setCategories($contcats);
}
}
@ -283,12 +278,72 @@ if (empty($reshook))
$action = 'edit';
}
if (! $error)
{
$contactid=GETPOST("contactid",'int');
$object->fetch($contactid);
// Photo save
$dir = $conf->societe->dir_output."/contact/".$object->id."/photos";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
if ($file_OK)
{
if (GETPOST('deletephoto'))
{
$fileimg=$dir.'/'.$object->photo;
$dirthumbs=$dir.'/thumbs';
dol_delete_file($fileimg);
dol_delete_dir_recursive($dirthumbs);
$object->photo = '';
}
if (image_format_supported($_FILES['photo']['name']) > 0)
{
dol_mkdir($dir);
if (@is_dir($dir))
{
$newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1);
if (! $result > 0)
{
$errors[] = "ErrorFailedToSaveFile";
}
else
{
$object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
// Create small thumbs for company (Ratio is near 16/9)
// Used on logon for example
$imgThumbSmall = vignette($newfile, $maxwidthsmall, $maxheightsmall, '_small', $quality);
// Create mini thumbs for company (Ratio is near 16/9)
// Used on menu or for setup page for example
$imgThumbMini = vignette($newfile, $maxwidthmini, $maxheightmini, '_mini', $quality);
}
}
}
else
{
$errors[] = "ErrorBadImageFormat";
}
}
else
{
switch($_FILES['photo']['error'])
{
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form
$errors[] = "ErrorFileSizeTooLarge";
break;
case 3: //uploaded file was only partially uploaded
$errors[] = "ErrorFilePartiallyUploaded";
break;
}
}
$object->oldcopy = clone$object;
$object->old_lastname = GETPOST("old_lastname");
@ -304,6 +359,7 @@ if (empty($reshook))
$object->zip = GETPOST("zipcode");
$object->town = GETPOST("town");
$object->state_id = GETPOST("state_id",'int');
$object->fk_departement = GETPOST("state_id",'int'); // For backward compatibility
$object->country_id = GETPOST("country_id",'int');
$object->email = GETPOST("email",'alpha');
@ -333,13 +389,8 @@ if (empty($reshook))
// Then we add the associated categories
$categories = GETPOST( 'contcats', 'array' );
if (!empty( $categories )) {
$cat = new Categorie( $db );
foreach ($categories as $id_category) {
$cat->fetch( $id_category );
$cat->add_type( $object, 'contact' );
}
}
$object->setCategories($categories);
$object->old_lastname='';
$object->old_firstname='';
$action = 'view';
@ -709,7 +760,7 @@ else
print '</script>'."\n";
}
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" name="formsoc">';
print '<form enctype="multipart/form-data" method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" name="formsoc">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$id.'">';
print '<input type="hidden" name="action" value="update">';
@ -916,6 +967,23 @@ else
else print $langs->trans("NoDolibarrAccess");
print '</td></tr>';
// Photo
print '<tr class="hideonsmartphone">';
print '<td>'.fieldLabel('Photo','photoinput').'</td>';
print '<td colspan="3">';
if ($object->photo) {
print $form->showphoto('contact',$object);
print "<br>\n";
}
print '<table class="nobordernopadding">';
if ($object->photo) print '<tr><td><input type="checkbox" class="flat" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
//print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
print '</table>';
print '</td>';
print '</tr>';
print '</table>';
print dol_fiche_end();
@ -983,12 +1051,12 @@ else
// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
if ($object->socid > 0)
{
$objsoc->fetch($object->socid);
@ -998,30 +1066,44 @@ else
{
print $langs->trans("ContactNotLinkedToCompany");
}
print '</td></tr>';
print '</td>';
}
// Photo
if ($object->photo)
{
print '<td rowspan="6" style="text-align: center;" width="25%">';
print $form->showphoto('contact',$object);
print '</td>';
} else {
print '<td rowspan="6" style="text-align: center;" width="25%">';
print '&nbsp;';
print '</td>';
}
print '</tr>';
// Civility
print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="3">';
print '<tr><td width="15%">'.$langs->trans("UserTitle").'</td><td colspan="2">';
print $object->getCivilityLabel();
print '</td></tr>';
// Role
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3">'.$object->poste.'</td>';
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="2">'.$object->poste.'</td>';
// Address
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="2">';
dol_print_address($object->address,'gmap','contact',$object->id);
print '</td></tr>';
// Zip/Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="2">';
print $object->zip;
if ($object->zip) print '&nbsp;';
print $object->town.'</td></tr>';
// Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="2">';
$img=picto_from_langcode($object->country_code);
if ($img) print $img.' ';
print $object->country;
@ -1030,7 +1112,7 @@ else
// State
if (empty($conf->global->SOCIETE_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'.$object->state.'</td>';
print '<tr><td>'.$langs->trans('State').'</td><td colspan="2">'.$object->state.'</td>';
}
// Phone

View File

@ -73,6 +73,7 @@ class Contact extends CommonObject
var $code;
var $email;
var $skype;
var $photo;
var $jabberid;
var $phone_pro;
var $phone_perso;
@ -240,6 +241,7 @@ class Contact extends CommonObject
$this->phone_mobile=trim($this->phone_mobile);
$this->jabberid=trim($this->jabberid);
$this->skype=trim($this->skype);
$this->photo=trim($this->photo);
$this->fax=trim($this->fax);
$this->zip=(empty($this->zip)?'':$this->zip);
$this->town=(empty($this->town)?'':$this->town);
@ -264,6 +266,7 @@ class Contact extends CommonObject
$sql .= ", fax='".$this->db->escape($this->fax)."'";
$sql .= ", email='".$this->db->escape($this->email)."'";
$sql .= ", skype='".$this->db->escape($this->skype)."'";
$sql .= ", photo='".$this->db->escape($this->photo)."'";
$sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
$sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null");
$sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null");
@ -392,7 +395,7 @@ class Contact extends CommonObject
if ($this->phone_perso && ! empty($conf->global->LDAP_CONTACT_FIELD_HOMEPHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso;
if ($this->phone_mobile && ! empty($conf->global->LDAP_CONTACT_FIELD_MOBILE)) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile;
if ($this->fax && ! empty($conf->global->LDAP_CONTACT_FIELD_FAX)) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax;
if ($this->skype && ! empty($conf->global->LDAP_CONTACT_FIELD_SKYPE)) $info[$conf->global->LDAP_CONTACT_FIELD_SKYPE] = $this->skype;
if ($this->skype && ! empty($conf->global->LDAP_CONTACT_FIELD_SKYPE)) $info[$conf->global->LDAP_CONTACT_FIELD_SKYPE] = $this->skype;
if ($this->note_private && ! empty($conf->global->LDAP_CONTACT_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note_private;
if ($this->email && ! empty($conf->global->LDAP_CONTACT_FIELD_MAIL)) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email;
@ -518,6 +521,7 @@ class Contact extends CommonObject
$sql.= " c.fk_departement,";
$sql.= " c.birthday,";
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype,";
$sql.= " c.photo,";
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,";
$sql.= " c.import_key,";
$sql.= " co.label as country, co.code as country_code,";
@ -573,6 +577,7 @@ class Contact extends CommonObject
$this->email = $obj->email;
$this->jabberid = $obj->jabberid;
$this->skype = $obj->skype;
$this->photo = $obj->photo;
$this->priv = $obj->priv;
$this->mail = $obj->email;
@ -909,12 +914,12 @@ class Contact extends CommonObject
$label = '<u>' . $langs->trans("ShowContact") . '</u>';
$label.= '<br><b>' . $langs->trans("Name") . ':</b> '.$this->getFullName($langs);
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
$label.= '<br><b>' . $langs->trans("Poste") . ':</b> '.$this->poste;
$label.= '<br><b>' . $langs->trans("EMail") . ':</b> '.$this->email;
if (! empty($this->poste)) $label.= '<br><b>' . $langs->trans("Poste") . ':</b> '.$this->poste;
if (! empty($this->email)) $label.= '<br><b>' . $langs->trans("EMail") . ':</b> '.$this->email;
$phonelist=array();
if ($this->phone_pro) $phonelist[]=$this->phone_pro;
if ($this->phone_mobile) $phonelist[]=$this->phone_mobile;
if ($this->phone_pesro) $phonelist[]=$this->phone_perso;
if ($this->phone_perso) $phonelist[]=$this->phone_perso;
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',$phonelist);
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
@ -1107,6 +1112,49 @@ class Contact extends CommonObject
}
}
/**
* Sets object to supplied categories.
*
* Deletes object from existing categories not supplied.
* Adds it to non existing supplied categories.
* Existing categories are left untouch.
*
* @param int[]|int $categories Category or categories IDs
*/
public function setCategories($categories)
{
// Handle single category
if (!is_array($categories)) {
$categories = array($categories);
}
// Get current categories
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$c = new Categorie($this->db);
$existing = $c->containing($this->id, Categorie::TYPE_CONTACT, 'id');
// Diff
if (is_array($existing)) {
$to_del = array_diff($existing, $categories);
$to_add = array_diff($categories, $existing);
} else {
$to_del = array(); // Nothing to delete
$to_add = $categories;
}
// Process
foreach ($to_del as $del) {
$c->fetch($del);
$c->del_type($this, 'contact');
}
foreach ($to_add as $add) {
$c->fetch($add);
$c->add_type($this, 'contact');
}
return;
}
/**
* Function used to replace a thirdparty id with another one.
*

View File

@ -56,6 +56,7 @@ $search_priv=GETPOST("search_priv");
$search_categ=GETPOST("search_categ",'int');
$search_status=GETPOST("search_status",'int');
if ($search_status=='') $search_status=1; // always display activ customer first
$optioncss = GETPOST('optioncss','alpha');
$type=GETPOST("type");
@ -261,6 +262,7 @@ if ($result)
if (!empty($search_categ)) $param.='&search_categ='.htmlspecialchars($search_categ);
if ($search_status != '') $param.='&amp;search_status='.htmlspecialchars($search_status);
if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".htmlspecialchars($search_priv);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
$num = $db->num_rows($result);
$i = 0;
@ -268,6 +270,7 @@ if ($result)
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_companies.png');
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';

View File

@ -51,6 +51,7 @@ $search_status=GETPOST('search_status');
$socid=GETPOST('socid');
$search_sale = GETPOST('search_sale','int');
$optioncss = GETPOST('optioncss','alpha');
if (! $sortfield) $sortfield="c.rowid";
if (! $sortorder) $sortorder="DESC";
@ -134,6 +135,7 @@ if ($resql)
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_name='.$search_name, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png');
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<table class="liste" width="100%">';
// If the user can view prospects other than his'
@ -160,6 +162,7 @@ if ($resql)
$param.='&search_name='.$search_name;
$param.='&search_ref_supplier='.$search_ref_supplier;
$param.='&search_sale=' .$search_sale;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder);

View File

@ -28,7 +28,7 @@
// $cancel must be defined
// $id or $ref must be defined (object is loaded in this file with fetch)
if (($id > 0 || ! empty($ref)) && empty($cancel))
if (($id > 0 || (! empty($ref) && ! in_array($action, array('create','createtask')))) && empty($cancel))
{
$ret = $object->fetch($id,$ref);
if ($ret > 0)

View File

@ -2272,7 +2272,7 @@ abstract class CommonObject
{
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
foreach($objectids as $i => $objectid); // $i is rowid into llx_element_element
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
{
$object = new $classname($this->db);
$ret = $object->fetch($objectid);

View File

@ -5155,6 +5155,11 @@ class Form
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
if ($object->logo) $file=$id.'/logos/thumbs/'.$smallfile;
}
if ($modulepart=='contact')
{
$dir=$conf->societe->multidir_output[$entity].'/contact';
$file=$id.'/photos/'.$object->photo;
}
else if ($modulepart=='userphoto')
{
$dir=$conf->user->dir_output;

View File

@ -126,19 +126,25 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">'.$langs->trans("VisibleTimeRange").'</td>';
print "<td class='nowrap maxwidthonsmartphone'>";
print '<div class="ui-grid-a"><div class="ui-block-a">';
print '<input type="number" class="short" name="begin_h" value="'.$begin_h.'" min="0" max="23">';
if (empty($conf->dol_use_jmobile)) print ' - ';
else print '</div><div class="ui-block-b">';
print '<input type="number" class="short" name="end_h" value="'.$end_h.'" min="1" max="24">';
if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H");
print '</div></div>';
print '</td></tr>';
// Filter on days
print '<tr>';
print '<td class="nowrap">'.$langs->trans("VisibleDaysRange").'</td>';
print "<td class='nowrap maxwidthonsmartphone'>";
print '<div class="ui-grid-a"><div class="ui-block-a">';
print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7">';
if (empty($conf->dol_use_jmobile)) print ' - ';
else print '</div><div class="ui-block-b">';
print '<input type="number" class="short" name="end_d" value="'.$end_d.'" min="1" max="7">';
print '</div></div>';
print '</td></tr>';
}

View File

@ -72,8 +72,13 @@ function bank_prepare_head(Account $object)
$h++;
}
// Attached files
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id;
$head[$h][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$h][1].= ' <span class="badge">'.$nbFiles.'</span>';
$head[$h][2] = 'document';
$h++;

View File

@ -537,7 +537,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
else
{
$var = false;
print '<tr '.$bc[$var].'><td colspan="4">'.$langs->trans("None").'</td></tr>';
print '<tr '.$bc[$var].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
}
$db->free($result);
}

View File

@ -1926,6 +1926,16 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$sqlprotectagainstexternals = "SELECT rowid as fk_soc FROM ".MAIN_DB_PREFIX."societe WHERE rowid='".$db->escape($refname)."' AND entity IN (".getEntity('societe', 1).")";
}
// Wrapping for contact
else if ($modulepart == 'contact')
{
if ($fuser->rights->societe->lire)
{
$accessallowed=1;
}
$original_file=$conf->societe->multidir_output[$entity].'/contact/'.$original_file;
}
// Wrapping for invoices
else if ($modulepart == 'facture' || $modulepart == 'invoice')
{
@ -2145,6 +2155,16 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$original_file=$conf->banque->dir_output.'/bordereau/'.$original_file; // original_file should contains relative path so include the get_exdir result
}
// Wrapping for bank
else if ($modulepart == 'bank')
{
if ($fuser->rights->banque->lire)
{
$accessallowed=1;
}
$original_file=$conf->bank->dir_output.'/'.$original_file;
}
// Wrapping for export module
else if ($modulepart == 'export')
{

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -120,6 +121,11 @@ function invoice_admin_prepare_head()
$head[$h][2] = 'general';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/payment.php';
$head[$h][1] = $langs->trans("Payments");
$head[$h][2] = 'payment';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -416,7 +416,10 @@ function encodedecode_dbpassconf($level=0)
if ($fp = @fopen($file,'w'))
{
fputs($fp, $config);
fflush($fp);
fclose($fp);
clearstatcache();
// It's config file, so we set read permission for creator only.
// Should set permission to web user and groups for users used by batch
//@chmod($file, octdec('0600'));

View File

@ -1401,7 +1401,7 @@ print $sql;
}
if (! $foundparent)
{
$this->error="ErrorBadDefinitionOfMenuArrayInModuleDescriptor (bad value for key fk_menu)";
$this->error="ErrorBadDefinitionOfMenuArrayInModuleDescriptor";
dol_syslog(get_class($this)."::insert_menus ".$this->error." ".$this->menu[$key]['fk_menu'], LOG_ERR);
$err++;
}

View File

@ -290,7 +290,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Line of free text
$newfreetext='';
$paramfreetext='COMMANDE_FREE_TEXT';
$paramfreetext='ORDER_FREE_TEXT';
if (! empty($conf->global->$paramfreetext))
{
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);

View File

@ -1350,7 +1350,7 @@ class pdf_einstein extends ModelePDFCommandes
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{
$showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'COMMANDE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
return pdf_pagefoot($pdf,$outputlangs,'ORDER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
}
}

View File

@ -298,7 +298,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Line of free text
$newfreetext='';
$paramfreetext='FACTURE_FREE_TEXT';
$paramfreetext='INVOICE_FREE_TEXT';
if (! empty($conf->global->$paramfreetext))
{
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);

View File

@ -1637,7 +1637,7 @@ class pdf_crabe extends ModelePDFFactures
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{
$showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
return pdf_pagefoot($pdf,$outputlangs,'INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
}
}

View File

@ -75,6 +75,7 @@ class mailing_contacts1 extends MailingTargets
$statssql[0].= " WHERE c.entity IN (".getEntity('societe', 1).")";
$statssql[0].= " AND c.email != ''"; // Note that null != '' is false
$statssql[0].= " AND c.no_email = 0";
$statssql[0].= " AND c.statut = 1";
return $statssql;
}
@ -98,6 +99,7 @@ class mailing_contacts1 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@ -204,6 +206,7 @@ class mailing_contacts1 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email <> ''";
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
$sql.= " AND c.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
foreach($filtersarray as $key)
{

View File

@ -86,6 +86,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email <> ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
//$sql.= " AND sp.poste != ''";
$sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'";
@ -168,6 +169,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
//$sql.= " AND sp.poste != ''";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@ -191,6 +193,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
$sql.= " GROUP BY sp.poste";
$sql.= " ORDER BY sp.poste";

View File

@ -85,6 +85,7 @@ class mailing_contacts3 extends MailingTargets
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE sp.email <> ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
@ -173,6 +174,7 @@ class mailing_contacts3 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
/*
$sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
@ -208,6 +210,7 @@ class mailing_contacts3 extends MailingTargets
$sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND cs.fk_categorie = c.rowid";
$sql.= " AND cs.fk_soc = sp.fk_soc";

View File

@ -85,6 +85,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'";
$sql.= " ORDER BY sp.lastname, sp.firstname";
@ -173,6 +174,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
/*
$sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
@ -208,6 +210,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " GROUP BY c.label";
$sql.= " ORDER BY c.label";

View File

@ -81,7 +81,7 @@ class modMargin extends DolibarrModules
// New pages on tabs
$this->tabs = array(
'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__',
'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous && ($societe->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous && ($object->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
);

View File

@ -0,0 +1,140 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/modules/payment/mod_payment_ant.php
* \ingroup payment
* \brief File containing class for numbering module Ant
*/
require_once DOL_DOCUMENT_ROOT .'/core/modules/payment/modules_payment.php';
/**
* Class to manage customer payment numbering rules Ant
*/
class mod_payment_ant extends ModeleNumRefPayments
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $error = '';
var $nom = 'Ant';
/**
* Renvoi la description du modele de numerotation
*
* @return string Texte descripif
*/
function info()
{
global $conf,$langs;
$langs->load("bills");
$form = new Form($this->db);
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$texte.= '<input type="hidden" name="action" value="updateMask">';
$texte.= '<input type="hidden" name="maskconstpayment" value="PAYMENT_ANT_MASK">';
$texte.= '<table class="nobordernopadding" width="100%">';
$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Order"),$langs->transnoentities("Order"));
$tooltip.=$langs->trans("GenericMaskCodes2");
$tooltip.=$langs->trans("GenericMaskCodes3");
$tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Order"),$langs->transnoentities("Order"));
$tooltip.=$langs->trans("GenericMaskCodes5");
// Parametrage du prefix
$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskpayment" value="'.$conf->global->PAYMENT_ANT_MASK.'">',$tooltip,1,1).'</td>';
$texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
$texte.= '</tr>';
$texte.= '</table>';
$texte.= '</form>';
return $texte;
}
/**
* Renvoi un exemple de numerotation
*
* @return string Example
*/
function getExample()
{
global $conf,$langs,$mysoc;
$old_code_client=$mysoc->code_client;
$mysoc->code_client='CCCCCCCCCC';
$numExample = $this->getNextValue($mysoc,'');
$mysoc->code_client=$old_code_client;
if (! $numExample)
{
$numExample = $langs->trans('NotConfigured');
}
return $numExample;
}
/**
* Return next free value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Value if KO, <0 if KO
*/
function getNextValue($objsoc,$object)
{
global $db,$conf;
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
// We get cursor rule
$mask=$conf->global->PAYMENT_ANT_MASK;
if (! $mask)
{
$this->error='NotConfigured';
return 0;
}
$numFinal=get_next_value($db,$mask,'paiement','ref','',$objsoc,$object->datepaye);
return $numFinal;
}
/**
* Return next free value
*
* @param Societe $objsoc Object third party
* @param string $objforref Object for number to search
* @return string Next free value
*/
function commande_get_num($objsoc,$objforref)
{
return $this->getNextValue($objsoc,$objforref);
}
}

View File

@ -0,0 +1,150 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/modules/payment/mod_payment_cicada.php
* \ingroup payment
* \brief File containing class for numbering module Cicada
*/
require_once DOL_DOCUMENT_ROOT .'/core/modules/payment/modules_payment.php';
/**
* Class to manage customer payment numbering rules Cicada
*/
class mod_payment_cicada extends ModeleNumRefPayments
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='PAY';
var $error='';
var $nom='Cicada';
/**
* Return description of numbering module
*
* @return string Text with description
*/
function info()
{
global $langs;
return $langs->trans("SimpleNumRefModelDesc",$this->prefix);
}
/**
* Renvoi un exemple de numerotation
*
* @return string Example
*/
function getExample()
{
return $this->prefix."0501-0001";
}
/**
* Test si les numeros deje en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
*
* @return boolean false si conflit, true si ok
*/
function canBeActivated()
{
global $conf,$langs,$db;
$payyymm=''; $max='';
$posindice=9;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql.= " FROM ".MAIN_DB_PREFIX."paiement";
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
$sql.= " AND entity = ".$conf->entity;
$resql=$db->query($sql);
if ($resql)
{
$row = $db->fetch_row($resql);
if ($row) { $payyymm = substr($row[0],0,6); $max=$row[0]; }
}
if ($payyymm && ! preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$payyymm))
{
$langs->load("errors");
$this->error=$langs->trans('ErrorNumRefModel', $max);
return false;
}
return true;
}
/**
* Return next free value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Value if KO, <0 if KO
*/
function getNextValue($objsoc,$object)
{
global $db,$conf;
// D'abord on recupere la valeur max
$posindice=9;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql.= " FROM ".MAIN_DB_PREFIX."paiement";
$sql.= " WHERE ref like '".$this->prefix."____-%'";
$sql.= " AND entity = ".$conf->entity;
$resql=$db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($obj) $max = intval($obj->max);
else $max=0;
}
else
{
dol_syslog(__METHOD__, LOG_DEBUG);
return -1;
}
//$date=time();
$date=$object->datepaye;
$yymm = strftime("%y%m",$date);
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
else $num = sprintf("%04s",$max+1);
dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num);
return $this->prefix.$yymm."-".$num;
}
/**
* Return next free value
*
* @param Societe $objsoc Object third party
* @param string $objforref Object for number to search
* @return string Next free value
*/
function payment_get_num($objsoc,$objforref)
{
return $this->getNextValue($objsoc,$objforref);
}
}

View File

@ -0,0 +1,101 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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/
*/
/**
* \class ModeleNumRefPayments
* \brief Payment numbering references mother class
*/
abstract class ModeleNumRefPayments
{
var $error='';
/**
* Return if a module can be used or not
*
* @return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/**
* Return the default description of numbering module
*
* @return string Texte descripif
*/
function info()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoDescription");
}
/**
* Return numbering example
*
* @return string Example
*/
function getExample()
{
global $langs;
$langs->load("bills");
return $langs->trans("NoExample");
}
/**
* Test if the existing numbers in the database do not cause conflicts that would prevent this numbering run.
*
* @return boolean false si conflit, true si ok
*/
function canBeActivated()
{
return true;
}
/**
* Returns the next value
*
* @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for
* @return string Valeur
*/
function getNextValue($objsoc,$object)
{
global $langs;
return $langs->trans("NotAvailable");
}
/**
* Returns the module numbering version
*
* @return string Value
*/
function getVersion()
{
global $langs;
$langs->load("admin");
if ($this->version == 'development') return $langs->trans("VersionDevelopment");
if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
if ($this->version == 'dolibarr') return DOL_VERSION;
if ($this->version) return $this->version;
return $langs->trans("NotAvailable");
}
}

View File

@ -324,7 +324,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
// Line of free text
$newfreetext='';
$paramfreetext='PROPALE_FREE_TEXT';
$paramfreetext='PROPOSAL_FREE_TEXT';
if (! empty($conf->global->$paramfreetext))
{
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);

View File

@ -1541,7 +1541,7 @@ class pdf_azur extends ModelePDFPropales
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{
$showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'PROPALE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
return pdf_pagefoot($pdf,$outputlangs,'PROPOSAL_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
}
/**

View File

@ -47,6 +47,7 @@ $search_ref=GETPOST('search_ref','alpha');
$search_company=GETPOST('search_company','alpha');
$search_name=GETPOST('search_name','alpha');
$search_amount = GETPOST('search_amount','alpha');
$optioncss = GETPOST('optioncss','alpha');
if (!$user->rights->don->lire) accessforbidden();
@ -101,34 +102,37 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
$param="&statut=$statut&sortorder=$sortorder&sortfield=$sortfield";
$param = '&statut='.$statut;
if ($page > 0) $param.= '&page='.$page;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($statut >= 0)
{
$donationstatic->statut=$statut;
$label=$donationstatic->getLibStatut(0);
print_barre_liste($label, $page, $_SERVER["PHP_SELF"], $param, '', '', '', $num);
print_barre_liste($label, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
}
else
{
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, '', '', '', $num);
print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
}
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","&page=$page&statut=$statut","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"d.societe","&page=$page&statut=$statut","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.lastname","&page=$page&statut=$statut","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.datedon","&page=$page&statut=$statut","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","", $param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"d.societe","", $param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.lastname","", $param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.datedon","", $param,'align="center"',$sortfield,$sortorder);
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"fk_projet","&page=$page&statut=$statut","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"fk_projet","", $param,"",$sortfield,$sortorder);
}
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"d.amount","&page=$page&statut=$statut","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.fk_statut","&page=$page&statut=$statut","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"d.amount","", $param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.fk_statut","", $param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
// Filters lines

View File

@ -77,7 +77,7 @@ $hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($co
$object = new Expedition($db);
// Load object. Make an object->fetch
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not includ_once
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('expeditioncard','globalcard'));

View File

@ -38,6 +38,7 @@ $result = restrictedArea($user, 'expedition',$expeditionid,'');
$search_ref_exp = GETPOST("search_ref_exp");
$search_ref_liv = GETPOST('search_ref_liv');
$search_company = GETPOST("search_company");
$optioncss = GETPOST('optioncss','alpha');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
@ -114,12 +115,14 @@ if ($resql)
if ($search_ref_exp) $param.= "&amp;search_ref_exp=".$search_ref_exp;
if ($search_ref_liv) $param.= "&amp;search_ref_liv=".$search_ref_liv;
if ($search_company) $param.= "&amp;search_company=".$search_company;
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
$i = 0;
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -48,6 +48,7 @@ $month_start = GETPOST("month_start","int");
$year_start = GETPOST("year_start","int");
$month_end = GETPOST("month_end","int");
$year_end = GETPOST("year_end","int");
$optioncss = GETPOST('optioncss','alpha');
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
{
@ -177,9 +178,11 @@ if ($resql)
if ($search_amount_ht) $param.="&search_amount_ht=".$search_amount_ht;
if ($search_amount_ttc) $param.="&search_amount_ttc=".$search_amount_ttc;
if ($search_status >= 0) $param.="&search_status=".$search_status;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_barre_liste($langs->trans("ListTripsAndExpenses"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";

View File

@ -62,6 +62,7 @@ $search_company=GETPOST('search_company','alpha');
$search_desc=GETPOST('search_desc','alpha');
$search_status=GETPOST('search_status');
$sall=GETPOST('sall');
$optioncss = GETPOST('optioncss','alpha');
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
@ -128,10 +129,12 @@ if ($result)
if ($search_company) $urlparam.="&search_company=".urlencode($search_company);
if ($search_desc) $urlparam.="&search_desc=".urlencode($search_desc);
if ($search_status != '' && $search_status > -1) $urlparam.="&search_status=".urlencode($search_status);
if ($optioncss != '') $urlparam.='&optioncss='.$optioncss;
print_barre_liste($langs->trans("ListOfInterventions"), $page, $_SERVER['PHP_SELF'], $urlparam, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_commercial.png');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
@ -991,8 +991,8 @@ class FactureFournisseur extends CommonInvoice
$oldref = dol_sanitizeFileName($this->ref);
$newref = dol_sanitizeFileName($num);
$dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2,0,0, $this, 'invoive_supplier').$oldref;
$dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2,0,0, $this, 'invoive_supplier').$newref;
$dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2,0,0, $this, 'invoice_supplier').$oldref;
$dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2,0,0, $this, 'invoice_supplier').$newref;
if (file_exists($dirsource))
{
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
@ -1001,7 +1001,7 @@ class FactureFournisseur extends CommonInvoice
{
dol_syslog("Rename ok");
// Rename docs starting with $oldref with $newref
$listoffiles=dol_dir_list($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2,0,0, $this, 'invoive_supplier').$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
$listoffiles=dol_dir_list($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2,0,0, $this, 'invoice_supplier').$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
foreach($listoffiles as $fileentry)
{
$dirsource=$fileentry['name'];

View File

@ -2333,7 +2333,7 @@ elseif (! empty($object->id))
// Tableau des substitutions
$formmail->substit['__ORDERREF__']=$object->ref;
$formmail->substit['__ORDERSUPPLIERREF__']=$object->ref_supplier;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';

View File

@ -46,6 +46,7 @@ $search_ht=GETPOST('search_ht');
$search_ttc=GETPOST('search_ttc');
$sall=GETPOST('search_all');
$search_status=(GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha')); // alpha and not intbecause it can be '6,7'
$optioncss = GETPOST('optioncss','alpha');
$page = GETPOST('page','int');
$socid = GETPOST('socid','int');
@ -185,6 +186,7 @@ if ($resql)
if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
if ($socid) $param.="&socid=".$socid;
if ($search_status >= 0) $param.="&search_status=".$search_status;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';

View File

@ -82,6 +82,7 @@ $day_lim = GETPOST('day_lim','int');
$month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int');
$filter = GETPOST("filtre");
$optioncss = GETPOST('optioncss','alpha');
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
{
@ -249,9 +250,11 @@ if ($resql)
if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax);
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.ref,fac.rowid","",$param,"",$sortfield,$sortorder);

View File

@ -7,6 +7,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -55,6 +56,7 @@ $pagenext = $page + 1;
$limit = $conf->liste_limit;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="p.rowid";
$optioncss = GETPOST('optioncss','alpha');
$amounts = array();
@ -438,7 +440,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$text.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
print '<input type="hidden" name="closepaidinvoices" value="'.GETPOST('closepaidinvoices').'">';
}
$form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('PayedSuppliersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('PayedSuppliersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
}
print '</form>';
@ -530,10 +532,12 @@ if (empty($action))
$paramlist.=(! empty($search_ref)?"&search_ref=".$search_ref:"");
$paramlist.=(! empty($search_company)?"&search_company=".$search_company:"");
$paramlist.=(! empty($search_amount)?"&search_amount='".$search_amount:"");
if ($optioncss != '') $paramlist.='&optioncss='.$optioncss;
print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('RefPayment'),$_SERVER["PHP_SELF"],'p.rowid','',$paramlist,'',$sortfield,$sortorder);

View File

@ -49,6 +49,7 @@ $search_status = GETPOST("search_status",'int');
$catid = GETPOST("catid",'int');
$search_country = GETPOST("search_country",'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty",'int');
$optioncss = GETPOST('optioncss','alpha');
// Security check
$socid = GETPOST('socid','int');
@ -182,10 +183,12 @@ if ($resql)
if ($search_status != '') $param.='&amp;search_status='.htmlspecialchars($search_status);
if ($search_country != '') $param.='&amp;search_country='.htmlspecialchars($search_country);
if ($search_type_thirdparty != '') $param.='&amp;search_type_thirdparty='.htmlspecialchars($search_type_thirdparty);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies');
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
// Filter on categories
$moreforfilter='';

View File

@ -40,6 +40,7 @@ $sref = GETPOST('sref');
$sRefSupplier = GETPOST('srefsupplier');
$snom = GETPOST('snom');
$type = GETPOST('type');
$optioncss = GETPOST('optioncss','alpha');
$sortfield = GETPOST('sortfield');
$sortorder = GETPOST('sortorder');
@ -150,6 +151,7 @@ if ($resql)
$param="&tobuy=".$tobuy."&sref=".$sref."&snom=".$snom."&fourn_id=".$fourn_id.(isset($type)?"&amp;type=".$type:"").(empty($sRefSupplier)?"":"&amp;srefsupplier=".$sRefSupplier);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
@ -163,6 +165,7 @@ if ($resql)
}
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($fourn_id > 0) print '<input type="hidden" name="fourn_id" value="'.$fourn_id.'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';

View File

@ -52,4 +52,6 @@ ALTER TABLE llx_payment_salary CHANGE COLUMN fk_user_creat fk_user_author intege
ALTER TABLE llx_adherent ADD COLUMN pass_crypted varchar(128) after pass;
ALTER TABLE llx_paiement ADD COLUMN ref varchar(30) NOT NULL AFTER rowid;
ALTER TABLE llx_socpeople ADD COLUMN photo varchar(255) AFTER skype;

View File

@ -21,6 +21,7 @@
create table llx_paiement
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL, -- payment reference number
entity integer DEFAULT 1 NOT NULL, -- Multi company id
datec datetime, -- date de creation
tms timestamp,

View File

@ -43,6 +43,7 @@ create table llx_socpeople
email varchar(255),
jabberid varchar(255),
skype varchar(255),
photo varchar(255),
no_email smallint NOT NULL DEFAULT 0,
priv smallint NOT NULL DEFAULT 0,
fk_user_creat integer DEFAULT 0, -- user qui a creel'enregistrement

View File

@ -3830,7 +3830,6 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$mod=new modService($db);
@ -3841,7 +3840,6 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$mod=new modCommande($db);

View File

@ -2,11 +2,13 @@
CHARSET=UTF-8
ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file
ACCOUNTING_EXPORT_DATE=Date format for export file
ACCOUNTING_EXPORT_PIECE=Export the number of piece ?
ACCOUNTING_EXPORT_GLOBAL_ACCOUNT=Export with global account ?
ACCOUNTING_EXPORT_LABEL=Export the label ?
ACCOUNTING_EXPORT_AMOUNT=Export the amount ?
ACCOUNTING_EXPORT_DEVISE=Export the devise ?
ACCOUNTING_EXPORT_PIECE=Export the number of piece
ACCOUNTING_EXPORT_GLOBAL_ACCOUNT=Export with global account
ACCOUNTING_EXPORT_LABEL=Export the label
ACCOUNTING_EXPORT_AMOUNT=Export the amount
ACCOUNTING_EXPORT_DEVISE=Export the devise
Selectformat=Select the format for the file
ACCOUNTING_EXPORT_PREFIX_SPEC=Specify the prefix for the file name
Accounting=Accounting
Globalparameters=Global parameters
@ -34,6 +36,7 @@ Selectchartofaccounts=Select a chart of accounts
Validate=Validate
Addanaccount=Add an accounting account
AccountAccounting=Accounting account
AccountAccountingSuggest=Accounting account suggest
Ventilation=Breakdown
ToDispatch=To dispatch
Dispatched=Dispatched
@ -60,10 +63,10 @@ AccountingVentilationSupplier=Breakdown accounting supplier
AccountingVentilationCustomer=Breakdown accounting customer
Line=Line
CAHTF=Total purchase supplier HT
CAHTF=Total purchase supplier before tax
InvoiceLines=Lines of invoice to be ventilated
InvoiceLinesDone=Ventilated lines of invoice
IntoAccount=In the accounting account
IntoAccount=Ventilate in the accounting account
Ventilate=Ventilate
VentilationAuto=Automatic breakdown
@ -152,7 +155,7 @@ Active=Statement
NewFiscalYear=New fiscal year
DescVentilCustomer=Consult here the annual breakdown accounting of your invoices customers
TotalVente=Total turnover HT
TotalVente=Total turnover before tax
TotalMarge=Total sales margin
DescVentilDoneCustomer=Consult here the list of the lines of invoices customers and their accounting account
DescVentilTodoCustomer=Ventilate your lines of customer invoice with an accounting account
@ -167,3 +170,4 @@ ValidateHistory=Validate Automatically
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
FicheVentilation=Breakdown card
GeneralLedgerIsWritten=Operations are written in the general ledger

View File

@ -241,7 +241,7 @@ DolibarrProjectLeader=المشروع
Developpers=مطوري / المساهمين
OtherDeveloppers=غيرها من مطوري / المساهمين
OfficialWebSite=Dolibarr الدولي الموقع الرسمي
OfficialWebSiteFr=الفرنسية الموقع الرسمي
OfficialWebSiteLocal=Local web site (%s)
OfficialWiki=Dolibarr يكي
OfficialDemo=Dolibarr الانترنت التجريبي
OfficialMarketPlace=المسؤول عن وحدات السوق الخارجية / أدونس
@ -279,7 +279,8 @@ MAIN_DISABLE_ALL_SMS=تعطيل كافة sendings SMS (لأغراض الاختب
MAIN_SMS_SENDMODE=طريقة استخدامه لإرسال الرسائل القصيرة SMS
MAIN_MAIL_SMS_FROM=رقم الهاتف المرسل الافتراضي لإرسال الرسائل القصيرة
FeatureNotAvailableOnLinux=ميزة لا تتوفر على مثل أنظمة يونكس. sendmail برنامج الاختبار الخاص بك محليا.
SubmitTranslation=إذا كان ترجمة لهذه اللغة ليست كاملة أو تجد الأخطاء ، يمكنك تصحيح هذا عن طريق تحرير الملفات إلى الدليل <b>langs / ق ٪</b> ، وإرسال ملفات تعديل على www.dolibarr.org المنتدى.
SubmitTranslationENUS=If translation for this language is not complete or you find errors, you can correct this by editing files into directory <b>langs/%s</b> and submit modified files on dolibarr.org/forum or for developers on github.com/Dolibarr/dolibarr.
SubmitTranslation=If translation for this language is not complete or you find errors, you can correct this by editing files into directory <b>langs/%s</b> and submit your change to www.transifex.com/dolibarr-association/dolibarr/
ModuleSetup=إعداد وحدة
ModulesSetup=نمائط الإعداد
ModuleFamilyBase=نظام
@ -339,7 +340,7 @@ MinLength=الحد الأدني لمدة
LanguageFilesCachedIntoShmopSharedMemory=لانغ لتحميل الملفات. في الذاكرة المشتركة
ExamplesWithCurrentSetup=أمثلة مع تشغيل الإعداد الحالي
ListOfDirectories=قائمة الدلائل المفتوحة قوالب
ListOfDirectoriesForModelGenODT=قائمة الدلائل التي تحتوي على ملفات ذات شكل قوالب المفتوحة. <br><br> هنا وضع المسار الكامل من الدلائل. <br> إضافة حرف إرجاع بين الدليل ايه. <br> لإضافة دليل وحدة [جد] ، أضيف هنا <b>DOL_DATA_ROOT / إدارة المحتوى في المؤسسة / yourdirectoryname.</b> <br><br> في هذه الدلائل يجب أن تنتهي مع <b>ملفات. odt.</b>
ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.<br><br>Put here full path of directories.<br>Add a carriage return between eah directory.<br>To add a directory of the GED module, add here <b>DOL_DATA_ROOT/ecm/yourdirectoryname</b>.<br><br>Files in those directories must end with <b>.odt</b> or <b>.ods</b>.
NumberOfModelFilesFound=Number of ODT/ODS templates files found in those directories
ExampleOfDirectoriesForModelGen=أمثلة على بناء الجملة : <br> ج : mydir \\ <br> / الوطن / mydir <br> DOL_DATA_ROOT / إدارة المحتوى في المؤسسة / ecmdir
FollowingSubstitutionKeysCanBeUsed=<br> لمعرفة كيفية إنشاء قوالب المستند ODT، قبل تخزينها في تلك الدلائل، وقراءة وثائق ويكي:
@ -635,7 +636,7 @@ Permission162=Create/modify contracts/subscriptions
Permission163=Activate a service/subscription of a contract
Permission164=Disable a service/subscription of a contract
Permission165=Delete contracts/subscriptions
Permission171=Read trips and expenses (own and his subordinates)
Permission171=Read trips and expenses (yours and your subordinates)
Permission172=Create/modify trips and expenses
Permission173=Delete trips and expenses
Permission174=Read all trips and expenses
@ -730,7 +731,7 @@ Permission538=تصدير الخدمات
Permission701=قراءة التبرعات
Permission702=إنشاء / تعديل والهبات
Permission703=حذف التبرعات
Permission771=Read expense reports (own and his subordinates)
Permission771=Read expense reports (yours and your subordinates)
Permission772=Create/modify expense reports
Permission773=Delete expense reports
Permission774=Read all expense reports (even for user not subordinates)
@ -767,6 +768,12 @@ Permission1237=Export supplier orders and their details
Permission1251=ادارة الدمار الواردات الخارجية البيانات في قاعدة البيانات (بيانات تحميل)
Permission1321=تصدير العملاء والفواتير والمدفوعات والصفات
Permission1421=التصدير طلبات الزبائن وصفاته
Permission20001=Read leave requests (yours and your subordinates)
Permission20002=Create/modify your leave requests
Permission20003=Delete leave requests
Permission20004=Read all leave requests (even user not subordinates)
Permission20005=Create/modify leave requests for everybody
Permission20006=Admin leave requests (setup and update balance)
Permission23001=Read Scheduled job
Permission23002=Create/update Scheduled job
Permission23003=Delete Scheduled job
@ -1392,6 +1399,7 @@ ModifyProductDescAbility=الشخصي من الأشكال في وصف المنت
ViewProductDescInFormAbility=تصور وصف المنتج في أشكال (ما المنبثقة tooltip)
MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal
ViewProductDescInThirdpartyLanguageAbility=تصور من أوصاف المنتجات في لغة مرشحين عن
UseMaskOnClone=Use product next ref when we clone a product%s (available if mask configured)
UseSearchToSelectProductTooltip=Also if you have a large number of product (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
UseSearchToSelectProduct=Use a search form to choose a product (rather than a drop-down list).
UseEcoTaxeAbility=الدعم الاقتصادي Taxe (WEEE)
@ -1411,6 +1419,8 @@ SyslogFilename=اسم الملف ومسار
YouCanUseDOL_DATA_ROOT=يمكنك استخدام DOL_DATA_ROOT / dolibarr.log لملف الدخول في Dolibarr "وثائق" دليل. يمكنك أن تحدد مسارا مختلفا لتخزين هذا الملف.
ErrorUnknownSyslogConstant=ق المستمر ٪ ليست معروفة syslog مستمر
OnlyWindowsLOG_USER=Windows only supports LOG_USER
SyslogSentryDSN=Sentry DSN
SyslogSentryFromProject=DSN from your Sentry project
##### Donations #####
DonationsSetup=وحدة الإعداد للتبرع
DonationsReceiptModel=قالب من استلام التبرع
@ -1536,6 +1546,7 @@ AgendaSetup=جدول الأعمال وحدة الإعداد
PasswordTogetVCalExport=مفتاح ربط تصدير تأذن
PastDelayVCalExport=لا تصدر الحدث الأكبر من
AGENDA_USE_EVENT_TYPE=Use events types (managed into menu Setup -> Dictionary -> Type of agenda events)
AGENDA_USE_EVENT_TYPE_DEFAULT=Set automatically this default value for type of event into event create form
AGENDA_DEFAULT_FILTER_TYPE=Set automatically this type of event into search filter of agenda view
AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view
AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda
@ -1643,12 +1654,13 @@ SomethingMakeInstallFromWebNotPossible2=For this reason, process to upgrade desc
InstallModuleFromWebHasBeenDisabledByFile=Install of external module from application has been disabled by your administrator. You must ask him to remove the file <strong>%s</strong> to allow this feature.
ConfFileMuseContainCustom=Installing an external module from application save the module files into directory <strong>%s</strong>. To have this directory processed by Dolibarr, you must setup your <strong>conf/conf.php</strong> to have option<br>- <strong>$dolibarr_main_url_root_alt</strong> enabled to value <strong>$dolibarr_main_url_root_alt="/custom"</strong><br>- <strong>$dolibarr_main_document_root_alt</strong> enabled to value <strong>"%s/custom"</strong>
HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over
HighlightLinesColor=Color of highlight line when mouse move passes over (keep empty for no highlight)
PressF5AfterChangingThis=Press F5 on keyboard after changing this value to have it effective
NotSupportedByAllThemes=Will works with eldy theme but is not supported by all themes
BackgroundColor=Background color
TopMenuBackgroundColor=Background color for Top menu
LeftMenuBackgroundColor=Background color for Left menu
BackgroundTableTitleColor=Background color for table title line
BackgroundTableTitleColor=Background color for Table title line
BackgroundTableLineOddColor=Background color for odd table lines
BackgroundTableLineEvenColor=Background color for even table lines
MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay)

View File

@ -165,8 +165,8 @@ DeleteARib=Delete BAN record
ConfirmDeleteRib=Are you sure you want to delete this BAN record ?
StartDate=Start date
EndDate=End date
RejectCheck=Check rejection
RejectCheck=Check returned
ConfirmRejectCheck=Are you sure you want to mark this check as rejected ?
RejectCheckDate=Check rejection date
CheckRejected=Check rejected
CheckRejectedAndInvoicesReopened=Check rejected and invoices reopened
RejectCheckDate=Date the check was returned
CheckRejected=Check returned
CheckRejectedAndInvoicesReopened=Check returned and invoices reopened

View File

@ -218,7 +218,6 @@ NoInvoice=لا الفاتورة
ClassifyBill=تصنيف الفاتورة
SupplierBillsToPay=دفع فواتير الموردين
CustomerBillsUnpaid=فواتير غير مدفوعة للعملاء
DispenseMontantLettres=The written invoices through mecanographic procedures are dispensed by the order in letters
NonPercuRecuperable=غير القابلة للاسترداد
SetConditions=تحدد شروط الدفع
SetMode=حدد طريقة الدفع
@ -330,12 +329,14 @@ PaymentTypeCB=بطاقة الائتمان
PaymentTypeShortCB=بطاقة الائتمان
PaymentTypeCHQ=الشيكات
PaymentTypeShortCHQ=الشيكات
PaymentTypeTIP=Deposit
PaymentTypeShortTIP=Deposit
PaymentTypeTIP=Interbank Payment
PaymentTypeShortTIP=Interbank Payment
PaymentTypeVAD=على خط التسديد
PaymentTypeShortVAD=على خط التسديد
PaymentTypeTRA=تسديد الفواتير
PaymentTypeShortTRA=فاتورة
PaymentTypeTRA=Traite
PaymentTypeShortTRA=Traite
PaymentTypeFAC=Factor
PaymentTypeShortFAC=Factor
BankDetails=التفاصيل المصرفية
BankCode=رمز المصرف
DeskCode=مدونة مكتبية
@ -381,6 +382,8 @@ ChequesReceipts=الشيكات والإيصالات
ChequesArea=الشيكات مجال الودائع
ChequeDeposits=الشيكات الودائع
Cheques=الشيكات
DepositId=Id deposit
NbCheque=Number of checks
CreditNoteConvertedIntoDiscount=هذه المذكرة الائتمان أو إيداع فاتورة تم تحويلها إلى ٪ ق
UsBillingContactAsIncoiveRecipientIfExist=فواتير العملاء استخدام عنوان الاتصال بدلا من التصدي لطرف ثالث كما المتلقية للفواتير
ShowUnpaidAll=وتظهر جميع الفواتير غير المسددة
@ -404,7 +407,7 @@ RevenueStamp=Revenue stamp
YouMustCreateInvoiceFromThird=This option is only available when creating invoice from tab "customer" of thirdparty
PDFCrabeDescription=نموذج فاتورة Crabe. نموذج الفاتورة كاملة (دعم الخيار الضريبة على القيمة المضافة ، والخصومات ، وشروط الدفع ، والشعار ، الخ..)
TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for credit notes and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for deposit invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
TerreNumRefModelError=وهناك مشروع قانون بدءا من دولار ويوجد بالفعل syymm لا تتفق مع هذا النموذج من التسلسل. إزالة أو تغيير تسميتها لتصبح لتفعيل هذه الوحدة.
##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=ممثل العميل متابعة فاتورة

View File

@ -122,6 +122,12 @@ ProfId3AR=-
ProfId4AR=-
ProfId5AR=-
ProfId6AR=-
ProfId1AT=Prof Id 1 (USt.-IdNr)
ProfId2AT=Prof Id 2 (USt.-Nr)
ProfId3AT=Prof Id 3 (Handelsregister-Nr.)
ProfId4AT=-
ProfId5AT=-
ProfId6AT=-
ProfId1AU=الأستاذ عيد 1 (ايه. بي.)
ProfId2AU=-
ProfId3AU=-
@ -332,6 +338,7 @@ ProspectLevel=آفاق محتملة
ContactPrivate=القطاع الخاص
ContactPublic=تقاسم
ContactVisibility=الرؤية
ContactOthers=Other
OthersNotLinkedToThirdParty=أخرى ، لا صلة لطرف ثالث
ProspectStatus=آفاق الوضع
PL_NONE=Aucun
@ -375,6 +382,7 @@ ExportDataset_company_2=الاتصالات والعقارات
ImportDataset_company_1=Third parties (Companies/foundations/physical people) and properties
ImportDataset_company_2=Contacts/Addresses (of thirdparties or not) and attributes
ImportDataset_company_3=التفاصيل المصرفية
ImportDataset_company_4=Third parties/Sales representatives (Affect sales representatives users to companies)
PriceLevel=مستوى الأسعار
DeliveriesAddress=تقديم عناوين
DeliveryAddress=عنوان التسليم

View File

@ -91,6 +91,8 @@ LT1PaymentES=RE Payment
LT1PaymentsES=RE Payments
VATPayment=دفع ضريبة القيمة المضافة
VATPayments=دفع ضريبة القيمة المضافة
VATRefund=VAT Refund
Refund=Refund
SocialContributionsPayments=Social/fiscal taxes payments
ShowVatPayment=وتظهر دفع ضريبة القيمة المضافة
TotalToPay=على دفع ما مجموعه
@ -198,8 +200,8 @@ CalculationRuleDescSupplier=According to supplier, choose appropriate method to
TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a <b>cash accountancy</b> mode is not relevant. This report is only available when using <b>engagement accountancy</b> mode (see setup of accountancy module).
CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal
ACCOUNTING_VAT_SOLD_ACCOUNT=Default accountancy code for collecting VAT
ACCOUNTING_VAT_BUY_ACCOUNT=Default accountancy code for recovered VAT
ACCOUNTING_VAT_SOLD_ACCOUNT=Default accountancy code for collecting VAT (VAT on sales)
ACCOUNTING_VAT_BUY_ACCOUNT=Default accountancy code for recovered VAT (VAT on purchases)
ACCOUNTING_VAT_PAY_ACCOUNT=Default accountancy code for paying VAT
ACCOUNTING_ACCOUNT_CUSTOMER=Accountancy code by default for customer thirdparties
ACCOUNTING_ACCOUNT_SUPPLIER=Accountancy code by default for supplier thirdparties

View File

@ -63,7 +63,7 @@ ErrorSizeTooLongForVarcharType=وقتا طويلا لنوع السلسلة (%s
ErrorNoValueForSelectType=Please fill value for select list
ErrorNoValueForCheckBoxType=Please fill value for checkbox list
ErrorNoValueForRadioType=Please fill value for radio list
ErrorBadFormatValueList=The list value cannot have more than one come : <u>%s</u>, but need at least one: llave,valores
ErrorBadFormatValueList=The list value cannot have more than one comma: <u>%s</u>, but need at least one: key,value
ErrorFieldCanNotContainSpecialCharacters=ميدان <b>٪ ق</b> يجب ألا يحتوي على أحرف خاصة.
ErrorFieldCanNotContainSpecialNorUpperCharacters=Field <b>%s</b> must not contain special characters, nor upper case characters and cannot contain only numbers.
ErrorNoAccountancyModuleLoaded=أي وحدة المحاسبة وتفعيل
@ -191,5 +191,5 @@ WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your
WarningNotRelevant=Irrelevant operation for this dataset
WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Feature disabled when display setup is optimized for blind person or text browsers.
WarningPaymentDateLowerThanInvoiceDate=Payment date (%s) is earlier than invoice date (%s) for invoice %s.
WarningTooManyDataPleaseUseMoreFilters=Too many data. Please use more filters
WarningTooManyDataPleaseUseMoreFilters=Too many data (more than %s lines). Please use more filters or set the constant %s to a higher limit.
WarningSomeLinesWithNullHourlyRate=Some times were recorded by users when their hourly rate was not defined. A value of 0 was used but this may result in wrong valuation of time spent.

View File

@ -90,7 +90,7 @@ SelectAtLeastOneField=التبديل حقل واحد على الأقل مصدر
SelectFormat=اختيار تنسيق الملف هذا الاستيراد
RunImportFile=بدء استيراد الملف
NowClickToRunTheImport=تحقق نتيجة لمحاكاة الاستيراد. إذا كان كل شيء على ما يرام ، بدء استيراد نهائي.
DataLoadedWithId=يمكن تحميل جميع البيانات ومع معرف استيراد التالية : <b>%s</b>
DataLoadedWithId=All data will be loaded with the following import id: <b>%s</b>
ErrorMissingMandatoryValue=البيانات الإلزامية فارغ في الملف المصدر <b>ل%s</b> الميدان.
TooMuchErrors=لا يزال هناك <b>%s</b> خطوط مصدر آخر مع وجود أخطاء ولكن محدودة الانتاج و.
TooMuchWarnings=لا يزال هناك <b>%s</b> خطوط مصدر آخر مع تحذيرات ولكن محدودة الانتاج و.
@ -130,7 +130,7 @@ ExportDateFilter=YYYY, YYYYMM, YYYYMMDD : filters by one year/month/day<br>YYYY+
ExportNumericFilter='NNNNN' filters by one value<br>'NNNNN+NNNNN' filters over a range of values<br>'&gt;NNNNN' filters by lower values<br>'&gt;NNNNN' filters by higher values
## filters
SelectFilterFields=If you want to filter on some values, just input values here.
FilterableFields=Champs Filtrables
FilterableFields=Filterable Fields
FilteredFields=Filtered fields
FilteredFieldsValues=Value for filter
FormatControlRule=Format control rule

Some files were not shown because too many files have changed in this diff Show More