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 PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
Restler 3.0 LGPL-3+ Yes Library to develop REST Web services Restler 3.0 LGPL-3+ Yes Library to develop REST Web services
TCPDF 6.2.6 LGPL-3+ Yes PDF generation TCPDF 6.2.6 LGPL-3+ Yes PDF generation
EvalMath 1.0 BSD Yes Safe math expressions evaluation
JS libraries: JS libraries:
jQuery 1.11.3 MIT License Yes JS library 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 delivery date on rouget pdf
FIX: Not showing task extrafields when creating from left menu FIX: Not showing task extrafields when creating from left menu
FIX [ bug #3288 ] Tasks box is not properly drawn 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 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 #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 #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 #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 ***** ***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973 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="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
print '<a class="butAction" href="./importaccounts.php">' . $langs->trans("ImportAccount") . '</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 '<br/><br/>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -1,10 +1,9 @@
<?PHP <?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) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -21,19 +20,19 @@
*/ */
/** /**
* \file htdocs/accountancy/admin/productaccount.php * \file htdocs/accountancy/admin/productaccount.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Onglet de gestion de parametrages des ventilations * \brief Onglet de gestion de parametrages des ventilations
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; 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 . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
// Langs // Langs
$langs->load("companies"); $langs->load("companies");
@ -41,383 +40,355 @@ $langs->load("compta");
$langs->load("main"); $langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
// Search & action GETPOST // search & action GETPOST
$action = GETPOST('action'); $action = GETPOST('action');
$codeventil_buy = GETPOST('codeventil_buy', 'array'); $codeventil_buy = GETPOST('codeventil_buy', 'array');
$codeventil_sell = GETPOST('codeventil_sell', 'array'); $codeventil_sell = GETPOST('codeventil_sell', 'array');
$mesCasesCochees = GETPOST('mesCasesCochees', 'array'); $chk_prod = GETPOST('chk_prod', 'array');
$account_number_buy = GETPOST('account_number_buy'); $account_number_buy = GETPOST('account_number_buy');
$account_number_sell = GETPOST('account_number_sell'); $account_number_sell = GETPOST('account_number_sell');
$changeaccount = GETPOST('changeaccount','array'); $changeaccount = GETPOST('changeaccount', 'array');
$changeaccount_buy = GETPOST('changeaccount_buy','array'); $changeaccount_buy = GETPOST('changeaccount_buy', 'array');
$changeaccount_sell = GETPOST('changeaccount_sell','array'); $changeaccount_sell = GETPOST('changeaccount_sell', 'array');
$search_ref = GETPOST('search_ref','alpha'); $search_ref = GETPOST('search_ref', 'alpha');
$search_label = GETPOST('search_label','alpha'); $search_label = GETPOST('search_label', 'alpha');
$search_desc = GETPOST('search_desc','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'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page','int'); $page = GETPOST('page', 'int');
if ($page < 0) $page = 0; if ($page < 0)
$page = 0;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $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) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) && $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION >= $conf->liste_limit) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
//} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { // } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
// $limit = $conf->liste_limit; // $limit = $conf->liste_limit;
} else { } else {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;
if (! $sortfield) $sortfield="p.ref"; if (! $sortfield)
if (! $sortorder) $sortorder="ASC"; $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 // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
// TODO after adding menu // TODO after adding menu
// if (! $user->rights->accounting->ventilation->dispatch) // if (! $user->rights->accounting->ventilation->dispatch)
// accessforbidden(); // accessforbidden();
$form = new FormVentilation($db); $form = new FormVentilation($db);
//Defaut AccountingAccount RowId Product / Service // Defaut AccountingAccount RowId Product / Service
//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid // 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 // so we need to get those default value rowid first
$accounting = new AccountingAccount($db); $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_servbuy = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT); $aarowid_servbuy = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
$aarowid_prodbuy = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT); $aarowid_prodbuy = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT, 1);
$aarowid_servsell = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT); $aarowid_servsell = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
$aarowid_prodsell = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT); $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_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_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_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")); $aacompta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
// Purge search criteria // Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{ {
$search_ref=''; $search_ref = '';
$search_label=''; $search_label = '';
$search_desc=''; $search_desc = '';
} }
//TODO: modify to update all selected product with a sell account // debug move header to top
if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_sell")) { llxHeader('', $langs->trans("Accounts"));
$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');
}
}
/* /*
* View * View
*/ */
llxHeader('', $langs->trans("Accounts"));
// For updating account export
print '<script type="text/javascript"> print '<script type="text/javascript">
function launch_export() { $(function () {
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv"); $(\'#select-all\').click(function(event) {
$("div.fiche div.tabBar form input[type=\"submit\"]").click(); // Iterate each checkbox
$("div.fiche div.tabBar form input[name=\"action\"]").val(""); $(\':checkbox\').each(function() {
} this.checked = true;
</script>'; });
});
$(\'#unselect-all\').click(function(event) {
// Iterate each checkbox
$(\':checkbox\').each(function() {
this.checked = false;
});
});
});
</script>';
//TODO For select box $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";
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 .= " FROM " . MAIN_DB_PREFIX . "product as p"; $sql .= " FROM " . MAIN_DB_PREFIX . "product as p";
//$sql .= " , " . MAIN_DB_PREFIX . "accountingaccount as aa";
$sql .= " WHERE ("; $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; $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 . "))"; IF ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') {
//(SELECT account_number FROM " . MAIN_DB_PREFIX . "accountingaccount as aa WHERE fk_pcg_version='PCG99-BASE'))"; $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 $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 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'))"; } 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 .= ")"; $sql .= ")";
//Add search filter like
// Add search filter like
if (strlen(trim($search_ref))) { if (strlen(trim($search_ref))) {
$sql .= " AND (p.ref like '" . $search_ref . "%')"; $sql .= " AND (p.ref like '" . $search_ref . "%')";
} }
if (strlen(trim($search_label))) { if (strlen(trim($search_label))) {
$sql .= " AND (p.label like '" . $search_label . "%')"; $sql .= " AND (p.label like '" . $search_label . "%')";
} }
if (strlen(trim($search_desc))) { 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); $sql .= $db->plimit($limit + 1, $offset);
dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG); dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result) {
$num_lines = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
/* /*
* View * View
*/ */
print_barre_liste($langs->trans("ProductAccountingAccountSelect"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); 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 '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"],"p.rowid","",$param,'',$sortfield,$sortorder); print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '&nbsp;&nbsp;'; print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
//DEBUG print '<tr class="liste_titre">';
//print $sql; print '<td>' . $langs->trans('OptionMode') . '</td><td>' . $langs->trans('Description') . '</td>';
print "</tr>\n";
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post"><br />'; 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 '<input type="hidden" name="action" value="ventil">'; print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductSell'));
print "</td></tr>\n";
print '<table class="noborder" width="100%">'; 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 '<tr>'; print '<td colspan="2">' . nl2br($langs->trans('OptionModeProductBuy')) . "</td></tr>\n";
print '<td width="33%">';
print '<div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br />'; print "</table>\n";
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 '<br /><div style="text-align:center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="changetype"></div>';
print '</td>';
print "<br>\n";
print '<td width="33%">';
print '<div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br />'; if (! empty($msg)) {
print $langs->trans("Accountancy_code_sell") . ': ' . $form->select_account($account_number_sell, 'account_number_sell', 1, '', 0, 1); print $msg;
print '<input type="submit" class="butAction" name="action" value="' . $langs->trans("Accountancy_code_sell") . '"/></div>'; }
print '</td>';
print '<td width="33%">'; // print '<td align="left"><b>' . $langs->trans("DescProductAccountingAccount") . '</b></td>&nbsp;';
//TODO change button // print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"], "p.rowid", "", $param, '', $sortfield, $sortorder);
print '<input type="button" class="button" style="float: right;" value="Renseigner les comptes comptables produits manquant" onclick="launch_export();" />'; print '&nbsp;&nbsp;';
print '</td>';
print '</tr>'; print '<table class="noborder" width="100%">';
print '</table>'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
print '<table class="noborder" width="100%">'; print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
// print '<td align="left">' . $langs->trans("Ref") . '</td>'; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
// print '<td align="left">' . $langs->trans("Label") . '</td>'; print '<th align="left">' . $langs->trans("Accountancy_code_buy") . '</td>';
// print '<td align="left">' . $langs->trans("Description") . '</td>'; print '<th align="left">' . $langs->trans("Accountancy_code_buy_suggest") . '</td>';
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); } else {
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"],"p.label","",$param,'',$sortfield,$sortorder); print '<th align="left">' . $langs->trans("Accountancy_code_sell") . '</td>';
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder); print '<th align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
print '<td align="left">' . $langs->trans("Accountancy_code_buy") . '</td>'; }
print '<td align="left">' . $langs->trans("Accountancy_code_buy_suggest") . '</td>'; // print_liste_field_titre('');
print '<td align="left">' . $langs->trans("Accountancy_code_sell") . '</td>'; 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 '<td align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>'; print '</tr>';
print_liste_field_titre(''); print '<tr class="liste_titre">';
// print_liste_field_titre(''); print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_ref" value="' . $search_ref . '"></td>';
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 '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
print '</tr>'; print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>';
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" colspan="2">&nbsp;</td>';
print '<td class="liste_titre">%<input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>'; print '<td align="right" class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>'; 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 '<td class="liste_titre" colspan="3">&nbsp;</td>'; 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 align="right" colspan="4" class="liste_titre">'; print '</td>';
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 '</tr>';
// 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;'; $var = true;
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")).'">'; while ( $i < min($num_lines, 250) ) {
print '</td>'; $obj = $db->fetch_object($result);
// print '<td class="liste_titre" colspan="2">&nbsp;</td>'; $var = ! $var;
print '</tr>';
$compta_prodsell = $obj->accountancy_code_sell;
$var = true;
if ($obj->product_type == 0) {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
while ( $i < min($num_lines, 250) ) { $compta_prodsell_id = $aarowid_prodsell;
$obj = $db->fetch_object($result); } else {
$var = ! $var; $compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
$compta_prodsell_id = $aarowid_servsell;
}
$compta_prodsell = $obj->accountancy_code_sell;
if (empty($compta_prodsell)) { $compta_prodbuy = $obj->accountancy_code_buy;
if ($obj->product_type == 0) {
$compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); if ($obj->product_type == 0) {
$compta_prodsell_id = $aarowid_prodsell; $compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
} else { $compta_prodbuy_id = $aarowid_prodbuy;
$compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); } else {
$compta_prodsell_id = $aarowid_servsell; $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);
$compta_prodbuy = $obj->accountancy_code_buy;
if (empty($compta_prodbuy)) { print "<tr $bc[$var]>";
if ($obj->product_type == 0) {
$compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); print "</tr>";
$compta_prodbuy_id = $aarowid_prodbuy; print "<tr $bc[$var]>";
} else { // Ref produit as link
$compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $product_static->ref = $obj->ref;
$compta_prodbuy_id = $aarowid_servbuy; $product_static->id = $obj->rowid;
} $product_static->type = $obj->type;
} print '<td>';
if ($product_static->id)
print $product_static->getNomUrl(1);
$product_static = new Product($db); else
print '-&nbsp;';
print "<tr $bc[$var]>"; print '</td>';
//debug print '<td align="left">' . dol_trunc($obj->label, 24) . '</td>';
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>'; // TODO ADJUST DESCRIPTION SIZE
// print '<td align="left">' . $obj->description . '</td>';
print "</tr>"; // TODO: we shoul set a user defined value to adjust user square / wide screen size
print "<tr $bc[$var]>"; $trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
// Ref produit as link print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
$product_static->ref = $obj->ref;
$product_static->id = $obj->rowid; // acountingaccount buy
$product_static->type = $obj->type;
print '<td>'; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
if ($product_static->id) print '<td align="left">' . $obj->accountancy_code_buy . '</td>';
print $product_static->getNomUrl(1); // TODO: replace by select
else // print '<td align="left">' . $compta_prodbuy . '</td>';
print '-&nbsp;'; // TODO: we shoul set a user defined value to adjust user square / wide screen size
print '</td>'; // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
print '<td align="center">';
print '<td align="left">' . $obj->label . '</td>'; print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1);
//TODO ADJUST DESCRIPTION SIZE print '</td>';
// print '<td align="left">' . $obj->description . '</td>'; } else {
//TODO: we shoul set a user defined value to adjust user square / wide screen size
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; // acountingaccount sel
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>'; print '<td align="left">' . $obj->accountancy_code_sell . '</td>';
// TODO: replace by select
//acountingaccount buy // TODO: we shoul set a user defined value to adjust user square / wide screen size
print '<td align="left">' . $obj->accountancy_code_buy . '</td>'; // $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
//TODO: replace by select print '<td align="center">';
// print '<td align="left">' . $compta_prodbuy . '</td>'; print $form->select_account($compta_prodsell_id, 'codeventil_'.$product_static->id, 1);
//TODO: we shoul set a user defined value to adjust user square / wide screen size print '</td>';
//$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; }
print '<td align="center">';
print $form->select_account($compta_prodbuy_id, 'codeventil[]', 1); // Checkbox select
print '</td>'; print '<td align="center">';
print '<input type="checkbox" name="chk_prod[]" value="' . $obj->rowid . '"/></td>';
//acountingaccount sel
print '<td align="left">' . $obj->accountancy_code_sell . '</td>'; print "</tr>";
$i ++;
//TODO: replace by select }
//TODO: we shoul set a user defined value to adjust user square / wide screen size print '</table>';
//$trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50; print '<br><div align="center"><input type="submit" class="butAction" name="changeaccount" value="' . $langs->trans("Change_Account") . '"></div>';
print '<td align="center">'; print '</form>';
print $form->select_account($compta_prodsell_id, 'codeventil[]', 1);
print '</td>'; $db->free($result);
//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);
} else { } else {
// print $db->error(); dol_print_error($db);
dol_print_error($db);
} }
print "</table></form>";
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -61,12 +61,15 @@ class AccountingAccount extends CommonObject
/** /**
* Load record in memory * Load record in memory
* *
* @param int $rowid Id * @param int $rowid Id
* @param string $account_number Account number * @param string $account_number Account number
* @return int <0 if KO, >0 if OK * @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) { 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 = "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"; $sql.= " FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE";
@ -75,7 +78,9 @@ class AccountingAccount extends CommonObject
} elseif ($account_number) { } elseif ($account_number) {
$sql .= " account_number = '" . $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); dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) { if ($result) {
@ -101,7 +106,8 @@ class AccountingAccount extends CommonObject
return 0; return 0;
} }
} else { } else {
dol_print_error($this->db); $this->error="Error " . $this->db->lasterror();
$this->errors[] = "Error " . $this->db->lasterror();
} }
} }
return -1; return -1;

View File

@ -27,10 +27,13 @@
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; 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.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
// Langs
$langs->load("bills"); $langs->load("bills");
$langs->load("compta"); $langs->load("compta");
$langs->load("main"); $langs->load("main");
@ -38,23 +41,23 @@ $langs->load("accountancy");
$account_parent = GETPOST('account_parent'); $account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount'); $changeaccount = GETPOST('changeaccount');
//Search Getpost
$search_ref = GETPOST('search_ref','alpha'); $search_ref = GETPOST('search_ref','alpha');
$search_invoice = GETPOST('search_invoice','alpha'); $search_invoice = GETPOST('search_invoice','alpha');
$search_label = GETPOST('search_label','alpha'); $search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha'); $search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha'); $search_amount = GETPOST('search_amount','alpha');
$search_account = GETPOST('search_account','alpha'); $search_account = GETPOST('search_account','alpha');
$search_vat = GETPOST('search_vat','alpha');
//Getpost Order and column and limit page
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');
//if ($page == -1) { $page = 0; }
if ($page < 0) $page = 0; if ($page < 0) $page = 0;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
//$limit = $conf->liste_limit;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { } else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
@ -62,19 +65,11 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
} else { } else {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
} }
//$offset = $conf->liste_limit * $page;
$offset = $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 (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid";
//if (! $sortorder) $sortorder="DESC";
if (! $sortorder) { if (! $sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
$sortorder = " DESC "; $sortorder = " DESC ";
@ -98,6 +93,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_desc=''; $search_desc='';
$search_amount=''; $search_amount='';
$search_account=''; $search_account='';
$search_vat='';
} }
if (is_array($changeaccount) && count($changeaccount) > 0) { if (is_array($changeaccount) && count($changeaccount) > 0) {
@ -181,6 +177,10 @@ if (strlen(trim($search_amount))) {
if (strlen(trim($search_account))) { if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $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)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")"; $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("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("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("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($langs->trans("Account"), $_SERVER["PHP_SELF"],"aa.account_number","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre(''); print_liste_field_titre('');
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_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"><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="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" 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" 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")).'">';
@ -257,6 +259,7 @@ if ($result) {
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>'; print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>'; print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
print '<td align="right">' . price($objp->total_ht) . '</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="center">' . $codecompta . '</td>';
print '<td align="right">' . $objp->rowid . '</td>'; print '<td align="right">' . $objp->rowid . '</td>';
print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">'; print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">';
@ -275,4 +278,4 @@ if ($result) {
print "</table></form>"; print "</table></form>";
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

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

View File

@ -26,11 +26,14 @@
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; 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.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Langs
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
@ -39,24 +42,45 @@ $langs->load("accountancy");
$account_parent = GETPOST('account_parent'); $account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount'); $changeaccount = GETPOST('changeaccount');
//Search Getpost
$search_ref = GETPOST('search_ref','alpha'); $search_ref = GETPOST('search_ref','alpha');
$search_invoice = GETPOST('search_invoice','alpha'); $search_invoice = GETPOST('search_invoice','alpha');
$search_label = GETPOST('search_label','alpha'); $search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha'); $search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha'); $search_amount = GETPOST('search_amount','alpha');
$search_account = GETPOST('search_account','alpha'); $search_account = GETPOST('search_account','alpha');
$search_vat = GETPOST('search_vat','alpha');
//Getpost Order and column and limit page
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');
if ($page == -1) { $page = 0; } if ($page < 0) $page = 0;
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$limit = $conf->liste_limit; if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION))
if (! $sortfield) $sortfield="f.ref"; {
if (! $sortorder) $sortorder="DESC"; $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 // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
@ -75,6 +99,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_desc=''; $search_desc='';
$search_amount=''; $search_amount='';
$search_account=''; $search_account='';
$search_vat='';
} }
if (is_array($changeaccount) && count($changeaccount) > 0) { if (is_array($changeaccount) && count($changeaccount) > 0) {
@ -124,9 +149,6 @@ print '<script type="text/javascript">
}); });
</script>'; </script>';
/*
* Action
*/
/* /*
* Supplier Invoice lines * Supplier Invoice lines
@ -157,6 +179,10 @@ if (strlen(trim($search_amount))) {
if (strlen(trim($search_account))) { if (strlen(trim($search_account))) {
$sql .= " AND aa.account_number like '%" . $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)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")"; $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("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("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("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($langs->trans("Account"), $_SERVER["PHP_SELF"],"aa.account_number","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre(''); print_liste_field_titre('');
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_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"><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="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" 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" 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 '<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); $facturefournisseur_static = new FactureFournisseur($db);
$product_static = new Product($db); $product_static = new Product($db);
@ -234,6 +262,7 @@ if ($result) {
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>'; print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>'; print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
print '<td align="right">' . price($objp->total_ht) . '</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="center">' . $codeCompta . '</td>';
print '<td align="right">' . $objp->rowid . '</td>'; print '<td align="right">' . $objp->rowid . '</td>';
print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">'; print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">';
@ -253,4 +282,4 @@ if ($result) {
print "</table></form>"; print "</table></form>";
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -24,14 +24,13 @@
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Ventilation page from suppliers invoices * \brief Ventilation page from suppliers invoices
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.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 . '/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.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 . '/accountancy/class/accountingaccount.class.php';
// Langs // Langs
$langs->load("compta"); $langs->load("compta");
@ -41,18 +40,28 @@ $langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
$action = GETPOST('action'); $action = GETPOST('action');
// Select Box
$codeventil = GETPOST('codeventil', 'array'); $codeventil = GETPOST('codeventil', 'array');
$mesCasesCochees = GETPOST('mesCasesCochees', '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'); // Search Getpost
$sortorder = GETPOST('sortorder','alpha'); $search_invoice = GETPOST('search_invoice', 'alpha');
//Should move to top with all GETPOST $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'); $page = GETPOST('page');
if ($page < 0) $page = 0; if ($page < 0)
$page = 0;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $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; $limit = $conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;
//End Should move to top with all GETPOST
if (! $sortfield)
// TODO : remove comment $sortfield = "f.datef, f.ref, l.rowid";
//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 (! $sortorder) { if (! $sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
$sortorder = " DESC "; $sortorder = " DESC ";
@ -88,21 +88,24 @@ if (! $user->rights->accounting->ventilation->dispatch)
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);
//Defaut AccountingAccount RowId Product / Service // Defaut AccountingAccount RowId Product / Service
//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid // 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 // so we need to get those default value rowid first
$accounting = new AccountingAccount($db); $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_s = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT);
$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT); $aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT);
// Purge search criteria // Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{ {
$search_ref=''; $search_ref = '';
$search_label=''; $search_label = '';
$search_desc=''; $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")); llxHeader('', $langs->trans("Ventilation"));
//debug print '<script type="text/javascript">
//print_r($aarowid_s);
//print_r($aarowid_p);
print '<script type="text/javascript">
$(function () { $(function () {
$(\'#select-all\').click(function(event) { $(\'#select-all\').click(function(event) {
// Iterate each checkbox // Iterate each checkbox
@ -133,31 +133,31 @@ print '<script type="text/javascript">
* Action * Action
*/ */
if ($action == 'ventil') { if ($action == 'ventil' && !empty($btn_ventil)) {
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>'; print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
if ($_POST['codeventil'] && $_POST["mesCasesCochees"]) { if ($_POST['codeventil'] && $_POST["mesCasesCochees"]) {
print '<div><font color="red">' . count($_POST["mesCasesCochees"]) . ' ' . $langs->trans("SelectedLines") . '</font></div>'; print '<div><font color="red">' . count($_POST["mesCasesCochees"]) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
$mesCodesVentilChoisis = $codeventil; $mesCodesVentilChoisis = $codeventil;
$cpt = 0; $cpt = 0;
foreach ( $mesCasesCochees as $maLigneCochee ) { foreach ( $mesCasesCochees as $maLigneCochee ) {
// print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>"; // print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>";
$maLigneCourante = explode("_", $maLigneCochee); $maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0]; $monId = $maLigneCourante[0];
$monNumLigne = $maLigneCourante[1]; $monNumLigne = $maLigneCourante[1];
$monCompte = $mesCodesVentilChoisis[$monNumLigne]; $monCompte = $mesCodesVentilChoisis[$monNumLigne];
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
$sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " SET fk_code_ventilation = " . $monCompte;
$sql .= " WHERE rowid = " . $monId; $sql .= " WHERE rowid = " . $monId;
dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG); dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG);
if ($db->query($sql)) { if ($db->query($sql)) {
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>'; print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
} else { } else {
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>'; print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
} }
$cpt ++; $cpt ++;
} }
} else { } else {
@ -170,22 +170,9 @@ if ($action == 'ventil') {
* Supplier Invoice Lines * Supplier Invoice Lines
* *
*/ */
$page = GETPOST('page');
if ($page < 0)
$page = 0;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { $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, ";
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_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, p.tva_tx as tva_tx_prod";
} 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 .= " , aa.rowid as aarowid"; $sql .= " , aa.rowid as aarowid";
$sql .= " , f.datef"; $sql .= " , f.datef";
$sql .= " , l.product_type as type_l"; $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 . "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 .= " 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 .= " 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 // Add search filter like
if (strlen(trim($search_invoice))) {
$sql .= " AND (f.ref like '%" . $search_invoice . "%')";
}
if (strlen(trim($search_ref))) { if (strlen(trim($search_ref))) {
$sql .= " AND (p.ref like '%" . $search_ref . "%')"; $sql .= " AND (p.ref like '%" . $search_ref . "%')";
} }
@ -207,11 +197,20 @@ if (strlen(trim($search_label))) {
if (strlen(trim($search_desc))) { if (strlen(trim($search_desc))) {
$sql .= " AND (l.description like '%" . $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)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")"; $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); $sql .= $db->plimit($limit + 1, $offset);
@ -220,32 +219,49 @@ $result = $db->query($sql);
if ($result) { if ($result) {
$num_lines = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... // 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_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>'; print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n"; print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
print '<input type="hidden" name="action" value="ventil">'; print '<input type="hidden" name="action" value="ventil">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; 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("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("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("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("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Amount"),'','','','','align="right"'); print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("AccountAccounting"),'','','','','align="center"'); print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("IntoAccount"),'','','','','align="center"'); print_liste_field_titre($langs->trans("AccountAccounting"), '', '', '', '', 'align="center"');
print_liste_field_titre(''); print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', '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_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>\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); $facturefourn_static = new FactureFournisseur($db);
$productfourn_static = new ProductFournisseur($db); $productfourn_static = new ProductFournisseur($db);
$form = new Form($db); $form = new Form($db);
$var = True; $var = True;
while ( $i < min($num_lines, $limit) ) { while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
@ -258,43 +274,43 @@ if ($result) {
$objp->code_buy_p = ''; $objp->code_buy_p = '';
$objp->aarowid_suggest = ''; $objp->aarowid_suggest = '';
$code_buy_p_l_differ = ''; $code_buy_p_l_differ = '';
$code_buy_p_notset = ''; $code_buy_p_notset = '';
$objp->aarowid_suggest = $objp->aarowid; $objp->aarowid_suggest = $objp->aarowid;
if ( ! empty($objp->code_buy)) { if (! empty($objp->code_buy)) {
$objp->code_buy_p = $objp->code_buy; $objp->code_buy_p = $objp->code_buy;
} else { } else {
$code_buy_p_notset = 'color:red'; $code_buy_p_notset = 'color:red';
if ($objp->type == 1) { if ($objp->type == 1) {
$objp->code_buy_p = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_buy_p = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
}
}
elseif ($objp->type == 0) { elseif ($objp->type == 0) {
$objp->code_buy_p = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef")); $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) { 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")); $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; if ($objp->aarowid == '')
} $objp->aarowid_suggest = $aarowid_s;
elseif ($objp->type_l == 0) { } 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")); $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->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]>"; print "<tr $bc[$var]>";
// Ref Invoice // Ref Invoice
$facturefourn_static->ref = $objp->ref; $facturefourn_static->ref = $objp->ref;
$facturefourn_static->id = $objp->facid; $facturefourn_static->id = $objp->facid;
print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>'; print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>';
// Ref Supplier Invoice // Ref Supplier Invoice
$productfourn_static->ref = $objp->product_ref; $productfourn_static->ref = $objp->product_ref;
$productfourn_static->id = $objp->product_id; $productfourn_static->id = $objp->product_id;
@ -305,26 +321,32 @@ if ($result) {
else else
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td style="' . $code_buy_p_l_differ . '">' . dol_trunc($objp->product_label, 24) . '</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 // TODO: we should set a user defined value to adjust user square / wide screen size
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; $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 style="' . $code_buy_p_l_differ . '">' . nl2br(dol_trunc($objp->description, $trunclength)) . '</td>';
print '<td align="right">'; print '<td align="right">';
print price($objp->price); print price($objp->price);
print '</td>'; 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 . '">'; 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) { if ($objp->code_buy_l == $objp->code_buy_p) {
print $objp->code_buy_l; print $objp->code_buy_l;
} else { } 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>'; print '</td>';
// Colonne choix du compte // Colonne choix du compte
print '<td align="center">'; print '<td align="center">';
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil[]', 1); print $formventilation->select_account($objp->aarowid_suggest, 'codeventil[]', 1);
@ -332,19 +354,19 @@ if ($result) {
print '<td align="center">' . $objp->rowid . '</td>'; print '<td align="center">' . $objp->rowid . '</td>';
// Colonne choix ligne a ventiler // Colonne choix ligne a ventiler
print '<td align="center">'; 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 '</td>';
print "</tr>"; print "</tr>";
$i ++; $i ++;
} }
print '</table>'; 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>'; print '</form>';
} else { } else {
print $db->error(); print $db->error();
} }
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -141,7 +141,7 @@ if ($object->id > 0)
if (! empty($conf->agenda->enabled)) 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>'; print '</div>';

View File

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

View File

@ -168,19 +168,11 @@ else if ($action == 'addcat')
else if ($action == 'set_SUPPLIER_ORDER_OTHER') else if ($action == 'set_SUPPLIER_ORDER_OTHER')
{ {
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string
$doubleapproval = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL'); $doubleapproval = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL','alpha');
//$doubleapprovalgroup = GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP') > 0 ? GETPOST('SUPPLIER_ORDER_DOUBLE_APPROVAL_GROUP') : ''; $doubleapproval = price2num($doubleapproval );
$res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); $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); $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 // 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'; 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("UseDoubleApproval").'<br>';
print $langs->trans("IfSetToYesDontForgetPermission"); print $langs->trans("IfSetToYesDontForgetPermission");
print '</td><td>'; 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 '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
$var=!$var; $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">'; print '<tr '.$bc[$var].'><td colspan="2">';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -643,16 +643,16 @@ class Propal extends CommonObject
$price = $pu - $remise; $price = $pu - $remise;
} }
// Update line //Fetch current line from the database and then clone the object and set it in $oldline property
$this->line=new PropaleLigne($this->db); $line = new PropaleLigne($this->db);
$line->fetch($rowid);
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
$this->line->context = $this->context; $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 // Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) 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) function createFromClone($socid=0)
{ {
global $db, $user,$langs,$conf,$hookmanager; global $db, $user,$langs,$conf,$hookmanager;
dol_include_once('/projet/class.project.class.php'); dol_include_once('/projet/class.project.class.php');
$this->context['createfromclone']='createfromclone'; $this->context['createfromclone']='createfromclone';
$error=0; $error=0;
@ -1089,16 +1089,16 @@ class Propal extends CommonObject
$this->socid = $objsoc->id; $this->socid = $objsoc->id;
$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); $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); $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$project = new Project($db); $project = new Project($db);
if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) { if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) {
if($project->socid <= 0) $this->fk_project = $objFrom->fk_project; if($project->socid <= 0) $this->fk_project = $objFrom->fk_project;
else $this->fk_project = ''; else $this->fk_project = '';
} else { } else {
$this->fk_project = ''; $this->fk_project = '';
} }
$this->fk_delivery_address = ''; $this->fk_delivery_address = '';
} }
@ -3107,10 +3107,12 @@ class PropaleLigne extends CommonObjectLine
$this->date_end = $this->db->jdate($objp->date_end); $this->date_end = $this->db->jdate($objp->date_end);
$this->db->free($result); $this->db->free($result);
return 1;
} }
else 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 '<tr height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>'; print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NbOfProposals").'</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">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>'; print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="center">%</td>';
print '</tr>'; print '</tr>';
$oldyear=0; $oldyear=0;
@ -280,15 +283,21 @@ foreach ($data as $val)
print '<tr height="24">'; 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="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"></td>';
print '<td align="right">0</td>'; print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>'; print '<td align="right">0</td>';
print '<td align="right"></td>';
print '</tr>'; print '</tr>';
} }
print '<tr height="24">'; 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="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">'.$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">'.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">'.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>'; print '</tr>';
$oldyear=$year; $oldyear=$year;
} }

