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

This commit is contained in:
Florian HENRY 2015-08-13 10:08:12 +02:00
commit 8453e62573
561 changed files with 3894 additions and 2973 deletions

13
.codeclimate.yml Normal file
View File

@ -0,0 +1,13 @@
# Save as .codeclimate.yml (note leading .) in project root directory
languages:
Ruby: false
JavaScript: true
PHP: true
engines:
phpcodesniffer: true
exclude_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'

View File

@ -26,6 +26,7 @@ php-iban 1.4.6 LGPL-3+ Yes
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
Restler 3.0 LGPL-3+ Yes Library to develop REST Web services
TCPDF 6.2.6 LGPL-3+ Yes PDF generation
EvalMath 1.0 BSD Yes Safe math expressions evaluation
JS libraries:
jQuery 1.11.3 MIT License Yes JS library

View File

@ -237,6 +237,7 @@ FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead
FIX: Not showing delivery date on rouget pdf
FIX: Not showing task extrafields when creating from left menu
FIX [ bug #3288 ] Tasks box is not properly drawn
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
NEW: Created new ContratLigne::insert function
@ -684,6 +685,9 @@ Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid
Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter
Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result
Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled
Fix: [ bug #3310 ] OrderLine::fetch, FactureLigne::fetch and PropaleLigne::fetch do not return anything
Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information
Fix: [ bug #3313 ] Error enabling module with PostgreSQL database
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973

View File

@ -145,6 +145,7 @@ if ($result) {
print '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
print '<a class="butAction" href="./importaccounts.php">' . $langs->trans("ImportAccount") . '</a>';
print '<a class="butAction" href="./productaccount.php">' . $langs->trans("CheckProductAccountancyCode") . '</a>';
print '<br/><br/>';
print '<table class="noborder" width="100%">';

View File

@ -1,10 +1,9 @@
<?PHP
/*
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -21,19 +20,19 @@
*/
/**
* \file htdocs/accountancy/admin/productaccount.php
* \ingroup Accounting Expert
* \brief Onglet de gestion de parametrages des ventilations
* \file htdocs/accountancy/admin/productaccount.php
* \ingroup Accounting Expert
* \brief Onglet de gestion de parametrages des ventilations
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
// Langs
$langs->load("companies");
@ -41,383 +40,355 @@ $langs->load("compta");
$langs->load("main");
$langs->load("accountancy");
// Search & action GETPOST
// search & action GETPOST
$action = GETPOST('action');
$codeventil_buy = GETPOST('codeventil_buy', 'array');
$codeventil_sell = GETPOST('codeventil_sell', 'array');
$mesCasesCochees = GETPOST('mesCasesCochees', 'array');
$account_number_buy = GETPOST('account_number_buy');
$chk_prod = GETPOST('chk_prod', 'array');
$account_number_buy = GETPOST('account_number_buy');
$account_number_sell = GETPOST('account_number_sell');
$changeaccount = GETPOST('changeaccount','array');
$changeaccount_buy = GETPOST('changeaccount_buy','array');
$changeaccount_sell = GETPOST('changeaccount_sell','array');
$search_ref = GETPOST('search_ref','alpha');
$search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha');
$changeaccount = GETPOST('changeaccount', 'array');
$changeaccount_buy = GETPOST('changeaccount_buy', 'array');
$changeaccount_sell = GETPOST('changeaccount_sell', 'array');
$search_ref = GETPOST('search_ref', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
$search_desc = GETPOST('search_desc', 'alpha');
$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
$btn_changeaccount = GETPOST('changeaccount');
$btn_changetype = GETPOST('changetype');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if ($page < 0) $page = 0;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int');
if ($page < 0)
$page = 0;
$pageprev = $page - 1;
$pagenext = $page + 1;
//bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed !
// bug in page limit if ACCOUNTING_LIMIT_LIST_VENTILATION < $conf->liste_limit there is no pagination displayed !
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
//} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
// $limit = $conf->liste_limit;
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
// } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
// $limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
$limit = $conf->liste_limit;
}
$offset = $limit * $page;
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC";
if (! $sortfield)
$sortfield = "p.ref";
if (! $sortorder)
$sortorder = "ASC";
// sales or purchase
if ($action == 'update') {
if (! empty($btn_changetype)) {
$error = 0;
$accounting_product_modes = array (
'ACCOUNTANCY_SELL',
'ACCOUNTANCY_BUY'
);
$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
if (in_array($accounting_product_mode, $accounting_product_modes)) {
if (! dolibarr_set_const($db, 'ACCOUNTING_PRODUCT_MODE', $accounting_product_mode, 'chaine', 0, '', $conf->entity)) {
$error ++;
}
} else {
$error ++;
}
}
if (! empty($btn_changeaccount)) {
$msg = '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
if (! empty($chk_prod)) {
$accounting = new AccountingAccount($db);
$msg .= '<div><font color="red">' . count($chk_prod) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
$cpt = 0;
foreach ( $chk_prod as $productid ) {
$accounting_account_id=GETPOST('codeventil_'.$productid);
$result=$accounting->fetch($accounting_account_id,null,1);
if ($result<0) {
//setEventMessage(null, $accounting->errors,'errors');
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '<br/> <pre>' . $sql . '</pre></font></div>';
} else {
$sql = " UPDATE " . MAIN_DB_PREFIX . "product";
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
$sql .= " SET accountancy_code_buy = " . $accounting->account_number;
}
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
$sql .= " SET accountancy_code_sell = " . $accounting->account_number;
}
$sql .= " WHERE rowid = " . $productid;
dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG);
if ($db->query($sql)) {
$msg .= '<div><font color="green">' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
} else {
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $accounting->account_number . '<br/> <pre>' . $sql . '</pre></font></div>';
}
}
$cpt ++;
}
} else {
$msg .= '<div><font color="red">' . $langs->trans("AnyLineVentilate") . '</font></div>';
}
$msg .= '<div><font color="red">' . $langs->trans("EndProcessing") . '</font></div>';
}
}
// Security check
if ($user->societe_id > 0)
accessforbidden();
// TODO after adding menu
// if (! $user->rights->accounting->ventilation->dispatch)
// accessforbidden();
accessforbidden();
// TODO after adding menu
// if (! $user->rights->accounting->ventilation->dispatch)
// accessforbidden();
$form = new FormVentilation($db);
//Defaut AccountingAccount RowId Product / Service
//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
//so we need to get those default value rowid first
// Defaut AccountingAccount RowId Product / Service
// at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
// so we need to get those default value rowid first
$accounting = new AccountingAccount($db);
//TODO: we should need to check if result is a really exist accountaccount rowid.....
$aarowid_servbuy = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT);
$aarowid_prodbuy = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT);
$aarowid_servsell = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT);
$aarowid_prodsell = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
// TODO: we should need to check if result is a really exist accountaccount rowid.....
$aarowid_servbuy = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
$aarowid_prodbuy = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
$aarowid_servsell = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
$aarowid_prodsell = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT, 1);
$aacompta_servbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_servbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_servsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$aacompta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search_ref='';
$search_label='';
$search_desc='';
$search_ref = '';
$search_label = '';
$search_desc = '';
}
//TODO: modify to update all selected product with a sell account
if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_sell")) {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p";
$sql1 .= " SET p.accountancy_code_sell=" . $account_number_sell;
$sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')';
// Debug
// print_r ($sql1);
dol_syslog('accountancy/customer/lines.php::changeaccount product sell sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessage($db->lasterror(), 'errors');
}
if (! $error) {
$db->commit();
setEventMessage($langs->trans('Save'), 'mesgs');
} else {
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
}
}
//TODO: modify to update all selected product with a buy account
if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_buy")) {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p";
$sql1 .= " SET p.accountancy_code_buy=" . $account_number_buy;
$sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')';
// Debug
// print_r ($sql1);
dol_syslog('accountancy/customer/lines.php::changeaccount product buy sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessage($db->lasterror(), 'errors');
}
if (! $error) {
$db->commit();
setEventMessage($langs->trans('Save'), 'mesgs');
} else {
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
}
}
// debug move header to top
llxHeader('', $langs->trans("Accounts"));
/*
* View
*/
llxHeader('', $langs->trans("Accounts"));
// For updating account export
print '<script type="text/javascript">
function launch_export() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
}
</script>';
$(function () {
$(\'#select-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = true;
});
});
$(\'#unselect-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = false;
});
});
});
</script>';
//TODO For select box
print '<script type="text/javascript">
$(function () {
$(\'#select-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = true;
});
});
$(\'#unselect-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = false;
});
});
});
</script>';
/*
* Action
*/
//TODO
/*
if ($action == 'ventil') {
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
if (! empty($codeventil_buy) && ! empty($mesCasesCochees)) {
if (! empty($codeventil_sell) && ! empty($mesCasesCochees)) {
} else {
print '<div><font color="red">' . $langs->trans("AnyLineVentilate") . '</font></div>';
}
print '<div><font color="red">' . $langs->trans("EndProcessing") . '</font></div>';
}
*/
//do we really need to exclude old product not tosell / tobuy ?
//$sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type , p.tosell , p.tobuy ";
//$sql .= " WHERE p.accountancy_code_sell IS NULL AND p.tosell = 1 OR p.accountancy_code_buy IS NULL AND p.tobuy = 1";
//$sql .= " WHERE p.accountancy_code_sell ='' AND p.tosell = 1 OR p.accountancy_code_buy ='' AND p.tobuy = 1";
$sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type";
$sql = "SELECT p.rowid, p.ref , p.label, p.description , p.accountancy_code_sell, p.accountancy_code_buy, p.tms, p.fk_product_type as product_type";
$sql .= " FROM " . MAIN_DB_PREFIX . "product as p";
//$sql .= " , " . MAIN_DB_PREFIX . "accountingaccount as aa";
$sql .= " WHERE (";
$sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL";
//Search on correct pcg version
$pcgver = $conf->global->CHARTOFACCOUNTS;
$sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
//(SELECT account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa WHERE fk_pcg_version='PCG99-BASE'))";
$sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
//(SELECT account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa WHERE fk_pcg_version='PCG99-BASE'))";
IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
$sql .= " p.accountancy_code_buy ='' OR p.accountancy_code_buy IS NULL";
$sql .= " OR (p.accountancy_code_buy IS NOT NULL AND p.accountancy_code_buy != '' AND p.accountancy_code_buy NOT IN
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
} else {
$sql .= " p.accountancy_code_sell ='' OR p.accountancy_code_sell IS NULL ";
$sql .= " OR (p.accountancy_code_sell IS NOT NULL AND p.accountancy_code_sell != '' AND p.accountancy_code_sell NOT IN
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid = " . $pcgver . "))";
}
$sql .= ")";
//Add search filter like
// Add search filter like
if (strlen(trim($search_ref))) {
$sql .= " AND (p.ref like '" . $search_ref . "%')";
$sql .= " AND (p.ref like '" . $search_ref . "%')";
}
if (strlen(trim($search_label))) {
$sql .= " AND (p.label like '" . $search_label . "%')";
$sql .= " AND (p.label like '" . $search_label . "%')";
}
if (strlen(trim($search_desc))) {
$sql .= " AND (p.description like '%" . $search_desc . "%')";
$sql .= " AND (p.description like '%" . $search_desc . "%')";
}
$sql.= $db->order($sortfield,$sortorder);
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($limit + 1, $offset);
dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
$i = 0;
/*
$num_lines = $db->num_rows($result);
$i = 0;
/*
* View
*/
print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<td align="left"><b>' . $langs->trans("DescProductAccountingAccount") . '</b></td>&nbsp;';
print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"],"p.rowid","",$param,'',$sortfield,$sortorder);
print '&nbsp;&nbsp;';
//DEBUG
//print $sql;
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post"><br />';
// print '<input type="hidden" name="action" value="ventil">';
print '<table class="noborder" width="100%">';
print '<tr>';
print '<td width="33%">';
print '<div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br />';
print $langs->trans("Accountancy_code_buy") . ': ' . $form->select_account($account_number_buy, 'account_number_buy', 1,'', 0, 1);
print '<input type="submit" class="butAction" name="action" value="' . $langs->trans("Accountancy_code_buy") . '"/></div>';
print '</td>';
print '<td width="33%">';
print '<div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br />';
print $langs->trans("Accountancy_code_sell") . ': ' . $form->select_account($account_number_sell, 'account_number_sell', 1, '', 0, 1);
print '<input type="submit" class="butAction" name="action" value="' . $langs->trans("Accountancy_code_sell") . '"/></div>';
print '</td>';
print '<td width="33%">';
//TODO change button
print '<input type="button" class="button" style="float: right;" value="Renseigner les comptes comptables produits manquant" onclick="launch_export();" />';
print '</td>';
print '</tr>';
print '</table>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
// print '<td align="left">' . $langs->trans("Ref") . '</td>';
// print '<td align="left">' . $langs->trans("Label") . '</td>';
// print '<td align="left">' . $langs->trans("Description") . '</td>';
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
print '<td align="left">' . $langs->trans("Accountancy_code_buy") . '</td>';
print '<td align="left">' . $langs->trans("Accountancy_code_buy_suggest") . '</td>';
print '<td align="left">' . $langs->trans("Accountancy_code_sell") . '</td>';
print '<td align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
print_liste_field_titre('');
// print_liste_field_titre('');
print '<td align="center" colspan="2">' . $langs->trans("Ventilate") . '<br><label id="select-all">'.$langs->trans('All').'</label>/<label id="unselect-all">'.$langs->trans('None').'</label>'.'</td>';
print '</tr>';
print '<tr class="liste_titre">';
print '<td class="liste_titre">%<input type="text" class="flat" size="20" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre">%<input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre" colspan="3">&nbsp;</td>';
print '<td align="right" colspan="4" class="liste_titre">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
// print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '&nbsp;';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
// print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
// print '<td class="liste_titre" colspan="2">&nbsp;</td>';
print '</tr>';
$var = true;
while ( $i < min($num_lines, 250) ) {
$obj = $db->fetch_object($result);
$var = ! $var;
$compta_prodsell = $obj->accountancy_code_sell;
if (empty($compta_prodsell)) {
if ($obj->product_type == 0) {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_prodsell;
} else {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_servsell;
}
}
$compta_prodbuy = $obj->accountancy_code_buy;
if (empty($compta_prodbuy)) {
if ($obj->product_type == 0) {
$compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodbuy_id = $aarowid_prodbuy;
} else {
$compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodbuy_id = $aarowid_servbuy;
}
}
$product_static = new Product($db);
print "<tr $bc[$var]>";
//debug
print '<td align="left" colspan="6">Compte Suggeres compta_prodbuy=' . $compta_prodbuy . ' -- compta_prodbuy_id' . $compta_prodbuy_id . '-- compta_prodsell:' . $compta_prodsell . '-- compta_prodsell_id' . $compta_prodsell_id . '</td>';
print "</tr>";
print "<tr $bc[$var]>";
// Ref produit as link
$product_static->ref = $obj->ref;
$product_static->id = $obj->rowid;
$product_static->type = $obj->type;
print '<td>';
if ($product_static->id)
print $product_static->getNomUrl(1);
else
print '-&nbsp;';
print '</td>';
print '<td align="left">' . $obj->label . '</td>';
//TODO ADJUST DESCRIPTION SIZE
// print '<td align="left">' . $obj->description . '</td>';
//TODO: we shoul set a user defined value to adjust user square / wide screen size
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
//acountingaccount buy
print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
//TODO: replace by select
// print '<td align="left">' . $compta_prodbuy . '</td>';
//TODO: we shoul set a user defined value to adjust user square / wide screen size
//$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
print '<td align="center">';
print $form->select_account($compta_prodbuy_id, 'codeventil[]', 1);
print '</td>';
//acountingaccount sel
print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
//TODO: replace by select
//TODO: we shoul set a user defined value to adjust user square / wide screen size
//$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
print '<td align="center">';
print $form->select_account($compta_prodsell_id, 'codeventil[]', 1);
print '</td>';
//action edit & select box
print '<td align="center">' . $obj->rowid . '</td>';
print '<td><a href="./card.php?id=' . $obj->rowid . '">';
print img_edit();
print '</a></td>';
//Checkbox select
print '<td align="center">';
print '<input type="checkbox" name="changeaccount[]" value="' . $obj->rowid . '"/></td>';
print "</tr>";
$i ++;
}
$db->free($result);
print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans('OptionMode') . '</td><td>' . $langs->trans('Description') . '</td>';
print "</tr>\n";
print '<tr ' . $bc[false] . '><td width="200"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"' . ($accounting_product_mode != 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('Accountancy_code_sell') . '</td>';
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSell'));
print "</td></tr>\n";
print '<tr ' . $bc[true] . '><td width="200"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('Accountancy_code_buy') . '</td>';
print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuy')) . "</td></tr>\n";
print "</table>\n";
print '<br /><div style="text-align:center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="changetype"></div>';
print "<br>\n";
if (! empty($msg)) {
print $msg;
}
// print '<td align="left"><b>' . $langs->trans("DescProductAccountingAccount") . '</b></td>&nbsp;';
// print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "p.rowid", "", $param, '', $sortfield, $sortorder);
print '&nbsp;&nbsp;';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
print '<th align="left">' . $langs->trans("Accountancy_code_buy") . '</td>';
print '<th align="left">' . $langs->trans("Accountancy_code_buy_suggest") . '</td>';
} else {
print '<th align="left">' . $langs->trans("Accountancy_code_sell") . '</td>';
print '<th align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
}
// print_liste_field_titre('');
print '<td align="center">' . $langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>' . '</td>';
print '</tr>';
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre" colspan="2">&nbsp;</td>';
print '<td align="right" class="liste_titre">';
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
print '&nbsp;';
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
print '</td>';
print '</tr>';
$var = true;
while ( $i < min($num_lines, 250) ) {
$obj = $db->fetch_object($result);
$var = ! $var;
$compta_prodsell = $obj->accountancy_code_sell;
if ($obj->product_type == 0) {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_prodsell;
} else {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_servsell;
}
$compta_prodbuy = $obj->accountancy_code_buy;
if ($obj->product_type == 0) {
$compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodbuy_id = $aarowid_prodbuy;
} else {
$compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodbuy_id = $aarowid_servbuy;
}
$product_static = new Product($db);
print "<tr $bc[$var]>";
print "</tr>";
print "<tr $bc[$var]>";
// Ref produit as link
$product_static->ref = $obj->ref;
$product_static->id = $obj->rowid;
$product_static->type = $obj->type;
print '<td>';
if ($product_static->id)
print $product_static->getNomUrl(1);
else
print '-&nbsp;';
print '</td>';
print '<td align="left">' . dol_trunc($obj->label, 24) . '</td>';
// TODO ADJUST DESCRIPTION SIZE
// print '<td align="left">' . $obj->description . '</td>';
// TODO: we shoul set a user defined value to adjust user square / wide screen size
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
// acountingaccount buy
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
// TODO: replace by select
// print '<td align="left">' . $compta_prodbuy . '</td>';
// TODO: we shoul set a user defined value to adjust user square / wide screen size
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
print '<td align="center">';
print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1);
print '</td>';
} else {
// acountingaccount sel
print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
// TODO: replace by select
// TODO: we shoul set a user defined value to adjust user square / wide screen size
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
print '<td align="center">';
print $form->select_account($compta_prodsell_id, 'codeventil_'.$product_static->id, 1);
print '</td>';
}
// Checkbox select
print '<td align="center">';
print '<input type="checkbox" name="chk_prod[]" value="' . $obj->rowid . '"/></td>';
print "</tr>";
$i ++;
}
print '</table>';
print '<br><div align="center"><input type="submit" class="butAction" name="changeaccount" value="' . $langs->trans("Change_Account") . '"></div>';
print '</form>';
$db->free($result);
} else {
// print $db->error();
dol_print_error($db);
dol_print_error($db);
}
print "</table></form>";
llxFooter();
$db->close();

