This commit is contained in:
Philippe 2018-09-27 19:00:09 +02:00
commit 8deb2eaa0c
116 changed files with 736 additions and 338 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@ dolibarr_install.log
upgrade.log
doxygen_warnings.log
/.project
/.vscode
.DS_Store
.idea
*.iml

View File

@ -63,6 +63,14 @@ matrix:
- php: nightly
# We exclude some combinations not usefull to save Travis CPU
exclude:
- php: '5.4'
env: DB=mariadb
- php: '5.5'
env: DB=mariadb
- php: '5.6'
env: DB=mariadb
- php: '7.0'
env: DB=mariadb
- php: '5.4'
env: DB=postgresql
- php: '5.5'

View File

@ -1,6 +1,6 @@
# DOLIBARR ERP & CRM
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/6.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).

View File

@ -17,11 +17,13 @@
*/
/**
* \file build/generate_filecheck_xml.php
* \file build/generate_filelist_xml.php
* \ingroup dev
* \brief This script create a xml checksum file
*/
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
@ -45,7 +47,7 @@ $includeconstants=array();
if (empty($argv[1]))
{
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1;
}
@ -68,11 +70,20 @@ while ($i < $argc)
$i++;
}
// If release is auto, we take current version
$tmpver=explode('-', $release, 2);
if ($tmpver[0] == 'auto')
{
$release=DOL_VERSION;
if ($tmpver[1]) $release.='-'.$tmpver[1];
}
if (empty($includecustom))
{
if (DOL_VERSION != $release)
$tmpver=explode('-', $release, 2);
if (DOL_VERSION != $tmpver[0])
{
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n";
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n";
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
exit -1;
}

View File

@ -198,7 +198,7 @@ $sql.=$hookmanager->resPrint;
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON (p.accountancy_code_sell = aa.account_number AND aa.entity = ".$conf->entity.")";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND product_type <= 2";
@ -439,4 +439,4 @@ if ($result) {
}
llxFooter();
$db->close();
$db->close();

View File

@ -179,24 +179,30 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
// TODO We add/delete permission here until permission can have a condition on a global var
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
$newmodule=new modFournisseur($db);
// clear default rights array
$newmodule->rights=array();
// add new right
$r=0;
$newmodule->rights[$r][0] = 1190;
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
$newmodule->rights[$r][2] = 'w';
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
{
// clear default rights array
$newmodule->rights=array();
// add new right
$r=0;
$newmodule->rights[$r][0] = 1190;
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
$newmodule->rights[$r][2] = 'w';
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
// Insert
$newmodule->insert_permissions(1);
}
else
{
// Remove all rights with Permission1190
$newmodule->delete_permissions();
// Add all right without Permission1190
$newmodule->insert_permissions(1);
}
}

View File

@ -534,8 +534,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{
@ -1243,7 +1243,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
$nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ...
$nextindextouse=is_array($colorindexused)?count($colorindexused):0; // At first run this is 0, so fist user has 0, next 1, ...
//print $nextindextouse;
foreach ($eventarray as $daykey => $notused)

View File

@ -238,7 +238,7 @@ if (! empty($actioncode))
else
{
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
}
}
}
@ -253,8 +253,8 @@ if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == '100') { $sql.= " AND a.percent = 100"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
if ($search_title) $sql.=natural_search("a.label", $search_title);
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)

View File

@ -427,8 +427,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{

View File

@ -446,8 +446,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{

View File

@ -79,6 +79,7 @@ $originid = GETPOST('originid', 'int');
$confirm = GETPOST('confirm', 'alpha');
$lineid = GETPOST('lineid', 'int');
$contactid = GETPOST('contactid','int');
$projectid = GETPOST('projectid','int');
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@ -1320,7 +1321,7 @@ if ($action == 'create')
}
$objectsrc->fetch_thirdparty();
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : 0);
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
@ -1450,7 +1451,7 @@ if ($action == 'create')
// Bank Account
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) {
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1);
print '</td></tr>';
}
@ -1488,9 +1489,6 @@ if ($action == 'create')
// Project
if (! empty($conf->projet->enabled) && $socid > 0)
{
$projectid = GETPOST('projectid')?GETPOST('projectid'):0;
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
$langs->load("projects");
print '<tr>';
print '<td>' . $langs->trans("Project") . '</td><td>';

View File

@ -417,6 +417,7 @@ class Propal extends CommonObject
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
$txlocaltax1=price2num($txlocaltax1);
@ -638,6 +639,7 @@ class Propal extends CommonObject
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu = price2num($pu);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva = price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);

View File

@ -83,12 +83,14 @@ $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@ -384,6 +386,7 @@ if ($resql)
if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
if ($socid > 0) $param.='&socid='.urlencode($socid);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($search_product_category != '') $param.='&search_product_category='.$search_product_category;
// Add $param from extra fields
foreach ($search_array_options as $key => $val)

View File

@ -1269,6 +1269,7 @@ class Commande extends CommonOrder
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva = price2num($txtva);
@ -2815,6 +2816,7 @@ class Commande extends CommonOrder
$qty=price2num($qty);
$pu = price2num($pu);
$pa_ht=price2num($pa_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);

View File

@ -74,6 +74,8 @@ $search_total_ht=GETPOST('search_total_ht','alpha');
$optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int');
$viewstatut=GETPOST('viewstatut');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
// Security check
$id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int'));
@ -86,7 +88,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@ -627,6 +629,13 @@ if ($resql)
if ($show_files) $param.='&show_files=' .$show_files;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($billed != '') $param.='&billed='.$billed;
if ($search_town != '')$param .= '&search_town='.$search_town;
if ($search_zip != '')$param .= '&search_zip='.$search_zip;
if ($search_state != '')$param .= '&search_state='.$search_state;
if ($search_country != '')$param .= '&search_country='.$search_country;
if ($search_type_thirdparty != '')$param .= '&search_type_thirdparty='.$search_type_thirdparty;
if ($search_product_category != '')$param .= '&search_product_category='.$search_product_category;
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{

View File

@ -186,13 +186,17 @@ if (empty($reshook))
$qualified_for_stock_change = $object->hasProductsOrServices(1);
}
$result = $object->delete($user, 0, $idwarehouse);
if ($result > 0) {
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
exit();
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action='';
if ($object->is_erasable()) {
$result = $object->delete($user, 0, $idwarehouse);
if ($result > 0) {
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
exit();
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
}
}
@ -402,7 +406,7 @@ if (empty($reshook))
//var_dump($object->getRemainToPay(0));
//var_dump($discount->amount_ttc);exit;
if ($discount->amount_ttc > $object->getRemainToPay(0))
if (price2num($discount->amount_ttc) > price2num($object->getRemainToPay(0)))
{
// TODO Split the discount in 2 automatically
$error++;

View File

@ -2512,6 +2512,7 @@ class Facture extends CommonInvoice
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva=price2num($txtva);
@ -2735,6 +2736,7 @@ class Facture extends CommonInvoice
$remise_percent = price2num($remise_percent);
$qty = price2num($qty);
$pu = price2num($pu);
$pu_ht_devise = price2num($pu_ht_devise);
$pa_ht = price2num($pa_ht);
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1);
@ -4832,7 +4834,7 @@ class FactureLigne extends CommonInvoiceLine
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
$res = $this->db->fetch_array($resql);
return $res['situation_percent'];
return floatval($res['situation_percent']);
} else {
$this->error = $this->db->error();
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);

