Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop-api
This commit is contained in:
commit
37cad81a68
@ -319,7 +319,7 @@ script:
|
||||
php upgrade2.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
||||
php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log
|
||||
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade600700.log
|
||||
php upgrade2.php 6.0.0 7.0.0 MAIN_MODULE_WEBSITE > $TRAVIS_BUILD_DIR/upgrade600700-2.log
|
||||
php upgrade2.php 6.0.0 7.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade600700-2.log
|
||||
php step5.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-3.log
|
||||
cd -
|
||||
set +e
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -67,8 +67,8 @@ $arrayfields=array(
|
||||
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0),
|
||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'),
|
||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||
);
|
||||
|
||||
@ -105,14 +105,32 @@ if (empty($reshook))
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
if (GETPOST('change_chart'))
|
||||
if (GETPOST('change_chart','alpha'))
|
||||
{
|
||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||
|
||||
if (! empty($chartofaccounts)) {
|
||||
if ($chartofaccounts > 0)
|
||||
{
|
||||
// Get language code for this $chartofaccounts
|
||||
$sql ='SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
|
||||
$sql.=' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$country_code = $obj->code;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
// Try to load sql file
|
||||
if ($country_code)
|
||||
{
|
||||
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
|
||||
$result = run_sql($sqlfile, 1, 0, 1);
|
||||
}
|
||||
|
||||
if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$error ++;
|
||||
@ -216,25 +234,29 @@ if ($resql)
|
||||
// Box to select active chart of account
|
||||
print $langs->trans("Selectchartofaccounts") . " : ";
|
||||
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
|
||||
$sql = "SELECT rowid, pcg_version, label, active";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system";
|
||||
$sql .= " WHERE active = 1";
|
||||
dol_syslog('accountancy/admin/account.php:: $sql=' . $sql);
|
||||
$sql = "SELECT a.rowid, a.pcg_version, a.label, a.active, c.code as country_code";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system as a";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON a.fk_country = c.rowid";
|
||||
$sql .= " WHERE a.active = 1";
|
||||
dol_syslog('accountancy/admin/account.php $sql='.$sql);
|
||||
print $sql;
|
||||
$resqlchart = $db->query($sql);
|
||||
if ($resqlchart) {
|
||||
$numbis = $db->num_rows($resqlchart);
|
||||
$i = 0;
|
||||
while ( $i < $numbis ) {
|
||||
$row = $db->fetch_row($resqlchart);
|
||||
while ($i < $numbis) {
|
||||
$obj = $db->fetch_object($resqlchart);
|
||||
|
||||
print '<option value="' . $row[0] . '"';
|
||||
print $pcgver == $row[0] ? ' selected' : '';
|
||||
print '>' . $row[1] . ' - ' . $row[2] . '</option>';
|
||||
print '<option value="' . $obj->rowid . '"';
|
||||
print ($pcgver == $obj->rowid) ? ' selected' : '';
|
||||
print '>' . $obj->pcg_version . ' - ' . $obj->label . ' - (' . $obj->country_code . ')</option>';
|
||||
|
||||
$i ++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
print "</select>";
|
||||
print ajax_combobox("chartofaccounts");
|
||||
print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
@ -41,14 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$langs->load("errors");
|
||||
$langs->load("admin");
|
||||
$langs->load("main");
|
||||
$langs->load("companies");
|
||||
$langs->load("resource");
|
||||
$langs->load("holiday");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("hrm");
|
||||
$langs->loadLangs(array("errors","admin","companies","resource","holiday","compta","accountancy","hrm"));
|
||||
|
||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
@ -100,7 +93,7 @@ $tablib[32]= "DictionaryAccountancyCategory";
|
||||
|
||||
// Requests to extract data
|
||||
$tabsql=array();
|
||||
$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
||||
$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.fk_country as country_id, c.code as country_code, c.label as country, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_country=c.rowid and c.active=1";
|
||||
$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
@ -110,17 +103,17 @@ $tabsqlsort[32]="position ASC";
|
||||
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
$tabfield=array();
|
||||
$tabfield[31]= "pcg_version,label";
|
||||
$tabfield[31]= "pcg_version,label,country_id,country";
|
||||
$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
$tabfieldvalue=array();
|
||||
$tabfieldvalue[31]= "pcg_version,label";
|
||||
$tabfieldvalue[31]= "pcg_version,label,country";
|
||||
$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
$tabfieldinsert=array();
|
||||
$tabfieldinsert[31]= "pcg_version,label";
|
||||
$tabfieldinsert[31]= "pcg_version,label,fk_country";
|
||||
$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
@ -173,7 +166,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$ok=1;
|
||||
foreach ($listfield as $f => $value)
|
||||
{
|
||||
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancyCategory','Pcg_version'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
||||
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
||||
@ -188,6 +181,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$ok=0;
|
||||
$fieldnamekey=$listfield[$f];
|
||||
// We take translate key of field
|
||||
|
||||
if ($fieldnamekey == 'pcg_version') $fieldnamekey='Pcg_version';
|
||||
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
|
||||
if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments';
|
||||
if ($fieldnamekey == 'nbjour') $fieldnamekey='NbOfDays';
|
||||
|
||||
@ -569,6 +569,7 @@ if ($id)
|
||||
print "</tr>";
|
||||
|
||||
$colspan=count($fieldlist)+3;
|
||||
if ($id == 32) $colspan++;
|
||||
|
||||
print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
||||
}
|
||||
|
||||
@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
|
||||
$action=GETPOST('action','aZ09');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("products");
|
||||
@ -62,22 +63,22 @@ error_reporting($err);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'update' && empty($_POST["cancel"]))
|
||||
if ($action == 'update' && ! $cancel)
|
||||
{
|
||||
$_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer
|
||||
|
||||
dolibarr_set_const($db, "MAIN_MENU_STANDARD", $_POST["MAIN_MENU_STANDARD"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", $_POST["MAIN_MENU_SMARTPHONE"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD','alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", $_POST["MAIN_MENUFRONT_STANDARD"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE",$_POST["MAIN_MENUFRONT_SMARTPHONE"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD','alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
// Define list of menu handlers to initialize
|
||||
$listofmenuhandler=array();
|
||||
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENU_STANDARD"])]=1;
|
||||
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENUFRONT_STANDARD"])]=1;
|
||||
if (isset($_POST["MAIN_MENU_SMARTPHONE"])) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENU_SMARTPHONE"])]=1;
|
||||
if (isset($_POST["MAIN_MENUFRONT_SMARTPHONE"])) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',$_POST["MAIN_MENUFRONT_SMARTPHONE"])]=1;
|
||||
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENU_STANDARD','alpha'))]=1;
|
||||
$listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENUFRONT_STANDARD','alpha'))]=1;
|
||||
if (GETPOST('MAIN_MENU_SMARTPHONE','alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENU_SMARTPHONE','alpha'))]=1;
|
||||
if (GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'))]=1;
|
||||
|
||||
// Initialize menu handlers
|
||||
foreach ($listofmenuhandler as $key => $val)
|
||||
@ -179,7 +180,7 @@ if ($action == 'edit')
|
||||
print '</tr>';
|
||||
|
||||
// Menu top
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuManager").'</td>';
|
||||
print '<td>';
|
||||
$formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled');
|
||||
@ -190,7 +191,7 @@ if ($action == 'edit')
|
||||
print '</tr>';
|
||||
|
||||
// Menu smartphone
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
|
||||
print '<td>';
|
||||
$formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled');
|
||||
@ -217,7 +218,7 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuManager").'</td>';
|
||||
print '<td>';
|
||||
$filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED));
|
||||
@ -229,7 +230,7 @@ else
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -110,10 +110,10 @@ $formother=new FormOther($db);
|
||||
$formadmin=new FormAdmin($db);
|
||||
|
||||
$arraydetailsforpdffoot = array(
|
||||
0 => $langs->trans('NoDetails'),
|
||||
1 => $langs->trans('DisplayCompanyInfo'),
|
||||
2 => $langs->trans('DisplayCompanyManagers'),
|
||||
3 => $langs->trans('DisplayCompanyInfoAndManagers')
|
||||
0 => $langs->transnoentitiesnoconv('NoDetails'),
|
||||
1 => $langs->transnoentitiesnoconv('DisplayCompanyInfo'),
|
||||
2 => $langs->transnoentitiesnoconv('DisplayCompanyManagers'),
|
||||
3 => $langs->transnoentitiesnoconv('DisplayCompanyInfoAndManagers')
|
||||
);
|
||||
|
||||
print load_fiche_titre($langs->trans("PDF"),'','title_setup');
|
||||
@ -589,7 +589,7 @@ else // Show
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td colspan="2">';
|
||||
print $arraydetailsforpdffoot[$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS];
|
||||
print $arraydetailsforpdffoot[($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS ? $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS : 0)];
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -207,7 +207,7 @@ class Contracts extends DolibarrApi
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lines of an contract
|
||||
* Get lines of a contract
|
||||
*
|
||||
* @param int $id Id of contract
|
||||
*
|
||||
|
||||
@ -691,8 +691,8 @@ class Contrat extends CommonObject
|
||||
$sql.= " d.fk_user_ouverture,";
|
||||
$sql.= " d.fk_user_cloture,";
|
||||
$sql.= " d.fk_unit";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as d, ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " WHERE d.fk_contrat = ".$this->id ." AND d.fk_product = p.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as d LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid";
|
||||
$sql.= " WHERE d.fk_contrat = ".$this->id;
|
||||
$sql.= " ORDER by d.rowid ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
|
||||
@ -728,7 +728,7 @@ class Contrat extends CommonObject
|
||||
$line->total_localtax1 = $objp->total_localtax1;
|
||||
$line->total_localtax2 = $objp->total_localtax2;
|
||||
$line->total_ttc = $objp->total_ttc;
|
||||
$line->fk_product = $objp->fk_product;
|
||||
$line->fk_product = (($objp->fk_product > 0)?$objp->fk_product:0);
|
||||
$line->info_bits = $objp->info_bits;
|
||||
|
||||
$line->fk_fournprice = $objp->fk_fournprice;
|
||||
@ -740,9 +740,17 @@ class Contrat extends CommonObject
|
||||
$line->fk_user_cloture = $objp->fk_user_cloture;
|
||||
$line->fk_unit = $objp->fk_unit;
|
||||
|
||||
$line->ref = $objp->product_ref; // deprecated
|
||||
$line->label = $objp->product_label; // deprecated
|
||||
$line->libelle = $objp->product_label; // deprecated
|
||||
$line->ref = $objp->product_ref; // deprecated
|
||||
if (empty($objp->fk_product))
|
||||
{
|
||||
$line->label = ''; // deprecated
|
||||
$line->libelle = $objp->description; // deprecated
|
||||
}
|
||||
else
|
||||
{
|
||||
$line->label = $objp->product_label; // deprecated
|
||||
$line->libelle = $objp->product_label; // deprecated
|
||||
}
|
||||
$line->product_ref = $objp->product_ref; // Ref product
|
||||
$line->product_desc = $objp->product_desc; // Description product
|
||||
$line->product_label = $objp->product_label; // Label product
|
||||
@ -759,7 +767,7 @@ class Contrat extends CommonObject
|
||||
$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite);
|
||||
$line->date_fin_reel = $this->db->jdate($objp->date_cloture);
|
||||
|
||||
// Retreive all extrafield for propal
|
||||
// Retreive all extrafield for contract
|
||||
// fetch optionals attributes and labels
|
||||
$line->fetch_optionals($line->id,$extralabelsline);
|
||||
|
||||
@ -789,108 +797,6 @@ class Contrat extends CommonObject
|
||||
return -3;
|
||||
}
|
||||
|
||||
// Selectionne les lignes contrat liees a aucun produit
|
||||
$sql = "SELECT d.rowid, d.fk_contrat, d.statut, d.qty, d.description, d.price_ht, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.rowid, d.remise_percent, d.subprice,";
|
||||
$sql.= " d.total_ht,";
|
||||
$sql.= " d.total_tva,";
|
||||
$sql.= " d.total_localtax1,";
|
||||
$sql.= " d.total_localtax2,";
|
||||
$sql.= " d.total_ttc,";
|
||||
$sql.= " d.info_bits, d.fk_product,";
|
||||
$sql.= " d.date_ouverture_prevue, d.date_ouverture,";
|
||||
$sql.= " d.date_fin_validite, d.date_cloture,";
|
||||
$sql.= " d.fk_user_author,";
|
||||
$sql.= " d.fk_user_ouverture,";
|
||||
$sql.= " d.fk_user_cloture,";
|
||||
$sql.= " d.fk_unit";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as d";
|
||||
$sql.= " WHERE d.fk_contrat = ".$this->id;
|
||||
$sql.= " AND (d.fk_product IS NULL OR d.fk_product = 0)"; // fk_product = 0 gardee pour compatibilitee
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$line = new ContratLigne($this->db);
|
||||
$line->id = $objp->rowid;
|
||||
$line->fk_contrat = $objp->fk_contrat;
|
||||
$line->libelle = $objp->description;
|
||||
$line->desc = $objp->description;
|
||||
$line->qty = $objp->qty;
|
||||
$line->statut = $objp->statut;
|
||||
$line->ref = '';
|
||||
$line->tva_tx = $objp->tva_tx;
|
||||
$line->localtax1_tx = $objp->localtax1_tx;
|
||||
$line->localtax2_tx = $objp->localtax2_tx;
|
||||
$line->localtax1_type = $objp->localtax1_type;
|
||||
$line->localtax2_type = $objp->localtax2_type;
|
||||
$line->subprice = $objp->subprice;
|
||||
$line->remise_percent = $objp->remise_percent;
|
||||
$line->price_ht = $objp->price_ht;
|
||||
$line->price = (isset($objp->price)?$objp->price:null); // For backward compatibility
|
||||
$line->total_ht = $objp->total_ht;
|
||||
$line->total_tva = $objp->total_tva;
|
||||
$line->total_localtax1= $objp->total_localtax1;
|
||||
$line->total_localtax2= $objp->total_localtax2;
|
||||
$line->total_ttc = $objp->total_ttc;
|
||||
$line->fk_product = 0;
|
||||
$line->info_bits = $objp->info_bits;
|
||||
|
||||
$line->fk_user_author = $objp->fk_user_author;
|
||||
$line->fk_user_ouverture= $objp->fk_user_ouverture;
|
||||
$line->fk_user_cloture = $objp->fk_user_cloture;
|
||||
|
||||
$line->description = $objp->description;
|
||||
|
||||
$line->date_ouverture_prevue = $this->db->jdate($objp->date_ouverture_prevue);
|
||||
$line->date_ouverture = $this->db->jdate($objp->date_ouverture);
|
||||
$line->date_fin_validite = $this->db->jdate($objp->date_fin_validite);
|
||||
$line->date_cloture = $this->db->jdate($objp->date_cloture);
|
||||
// For backward compatibility
|
||||
$line->date_debut_prevue = $this->db->jdate($objp->date_ouverture_prevue);
|
||||
$line->date_debut_reel = $this->db->jdate($objp->date_ouverture);
|
||||
$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite);
|
||||
$line->date_fin_reel = $this->db->jdate($objp->date_cloture);
|
||||
$line->fk_unit = $objp->fk_unit;
|
||||
|
||||
if ($line->statut == 0) $this->nbofserviceswait++;
|
||||
if ($line->statut == 4 && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) $this->nbofservicesopened++;
|
||||
if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
|
||||
if ($line->statut == 5) $this->nbofservicesclosed++;
|
||||
|
||||
|
||||
// Retreive all extrafield for propal
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
$line->fetch_optionals($line->id,$extralabelsline);
|
||||
|
||||
|
||||
$this->lines[$pos] = $line;
|
||||
$this->lines_id_index_mapper[$line->id] = $pos;
|
||||
|
||||
$total_ttc+=$objp->total_ttc;
|
||||
$total_vat+=$objp->total_tva;
|
||||
$total_ht+=$objp->total_ht;
|
||||
|
||||
$i++;
|
||||
$pos++;
|
||||
}
|
||||
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::Fetch Erreur lecture des lignes de contrat non liees aux produits");
|
||||
$this->error=$this->db->error();
|
||||
return -2;
|
||||
}
|
||||
|
||||
$this->nbofservices=count($this->lines);
|
||||
$this->total_ttc = price2num($total_ttc); // TODO For the moment value is false as value is not stored in database for line linked to products
|
||||
$this->total_vat = price2num($total_vat); // TODO For the moment value is false as value is not stored in database for line linked to products
|
||||
|
||||
@ -226,7 +226,7 @@ class modResource extends DolibarrModules
|
||||
'type'=> 'left', // Toujours un menu gauche
|
||||
'titre'=> 'MenuResourceAdd',
|
||||
'mainmenu'=> 'tools',
|
||||
'leftmenu'=> '', // On n'indique rien ici car on ne souhaite pas intégrer de sous-menus à ce menu
|
||||
'leftmenu'=> 'resource_add',
|
||||
'url'=> '/resource/add.php',
|
||||
'langs'=> 'resource',
|
||||
'position'=> 101,
|
||||
@ -241,7 +241,7 @@ class modResource extends DolibarrModules
|
||||
'type'=> 'left', // Toujours un menu gauche
|
||||
'titre'=> 'List',
|
||||
'mainmenu'=> 'tools',
|
||||
'leftmenu'=> '', // On n'indique rien ici car on ne souhaite pas intégrer de sous-menus à ce menu
|
||||
'leftmenu'=> 'resource_list',
|
||||
'url'=> '/resource/list.php',
|
||||
'langs'=> 'resource',
|
||||
'position'=> 102,
|
||||
@ -255,7 +255,7 @@ class modResource extends DolibarrModules
|
||||
// Exports
|
||||
//--------
|
||||
$r=0;
|
||||
|
||||
|
||||
$r++;
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]="ResourceSingular"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
@ -265,19 +265,19 @@ class modResource extends DolibarrModules
|
||||
$this->export_entities_array[$r]=array('r.rowid'=>'resource','r.ref'=>'resource','c.code'=>'resource','c.label'=>'resource','r.description'=>'resource','r.note_private'=>"resource",'r.resource'=>"resource",'r.asset_number'=>'resource','r.datec'=>"resource",'r.tms'=>"resource");
|
||||
$keyforselect='resource'; $keyforelement='resource'; $keyforaliasextra='extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
|
||||
$this->export_dependencies_array[$r]=array('resource'=>array('r.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them.
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'resource as r ';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = c.rowid';
|
||||
$this->export_sql_end[$r] .=' AND r.entity IN ('.getEntity('resource').')';
|
||||
|
||||
|
||||
|
||||
// Imports
|
||||
//--------
|
||||
$r=0;
|
||||
|
||||
|
||||
// Import list of third parties and attributes
|
||||
$r++;
|
||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
||||
@ -307,7 +307,7 @@ class modResource extends DolibarrModules
|
||||
$this->import_regex_array[$r]=array('s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
|
||||
$this->import_examplevalues_array[$r]=array('r.ref'=>"REF1",'r.fk_code_type_resource'=>"Code from dictionary resource type",'r.datec'=>"2017-01-01 or 2017-01-01 12:30:00");
|
||||
$this->import_updatekeys_array[$r]=array('r.rf'=>'ResourceFormLabel_ref');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -37,21 +37,21 @@ INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('ER', '
|
||||
|
||||
|
||||
-- Description of chart of account FR PCG99-ABREGE
|
||||
INSERT INTO llx_accounting_system (pcg_version, label, active) VALUES ('PCG99-ABREGE', 'The simple accountancy french plan', 1);
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG99-ABREGE', 'The simple accountancy french plan', 1);
|
||||
|
||||
-- Description of chart of account FR PCG99-BASE
|
||||
INSERT INTO llx_accounting_system (pcg_version, label, active) VALUES ('PCG99-BASE', 'The base accountancy french plan', 1);
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG99-BASE', 'The base accountancy french plan', 1);
|
||||
|
||||
-- Description of chart of account BE PCMN-BASE
|
||||
INSERT INTO llx_accounting_system (pcg_version, label, active) VALUES ('PCMN-BASE', 'The base accountancy belgium plan', 1);
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 2, 'PCMN-BASE', 'The base accountancy belgium plan', 1);
|
||||
|
||||
-- Description of chart of account ES PCG08-PYME
|
||||
INSERT INTO llx_accounting_system (pcg_version, label, active) VALUES ('PCG08-PYME', 'The PYME accountancy spanish plan', 1);
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 4, 'PCG08-PYME', 'The PYME accountancy spanish plan', 1);
|
||||
|
||||
-- Description of chart of account DK DK-STD
|
||||
INSERT INTO llx_accounting_system (pcg_version, label, active) VALUES ('DK-STD', 'Standardkontoplan fra SKAT', 1);
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (80, 'DK-STD', 'Standardkontoplan fra SKAT', 1);
|
||||
|
||||
-- Description of chart of account CL CL-PYME
|
||||
INSERT INTO llx_accounting_system (pcg_version, label, active) VALUES ('PC-MIPYME', 'The PYME accountancy Chile plan', 1);
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (67, 'PC-MIPYME', 'The PYME accountancy Chile plan', 1);
|
||||
|
||||
|
||||
|
||||
@ -365,6 +365,8 @@ UPDATE llx_const set name = 'ONLINE_PAYMENT_CSS_URL' where name = 'PAYPAL_CS
|
||||
UPDATE llx_const set name = 'ONLINE_PAYMENT_NEWFORMTEXT' where name = 'PAYPAL_NEWFORMTEXT';
|
||||
UPDATE llx_const set name = 'ONLINE_PAYMENT_LOGO' where name = 'PAYPAL_LOGO';
|
||||
|
||||
ALTER TABLE llx_accounting_system ADD COLUMN fk_country integer;
|
||||
|
||||
UPDATE llx_accounting_account SET pcg_type = 'INCOME' where pcg_type = 'PROD';
|
||||
UPDATE llx_accounting_account SET pcg_type = 'EXPENSE' where pcg_type = 'CHARGE';
|
||||
UPDATE llx_accounting_account SET pcg_type = 'INCOME' where pcg_type = 'VENTAS_E_INGRESOS';
|
||||
@ -434,5 +436,16 @@ create table llx_c_email_senderprofile
|
||||
ALTER TABLE llx_c_email_senderprofile ADD UNIQUE INDEX uk_c_email_senderprofile(entity, label, email);
|
||||
|
||||
|
||||
-- Description of chart of account CL CL-PYME
|
||||
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (67, 'PC-MIPYME', 'The PYME accountancy Chile plan', 1);
|
||||
|
||||
UPDATE llx_accounting_system SET fk_country = 1 WHERE pcg_version = 'PCG99-ABREGE';
|
||||
UPDATE llx_accounting_system SET fk_country = 1 WHERE pcg_version = 'PCG99-BASE';
|
||||
UPDATE llx_accounting_system SET fk_country = 2 WHERE pcg_version = 'PCMN-BASE';
|
||||
UPDATE llx_accounting_system SET fk_country = 4 WHERE pcg_version = 'PCG08-PYME';
|
||||
UPDATE llx_accounting_system SET fk_country = 80 WHERE pcg_version = 'DK-STD';
|
||||
UPDATE llx_accounting_system SET fk_country = 67 WHERE pcg_version = 'PC-MIPYME';
|
||||
|
||||
|
||||
-- May have error due to duplicate keys
|
||||
ALTER TABLE llx_resource ADD UNIQUE INDEX uk_resource_ref (ref, entity);
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
create table llx_accounting_system
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
fk_country integer,
|
||||
pcg_version varchar(32) NOT NULL,
|
||||
label varchar(128) NOT NULL,
|
||||
active smallint DEFAULT 0
|
||||
|
||||
@ -4361,31 +4361,10 @@ function migrate_reload_menu($db,$langs,$conf,$versionto)
|
||||
|
||||
// Define list of menu handlers to initialize
|
||||
$listofmenuhandler=array();
|
||||
|
||||
$versiontoarray=explode('.',$versionto);
|
||||
|
||||
// Migration required when target version is between
|
||||
$afterversionarray=explode('.','2.8.9');
|
||||
$beforeversionarray=explode('.','2.9.9');
|
||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
||||
if ($conf->global->MAIN_MENU_STANDARD == 'auguria_menu' || $conf->global->MAIN_MENU_SMARTPHONE == 'auguria_menu'
|
||||
|| $conf->global->MAIN_MENUFRONT_STANDARD == 'auguria_menu' || $conf->global->MAIN_MENUFRONT_SMARTPHONE == 'auguria_menu')
|
||||
{
|
||||
$listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers
|
||||
}
|
||||
|
||||
// Migration required when target version is between
|
||||
$afterversionarray=explode('.','3.1.9');
|
||||
$beforeversionarray=explode('.','3.2.9');
|
||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
||||
{
|
||||
$listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers
|
||||
}
|
||||
|
||||
// Migration required when target version is between
|
||||
$afterversionarray=explode('.','3.7.9');
|
||||
$beforeversionarray=explode('.','4.0.9');
|
||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
||||
{
|
||||
$listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers
|
||||
$listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers
|
||||
}
|
||||
|
||||
foreach ($listofmenuhandler as $key => $val)
|
||||
|
||||
@ -253,7 +253,7 @@ class modMyModule extends DolibarrModules
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'List MyObject',
|
||||
'mainmenu'=>'mymodule',
|
||||
'leftmenu'=>'mymodule',
|
||||
'leftmenu'=>'mymodule_myobject_list',
|
||||
'url'=>'/mymodule/myobject_list.php',
|
||||
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
@ -265,7 +265,7 @@ class modMyModule extends DolibarrModules
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'New MyObject',
|
||||
'mainmenu'=>'mymodule',
|
||||
'leftmenu'=>'mymodule',
|
||||
'leftmenu'=>'mymodule_myobject_new',
|
||||
'url'=>'/mymodule/myobject_page.php?action=create',
|
||||
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
|
||||
@ -81,6 +81,8 @@ class SupplierProposalTest extends PHPUnit_Framework_TestCase
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
if (empty($conf->global->MAIN_MODULE_SUPPLIERPROPOSAL)) { print "\n".__METHOD__." module Supplier proposal must be enabled.\n"; die(); }
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user