View File

@ -61,12 +61,15 @@ class AccountingAccount extends CommonObject
/**
* Load record in memory
*
* @param int $rowid Id
* @param string $account_number Account number
* @return int <0 if KO, >0 if OK
* @param int $rowid Id
* @param string $account_number Account number
* @param int $limittocurentchart 1=Do not load record if it is into another accounting system
* @return int <0 if KO, >0 if OK
*/
function fetch($rowid = null, $account_number = null)
function fetch($rowid = null, $account_number = null, $limittocurentchart=0)
{
global $conf;
if ($rowid || $account_number) {
$sql = "SELECT rowid, datec, tms, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, fk_user_author, fk_user_modif, active";
$sql.= " FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE";
@ -75,7 +78,9 @@ class AccountingAccount extends CommonObject
} elseif ($account_number) {
$sql .= " account_number = '" . $account_number . "'";
}
if (!empty($limittocurentchart)) {
$sql .=' AND fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS.')';
}
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
@ -101,7 +106,8 @@ class AccountingAccount extends CommonObject
return 0;
}
} else {
dol_print_error($this->db);
$this->error="Error " . $this->db->lasterror();
$this->errors[] = "Error " . $this->db->lasterror();
}
}
return -1;

View File

@ -27,10 +27,13 @@
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
// Langs
$langs->load("bills");
$langs->load("compta");
$langs->load("main");
@ -38,23 +41,23 @@ $langs->load("accountancy");
$account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount');
//Search Getpost
$search_ref = GETPOST('search_ref','alpha');
$search_invoice = GETPOST('search_invoice','alpha');
$search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha');
$search_account = GETPOST('search_account','alpha');
$search_vat = GETPOST('search_vat','alpha');
//Getpost Order and column and limit page
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
//if ($page == -1) { $page = 0; }
if ($page < 0) $page = 0;
$pageprev = $page - 1;
$pagenext = $page + 1;
//$limit = $conf->liste_limit;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
@ -62,19 +65,11 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
} else {
$limit = $conf->liste_limit;
}
//$offset = $conf->liste_limit * $page;
$offset = $limit * $page;
// TODO : remove comment
//elarifr we can not use only
//$sql .= " ORDER BY l.rowid";
// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04...
// f.facnumber will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA
// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered
//if (! $sortfield) $sortfield="f.facnumber";
if (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid";
//if (! $sortorder) $sortorder="DESC";
if (! $sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
$sortorder = " DESC ";
@ -98,6 +93,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_desc='';
$search_amount='';
$search_account='';
$search_vat='';
}
if (is_array($changeaccount) && count($changeaccount) > 0) {
@ -181,6 +177,10 @@ if (strlen(trim($search_amount))) {
if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
}
if (strlen(trim($search_vat)))
{
$sql .= " AND (l.tva_tx like '" . $search_vat . "%')";
}
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
@ -210,6 +210,7 @@ if ($result) {
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"],"l.total_ht","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"],"l.tva_tx","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"],"aa.account_number","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre('');
@ -222,6 +223,7 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="8" name="search_amount" value="' . $search_amount. '"></td>';
print '<td class="liste_titre" align="center">%<input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '"></td>';
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
print '<td class="liste_titre" colspan="2">&nbsp;</td>';
print '<td class="liste_titre" align="center"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
@ -257,6 +259,7 @@ if ($result) {
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
print '<td align="right">' . price($objp->total_ht) . '</td>';
print '<td align="center">' . price($objp->tva_tx) . '</td>';
print '<td align="center">' . $codecompta . '</td>';
print '<td align="right">' . $objp->rowid . '</td>';
print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">';
@ -275,4 +278,4 @@ if ($result) {
print "</table></form>";
llxFooter();
$db->close();
$db->close();

View File

@ -24,14 +24,13 @@
* \ingroup Accounting Expert
* \brief Ventilation page from customers invoices
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
// Langs
$langs->load("compta");
@ -42,24 +41,25 @@ $langs->load("accountancy");
$action = GETPOST('action');
//Select Box
// Select Box
$codeventil = GETPOST('codeventil', 'array');
$mesCasesCochees = GETPOST('mesCasesCochees', 'array');
//Search Getpost
$search_invoice = GETPOST('search_invoice','alpha');
$search_ref = GETPOST('search_ref','alpha');
$search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha');
$search_account = GETPOST('search_account','alpha');
$search_vat = GETPOST('search_vat','alpha');
// Search Getpost
$search_invoice = GETPOST('search_invoice', 'alpha');
$search_ref = GETPOST('search_ref', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
$search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
//Getpost Order and column and limit page
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page');
if ($page < 0) $page = 0;
// Getpost Order and column and limit page
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page','int');
if ($page < 0)
$page = 0;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
@ -70,7 +70,8 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
}
$offset = $limit * $page;
if (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid";
if (! $sortfield)
$sortfield = "f.datef, f.facnumber, l.rowid";
if (! $sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
@ -91,23 +92,23 @@ $aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT);
$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter"))
{
$search_ref='';
$search_invoice='';
$search_label='';
$search_desc='';
$search_amount='';
$search_account='';
$search_vat='';
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
$search_ref = '';
$search_invoice = '';
$search_label = '';
$search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
}
/*
* View
*/
llxHeader('', $langs->trans("Ventilation"));
print '<script type="text/javascript">
print '<script type="text/javascript">
$(function () {
$(\'#select-all\').click(function(event) {
// Iterate each checkbox
@ -139,18 +140,18 @@ if ($action == 'ventil') {
$monId = $maLigneCourante[0];
$monNumLigne = $maLigneCourante[1];
$monCompte = $mesCodesVentilChoisis[$monNumLigne];
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql .= " SET fk_code_ventilation = " . $monCompte;
$sql .= " WHERE rowid = " . $monId;
dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG);
if ($db->query($sql)) {
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
} else {
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
}
$cpt ++;
}
} else {
@ -163,7 +164,6 @@ if ($action == 'ventil') {
* Customer Invoice lines
*/
$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod";
$sql .= " , aa.rowid as aarowid";
@ -177,8 +177,7 @@ $sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
// Add search filter like
if (strlen(trim($search_invoice)))
{
if (strlen(trim($search_invoice))) {
$sql .= " AND (f.facnumber like '%" . $search_invoice . "%')";
}
if (strlen(trim($search_ref))) {
@ -190,16 +189,13 @@ if (strlen(trim($search_label))) {
if (strlen(trim($search_desc))) {
$sql .= " AND (l.description like '%" . $search_desc . "%')";
}
if (strlen(trim($search_amount)))
{
if (strlen(trim($search_amount))) {
$sql .= " AND l.total_ht like '" . $search_amount . "%'";
}
if (strlen(trim($search_account)))
{
if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
}
if (strlen(trim($search_vat)))
{
if (strlen(trim($search_vat))) {
$sql .= " AND (l.tva_tx like '" . $search_vat . "%')";
}
@ -207,7 +203,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
$sql.= $db->order($sortfield,$sortorder);
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($limit + 1, $offset);
@ -216,87 +212,86 @@ $result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
$i = 0;
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"],"f.datef","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "f.datef", "", $param, '', $sortfield, $sortorder);
print '&nbsp;&nbsp;';
print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"],"l.rowid","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
print '<input type="hidden" name="action" value="ventil">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"],"f.facnumber","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),'','','','','align="right"');
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"],"l.tva_tx","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AccountAccounting"),'','','','','align="center"');
print_liste_field_titre($langs->trans("IntoAccount"),'','','','','align="center"');
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"],"l.total_ht","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("AccountAccounting"), '', '', '', '', 'align="center"');
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
print_liste_field_titre('');
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">'.$langs->trans('All').'</label>/<label id="unselect-all">'.$langs->trans('None').'</label>','','','','','align="center"');
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>', '', '', '', '', 'align="center"');
print '</tr>';
// We add search filter
// We add search filter
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_invoice" value="' . $search_invoice . '"></td>';
print '<td class="liste_titre">%<input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="10" name="search_amount" value="' . $search_amount. '"></td>';
print '<td class="liste_titre" align="center">%<input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '"></td>';
print '<td class="liste_titre" align="center">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td align="right" colspan="2" class="liste_titre">';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="10" name="search_amount" value="' . $search_amount . '"></td>';
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '"></td>';
print '<td align="right" class="liste_titre" colspan="4">';
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
print '&nbsp;';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
print '</td>';
print '</tr>';
$facture_static = new Facture($db);
$product_static = new Product($db);
$form = new Form($db);
$var = true;
while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result);
$var = ! $var;
$objp->code_sell_l = '';
$objp->code_sell_p = '';
$objp->aarowid_suggest = '';
$code_sell_p_l_differ = '';
$code_sell_p_notset = '';
$objp->aarowid_suggest = $objp->aarowid;
if ( ! empty($objp->code_sell)) {
if (! empty($objp->code_sell)) {
$objp->code_sell_p = $objp->code_sell;
} else {
$code_sell_p_notset = 'color:red';
if ($objp->type == 1) {
$objp->code_sell_p = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
}
elseif ($objp->type == 0) {
} elseif ($objp->type == 0) {
$objp->code_sell_p = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
}
}
if ($objp->type_l == 1) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_s;
}
elseif ($objp->type_l == 0) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_p;
}
if ($objp->code_sell_l <> $objp->code_sell_p) $code_sell_p_l_differ = 'color:red';
if ($objp->type_l == 1) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '')
$objp->aarowid_suggest = $aarowid_s;
} elseif ($objp->type_l == 0) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '')
$objp->aarowid_suggest = $aarowid_p;
}
if ($objp->code_sell_l != $objp->code_sell_p)
$code_sell_p_l_differ = 'color:red';
print "<tr $bc[$var]>";
// Ref Invoice
$facture_static->ref = $objp->facnumber;
$facture_static->id = $objp->facid;
@ -311,21 +306,25 @@ if ($result) {
else
print '&nbsp;';
print '</td>';
print '<td style="' . $code_sell_p_l_differ . '">' . dol_trunc($objp->product_label, 24) . '</td>';
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($objp->description, $trunclength)) . '</td>';
print '<td align="right">';
print price($objp->total_ht);
print '</td>';
if ($objp->vat_tx_l <> $objp->vat_tx_p) $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
print '<td style="' . $code_vat_differ . '" align="center">';
print price($objp->tva_tx_line);
print '</td>';
print '<td align="center" style="' . $code_sell_p_notset . '">';
if ($objp->code_sell_l == $objp->code_sell_p) {
print $objp->code_sell_l;
} else {
print 'lines='.$objp->code_sell_l . '<br />product=' . $objp->code_sell_p;
print 'lines=' . $objp->code_sell_l . '<br />product=' . $objp->code_sell_p;
}
print '</td>';
print '<td align="center">';
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil[]', 1);
print '</td>';
@ -336,7 +335,7 @@ if ($result) {
print '</tr>';
$i ++;
}
print '</table>';
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
print '</form>';
@ -345,4 +344,4 @@ if ($result) {
}
llxFooter();
$db->close();
$db->close();

View File

@ -26,11 +26,14 @@
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Langs
$langs->load("compta");
$langs->load("bills");
$langs->load("other");
@ -39,24 +42,45 @@ $langs->load("accountancy");
$account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount');
//Search Getpost
$search_ref = GETPOST('search_ref','alpha');
$search_invoice = GETPOST('search_invoice','alpha');
$search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha');
$search_account = GETPOST('search_account','alpha');
$search_vat = GETPOST('search_vat','alpha');
//Getpost Order and column and limit page
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if ($page == -1) { $page = 0; }
if ($page < 0) $page = 0;
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$limit = $conf->liste_limit;
if (! $sortfield) $sortfield="f.ref";
if (! $sortorder) $sortorder="DESC";
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION))
{
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
}
else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0)
{
$limit = $conf->liste_limit;
}
else
{
$limit = $conf->liste_limit;
}
if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid";
if (! $sortorder)
{
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0)
{
$sortorder = " DESC ";
}
}
// Security check
if ($user->societe_id > 0)
@ -75,6 +99,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_desc='';
$search_amount='';
$search_account='';
$search_vat='';
}
if (is_array($changeaccount) && count($changeaccount) > 0) {
@ -124,9 +149,6 @@ print '<script type="text/javascript">
});
</script>';
/*
* Action
*/
/*
* Supplier Invoice lines
@ -157,6 +179,10 @@ if (strlen(trim($search_amount))) {
if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
}
if (strlen(trim($search_vat)))
{
$sql .= " AND (l.tva_tx like '" . $search_vat . "%')";
}
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
@ -187,6 +213,7 @@ if ($result) {
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"],"l.total_ht","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"],"l.tva_tx","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"],"aa.account_number","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre('');
@ -198,11 +225,12 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="8" name="search_amount" value="' . $search_amount . '"></td>';
print '<td class="liste_titre" align="center">%<input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '"></td>';
print '<td class="liste_titre" align="center"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
print '<td class="liste_titre" colspan="2">&nbsp;</td>';
print '<td class="liste_titre" align="center"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<td class="liste_titre" align="center"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print "</td></tr>\n";
print "</td></tr>\n";
$facturefournisseur_static = new FactureFournisseur($db);
$product_static = new Product($db);
@ -234,6 +262,7 @@ if ($result) {
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
print '<td align="right">' . price($objp->total_ht) . '</td>';
print '<td align="center">' . price($objp->tva_tx) . '</td>';
print '<td align="center">' . $codeCompta . '</td>';
print '<td align="right">' . $objp->rowid . '</td>';
print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">';
@ -253,4 +282,4 @@ if ($result) {
print "</table></form>";
llxFooter();
$db->close();
$db->close();

View File

@ -24,14 +24,13 @@
* \ingroup Accounting Expert
* \brief Ventilation page from suppliers invoices
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
// Langs
$langs->load("compta");
@ -41,18 +40,28 @@ $langs->load("main");
$langs->load("accountancy");
$action = GETPOST('action');
// Select Box
$codeventil = GETPOST('codeventil', 'array');
$mesCasesCochees = GETPOST('mesCasesCochees', 'array');
$search_ref = GETPOST('search_ref','alpha');
$search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
//Should move to top with all GETPOST
// Search Getpost
$search_invoice = GETPOST('search_invoice', 'alpha');
$search_ref = GETPOST('search_ref', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
$search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
$btn_ventil = GETPOST('ventil', 'alpha');
// Getpost Order and column and limit page
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page');
if ($page < 0) $page = 0;
if ($page < 0)
$page = 0;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
@ -62,18 +71,9 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->liste_limit;
}
$offset = $limit * $page;
//End Should move to top with all GETPOST
// TODO : remove comment
//elarifr we can not use only
//$sql .= " ORDER BY l.rowid";
// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04...
// f.ref will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA
// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered
//if (! $sortfield) $sortfield="l.rowid";
if (! $sortfield) $sortfield="f.datef, f.ref, l.rowid";
//if (! $sortorder) $sortorder="DESC";
if (! $sortfield)
$sortfield = "f.datef, f.ref, l.rowid";
if (! $sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
$sortorder = " DESC ";
@ -88,21 +88,24 @@ if (! $user->rights->accounting->ventilation->dispatch)
$formventilation = new FormVentilation($db);
//Defaut AccountingAccount RowId Product / Service
//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
//so we need to get those default value rowid first
// Defaut AccountingAccount RowId Product / Service
// at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
// so we need to get those default value rowid first
$accounting = new AccountingAccount($db);
//TODO: we should need to check if result is a really exist accountaccount rowid.....
// TODO: we should need to check if result is a really exist accountaccount rowid.....
$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT);
$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT);
// Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$search_ref='';
$search_label='';
$search_desc='';
$search_ref = '';
$search_label = '';
$search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
}
/*
@ -110,10 +113,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
*/
llxHeader('', $langs->trans("Ventilation"));
//debug
//print_r($aarowid_s);
//print_r($aarowid_p);
print '<script type="text/javascript">
print '<script type="text/javascript">
$(function () {
$(\'#select-all\').click(function(event) {
// Iterate each checkbox
@ -133,31 +133,31 @@ print '<script type="text/javascript">
* Action
*/
if ($action == 'ventil') {
if ($action == 'ventil' && !empty($btn_ventil)) {
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
if ($_POST['codeventil'] && $_POST["mesCasesCochees"]) {
print '<div><font color="red">' . count($_POST["mesCasesCochees"]) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
$mesCodesVentilChoisis = $codeventil;
$cpt = 0;
foreach ( $mesCasesCochees as $maLigneCochee ) {
// print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>";
$maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0];
$monNumLigne = $maLigneCourante[1];
$monCompte = $mesCodesVentilChoisis[$monNumLigne];
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
$sql .= " SET fk_code_ventilation = " . $monCompte;
$sql .= " WHERE rowid = " . $monId;
dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG);
if ($db->query($sql)) {
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
} else {
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
}
$cpt ++;
}
} else {
@ -170,22 +170,9 @@ if ($action == 'ventil') {
* Supplier Invoice Lines
*
*/
$page = GETPOST('page');
if ($page < 0)
$page = 0;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
}
$offset = $limit * $page;
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, ";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy";
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.tva_tx as tva_tx_line, ";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod";
$sql .= " , aa.rowid as aarowid";
$sql .= " , f.datef";
$sql .= " , l.product_type as type_l";
@ -195,9 +182,12 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
$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 fk_code_ventilation <= 0";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
// Add search filter like
if (strlen(trim($search_invoice))) {
$sql .= " AND (f.ref like '%" . $search_invoice . "%')";
}
if (strlen(trim($search_ref))) {
$sql .= " AND (p.ref like '%" . $search_ref . "%')";
}
@ -207,11 +197,20 @@ if (strlen(trim($search_label))) {
if (strlen(trim($search_desc))) {
$sql .= " AND (l.description like '%" . $search_desc . "%')";
}
if (strlen(trim($search_amount))) {
$sql .= " AND l.total_ht like '" . $search_amount . "%'";
}
if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
}
if (strlen(trim($search_vat))) {
$sql .= " AND (l.tva_tx like '" . $search_vat . "%')";
}
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
}
$sql.= $db->order($sortfield,$sortorder);
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($limit + 1, $offset);
@ -220,32 +219,49 @@ $result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
$i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list...
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
print '<input type="hidden" name="action" value="ventil">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),'','','','','align="right"');
print_liste_field_titre($langs->trans("AccountAccounting"),'','','','','align="center"');
print_liste_field_titre($langs->trans("IntoAccount"),'','','','','align="center"');
print_liste_field_titre('');
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">'.$langs->trans('All').'</label>/<label id="unselect-all">'.$langs->trans('None').'</label>','','','','','align="center"');
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("AccountAccounting"), '', '', '', '', 'align="center"');
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
print_liste_field_titre('');
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>', '', '', '', '', 'align="center"');
print "</tr>\n";
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_invoice" value="' . $search_invoice . '"></td>';
print '<td class="liste_titre">%<input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="10" name="search_amount" value="' . $search_amount . '"></td>';
print '<td class="liste_titre" align="center">%<input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '"></td>';
print '<td class="liste_titre" align="center">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td align="right" colspan="2" class="liste_titre">';
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
print '&nbsp;';
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
print '</td>';
print '</tr>';
$facturefourn_static = new FactureFournisseur($db);
$productfourn_static = new ProductFournisseur($db);
$form = new Form($db);
$var = True;
while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result);
@ -258,43 +274,43 @@ if ($result) {
$objp->code_buy_p = '';
$objp->aarowid_suggest = '';
$code_buy_p_l_differ = '';
$code_buy_p_notset = '';
$objp->aarowid_suggest = $objp->aarowid;
if ( ! empty($objp->code_buy)) {
if (! empty($objp->code_buy)) {
$objp->code_buy_p = $objp->code_buy;
} else {
$code_buy_p_notset = 'color:red';
if ($objp->type == 1) {
$objp->code_buy_p = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
}
}
elseif ($objp->type == 0) {
$objp->code_buy_p = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
}
}
if ($objp->type_l == 1) {
$objp->code_buy_l = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_s;
}
elseif ($objp->type_l == 0) {
$objp->code_buy_l = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_p;
}
if ($objp->type_l == 1) {
$objp->code_buy_l = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '')
$objp->aarowid_suggest = $aarowid_s;
} elseif ($objp->type_l == 0) {
$objp->code_buy_l = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '')
$objp->aarowid_suggest = $aarowid_p;
}
if ($objp->code_buy_l <> $objp->code_buy_p) $code_buy_p_l_differ = 'color:red';
if ($objp->code_buy_l != $objp->code_buy_p)
$code_buy_p_l_differ = 'color:red';
print "<tr $bc[$var]>";
// Ref Invoice
$facturefourn_static->ref = $objp->ref;
$facturefourn_static->id = $objp->facid;
print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>';
// Ref Supplier Invoice
$productfourn_static->ref = $objp->product_ref;
$productfourn_static->id = $objp->product_id;
@ -305,26 +321,32 @@ if ($result) {
else
print '&nbsp;';
print '</td>';
print '<td style="' . $code_buy_p_l_differ . '">' . dol_trunc($objp->product_label, 24) . '</td>';
// TODO: we should set a user defined value to adjust user square / wide screen size
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
print '<td style="' . $code_buy_p_l_differ . '">' . nl2br(dol_trunc($objp->description, $trunclength)) . '</td>';
print '<td align="right">';
print price($objp->price);
print '</td>';
if ($objp->vat_tx_l != $objp->vat_tx_p)
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
print '<td style="' . $code_vat_differ . '" align="center">';
print price($objp->tva_tx_line);
print '</td>';
print '<td align="center" style="' . $code_buy_p_notset . '">';
//if not same kind of product_type stored in product & facturedt we display both account and let user choose
// if not same kind of product_type stored in product & facturedt we display both account and let user choose
if ($objp->code_buy_l == $objp->code_buy_p) {
print $objp->code_buy_l;
} else {
print 'lines='.$objp->code_buy_l . '<br />product=' . $objp->code_buy_p;
print 'lines=' . $objp->code_buy_l . '<br />product=' . $objp->code_buy_p;
}
print '</td>';
// Colonne choix du compte
print '<td align="center">';
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil[]', 1);
@ -332,19 +354,19 @@ if ($result) {
print '<td align="center">' . $objp->rowid . '</td>';
// Colonne choix ligne a ventiler
print '<td align="center">';
print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid_suggest ? "checked" : "") . '/>';
print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
print '</td>';
print "</tr>";
$i ++;
}
print '</table>';
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></div>';
print '<br><div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '" name="ventil" ></div>';
print '</form>';
} else {
print $db->error();
}
llxFooter();
$db->close();
$db->close();