View File

@ -93,6 +93,8 @@ $year = GETPOST('year','int');
$day_lim = GETPOST('day_lim','int');
$month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$option = GETPOST('option');
if ($option == 'late') {
@ -104,7 +106,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
if (! $sortorder && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
if (! $sortorder) $sortorder='DESC';
@ -563,6 +565,9 @@ if ($resql)
if ($show_files) $param.='&show_files=' .$show_files;
if ($option) $param.="&option=".$option;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_town)$param .= '&search_town='.urlencode($search_town);
if ($search_zip)$param .= '&search_zip='.urlencode($search_zip);
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{
@ -1009,6 +1014,9 @@ if ($resql)
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
$facturestatic->statut=$obj->fk_statut;
$facturestatic->total_ttc=$obj->total_ttc;
$facturestatic->paye=$obj->paye;
$facturestatic->fk_soc=$obj->fk_soc;
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
$facturestatic->note_public=$obj->note_public;
$facturestatic->note_private=$obj->note_private;
@ -1017,7 +1025,13 @@ if ($resql)
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
$remaintopay = $facturestatic->total_ttc - $totalpay;
if($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) {
$discount = new DiscountAbsolute($db);
$remaincreditnote = $discount->getAvailableDiscounts($obj->fk_soc, '', 'rc.fk_facture_source='.$facturestatic->id);
$remaintopay = -$remaincreditnote;
$totalpay = $facturestatic->total_ttc - $remaintopay;
}
print '<tr class="oddeven">';
if (! empty($arrayfields['f.facnumber']['checked']))

View File

@ -54,9 +54,12 @@ if (! $sortorder) $sortorder="DESC";
$arrayfields=array(
'f.datef'=>array('label'=>"Date", 'checked'=>1),
//...
//...
);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('supplierbalencelist','globalcard'));
/*
* Actions
*/
@ -87,13 +90,13 @@ if ($id > 0)
dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company');
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 1);
dol_fiche_end();
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
// Invoice list
print load_fiche_titre($langs->trans("CustomerPreview"));
print '<table class="noborder" width="100%">';
print '<table class="noborder tagtable liste" width="100%">';
print '<tr class="liste_titre">';
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'],$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
print '<td>'.$langs->trans("Element").'</td>';
@ -103,7 +106,7 @@ if ($id > 0)
print '<td align="right">'.$langs->trans("Balance").'</td>';
print '<td align="right">'.$langs->trans("Author").'</td>';
print '</tr>';
$TData = array();
$TDataSort = array();
@ -135,10 +138,10 @@ if ($id > 0)
continue;
}
$totalpaye = $fac->getSommePaiement();
$userstatic->id=$objf->userid;
$userstatic->login=$objf->login;
$TData[] = array(
'date' => $fac->date,
'link' => $fac->getNomUrl(1),
@ -168,13 +171,13 @@ if ($id > 0)
while ($j < $nump)
{
$objp = $db->fetch_object($resqlp);
$paymentstatic = new Paiement($db);
$paymentstatic->id = $objp->rowid;
$userstatic->id=$objp->userid;
$userstatic->login=$objp->login;
$TData[] = array(
'date' => $db->jdate($objp->dp),
'link' => $langs->trans("Payment") .' '. $paymentstatic->getNomUrl(1),
@ -199,11 +202,11 @@ if ($id > 0)
{
dol_print_error($db);
}
if(empty($TData)) {
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoInvoice").'</td></tr>';
} else {
// Sort array by date
asort($TDataSort);
array_multisort($TData,$TDataSort);
@ -213,37 +216,37 @@ if ($id > 0)
$balance += $data1['amount'];
$data1['balance'] += $balance;
}
// Reverse array to have last elements on top
$TData = dol_sort_array($TData, 'date', $sortorder);
$totalDebit = 0;
$totalCredit = 0;
// Display array
foreach($TData as $data) {
print '<tr class="oddeven">';
print "<td align=\"center\">".dol_print_date($data['date'],'day')."</td>\n";
print '<td>'.$data['link']."</td>\n";
print '<td aling="left">'.$data['status'].'</td>';
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
print '<td align="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
print '<td align="right">'.price($data['balance'])."</td>\n";
// Author
print '<td class="nowrap" align="right">';
print $data['author'];
print '</td>';
print "</tr>\n";
}
print '<tr class="liste_total">';
print '<td colspan="3">&nbsp;</td>';
print '<td align="right">'.price($totalDebit).'</td>';
@ -252,7 +255,7 @@ if ($id > 0)
print '<td></td>';
print "</tr>\n";
}
print "</table>";
}
}

View File

