Merge remote-tracking branch 'origin/3.7' into develop

Conflicts:
	htdocs/accountancy/customer/card.php
	htdocs/accountancy/journal/sellsjournal.php
	htdocs/admin/menus.php
	htdocs/fourn/commande/card.php
	htdocs/install/check.php
This commit is contained in:
Laurent Destailleur 2015-01-30 15:53:06 +01:00
commit 4fdc287717
58 changed files with 497 additions and 319 deletions

View File

@ -376,7 +376,7 @@ $cfg['DefaultConnectionCollation'] = 'utf8_unicode_ci';
// libraries/select_lang.lib.php // libraries/select_lang.lib.php
// $cfg['Lang'] = 'en-iso-8859-1'; // $cfg['Lang'] = 'en-iso-8859-1';
// Regullar expression to limit listed languages, eg. '^(cs|en)' for Czech and // Regular expression to limit listed languages, eg. '^(cs|en)' for Czech and
// English only // English only
$cfg['FilterLanguages'] = ''; $cfg['FilterLanguages'] = '';

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
<?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 <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -44,7 +44,13 @@ $action = GETPOST('action', 'alpha');
// Other parameters ACCOUNTING_* // Other parameters ACCOUNTING_*
$list = array ( $list = array (
'ACCOUNTING_SEPARATORCSV' 'ACCOUNTING_EXPORT_SEPARATORCSV',
'ACCOUNTING_EXPORT_DATE',
'ACCOUNTING_EXPORT_PIECE',
'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT',
'ACCOUNTING_EXPORT_LABEL',
'ACCOUNTING_EXPORT_AMOUNT',
'ACCOUNTING_EXPORT_DEVISE'
); );
/* /*
@ -57,7 +63,7 @@ if ($action == 'update') {
if (! empty($modelcsv)) { if (! empty($modelcsv)) {
if (! dolibarr_set_const($db, 'ACCOUNTING_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
$error ++; $error ++;
} }
} else { } else {
@ -112,12 +118,12 @@ print "<td>" . $langs->trans("Selectmodelcsv") . "</td>";
print "<td>"; print "<td>";
print '<select class="flat" name="modelcsv" id="modelcsv">'; print '<select class="flat" name="modelcsv" id="modelcsv">';
print '<option value="0"'; print '<option value="0"';
if ($conf->global->ACCOUNTING_MODELCSV == 0) { if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 0) {
print ' selected="selected"'; print ' selected="selected"';
} }
print '>' . $langs->trans("Modelcsv_normal") . '</option>'; print '>' . $langs->trans("Modelcsv_normal") . '</option>';
print '<option value="1"'; print '<option value="1"';
if ($conf->global->ACCOUNTING_MODELCSV == 1) { if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) {
print ' selected="selected"'; print ' selected="selected"';
} }
print '>' . $langs->trans("Modelcsv_CEGID") . '</option>'; print '>' . $langs->trans("Modelcsv_CEGID") . '</option>';
@ -128,8 +134,7 @@ print "</table>";
print "<br>\n"; print "<br>\n";
/* /*
* Params * Parameters
*
*/ */
$num = count($list); $num = count($list);
@ -161,4 +166,4 @@ print '<br /><div style="text-align:center"><input type="submit" class="button"
print '</form>'; print '</form>';
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -50,10 +50,10 @@ if ($year == 0) {
/* /*
* View * View
*/ */
llxHeader('', $langs->trans("CustomersVentilation")); llxHeader('', $langs->trans("Bookkeeping"));
$textprevyear = "<a href=\"balancebymonth.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>"; $textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
$textnextyear = " <a href=\"balancebymonth.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>"; $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
print_fiche_titre($langs->trans("AccountBalanceByMonth") . ' ' . $textprevyear . ' ' . $langs->trans("Year") . ' ' . $year_start . ' ' . $textnextyear); print_fiche_titre($langs->trans("AccountBalanceByMonth") . ' ' . $textprevyear . ' ' . $langs->trans("Year") . ' ' . $year_start . ' ' . $textnextyear);

View File

@ -151,7 +151,7 @@ else {
print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey')); print $formventilation->select_bookkeeping_importkey('importkey', GETPOST('importkey'));
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" />'; print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
print '</form>'; print '</form>';
@ -231,4 +231,4 @@ else {
} }
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -56,12 +56,11 @@ $offset = $conf->liste_limit * $page;
llxHeader('', $langs->trans("Bookkeeping")); llxHeader('', $langs->trans("Bookkeeping"));
$textprevyear = "<a href=\"listbyyear.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>"; $textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
$textnextyear = " <a href=\"listbyyear.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>"; $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
/* /*
* Mode Liste * Mode List
*
*/ */
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens, bk.code_journal"; $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens, bk.code_journal";

View File

@ -53,7 +53,6 @@ class AccountingAccount extends CommonObject
* @param DoliDB $db Database handle * @param DoliDB $db Database handle
*/ */
function __construct($db) function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }

View File

@ -128,7 +128,7 @@ class FormVentilation extends Form
$label = $obj->account_number . ' - ' . $obj->label; $label = $obj->account_number . ' - ' . $obj->label;
// Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number // Remember guy's we store in database llx_facturedet the rowid of accountingaccount and not the account_number
// Bacause same account_number can be share between different accounting_system and do have the same meaning // Because same account_number can be share between different accounting_system and do have the same meaning
if (($selectid != '') && $selectid == $obj->rowid) { if (($selectid != '') && $selectid == $obj->rowid) {
// $out .= '<option value="' . $obj->account_number . '" selected="selected">' . $label . '</option>'; // $out .= '<option value="' . $obj->account_number . '" selected="selected">' . $label . '</option>';
$out .= '<option value="' . $obj->rowid . '" selected="selected">' . $label . '</option>'; $out .= '<option value="' . $obj->rowid . '" selected="selected">' . $label . '</option>';

View File

@ -24,7 +24,7 @@
*/ */
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.'/accountancy/class/html.formventilation.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
@ -40,19 +40,18 @@ $id = GETPOST('id');
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
/* /*
* Actions * Actions
*/ */
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
{
if (! GETPOST('cancel', 'alpha')) if (! GETPOST('cancel', 'alpha'))
{ {
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet"; $sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql .= " SET fk_code_ventilation = " . $codeventil; $sql .= " SET fk_code_ventilation = " . $codeventil;
$sql .= " WHERE rowid = " . $id; $sql .= " WHERE rowid = " . $id;
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if (! $resql) { if (! $resql) {
@ -61,7 +60,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch)
} else { } else {
header("Location: ./lines.php"); header("Location: ./lines.php");
exit(); exit();
} }
} }
llxHeader("", "", "FicheVentilation"); llxHeader("", "", "FicheVentilation");
@ -86,38 +85,38 @@ if (! empty($id)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
} }
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG); dol_syslog("/accounting/customer/card.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;
if ($num_lines) { if ($num_lines) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '" method="post">' . "\n"; print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '" method="post">' . "\n";
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="ventil">'; print '<input type="hidden" name="action" value="ventil">';
$linkback='<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php">'.$langs->trans("Back").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php">'.$langs->trans("Back").'</a>';
print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'setup'); print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'setup');
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref facture // Ref facture
print '<tr><td>' . $langs->trans("Invoice") . '</td>'; print '<tr><td>' . $langs->trans("Invoice") . '</td>';
$facture_static->ref = $objp->facnumber; $facture_static->ref = $objp->facnumber;
$facture_static->id = $objp->facid; $facture_static->id = $objp->facid;
print '<td>' . $facture_static->getNomUrl(1) . '</td>'; print '<td>' . $facture_static->getNomUrl(1) . '</td>';
print '</tr>'; print '</tr>';
print '<tr><td width="20%">' . $langs->trans("Line") . '</td>'; print '<tr><td width="20%">' . $langs->trans("Line") . '</td>';
print '<td>' . nl2br($objp->description) . '</td></tr>'; print '<td>' . nl2br($objp->description) . '</td></tr>';
print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>'; print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>';
@ -126,13 +125,13 @@ if (! empty($id)) {
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1); print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '<br><div class="center">'; print '<br><div class="center">';
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">'; print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">'; print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
print '</div>'; print '</div>';
print '</form>'; print '</form>';
} else { } else {
print "Error"; print "Error";
@ -145,4 +144,4 @@ if (! empty($id)) {
} }
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/accountancy/customer/index.php * \file htdocs/accountancy/customer/index.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page accueil clients ventilation comptable * \brief Home customer ventilation
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -75,6 +75,8 @@ if ($action == 'validatehistory') {
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number"; $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0"; $sql1 .= " AND fd.fk_code_ventilation = 0";
} }
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$resql1 = $db->query($sql1); $resql1 = $db->query($sql1);
if (! $resql1) { if (! $resql1) {
@ -93,7 +95,7 @@ if ($action == 'validatehistory') {
llxHeader('', $langs->trans("CustomersVentilation")); llxHeader('', $langs->trans("CustomersVentilation"));
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>'; $textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>'; $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
@ -105,6 +107,7 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f";
$sql .= " WHERE fd.fk_code_ventilation = 0"; $sql .= " WHERE fd.fk_code_ventilation = 0";
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;"; $sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result) {
$row = $db->fetch_row($result); $row = $db->fetch_row($result);
@ -160,6 +163,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " GROUP BY fd.fk_code_ventilation"; $sql .= " GROUP BY fd.fk_code_ventilation";
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$i = 0; $i = 0;
@ -194,7 +198,7 @@ print "</table>\n";
print "<br>\n"; print "<br>\n";
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>'; print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>'; print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>'; print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>'; print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>';
@ -232,6 +236,7 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
} }
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$i = 0; $i = 0;
@ -303,7 +308,8 @@ if (! empty($conf->margin->enabled)) {
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
} }
dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$i = 0; $i = 0;

View File