View File

@ -141,7 +141,7 @@ if ($object->id > 0)
if (! empty($conf->agenda->enabled))
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create">'.$langs->trans("AddAction").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1">'.$langs->trans("AddAction").'</a></div>';
}
print '</div>';

View File

@ -36,6 +36,7 @@ $langs->load("other");
$langs->load("companies");
$langs->load("products");
$langs->load("members");
$langs->load("projects");
if (! $user->admin) accessforbidden();

View File

@ -168,19 +168,11 @@ else if ($action == 'addcat')
else if ($action == 'set_SUPPLIER_ORDER_OTHER')
{
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string
$doubleapproval = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL');
//$doubleapprovalgroup = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP') > 0 ? GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP') : '';
$doubleapproval = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL','alpha');
$doubleapproval = price2num($doubleapproval );
$res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
$res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_DOUBLE_APPROVAL",$doubleapproval,'chaine',0,'',$conf->entity);
/*if (isset($_POST["SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP"]))
{
$res3 = dolibarr_set_const($db, "SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP",$doubleapprovalgroup,'chaine',0,'',$conf->entity);
}
else
{
$res3=1;
}*/
// 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';
@ -486,18 +478,11 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
print $langs->trans("UseDoubleApproval").'<br>';
print $langs->trans("IfSetToYesDontForgetPermission");
print '</td><td>';
print $form->selectyesno('SUPPLIER_ORDER_DOUBLE_APPROVAL', $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL, 1);
print '<input type="text" size="3" name="SUPPLIER_ORDER_DOUBLE_APPROVAL" value="'.$conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL.'">';
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
$var=!$var;
/*print '<tr '.$bc[$var].'><td>';
print $langs->trans("GroupOfUserForSecondApproval").'</td><td>';
print $form->select_dolgroups($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP,'SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP', 1);
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
$var=!$var;*/
}
print '<tr '.$bc[$var].'><td colspan="2">';

View File