@ -407,18 +407,44 @@ class CMailFile
// TODO if (! empty($moreinheader)) ...
// Give the message a subject
$this->message->setSubject($this->encodetorfc2822($subject));
try {
$this->message->setSubject($subject);
} catch (Exception $e) {
$this->error = $e->getMessage();
}
// Set the From address with an associative array
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
if (! empty($from)) $this->message->setFrom($this->getArrayAddress($from));
if (! empty($from)) {
try {
$result = $this->message->setFrom($this->getArrayAddress($from));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}
// Set the To addresses with an associative array
if (! empty($to)) $this->message->setTo($this->getArrayAddress($to));
if (! empty($to)) {
try {
$result = $this->message->setTo($this->getArrayAddress($to));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}
if (! empty($from)) $this->message->SetReplyTo($this->getArrayAddress($from));
if (! empty($from)) {
try {
$result = $this->message->SetReplyTo($this->getArrayAddress($from));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}
$this->message->setCharSet($conf->file->character_set_client);
try {
$result = $this->message->setCharSet($conf->file->character_set_client);
} catch (Exception $e) {
$this->error = $e->getMessage();
}
if (! empty($this->html))
{

View File

@ -4524,7 +4524,7 @@ abstract class CommonObject
{
if (is_array($params) && count($params)>0) {
if (array_key_exists('colspan',$params)) {
$colspan=$params['colspan'];
$colspan=$params['colspan'] - 1;
}
}else {
$colspan='3';
@ -4581,6 +4581,12 @@ abstract class CommonObject
if($extrafields->attribute_required[$key])
$label = '<span'.($mode != 'view' ? ' class="fieldrequired"':'').'>'.$label.'</span>';
if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
{
$out .= '<td>&nbsp;</td>';
$colspan--;
}
$out .= '<td>'.$langs->trans($label).'</td>';
$html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : '';
$out .='<td id="'.$html_id.'" class="'.$this->element.'_extras_'.$key.'" '.($colspan?' colspan="'.$colspan.'"':'').'>';

View File

@ -282,7 +282,7 @@ class Form
$out='';
// Check parameters
if ($inputType == 'textarea') $value = dol_nl2br($value);
if (preg_match('/^text/',$inputType)) $value = dol_nl2br($value);
else if (preg_match('/^numeric/',$inputType)) $value = price($value);
else if ($inputType == 'day' || $inputType == 'datepicker') $value = dol_print_date($value, 'day');
@ -2581,7 +2581,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
$sql.= " WHERE p.entity IN (".getEntity('productprice').")";
$sql.= " WHERE pfp.entity IN (".getEntity('productprice').")";
$sql.= " AND p.tobuy = 1";
$sql.= " AND s.fournisseur = 1";
$sql.= " AND p.rowid = ".$productid;
@ -3231,21 +3231,21 @@ class Form
if ($resql && $this->db->num_rows($resql) > 0) {
// Last seen cycle
$ref = 0;
while ($res = $this->db->fetch_array($resql, MYSQL_NUM)) {
while ($obj = $this->db->fetch_object($resql)){
//Same company ?
if ($socid == $res[5]) {
if ($socid == $obj->fk_soc) {
//Same cycle ?
if ($res[2] != $ref) {
if ($obj->situation_cycle_ref != $ref) {
// Just seen this cycle
$ref = $res[2];
$ref = $obj->situation_cycle_ref;
//not final ?
if ($res[4] != 1) {
if ($obj->situation_final != 1) {
//Not prov?
if (substr($res[1], 1, 4) != 'PROV') {
if ($selected == $res[0]) {
$opt .= '<option value="' . $res[0] . '" selected>' . $res[1] . '</option>';
if (substr($obj->facnumber, 1, 4) != 'PROV') {
if ($selected == $obj->situation_final) {
$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->facnumber . '</option>';
} else {
$opt .= '<option value="' . $res[0] . '">' . $res[1] . '</option>';
$opt .= '<option value="' . $obj->rowid . '">' . $obj->facnumber . '</option>';
}
}
}

View File

@ -742,7 +742,7 @@ function xml2php($xml)
}
//Let see if the new child is not in the array
if($tab==false && in_array($key,array_keys($array)))
if($tab === false && in_array($key,array_keys($array)))
{
//If this element is already in the array we will create an indexed array
$tmp = $array[$key];
@ -751,7 +751,7 @@ function xml2php($xml)
$array[$key][] = $child;
$tab = true;
}
elseif($tab == true)
elseif($tab === true)
{
//Add an element in an existing array
$array[$key][] = $child;

View File

@ -1031,7 +1031,7 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file))
{
dol_syslog("Refused to delete file ".$file, LOG_WARNING);
return False;
return false;
}
if (empty($nohook))
@ -1080,18 +1080,21 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
{
$rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete);
dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($db);
$result = $ecmfile->fetch(0, '', $rel_filetodelete);
if ($result >= 0 && $ecmfile->id > 0)
{
$result = $ecmfile->delete($user);
}
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
if (is_object($db)) // $db may not be defined when lib is in a context with define('NOREQUIREDB',1)
{
dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($db);
$result = $ecmfile->fetch(0, '', $rel_filetodelete);
if ($result >= 0 && $ecmfile->id > 0)
{
$result = $ecmfile->delete($user);
}
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
}
}
}
else dol_syslog("Failed to remove file ".$filename, LOG_WARNING);
@ -1130,7 +1133,7 @@ function dol_delete_dir($dir,$nophperrors=0)
if (preg_match('/\.\./',$dir) || preg_match('/[<>|]/',$dir))
{
dol_syslog("Refused to delete dir ".$dir, LOG_WARNING);
return False;
return false;
}
$dir_osencoded=dol_osencode($dir);
@ -1711,7 +1714,7 @@ function dol_uncompress($inputfile,$outputdir)
dol_syslog("Class ZipArchive is set so we unzip using ZipArchive to unzip into ".$outputdir);
$zip = new ZipArchive;
$res = $zip->open($inputfile);
if ($res === TRUE)
if ($res === true)
{
$zip->extractTo($outputdir.'/');
$zip->close();

View File

@ -449,7 +449,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL,
if (! is_array($out) || empty($out)) $out=array();
break;
case 'nohtml':
$out=dol_string_nohtmltag($out);
$out=dol_string_nohtmltag($out, 0);
break;
case 'alphanohtml': // Recommended for search params
$out=trim($out);
@ -5068,6 +5068,7 @@ function dol_textishtml($msg,$option=0)
if (preg_match('/<html/i',$msg)) return true;
elseif (preg_match('/<body/i',$msg)) return true;
elseif (preg_match('/<(b|em|i|u)>/i',$msg)) return true;
elseif (preg_match('/<br\/>/i',$msg)) return true;
elseif (preg_match('/<(br|div|font|li|p|span|strong|table)>/i',$msg)) return true;
elseif (preg_match('/<(br|div|font|li|p|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true;
elseif (preg_match('/<(br|div|font|li|p|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true;
@ -5158,9 +5159,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
{
$tmp=dol_getdate(dol_now(), true);
$tmp2=dol_get_prev_day($tmp['mday'], $tmp['mon'], $tmp['year']);
$tmp3=dol_get_prev_month($tmp['mday'], $tmp['mon'], $tmp['year']);
$tmp3=dol_get_prev_month($tmp['mon'], $tmp['year']);
$tmp4=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']);
$tmp5=dol_get_next_month($tmp['mday'], $tmp['mon'], $tmp['year']);
$tmp5=dol_get_next_month($tmp['mon'], $tmp['year']);
}
$substitutionarray=array_merge($substitutionarray, array(
'__DAY__' => $tmp['mday'],

View File

@ -432,8 +432,17 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (!empty($targetcontact->address)) {
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n";
}else {
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n";
} else {
$companytouseforaddress = $targetcompany;
// Contact on a thirdparty that is a different thirdparty than the thirdparty of object
if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id)
{
$targetcontact->fetch_thirparty();
$companytouseforaddress = $targetcontact->thirdparty;
}
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress))."\n";
}
// Country
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
@ -1899,13 +1908,13 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
{
$prev_progress = 0;
$progress = 1;
if (method_exists($object, 'get_prev_progress'))
if (method_exists($object->lines[$i], 'get_prev_progress'))
{
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
$progress = ($object->lines[$i]->situation_percent - $prev_progress) / 100;
}
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs);
}
}
else
$result.=price($sign * $total_ht, 0, $outputlangs);
}

View File

@ -7,6 +7,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -856,7 +857,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1);
@ -1307,7 +1308,7 @@ class pdf_einstein extends ModelePDFCommandes
{
$top_shift = $pdf->getY() - $current_y;
}
if ($showaddress)
{
// Sender properties
@ -1421,4 +1422,3 @@ class pdf_einstein extends ModelePDFCommandes
}
}

View File

@ -8,6 +8,7 @@
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -1054,7 +1055,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
@ -1679,7 +1680,7 @@ class pdf_crabe extends ModelePDFFactures
{
$top_shift = $pdf->getY() - $current_y;
}
if ($showaddress)
{
// Sender properties
@ -1788,4 +1789,3 @@ class pdf_crabe extends ModelePDFFactures
}
}

View File

@ -130,12 +130,9 @@ class doc_generic_project_odt extends ModelePDFProjects
$array_key.'_statut'=>$object->getLibStatut()
);
// Retrieve extrafields
$extrafieldkey=$object->element;
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element,true);
$object->fetch_optionals($object->id,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
@ -154,7 +151,7 @@ class doc_generic_project_odt extends ModelePDFProjects
{
global $conf;
return array(
$resarray = array(
'task_ref'=>$task->ref,
'task_fk_project'=>$task->fk_project,
'task_projectref'=>$task->projectref,
@ -163,6 +160,7 @@ class doc_generic_project_odt extends ModelePDFProjects
'task_description'=>$task->description,
'task_fk_parent'=>$task->fk_parent,
'task_duration'=>$task->duration,
'task_duration_hour'=>convertSecondToTime($task->duration,'all'),
'task_progress'=>$task->progress,
'task_public'=>$task->public,
'task_date_start'=>dol_print_date($task->date_start,'day'),
@ -170,6 +168,16 @@ class doc_generic_project_odt extends ModelePDFProjects
'task_note_private'=>$task->note_private,
'task_note_public'=>$task->note_public
);
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($task->table_element,true);
$task->fetch_optionals($task->id,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($task,$resarray,$extrafields,'task',$outputlangs);
return $resarray;
}
/**
@ -310,7 +318,10 @@ class doc_generic_project_odt extends ModelePDFProjects
'tasktime_fk_user'=>$tasktime['fk_user'],
'tasktime_user_name'=>$tasktime['name'],
'tasktime_user_first'=>$tasktime['firstname'],
'tasktime_fullcivname'=>$tasktime['fullcivname']
'tasktime_fullcivname'=>$tasktime['fullcivname'],
'tasktime_amountht'=>$tasktime['amountht'],
'tasktime_amountttc'=>$tasktime['amountttc'],
'tasktime_thm'=>$tasktime['thm'],
);
}
@ -691,7 +702,7 @@ class doc_generic_project_odt extends ModelePDFProjects
//Time ressources
$sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
$sql.= ", u.lastname, u.firstname";
$sql.= ", u.lastname, u.firstname, t.thm";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
$sql .= " , ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE t.fk_task =".$task->id;
@ -705,6 +716,35 @@ class doc_generic_project_odt extends ModelePDFProjects
$i = 0;
$tasks = array();
$listlinestasktime = $listlines->__get('taskstimes');
if (empty($num)) {
$row['rowid']='';
$row['task_date']='';
$row['task_duration']='';
$row['$tasktime']='';
$row['note']='';
$row['fk_user']='';
$row['name']='';
$row['firstname']='';
$row['fullcivname']='';
$row['amountht']='';
$row['amountttc']='';
$row['thm']='';
$tmparray=$this->get_substitutionarray_taskstime($row,$outputlangs);
foreach($tmparray as $key => $val)
{
try
{
$listlinestasktime->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
}
}
$listlinestasktime->merge();
}
while ($i < $num)
{
$row = $this->db->fetch_array($resql);
@ -716,6 +756,16 @@ class doc_generic_project_odt extends ModelePDFProjects
$row['fullcivname']='';
}
if (!empty($row['thm'])) {
$row['amountht']=($row['task_duration'] / 3600) * $row['thm'];
$defaultvat = get_default_tva($mysoc, $mysoc);
$row['amountttc']=price2num($row['amountht'] * (1 + ($defaultvat / 100)),'MT');;
} else {
$row['amountht']=0;
$row['amountttc']=0;
$row['thm']=0;
}
$tmparray=$this->get_substitutionarray_taskstime($row,$outputlangs);
foreach($tmparray as $key => $val)
@ -877,60 +927,114 @@ class doc_generic_project_odt extends ModelePDFProjects
//List of referent
$listofreferent=array(
'propal'=>array(
'title'=>"ListProposalsAssociatedProject",
'class'=>'Propal',
'table'=>'propal',
'test'=>$conf->propal->enabled && $user->rights->propale->lire),
'order'=>array(
'title'=>"ListOrdersAssociatedProject",
'class'=>'Commande',
'table'=>'commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire),
'invoice'=>array(
'title'=>"ListInvoicesAssociatedProject",
'class'=>'Facture',
'table'=>'facture',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'invoice_predefined'=>array(
'title'=>"ListPredefinedInvoicesAssociatedProject",
'class'=>'FactureRec',
'table'=>'facture_rec',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'order_supplier'=>array(
'title'=>"ListSupplierOrdersAssociatedProject",
'table'=>'commande_fournisseur',
'class'=>'CommandeFournisseur',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire),
'invoice_supplier'=>array(
'title'=>"ListSupplierInvoicesAssociatedProject",
'table'=>'facture_fourn',
'class'=>'FactureFournisseur',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire),
'contract'=>array(
'title'=>"ListContractAssociatedProject",
'class'=>'Contrat',
'table'=>'contrat',
'test'=>$conf->contrat->enabled && $user->rights->contrat->lire),
'intervention'=>array(
'title'=>"ListFichinterAssociatedProject",
'class'=>'Fichinter',
'table'=>'fichinter',
'disableamount'=>1,
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
'trip'=>array(
'title'=>"ListTripAssociatedProject",
'class'=>'Deplacement',
'table'=>'deplacement',
'disableamount'=>1,
'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire),
'agenda'=>array(
'title'=>"ListActionsAssociatedProject",
'class'=>'ActionComm',
'table'=>'actioncomm',
'disableamount'=>1,
'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire)
$listofreferent = array(
'propal' => array(
'title' => "ListProposalsAssociatedProject",
'class' => 'Propal',
'table' => 'propal',
'test' => $conf->propal->enabled && $user->rights->propale->lire
),
'order' => array(
'title' => "ListOrdersAssociatedProject",
'class' => 'Commande',
'table' => 'commande',
'test' => $conf->commande->enabled && $user->rights->commande->lire
),
'invoice' => array(
'title' => "ListInvoicesAssociatedProject",
'class' => 'Facture',
'table' => 'facture',
'test' => $conf->facture->enabled && $user->rights->facture->lire
),
'invoice_predefined' => array(
'title' => "ListPredefinedInvoicesAssociatedProject",
'class' => 'FactureRec',
'table' => 'facture_rec',
'test' => $conf->facture->enabled && $user->rights->facture->lire
),
'proposal_supplier' => array(
'title' => "ListSupplierProposalsAssociatedProject",
'class' => 'SupplierProposal',
'table' => 'supplier_proposal',
'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire
),
'order_supplier' => array(
'title' => "ListSupplierOrdersAssociatedProject",
'table' => 'commande_fournisseur',
'class' => 'CommandeFournisseur',
'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire
),
'invoice_supplier' => array(
'title' => "ListSupplierInvoicesAssociatedProject",
'table' => 'facture_fourn',
'class' => 'FactureFournisseur',
'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire
),
'contract' => array(
'title' => "ListContractAssociatedProject",
'class' => 'Contrat',
'table' => 'contrat',
'test' => $conf->contrat->enabled && $user->rights->contrat->lire
),
'intervention' => array(
'title' => "ListFichinterAssociatedProject",
'class' => 'Fichinter',
'table' => 'fichinter',
'disableamount' => 1,
'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire
),
'shipping' => array(
'title' => "ListShippingAssociatedProject",
'class' => 'Expedition',
'table' => 'expedition',
'disableamount' => 1,
'test' => $conf->expedition->enabled && $user->rights->expedition->lire
),
'trip' => array(
'title' => "ListTripAssociatedProject",
'class' => 'Deplacement',
'table' => 'deplacement',
'disableamount' => 1,
'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire
),
'expensereport' => array(
'title' => "ListExpenseReportsAssociatedProject",
'class' => 'ExpenseReportLine',
'table' => 'expensereport_det',
'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire
),
'donation' => array(
'title' => "ListDonationsAssociatedProject",
'class' => 'Don',
'table' => 'don',
'test' => $conf->don->enabled && $user->rights->don->lire
),
'loan' => array(
'title' => "ListLoanAssociatedProject",
'class' => 'Loan',
'table' => 'loan',
'test' => $conf->loan->enabled && $user->rights->loan->read
),
'chargesociales' => array(
'title' => "ListSocialContributionAssociatedProject",
'class' => 'ChargeSociales',
'table' => 'chargesociales',
'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id,
'test' => $conf->tax->enabled && $user->rights->tax->charges->lire
),
'stock_mouvement' => array(
'title' => "ListMouvementStockProject",
'class' => 'MouvementStock',
'table' => 'stock_mouvement',
'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))
),
'agenda' => array(
'title' => "ListActionsAssociatedProject",
'class' => 'ActionComm',
'table' => 'actioncomm',
'disableamount' => 1,
'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire
)
);
//Insert reference

View File

@ -7,6 +7,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -1004,7 +1005,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1);
@ -1493,7 +1494,7 @@ class pdf_azur extends ModelePDFPropales
{
$top_shift = $pdf->getY() - $current_y;
}
if ($showaddress)
{
// Sender properties
@ -1636,4 +1637,3 @@ class pdf_azur extends ModelePDFPropales
return ($tab_hl*7);
}
}

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -598,7 +599,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + $object->remise), 0, 'R', 1);
@ -1094,7 +1095,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$object->fetch_user($arrayidcontact[0]);
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
}
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
// Show sender
@ -1192,4 +1193,3 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
}
}

View File

@ -5,6 +5,7 @@
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -430,7 +431,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if ($object->lines[$i]->remise_percent)
{
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent."%", 0, 'R');
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R');
}
// Total HT line
@ -695,7 +696,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
@ -1144,7 +1145,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$object->fetch_user($arrayidcontact[0]);
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
}
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
// Show sender
@ -1242,4 +1243,3 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
}
}

View File

@ -71,7 +71,7 @@ elseif ($module == 'shipping') { $permission=$user->rights->expedition->cr
elseif ($module == 'product') { $permission=$user->rights->produit->creer;}
//else dol_print_error('','Bad value '.$module.' for param module');
if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%'; // Rem: This var is for all notes, not only thirdparties note.
if (! empty($conf->fckeditor->enabled) && ! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:95%'; // Rem: This var is for all notes, not only thirdparties note.
else $typeofdata='textarea:12:95%';
?>

View File

@ -481,13 +481,13 @@ class Expedition extends CommonObject
// Check parameters
if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut";
$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet";
$sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
$sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery";
$sql.= ", e.fk_shipping_method, e.tracking_number";
$sql.= ", el.fk_source as origin_id, el.sourcetype as origin";
$sql.= ", e.note_private, e.note_public";
$sql.= ', e.fk_incoterms, e.location_incoterms';
$sql.= ', e.fk_incoterms, e.location_incoterms, e.fk_projet';
$sql.= ', i.libelle as libelle_incoterms';
$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'";
@ -513,6 +513,7 @@ class Expedition extends CommonObject
$this->ref_ext = $obj->ref_ext;
$this->ref_int = $obj->ref_int;
$this->statut = $obj->fk_statut;
$this->fk_project = $obj->fk_projet;
$this->user_author_id = $obj->fk_user_author;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date = $this->db->jdate($obj->date_expedition); // TODO deprecated
@ -526,6 +527,7 @@ class Expedition extends CommonObject
$this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility
$this->origin_id = $obj->origin_id;
$this->billed = ($obj->fk_statut==2?1:0);
$this->fk_project = $obj->fk_projet;
$this->trueWeight = $obj->weight;
$this->weight_units = $obj->weight_units;
@ -1052,6 +1054,7 @@ class Expedition extends CommonObject
$sql.= " fk_shipping_method=".((isset($this->shipping_method_id) && $this->shipping_method_id > 0)?$this->shipping_method_id:"null").",";
$sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").",";
$sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").",";
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
$sql.= " height=".(($this->trueHeight != '')?$this->trueHeight:"null").",";
$sql.= " width=".(($this->trueWidth != '')?$this->trueWidth:"null").",";
$sql.= " size_units=".(isset($this->size_units)?$this->size_units:"null").",";

View File

@ -51,6 +51,7 @@ $search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_billed=GETPOST("search_billed",'int');
$sall = GETPOST('sall', 'alphanohtml');
$optioncss = GETPOST('optioncss','alpha');
$search_ref_customer=GETPOST("search_ref_customer");
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
@ -141,6 +142,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_billed='';
$viewstatut='';
$search_array_options=array();
$search_ref_customer='';
}
if (empty($reshook))
@ -267,6 +269,10 @@ if ($resql)
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;
if ($search_town)$param .= '&search_town='.urlencode($search_town);
if ($search_zip)$param .= '&search_zip='.urlencode($search_zip);
if ($search_ref_customer)$param .= '&search_ref_customer='.$search_ref_customer;
if ($viewstatut != '')$param .= '&viewstatut='.$viewstatut;
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{

View File

@ -1374,7 +1374,7 @@ class CommandeFournisseur extends CommonOrder
$error = 0;
dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $fk_prod_fourn_price, $fourn_ref, $remise_percent, $price_base_type, $pu_ttc, $type, $fk_unit");
dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $fk_prod_fourn_price, $fourn_ref, $remise_percent, $price_base_type, $pu_ttc, $type, $fk_unit, $pu_ht_devise, $origin, $origin_id");
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
@ -1388,6 +1388,7 @@ class CommandeFournisseur extends CommonOrder
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1);
@ -1430,15 +1431,14 @@ class CommandeFournisseur extends CommonOrder
// We use 'none' instead of $fourn_ref, because fourn_ref may not exists anymore. So we will take the first supplier price ok.
// If we want a dedicated supplier price, we must provide $fk_prod_fourn_price.
$result=$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc?$this->fk_soc:$this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$fourn_ref/$this->fk_soc
if ($result > 0)
// If supplier order created from customer order, we take best supplier price
// If $pu (defined previously from pu_ht or pu_ttc) is not defined at all, we also take the best supplier price
if ($result > 0 && ($origin == 'commande' || $pu === ''))
{
$pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice
$ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice
// is remise percent not keyed but present for the product we add it
if ($remise_percent == 0 && $prod->remise_percent !=0)
$remise_percent =$prod->remise_percent;
$pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice
$ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice
// is remise percent not keyed but present for the product we add it
if ($remise_percent == 0 && $prod->remise_percent !=0) $remise_percent = $prod->remise_percent;
}
if ($result == 0) // If result == 0, we failed to found the supplier reference price
{
@ -2337,6 +2337,7 @@ class CommandeFournisseur extends CommonOrder
$qty=price2num($qty);
if (! $qty) $qty=1;
$pu = price2num($pu);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);

View File

@ -401,7 +401,7 @@ if (empty($reshook))
$localtax2_tx,
$idprod,
$productsupplier->product_fourn_price_id,
$productsupplier->fourn_ref,
$productsupplier->ref_supplier,
$remise_percent,
'HT',
$pu_ttc,
@ -1342,6 +1342,8 @@ if ($action=='create')
dol_htmloutput_events();
$currency_code = $conf->currency;
$societe='';
if ($socid>0)
{

View File

@ -85,6 +85,8 @@ $search_total_ttc=GETPOST('search_total_ttc','alpha');
$optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int');
$search_project_ref=GETPOST('search_project_ref','alpha');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$page = GETPOST('page','int');
$sortorder = GETPOST('sortorder','alpha');
@ -105,7 +107,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -99,6 +99,8 @@ $day_lim = GETPOST('day_lim','int');
$month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int');
$toselect = GETPOST('toselect', 'array');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$option = GETPOST('option');
if ($option == 'late') {
@ -110,7 +112,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int');
if ($page == -1 || $page == null) { $page = 0 ; }
if ($page == -1 || $page == null || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0 ; }
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -38,6 +38,8 @@ if ($user->societe_id > 0)
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('supplierbalencelist','globalcard'));
/*
* View
@ -67,7 +69,7 @@ if ($socid > 0)
// Invoice list
print load_fiche_titre($langs->trans("SupplierPreview"));
print '<table class="noborder" width="100%">';
print '<table class="noborder tagtable liste" width="100%">';
$sql = "SELECT s.nom, s.rowid as socid, f.ref_supplier, f.amount, f.datef as df,";
$sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,";
@ -114,7 +116,7 @@ if ($socid > 0)
}
$totalpaye = $fac->getSommePaiement();
print '<tr class="oddeven">';
print "<td align=\"center\">".dol_print_date($fac->date)."</td>\n";
@ -182,7 +184,7 @@ if ($socid > 0)
{
dol_print_error($db);
}
print "</table>";
}
}

View File

@ -47,16 +47,16 @@ $main_data_dir = GETPOST('main_data_dir') ? GETPOST('main_data_dir') : $main_dir
// Dolibarr root URL
$main_url = GETPOST('main_url');
// Database login informations
$userroot=GETPOST('db_user_root');
$passroot=GETPOST('db_pass_root');
$userroot=GETPOST('db_user_root','alpha');
$passroot=GETPOST('db_pass_root','none');
// Database server
$db_type=GETPOST('db_type','alpha');
$db_type=GETPOST('db_type','aZ09');
$db_host=GETPOST('db_host','alpha');
$db_name=GETPOST('db_name','alpha');
$db_name=GETPOST('db_name','aZ09');
$db_user=GETPOST('db_user','alpha');
$db_pass=GETPOST('db_pass');
$db_pass=GETPOST('db_pass','none');
$db_port=GETPOST('db_port','int');
$db_prefix=GETPOST('db_prefix','alpha');
$db_prefix=GETPOST('db_prefix','aZ09');
$db_create_database = GETPOST('db_create_database','none');
$db_create_user = GETPOST('db_create_user','none');
// Force https

View File

@ -1705,6 +1705,7 @@ BaseCurrency=Reference currency of the company (go into setup of company to chan
WarningNoteModuleInvoiceForFrenchLaw=This module %s is compliant with french laws (Loi Finance 2016).
WarningNoteModulePOSForFrenchLaw=This module %s is compliant with french laws (Loi Finance 2016) because module Non Reversible Logs is automatically activated.
WarningInstallationMayBecomeNotCompliantWithLaw=You try to install the module %s that is an external module. Activating an external module means you trust the publisher of the module and you are sure that this module does not alterate negatively the behavior of your application and is compliant with laws of your country (%s). If the module bring a non legal feature, you become responsible for the use of a non legal software.
NothingToSetup=There is no specific setup to do for this module.
##### Resource ####
ResourceSetup=Configuration du module Resource
UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).

View File

@ -108,7 +108,7 @@ MyAvailability=Ma disponibilité
ActionType=Type événement
DateActionBegin=Date début événément
CloneAction=Cloner l'événement
ConfirmCloneEvent=Êtes-vous sûr de vouloir cloner cette facture <b>%s</b> ?
ConfirmCloneEvent=Êtes-vous sûr de vouloir cloner l'événement <b>%s</b> ?
RepeatEvent=Répétez événement
EveryWeek=Chaque semaine
EveryMonth=Chaque mois

View File

@ -4456,8 +4456,6 @@ class Product extends CommonObject
$langs->load('products');
$this->db->begin();
$label_type = 'label';
if ($type == 'short')

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -134,7 +134,7 @@ if (dol_strlen($type))
$sql.= " AND p.fk_product_type <> '1'";
}
}
if ($sref) $sql.= natural_search('p.ref', $ref);
if ($sref) $sql.= natural_search('p.ref', $sref);
if ($sbarcode) $sql.= natural_search('p.barcode', $sbarcode);
if ($snom) $sql.= natural_search('p.label', $snom);
if (! empty($tosell)) $sql.= " AND p.tosell = ".$tosell;

View File

@ -633,9 +633,8 @@ class Project extends CommonObject
$this->getLinesArray($user);
// Delete tasks
foreach($this->lines as &$task) {
$task->delete($user);
}
$ret = $this->deleteTasks($user);
if ($ret < 0) $error++;
// Delete project
if (! $error)
@ -711,6 +710,40 @@ class Project extends CommonObject
return -1;
}
}
/**
* Delete tasks with no children first, then task with children recursively
*
* @param User $user User
* @return int <0 if KO, 1 if OK
*/
function deleteTasks($user)
{
$countTasks = count($this->lines);
$deleted = false;
if ($countTasks)
{
foreach($this->lines as $task)
{
if ($task->hasChildren() <= 0) { // If there is no children (or error to detect them)
$deleted = true;
$ret = $task->delete($user);
if ($ret <= 0)
{
$this->errors[] = $this->db->lasterror();
return -1;
}
}
}
}
$this->getLinesArray($user);
if ($deleted && count($this->lines) < $countTasks)
{
if (count($this->lines)) $this->deleteTasks($this->lines);
}
return 1;
}
/**
* Validate a project
@ -1674,7 +1707,7 @@ class Project extends CommonObject
// For external user, no check is done on company permission because readability is managed by public status of project and assignement.
//if (! $user->rights->societe->client->voir && ! $socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid";
$sql.= " WHERE p.fk_statut = 1";
$sql.= " AND p.entity IN (".getEntity('project', 0).')';
$sql.= " AND p.entity IN (".getEntity('project').')';
if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
//if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
@ -1750,7 +1783,7 @@ class Project extends CommonObject
$sql = "SELECT count(p.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " WHERE";
$sql.= " p.entity IN (".getEntity('projet').")";
$sql.= " p.entity IN (".getEntity('project').")";
if (! $user->rights->projet->all->lire)
{
$projectsListId = $this->getProjectsAuthorizedForUser($user,0,1);

View File

@ -296,7 +296,7 @@ if (empty($reshook))
if (! $error)
{
$result = $object->insertExtraFields();
if ($result < 0)
if ($result < 0)
{
$error++;
$errors = $object->errors;
@ -524,8 +524,8 @@ if (empty($reshook))
$error=$object->error; $errors=$object->errors;
}
}
// Customer categories association
$custcats = GETPOST( 'custcats', 'array' );
$object->setCategories($custcats, 'customer');
@ -533,7 +533,7 @@ if (empty($reshook))
// Supplier categories association
$suppcats = GETPOST('suppcats', 'array');
$object->setCategories($suppcats, 'supplier');
// Logo/Photo save
$dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/";
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
@ -638,10 +638,13 @@ if (empty($reshook))
$result = $object->update($socid, $user, 1, $object->oldcopy->codeclient_modifiable(), $object->oldcopy->codefournisseur_modifiable(), 'update', 0);
if ($result <= 0)
{
$error = $object->error; $errors = $object->errors;
$error++;
$errors = $object->errors;
setEventMessages($object->error, $object->errors, 'errors');
}
// Prevent thirdparty's emptying if a user hasn't rights $user->rights->categorie->lire (in such a case, post of 'custcats' is not defined)
if(!empty($user->rights->categorie->lire)){
if(!empty($user->rights->categorie->lire)){
// Customer categories association
$categories = GETPOST( 'custcats', 'array' );
$object->setCategories($categories, 'customer');
@ -718,6 +721,7 @@ if (empty($reshook))
{
$error++;
$object->error .= $object->db->lasterror();
setEventMessages($object->error, $object->errors, 'errors');
}
}

View File

@ -82,6 +82,8 @@ $search_type=GETPOST('search_type','alpha');
$search_level_from = GETPOST("search_level_from","alpha");
$search_level_to = GETPOST("search_level_to","alpha");
$search_stcomm=GETPOST('search_stcomm','int');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$type=GETPOST('type');
$optioncss=GETPOST('optioncss','alpha');
@ -95,7 +97,7 @@ $sortorder=GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int');
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="s.nom";
if (empty($page) || $page == -1) { $page = 0; }
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; }
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -73,6 +73,8 @@ $search_montant_vat=GETPOST('search_montant_vat','alpha');
$search_montant_ttc=GETPOST('search_montant_ttc','alpha');
$search_status=GETPOST('viewstatut','alpha')?GETPOST('viewstatut','alpha'):GETPOST('search_status','int');
$object_statut=$db->escape(GETPOST('supplier_proposal_statut'));
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$sall=GETPOST('sall', 'alphanohtml');
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
@ -85,7 +87,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -136,7 +136,7 @@ if (preg_match('/\.\./',$fullpath_original_file) || preg_match('/[<>|]/',$fullpa
if ($modulepart == 'barcode')
{
$generator=GETPOST("generator","alpha");
$code=GETPOST("code",'alpha');
$code=GETPOST("code",'none');
$encoding=GETPOST("encoding","alpha");
$readable=GETPOST("readable",'alpha')?GETPOST("readable","alpha"):"Y";

View File

@ -61,7 +61,9 @@ class AdherentTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -59,7 +59,9 @@ class AdminLibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -61,7 +61,9 @@ class BankAccountTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -62,6 +62,8 @@ class BonPrelevementTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -89,7 +89,9 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -59,7 +59,9 @@ class CMailFileTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;
@ -103,7 +105,7 @@ class CMailFileTest extends PHPUnit_Framework_TestCase
$db=$this->savdb;
$conf->global->MAIN_DISABLE_ALL_MAILS=1; // If I comment/remove this lien, unit test still works alone but failed when ran from AllTest. Don't know why.
print __METHOD__."\n";
}
/**

View File

@ -60,7 +60,9 @@ class CategorieTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -60,6 +60,8 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
@ -117,7 +119,7 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
/**
* testChargeSocialesCreate
*
*
* @return void
*/
public function testChargeSocialesCreate()
@ -139,10 +141,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
/**
* testChargeSocialesFetch
*
*
* @param int $id Id of social contribution
* @return void
*
*
* @depends testChargeSocialesCreate
* The depends says test is run only if previous is ok
*/
@ -164,10 +166,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
/**
* testChargeSocialesValid
*
*
* @param Object $localobject Social contribution
* @return void
*
*
* @depends testChargeSocialesFetch
* The depends says test is run only if previous is ok
*/
@ -188,10 +190,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
/**
* testChargeSocialesOther
*
*
* @param Object $localobject Social contribution
* @return void
*
*
* @depends testChargeSocialesValid
* The depends says test is run only if previous is ok
*/
@ -216,10 +218,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase
/**
* testChargeSocialesDelete
*
*
* @param int $id Social contribution
* @return void
*
*
* @depends testChargeSocialesOther
* The depends says test is run only if previous is ok
*/

View File

@ -72,7 +72,9 @@ class CodingPhpTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -72,7 +72,9 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -61,7 +61,9 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -59,7 +59,9 @@ class CommandeTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -60,7 +60,9 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -60,6 +60,8 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -59,7 +59,9 @@ class CompanyLibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -68,6 +68,8 @@ class ContactTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
@ -207,7 +209,7 @@ class ContactTest extends PHPUnit_Framework_TestCase
$localobject->email='newemail@newemail.com';
$localobject->jabberid='New im id';
$localobject->default_lang='es_ES';
$result=$localobject->update($localobject->id,$user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0, 'Contact::update error');

View File

@ -60,6 +60,8 @@ class ContratTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -62,7 +62,9 @@ class CoreTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;
@ -290,22 +292,22 @@ class CoreTest extends PHPUnit_Framework_TestCase
}
// Run tests
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices';
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
$expectedresult=0;
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1a');
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices;badaction';
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
$expectedresult=1;
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1b');
$_GET['aaa']="<img src='1.jpg' onerror =javascript:alert('XSS')>";
$result=test_sql_and_script_inject($_GET['aaa'], 0);
$expectedresult=1;
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 2');
$_POST['bbb']="<img src='1.jpg' onerror =javascript:alert('XSS')>";
$result=test_sql_and_script_inject($_POST['bbb'], 2);
$expectedresult=1;

View File

@ -60,6 +60,8 @@ class DateLibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -60,6 +60,8 @@ class DateLibTzFranceTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -60,6 +60,8 @@ class DiscountTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -60,6 +60,8 @@ class EntrepotTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -60,7 +60,9 @@ class ExpenseReportTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;
@ -151,7 +153,7 @@ class ExpenseReportTest extends PHPUnit_Framework_TestCase
$localobject2->initAsSpecimen(); // Init a speciment with lines
$localobject2->status = 0;
$localobject2->fk_statut = 0;
$result=$localobject2->create($user);
print __METHOD__." result=".$result."\n";
$this->assertGreaterThanOrEqual(0, $result);

View File

@ -64,6 +64,8 @@ class ExportTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -61,6 +61,8 @@ class FactureFournisseurTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -61,6 +61,8 @@ class FactureRecTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -59,7 +59,9 @@ class FactureTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -60,6 +60,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -60,6 +60,8 @@ class FichinterTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -61,6 +61,8 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -60,6 +60,8 @@ class FormAdminTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -63,7 +63,9 @@ class Functions2LibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -63,7 +63,9 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -62,6 +62,8 @@ class HolidayTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
@ -201,11 +203,11 @@ class HolidayTest extends PHPUnit_Framework_TestCase
$localobject->email='newemail@newemail.com';
$localobject->jabberid='New im id';
$localobject->default_lang='es_ES';
$result=$localobject->update($localobject->id,$user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0, 'Holiday::update error');
$result=$localobject->update_note($localobject->note_private,'_private');
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0, 'Holiday::update_note (private) error');
@ -213,7 +215,7 @@ class HolidayTest extends PHPUnit_Framework_TestCase
$result=$localobject->update_note($localobject->note_public, '_public');
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0, 'Holiday::update_note (public) error');
$newobject=new Holiday($this->savdb);
$result=$newobject->fetch($localobject->id);

View File

@ -61,6 +61,8 @@ class ImagesLibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -62,6 +62,8 @@ class ImportTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -62,7 +62,9 @@ class JsonLibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -72,6 +72,8 @@ class LangTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -60,6 +60,8 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
@ -136,7 +138,7 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
$this->assertEquals(25,$result[1]);
print __METHOD__." result[2]=".$result[2]."\n";
$this->assertEquals(20,$result[2]);
$result=getMarginInfos(10, 10, 19.6, 0, 0, 0, 8);
print __METHOD__." result[0]=".$result[0]."\n";
$this->assertEquals(8,$result[0]);
@ -144,7 +146,7 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase
$this->assertEquals(12.5,$result[1]);
print __METHOD__." result[2]=".$result[2]."\n";
$this->assertEquals(1/9*100,$result[2]);
return 0;
}

View File

@ -59,6 +59,8 @@ class ModulesTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -62,6 +62,8 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -59,6 +59,8 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
@ -75,7 +77,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
print __METHOD__."\n";
@ -128,7 +130,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php';
require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/mod_facture_mercure.php';
@ -137,9 +139,9 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase
$conf->global->FACTURE_ADDON='mercure';
$conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000}';
$conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000}';
$conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED=0;
$conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED=0;
$localobject=new Facture($this->savdb);
$localobject=new Facture($this->savdb);
$localobject->initAsSpecimen();
$localobject->date=dol_mktime(12, 0, 0, 1, 1, 1915); // we use year 1915 to be sure to not have existing invoice for this year
$numbering=new mod_facture_mercure();

View File

@ -61,6 +61,8 @@ class PaypalTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
@ -135,9 +137,9 @@ class PaypalTest extends PHPUnit_Framework_TestCase
$urltotest=getPaypalPaymentUrl(1,'free');
print "urltotest=".$urltotest."\n";
$result=getURLContent($urltotest, 'GET');
print __METHOD__." result=".$result."\n";
$this->assertLessThanOrEqual($result, 0);

View File

@ -63,6 +63,8 @@ class PdfDocTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;

View File

@ -62,6 +62,8 @@ class PgsqlTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
@ -167,13 +169,13 @@ class PgsqlTest extends PHPUnit_Framework_TestCase
$result=DoliDBPgsql::convertSQLFromMysql($sql);
print __METHOD__." result=".$result."\n";
$this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (without SEPARATOR)');
// Test GROUP_CONCAT (with SEPARATOR)
$sql="SELECT a.b, GROUP_CONCAT(a.c SEPARATOR ',') FROM table GROUP BY a.b";
$result=DoliDBPgsql::convertSQLFromMysql($sql);
print __METHOD__." result=".$result."\n";
$this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (with SEPARATOR)');
return $result;
}
}

View File

@ -67,7 +67,9 @@ class PricesTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

View File

@ -60,7 +60,9 @@ class ProductTest extends PHPUnit_Framework_TestCase
*/
function __construct()
{
//$this->sharedFixture
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;

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