View File

@ -1112,10 +1112,10 @@ class Commande extends CommonOrder
// get extrafields from original line // get extrafields from original line
$object->fetch_optionals($object->id); $object->fetch_optionals($object->id);
$e = new ExtraFields($db); $e = new ExtraFields($db);
$element_extrafields = $e->fetch_name_optionals_label($this->element); $element_extrafields = $e->fetch_name_optionals_label($this->element);
foreach($object->array_options as $options_key => $value) { foreach($object->array_options as $options_key => $value) {
if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){ if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){
$this->array_options[$options_key] = $value; $this->array_options[$options_key] = $value;
@ -2503,16 +2503,16 @@ class Commande extends CommonOrder
$price = ($pu - $remise); $price = ($pu - $remise);
} }
// Update line //Fetch current line from the database and then clone the object and set it in $oldline property
$this->line=new OrderLine($this->db); $line = new OrderLine($this->db);
$line->fetch($rowid);
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
$this->line->context = $this->context; $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 // Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) 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->date_end = $this->db->jdate($objp->date_end);
$this->db->free($result); $this->db->free($result);
return 1;
} }
else 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 '<tr height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>'; print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NbOfOrders").'</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">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>'; print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="center">%</td>';
print '</tr>'; print '</tr>';
$oldyear=0; $oldyear=0;
@ -289,21 +292,27 @@ foreach ($data as $val)
$year = $val['year']; $year = $val['year'];
while (! empty($year) && $oldyear > $year+1) while (! empty($year) && $oldyear > $year+1)
{ // If we have empty year { // If we have empty year
$oldyear--; $oldyear--;
print '<tr height="24">'; 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="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 '<td align="right"></td>';
print '<td align="right">0</td>'; print '<td align="right">0</td>';
print '</tr>'; print '<td align="right"></td>';
print '<td align="right">0</td>';
print '<td align="right"></td>';
print '</tr>';
} }
print '<tr height="24">'; 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="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">'.$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">'.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">'.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>'; print '</tr>';
$oldyear=$year; $oldyear=$year;
} }