@ -87,13 +87,16 @@ if (file_exists($xmlfile))
print '</tr>'."\n";
$var = true;
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
foreach ($tmpfilelist as $file)
if (is_array($tmpfilelist))
{
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>'.$file['filename'].'</td>' . "\n";
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
print "</tr>\n";
foreach ($tmpfilelist as $file)
{
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>'.$file['filename'].'</td>' . "\n";
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
print "</tr>\n";
}
}
print '</table>';
@ -109,16 +112,19 @@ if (file_exists($xmlfile))
print '</tr>'."\n";
$var = true;
$tmpfilelist = dol_sort_array($file_list['updated'], 'filename');
foreach ($tmpfilelist as $file)
if (is_array($tmpfilelist))
{
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>'.$file['filename'].'</td>' . "\n";
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
print '<td align="center">'.$file['md5'].'</td>' . "\n";
print '<td align="right">'.dol_print_size(dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename'])).'</td>' . "\n";
print '<td align="right">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'</td>' . "\n";
print "</tr>\n";
foreach ($tmpfilelist as $file)
{
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>'.$file['filename'].'</td>' . "\n";
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
print '<td align="center">'.$file['md5'].'</td>' . "\n";
print '<td align="right">'.dol_print_size(dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename'])).'</td>' . "\n";
print '<td align="right">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'</td>' . "\n";
print "</tr>\n";
}
}
print '</table>';
}

View File

@ -141,7 +141,7 @@ if ($action == 'builddoc')
$result=@include_once $newdir.$generator.'.modules.php';
if ($result) break;
}
// Load barcode class for generating barcode image
$classname = "mod".ucfirst($generator);
$module = new $classname($db);
@ -196,7 +196,7 @@ if ($action == 'builddoc')
// For labels
if ($mode == 'label')
{
$txtforsticker="%PHOTO%"; // Photo will be barcode image, %BARCODE% posible when using TCPDF generator
$textleft=make_substitutions((empty($conf->global->BARCODE_LABEL_LEFT_TEXT)?$txtforsticker:$conf->global->BARCODE_LABEL_LEFT_TEXT), $substitutionarray);
$textheader=make_substitutions((empty($conf->global->BARCODE_LABEL_HEADER_TEXT)?'':$conf->global->BARCODE_LABEL_HEADER_TEXT), $substitutionarray);
@ -379,7 +379,7 @@ print '</div>';
print '<input id="fillfromthirdparty" type="radio" '.((GETPOST("selectorforbarcode")=='fillfromthirdparty')?'checked ':'').'name="selectorforbarcode" value="fillfromthirdparty" class="radiobarcodeselect"> '.$langs->trans("FillBarCodeTypeAndValueFromThirdParty").' &nbsp; ';
print '<br>';
print '<div class="showforthirdpartyselector">';
print $form->select_company(GETPOST('socid'), 'socid', '', 1);
print $form->select_company(GETPOST('socid'), 'socid', '', 1, 0, 0, array(), 0, 'minwidth300');
print ' &nbsp; <input type="submit" id="submitthirdparty" name="submitthirdparty" class="button showforthirdpartyselector" value="'.(dol_escape_htmltag($langs->trans("GetBarCode"))).'">';
print '</div>';

View File

@ -850,8 +850,8 @@ class Categorie extends CommonObject
* fulllabel = nom avec chemin complet de la categorie
* fullpath = chemin complet compose des id
*
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member'). Old
* mode (0, 1, 2, ...) is deprecated.
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member').
* Old mode (0, 1, 2, ...) is deprecated.
* @param int $markafterid Removed all categories including the leaf $markafterid in category tree.
*
* @return array Array of categories. this->cats and this->motherof are set.
@ -861,12 +861,12 @@ class Categorie extends CommonObject
global $conf, $langs;
// For backward compatibility
if (is_numeric( $type )) {
if (is_numeric($type))
{
// We want to reverse lookup
$map_type = array_flip( $this->MAP_ID );
$map_type = array_flip($this->MAP_ID);
$type = $map_type[$type];
dol_syslog( get_class( $this ) . "::get_full_arbo(): numeric types are deprecated, please use string instead",
LOG_WARNING );
dol_syslog( get_class( $this ) . "::get_full_arbo(): numeric types are deprecated, please use string instead", LOG_WARNING);
}
$this->cats = array();

View File

@ -117,17 +117,14 @@ if ($action == 'update' && $user->rights->categorie->creer)
* View
*/
$form = new Form($db);
llxHeader("","",$langs->trans("Categories"));
print_fiche_titre($langs->trans("ModifCat"));
$object->fetch($id);
$form = new Form($db);
print '<table class="notopnoleft" border="0" width="100%">';
print '<tr><td class="notopnoleft" valign="top" width="30%">';
print "\n";
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'">';
@ -136,6 +133,8 @@ print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
dol_fiche_head('');
print '<table class="border" width="100%">';
// Ref
@ -165,13 +164,15 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
}
print '</table>';
print '<br>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
print '</form>';
print '</td></tr></table>';
llxFooter();

View File

@ -148,12 +148,13 @@ foreach($fulltree as $key => $val)
$categstatic->ref=$val['label'];
$categstatic->type=$type;
$li=$categstatic->getNomUrl(1,'',60);
$desc=dol_htmlcleanlastbr($val['description']);
$data[] = array(
'rowid'=>$val['rowid'],
'fk_menu'=>$val['fk_parent'],
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.$li.
'</td><td width="50%">'.dolGetFirstLineOfText($val['description']).'</td>'.
'</td><td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
'<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
'</tr></table>'
);

View File

@ -643,16 +643,16 @@ class Propal extends CommonObject
$price = $pu - $remise;
}
// Update line
$this->line=new PropaleLigne($this->db);
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new PropaleLigne($this->db);
$line->fetch($rowid);
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
$this->line->context = $this->context;
// Stock previous line records
$staticline=new PropaleLigne($this->db);
$staticline->fetch($rowid);
$this->line->oldline = $staticline;
// Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line)
{
@ -1062,9 +1062,9 @@ class Propal extends CommonObject
function createFromClone($socid=0)
{
global $db, $user,$langs,$conf,$hookmanager;
dol_include_once('/projet/class.project.class.php');
$this->context['createfromclone']='createfromclone';
$error=0;
@ -1089,16 +1089,16 @@ class Propal extends CommonObject
$this->socid = $objsoc->id;
$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
$this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$project = new Project($db);
if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) {
if($project->socid <= 0) $this->fk_project = $objFrom->fk_project;
else $this->fk_project = '';
} else {
$this->fk_project = '';
}
$this->fk_delivery_address = '';
}
@ -3107,10 +3107,12 @@ class PropaleLigne extends CommonObjectLine
$this->date_end = $this->db->jdate($objp->date_end);
$this->db->free($result);
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}

View File

@ -266,8 +266,11 @@ print '<table class="border" width="100%">';
print '<tr height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NbOfProposals").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="center">%</td>';
print '</tr>';
$oldyear=0;
@ -280,15 +283,21 @@ foreach ($data as $val)
print '<tr height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '</tr>';
}
print '<tr height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
print '<td align="right">'.$val['nb'].'</td>';
print '<td align="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
print '<td align="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
print '<td align="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
print '</tr>';
$oldyear=$year;
}

View File

@ -1112,10 +1112,10 @@ class Commande extends CommonOrder
// get extrafields from original line
$object->fetch_optionals($object->id);
$e = new ExtraFields($db);
$element_extrafields = $e->fetch_name_optionals_label($this->element);
foreach($object->array_options as $options_key => $value) {
if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){
$this->array_options[$options_key] = $value;
@ -2503,16 +2503,16 @@ class Commande extends CommonOrder
$price = ($pu - $remise);
}
// Update line
$this->line=new OrderLine($this->db);
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new OrderLine($this->db);
$line->fetch($rowid);
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
$this->line->context = $this->context;
// Stock previous line records
$staticline=new OrderLine($this->db);
$staticline->fetch($rowid);
$this->line->oldline = $staticline;
// Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line)
{
@ -3471,10 +3471,12 @@ class OrderLine extends CommonOrderLine
$this->date_end = $this->db->jdate($objp->date_end);
$this->db->free($result);
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}

View File

@ -279,8 +279,11 @@ print '<table class="border" width="100%">';
print '<tr height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NbOfOrders").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="center">%</td>';
print '</tr>';
$oldyear=0;
@ -289,21 +292,27 @@ foreach ($data as $val)
$year = $val['year'];
while (! empty($year) && $oldyear > $year+1)
{ // If we have empty year
$oldyear--;
print '<tr height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
$oldyear--;
print '<tr height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
print '<td align="right">0</td>';
print '<td align="right">0</td>';
print '<td align="right">0</td>';
print '</tr>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '</tr>';
}
print '<tr height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
print '<td align="right">'.$val['nb'].'</td>';
print '<td align="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
print '<td align="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
print '<td align="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
print '</tr>';
$oldyear=$year;
}

View File

@ -1244,7 +1244,6 @@ class AccountLine extends CommonObject
}
else
{
dol_print_error($this->db);
return -1;
}
}

View File

@ -2345,16 +2345,26 @@ class Facture extends CommonInvoice
$pu_tva = $tabprice[4];
$pu_ttc = $tabprice[5];
// Update line into database
$this->line=new FactureLigne($this->db);
// Old properties: $price, $remise (deprecated)
$price = $pu;
$remise = 0;
if ($remise_percent > 0)
{
$remise = round(($pu * $remise_percent / 100),2);
$price = ($pu - $remise);
}
$price = price2num($price);
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new FactureLigne($this->db);
$line->fetch($rowid);
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
$this->line->context = $this->context;
// Stock previous line records
$staticline=new FactureLigne($this->db);
$staticline->fetch($rowid);
$this->line->oldline = $staticline;
// Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line)
{
@ -3843,10 +3853,12 @@ class FactureLigne extends CommonInvoiceLine
$this->fk_prev_id = $objp->fk_prev_id;
$this->db->free($result);
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}

View File

@ -263,8 +263,11 @@ print '<table class="border" width="100%">';
print '<tr height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NumberOfBills").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="center">%</td>';
print '</tr>';
$oldyear=0;
@ -277,15 +280,21 @@ foreach ($data as $val)
print '<tr height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '</tr>';
}
print '<tr height="24">';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
print '<td align="right">'.$val['nb'].'</td>';
print '<td align="right" style="'.(($val['nb_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['nb_diff']).'</td>';
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
print '<td align="right" style="'.(($val['total_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['total_diff']).'</td>';
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
print '<td align="right" style="'.(($val['avg_diff'] >= 0) ? 'color: green;':'color: red;').'">'.round($val['avg_diff']).'</td>';
print '</tr>';
$oldyear=$year;
}

View File

@ -65,8 +65,8 @@ $v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE");
$v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE");
$v->setPhoneNumber($contact->fax, "WORK;FAX");
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL");
$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK");
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country:''), "WORK;POSTAL");
$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country:''), "WORK");
$v->setEmail($contact->email,'internet,pref');
$v->setNote($contact->note);
@ -78,7 +78,7 @@ if ($company->id)
$v->setURL($company->url, "WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX");
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country, "WORK;POSTAL");
if ($company->email != $contact->email) $v->setEmail($company->email,'internet');
// Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name);

View File

@ -762,7 +762,6 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
setEventMessage($object->error,'errors');
}
} elseif ($action=='setref_supplier') {
$cancelbutton = GETPOST('cancel');
if (!$cancelbutton) {
@ -771,9 +770,8 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
if ($result < 0) {
setEventMessage($object->errors, 'errors');
}
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
$result = $object->update($user);
$result = $object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha'));
if ($result < 0) {
setEventMessage($object->errors, 'errors');
$action = 'editref_supplier';
@ -794,9 +792,8 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
if ($result < 0) {
setEventMessage($object->errors, 'errors');
}
$object->ref = GETPOST('ref', 'alpha');
$result = $object->update($user);
$result = $object->setValueFrom('ref',GETPOST('ref','alpha'));;
if ($result < 0) {
setEventMessage($object->errors, 'errors');
$action = 'editref';

View File

@ -2072,10 +2072,12 @@ class Form
if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','<strong>$1</strong>',$label,1);
$opt.=$objp->ref;
if (! empty($objp->idprodfournprice)) $opt.=' ('.$objp->ref_fourn.')';
if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn))
$opt.=' ('.$objp->ref_fourn.')';
$opt.=' - ';
$outval.=$objRef;
if (! empty($objp->idprodfournprice)) $outval.=' ('.$objRefFourn.')';
if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn))
$outval.=' ('.$objRefFourn.')';
$outval.=' - ';
$opt.=dol_trunc($label, 72).' - ';
$outval.=dol_trunc($label, 72).' - ';

View File

@ -56,7 +56,7 @@ abstract class Stats
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
}
$newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_user'.$user->id.'.cache';
$newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_entity.'.$conf->entity.'_user'.$user->id.'.cache';
$newmask='0644';
$nowgmt = dol_now();
@ -150,7 +150,7 @@ abstract class Stats
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
}
$newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_user'.$user->id.'.cache';
$newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_entity.'.$conf->entity.'_user'.$user->id.'.cache';
$newmask='0644';
$nowgmt = dol_now();
@ -276,7 +276,7 @@ abstract class Stats
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
}
$newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_user'.$user->id.'.cache';
$newpathofdestfile=$conf->user->dir_temp.'/'.get_class($this).'_'.__FUNCTION__.'_'.(empty($this->cachefilesuffix)?'':$this->cachefilesuffix.'_').$langs->defaultlang.'_entity.'.$conf->entity.'_user'.$user->id.'.cache';
$newmask='0644';
$nowgmt = dol_now();
@ -383,8 +383,11 @@ abstract class Stats
$row = $this->db->fetch_object($resql);
$result[$i]['year'] = $row->year;
$result[$i]['nb'] = $row->nb;
if($i>0) $result[$i-1]['nb_diff'] = ($result[$i-1]['nb'] - $row->nb) / $row->nb * 100;
$result[$i]['total'] = $row->total;
if($i>0) $result[$i-1]['total_diff'] = ($result[$i-1]['total'] - $row->total) / $row->total * 100;
$result[$i]['avg'] = $row->avg;
if($i>0) $result[$i-1]['avg_diff'] = ($result[$i-1]['avg'] - $row->avg) / $row->avg * 100;
$i++;
}
$this->db->free($resql);

View File

@ -410,6 +410,7 @@ class DoliDBPgsql extends DoliDB
$this->database_name = $name;
pg_set_error_verbosity($this->db, PGSQL_ERRORS_VERBOSE); // Set verbosity to max
}
pg_query($this->db, "set datestyle = 'ISO, YMD';");
return $this->db;
}

View File

@ -897,7 +897,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
*/
function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
{
global $bc,$user;
global $bc,$user,$conf;
// Check parameters
if (! is_object($object)) dol_print_error('','BadParameter');
@ -915,12 +915,22 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$out.="\n";
$out.='<table width="100%" class="noborder">';
$out.='<tr class="liste_titre">';
$out.='<td colspan="2">';
if($conf->global->AGENDA_USE_EVENT_TYPE) $out.='<td colspan="3">';
else $out.='<td colspan="2">';
if (get_class($object) == 'Societe') $out.='<a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$object->id.'&amp;status=todo">';
$out.=$langs->trans("ActionsToDoShort");
if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>';
$out.='<td colspan="5" align="right">';
if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.='<td>';
$out.=$langs->trans("Type");
$out.='</td>';
$out.='<td colspan="4" align="right">';
} else {
$out.='<td colspan="5" align="right">';
}
$out.='</td>';
$out.='</tr>';
@ -965,7 +975,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$var = !$var;
$obj = $db->fetch_object($result);
$actionstatic->fetch($obj->id);
$datep=$db->jdate($obj->dp);
$datep2=$db->jdate($obj->dp2);
@ -999,8 +1009,13 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
// Title of event
//$out.='<td colspan="2">'.dol_trunc($obj->label,40).'</td>';
$out.='<td colspan="2">'.$actionstatic->getNomUrl(1,120).'</td>';
$out.='<td>'.$actionstatic->getNomUrl(1,120).'</td>';
if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.= '<td>';
$out.=$actionstatic->type;
$out.='</td>';
}
// Contact pour cette action
if (empty($objcon->id) && $obj->fk_contact > 0)
{
@ -1063,7 +1078,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
*/
function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
{
global $bc,$user;
global $bc,$user,$conf;
// Check parameters
if (! is_object($object)) dol_print_error('','BadParameter');
@ -1202,12 +1217,22 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$out.="\n";
$out.='<table class="noborder" width="100%">';
$out.='<tr class="liste_titre">';
$out.='<td colspan="2">';
if($conf->global->AGENDA_USE_EVENT_TYPE) $out.='<td colspan="3">';
else $out.='<td colspan="2">';
if (get_class($object) == 'Societe') $out.='<a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$object->id.'&amp;status=done">';
$out.=$langs->trans("ActionsDoneShort");
if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>';
$out.='<td colspan="5" align="right">';
if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.='<td>';
$out.=$langs->trans("Type");
$out.='</td>';
$out.='<td colspan="4" align="right">';
} else {
$out.='<td colspan="5" align="right">';
}
$out.='</td>';
$out.='</tr>';
@ -1215,7 +1240,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
{
$var=!$var;
$out.="<tr ".$bc[$var].">";
$actionstatic->fetch($histo[$key]['id']);
// Champ date
$out.='<td width="120" class="nowrap">';
$out.=dol_print_date($histo[$key]['datestart'],'dayhour');
@ -1251,7 +1276,12 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$out.=dol_trunc($libelle,120);
}
$out.='</td>';
if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.='<td>';
$out.=$actionstatic->type;
$out.='</td>';
}
// Title of event
//$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>';