@ -133,7 +133,7 @@ if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
} }
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
dol_syslog("/accountancy/customer/linges.php sql=" . $sql, LOG_DEBUG); dol_syslog("/accountancy/customer/lines.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);
@ -220,5 +220,5 @@ if ($result) {
print "</table></form>"; print "</table></form>";
$db->close(); llxFooter();
llxFooter(); $db->close();

View File

@ -52,9 +52,25 @@ $formventilation = new FormVentilation($db);
llxHeader('', $langs->trans("Ventilation")); llxHeader('', $langs->trans("Ventilation"));
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 * Action
*/ */
if ($action == 'ventil') { if ($action == 'ventil') {
print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>'; print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
@ -113,8 +129,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_fac
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $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_sell = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = 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)"; $sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
} }
@ -147,7 +163,7 @@ if ($result) {
print '<td align="right">' . $langs->trans("Amount") . '</td>'; print '<td align="right">' . $langs->trans("Amount") . '</td>';
print '<td align="right">' . $langs->trans("AccountAccounting") . '</td>'; print '<td align="right">' . $langs->trans("AccountAccounting") . '</td>';
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>'; print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
print '<td align="center">' . $langs->trans("Ventilate") . '</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 '</tr>'; print '</tr>';
$facture_static = new Facture($db); $facture_static = new Facture($db);

View File

@ -450,14 +450,14 @@ if ($action == 'writeBookKeeping')
// export csv // export csv
if ($action == 'export_csv') if ($action == 'export_csv')
{ {
$sep = $conf->global->ACCOUNTING_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_banque.csv'); header('Content-Disposition: attachment;filename=journal_banque.csv');
$companystatic = new Client($db); $companystatic = new Client($db);
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{ {
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');

View File

@ -367,12 +367,12 @@ if ($action == 'writeBookKeeping')
} }
// export csv // export csv
if ($action == 'export_csv') { if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition:attachment;filename=journal_caisse.csv'); header('Content-Disposition:attachment;filename=journal_caisse.csv');
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{ {
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');

View File

@ -185,8 +185,8 @@ if ($action == 'writebookkeeping') {
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
// get compte id and label // get compte id and label
$compte = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
if ($compte->fetch(null, $k)) { if ($accountingaccount->fetch(null, $k)) {
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"]; $bookkeeping->doc_ref = $val["ref"];
@ -195,7 +195,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_doc = $key; $bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_facturefourndet"]; $bookkeeping->fk_docdet = $val["fk_facturefourndet"];
$bookkeeping->code_tiers = ''; $bookkeeping->code_tiers = '';
$bookkeeping->label_compte = dol_trunc($val["description"], 128); $bookkeeping->label_compte = $accountingaccount->label;
$bookkeeping->numero_compte = $k; $bookkeeping->numero_compte = $k;
$bookkeeping->montant = $mt; $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
@ -213,7 +213,6 @@ if ($action == 'writebookkeeping') {
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
// get compte id and label // get compte id and label
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"]; $bookkeeping->doc_ref = $val["ref"];
@ -246,12 +245,12 @@ $companystatic = new Fournisseur($db);
// export csv // export csv
if ($action == 'export_csv') if ($action == 'export_csv')
{ {
$sep = $conf->global->ACCOUNTING_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_achats.csv'); header('Content-Disposition: attachment;filename=journal_achats.csv');
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{ {
foreach ( $tabfac as $key => $val ) { foreach ( $tabfac as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
@ -314,11 +313,13 @@ if ($action == 'export_csv')
// Product / Service // Product / Service
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) { if ($mt) {
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep; print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . dol_trunc($val["description"], 32) . '"' . $sep; print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n"; print "\n";
@ -417,12 +418,15 @@ if ($action == 'export_csv')
// Product / Service // Product / Service
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) { if ($mt) {
print "<tr " . $bc[$var] . " >"; print "<tr " . $bc[$var] . " >";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
print "<td>" . length_accountg($k) . "</td>"; print "<td>" . length_accountg($k) . "</td>";
print "<td>" . $invoicestatic->description . "</td>"; print "<td>" . $accountingaccount->label . "</td>";
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>"; print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
print '<td align="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>"; print '<td align="right">' . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "</tr>"; print "</tr>";

View File

@ -151,7 +151,7 @@ if ($result) {
$tabfac[$obj->rowid]["date"] = $obj->df; $tabfac[$obj->rowid]["date"] = $obj->df;
$tabfac[$obj->rowid]["ref"] = $obj->facnumber; $tabfac[$obj->rowid]["ref"] = $obj->facnumber;
$tabfac[$obj->rowid]["type"] = $obj->type; $tabfac[$obj->rowid]["type"] = $obj->type;
$tabfac[$obj->rowid]["description"] = $obj->description; $tabfac[$obj->rowid]["description"] = $obj->label_compte;
$tabfac[$obj->rowid]["fk_facturedet"] = $obj->fdid; $tabfac[$obj->rowid]["fk_facturedet"] = $obj->fdid;
if (! isset($tabttc[$obj->rowid][$compta_soc])) if (! isset($tabttc[$obj->rowid][$compta_soc]))
$tabttc[$obj->rowid][$compta_soc] = 0; $tabttc[$obj->rowid][$compta_soc] = 0;
@ -207,8 +207,8 @@ if ($action == 'writebookkeeping') {
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
// get compte id and label // get compte id and label
$compte = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
if ($compte->fetch(null, $k)) { if ($accountingaccount->fetch(null, $k)) {
$bookkeeping = new BookKeeping($db); $bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"]; $bookkeeping->doc_date = $val["date"];
$bookkeeping->doc_ref = $val["ref"]; $bookkeeping->doc_ref = $val["ref"];
@ -218,7 +218,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->fk_docdet = $val["fk_facturedet"]; $bookkeeping->fk_docdet = $val["fk_facturedet"];
$bookkeeping->code_tiers = ''; $bookkeeping->code_tiers = '';
$bookkeeping->numero_compte = $k; $bookkeeping->numero_compte = $k;
$bookkeeping->label_compte = dol_trunc($val["description"], 128); $bookkeeping->label_compte = $accountingaccount->label;
$bookkeeping->montant = $mt; $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->debit = ($mt < 0) ? $mt : 0;
@ -258,14 +258,14 @@ if ($action == 'writebookkeeping') {
} }
// export csv // export csv
if ($action == 'export_csv') { if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_ventes.csv'); header('Content-Disposition: attachment;filename=journal_ventes.csv');
$companystatic = new Client($db); $companystatic = new Client($db);
if ($conf->global->ACCOUNTING_MODELCSV == 1) // Modèle Export Cegid Expert if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert
{ {
foreach ( $tabfac as $key => $val ) { foreach ( $tabfac as $key => $val ) {
$companystatic->id = $tabcompany[$key]['id']; $companystatic->id = $tabcompany[$key]['id'];
@ -335,11 +335,14 @@ if ($action == 'export_csv') {
// Product / Service // Product / Service
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) { if ($mt) {
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep; print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . dol_trunc($val["description"], 32) . '"' . $sep; print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'; print '"' . ($mt >= 0 ? price($mt) : '') . '"';
print "\n"; print "\n";
@ -447,12 +450,15 @@ if ($action == 'export_csv') {
// Product / Service // Product / Service
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k);
if ($mt) { if ($mt) {
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>"; print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
print "<td>" . length_accountg($k) . "</td>"; print "<td>" . length_accountg($k) . "</td>";
print "<td>" . $invoicestatic->description . "</td>"; print "<td>" . $accountingaccount->label . "</td>";
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>"; print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>"; print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
print "</tr>"; print "</tr>";
@ -478,8 +484,8 @@ if ($action == 'export_csv') {
} }
print "</table>"; print "</table>";
// End of page
llxFooter();
} }
llxFooter();
$db->close(); $db->close();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent s<jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* 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

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/supplier/index.php * \file htdocs/accountancy/supplier/index.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page accueil ventilation * \brief Home supplier ventilation
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -93,9 +93,9 @@ if ($action == 'validatehistory') {
llxHeader('', $langs->trans("SuppliersVentilation")); llxHeader('', $langs->trans("SuppliersVentilation"));
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>'; $textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>'; $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); print_fiche_titre($langs->trans("SuppliersVentilation") . "&nbsp;" . $textprevyear . "&nbsp;" . $langs->trans("Year") . "&nbsp;" . $year_start . "&nbsp;" . $textnextyear);
print '<b>' . $langs->trans("DescVentilSupplier") . '</b>'; print '<b>' . $langs->trans("DescVentilSupplier") . '</b>';
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=validatehistory">' . $langs->trans("ValidateHistory") . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=validatehistory">' . $langs->trans("ValidateHistory") . '</a></div>';
@ -105,7 +105,7 @@ $y = $year_current;
$var = true; $var = true;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>'; print '<tr class="liste_titre"><td width="200" align="left">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>'; print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>'; print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>'; print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';

View File

@ -1,7 +1,5 @@
<?php <?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
@ -48,6 +46,7 @@ if ($user->societe_id > 0)
if (! $user->rights->accounting->ventilation->dispatch) if (! $user->rights->accounting->ventilation->dispatch)
accessforbidden(); accessforbidden();
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);
$changeaccount = GETPOST('changeaccount'); $changeaccount = GETPOST('changeaccount');
@ -107,7 +106,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product
$sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 "; $sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
$sql .= " AND aa.rowid = l.fk_code_ventilation"; $sql .= " AND aa.rowid = l.fk_code_ventilation";
if (strlen(trim($_GET["search_facture"]))) { if (strlen(trim($_GET["search_facture"]))) {
$sql .= " AND f.facnumber like '%" . $_GET["search_facture"] . "%'"; $sql .= " AND f.ref like '%" . $_GET["search_facture"] . "%'";
} }
if (strlen(trim($_GET["search_ref"]))) { if (strlen(trim($_GET["search_ref"]))) {
$sql .= " AND p.ref like '%" . $_GET["search_ref"] . "%'"; $sql .= " AND p.ref like '%" . $_GET["search_ref"] . "%'";
@ -218,7 +217,8 @@ if ($result) {
print $db->error(); print $db->error();
} }
print "</table></form>"; print "</table></form>";
$db->close(); llxFooter();
llxFooter(); $db->close();

View File

@ -22,7 +22,7 @@
/** /**
* \file htdocs/accountancy/supplier/list.php * \file htdocs/accountancy/supplier/list.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Page de ventilation des lignes de facture * \brief Ventilation page from suppliers invoices
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -53,6 +53,22 @@ $formventilation = new FormVentilation($db);
llxHeader('', $langs->trans("Ventilation")); llxHeader('', $langs->trans("Ventilation"));
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 * Action
*/ */
@ -115,8 +131,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $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)"; $sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
@ -150,7 +166,7 @@ if ($result) {
print '<td align="right">' . $langs->trans("Amount") . '</td>'; print '<td align="right">' . $langs->trans("Amount") . '</td>';
print '<td align="right">' . $langs->trans("Compte") . '</td>'; print '<td align="right">' . $langs->trans("Compte") . '</td>';
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>'; print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
print '<td align="center">' . $langs->trans("Ventilate") . '</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 "</tr>\n"; print "</tr>\n";
$facturefourn_static = new FactureFournisseur($db); $facturefourn_static = new FactureFournisseur($db);
@ -161,6 +177,23 @@ if ($result) {
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;
// product_type: 0 = service ? 1 = product
// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
$code_buy_notset = '';
if (empty($objp->code_buy)) {
$code_buy_notset = 'color:red';
if ($objp->type == 1) {
$objp->code_buy = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT) ? $conf->global->COMPTA_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
} else {
$objp->code_buy = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT) ? $conf->global->COMPTA_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
}
}else {
$code_buy_notset = 'color:blue';
}
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
// Ref facture // Ref facture
@ -191,7 +224,7 @@ if ($result) {
print price($objp->price); print price($objp->price);
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="center" style="' . $code_buy_notset . '">';
print $objp->code_buy; print $objp->code_buy;
print '</td>'; print '</td>';
@ -216,4 +249,4 @@ if ($result) {
} }
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -65,7 +65,7 @@ error_reporting($err);
if ($action == 'update' && empty($_POST["cancel"])) if ($action == 'update' && empty($_POST["cancel"]))
{ {
$_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer $_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer
dolibarr_set_const($db, "MAIN_MENU_STANDARD", $_POST["MAIN_MENU_STANDARD"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENU_STANDARD", $_POST["MAIN_MENU_STANDARD"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", $_POST["MAIN_MENU_SMARTPHONE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", $_POST["MAIN_MENU_SMARTPHONE"],'chaine',0,'',$conf->entity);
@ -89,11 +89,11 @@ if ($action == 'update' && empty($_POST["cancel"]))
$file='init_menu_'.$key.'.sql'; $file='init_menu_'.$key.'.sql';
$fullpath=dol_buildpath($dirmenu.$file); $fullpath=dol_buildpath($dirmenu.$file);
//print 'action='.$action.' Search menu into fullpath='.$fullpath.'<br>';exit; //print 'action='.$action.' Search menu into fullpath='.$fullpath.'<br>';exit;
if (file_exists($fullpath)) if (file_exists($fullpath))
{ {
$db->begin(); $db->begin();
$result=run_sql($fullpath,1,'',1,$key,'none'); $result=run_sql($fullpath,1,'',1,$key,'none');
if ($result > 0) if ($result > 0)
{ {
@ -152,6 +152,10 @@ $head[$h][2] = 'misc';
$h++; $h++;
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
dol_fiche_head($head, 'handler', $langs->trans("Menus")); dol_fiche_head($head, 'handler', $langs->trans("Menus"));
print $langs->trans("MenusDesc")."<br>\n"; print $langs->trans("MenusDesc")."<br>\n";
@ -160,10 +164,6 @@ print "<br>\n";
if ($action == 'edit') if ($action == 'edit')
{ {
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
clearstatcache(); clearstatcache();
// Gestionnaires de menu // Gestionnaires de menu
@ -202,14 +202,6 @@ if ($action == 'edit')
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
} }
else else
{ {
@ -264,7 +256,21 @@ else
print '</table>'; print '</table>';
} }
print '</div>'; dol_fiche_end();
if ($action == 'edit')
{
print '<div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
}
print '</form>';
if ($action != 'edit') if ($action != 'edit')
{ {

View File

@ -14,7 +14,6 @@ support/index.php
support/online.php support/online.php
support/default.css support/default.css
support/dolibarr_logo2.png
support/headbg.jpg support/headbg.jpg
support/helpcenter.png support/helpcenter.png
support/internet.png support/internet.png

View File

@ -289,7 +289,8 @@ if ($socid)
if ($soc->country) if ($soc->country)
{ {
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
$img=picto_from_langcode($soc->country_code); //$img=picto_from_langcode($soc->country_code);
$img='';
print ($img?$img.' ':''); print ($img?$img.' ':'');
print $soc->country; print $soc->country;
print '</td></tr>'; print '</td></tr>';

View File

@ -881,15 +881,15 @@ if ($id > 0)
// Date start // Date start
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">'; print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">';
if (GETPOST("afaire") == 1) $form->select_date($object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart'); if (GETPOST("afaire") == 1) $form->select_date($datep?$datep:$object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
else if (GETPOST("afaire") == 2) $form->select_date($object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); else if (GETPOST("afaire") == 2) $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
else $form->select_date($object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); else $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
print '</td></tr>'; print '</td></tr>';
// Date end // Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
if (GETPOST("afaire") == 1) $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); if (GETPOST("afaire") == 1) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else if (GETPOST("afaire") == 2) $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); else if (GETPOST("afaire") == 2) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else $form->select_date($object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
print '</td></tr>'; print '</td></tr>';
// Status // Status

View File

@ -339,7 +339,7 @@ dol_fiche_end();
$showextcals=$listofextcals; $showextcals=$listofextcals;
// Legend // Legend
if ($conf->use_javascript_ajax) if (! empty($conf->use_javascript_ajax))
{ {
$s=''; $s='';
$s.='<script type="text/javascript">' . "\n"; $s.='<script type="text/javascript">' . "\n";
@ -349,29 +349,27 @@ if ($conf->use_javascript_ajax)
$s.='jQuery(".family_birthday").toggle();' . "\n"; $s.='jQuery(".family_birthday").toggle();' . "\n";
if ($action=="show_week" || $action=="show_month" || empty($action)) if ($action=="show_week" || $action=="show_month" || empty($action))
{ {
$s.='jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {'; $s.='jQuery( "td.sortable" ).sortable({connectWith: ".sortable", placeholder: "ui-state-highlight", items: "div.movable", receive: function( event, ui ) {';
$s.='var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n"; $s.='var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n";
} }
$s.='});' . "\n"; $s.='});' . "\n";
$s.='</script>' . "\n"; $s.='</script>' . "\n";
if (! empty($conf->use_javascript_ajax))
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda").' &nbsp; </div>';
if (is_array($showextcals) && count($showextcals) > 0)
{ {
$s.='<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda").' &nbsp; </div>'; foreach ($showextcals as $val)
if (is_array($showextcals) && count($showextcals) > 0)
{ {
foreach ($showextcals as $val) $htmlname = dol_string_nospecial($val['name']);
{ $s.='<script type="text/javascript">' . "\n";
$htmlname = dol_string_nospecial($val['name']); $s.='jQuery(document).ready(function () {' . "\n";
$s.='<script type="text/javascript">' . "\n"; $s.=' jQuery("#check_' . $htmlname . '").click(function() {';
$s.='jQuery(document).ready(function () {' . "\n"; $s.=' /* alert("'.$htmlname.'"); */';
$s.=' jQuery("#check_' . $htmlname . '").click(function() {'; $s.=' jQuery(".family_' . $htmlname . '").toggle();';
$s.=' /* alert("'.$htmlname.'"); */'; $s.=' });' . "\n";
$s.=' jQuery(".family_' . $htmlname . '").toggle();'; $s.='});' . "\n";
$s.=' });' . "\n"; $s.='</script>' . "\n";
$s.='});' . "\n"; $s.='<div class="nowrap float"><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . ' &nbsp; </div>';
$s.='</script>' . "\n";
$s.='<div class="nowrap float"><input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'] . ' &nbsp; </div>';
}
} }
} }
$s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' &nbsp; </div>'; $s.='<div class="nowrap float"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' &nbsp; </div>';
@ -1092,11 +1090,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
global $theme_datacolor; global $theme_datacolor;
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused; global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n"; print "\n".'<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">';
// Line with title of day // Line with title of day
$curtime = dol_mktime(0, 0, 0, $month, $day, $year); $curtime = dol_mktime(0, 0, 0, $month, $day, $year);
print '<table class="nobordernopadding" width="100%">'; print '<table class="nobordernopadding" width="100%">'."\n";
print '<tr><td align="left" class="nowrap">'; print '<tr><td align="left" class="nowrap">';
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?'; print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?';
print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
@ -1116,7 +1115,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print img_picto($langs->trans("NewAction"),'edit_add.png'); print img_picto($langs->trans("NewAction"),'edit_add.png');
print '</a>'; print '</a>';
} }
print '</td></tr>'; print '</td></tr>'."\n";
// Line with td contains all div of each events // Line with td contains all div of each events
print '<tr height="'.$minheight.'"><td valign="top" colspan="2" class="sortable" style="padding-bottom: 2px;">'; print '<tr height="'.$minheight.'"><td valign="top" colspan="2" class="sortable" style="padding-bottom: 2px;">';
@ -1171,11 +1170,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$numicals[dol_string_nospecial($event->icalname)]++; $numicals[dol_string_nospecial($event->icalname)]++;
} }
$color=$event->icalcolor; $color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unmovable');
} }
else if ($event->type_code == 'BIRTHDAY') else if ($event->type_code == 'BIRTHDAY')
{ {
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); $numbirthday++; $colorindex=2; $cssclass='family_birthday unmovable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
} }
else else
{ {
@ -1213,32 +1212,35 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; $cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
// Defined style to disable drag and drop feature // Defined style to disable drag and drop feature
if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar)) if ($event->type_code =='AC_OTH_AUTO')
{
$cssclass.= " unmovable";
}
else if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
{ {
$tmpyearend = date('Y',$event->date_end_in_calendar); $tmpyearend = date('Y',$event->date_end_in_calendar);
$tmpmonthend = date('m',$event->date_end_in_calendar); $tmpmonthend = date('m',$event->date_end_in_calendar);
$tmpdayend = date('d',$event->date_end_in_calendar); $tmpdayend = date('d',$event->date_end_in_calendar);
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
{ {
$cssclass.= " unsortable"; $cssclass.= " unmovable";
} }
} }
if ($event->type_code =='AC_OTH_AUTO') else $cssclass.= " movable";
{
$cssclass.= " unsortable";
}
$h=''; $nowrapontd=1; $h=''; $nowrapontd=1;
if ($action == 'show_day') { $h='height: 100%; '; $nowrapontd=0; } if ($action == 'show_day') { $h='height: 100%; '; $nowrapontd=0; }
if ($action == 'show_week') { $h='height: 100%; '; $nowrapontd=0; } if ($action == 'show_week') { $h='height: 100%; '; $nowrapontd=0; }
// Show rect of event // Show rect of event
print '<div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'"'; print "\n";
print '<!-- start event '.$i.' --><div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'"';
//print ' style="height: 100px;'; //print ' style="height: 100px;';
//print ' position: absolute; top: 40px; width: 50%;'; //print ' position: absolute; top: 40px; width: 50%;';
//print '"'; //print '"';
print '>'; print '>';
print '<ul class="cal_event" style="'.$h.'"><li class="cal_event" style="'.$h.'">'; print '<ul class="cal_event" style="'.$h.'">'; // always 1 li per ul, 1 ul per event
print '<li class="cal_event" style="'.$h.'">';
print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h; print '<table class="cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h;
print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; //if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
@ -1369,8 +1371,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1); if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1);
else print '&nbsp;'; else print '&nbsp;';
print '</td></tr></table>'; print '</td></tr></table>';
print '</li></ul>'; print '</li>';
print '</div>'; print '</ul>';
print '</div><!-- end event '.$i.' -->'."\n";
$i++; $i++;
} }
else else
@ -1413,8 +1416,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '</div>'; print '</div>';
print '</td></tr>'; print '</td></tr>';
print '</table>';
print '</div>'."\n"; print '</table></div>'."\n";
} }

View File

@ -265,7 +265,8 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
if (! empty($object->country_code)) if (! empty($object->country_code))
{ {
$img=picto_from_langcode($object->country_code); //$img=picto_from_langcode($object->country_code);
$img='';
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country; else print ($img?$img.' ':'').$object->country;
} }

View File

@ -51,7 +51,7 @@ class FormProjets
* @param int $maxlength Maximum length of label * @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag * @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line * @param int $show_empty Add an empty line
* @param int $discard_closed Discard closed projects * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @return int Nber of project if OK, <0 if KO * @return int Nber of project if OK, <0 if KO
*/ */
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0) function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0)
@ -105,7 +105,7 @@ class FormProjets
} }
else else
{ {
if ($discard_closed && $obj->fk_statut == 2) if ($discard_closed == 1 && $obj->fk_statut == 2)
{ {
$i++; $i++;
continue; continue;
@ -114,30 +114,31 @@ class FormProjets
$labeltoshow=dol_trunc($obj->ref,18); $labeltoshow=dol_trunc($obj->ref,18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')';
$labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
$disabled=0;
if ($obj->fk_statut == 0)
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("Draft");
}
else if ($obj->fk_statut == 2)
{
if ($discard_close == 2) $disabled=1;
$labeltoshow.=' - '.$langs->trans("Closed");
}
else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
}
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0) if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0)
{ {
$out.= '<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.' '.dol_trunc($obj->title,$maxlength).'</option>'; $out.= '<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
} }
else else
{ {
$disabled=0;
$labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
if ($obj->fk_statut == 0)
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("Draft");
}
else if ($obj->fk_statut == 2)
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("Closed");
}
else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
}
if ($hideunselectables && $disabled) if ($hideunselectables && $disabled)
{ {
$resultat=''; $resultat='';

View File

@ -114,7 +114,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<td class="nowrap">'; print '<td class="nowrap">';
print $langs->trans("Project").' &nbsp; '; print $langs->trans("Project").' &nbsp; ';
print '</td><td class="nowrap maxwidthonsmartphone">'; print '</td><td class="nowrap maxwidthonsmartphone">';
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 64); $formproject->select_projects($socid?$socid:-1, $pid, 'projectid');
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -488,13 +488,15 @@ function dolEscapeXML($string)
* *
* @param string $stringtoescape String to escape * @param string $stringtoescape String to escape
* @param string $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \ * @param string $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
* @param string $noescapebackslashn 0=Escape also \n. 1=Do not escape \n.
* @return string Escaped string. Both ' and " are escaped into ' if they are escaped. * @return string Escaped string. Both ' and " are escaped into ' if they are escaped.
*/ */
function dol_escape_js($stringtoescape, $mode=0) function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
{ {
// escape quotes and backslashes, newlines, etc. // escape quotes and backslashes, newlines, etc.
$substitjs=array("&#039;"=>"\\'",'\\'=>'\\\\',"\r"=>'\\r',"\n"=>'\\n'); $substitjs=array("&#039;"=>"\\'","\r"=>'\\r');
//$substitjs['</']='<\/'; // We removed this. Should be useless. //$substitjs['</']='<\/'; // We removed this. Should be useless.
if (empty($noescapebackslashn)) { $substitjs["\n"]='\\n'; $substitjs['\\']='\\\\'; }
if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; } if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; }
else if ($mode == 1) $substitjs["'"]="\\'"; else if ($mode == 1) $substitjs["'"]="\\'";
else if ($mode == 2) { $substitjs['"']='\\"'; } else if ($mode == 2) { $substitjs['"']='\\"'; }
@ -1119,7 +1121,7 @@ function dol_getdate($timestamp,$fast=false)
* @param int $year Year * @param int $year Year
* @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ * @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ
* @param int $check 0=No check on parameters (Can use day 32, etc...) * @param int $check 0=No check on parameters (Can use day 32, etc...)
* @return timestamp|string Date as a timestamp, '' if error * @return timestamp|string Date as a timestamp, '' or false if error
* @see dol_print_date, dol_stringtotime, dol_getdate * @see dol_print_date, dol_stringtotime, dol_getdate
*/ */
function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
@ -3389,7 +3391,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
$sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'";
$sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC"; $sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC";
$sql.= $db->plimit(1); $sql.= $db->plimit(1);
print $sql;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
@ -3515,7 +3517,7 @@ function get_default_tva($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
// we use the buyer VAT. // we use the buyer VAT.
if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC))
{ {
if (! $seller_in_cee && $buyer_in_cee && ! $thirdparty_buyer->isACompany()) if ($seller_in_cee && $buyer_in_cee && ! $thirdparty_buyer->isACompany())
{ {
//print 'VATRULE 0'; //print 'VATRULE 0';
return get_product_vat_for_country($idprod,$thirdparty_buyer,$idprodfournprice); return get_product_vat_for_country($idprod,$thirdparty_buyer,$idprodfournprice);

View File

@ -64,8 +64,12 @@ function shipping_prepare_head($object)
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
$nbNote = 0;
if (!empty($object->note_private)) $nbNote++;
if (!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id; $head[$h][0] = DOL_URL_ROOT."/expedition/note.php?id=".$object->id;
$head[$h][1] = $langs->trans("Notes"); $head[$h][1] = $langs->trans("Notes");
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$h][2] = 'note'; $head[$h][2] = 'note';
$h++; $h++;

View File

@ -11,7 +11,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&amp;leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', 1__+MAX_llx_menu__, __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&amp;leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&amp;leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('societe|fournisseur', '( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)', 2__+MAX_llx_menu__, __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&amp;leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&amp;leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&amp;leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&amp;leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->fournisseur->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&amp;leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax|salaries', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read', '', 2, 50, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax|salaries', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read', '', 2, 50, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__);
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
@ -53,8 +53,10 @@ 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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 309__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 309__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 310__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 310__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/support/index.php?leftmenu=admintools', 'HelpCenter', 1, 'help', '', '_blank', 2, 13, __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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __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 ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 311__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/about.php?leftmenu=admintools', 'About', 1, 'admin', '', '', 2, 14, __ENTITY__);
-- Home - Module Tools
-- Added by ???
-- Home - Menu users and groups -- Home - Menu users and groups
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 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 ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/index.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?leftmenu=users&amp;action=create', 'NewUser', 2, 'users', '$user->rights->user->user->creer || $user->admin', '', 2, 0, __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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?leftmenu=users&amp;action=create', 'NewUser', 2, 'users', '$user->rights->user->user->creer || $user->admin', '', 2, 0, __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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 403__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/index.php?leftmenu=users', 'Groups', 1, 'users', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin', '', 2, 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 ('', '$leftmenu=="users"', __HANDLER__, 'left', 403__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/index.php?leftmenu=users', 'Groups', 1, 'users', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin', '', 2, 1, __ENTITY__);

View File

@ -149,7 +149,7 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
if ($showmode == 1) if ($showmode == 1)
{ {
print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>';
print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>';
print '</a>'; print '</a>';
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>';
print '<span class="mainmenuaspan">'; print '<span class="mainmenuaspan">';
@ -273,7 +273,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
else dol_print_error($db); else dol_print_error($db);
$db->free($resql); $db->free($resql);
} }
if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account
{ {
$newmenu->add('/accountancy/journal/index.php?leftmenu=journal',$langs->trans("Journaux"),0,$user->rights->banque->lire); $newmenu->add('/accountancy/journal/index.php?leftmenu=journal',$langs->trans("Journaux"),0,$user->rights->banque->lire);

View File

@ -557,13 +557,18 @@ class pdf_merou extends ModelePdfExpedition
// Date Expedition // Date Expedition
$Yoff = $Yoff+7; $Yoff = $Yoff+7;
$pdf->SetXY($blSocX-80,$blSocY+20); $pdf->SetXY($blSocX-80,$blSocY+17);
$pdf->SetFont('','B', $default_font_size - 2); $pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L'); $pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');
$pdf->SetXY($blSocX-80,$blSocY+20);
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, '', 'L');
// Deliverer // Deliverer
$pdf->SetXY($blSocX-80,$blSocY+23); $pdf->SetXY($blSocX-80,$blSocY+24);
$pdf->SetFont('','', $default_font_size - 2); $pdf->SetFont('','', $default_font_size - 2);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
@ -577,13 +582,8 @@ class pdf_merou extends ModelePdfExpedition
// Get code using getLabelFromKey // Get code using getLabelFromKey
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); $code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
$label=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; $label=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
$pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
} }
else
{
$label=$outputlangs->transnoentities("Deliverer");
}
$pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
} }
} }
else else

View File

@ -191,11 +191,17 @@ class pdf_rouget extends ModelePdfExpedition
$tab_height = 130; $tab_height = 130;
$tab_height_newpage = 150; $tab_height_newpage = 150;
if (! empty($object->note_public) || (! empty($object->tracking_number) && ! empty($object->shipping_method_id))) if (! empty($object->note_public) || ! empty($object->tracking_number))
{ {
$tab_top = 88; $tab_top = 88;
$tab_top_alt = $tab_top; $tab_top_alt = $tab_top;
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top-1, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, 0, 1, false, true, 'L');
$tab_top_alt = $pdf->GetY();
//$tab_top_alt += 1;
// Tracking number // Tracking number
if (! empty($object->tracking_number)) if (! empty($object->tracking_number))
{ {
@ -209,14 +215,14 @@ class pdf_rouget extends ModelePdfExpedition
$label=$outputlangs->trans("LinkToTrackYourPackage")."<br>"; $label=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; $label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
$pdf->SetFont('','B', $default_font_size - 2); $pdf->SetFont('','B', $default_font_size - 2);
$pdf->writeHTMLCell(60, 7, $this->posxdesc-1, $tab_top-1, $label." ".$object->tracking_url, 0, 1, false, true, 'L'); $pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top+6, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
$tab_top_alt += 7; $tab_top_alt = $pdf->GetY();
} }
} }
} }
// Affiche notes // Notes
if (! empty($object->note_public)) if (! empty($object->note_public))
{ {
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page $pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page

View File

@ -1,6 +1,6 @@
<?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 <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* *
@ -19,14 +19,14 @@
*/ */
/** /**
* \file accountingex/core/modules/modAccounting.class.php * \file htdocs/core/modules/modAccounting.class.php
* \ingroup Accounting Expert * \ingroup Accounting Expert
* \brief Module to activate Accounting Expert module * \brief Module to activate Accounting Expert module
*/ */
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** /**
* \class modAccountingExpert * \class modAccounting
* \brief Description and activation class for module accounting expert * \brief Description and activation class for module accounting expert
*/ */
class modAccounting extends DolibarrModules class modAccounting extends DolibarrModules
@ -68,7 +68,7 @@ class modAccounting extends DolibarrModules
$this->depends = array("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled $this->depends = array("modFacture","modBanque","modTax"); // List of modules id that must be enabled if this module is enabled
$this->requiredby = array(); // List of modules id to disable if this one is disabled $this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module $this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module
$this->phpmin = array(5, 2); // Minimum version of PHP required by module $this->phpmin = array(5, 3); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3, 6); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(3, 6); // Minimum version of Dolibarr required by module
$this->langfiles = array("accountancy"); $this->langfiles = array("accountancy");
@ -87,7 +87,7 @@ class modAccounting extends DolibarrModules
"With this constants on, bank account number is always required" "With this constants on, bank account number is always required"
); );
$this->const[1] = array( $this->const[1] = array(
"ACCOUNTING_SEPARATORCSV", "ACCOUNTING_EXPORT_SEPARATORCSV",
"string", "string",
"," ","
); );
@ -112,60 +112,85 @@ class modAccounting extends DolibarrModules
"SOC" "SOC"
); );
$this->const[6] = array( $this->const[6] = array(
"ACCOUNTING_CASH_JOURNAL",
"chaine",
"CAI"
);
$this->const[7] = array(
"ACCOUNTING_MISCELLANEOUS_JOURNAL", "ACCOUNTING_MISCELLANEOUS_JOURNAL",
"chaine", "chaine",
"OD" "OD"
); );
$this->const[8] = array( $this->const[7] = array(
"ACCOUNTING_BANK_JOURNAL",
"chaine",
"BQ"
); // Deprecated Move into llx_bank_account
$this->const[9] = array(
"ACCOUNTING_ACCOUNT_TRANSFER_CASH", "ACCOUNTING_ACCOUNT_TRANSFER_CASH",
"chaine", "chaine",
"58" "58"
); );
$this->const[10] = array( $this->const[8] = array(
"CHARTOFACCOUNTS", "CHARTOFACCOUNTS",
"chaine", "chaine",
"2" "2"
); );
$this->const[11] = array( $this->const[9] = array(
"ACCOUNTING_MODELCSV", "ACCOUNTING_EXPORT_MODELCSV",
"chaine", "chaine",
"0" "0"
); );
$this->const[12] = array( $this->const[10] = array(
"ACCOUNTING_LENGTH_GACCOUNT", "ACCOUNTING_LENGTH_GACCOUNT",
"chaine", "chaine",
"" ""
); );
$this->const[13] = array( $this->const[11] = array(
"ACCOUNTING_LENGTH_AACCOUNT", "ACCOUNTING_LENGTH_AACCOUNT",
"chaine", "chaine",
"" ""
); );
$this->const[14] = array( $this->const[12] = array(
"ACCOUNTING_LIMIT_LIST_VENTILATION", "ACCOUNTING_LIMIT_LIST_VENTILATION",
"chaine", "chaine",
"50" "50"
); );
$this->const[15] = array( $this->const[13] = array(
"ACCOUNTING_LIST_SORT_VENTILATION_TODO", "ACCOUNTING_LIST_SORT_VENTILATION_TODO",
"yesno", "yesno",
"1" "1"
); );
$this->const[16] = array( $this->const[14] = array(
"ACCOUNTING_LIST_SORT_VENTILATION_DONE", "ACCOUNTING_LIST_SORT_VENTILATION_DONE",
"yesno", "yesno",
"1" "1"
); );
$this->const[15] = array (
"ACCOUNTING_GROUPBYACCOUNT",
"yesno",
"1"
);
$this->const[16] = array (
"ACCOUNTING_EXPORT_DATE",
"chaine",
"%d%m%Y"
);
$this->const[17] = array (
"ACCOUNTING_EXPORT_PIECE",
"yesno",
"1"
);
$this->const[18] = array (
"ACCOUNTING_EXPORT_GLOBAL_ACCOUNT",
"yesno",
"1"
);
$this->const[19] = array (
"ACCOUNTING_EXPORT_LABEL",
"yesno",
"1"
);
$this->const[20] = array (
"ACCOUNTING_EXPORT_AMOUNT",
"yesno",
"1"
);
$this->const[21] = array (
"ACCOUNTING_EXPORT_DEVISE",
"yesno",
"1"
);
// Tabs // Tabs
$this->tabs = array(); $this->tabs = array();

View File

@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules
$this->family = "hr"; $this->family = "hr";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this)); $this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des adhérents d'une association"; $this->description = "Management of members of a foundation or association";
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0; $this->special = 0;
@ -137,7 +137,7 @@ class modAdherent extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 75; $this->rights[$r][0] = 75;
$this->rights[$r][1] = 'Setup types and attributes of members'; $this->rights[$r][1] = 'Setup types of membership';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'configurer'; $this->rights[$r][4] = 'configurer';

View File

@ -28,9 +28,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_order/modules_commandefo
/** /**
\class mod_commande_fournisseur_orchidee * Classe du modele de numerotation de reference de commande fournisseur Orchidee
\brief Classe du modele de numerotation de reference de commande fournisseur Orchidee */
*/
class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
{ {
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'

View File

@ -1523,7 +1523,7 @@ class Expedition extends CommonObject
} }
/** /**
* Get tracking url status * Forge an set tracking url
* *
* @param string $value Value * @param string $value Value
* @return void * @return void

View File

@ -157,6 +157,7 @@ if ($id > 0 || ! empty($ref))
print '<br>'; print '<br>';
$colwidth=20;
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
dol_fiche_end(); dol_fiche_end();

View File

@ -167,7 +167,8 @@ if ($object->id > 0)
// Country // Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
$img=picto_from_langcode($object->country_code); //$img=picto_from_langcode($object->country_code);
$img='';
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country; else print ($img?$img.' ':'').$object->country;
print '</td></tr>'; print '</td></tr>';

View File

@ -592,7 +592,6 @@ class CommandeFournisseur extends CommonOrder
else else
{ {
$this->error = $obj->error; $this->error = $obj->error;
dol_print_error($db, get_class($this)."::getNextNumRef ".$obj->error);
return -1; return -1;
} }
} }

View File

@ -130,13 +130,13 @@ if ($action == 'setconditions' && $user->rights->fournisseur->commande->creer)
} }
// mode de reglement // mode de reglement
else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) if ($action == 'setmode' && $user->rights->fournisseur->commande->creer)
{ {
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
} }
// bank account // bank account
else if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer) if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer)
{ {
$result=$object->setBankAccount(GETPOST('fk_account', 'int')); $result=$object->setBankAccount(GETPOST('fk_account', 'int'));
} }
@ -154,17 +154,17 @@ if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->cree
} }
// Set project // Set project
else if ($action == 'classin' && $user->rights->fournisseur->commande->creer) if ($action == 'classin' && $user->rights->fournisseur->commande->creer)
{ {
$object->setProject($projectid); $object->setProject($projectid);
} }
else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer) if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->creer)
{ {
$result = $object->set_remise($user, $_POST['remise_percent']); $result = $object->set_remise($user, $_POST['remise_percent']);
} }
else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver) if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
{ {
if (in_array($object->statut, array(1, 2, 5, 6, 7, 9))) if (in_array($object->statut, array(1, 2, 5, 6, 7, 9)))
{ {
@ -191,7 +191,7 @@ else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
/* /*
* Add a line into product * Add a line into product
*/ */
else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
{ {
$langs->load('errors'); $langs->load('errors');
$error = 0; $error = 0;
@ -402,7 +402,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
/* /*
* Mise a jour d'une ligne dans la commande * Mise a jour d'une ligne dans la commande
*/ */
else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel')) if ($action == 'update_line' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel'))
{ {
if ($_POST["elrowid"]) if ($_POST["elrowid"])
{ {
@ -473,7 +473,7 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer
} }
} }
else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer) if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
{ {
$result = $object->deleteline(GETPOST('lineid')); $result = $object->deleteline(GETPOST('lineid'));
@ -506,7 +506,7 @@ else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->r
} }
} }
else if ($action == 'confirm_valid' && $confirm == 'yes' && if ($action == 'confirm_valid' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer)) ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->commande->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate))) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_order_advance->validate)))
) )
@ -545,7 +545,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' &&
} }
} }
else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver) if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
{ {
$idwarehouse=GETPOST('idwarehouse', 'int'); $idwarehouse=GETPOST('idwarehouse', 'int');
@ -596,7 +596,7 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
} }
} }
else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver) if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->fournisseur->commande->approuver)
{ {
$result = $object->refuse($user); $result = $object->refuse($user);
if ($result > 0) if ($result > 0)
@ -610,7 +610,7 @@ else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->four
} }
} }
else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
{ {
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']); $result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
if ($result > 0) if ($result > 0)
@ -628,7 +628,7 @@ else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fo
} }
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer) if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->commande->supprimer)
{ {
$result=$object->delete($user); $result=$object->delete($user);
if ($result > 0) if ($result > 0)
@ -643,7 +643,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->four
} }
// Action clone object // Action clone object
else if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer) if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fournisseur->commande->creer)
{ {
if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
{ {
@ -669,7 +669,7 @@ else if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->fourn
} }
// Receive // Receive
else if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner) if ($action == 'livraison' && $user->rights->fournisseur->commande->receptionner)
{ {
if ($_POST["type"]) if ($_POST["type"])
@ -698,7 +698,7 @@ else if ($action == 'livraison' && $user->rights->fournisseur->commande->recepti
} }
} }
else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander) if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
{ {
$result = $object->cancel($user); $result = $object->cancel($user);
if ($result > 0) if ($result > 0)
@ -713,7 +713,7 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->four
} }
// Line ordering // Line ordering
else if ($action == 'up' && $user->rights->fournisseur->commande->creer) if ($action == 'up' && $user->rights->fournisseur->commande->creer)
{ {
$object->line_up($_GET['rowid']); $object->line_up($_GET['rowid']);
@ -729,7 +729,7 @@ else if ($action == 'up' && $user->rights->fournisseur->commande->creer)
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid'])); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
exit; exit;
} }
else if ($action == 'down' && $user->rights->fournisseur->commande->creer) if ($action == 'down' && $user->rights->fournisseur->commande->creer)
{ {
$object->line_down($_GET['rowid']); $object->line_down($_GET['rowid']);
@ -746,7 +746,7 @@ else if ($action == 'down' && $user->rights->fournisseur->commande->creer)
exit; exit;
} }
else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) // En get ou en post if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) // En get ou en post
{ {
// Build document // Build document
@ -768,7 +768,7 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) /
} }
// Delete file in doc form // Delete file in doc form
else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisseur->commande->creer) if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisseur->commande->creer)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("other"); $langs->load("other");
@ -779,7 +779,7 @@ else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisse
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
} }
elseif ($action == 'update_extras') if ($action == 'update_extras')
{ {
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
@ -821,7 +821,7 @@ elseif ($action == 'update_extras')
/* /*
* Create an order * Create an order
*/ */
else if ($action == 'add' && $user->rights->fournisseur->commande->creer) if ($action == 'add' && $user->rights->fournisseur->commande->creer)
{ {
$error=0; $error=0;
@ -1367,17 +1367,24 @@ elseif (! empty($object->id))
if (preg_match('/^[\(]?PROV/i',$object->ref)) $newref = $object->getNextNumRef($object->thirdparty); if (preg_match('/^[\(]?PROV/i',$object->ref)) $newref = $object->getNextNumRef($object->thirdparty);
else $newref = $object->ref; else $newref = $object->ref;
$text=$langs->trans('ConfirmValidateOrder',$newref); if ($newref < 0)
if (! empty($conf->notification->enabled))
{ {
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; setEventMessages($object->error, $object->errors, 'errors');
$notify=new Notify($db); $action='';
$text.='<br>';
$text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
} }
else
{
$text=$langs->trans('ConfirmValidateOrder',$newref);
if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
$text.='<br>';
$text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
}
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
}
} }
/* /*

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
@ -454,7 +454,7 @@ else
if ($allowupgrade) if ($allowupgrade)
{ {
// If it's not last updagre script, action = upgrade_tmp, if last action = upgrade // If it's not last updagre script, action = upgrade_tmp, if last action = upgrade
$choice .= '<a class="button" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>'; $choice .= '<a class="button runupgrade" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
} }
else else
{ {
@ -523,6 +523,10 @@ $("div#AShowChoices a").click(function() {
}); });
$(".runupgrade").click(function() {
return confirm("'.dol_escape_js($langs->transnoentitiesnoconv("WarningUpgrade"), 0, 1).'");
});
</script>'; </script>';
pFooter(true); // Never display next button pFooter(true); // Never display next button

View File

@ -106,15 +106,20 @@ UPDATE llx_const SET name = 'ACCOUNTING_VAT_ACCOUNT' WHERE name = 'COMPTA_VAT_AC
UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT'; UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT';
-- Compatibility with module Accounting Expert -- Compatibility with module Accounting Expert
UPDATE llx_const SET name = 'ACCOUNTING_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV'; UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DATE' WHERE name = 'ACCOUNTINGEX_EXP_DATE';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_PIECE' WHERE name = 'ACCOUNTINGEX_EXP_PIECE';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_GLOBAL_ACCOUNT' WHERE name = 'ACCOUNTINGEX_EXP_GLOBAL_ACCOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_LABEL' WHERE name = 'ACCOUNTINGEX_EXP_LABEL';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_AMOUNT' WHERE name = 'ACCOUNTINGEX_EXP_AMOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_EXPORT_DEVISE' WHERE name = 'ACCOUNTINGEX_EXP_DEVISE';
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUSPENSE' WHERE name = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE'; UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_SUSPENSE' WHERE name = 'ACCOUNTINGEX_ACCOUNT_SUSPENSE';
UPDATE llx_const SET name = 'ACCOUNTING_SELL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SELL_JOURNAL'; UPDATE llx_const SET name = 'ACCOUNTING_SELL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SELL_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_PURCHASE_JOURNAL' WHERE name = 'ACCOUNTINGEX_PURCHASE_JOURNAL'; UPDATE llx_const SET name = 'ACCOUNTING_PURCHASE_JOURNAL' WHERE name = 'ACCOUNTINGEX_PURCHASE_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_SOCIAL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SOCIAL_JOURNAL'; UPDATE llx_const SET name = 'ACCOUNTING_SOCIAL_JOURNAL' WHERE name = 'ACCOUNTINGEX_SOCIAL_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_CASH_JOURNAL' WHERE name = 'ACCOUNTINGEX_CASH_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_MISCELLANEOUS_JOURNAL' WHERE name = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL'; UPDATE llx_const SET name = 'ACCOUNTING_MISCELLANEOUS_JOURNAL' WHERE name = 'ACCOUNTINGEX_MISCELLANEOUS_JOURNAL';
UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' WHERE name = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH'; UPDATE llx_const SET name = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH' WHERE name = 'ACCOUNTINGEX_ACCOUNT_TRANSFER_CASH';
UPDATE llx_const SET name = 'ACCOUNTING_MODELCSV' WHERE name = 'ACCOUNTINGEX_MODELCSV';
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_GACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_GACCOUNT'; UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_GACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_GACCOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_AACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_AACCOUNT'; UPDATE llx_const SET name = 'ACCOUNTING_LENGTH_AACCOUNT' WHERE name = 'ACCOUNTINGEX_LENGTH_AACCOUNT';
UPDATE llx_const SET name = 'ACCOUNTING_LIMIT_LIST_VENTILATION' WHERE name = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION'; UPDATE llx_const SET name = 'ACCOUNTING_LIMIT_LIST_VENTILATION' WHERE name = 'ACCOUNTINGEX_LIMIT_LIST_VENTILATION';

View File

@ -574,7 +574,7 @@ Permission67=Export interventions
Permission71=Read members Permission71=Read members
Permission72=Create/modify members Permission72=Create/modify members
Permission74=Delete members Permission74=Delete members
Permission75=Setup types and attributes for members Permission75=Setup types of membership
Permission76=Export datas Permission76=Export datas
Permission78=Read subscriptions Permission78=Read subscriptions
Permission79=Create/modify subscriptions Permission79=Create/modify subscriptions
@ -597,8 +597,8 @@ Permission106=Export sendings
Permission109=Delete sendings Permission109=Delete sendings
Permission111=Read financial accounts Permission111=Read financial accounts
Permission112=Create/modify/delete and compare transactions Permission112=Create/modify/delete and compare transactions
Permission113=Setup financiel accounts (create, manage categories) Permission113=Setup financial accounts (create, manage categories)
Permission114=Consolidate transactions Permission114=Reconciliate transactions
Permission115=Export transactions and account statements Permission115=Export transactions and account statements
Permission116=Transfers between accounts Permission116=Transfers between accounts
Permission117=Manage cheques dispatching Permission117=Manage cheques dispatching
@ -1059,7 +1059,7 @@ BrowserIsOK=You are using the web browser %s. This browser is ok for security an
BrowserIsKO=You are using the web browser %s. This browser is known to be a bad choice for security, performance and reliability. We recommand you to use Firefox, Chrome, Opera or Safari. BrowserIsKO=You are using the web browser %s. This browser is known to be a bad choice for security, performance and reliability. We recommand you to use Firefox, Chrome, Opera or Safari.
XDebugInstalled=XDebug is loaded. XDebugInstalled=XDebug is loaded.
XCacheInstalled=XCache is loaded. XCacheInstalled=XCache is loaded.
AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink. Third parties will appears with name "CC12345 - SC45678 - The big company coorp", instead of "The big company coorp".
FieldEdition=Edition of field %s FieldEdition=Edition of field %s
FixTZ=TimeZone fix FixTZ=TimeZone fix
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced) FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)
@ -1405,9 +1405,9 @@ FixedEmailTarget=Fixed email target
SendingsSetup=Sending module setup SendingsSetup=Sending module setup
SendingsReceiptModel=Sending receipt model SendingsReceiptModel=Sending receipt model
SendingsNumberingModules=Sendings numbering modules SendingsNumberingModules=Sendings numbering modules
SendingsAbility=Support sendings sheets for customer deliveries SendingsAbility=Support shipment sheets for customer deliveries
NoNeedForDeliveryReceipts=In most cases, sendings receipts are used both as sheets for customer deliveries (list of products to send) and sheets that is recevied and signed by customer. So product deliveries receipts is a duplicated feature and is rarely activated. NoNeedForDeliveryReceipts=In most cases, sendings receipts are used both as sheets for customer deliveries (list of products to send) and sheets that is recevied and signed by customer. So product deliveries receipts is a duplicated feature and is rarely activated.
FreeLegalTextOnShippings=Free text on shippings FreeLegalTextOnShippings=Free text on shipments
##### Deliveries ##### ##### Deliveries #####
DeliveryOrderNumberingModules=Products deliveries receipt numbering module DeliveryOrderNumberingModules=Products deliveries receipt numbering module
DeliveryOrderModel=Products deliveries receipt model DeliveryOrderModel=Products deliveries receipt model

View File

@ -58,8 +58,8 @@ OrderSentByEMail=Customer order %s sent by EMail
InvoiceSentByEMail=Customer invoice %s sent by EMail InvoiceSentByEMail=Customer invoice %s sent by EMail
SupplierOrderSentByEMail=Supplier order %s sent by EMail SupplierOrderSentByEMail=Supplier order %s sent by EMail
SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail
ShippingSentByEMail=Shipping %s sent by EMail ShippingSentByEMail=Shipment %s sent by EMail
ShippingValidated= Shipping %s validated ShippingValidated= Shipment %s validated
NewCompanyToDolibarr= Third party created NewCompanyToDolibarr= Third party created
DateActionPlannedStart= Planned start date DateActionPlannedStart= Planned start date
DateActionPlannedEnd= Planned end date DateActionPlannedEnd= Planned end date

View File

@ -1,16 +1,16 @@
# Dolibarr language file - Source file is en_US - bills # Dolibarr language file - Source file is en_US - bills
Bill=Invoice Bill=Invoice
Bills=Invoices Bills=Invoices
BillsCustomers=Customer's invoices BillsCustomers=Customers invoices
BillsCustomer=Customer's invoice BillsCustomer=Customers invoice
BillsSuppliers=Supplier's invoices BillsSuppliers=Suppliers invoices
BillsCustomersUnpaid=Unpaid customer's invoices BillsCustomersUnpaid=Unpaid customers invoices
BillsCustomersUnpaidForCompany=Unpaid customer's invoices for %s BillsCustomersUnpaidForCompany=Unpaid customer's invoices for %s
BillsSuppliersUnpaid=Unpaid supplier's invoices BillsSuppliersUnpaid=Unpaid supplier's invoices
BillsSuppliersUnpaidForCompany=Unpaid supplier's invoices for %s BillsSuppliersUnpaidForCompany=Unpaid supplier's invoices for %s
BillsLate=Late payments BillsLate=Late payments
BillsStatistics=Customer's invoices statistics BillsStatistics=Customers invoices statistics
BillsStatisticsSuppliers=Supplier's invoices statistics BillsStatisticsSuppliers=Suppliers invoices statistics
DisabledBecauseNotErasable=Disabled because can not be erased DisabledBecauseNotErasable=Disabled because can not be erased
InvoiceStandard=Standard invoice InvoiceStandard=Standard invoice
InvoiceStandardAsk=Standard invoice InvoiceStandardAsk=Standard invoice

View File

@ -155,6 +155,7 @@ MigrationFinished=Migration finished
LastStepDesc=<strong>Last step</strong>: Define here login and password you plan to use to connect to software. Do not loose this as it is the account to administer all others. LastStepDesc=<strong>Last step</strong>: Define here login and password you plan to use to connect to software. Do not loose this as it is the account to administer all others.
ActivateModule=Activate module %s ActivateModule=Activate module %s
ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode) ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode)
WarningUpgrade=Warning:\nDid your run a database backup first ?\nThis is highly recommanded: for example, due to some bugs into databases systems (for example mysql version 5.5.40), some data or tables may be lost during this process, so it is highly recommanded to have a complete dump of your database before starting migration.\n\nClick OK to start migration process...
######### #########
# upgrade # upgrade

View File

@ -16,13 +16,13 @@ SupplierOrder=Supplier order
SuppliersOrders=Suppliers orders SuppliersOrders=Suppliers orders
SuppliersOrdersRunning=Current suppliers orders SuppliersOrdersRunning=Current suppliers orders
CustomerOrder=Customer order CustomerOrder=Customer order
CustomersOrders=Customer's orders CustomersOrders=Customers orders
CustomersOrdersRunning=Current customer's orders CustomersOrdersRunning=Current customer's orders
CustomersOrdersAndOrdersLines=Customer orders and order's lines CustomersOrdersAndOrdersLines=Customer orders and order's lines
OrdersToValid=Customer's orders to validate OrdersToValid=Customers orders to validate
OrdersToBill=Customer's orders delivered OrdersToBill=Customers orders delivered
OrdersInProcess=Customer's orders in process OrdersInProcess=Customers orders in process
OrdersToProcess=Customer's orders to process OrdersToProcess=Customers orders to process
SuppliersOrdersToProcess=Supplier's orders to process SuppliersOrdersToProcess=Supplier's orders to process
StatusOrderCanceledShort=Canceled StatusOrderCanceledShort=Canceled
StatusOrderDraftShort=Draft StatusOrderDraftShort=Draft

View File

@ -4,7 +4,7 @@ Sending=Shipment
Sendings=Shipments Sendings=Shipments
Shipment=Shipment Shipment=Shipment
Shipments=Shipments Shipments=Shipments
Receivings=Receivings Receivings=Receipts
SendingsArea=Shipments area SendingsArea=Shipments area
ListOfSendings=List of shipments ListOfSendings=List of shipments
SendingMethod=Shipping method SendingMethod=Shipping method
@ -14,7 +14,7 @@ SearchASending=Search for shipment
StatisticsOfSendings=Statistics for shipments StatisticsOfSendings=Statistics for shipments
NbOfSendings=Number of shipments NbOfSendings=Number of shipments
NumberOfShipmentsByMonth=Number of shipments by month NumberOfShipmentsByMonth=Number of shipments by month
SendingCard=Shipping card SendingCard=Shipment card
NewSending=New shipment NewSending=New shipment
CreateASending=Create a shipment CreateASending=Create a shipment
CreateSending=Create shipment CreateSending=Create shipment
@ -37,7 +37,7 @@ StatusSendingCanceledShort=Canceled
StatusSendingDraftShort=Draft StatusSendingDraftShort=Draft
StatusSendingValidatedShort=Validated StatusSendingValidatedShort=Validated
StatusSendingProcessedShort=Processed StatusSendingProcessedShort=Processed
SendingSheet=Sending sheet SendingSheet=Shipment sheet
Carriers=Carriers Carriers=Carriers
Carrier=Carrier Carrier=Carrier
CarriersArea=Carriers area CarriersArea=Carriers area
@ -58,7 +58,7 @@ SendShippingRef=Submission of shipment %s
ActionsOnShipping=Events on shipment ActionsOnShipping=Events on shipment
LinkToTrackYourPackage=Link to track your package LinkToTrackYourPackage=Link to track your package
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card. ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
RelatedShippings=Related shippings RelatedShippings=Related shipments
ShipmentLine=Shipment line ShipmentLine=Shipment line
CarrierList=List of transporters CarrierList=List of transporters
SendingRunning=Product from customer order already sent SendingRunning=Product from customer order already sent

View File

@ -116,7 +116,7 @@ MassMovement=Mass movement
MassStockMovement=Mass stock movement MassStockMovement=Mass stock movement
SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s". SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s".
RecordMovement=Record transfert RecordMovement=Record transfert
ReceivingForSameOrder=Receivings for this order ReceivingForSameOrder=Receipts for this order
StockMovementRecorded=Stock movements recorded StockMovementRecorded=Stock movements recorded
RuleForStockAvailability=Rules on stock requirements RuleForStockAvailability=Rules on stock requirements
StockMustBeEnoughForInvoice=Stock level must be enough to add product/service into invoice StockMustBeEnoughForInvoice=Stock level must be enough to add product/service into invoice

View File

@ -441,7 +441,16 @@ if ($id > 0 || $ref)
// Real stock // Real stock
$product->load_stock(); $product->load_stock();
print '<tr><td>'.$langs->trans("PhysicalStock").'</td>'; $text_stock_options = '';
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'<br>':'');
print '<tr><td>';
print $form->textwithtooltip($langs->trans("PhysicalStock"),$text_stock_options,2,1,img_picto('', 'info'),'',0);
print '</td>';
print '<td>'.$product->stock_reel; print '<td>'.$product->stock_reel;
if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit")); if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit"));
print '</td>'; print '</td>';
@ -457,14 +466,7 @@ if ($id > 0 || $ref)
print '</tr>'; print '</tr>';
print '<tr><td>'; print '<tr><td>';
$text_stock_options = ''; print $langs->trans("StockDiffPhysicTeoric");
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'<br>':'');
$text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'<br>':'');
print $form->textwithtooltip($langs->trans("StockDiffPhysicTeoric"),$text_stock_options,2,1,img_picto('', 'info'),'',0);;
print '</td>'; print '</td>';
print '<td>'; print '<td>';

View File

@ -164,21 +164,21 @@ dol_fiche_end();
$listofreferent=array( $listofreferent=array(
'propal'=>array( 'propal'=>array(
'name'=>"Proposalq", 'name'=>"Proposals",
'title'=>"ListProposalsAssociatedProject", 'title'=>"ListProposalsAssociatedProject",
'class'=>'Propal', 'class'=>'Propal',
'table'=>'propal', 'table'=>'propal',
'datefieldname'=>'datep', 'datefieldname'=>'datep',
'test'=>$conf->propal->enabled && $user->rights->propale->lire), 'test'=>$conf->propal->enabled && $user->rights->propale->lire),
'order'=>array( 'order'=>array(
'name'=>"CustomerOrderq", 'name'=>"CustomersOrders",
'title'=>"ListOrdersAssociatedProject", 'title'=>"ListOrdersAssociatedProject",
'class'=>'Commande', 'class'=>'Commande',
'table'=>'commande', 'table'=>'commande',
'datefieldname'=>'date_commande', 'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire), 'test'=>$conf->commande->enabled && $user->rights->commande->lire),
'invoice'=>array( 'invoice'=>array(
'name'=>"CustomerInvoiceq", 'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject", 'title'=>"ListInvoicesAssociatedProject",
'class'=>'Facture', 'class'=>'Facture',
'margin'=>'add', 'margin'=>'add',
@ -193,7 +193,7 @@ $listofreferent=array(
'datefieldname'=>'datec', 'datefieldname'=>'datec',
'test'=>$conf->facture->enabled && $user->rights->facture->lire), 'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'order_supplier'=>array( 'order_supplier'=>array(
'name'=>"SuplierOrders", 'name'=>"SuppliersOrders",
'title'=>"ListSupplierOrdersAssociatedProject", 'title'=>"ListSupplierOrdersAssociatedProject",
'class'=>'CommandeFournisseur', 'class'=>'CommandeFournisseur',
'table'=>'commande_fournisseur', 'table'=>'commande_fournisseur',
@ -223,7 +223,7 @@ $listofreferent=array(
'disableamount'=>1, 'disableamount'=>1,
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire), 'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
'trip'=>array( 'trip'=>array(
'name'=>"TripAndExpenses", 'name'=>"TripsAndExpenses",
'title'=>"ListTripAssociatedProject", 'title'=>"ListTripAssociatedProject",
'class'=>'Deplacement', 'class'=>'Deplacement',
'table'=>'deplacement', 'table'=>'deplacement',

View File

@ -395,6 +395,7 @@ print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>'; print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=true;
foreach ($dirsociete as $dirroot) foreach ($dirsociete as $dirroot)
{ {
$dir = dol_buildpath($dirroot,0); $dir = dol_buildpath($dirroot,0);
@ -488,6 +489,7 @@ print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="60">'.$langs->trans("Preview").'</td>'; print '<td align="center" width="60">'.$langs->trans("Preview").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=true;
foreach ($dirsociete as $dirroot) foreach ($dirsociete as $dirroot)
{ {
$dir = dol_buildpath($dirroot.'doc/',0); $dir = dol_buildpath($dirroot.'doc/',0);

View File

@ -121,7 +121,8 @@ if ($socid)
// Country // Country
if ($object->country) { if ($object->country) {
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
$img=picto_from_langcode($object->country_code); //$img=picto_from_langcode($object->country_code);
$img='';
print ($img?$img.' ':''); print ($img?$img.' ':'');
print $object->country; print $object->country;
print '</td></tr>'; print '</td></tr>';

View File

@ -2648,7 +2648,7 @@ class Societe extends CommonObject
{ {
global $conf; global $conf;
// Define if third party is treated as company of not when nature is unknown // Define if third party is treated as company (or not) when nature is unknown
$isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default $isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default
if (! empty($this->tva_intra)) $isacompany=1; if (! empty($this->tva_intra)) $isacompany=1;
else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0; else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0;

View File

@ -428,6 +428,9 @@ th .button {
background-color: #777; background-color: #777;
border-radius: 10px; border-radius: 10px;
} }
.movable {
cursor: move;
}
.borderrightlight .borderrightlight
{ {

View File

@ -646,6 +646,7 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
$this->savlangs=$langs; $this->savlangs=$langs;
$this->savdb=$db; $this->savdb=$db;
// Sellers
$companyfrnovat=new Societe($db); $companyfrnovat=new Societe($db);
$companyfrnovat->country_code='FR'; $companyfrnovat->country_code='FR';
$companyfrnovat->tva_assuj=0; $companyfrnovat->tva_assuj=0;
@ -653,53 +654,88 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
$companyfr=new Societe($db); $companyfr=new Societe($db);
$companyfr->country_code='FR'; $companyfr->country_code='FR';
$companyfr->tva_assuj=1; $companyfr->tva_assuj=1;
$companyfr->tva_intra='FR9999';
// Buyers
$companymc=new Societe($db); $companymc=new Societe($db);
$companymc->country_code='MC'; $companymc->country_code='MC';
$companymc->tva_assuj=1; $companymc->tva_assuj=1;
$companyfr->tva_intra='MC9999';
$companyit=new Societe($db); $companyit=new Societe($db);
$companyit->country_code='IT'; $companyit->country_code='IT';
$companyit->tva_assuj=1; $companyit->tva_assuj=1;
$companyit->tva_intra='IT99999'; $companyit->tva_intra='IT99999';
$notcompanyit=new Societe($db); $companyde=new Societe($db);
$notcompanyit->country_code='IT'; $companyde->country_code='DE';
$notcompanyit->tva_assuj=1; $companyde->tva_assuj=1;
$notcompanyit->tva_intra=''; $companyde->tva_intra='DE99999';
$notcompanyit->typent_code='TE_PRIVATE';
$notcompanyde=new Societe($db);
$notcompanyde->country_code='DE';
$notcompanyde->tva_assuj=0;
$notcompanyde->tva_intra='';
$notcompanyde->typent_code='TE_PRIVATE';
$companyus=new Societe($db); $companyus=new Societe($db);
$companyus->country_code='US'; $companyus->country_code='US';
$companyus->tva_assuj=1; $companyus->tva_assuj=1;
$companyus->tva_intra=''; $companyus->tva_intra='';
// Test RULE 0 (FR-IT)
// Test RULE 0 (FR-DE)
// Not tested // Not tested
// Test RULE 1 // Test RULE 1
$vat=get_default_tva($companyfrnovat,$companymc,0); $vat=get_default_tva($companyfrnovat,$companymc,0);
$this->assertEquals(0,$vat); $this->assertEquals(0,$vat,'RULE 1');
// Test RULE 2 (FR-FR) // Test RULE 2 (FR-FR)
$vat=get_default_tva($companyfr,$companyfr,0); $vat=get_default_tva($companyfr,$companyfr,0);
$this->assertEquals(20,$vat); $this->assertEquals(20,$vat,'RULE 2');
// Test RULE 2 (FR-MC) // Test RULE 2 (FR-MC)
$vat=get_default_tva($companyfr,$companymc,0); $vat=get_default_tva($companyfr,$companymc,0);
$this->assertEquals(20,$vat); $this->assertEquals(20,$vat,'RULE 2');
// Test RULE 3 (FR-IT) // Test RULE 3 (FR-DE company)
$vat=get_default_tva($companyfr,$companyit,0); $vat=get_default_tva($companyfr,$companyit,0);
$this->assertEquals(0,$vat); $this->assertEquals(0,$vat,'RULE 3');
// Test RULE 4 (FR-IT) // Test RULE 4 (FR-DE not a company)
$vat=get_default_tva($companyfr,$notcompanyit,0); $vat=get_default_tva($companyfr,$notcompanyde,0);
$this->assertEquals(20,$vat); $this->assertEquals(20,$vat,'RULE 4');
// Test RULE 5 (FR-US) // Test RULE 5 (FR-US)
$vat=get_default_tva($companyfr,$companyus,0); $vat=get_default_tva($companyfr,$companyus,0);
$this->assertEquals(0,$vat); $this->assertEquals(0,$vat,'RULE 5');
// We do same tests but with option SERVICE_ARE_ECOMMERCE_200238EC on.
$conf->global->SERVICE_ARE_ECOMMERCE_200238EC = 1;
// Test RULE 1 (FR-US)
$vat=get_default_tva($companyfr,$companyus,0);
$this->assertEquals(0,$vat,'RULE 1 ECOMMERCE_200238EC');
// Test RULE 2 (FR-FR)
$vat=get_default_tva($companyfr,$companyfr,0);
$this->assertEquals(20,$vat,'RULE 2 ECOMMERCE_200238EC');
// Test RULE 3 (FR-DE company)
$vat=get_default_tva($companyfr,$companyde,0);
$this->assertEquals(0,$vat,'RULE 3 ECOMMERCE_200238EC');
// Test RULE 4 (FR-DE not a company)
$vat=get_default_tva($companyfr,$notcompanyde,0);
$this->assertEquals(19,$vat,'RULE 4 ECOMMERCE_200238EC');
// Test RULE 5 (FR-US)
$vat=get_default_tva($companyfr,$companyus,0);
$this->assertEquals(0,$vat,'RULE 5 ECOMMERCE_200238EC');
} }
/** /**
@ -836,7 +872,7 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
$this->assertEquals(1000, price2num('1 000.0')); $this->assertEquals(1000, price2num('1 000.0'));
$this->assertEquals(1000, price2num('1 000','MT')); $this->assertEquals(1000, price2num('1 000','MT'));
$this->assertEquals(1000, price2num('1 000','MU')); $this->assertEquals(1000, price2num('1 000','MU'));
$this->assertEquals(1000.123456, price2num('1 000.123456')); $this->assertEquals(1000.123456, price2num('1 000.123456'));
// Round down // Round down
@ -850,8 +886,8 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
// Text can't be converted // Text can't be converted
$this->assertEquals('12.4$',price2num('12.4$')); $this->assertEquals('12.4$',price2num('12.4$'));
$this->assertEquals('12r.4$',price2num('12r.4$')); $this->assertEquals('12r.4$',price2num('12r.4$'));
return true; return true;
} }
} }