View File

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

View File

@ -2345,16 +2345,26 @@ class Facture extends CommonInvoice
$pu_tva = $tabprice[4]; $pu_tva = $tabprice[4];
$pu_ttc = $tabprice[5]; $pu_ttc = $tabprice[5];
// Update line into database // Old properties: $price, $remise (deprecated)
$this->line=new FactureLigne($this->db); $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; $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 // Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) 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->fk_prev_id = $objp->fk_prev_id;
$this->db->free($result); $this->db->free($result);
return 1;
} }
else 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 '<tr height="24">';
print '<td align="center">'.$langs->trans("Year").'</td>'; print '<td align="center">'.$langs->trans("Year").'</td>';
print '<td align="center">'.$langs->trans("NumberOfBills").'</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">'.$langs->trans("AmountTotal").'</td>';
print '<td align="center">%</td>';
print '<td align="center">'.$langs->trans("AmountAverage").'</td>'; print '<td align="center">'.$langs->trans("AmountAverage").'</td>';
print '<td align="center">%</td>';
print '</tr>'; print '</tr>';
$oldyear=0; $oldyear=0;
@ -277,15 +280,21 @@ foreach ($data as $val)
print '<tr height="24">'; 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="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"></td>';
print '<td align="right">0</td>'; print '<td align="right">0</td>';
print '<td align="right"></td>';
print '<td align="right">0</td>'; print '<td align="right">0</td>';
print '<td align="right"></td>';
print '</tr>'; print '</tr>';
} }
print '<tr height="24">'; 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="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">'.$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">'.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">'.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>'; print '</tr>';
$oldyear=$year; $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->phone_mobile, "CELL;VOICE");
$v->setPhoneNumber($contact->fax, "WORK;FAX"); $v->setPhoneNumber($contact->fax, "WORK;FAX");
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL"); $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_id:''), "WORK"); $v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country:''), "WORK");
$v->setEmail($contact->email,'internet,pref'); $v->setEmail($contact->email,'internet,pref');
$v->setNote($contact->note); $v->setNote($contact->note);
@ -78,7 +78,7 @@ if ($company->id)
$v->setURL($company->url, "WORK"); $v->setURL($company->url, "WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE"); if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX"); 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'); if ($company->email != $contact->email) $v->setEmail($company->email,'internet');
// Si contact lie a un tiers non de type "particulier" // Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name); 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'); setEventMessage($object->error,'errors');
} }
} elseif ($action=='setref_supplier') { } elseif ($action=='setref_supplier') {
$cancelbutton = GETPOST('cancel'); $cancelbutton = GETPOST('cancel');
if (!$cancelbutton) { if (!$cancelbutton) {
@ -771,9 +770,8 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
if ($result < 0) { if ($result < 0) {
setEventMessage($object->errors, 'errors'); 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) { if ($result < 0) {
setEventMessage($object->errors, 'errors'); setEventMessage($object->errors, 'errors');
$action = 'editref_supplier'; $action = 'editref_supplier';
@ -794,9 +792,8 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
if ($result < 0) { if ($result < 0) {
setEventMessage($object->errors, 'errors'); setEventMessage($object->errors, 'errors');
} }
$object->ref = GETPOST('ref', 'alpha');
$result = $object->update($user); $result = $object->setValueFrom('ref',GETPOST('ref','alpha'));;
if ($result < 0) { if ($result < 0) {
setEventMessage($object->errors, 'errors'); setEventMessage($object->errors, 'errors');
$action = 'editref'; $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); if ($filterkey && $filterkey != '') $label=preg_replace('/('.preg_quote($filterkey).')/i','<strong>$1</strong>',$label,1);
$opt.=$objp->ref; $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.=' - '; $opt.=' - ';
$outval.=$objRef; $outval.=$objRef;
if (! empty($objp->idprodfournprice)) $outval.=' ('.$objRefFourn.')'; if (! empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn))
$outval.=' ('.$objRefFourn.')';
$outval.=' - '; $outval.=' - ';
$opt.=dol_trunc($label, 72).' - '; $opt.=dol_trunc($label, 72).' - ';
$outval.=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'; 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'; $newmask='0644';
$nowgmt = dol_now(); $nowgmt = dol_now();
@ -150,7 +150,7 @@ abstract class Stats
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; 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'; $newmask='0644';
$nowgmt = dol_now(); $nowgmt = dol_now();
@ -276,7 +276,7 @@ abstract class Stats
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; 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'; $newmask='0644';
$nowgmt = dol_now(); $nowgmt = dol_now();
@ -383,8 +383,11 @@ abstract class Stats
$row = $this->db->fetch_object($resql); $row = $this->db->fetch_object($resql);
$result[$i]['year'] = $row->year; $result[$i]['year'] = $row->year;
$result[$i]['nb'] = $row->nb; $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; $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; $result[$i]['avg'] = $row->avg;
if($i>0) $result[$i-1]['avg_diff'] = ($result[$i-1]['avg'] - $row->avg) / $row->avg * 100;
$i++; $i++;
} }
$this->db->free($resql); $this->db->free($resql);

View File

@ -410,6 +410,7 @@ class DoliDBPgsql extends DoliDB
$this->database_name = $name; $this->database_name = $name;
pg_set_error_verbosity($this->db, PGSQL_ERRORS_VERBOSE); // Set verbosity to max pg_set_error_verbosity($this->db, PGSQL_ERRORS_VERBOSE); // Set verbosity to max
} }
pg_query($this->db, "set datestyle = 'ISO, YMD';");
return $this->db; 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) function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
{ {
global $bc,$user; global $bc,$user,$conf;
// Check parameters // Check parameters
if (! is_object($object)) dol_print_error('','BadParameter'); 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.="\n";
$out.='<table width="100%" class="noborder">'; $out.='<table width="100%" class="noborder">';
$out.='<tr class="liste_titre">'; $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">'; 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"); $out.=$langs->trans("ActionsToDoShort");
if (get_class($object) == 'Societe') $out.='</a>'; if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>'; $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.='</td>';
$out.='</tr>'; $out.='</tr>';
@ -965,7 +975,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$var = !$var; $var = !$var;
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$actionstatic->fetch($obj->id);
$datep=$db->jdate($obj->dp); $datep=$db->jdate($obj->dp);
$datep2=$db->jdate($obj->dp2); $datep2=$db->jdate($obj->dp2);
@ -999,8 +1009,13 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
// Title of event // Title of event
//$out.='<td colspan="2">'.dol_trunc($obj->label,40).'</td>'; //$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 // Contact pour cette action
if (empty($objcon->id) && $obj->fk_contact > 0) 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) function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
{ {
global $bc,$user; global $bc,$user,$conf;
// Check parameters // Check parameters
if (! is_object($object)) dol_print_error('','BadParameter'); 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.="\n";
$out.='<table class="noborder" width="100%">'; $out.='<table class="noborder" width="100%">';
$out.='<tr class="liste_titre">'; $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">'; 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"); $out.=$langs->trans("ActionsDoneShort");
if (get_class($object) == 'Societe') $out.='</a>'; if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>'; $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.='</td>';
$out.='</tr>'; $out.='</tr>';
@ -1215,7 +1240,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
{ {
$var=!$var; $var=!$var;
$out.="<tr ".$bc[$var].">"; $out.="<tr ".$bc[$var].">";
$actionstatic->fetch($histo[$key]['id']);
// Champ date // Champ date
$out.='<td width="120" class="nowrap">'; $out.='<td width="120" class="nowrap">';
$out.=dol_print_date($histo[$key]['datestart'],'dayhour'); $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.=dol_trunc($libelle,120);
} }
$out.='</td>'; $out.='</td>';
if($conf->global->AGENDA_USE_EVENT_TYPE) {
$out.='<td>';
$out.=$actionstatic->type;
$out.='</td>';
}
// Title of event // Title of event
//$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>'; //$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); $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 if (preg_match('/:[^\s]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
$title=$tmparray[0]; $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 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> * 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', 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', 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__); 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', 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', 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__); 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(); $this->db->begin();
//var_dump($this->menu); exit;
foreach ($this->menu as $key => $value) foreach ($this->menu as $key => $value)
{ {
$menu = new Menubase($this->db); $menu = new Menubase($this->db);
@ -1343,11 +1342,9 @@ print $sql;
if (! $this->menu[$key]['fk_menu']) if (! $this->menu[$key]['fk_menu'])
{ {
$menu->fk_menu=0; $menu->fk_menu=0;
//print 'aaa'.$this->menu[$key]['fk_menu'];
} }
else else
{ {
//print 'xxx'.$this->menu[$key]['fk_menu'];exit;
$foundparent=0; $foundparent=0;
$fk_parent=$this->menu[$key]['fk_menu']; $fk_parent=$this->menu[$key]['fk_menu'];
if (preg_match('/^r=/',$fk_parent)) // old deprecated method if (preg_match('/^r=/',$fk_parent)) // old deprecated method

View File

@ -227,7 +227,7 @@ class modAgenda extends DolibarrModules
// Calendar // Calendar
$this->menu[$r]=array('fk_menu'=>'r=1', $this->menu[$r]=array('fk_menu'=>'r=1',
'type'=>'left', 'type'=>'left',
'titre'=>'Calendar', 'titre'=>'Agenda',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda', 'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda',
'langs'=>'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. 'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>200, '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. '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'=>'', 'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++; $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. 'langs'=>'products', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>300, '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. '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'=>'', 'target'=>'',
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both 'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
$r++; $r++;

View File

@ -94,7 +94,7 @@ class modPrinting extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 64001; $this->rights[$r][0] = 64001;
$this->rights[$r][1] = 'Printing'; $this->rights[$r][1] = 'DirectPrint';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
$this->rights[$r][4] = 'read'; $this->rights[$r][4] = 'read';
@ -106,7 +106,7 @@ class modPrinting extends DolibarrModules
// This is to declare the Top Menu entry: // 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 $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 'type'=>'left', // This is a Top menu entry
'titre'=>'Printing', 'titre'=>'MenuDirectPrinting',
'mainmenu'=>'printing', 'mainmenu'=>'printing',
'url'=>'/printing/index.php', 'url'=>'/printing/index.php',
'langs'=>'printing', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. '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->details_entrepot[] = $detail_entrepot;
$line->line_id = $obj->line_id; $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->fk_origin_line = $obj->fk_origin_line;
$line->origin_line_id = $obj->fk_origin_line; // TODO deprecated $line->origin_line_id = $obj->fk_origin_line; // TODO deprecated
$line->fk_product = $obj->fk_product; $line->fk_product = $obj->fk_product;

View File

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

View File

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

View File

@ -703,7 +703,10 @@ class CommandeFournisseur extends CommonOrder
{ {
$sql.= " date_approve='".$this->db->idate($now)."',"; $sql.= " date_approve='".$this->db->idate($now)."',";
$sql.= " fk_user_approve = ".$user->id; $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 else // request a second level approval
{ {

View File

@ -2629,7 +2629,7 @@ elseif (! empty($object->id))
{ {
if ($user->rights->fournisseur->commande->approuver) 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>'; 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) // 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 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 // Refuse

View File

@ -2103,188 +2103,6 @@ else
$num=count($object->lines); $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 // Form to add new line
if ($object->statut == FactureFournisseur::STATUS_DRAFT && $user->rights->fournisseur->facture->creer) if ($object->statut == FactureFournisseur::STATUS_DRAFT && $user->rights->fournisseur->facture->creer)
{ {
@ -2316,135 +2134,137 @@ else
print '<div class="tabsAction">'; print '<div class="tabsAction">';
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook // modified by hook
if (empty($reshook)) { 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)
{ {
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 * Show mail form
*/ */
if (GETPOST('modelselected')) { if (GETPOST('modelselected')) {
$action = 'presend'; $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='CE' WHERE ncc='CEUTA' AND fk_region=407;
UPDATE llx_c_departements SET code_departement='ML' WHERE ncc='MELILLA' AND fk_region=409; 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_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, id integer PRIMARY KEY,
code varchar(6) NOT NULL, 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 type smallint, -- 0: input money, 1: output money, 2: input and output, 3: other
active tinyint DEFAULT 1 NOT NULL, active tinyint DEFAULT 1 NOT NULL,
accountancy_code varchar(32) NULL, accountancy_code varchar(32) NULL,

View File

@ -27,7 +27,7 @@
create table llx_c_type_resource create table llx_c_type_resource
( (
rowid integer PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(32) NOT NULL, code varchar(32) NOT NULL,
label varchar(64) NOT NULL, label varchar(64) NOT NULL,
active tinyint DEFAULT 1 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_approve integer DEFAULT NULL,
fk_user_refuse integer DEFAULT NULL, fk_user_refuse integer DEFAULT NULL,
fk_user_cancel 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_statut integer NOT NULL, -- 1=brouillon, 2=validated (waiting approval), 4=canceled, 5=approved, 6=payed, 99=refused
fk_c_paiement integer DEFAULT NULL, fk_c_paiement integer DEFAULT NULL, -- deprecated
paid smallint default 0 NOT NULL, paid smallint default 0 NOT NULL, -- deprecated
note_public text, note_public text,
note_private text, note_private text,
detail_refuse varchar(255) DEFAULT NULL, detail_refuse varchar(255) DEFAULT NULL,

View File

@ -20,18 +20,18 @@
create table llx_extrafields create table llx_extrafields
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
name varchar(64) NOT NULL, -- nom de l'attribut name varchar(64) NOT NULL, -- name of field into extrafields tables
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
elementtype varchar(64) NOT NULL DEFAULT 'member', elementtype varchar(64) NOT NULL DEFAULT 'member', -- for which element this extra fields is for
tms timestamp, tms timestamp, -- date of last update
label varchar(255) NOT NULL, -- label correspondant a l'attribut label varchar(255) NOT NULL, -- label to show for attribute
type varchar(8), type varchar(8),
size varchar(8) DEFAULT NULL, size varchar(8) DEFAULT NULL,
fieldunique integer DEFAULT 0, fieldunique integer DEFAULT 0,
fieldrequired integer DEFAULT 0, fieldrequired integer DEFAULT 0,
perms varchar(255), perms varchar(255), -- not used yet
pos integer DEFAULT 0, pos integer DEFAULT 0,
alwayseditable integer DEFAULT 0, alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
param text, param text, -- extra parameters to define possible values of field
list integer DEFAULT 0 list integer DEFAULT 0 -- list of values for field that are combo lists
)ENGINE=innodb; )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 TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only 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 MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice MailToSendInvoice=To send customer invoice

View File

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

View File

@ -194,7 +194,7 @@ ReCalculate=Recalculate
Mode1=Method 1 Mode1=Method 1
Mode2=Method 2 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>. 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). 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 CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal 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 ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided 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 # Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -43,4 +43,4 @@ ListOfSupplierOrders=List of supplier orders
MenuOrdersSupplierToBill=Supplier orders to invoice MenuOrdersSupplierToBill=Supplier orders to invoice
NbDaysToDelivery=Delivery delay in days NbDaysToDelivery=Delivery delay in days
DescNbDaysToDelivery=The biggest deliver delay of the products from this order 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 TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only 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 MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice MailToSendInvoice=To send customer invoice

View File

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

View File

@ -194,7 +194,7 @@ ReCalculate=Recalculate
Mode1=Method 1 Mode1=Method 1
Mode2=Method 2 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>. 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). 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 CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal 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 ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided 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 # Warnings
WarningMandatorySetupNotComplete=Задължителни параметри на настройката все още не са определени WarningMandatorySetupNotComplete=Задължителни параметри на настройката все още не са определени

View File

@ -130,7 +130,6 @@ nbJours=Брой дни
TitleAdminCP=Configuration of Leaves TitleAdminCP=Configuration of Leaves
NoticePeriod=Notice period NoticePeriod=Notice period
#Messages #Messages
Hello=Hello
HolidaysToValidate=Validate leave requests HolidaysToValidate=Validate leave requests
HolidaysToValidateBody=Below is a leave request to validate HolidaysToValidateBody=Below is a leave request to validate
HolidaysToValidateDelay=This leave request will take place within a period of less than %s days. 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 се лекува много. WarningBrowserTooOld=Е твърде стара версия на браузъра. Надстроите браузъра си до последната версия на Firefox, Chrome или Opera се лекува много.
PHPVersion=Версия на PHP PHPVersion=Версия на PHP
YouCanContinue=Можете да продължите ... YouCanContinue=Можете да продължите ...
PleaseBePatient=Моля, бъдете търпеливи ...
License=Използването на лиценз License=Използването на лиценз
ConfigurationFile=Конфигурационният файл ConfigurationFile=Конфигурационният файл
WebPagesDirectory=Директорията, в която се съхраняват уеб страници WebPagesDirectory=Директорията, в която се съхраняват уеб страници

View File

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

View File

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

View File

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

View File

@ -43,4 +43,4 @@ ListOfSupplierOrders=Списък на нарежданията за доста
MenuOrdersSupplierToBill=Поръчки на доставчика за фактуриране MenuOrdersSupplierToBill=Поръчки на доставчика за фактуриране
NbDaysToDelivery=Delivery delay in days NbDaysToDelivery=Delivery delay in days
DescNbDaysToDelivery=The biggest deliver delay of the products from this order 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 TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only 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 MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice MailToSendInvoice=To send customer invoice

View File

@ -7,13 +7,13 @@ Customer=Customer
Customers=Customers Customers=Customers
Prospect=Prospect Prospect=Prospect
Prospects=Prospects Prospects=Prospects
DeleteAction=Delete an event/task DeleteAction=Delete an event
NewAction=New event/task NewAction=New event
AddAction=Create event/task AddAction=Create event
AddAnAction=Create an event/task AddAnAction=Create an event
AddActionRendezVous=Create a Rendez-vous event AddActionRendezVous=Create a Rendez-vous event
Rendez-Vous=Rendezvous 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 CardAction=Event card
PercentDone=Percentage complete PercentDone=Percentage complete
ActionOnCompany=Task about company ActionOnCompany=Task about company

View File

@ -194,7 +194,7 @@ ReCalculate=Recalculate
Mode1=Method 1 Mode1=Method 1
Mode2=Method 2 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>. 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). 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 CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal 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 ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided 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 # Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@ -130,7 +130,6 @@ nbJours=Number days
TitleAdminCP=Configuration of Leaves TitleAdminCP=Configuration of Leaves
NoticePeriod=Notice period NoticePeriod=Notice period
#Messages #Messages
Hello=Hello
HolidaysToValidate=Validate leave requests HolidaysToValidate=Validate leave requests
HolidaysToValidateBody=Below is a leave request to validate HolidaysToValidateBody=Below is a leave request to validate
HolidaysToValidateDelay=This leave request will take place within a period of less than %s days. 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. WarningBrowserTooOld=Too old version of browser. Upgrading your browser to a recent version of Firefox, Chrome or Opera is highly recommanded.
PHPVersion=PHP Version PHPVersion=PHP Version
YouCanContinue=You can continue... YouCanContinue=You can continue...
PleaseBePatient=Please be patient...
License=Using license License=Using license
ConfigurationFile=Configuration file ConfigurationFile=Configuration file
WebPagesDirectory=Directory where web pages are stored WebPagesDirectory=Directory where web pages are stored

View File

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

View File

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

View File

@ -12,7 +12,6 @@ Creditor=Creditor
PaymentCode=Payment code PaymentCode=Payment code
PayBoxDoPayment=Go on payment PayBoxDoPayment=Go on payment
YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information
PleaseBePatient=Please, be patient
Continue=Next Continue=Next
ToOfferALinkForOnlinePayment=URL for %s payment ToOfferALinkForOnlinePayment=URL for %s payment
ToOfferALinkForOnlinePaymentOnOrder=URL to offer a %s online payment user interface for a customer order 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 MenuOrdersSupplierToBill=Supplier orders to invoice
NbDaysToDelivery=Delivery delay in days NbDaysToDelivery=Delivery delay in days
DescNbDaysToDelivery=The biggest deliver delay of the products from this order 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 TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only 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 MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice MailToSendInvoice=To send customer invoice

View File

@ -7,13 +7,13 @@ Customer=Customer
Customers=Customers Customers=Customers
Prospect=Prospect Prospect=Prospect
Prospects=Prospects Prospects=Prospects
DeleteAction=Delete an event/task DeleteAction=Delete an event
NewAction=New event/task NewAction=New event
AddAction=Create event/task AddAction=Create event
AddAnAction=Create an event/task AddAnAction=Create an event
AddActionRendezVous=Create a Rendez-vous event AddActionRendezVous=Create a Rendez-vous event
Rendez-Vous=Rendezvous 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 CardAction=Event card
PercentDone=Percentage complete PercentDone=Percentage complete
ActionOnCompany=Task about company ActionOnCompany=Task about company

View File

@ -194,7 +194,7 @@ ReCalculate=Recalculate
Mode1=Method 1 Mode1=Method 1
Mode2=Method 2 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>. 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). 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 CalculationMode=Calculation mode
AccountancyJournal=Accountancy code journal 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 ErrorFieldMustBeANumeric=Field <b>%s</b> must be a numeric value
ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer ErrorFieldMustBeAnInteger=Field <b>%s</b> must be an integer
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided 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 # Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@ -130,7 +130,6 @@ nbJours=Broj dana
TitleAdminCP=Configuration of Leaves TitleAdminCP=Configuration of Leaves
NoticePeriod=Notice period NoticePeriod=Notice period
#Messages #Messages
Hello=Zdravo
HolidaysToValidate=Validate leave requests HolidaysToValidate=Validate leave requests
HolidaysToValidateBody=Below is a leave request to validate HolidaysToValidateBody=Below is a leave request to validate
HolidaysToValidateDelay=This leave request will take place within a period of less than %s days. 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. WarningBrowserTooOld=Too old version of browser. Upgrading your browser to a recent version of Firefox, Chrome or Opera is highly recommanded.
PHPVersion=PHP Version PHPVersion=PHP Version
YouCanContinue=You can continue... YouCanContinue=You can continue...
PleaseBePatient=Please be patient...
License=Using license License=Using license
ConfigurationFile=Configuration file ConfigurationFile=Configuration file
WebPagesDirectory=Directory where web pages are stored WebPagesDirectory=Directory where web pages are stored

View File

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

View File

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

View File

@ -12,7 +12,6 @@ Creditor=Creditor
PaymentCode=Payment code PaymentCode=Payment code
PayBoxDoPayment=Go on payment PayBoxDoPayment=Go on payment
YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information
PleaseBePatient=Please, be patient
Continue=Next Continue=Next
ToOfferALinkForOnlinePayment=URL for %s payment ToOfferALinkForOnlinePayment=URL for %s payment
ToOfferALinkForOnlinePaymentOnOrder=URL to offer a %s online payment user interface for a customer order 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 MenuOrdersSupplierToBill=Supplier orders to invoice
NbDaysToDelivery=Delivery delay in days NbDaysToDelivery=Delivery delay in days
DescNbDaysToDelivery=The biggest deliver delay of the products from this order 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 TemplateForElement=This template record is dedicated to which element
TypeOfTemplate=Type of template TypeOfTemplate=Type of template
TemplateIsVisibleByOwnerOnly=Template is visible by owner only 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 MailToSendProposal=To send customer proposal
MailToSendOrder=To send customer order MailToSendOrder=To send customer order
MailToSendInvoice=To send customer invoice MailToSendInvoice=To send customer invoice

View File

@ -7,13 +7,13 @@ Customer=Client
Customers=Clients Customers=Clients
Prospect=Client potencial Prospect=Client potencial
Prospects=Clients potencials Prospects=Clients potencials
DeleteAction=Eliminar un esdeveniment DeleteAction=Delete an event
NewAction=Nou esdeveniment NewAction=New event
AddAction=Crea un esdeveniment/tasca AddAction=Create event
AddAnAction=Crear un esdeveniment/tasca AddAnAction=Create an event
AddActionRendezVous=Crear una cita AddActionRendezVous=Crear una cita
Rendez-Vous=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 CardAction=Fitxa esdeveniment
PercentDone=Percentatge realitzat PercentDone=Percentatge realitzat
ActionOnCompany=Esdeveniment concernent a l'empresa ActionOnCompany=Esdeveniment concernent a l'empresa

View File

@ -194,7 +194,7 @@ ReCalculate=Recalcular
Mode1=Mètode 1 Mode1=Mètode 1
Mode2=Mètode 2 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>. 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). 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 CalculationMode=Mode de càlcul
AccountancyJournal=Codi comptable diari 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 ErrorFieldMustBeANumeric=El camp <b>%s</b> ha de contenir un valor numèric
ErrorFieldMustBeAnInteger=El camp <b>%s</b> ha de ser un enter ErrorFieldMustBeAnInteger=El camp <b>%s</b> ha de ser un enter
ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided 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 # Warnings
WarningMandatorySetupNotComplete=Els paràmetres obligatoris de configuració no estan encara definits 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 TitleAdminCP=Configuració dels dies lliures retribuïts
NoticePeriod=Notice period NoticePeriod=Notice period
#Messages #Messages
Hello=Hola
HolidaysToValidate=Dies lliures retribuïts a validar HolidaysToValidate=Dies lliures retribuïts a validar
HolidaysToValidateBody=A continuació trobara una sol·licitud de dies lliures retribuïts per 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. 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. WarningBrowserTooOld=El seu navegador és molt antic. Es recomana que actualitzeu a una versió recent de Firefox, Chrome o Opera.
PHPVersion=Versió PHP PHPVersion=Versió PHP
YouCanContinue=Pot continuar ... YouCanContinue=Pot continuar ...
PleaseBePatient=Esperi, si us plau...
License=Llicència d'ús License=Llicència d'ús
ConfigurationFile=Arxiu de configuració ConfigurationFile=Arxiu de configuració
WebPagesDirectory=Carpeta que conté les pàgines web WebPagesDirectory=Carpeta que conté les pàgines web

View File

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

View File

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

View File

@ -12,7 +12,6 @@ Creditor=Beneficiari
PaymentCode=Codi de pagament PaymentCode=Codi de pagament
PayBoxDoPayment=Continua el pagament amb targeta PayBoxDoPayment=Continua el pagament amb targeta
YouWillBeRedirectedOnPayBox=Serà redirigit a la pàgina segura de PayBox per indicar la seva targeta de crèdit YouWillBeRedirectedOnPayBox=Serà redirigit a la pàgina segura de PayBox per indicar la seva targeta de crèdit
PleaseBePatient=Espereu uns segons
Continue=Continuar Continue=Continuar
ToOfferALinkForOnlinePayment=URL de pagament %s 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 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