View File

@ -2015,7 +2015,7 @@ function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $
$tmparray=array(0=>$titlealt);
if (preg_match('/:[^\s]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
$title=$tmparray[0];
$alt=empty($tmparray[1])?$tmparray[0]:$tmparray[1]; // Use title for alt if no alt is provided
$alt=empty($tmparray[1])?'':$tmparray[1];
return '<img src="'.$fullpathpicto.'" border="0" alt="'.dol_escape_htmltag($alt).'"'.($notitle?'':' title="'.dol_escape_htmltag($title).'"').($options?' '.$options:'').'>'; // Alt is used for accessibility, title for popup
}
}

View File

@ -94,7 +94,7 @@ function tree_showpad(&$fulltree,$key,$silent=0)
// ------------------------------- Used by menu editor -----------------
// ------------------------------- Used by menu editor, category view, ... -----------------
/**
* Recursive function to output menu tree. <ul id="iddivjstree"><li>...</li></ul>

View File

@ -301,7 +301,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?&action=request', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?&action=request', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->view_log', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/month_report.php?&action=request', 'MenuReportMonth', 1, 'holiday', '$user->rights->holiday->month_report', '', 0, 4, __ENTITY__);
-- HRM - Trips and expenses
-- HRM - Expense reports
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->rights->deplacement->lire', '', 0, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?action=create&amp;leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->rights->deplacement->creer', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__);

View File

@ -1334,7 +1334,6 @@ print $sql;
$this->db->begin();
//var_dump($this->menu); exit;
foreach ($this->menu as $key => $value)
{
$menu = new Menubase($this->db);
@ -1343,11 +1342,9 @@ print $sql;
if (! $this->menu[$key]['fk_menu'])
{
$menu->fk_menu=0;
//print 'aaa'.$this->menu[$key]['fk_menu'];
}
else
{
//print 'xxx'.$this->menu[$key]['fk_menu'];exit;
$foundparent=0;
$fk_parent=$this->menu[$key]['fk_menu'];
if (preg_match('/^r=/',$fk_parent)) // old deprecated method

View File

@ -227,7 +227,7 @@ class modAgenda extends DolibarrModules
// Calendar
$this->menu[$r]=array('fk_menu'=>'r=1',
'type'=>'left',
'titre'=>'Calendar',
'titre'=>'Agenda',
'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda',
'langs'=>'agenda',

View File

@ -102,7 +102,7 @@ class modBarcode extends DolibarrModules
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>200,
'enabled'=>'$conf->barcode->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->barcode->lire_advance', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'perms'=>'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++;
@ -114,7 +114,7 @@ class modBarcode extends DolibarrModules
'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>300,
'enabled'=>'$conf->barcode->enabled && $leftmenu=="modulesadmintools"', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->barcode->creer_advance', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'perms'=>'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
$r++;

View File

@ -94,7 +94,7 @@ class modPrinting extends DolibarrModules
$r++;
$this->rights[$r][0] = 64001;
$this->rights[$r][1] = 'Printing';
$this->rights[$r][1] = 'DirectPrint';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'read';
@ -106,7 +106,7 @@ class modPrinting extends DolibarrModules
// This is to declare the Top Menu entry:
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', // Put 0 if this is a top menu
'type'=>'left', // This is a Top menu entry
'titre'=>'Printing',
'titre'=>'MenuDirectPrinting',
'mainmenu'=>'printing',
'url'=>'/printing/index.php',
'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.

View File

@ -0,0 +1,618 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/modules/project/doc/pdf_beluga.modules.php
* \ingroup project
* \brief Fichier de la classe permettant de generer les projets au modele beluga
* \author Charlie Benke
*/
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
/**
* Classe permettant de generer les projets au modele Baleine
*/
class pdf_beluga extends ModelePDFProjects
{
var $emetteur; // Objet societe qui emet
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
global $conf,$langs,$mysoc;
$langs->load("main");
$langs->load("projects");
$langs->load("companies");
$this->db = $db;
$this->name = "beluga";
$this->description = $langs->trans("DocumentModelBeluga");
// Dimension page pour format A4
$this->type = 'pdf';
$formatarray=pdf_getFormat();
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_codeproduitservice = 1; // Affiche code produit-service
// Recupere emmetteur
$this->emetteur=$mysoc;
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
// Defini position des colonnes
$this->posxref=$this->marge_gauche+1;
$this->posxdate=$this->marge_gauche+25;
$this->posxsociety=$this->marge_gauche+45;
$this->posxamountht=$this->marge_gauche+115;
$this->posxamountttc=$this->marge_gauche+140;
$this->posxstatut=$this->marge_gauche+165;
}
/**
* Fonction generant le projet sur le disque
*
* @param Project $object Object project a generer
* @param Translate $outputlangs Lang output object
* @return int 1 if OK, <=0 if KO
*/
function write_file($object,$outputlangs)
{
global $user,$langs,$conf;
$formproject=new FormProjets($this->db);
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
$outputlangs->load("main");
$outputlangs->load("dict");
$outputlangs->load("companies");
$outputlangs->load("projects");
if ($conf->projet->dir_output)
{
//$nblignes = count($object->lines); // This is set later with array of tasks
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->projet->dir_output;
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
if (! file_exists($dir))
{
if (dol_mkdir($dir) < 0)
{
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
return 0;
}
}
if (file_exists($dir))
{
// Add pdfgeneration hook
if (! is_object($hookmanager))
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
}
$hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action;
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
// Complete object by loading several other informations
$task = new Task($this->db);
$tasksarray = $task->getTasksArray(0,0,$object->id);
$object->lines=$tasksarray;
$nblignes=count($object->lines);
$pdf->Open();
$pagenb=0;
$pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
$pdf->SetSubject($outputlangs->transnoentities("Project"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project"));
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
// New page
$pdf->AddPage();
$pagenb++;
$this->_pagehead($pdf, $object, 1, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$tab_top = 50;
$tab_height = 200;
$tab_top_newpage = 40;
$tab_height_newpage = 210;
// Affiche notes
if (! empty($object->note_public))
{
$pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxref-1, $tab_top-2, dol_htmlentitiesbr($object->note_public), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-($tab_top-2);
// Rect prend une longueur en 3eme param
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-3, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
$tab_height = $tab_height - $height_note;
$tab_top = $nexY+6;
}
else
{
$height_note=0;
}
$iniY = $tab_top + 7;
$curY = $tab_top + 7;
$nexY = $tab_top + 7;
$listofreferent=array(
'propal'=>array(
'name'=>"Proposals",
'title'=>"ListProposalsAssociatedProject",
'class'=>'Propal',
'table'=>'propal',
'datefieldname'=>'datep',
'test'=>$conf->propal->enabled && $user->rights->propale->lire),
'order'=>array(
'name'=>"CustomersOrders",
'title'=>"ListOrdersAssociatedProject",
'class'=>'Commande',
'table'=>'commande',
'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire),
'invoice'=>array(
'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject",
'class'=>'Facture',
'margin'=>'add',
'table'=>'facture',
'datefieldname'=>'datef',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'invoice_predefined'=>array(
'name'=>"PredefinedInvoices",
'title'=>"ListPredefinedInvoicesAssociatedProject",
'class'=>'FactureRec',
'table'=>'facture_rec',
'datefieldname'=>'datec',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'order_supplier'=>array(
'name'=>"SuppliersOrders",
'title'=>"ListSupplierOrdersAssociatedProject",
'class'=>'CommandeFournisseur',
'table'=>'commande_fournisseur',
'datefieldname'=>'date_commande',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire),
'invoice_supplier'=>array(
'name'=>"BillsSuppliers",
'title'=>"ListSupplierInvoicesAssociatedProject",
'class'=>'FactureFournisseur',
'margin'=>'minus',
'table'=>'facture_fourn',
'datefieldname'=>'datef',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire),
'contract'=>array(
'name'=>"Contracts",
'title'=>"ListContractAssociatedProject",
'class'=>'Contrat',
'table'=>'contrat',
'datefieldname'=>'date_contrat',
'test'=>$conf->contrat->enabled && $user->rights->contrat->lire),
'intervention'=>array(
'name'=>"Interventions",
'title'=>"ListFichinterAssociatedProject",
'class'=>'Fichinter',
'table'=>'fichinter',
'datefieldname'=>'date_valid',
'disableamount'=>1,
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
'trip'=>array(
'name'=>"TripsAndExpenses",
'title'=>"ListTripAssociatedProject",
'class'=>'Deplacement',
'table'=>'deplacement',
'datefieldname'=>'dated',
'margin'=>'minus',
'disableamount'=>1,
'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire),
'agenda'=>array(
'name'=>"Agenda",
'title'=>"ListActionsAssociatedProject",
'class'=>'ActionComm',
'table'=>'actioncomm',
'datefieldname'=>'datep',
'disableamount'=>1,
'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire)
);
foreach ($listofreferent as $key => $value)
{
$title=$value['title'];
$classname=$value['class'];
$tablename=$value['table'];
$datefieldname=$value['datefieldname'];
$qualified=$value['test'];
if ($qualified)
{
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
$num=count($elementarray);
if ($num> 0)
{
$nexY = $pdf->GetY()+5;
$curY = $nexY;
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxstatut-$this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
$selectList=$formproject->select_element($tablename,$project->thirdparty->id);
$nexY = $pdf->GetY()+1;
$curY = $nexY;
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxdate-$this->posxref, 3, $outputlangs->transnoentities("Ref"), 1, 'L');
$pdf->SetXY($this->posxdate, $curY);
$pdf->MultiCell($this->posxsociety-$this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C');
$pdf->SetXY($this->posxsociety, $curY);
$pdf->MultiCell($this->posxamountht-$this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L');
if (empty($value['disableamount']))
{
$pdf->SetXY($this->posxamountht, $curY);
$pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3, $outputlangs->transnoentities("AmountHT"), 1, 'R');
$pdf->SetXY($this->posxamountttc, $curY);
$pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTC"), 1, 'R');
}
else
{
$pdf->SetXY($this->posxamountht, $curY);
$pdf->MultiCell($this->posxstatut-$this->posxamountht, 3, "", 1, 'R');
}
$pdf->SetXY($this->posxstatut, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R');
if (is_array($elementarray) && count($elementarray)>0)
{
$nexY = $pdf->GetY();
$curY = $nexY;
$total_ht = 0;
$total_ttc = 0;
$num=count($elementarray);
for ($i = 0; $i < $num; $i++)
{
$element = new $classname($this->db);
$element->fetch($elementarray[$i]);
$element->fetch_thirdparty();
//print $classname;
$qualifiedfortotal=true;
if ($key == 'invoice')
{
if ($element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice
}
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxdate-$this->posxref, 3, $element->ref, 1, 'L');
// Date
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') $date=$element->date_commande;
else
{
$date=$element->date;
if (empty($date)) $date=$element->datep;
if (empty($date)) $date=$element->date_contrat;
if (empty($date)) $date=$element->datev; //Fiche inter
}
$pdf->SetXY($this->posxdate, $curY);
$pdf->MultiCell($this->posxsociety-$this->posxdate, 3, dol_print_date($date,'day'), 1, 'C');
$pdf->SetXY($this->posxsociety, $curY);
if (is_object($element->thirdparty))
$pdf->MultiCell($this->posxamountht-$this->posxsociety, 3, $element->thirdparty->name, 1, 'L');
// Amount without tax
if (empty($value['disableamount']))
{
$pdf->SetXY($this->posxamountht, $curY);
$pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3,
(isset($element->total_ht)?price($element->total_ht):'&nbsp;'), 1, 'R');
$pdf->SetXY($this->posxamountttc, $curY);
$pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3,
(isset($element->total_ttc)?price($element->total_ttc):'&nbsp;'), 1, 'R');
}
else
{
$pdf->SetXY($this->posxamountht, $curY);
$pdf->MultiCell($this->posxstatut-$this->posxamountht, 3, "", 1, 'R');
}
// Status
if ($element instanceof CommonInvoice) {
//This applies for Facture and FactureFournisseur
$outputstatut= $element->getLibStatut(1, $element->getSommePaiement());
} else {
$outputstatut = $element->getLibStatut(1);
}
$pdf->SetXY($this->posxstatut, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3,
$outputstatut, 1, 'R',false, 1, '', '', true, 0, true);
if ($qualifiedfortotal)
{
$total_ht = $total_ht + $element->total_ht;
$total_ttc = $total_ttc + $element->total_ttc;
}
$nexY = $pdf->GetY();
$curY = $nexY;
}
if (empty($value['disableamount']))
{
$curY = $nexY;
$pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell($this->posxamountttc-$this->posxref, 3, "TOTAL", 1, 'L');
$pdf->SetXY($this->posxamountht, $curY);
$pdf->MultiCell($this->posxamountttc-$this->posxamountht, 3,
(isset($element->total_ht)?price($total_ht):'&nbsp;'), 1, 'R');
$pdf->SetXY($this->posxamountttc, $curY);
$pdf->MultiCell($this->posxstatut-$this->posxamountttc, 3,
(isset($element->total_ttc)?price($total_ttc):'&nbsp;'), 1, 'R');
$pdf->SetXY($this->posxstatut, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxstatut, 3,
$outputlangs->transnoentities("Nb")." ".$num, 1, 'L');
}
$nexY = $pdf->GetY()+5;
$curY = $nexY;
}
}
}
}
/*
* Pied de page
*/
$this->_pagefoot($pdf,$object,$outputlangs);
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
$pdf->Close();
$pdf->Output($file,'F');
// Add pdfgeneration hook
if (! is_object($hookmanager))
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
}
$hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action;
$reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
return 1; // Pas d'erreur
}
else
{
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
return 0;
}
}
$this->error=$langs->transnoentities("ErrorConstantNotDefined","LIVRAISON_OUTPUTDIR");
return 0;
}
/**
* Show table for lines
*
* @param PDF $pdf Object PDF
* @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle)
* @param int $nexY Y
* @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void
*/
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{
global $conf,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetDrawColor(128,128,128);
// Rect prend une longueur en 3eme param
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
// line prend une position y en 3eme param
$pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size);
$pdf->SetXY($this->posxref, $tab_top+1);
$pdf->MultiCell($this->posxlabel-$this->posxref,3, $outputlangs->transnoentities("Tasks"),'','L');
$pdf->SetXY($this->posxlabel, $tab_top+1);
$pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L');
$pdf->SetXY($this->posxworkload, $tab_top+1);
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $outputlangs->transnoentities("PlannedWorkloadShort"), 0, 'R');
$pdf->SetXY($this->posxprogress, $tab_top+1);
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, '%', 0, 'R');
$pdf->SetXY($this->posxdatestart, $tab_top+1);
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, '', 0, 'C');
$pdf->SetXY($this->posxdateend, $tab_top+1);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
}
/**
* Show top header of page.
*
* @param PDF $pdf Object PDF
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
*/
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{
global $langs,$conf,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('','B', $default_font_size + 3);
$posx=$this->page_largeur-$this->marge_droite-100;
$posy=$this->marge_haute;
$pdf->SetXY($this->marge_gauche,$posy);
// Logo
$logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
if ($mysoc->logo)
{
if (is_readable($logo))
{
$height=pdf_getHeightForLogo($logo);
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
}
else
{
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
}
}
else $pdf->MultiCell(100, 4, $outputlangs->transnoentities($this->emetteur->name), 0, 'L');
$pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Project")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R');
$pdf->SetFont('','', $default_font_size + 2);
$posy+=6;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : " . dol_print_date($object->date_start,'day',false,$outputlangs,true), '', 'R');
$posy+=6;
$pdf->SetXY($posx,$posy);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->date_end,'day',false,$outputlangs,true), '', 'R');
$pdf->SetTextColor(0,0,60);
}
/**
* Show footer of page. Need this->emetteur object
*
* @param PDF $pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return void
*/
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{
$showdetails=0;
return pdf_pagefoot($pdf,$outputlangs,'PROJECT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
}
}

View File

@ -1192,6 +1192,8 @@ class Expedition extends CommonObject
$line->details_entrepot[] = $detail_entrepot;
$line->line_id = $obj->line_id;
$line->rowid = $obj->line_id; // TODO deprecated
$line->id = $obj->line_id;
$line->fk_origin_line = $obj->fk_origin_line;
$line->origin_line_id = $obj->fk_origin_line; // TODO deprecated
$line->fk_product = $obj->fk_product;

View File

@ -1546,7 +1546,7 @@ else
else
{
print '<tr>';
print '<td>'.$langs->trans("Approbator").'</td>';
print '<td>'.$langs->trans("ApprovedBy").'</td>';
print '<td>';
if ($object->fk_user_approve > 0)
{
@ -1580,6 +1580,7 @@ else
if($object->fk_statut==6)
{
/* TODO this fields are not yet filled
print '<tr>';
print '<td>'.$langs->trans("AUTHORPAIEMENT").'</td>';
print '<td>';
@ -1591,6 +1592,7 @@ else
print '<td>'.$langs->trans("DATE_PAIEMENT").'</td>';
print '<td>'.$object->date_paiement.'</td></tr>';
print '</tr>';
*/
}
print '</table>';

View File

@ -118,7 +118,7 @@ $field=GETPOST("field");
$objexport=new Export($db);
$objexport->load_arrays($user,$datatoexport);
$objmodelexport=new ModeleExports();
$objmodelexport=new ModeleExports($db);
$form = new Form($db);
$htmlother = new FormOther($db);
$formfile = new FormFile($db);
@ -293,7 +293,7 @@ if ($action == 'add_export_model')
$hexafiltervalue.=$key.'='.$val;
}
}
$objexport->model_name = $export_name;
$objexport->datatoexport = $datatoexport;
$objexport->hexa = $hexa;

View File

@ -703,7 +703,10 @@ class CommandeFournisseur extends CommonOrder
{
$sql.= " date_approve='".$this->db->idate($now)."',";
$sql.= " fk_user_approve = ".$user->id;
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)) $movetoapprovestatus=false;
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $this->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)
{
if (empty($this->user_approve_id2)) $movetoapprovestatus=false; // second level approval not done
}
}
else // request a second level approval
{

View File

@ -2629,7 +2629,7 @@ elseif (! empty($object->id))
{
if ($user->rights->fournisseur->commande->approuver)
{
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && ! empty($object->user_approve_id))
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL && ! empty($object->user_approve_id))
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("FirstApprovalAlreadyDone")).'">'.$langs->trans("ApproveOrder").'</a>';
}
@ -2645,23 +2645,26 @@ elseif (! empty($object->id))
}
// Second approval (if option SUPPLIER_ORDER_DOUBLE_APPROVAL is set)
if ($object->statut == 1)
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)
{
if ($user->rights->fournisseur->commande->approve2)
if ($object->statut == 1)
{
if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && ! empty($object->user_approve_id2))
if ($user->rights->fournisseur->commande->approve2)
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("SecondApprovalAlreadyDone")).'">'.$langs->trans("Approve2Order").'</a>';
if (! empty($object->user_approve_id2))
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("SecondApprovalAlreadyDone")).'">'.$langs->trans("Approve2Order").'</a>';
}
else
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=approve2">'.$langs->trans("Approve2Order").'</a>';
}
}
else
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=approve2">'.$langs->trans("Approve2Order").'</a>';
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans("Approve2Order").'</a>';
}
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans("Approve2Order").'</a>';
}
}
// Refuse

View File

@ -2103,188 +2103,6 @@ else
$num=count($object->lines);
/*
$var=1;
for ($i = 0; $i < $num; $i++)
{
if ($i == 0)
{
print '<tr class="liste_titre"><td>'.$langs->trans('Label').'</td>';
print '<td align="right">'.$langs->trans('VAT').'</td>';
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
print '<td align="right">'.$langs->trans('PriceUTTC').'</td>';
print '<td align="right">'.$langs->trans('Qty').'</td>';
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
print '<td align="right">'.$langs->trans('TotalHTShort').'</td>';
print '<td align="right">'.$langs->trans('TotalTTCShort').'</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '</tr>';
}
// Show product and description
$type=(! empty($object->lines[$i]->product_type)?$object->lines[$i]->product_type:(! empty($object->lines[$i]->fk_product_type)?$object->lines[$i]->fk_product_type:0));
// Try to enhance type detection using date_start and date_end for free lines where type was not saved.
$date_start='';
$date_end='';
if (! empty($object->lines[$i]->date_start))
{
$date_start=$object->lines[$i]->date_start;
$type=1;
}
if (! empty($object->lines[$i]->date_end))
{
$date_end=$object->lines[$i]->date_end;
$type=1;
}
$var=!$var;
// Edit line
if ($object->statut == 0 && $action == 'editline' && $_GET['lineid'] == $object->lines[$i]->rowid)
{
print '<tr '.$bc[$var].'>';
// Show product and description
print '<td>';
print '<input type="hidden" name="lineid" value="'.$object->lines[$i]->rowid.'">';
if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $object->lines[$i]->fk_product > 0)
{
print '<input type="hidden" name="idprod" value="'.$object->lines[$i]->fk_product.'">';
$product_static=new ProductFournisseur($db);
$product_static->fetch($object->lines[$i]->fk_product);
$text=$product_static->getNomUrl(1);
$text.= ' - '.$product_static->libelle;
print $text;
print '<br>';
}
else
{
$forceall=1; // For suppliers, we always show all types
print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1,0,$forceall);
if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|| (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>';
}
if (is_object($hookmanager))
{
$parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$object->lines[$i],'var'=>$var,'num'=>$num,'i'=>$i);
$reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$object,$action);
}
$nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor=new DolEditor('desc',$object->lines[$i]->description,'',128,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70);
$doleditor->Create();
print '</td>';
// VAT
print '<td align="right">';
print $form->load_tva('tauxtva',$object->lines[$i]->tva_tx,$societe,$mysoc);
print '</td>';
// Unit price
print '<td align="right" class="nowrap"><input size="4" name="puht" type="text" value="'.price($object->lines[$i]->pu_ht).'"></td>';
print '<td align="right" class="nowrap"><input size="4" name="puttc" type="text" value=""></td>';
print '<td align="right"><input size="1" name="qty" type="text" value="'.$object->lines[$i]->qty.'"></td>';
print '<td align="right" class="nowrap"><input size="1" name="remise_percent" type="text" value="'.$object->lines[$i]->remise_percent.'"><span class="hideonsmartphone">%</span></td>';
print '<td align="right" class="nowrap">&nbsp;</td>';
print '<td align="right" class="nowrap">&nbsp;</td>';
print '<td align="center" colspan="2"><input type="submit" class="button" name="save" value="'.$langs->trans('Save').'">';
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
print '</tr>';
}
else // Affichage simple de la ligne
{
print '<tr id="row-'.$object->lines[$i]->rowid.'" '.$bc[$var].'>';
// Show product and description
print '<td>';
if ($object->lines[$i]->fk_product)
{
print '<a name="'.$object->lines[$i]->rowid.'"></a>'; // ancre pour retourner sur la ligne
$product_static=new ProductFournisseur($db);
$product_static->fetch($object->lines[$i]->fk_product);
$text=$product_static->getNomUrl(1);
$text.= ' - '.$product_static->libelle;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($object->lines[$i]->description));
print $form->textwithtooltip($text,$description,3,'','',$i);
// Show range
print_date_range($date_start,$date_end);
// Add description in form
if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) print ($object->lines[$i]->description && $object->lines[$i]->description!=$product_static->libelle)?'<br>'.dol_htmlentitiesbr($object->lines[$i]->description):'';
}
// Description - Editor wysiwyg
if (! $object->lines[$i]->fk_product)
{
if ($type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
print $text.' '.nl2br($object->lines[$i]->description);
// Show range
print_date_range($date_start,$date_end);
}
if (is_object($hookmanager))
{
$parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$object->lines[$i],'var'=>$var,'num'=>$num,'i'=>$i);
$reshook=$hookmanager->executeHooks('formViewProductSupplierOptions',$parameters,$object,$action);
}
print '</td>';
// VAT
print '<td align="right">'.vatrate($object->lines[$i]->tva_tx, true, $object->lines[$i]->info_bits).'</td>';
// Unit price
print '<td align="right" class="nowrap">'.price($object->lines[$i]->pu_ht,'MU').'</td>';
print '<td align="right" class="nowrap">'.($object->lines[$i]->pu_ttc?price($object->lines[$i]->pu_ttc,'MU'):'&nbsp;').'</td>';
print '<td align="right">'.$object->lines[$i]->qty.'</td>';
print '<td align="right">'.(($object->lines[$i]->remise_percent > 0)?$object->lines[$i]->remise_percent.'%':'').'</td>';
print '<td align="right" class="nowrap">'.price($object->lines[$i]->total_ht).'</td>';
print '<td align="right" class="nowrap">'.price($object->lines[$i]->total_ttc).'</td>';
if (is_object($hookmanager))
{
$parameters=array('line'=>$object->lines[$i],'num'=>$num,'i'=>$i);
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$object,$action);
}
print '<td align="center" width="16">';
if ($object->statut == 0) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;etat=0&amp;lineid='.$object->lines[$i]->rowid.'">'.img_edit().'</a>';
else print '&nbsp;';
print '</td>';
print '<td align="center" width="16">';
if ($object->statut == 0)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=confirm_delete_line&amp;lineid='.$object->lines[$i]->rowid.'">'.img_delete().'</a>';
}
else print '&nbsp;';
print '</td>';
print '</tr>';
}
}
*/
// Form to add new line
if ($object->statut == FactureFournisseur::STATUS_DRAFT && $user->rights->fournisseur->facture->creer)
{
@ -2316,135 +2134,137 @@ else
print '<div class="tabsAction">';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook
if (empty($reshook)) {
// Modify a validated invoice with no payments
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook
if (empty($reshook))
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>';
// Modify a validated invoice with no payments
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>';
}
// Reopen a standard paid invoice
if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely)
{
if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans('ReOpen').'</a>';
}
else
{
print '<span class="butActionRefused" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ReOpen').'</span>';
}
}
// Send by mail
if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED))
{
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendByMail').'</a>';
}
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
}
// Make payments
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
{
print '<a class="butAction" href="paiement.php?facid='.$object->id.'&amp;action=create &amp;accountid='.$object->fk_account.'">'.$langs->trans('DoPayment').'</a>'; // must use facid because id is for payment id not invoice
}
// Classify paid
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=paid"';
print '>'.$langs->trans('ClassifyPaid').'</a>';
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=paid">'.$langs->trans('ClassifyPaid').'</a>';
}
// Validate
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT)
{
if (count($object->lines))
{
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=valid"';
print '>'.$langs->trans('Validate').'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"';
print '>'.$langs->trans('Validate').'</a>';
}
}
}
// Clone
if ($action != 'edit' && $user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=clone&amp;socid='.$object->socid.'">'.$langs->trans('ToClone').'</a>';
}
// Delete
if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
print '</div>';
print '<br>';
if ($action != 'edit')
{
print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre
/*
* Documents generes
*/
$ref=dol_sanitizeFileName($object->ref);
$subdir = get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
$urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed=$user->rights->fournisseur->facture->creer;
$delallowed=$user->rights->fournisseur->facture->supprimer;
$modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)?'':$conf->global->INVOICE_SUPPLIER_ADDON_PDF));
print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang);
$somethingshown=$formfile->numoffiles;
// Linked object block
$somethingshown = $form->showLinkedObjectBlock($object);
// Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object,array('supplier_order'));
if ($linktoelem) print '<br>'.$linktoelem;
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print '</td><td valign="top" width="50%">';
//print '<br>';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'invoice_supplier',$socid);
print '</div></div></div>';
//print '</td></tr></table>';
}
}
// Reopen a standard paid invoice
if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely)
{
if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=reopen">'.$langs->trans('ReOpen').'</a>';
}
else
{
print '<span class="butActionRefused" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('ReOpen').'</span>';
}
}
// Send by mail
if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED))
{
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=presend&amp;mode=init">'.$langs->trans('SendByMail').'</a>';
}
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
}
// Make payments
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
{
print '<a class="butAction" href="paiement.php?facid='.$object->id.'&amp;action=create &amp;accountid='.$object->fk_account.'">'.$langs->trans('DoPayment').'</a>'; // must use facid because id is for payment id not invoice
}
// Classify paid
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=paid"';
print '>'.$langs->trans('ClassifyPaid').'</a>';
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=paid">'.$langs->trans('ClassifyPaid').'</a>';
}
// Validate
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT)
{
if (count($object->lines))
{
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=valid"';
print '>'.$langs->trans('Validate').'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"';
print '>'.$langs->trans('Validate').'</a>';
}
}
}
// Clone
if ($action != 'edit' && $user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=clone&amp;socid='.$object->socid.'">'.$langs->trans('ToClone').'</a>';
}
// Delete
if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
print '</div>';
print '<br>';
if ($action != 'edit')
{
print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre
/*
* Documents generes
*/
$ref=dol_sanitizeFileName($object->ref);
$subdir = get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref;
$urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed=$user->rights->fournisseur->facture->creer;
$delallowed=$user->rights->fournisseur->facture->supprimer;
$modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)?'':$conf->global->INVOICE_SUPPLIER_ADDON_PDF));
print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang);
$somethingshown=$formfile->numoffiles;
// Linked object block
$somethingshown = $form->showLinkedObjectBlock($object);
// Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object,array('supplier_order'));
if ($linktoelem) print '<br>'.$linktoelem;
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print '</td><td valign="top" width="50%">';
//print '<br>';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'invoice_supplier',$socid);
print '</div></div></div>';
//print '</td></tr></table>';
}
}
}
/*
* Show mail form
*/
*/
if (GETPOST('modelselected')) {
$action = 'presend';
}

File diff suppressed because it is too large Load Diff

View File

@ -787,4 +787,6 @@ UPDATE llx_c_departements SET code_departement='VI' WHERE ncc='ALAVA' AND fk_reg
UPDATE llx_c_departements SET code_departement='CE' WHERE ncc='CEUTA' AND fk_region=407;
UPDATE llx_c_departements SET code_departement='ML' WHERE ncc='MELILLA' AND fk_region=409;
DELETE FROM llx_c_departements WHERE ncc='OTROS' AND fk_region=420;
DELETE FROM llx_c_regions WHERE code_region=420 and fk_pays=4;
DELETE FROM llx_c_regions WHERE code_region=420 and fk_pays=4;
ALTER TABLE llx_c_paiement MODIFY COLUMN libelle varchar(62);

View File

@ -22,7 +22,7 @@ create table llx_c_paiement
(
id integer PRIMARY KEY,
code varchar(6) NOT NULL,
libelle varchar(30),
libelle varchar(62),
type smallint, -- 0: input money, 1: output money, 2: input and output, 3: other
active tinyint DEFAULT 1 NOT NULL,
accountancy_code varchar(32) NULL,

View File

@ -27,7 +27,7 @@
create table llx_c_type_resource
(
rowid integer PRIMARY KEY,
rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(32) NOT NULL,
label varchar(64) NOT NULL,
active tinyint DEFAULT 1 NOT NULL

View File

@ -42,9 +42,9 @@ CREATE TABLE llx_expensereport (
fk_user_approve integer DEFAULT NULL,
fk_user_refuse integer DEFAULT NULL,
fk_user_cancel integer DEFAULT NULL,
fk_statut integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé
fk_c_paiement integer DEFAULT NULL,
paid smallint default 0 NOT NULL,
fk_statut integer NOT NULL, -- 1=brouillon, 2=validated (waiting approval), 4=canceled, 5=approved, 6=payed, 99=refused
fk_c_paiement integer DEFAULT NULL, -- deprecated
paid smallint default 0 NOT NULL, -- deprecated
note_public text,
note_private text,
detail_refuse varchar(255) DEFAULT NULL,

View File

@ -20,18 +20,18 @@
create table llx_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
name varchar(64) NOT NULL, -- nom de l'attribut
entity integer DEFAULT 1 NOT NULL, -- multi company id
elementtype varchar(64) NOT NULL DEFAULT 'member',
tms timestamp,
label varchar(255) NOT NULL, -- label correspondant a l'attribut
name varchar(64) NOT NULL, -- name of field into extrafields tables
entity integer DEFAULT 1 NOT NULL, -- multi company id
elementtype varchar(64) NOT NULL DEFAULT 'member', -- for which element this extra fields is for
tms timestamp, -- date of last update
label varchar(255) NOT NULL, -- label to show for attribute
type varchar(8),
size varchar(8) DEFAULT NULL,
fieldunique integer DEFAULT 0,
fieldrequired integer DEFAULT 0,
perms varchar(255),
perms varchar(255), -- not used yet
pos integer DEFAULT 0,
alwayseditable integer DEFAULT 0,
param text,
list integer DEFAULT 0
alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
param text, -- extra parameters to define possible values of field
list integer DEFAULT 0 -- list of values for field that are combo lists
)ENGINE=innodb;

View File

@ -1663,6 +1663,10 @@ OpportunityPercent=When you create an opportunity, you will defined an estimated
TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only
FixTZ=TimeZone fix
FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced)
ExpectedChecksum=Expected Checksum
CurrentChecksum=Current Checksum
MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice

View File

@ -7,13 +7,13 @@ Customer=العميل
Customers=العملاء
Prospect=احتمال
Prospects=آفاق
DeleteAction=حذف عمل / المهمة
NewAction=عمل جديدة / المهمة
AddAction=Create event/task
AddAnAction=Create an event/task
DeleteAction=Delete an event
NewAction=New event
AddAction=Create event
AddAnAction=Create an event
AddActionRendezVous=Create a Rendez-vous event
Rendez-Vous=الموعد
ConfirmDeleteAction=هل أنت متأكد من أنك تريد حذف هذه المهمة؟
ConfirmDeleteAction=Are you sure you want to delete this event ?
CardAction=بطاقة العمل
PercentDone=النسبة المئوية لعمله
ActionOnCompany=مهمة عن الشركة

View File

@ -194,7 +194,7 @@ ReCalculate=Recalculate
Mode1=Method 1
Mode2=Method 2
CalculationRuleDesc=To calculate total VAT, there is two methods:<br>Method 1 is rounding vat on each line, then summing them.<br>Method 2 is summing all vat on each line, then rounding result.<br>Final result may differs from few cents. Default mode is mode <b>%s</b>.
CalculationRuleDescSupplier=according to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
CalculationRuleDescSupplier=According to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a <b>cash accountancy</b> mode is not relevant. This report is only available when using <b>engagement accountancy</b> mode (see setup of accountancy module).
CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal

View File

@ -171,7 +171,7 @@ ErrorGlobalVariableUpdater5=No global variable selected
ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided
ErrorOppStatusRequiredIfAmount=Vous avez renseigné un montant estimé de l'opportunité. Dans ce cas, il faut aussi renseigner le statut d'opportunité
ErrorOppStatusRequiredIfAmount=You set an estimated amount for this opportunity/lead. So you must also enter its status
# Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@ -130,7 +130,6 @@ nbJours=Number days
TitleAdminCP=Configuration of Leaves
NoticePeriod=Notice period
#Messages
Hello=Hello
HolidaysToValidate=Validate leave requests
HolidaysToValidateBody=Below is a leave request to validate
HolidaysToValidateDelay=This leave request will take place within a period of less than %s days.

View File

@ -35,7 +35,6 @@ IfDatabaseExistsGoBackAndCheckCreate=إذا كانت قاعدة البيانات
WarningBrowserTooOld=نسخة قديمة جدا من المتصفح. ننصحك جيدا بترقية متصفحك إلى نسخة حديثة عن فايرفوكس، كروم أو أوبرا
PHPVersion=PHP الإصدار
YouCanContinue=يمكنك الاستمرار...
PleaseBePatient=يرجى التحلي بالصبر...
License=الترخيص باستعمال
ConfigurationFile=ملفات
WebPagesDirectory=الدليل حيث يتم تخزين صفحات الويب
@ -64,6 +63,7 @@ DatabaseSuperUserAccess=قاعدة بيانات -- وصول مستخدم الك
CheckToCreateDatabase=المربع إذا كان لا وجود قاعدة بيانات ، ويجب تهيئة. <br> في هذه الحالة ، يجب عليك ملء ادخل كلمة السر لحساب المستعملين المتميزين في أسفل هذه الصفحة.
CheckToCreateUser=المربع اذا ادخل لا وجود له ، ويجب تهيئة. <br> في هذه الحالة ، يجب عليك ملء ادخل كلمة السر لحساب المستعملين المتميزين في أسفل هذه الصفحة.
Experimental=(التجريبية وغير التشغيلية)
Deprecated=(deprecated)
DatabaseRootLoginDescription=ادخل يسمح للمستخدم لإنشاء قواعد بيانات جديدة أو المستخدمين الجدد ، وإذا كانت غير مجدية وقاعدة البيانات وقاعدة البيانات ادخل موجود بالفعل (مثل عندما كنت استضافته استضافة ويب).
KeepEmptyIfNoPassword=ترك فارغا إذا لم المستخدم كلمة السر (تجنب هذا؟)
SaveConfigurationFile=إنقاذ القيم

View File

@ -127,6 +127,7 @@ Disable=يعطل
Disabled=المعاقين
Add=إضافة
AddLink=إضافة وصلة
RemoveLink=Remove link
Update=تحديث
AddActionToDo=إضافة إلى العمل لا
AddActionDone=أضف العمل به
@ -712,6 +713,8 @@ Genderman=Man
Genderwoman=Woman
ViewList=List view
Mandatory=Mandatory
Hello=Hello
Sincerely=Sincerely
# Week day
Monday=يوم الاثنين
Tuesday=الثلاثاء

View File

@ -125,6 +125,7 @@ CloneOrder=استنساخ النظام
ConfirmCloneOrder=هل أنت متأكد من أن هذا الأمر استنساخ <b>٪ ق؟</b>
DispatchSupplierOrder=%s استقبال النظام مورد
FirstApprovalAlreadyDone=First approval already done
SecondApprovalAlreadyDone=Second approval already done
##### Types de contacts #####
TypeContact_commande_internal_SALESREPFOLL=ممثل العميل متابعة النظام
TypeContact_commande_internal_SHIPPING=ممثل الشحن متابعة

View File

@ -12,7 +12,6 @@ Creditor=الدائن
PaymentCode=دفع رمز
PayBoxDoPayment=على الدفع
YouWillBeRedirectedOnPayBox=سوف يتم نقلك على تأمين Paybox لك صفحة لإدخال معلومات بطاقة الائتمان
PleaseBePatient=من فضلك ، والتحلي بالصبر
Continue=التالي
ToOfferALinkForOnlinePayment=عنوان دفع %s
ToOfferALinkForOnlinePaymentOnOrder=عنوان لتقديم المستندات ٪ الدفع الإلكتروني واجهة المستخدم للأمر

View File

@ -43,4 +43,4 @@ ListOfSupplierOrders=List of supplier orders
MenuOrdersSupplierToBill=Supplier orders to invoice
NbDaysToDelivery=Delivery delay in days
DescNbDaysToDelivery=The biggest deliver delay of the products from this order
UseDoubleApproval=Use double approval (the second approval can be done by any user with the dedicated permission)
UseDoubleApproval=Use double approval when amount (without tax) is higher than (The second approval can be done by any user with the dedicated permission. Set to 0 for no double approval)

View File

@ -1663,6 +1663,10 @@ OpportunityPercent=When you create an opportunity, you will defined an estimated
TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only
FixTZ=TimeZone fix
FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced)
ExpectedChecksum=Expected Checksum
CurrentChecksum=Current Checksum
MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice

View File

@ -7,13 +7,13 @@ Customer=Клиент
Customers=Клиентите
Prospect=Перспектива
Prospects=Перспективи
DeleteAction=Изтриване на събитие / задача
NewAction=Ново събитие/задача
AddAction=Create event/task
AddAnAction=Create an event/task
DeleteAction=Delete an event
NewAction=New event
AddAction=Create event
AddAnAction=Create an event
AddActionRendezVous=Create a Rendez-vous event
Rendez-Vous=Среща
ConfirmDeleteAction=Сигурни ли сте, че желаете да изтриете това събитие/задача?
ConfirmDeleteAction=Are you sure you want to delete this event ?
CardAction=Карта на/за събитие
PercentDone=Процентно изпълнение
ActionOnCompany=Задача за компанията

View File

@ -194,7 +194,7 @@ ReCalculate=Recalculate
Mode1=Method 1
Mode2=Method 2
CalculationRuleDesc=To calculate total VAT, there is two methods:<br>Method 1 is rounding vat on each line, then summing them.<br>Method 2 is summing all vat on each line, then rounding result.<br>Final result may differs from few cents. Default mode is mode <b>%s</b>.
CalculationRuleDescSupplier=according to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
CalculationRuleDescSupplier=According to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a <b>cash accountancy</b> mode is not relevant. This report is only available when using <b>engagement accountancy</b> mode (see setup of accountancy module).
CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal

View File

@ -171,7 +171,7 @@ ErrorGlobalVariableUpdater5=No global variable selected
ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided
ErrorOppStatusRequiredIfAmount=Vous avez renseigné un montant estimé de l'opportunité. Dans ce cas, il faut aussi renseigner le statut d'opportunité
ErrorOppStatusRequiredIfAmount=You set an estimated amount for this opportunity/lead. So you must also enter its status
# Warnings
WarningMandatorySetupNotComplete=Задължителни параметри на настройката все още не са определени

View File

@ -130,7 +130,6 @@ nbJours=Брой дни
TitleAdminCP=Configuration of Leaves
NoticePeriod=Notice period
#Messages
Hello=Hello
HolidaysToValidate=Validate leave requests
HolidaysToValidateBody=Below is a leave request to validate
HolidaysToValidateDelay=This leave request will take place within a period of less than %s days.

View File

@ -35,7 +35,6 @@ IfDatabaseExistsGoBackAndCheckCreate=Ако базата данни вече с
WarningBrowserTooOld=Е твърде стара версия на браузъра. Надстроите браузъра си до последната версия на Firefox, Chrome или Opera се лекува много.
PHPVersion=Версия на PHP
YouCanContinue=Можете да продължите ...
PleaseBePatient=Моля, бъдете търпеливи ...
License=Използването на лиценз
ConfigurationFile=Конфигурационният файл
WebPagesDirectory=Директорията, в която се съхраняват уеб страници

View File

@ -127,6 +127,7 @@ Disable=Забрани
Disabled=Забранен
Add=Добавяне
AddLink=Добавяне на връзка
RemoveLink=Remove link
Update=Актуализация
AddActionToDo=Добави събитие
AddActionDone=Събитието е добавено
@ -712,6 +713,8 @@ Genderman=Man
Genderwoman=Woman
ViewList=List view
Mandatory=Mandatory
Hello=Hello
Sincerely=Sincerely
# Week day
Monday=Понеделник
Tuesday=Вторник

View File

@ -125,6 +125,7 @@ CloneOrder=Clone за
ConfirmCloneOrder=Сигурен ли сте, че искате да клонирате за този <b>%s?</b>
DispatchSupplierOrder=Получаване %s доставчика ред
FirstApprovalAlreadyDone=First approval already done
SecondApprovalAlreadyDone=Second approval already done
##### Types de contacts #####
TypeContact_commande_internal_SALESREPFOLL=Представител проследяване поръчка на клиента
TypeContact_commande_internal_SHIPPING=Представител проследяване доставка

View File

@ -12,7 +12,6 @@ Creditor=Кредитор
PaymentCode=Плащане код
PayBoxDoPayment=Отидете на плащане
YouWillBeRedirectedOnPayBox=Вие ще бъдете пренасочени на защитена Paybox страница за въвеждане на информация за кредитни карти
PleaseBePatient=Моля, бъдете търпеливи
Continue=До
ToOfferALinkForOnlinePayment=URL за %s плащане
ToOfferALinkForOnlinePaymentOnOrder=URL адрес, за да предложи на потребителя %s онлайн интерфейс плащане за поръчка на клиента

View File

@ -43,4 +43,4 @@ ListOfSupplierOrders=Списък на нарежданията за доста
MenuOrdersSupplierToBill=Поръчки на доставчика за фактуриране
NbDaysToDelivery=Delivery delay in days
DescNbDaysToDelivery=The biggest deliver delay of the products from this order
UseDoubleApproval=Use double approval (the second approval can be done by any user with the dedicated permission)
UseDoubleApproval=Use double approval when amount (without tax) is higher than (The second approval can be done by any user with the dedicated permission. Set to 0 for no double approval)

View File

@ -1663,6 +1663,10 @@ OpportunityPercent=When you create an opportunity, you will defined an estimated
TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only
FixTZ=TimeZone fix
FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced)
ExpectedChecksum=Expected Checksum
CurrentChecksum=Current Checksum
MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice

View File

@ -7,13 +7,13 @@ Customer=Customer
Customers=Customers
Prospect=Prospect
Prospects=Prospects
DeleteAction=Delete an event/task
NewAction=New event/task
AddAction=Create event/task
AddAnAction=Create an event/task
DeleteAction=Delete an event
NewAction=New event
AddAction=Create event
AddAnAction=Create an event
AddActionRendezVous=Create a Rendez-vous event
Rendez-Vous=Rendezvous
ConfirmDeleteAction=Are you sure you want to delete this event/task ?
ConfirmDeleteAction=Are you sure you want to delete this event ?
CardAction=Event card
PercentDone=Percentage complete
ActionOnCompany=Task about company

View File

@ -194,7 +194,7 @@ ReCalculate=Recalculate
Mode1=Method 1
Mode2=Method 2
CalculationRuleDesc=To calculate total VAT, there is two methods:<br>Method 1 is rounding vat on each line, then summing them.<br>Method 2 is summing all vat on each line, then rounding result.<br>Final result may differs from few cents. Default mode is mode <b>%s</b>.
CalculationRuleDescSupplier=according to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
CalculationRuleDescSupplier=According to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a <b>cash accountancy</b> mode is not relevant. This report is only available when using <b>engagement accountancy</b> mode (see setup of accountancy module).
CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal

View File

@ -171,7 +171,7 @@ ErrorGlobalVariableUpdater5=No global variable selected
ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided
ErrorOppStatusRequiredIfAmount=Vous avez renseigné un montant estimé de l'opportunité. Dans ce cas, il faut aussi renseigner le statut d'opportunité
ErrorOppStatusRequiredIfAmount=You set an estimated amount for this opportunity/lead. So you must also enter its status
# Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@ -130,7 +130,6 @@ nbJours=Number days
TitleAdminCP=Configuration of Leaves
NoticePeriod=Notice period
#Messages
Hello=Hello
HolidaysToValidate=Validate leave requests
HolidaysToValidateBody=Below is a leave request to validate
HolidaysToValidateDelay=This leave request will take place within a period of less than %s days.

View File

@ -35,7 +35,6 @@ IfDatabaseExistsGoBackAndCheckCreate=If database already exists, go back and unc
WarningBrowserTooOld=Too old version of browser. Upgrading your browser to a recent version of Firefox, Chrome or Opera is highly recommanded.
PHPVersion=PHP Version
YouCanContinue=You can continue...
PleaseBePatient=Please be patient...
License=Using license
ConfigurationFile=Configuration file
WebPagesDirectory=Directory where web pages are stored

View File

@ -127,6 +127,7 @@ Disable=Disable
Disabled=Disabled
Add=Add
AddLink=Add link
RemoveLink=Remove link
Update=Update
AddActionToDo=Add event to do
AddActionDone=Add event done
@ -712,6 +713,8 @@ Genderman=Man
Genderwoman=Woman
ViewList=List view
Mandatory=Mandatory
Hello=Hello
Sincerely=Sincerely
# Week day
Monday=Monday
Tuesday=Tuesday

View File

@ -125,6 +125,7 @@ CloneOrder=Clone order
ConfirmCloneOrder=Are you sure you want to clone this order <b>%s</b> ?
DispatchSupplierOrder=Receiving supplier order %s
FirstApprovalAlreadyDone=First approval already done
SecondApprovalAlreadyDone=Second approval already done
##### Types de contacts #####
TypeContact_commande_internal_SALESREPFOLL=Representative following-up customer order
TypeContact_commande_internal_SHIPPING=Representative following-up shipping

View File

@ -12,7 +12,6 @@ Creditor=Creditor
PaymentCode=Payment code
PayBoxDoPayment=Go on payment
YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information
PleaseBePatient=Please, be patient
Continue=Next
ToOfferALinkForOnlinePayment=URL for %s payment
ToOfferALinkForOnlinePaymentOnOrder=URL to offer a %s online payment user interface for a customer order

View File

@ -43,4 +43,4 @@ ListOfSupplierOrders=List of supplier orders
MenuOrdersSupplierToBill=Supplier orders to invoice
NbDaysToDelivery=Delivery delay in days
DescNbDaysToDelivery=The biggest deliver delay of the products from this order
UseDoubleApproval=Use double approval (the second approval can be done by any user with the dedicated permission)
UseDoubleApproval=Use double approval when amount (without tax) is higher than (The second approval can be done by any user with the dedicated permission. Set to 0 for no double approval)

View File

@ -1663,6 +1663,10 @@ OpportunityPercent=When you create an opportunity, you will defined an estimated
TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only
FixTZ=TimeZone fix
FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced)
ExpectedChecksum=Expected Checksum
CurrentChecksum=Current Checksum
MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice

View File

@ -7,13 +7,13 @@ Customer=Customer
Customers=Customers
Prospect=Prospect
Prospects=Prospects
DeleteAction=Delete an event/task
NewAction=New event/task
AddAction=Create event/task
AddAnAction=Create an event/task
DeleteAction=Delete an event
NewAction=New event
AddAction=Create event
AddAnAction=Create an event
AddActionRendezVous=Create a Rendez-vous event
Rendez-Vous=Rendezvous
ConfirmDeleteAction=Are you sure you want to delete this event/task ?
ConfirmDeleteAction=Are you sure you want to delete this event ?
CardAction=Event card
PercentDone=Percentage complete
ActionOnCompany=Task about company

View File

@ -194,7 +194,7 @@ ReCalculate=Recalculate
Mode1=Method 1
Mode2=Method 2
CalculationRuleDesc=To calculate total VAT, there is two methods:<br>Method 1 is rounding vat on each line, then summing them.<br>Method 2 is summing all vat on each line, then rounding result.<br>Final result may differs from few cents. Default mode is mode <b>%s</b>.
CalculationRuleDescSupplier=according to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
CalculationRuleDescSupplier=According to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a <b>cash accountancy</b> mode is not relevant. This report is only available when using <b>engagement accountancy</b> mode (see setup of accountancy module).
CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal

View File

@ -171,7 +171,7 @@ ErrorGlobalVariableUpdater5=No global variable selected
ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided
ErrorOppStatusRequiredIfAmount=Vous avez renseigné un montant estimé de l'opportunité. Dans ce cas, il faut aussi renseigner le statut d'opportunité
ErrorOppStatusRequiredIfAmount=You set an estimated amount for this opportunity/lead. So you must also enter its status
# Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@ -130,7 +130,6 @@ nbJours=Broj dana
TitleAdminCP=Configuration of Leaves
NoticePeriod=Notice period
#Messages
Hello=Zdravo
HolidaysToValidate=Validate leave requests
HolidaysToValidateBody=Below is a leave request to validate
HolidaysToValidateDelay=This leave request will take place within a period of less than %s days.

View File

@ -35,7 +35,6 @@ IfDatabaseExistsGoBackAndCheckCreate=If database already exists, go back and unc
WarningBrowserTooOld=Too old version of browser. Upgrading your browser to a recent version of Firefox, Chrome or Opera is highly recommanded.
PHPVersion=PHP Version
YouCanContinue=You can continue...
PleaseBePatient=Please be patient...
License=Using license
ConfigurationFile=Configuration file
WebPagesDirectory=Directory where web pages are stored

View File

@ -127,6 +127,7 @@ Disable=Disable
Disabled=Disabled
Add=Add
AddLink=Add link
RemoveLink=Remove link
Update=Update
AddActionToDo=Add event to do
AddActionDone=Add event done
@ -712,6 +713,8 @@ Genderman=Man
Genderwoman=Woman
ViewList=List view
Mandatory=Mandatory
Hello=Hello
Sincerely=Sincerely
# Week day
Monday=Monday
Tuesday=Tuesday

View File

@ -125,6 +125,7 @@ CloneOrder=Clone order
ConfirmCloneOrder=Are you sure you want to clone this order <b>%s</b> ?
DispatchSupplierOrder=Receiving supplier order %s
FirstApprovalAlreadyDone=First approval already done
SecondApprovalAlreadyDone=Second approval already done
##### Types de contacts #####
TypeContact_commande_internal_SALESREPFOLL=Representative following-up customer order
TypeContact_commande_internal_SHIPPING=Representative following-up shipping

View File

@ -12,7 +12,6 @@ Creditor=Creditor
PaymentCode=Payment code
PayBoxDoPayment=Go on payment
YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information
PleaseBePatient=Please, be patient
Continue=Next
ToOfferALinkForOnlinePayment=URL for %s payment
ToOfferALinkForOnlinePaymentOnOrder=URL to offer a %s online payment user interface for a customer order

View File

@ -43,4 +43,4 @@ ListOfSupplierOrders=List of supplier orders
MenuOrdersSupplierToBill=Supplier orders to invoice
NbDaysToDelivery=Delivery delay in days
DescNbDaysToDelivery=The biggest deliver delay of the products from this order
UseDoubleApproval=Use double approval (the second approval can be done by any user with the dedicated permission)
UseDoubleApproval=Use double approval when amount (without tax) is higher than (The second approval can be done by any user with the dedicated permission. Set to 0 for no double approval)

View File

@ -1663,6 +1663,10 @@ OpportunityPercent=When you create an opportunity, you will defined an estimated
TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only
FixTZ=Fixar zona horaria
FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced)
ExpectedChecksum=Expected Checksum
CurrentChecksum=Current Checksum
MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice

View File

@ -7,13 +7,13 @@ Customer=Client
Customers=Clients
Prospect=Client potencial
Prospects=Clients potencials
DeleteAction=Eliminar un esdeveniment
NewAction=Nou esdeveniment
AddAction=Crea un esdeveniment/tasca
AddAnAction=Crear un esdeveniment/tasca
DeleteAction=Delete an event
NewAction=New event
AddAction=Create event
AddAnAction=Create an event
AddActionRendezVous=Crear una cita
Rendez-Vous=Cita
ConfirmDeleteAction=Esteu segur de voler eliminar aquest esdeveniment?
ConfirmDeleteAction=Are you sure you want to delete this event ?
CardAction=Fitxa esdeveniment
PercentDone=Percentatge realitzat
ActionOnCompany=Esdeveniment concernent a l'empresa

View File

@ -194,7 +194,7 @@ ReCalculate=Recalcular
Mode1=Mètode 1
Mode2=Mètode 2
CalculationRuleDesc=Per calcular la totalitat de l'IVA, hi ha dos mètodes:<br>Mètode 1 és l'arrodoniment de l'IVA en cada línia, llavors es sumen-<br>Mètode 2 és la suma de tot l'IVA en cada línia, a continuació, arrodonint el resultat.<br>.El resultat final pot difereix uns pocs centaus. El mètode per defecte és <b>% s</b>.
CalculationRuleDescSupplier=segons el proveïdor, triar el mètode adequat per aplicar la mateixa regla de càlcul per obtenir el resultat esperat pel seu proveïdor.
CalculationRuleDescSupplier=According to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier.
TurnoverPerProductInCommitmentAccountingNotRelevant=l'Informe Facturació per producte, quan s'utilitza el mode <b>comptabilitat de caixa </b> no és rellevant. Aquest informe només està disponible quan s'utilitza el mode <b>compromís comptable</b>(consulteu la configuració del mòdul de comptabilitat).
CalculationMode=Mode de càlcul
AccountancyJournal=Codi comptable diari

View File

@ -171,7 +171,7 @@ ErrorGlobalVariableUpdater5=Sense variable global seleccionada
ErrorFieldMustBeANumeric=El camp <b>%s</b> ha de contenir un valor numèric
ErrorFieldMustBeAnInteger=El camp <b>%s</b> ha de ser un enter
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided
ErrorOppStatusRequiredIfAmount=Vous avez renseigné un montant estimé de l'opportunité. Dans ce cas, il faut aussi renseigner le statut d'opportunité
ErrorOppStatusRequiredIfAmount=You set an estimated amount for this opportunity/lead. So you must also enter its status
# Warnings
WarningMandatorySetupNotComplete=Els paràmetres obligatoris de configuració no estan encara definits

View File

@ -130,7 +130,6 @@ nbJours=Número de dies
TitleAdminCP=Configuració dels dies lliures retribuïts
NoticePeriod=Notice period
#Messages
Hello=Hola
HolidaysToValidate=Dies lliures retribuïts a validar
HolidaysToValidateBody=A continuació trobara una sol·licitud de dies lliures retribuïts per validar
HolidaysToValidateDelay=Aquesta sol·licitud de dies lliures retribuïts tindrà lloc en un termini de menys de %s dies.

View File

@ -35,7 +35,6 @@ IfDatabaseExistsGoBackAndCheckCreate=Si la base de dades ja existeix, torneu enr
WarningBrowserTooOld=El seu navegador és molt antic. Es recomana que actualitzeu a una versió recent de Firefox, Chrome o Opera.
PHPVersion=Versió PHP
YouCanContinue=Pot continuar ...
PleaseBePatient=Esperi, si us plau...
License=Llicència d'ús
ConfigurationFile=Arxiu de configuració
WebPagesDirectory=Carpeta que conté les pàgines web

View File

@ -127,6 +127,7 @@ Disable=Desactivar
Disabled=Desactivat
Add=Afegir
AddLink=Enllaçar
RemoveLink=Remove link
Update=Modificar
AddActionToDo=Afegir acció a realitzar
AddActionDone=Afegir acció realitzada
@ -712,6 +713,8 @@ Genderman=Man
Genderwoman=Woman
ViewList=List view
Mandatory=Mandatory
Hello=Hello
Sincerely=Sincerely
# Week day
Monday=Dilluns
Tuesday=Dimarts

View File

@ -125,6 +125,7 @@ CloneOrder=Clonar comanda
ConfirmCloneOrder=Esteu segur de voler clonar aquesta comanda <b>%s</b>?
DispatchSupplierOrder=Recepció de la comanda a proveïdor %s
FirstApprovalAlreadyDone=Primera aprovació realitzada
SecondApprovalAlreadyDone=Second approval already done
##### Types de contacts #####
TypeContact_commande_internal_SALESREPFOLL=Responsable seguiment comanda client
TypeContact_commande_internal_SHIPPING=Responsable enviament comanda client

View File

@ -12,7 +12,6 @@ Creditor=Beneficiari
PaymentCode=Codi de pagament
PayBoxDoPayment=Continua el pagament amb targeta
YouWillBeRedirectedOnPayBox=Serà redirigit a la pàgina segura de PayBox per indicar la seva targeta de crèdit
PleaseBePatient=Espereu uns segons
Continue=Continuar
ToOfferALinkForOnlinePayment=URL de pagament %s
ToOfferALinkForOnlinePaymentOnOrder=URL que ofereix una interfície de pagament en línia %s basada en l'import d'una comanda de client

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