dev_prodlist

Conflicts:
	htdocs/accountancy/class/accountancycategory.class.php
This commit is contained in:
florian HENRY 2017-07-10 16:16:11 +02:00
commit 8e3c2af7ee
2435 changed files with 23837 additions and 10108 deletions

View File

@ -1,4 +1,4 @@
JOURNALCODE JOURNALLIB ECRITURENUM ECRITUREDATE COMPTENUM COMPTELIB COMPAUXNUM COMPAUXLIB PIECEREF PIECEDATE ECRITURELIB DEBIT CREDIT ECRITURELET DATELET VALIDDATE MONTANTDEVISE IDEVISE JOURNALCODE JOURNALLIB ECRITURENUM ECRITUREDATE COMPTENUM COMPTELIB COMPAUXNUM COMPAUXLIB PIECEREF PIECEDATE ECRITURELIB DEBIT CREDIT ECRITURELET DATELET VALIDDATE MONTANTDEVISE IDEVISE
Banque Banque 17293 20170109 401PPRO PUBLI-PROV L08 20170109 PPRO domiciliation 1TR 187,20 0,00 20170109 Banque Banque 17293 20170109 401PPRO PUBLI-PROV L08 20170109 PPRO domiciliation 1TR 187,20 0,00 20170109
Banque Banque 17293 20170109 5121CRA CR AGRICOLE L08 20170109 PPRO domiciliation 1TR 0,00 187,20 20170109 Banque Banque 17293 20170109 5121CRA CR AGRICOLE L08 20170109 PPRO domiciliation 1TR 0,00 187,20 20170109
Banque Banque 17295 20170109 401ORPA ORANGE PARIS Report 20170109 ORPA adsl par 12 96,00 0,00 20170109 Banque Banque 17295 20170109 401ORPA ORANGE PARIS Report 20170109 ORPA adsl par 12 96,00 0,00 20170109

View File

@ -1,23 +0,0 @@
#!/bin/bash
# vim:ft=sh:ts=3:sts=3:sw=3:et:
###
# Strips the closing php tag `?>` and any following blank lines from the
# end of any PHP file in the current working directory and sub-directories. Files
# with non-whitespace characters following the closing tag will not be affected.
#
# Author: Bryan C. Geraghty <bryan@ravensight.org>
# Date: 2009-10-28
# Source: http://bryan.ravensight.org/2010/07/remove-php-closing-tag/
##
FILES=$(pcregrep -rnM --include='^.*\.php$' '^\?\>(?=([\s\n]+)?$(?!\n))' .);
for MATCH in $FILES;
do
FILE=`echo $MATCH | awk -F ':' '{print $1}'`;
TARGET=`echo $MATCH | awk -F ':' '{print $2}'`;
LINE_COUNT=`wc -l $FILE | awk -F " " '{print $1}'`;
echo "Removing lines ${TARGET} through ${LINE_COUNT} from file $FILE...";
sed -i "${TARGET},${LINE_COUNT}d" $FILE;
done;

View File

@ -12,3 +12,6 @@ Balance ?? Net profit
Subledger account Subledger account ?? Subledger account Subledger account ??
Proposal ?? Quotation Proposal is ok but proposition looks better (proposal is for a detailed proposition). We can say also "business proposition or business proposal".
Indian are using "Quotation".

View File

@ -303,6 +303,8 @@ foreach($filesToProcess as $fileToProcess)
// ----- Process output now ----- // ----- Process output now -----
//print "Found primary key = ".$key."\n";
// Key not in other file // Key not in other file
if (in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)) if (in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key))
{ {
@ -321,7 +323,7 @@ foreach($filesToProcess as $fileToProcess)
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)
) )
{ {
//print "Key $key differs so we add it into new secondary language (line: $cnt).\n"; //print "Key $key differs (aSecondary=".$aSecondary[$key].", aPrimary=".$aPrimary[$key].", aEnglish=".$aEnglish[$key].") so we add it into new secondary language (line: $cnt).\n";
fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n"); fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n");
} }
} }

View File

@ -46,7 +46,7 @@ if ($cat_id == 0) {
} }
// Security check // Security check
if (! empty($user->rights->accountancy->chartofaccount)) if (empty($user->rights->accounting->chartofaccount))
{ {
accessforbidden(); accessforbidden();
} }

View File

@ -57,7 +57,7 @@ $rowid=GETPOST('rowid','alpha');
$code=GETPOST('code','alpha'); $code=GETPOST('code','alpha');
// Security access // Security access
if (! empty($user->rights->accountancy->chartofaccount)) if (empty($user->rights->accounting->chartofaccount))
{ {
accessforbidden(); accessforbidden();
} }

View File

@ -42,7 +42,7 @@ $langs->load("salaries");
$langs->load("loan"); $langs->load("loan");
// Security check // Security check
if (! empty($user->rights->accountancy->chartofaccount)) if (empty($user->rights->accounting->chartofaccount))
{ {
accessforbidden(); accessforbidden();
} }

View File

@ -38,7 +38,7 @@ $langs->load("admin");
$langs->load("accountancy"); $langs->load("accountancy");
// Security check // Security check
if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount)) if (empty($user->admin) && empty($user->rights->accounting->chartofaccount))
{ {
accessforbidden(); accessforbidden();
} }

View File

@ -266,7 +266,7 @@ if (! empty($user->admin))
} }
// Param a user $user->rights->accountancy->chartofaccount can access // Param a user $user->rights->accounting->chartofaccount can access
foreach ($list as $key) foreach ($list as $key)
{ {
print '<tr class="oddeven value">'; print '<tr class="oddeven value">';

View File

@ -41,7 +41,7 @@ $rowid=GETPOST('rowid','alpha');
$code=GETPOST('code','alpha'); $code=GETPOST('code','alpha');
// Security access // Security access
if (! empty($user->rights->accountancy->chartofaccount)) if (empty($user->rights->accounting->chartofaccount))
{ {
accessforbidden(); accessforbidden();
} }
@ -134,6 +134,7 @@ $elementList = array();
'2' => $langs->trans('AccountingJournalType2'), '2' => $langs->trans('AccountingJournalType2'),
'3' => $langs->trans('AccountingJournalType3'), '3' => $langs->trans('AccountingJournalType3'),
'4' => $langs->trans('AccountingJournalType4'), '4' => $langs->trans('AccountingJournalType4'),
'5' => $langs->trans('AccountingJournalType5'),
'9' => $langs->trans('AccountingJournalType9') '9' => $langs->trans('AccountingJournalType9')
); );

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com> * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* 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
@ -16,13 +17,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* \file htdocs/accountancy/bookkeeping/card.php * \file htdocs/accountancy/bookkeeping/card.php
* \ingroup Advanced accountancy * \ingroup Advanced accountancy
* \brief Page to show book-entry * \brief Page to show book-entry
*/ */
require '../../main.inc.php';
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
@ -38,7 +40,7 @@ if ($user->societe_id > 0) {
accessforbidden(); accessforbidden();
} }
$action = GETPOST('action','aZ09'); $action = GETPOST('action','aZ09');
$mode = GETPOST('mode'); $mode = GETPOST('mode','aZ09'); // '' or 'tmp'
$piece_num = GETPOST("piece_num"); $piece_num = GETPOST("piece_num");
$mesg = ''; $mesg = '';
@ -53,15 +55,18 @@ $label_operation= GETPOST('label_operation');
$debit = price2num(GETPOST('debit')); $debit = price2num(GETPOST('debit'));
$credit = price2num(GETPOST('credit')); $credit = price2num(GETPOST('credit'));
$save = GETPOST('save'); $save = GETPOST('save','alpha');
if (! empty($save)) { if (! empty($save)) $action = 'add';
$action = 'add'; $update = GETPOST('update','alpha');
} if (! empty($update)) $action = 'confirm_update';
$update = GETPOST('update');
if (! empty($update)) {
$action = 'confirm_update';
}
$object = new BookKeeping($db); $object = new BookKeeping($db);
/*
* Actions
*/
if ($action == "confirm_update") { if ($action == "confirm_update") {
$error = 0; $error = 0;
@ -98,7 +103,14 @@ if ($action == "confirm_update") {
if ($result < 0) { if ($result < 0) {
setEventMessages($book->error, $book->errors, 'errors'); setEventMessages($book->error, $book->errors, 'errors');
} else { } else {
if ($mode != '_tmp')
{
setEventMessages($langs->trans('Saved'), null, 'mesgs'); setEventMessages($langs->trans('Saved'), null, 'mesgs');
}
$debit = 0;
$credit = 0;
$action = ''; $action = '';
} }
} }
@ -108,7 +120,7 @@ if ($action == "confirm_update") {
else if ($action == "add") { else if ($action == "add") {
$error = 0; $error = 0;
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0)) { if (empty($debit) && empty($credit)) {
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors'); setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
$error ++; $error ++;
} }
@ -144,7 +156,14 @@ else if ($action == "add") {
if ($result < 0) { if ($result < 0) {
setEventMessages($book->error, $book->errors, 'errors'); setEventMessages($book->error, $book->errors, 'errors');
} else { } else {
if ($mode != '_tmp')
{
setEventMessages($langs->trans('Saved'), null, 'mesgs'); setEventMessages($langs->trans('Saved'), null, 'mesgs');
}
$debit = 0;
$credit = 0;
$action = ''; $action = '';
} }
} }
@ -172,6 +191,11 @@ else if ($action == "confirm_create") {
$book = new BookKeeping($db); $book = new BookKeeping($db);
if (! GETPOST('code_journal') || GETPOST('code_journal') == '-1') {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Journal")), null, 'errors');
$action='create';
$error++;
}
if (! GETPOST('next_num_mvt')) if (! GETPOST('next_num_mvt'))
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumPiece")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumPiece")), null, 'errors');
@ -196,7 +220,10 @@ else if ($action == "confirm_create") {
if ($result < 0) { if ($result < 0) {
setEventMessages($book->error, $book->errors, 'errors'); setEventMessages($book->error, $book->errors, 'errors');
} else { } else {
if ($mode != '_tmp')
{
setEventMessages($langs->trans('Saved'), null, 'mesgs'); setEventMessages($langs->trans('Saved'), null, 'mesgs');
}
$action = 'update'; $action = 'update';
$id=$book->id; $id=$book->id;
$piece_num = $book->piece_num; $piece_num = $book->piece_num;
@ -210,39 +237,43 @@ if ($action == 'setdate') {
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
if ($mode != '_tmp')
{
setEventMessages($langs->trans('Saved'), null, 'mesgs'); setEventMessages($langs->trans('Saved'), null, 'mesgs');
}
$action = ''; $action = '';
} }
} }
if ($action == 'setjournal') { if ($action == 'setjournal') {
$journaldoc = trim(GETPOST('code_journal')); $journaldoc = trim(GETPOST('code_journal'));
if (!empty($journaldoc)) {
$journaldoc='\''.$journaldoc.'\'';
}
$result = $object->updateByMvt($piece_num,'code_journal',$journaldoc,$mode); $result = $object->updateByMvt($piece_num,'code_journal',$journaldoc,$mode);
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
if ($mode != '_tmp')
{
setEventMessages($langs->trans('Saved'), null, 'mesgs'); setEventMessages($langs->trans('Saved'), null, 'mesgs');
}
$action = ''; $action = '';
} }
} }
if ($action == 'setdocref') { if ($action == 'setdocref') {
$refdoc = trim(GETPOST('doc_ref')); $refdoc = trim(GETPOST('doc_ref'));
if (!empty($refdoc)) { $result = $object->updateByMvt($piece_num,'doc_ref',$refdoc,$mode);
$refdoc='\''.$refdoc.'\'';
}
$result = $object->updateByMvt(doc_ref,'code_journal',$refdoc,$mode);
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
if ($mode != '_tmp')
{
setEventMessages($langs->trans('Saved'), null, 'mesgs'); setEventMessages($langs->trans('Saved'), null, 'mesgs');
}
$action = ''; $action = '';
} }
} }
// Validate transaction
if ($action == 'valid') { if ($action == 'valid') {
$result = $object->transformTransaction(0,$piece_num); $result = $object->transformTransaction(0,$piece_num);
if ($result < 0) { if ($result < 0) {
@ -253,14 +284,17 @@ if ($action == 'valid') {
} }
} }
/* /*
* View * View
*/ */
llxHeader();
$html = new Form($db); $html = new Form($db);
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
$accountjournal = new AccountingJournal($db); $accountjournal = new AccountingJournal($db);
llxHeader('', $langs->trans("CreateMvts"));
// Confirmation to delete the command // Confirmation to delete the command
if ($action == 'delete') { if ($action == 'delete') {
$formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id.'&mode='. $mode, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'confirm_delete', '', 0, 1); $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id.'&mode='. $mode, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'confirm_delete', '', 0, 1);
@ -300,7 +334,7 @@ if ($action == 'create') {
print '<tr>'; print '<tr>';
print '<td class="fieldrequired">' . $langs->trans("Codejournal") . '</td>'; print '<td class="fieldrequired">' . $langs->trans("Codejournal") . '</td>';
print '<td>' . $formaccounting->select_journal(GETPOST('code_journal'),'code_journal',0,0,array(),1,1) . '</td>'; print '<td>' . $formaccounting->select_journal(GETPOST('code_journal'),'code_journal',0,1,array(),1,1) . '</td>';
print '</tr>'; print '</tr>';
print '<tr>'; print '<tr>';
@ -328,29 +362,45 @@ if ($action == 'create') {
if ($result < 0) { if ($result < 0) {
setEventMessages($book->error, $book->errors, 'errors'); setEventMessages($book->error, $book->errors, 'errors');
} }
if (! empty($book->piece_num)) { if (! empty($book->piece_num)) {
print load_fiche_titre($langs->trans("UpdateMvts"), '<a href="list.php">' . $langs->trans('BackToList') . '</a>'); $backlink = '<a href="list.php">' . $langs->trans('BackToList') . '</a>';
dol_fiche_head(); print load_fiche_titre($langs->trans("UpdateMvts"), $backlink);
$head=array();
$h=0;
$head[$h][0] = $_SERVER['PHP_SELF'].'?piece_num='.$book->piece_num.($mode?'&mode='.$mode:'');
$head[$h][1] = $langs->trans("Transaction");
$head[$h][2] = 'transaction';
$h++;
dol_fiche_head($head, 'transaction', '', -1);
//dol_banner_tab($book, '', $backlink);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">'; print '<table class="border tableforfield" width="100%">';
// account movement // account movement
print '<tr class="pair">'; print '<tr>';
print '<td class="titlefield">' . $langs->trans("NumMvts") . '</td>'; print '<td class="titlefield">' . $langs->trans("NumMvts") . '</td>';
print '<td>' . $book->piece_num . '</td>'; print '<td>' . $book->piece_num . '</td>';
print '</tr>'; print '</tr>';
// date // date
print '<tr class="impair"><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Docdate'); print $langs->trans('Docdate');
print '</td>'; print '</td>';
if ($action != 'editdate') if ($action != 'editdate')
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;piece_num='. $book->piece_num .'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'),1).'</a></td>'; print '<td><a href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;piece_num='. $book->piece_num .'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($action == 'editdate') { if ($action == 'editdate') {
@ -367,12 +417,12 @@ if ($action == 'create') {
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
//journal //journal
print '<tr class="pair"><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Codejournal'); print $langs->trans('Codejournal');
print '</td>'; print '</td>';
if ($action != 'editjournal') if ($action != 'editjournal')
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editjournal&amp;piece_num='.$book->piece_num.'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</a></td>'; print '<td><a href="'.$_SERVER["PHP_SELF"].'?action=editjournal&amp;piece_num='.$book->piece_num.'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($action == 'editjournal') { if ($action == 'editjournal') {
@ -389,12 +439,12 @@ if ($action == 'create') {
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
//docref //docref
print '<tr class="impair"><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Docref'); print $langs->trans('Docref');
print '</td>'; print '</td>';
if ($action != 'editdocref') if ($action != 'editdocref')
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editdocref&amp;piece_num='.$book->piece_num.'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</a></td>'; print '<td><a href="'.$_SERVER["PHP_SELF"].'?action=editdocref&amp;piece_num='.$book->piece_num.'&amp;mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($action == 'editdocref') { if ($action == 'editdocref') {
@ -410,21 +460,25 @@ if ($action == 'create') {
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
//doctype
print '<tr class="pair">';
print '<td>' . $langs->trans("Doctype") . '</td>';
print '<td>' . $book->doc_type . '</td>';
print '</tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '<div class="fichehalfright"><div class="ficheaddleft">'; print '<div class="fichehalfright"><div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield" width="100%">';
// Doc type
print '<tr>';
print '<td>' . $langs->trans("Doctype") . '</td>';
print '<td>' . $book->doc_type . '</td>';
print '</tr>';
// Validate // Validate
print '<tr class="pair">'; /*
print '<tr>';
print '<td class="titlefield">' . $langs->trans("Status") . '</td>'; print '<td class="titlefield">' . $langs->trans("Status") . '</td>';
print '<td>'; print '<td>';
if (empty($book->validated)) { if (empty($book->validated)) {
@ -438,10 +492,12 @@ if ($action == 'create') {
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
*/
// check data // check data
print '<tr class="impair">';
print '<td class="titlefield">' . $langs->trans("Control") . '</td>';
/* /*
print '<tr>';
print '<td class="titlefield">' . $langs->trans("Control") . '</td>';
if ($book->doc_type == 'customer_invoice') if ($book->doc_type == 'customer_invoice')
{ {
$sqlmid = 'SELECT rowid as ref'; $sqlmid = 'SELECT rowid as ref';
@ -457,14 +513,19 @@ if ($action == 'create') {
} }
else dol_print_error($db); else dol_print_error($db);
} }
*/
print '<td>' . $ref .'</td>'; print '<td>' . $ref .'</td>';
print '</tr>';
*/
print "</table>\n"; print "</table>\n";
print '</div>';
print '</div></div>'; print '</div></div>';
print '</div>';
print '<div style="clear:both"></div>'; print '<div style="clear:both"></div>';
print '<br>'; print '<br>';
$result = $book->fetchAllPerMvt($piece_num, $mode); $result = $book->fetchAllPerMvt($piece_num, $mode);
if ($result < 0) { if ($result < 0) {
setEventMessages($book->error, $book->errors, 'errors'); setEventMessages($book->error, $book->errors, 'errors');
@ -490,11 +551,11 @@ if ($action == 'create') {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("AccountAccountingShort")); print_liste_field_titre($langs->trans("AccountAccountingShort"));
print_liste_field_titre($langs->trans("Subledger_account")); print_liste_field_titre($langs->trans("SubledgerAccount"));
print_liste_field_titre($langs->trans("Labelcompte")); print_liste_field_titre($langs->trans("Labelcompte"));
print_liste_field_titre($langs->trans("Labeloperation")); print_liste_field_titre($langs->trans("Label"));
print_liste_field_titre($langs->trans("Debit"), "", "", "", "", 'align="center"'); print_liste_field_titre($langs->trans("Debit"), "", "", "", "", 'align="right"');
print_liste_field_titre($langs->trans("Credit"), "", "", "", "", 'align="center"'); print_liste_field_titre($langs->trans("Credit"), "", "", "", "", 'align="right"');
print_liste_field_titre($langs->trans("Action"), "", "", "", "", 'width="60" align="center"'); print_liste_field_titre($langs->trans("Action"), "", "", "", "", 'width="60" align="center"');
print "</tr>\n"; print "</tr>\n";
@ -509,7 +570,16 @@ if ($action == 'create') {
print $formaccounting->select_account($line->numero_compte, 'account_number', 0, array (), 1, 1, ''); print $formaccounting->select_account($line->numero_compte, 'account_number', 0, array (), 1, 1, '');
print '</td>'; print '</td>';
print '<td>'; print '<td>';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
{
print $formaccounting->select_auxaccount($line->subledger_account, 'subledger_account', 1); print $formaccounting->select_auxaccount($line->subledger_account, 'subledger_account', 1);
}
else
{
print '<input type="text" name="subledger_account" value="'.$line->subledger_account.'">';
}
print '</td>'; print '</td>';
print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>'; print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>';
print '<td><input type="text" size="15" name="label_operation" value="' . $line->label_operation. '"/></td>'; print '<td><input type="text" size="15" name="label_operation" value="' . $line->label_operation. '"/></td>';
@ -528,10 +598,14 @@ if ($action == 'create') {
print '<td align="right">' . price($line->credit) . '</td>'; print '<td align="right">' . price($line->credit) . '</td>';
print '<td align="center">'; print '<td align="center">';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=update&amp;id=' . $line->id . '&amp;piece_num=' . $line->piece_num . '&amp;mode='.$mode.'">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '&mode='.$mode.'">';
print img_edit(); print img_edit();
print '</a> &nbsp;'; print '</a> &nbsp;';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=delete&amp;id=' . $line->id . '&amp;piece_num=' . $line->piece_num . '&amp;mode='.$mode.'">';
$actiontodelete='detele';
if ($mode == '_tmp') $actiontodelete='confirm_delete';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action='.$actiontodelete.'&id=' . $line->id . '&piece_num=' . $line->piece_num . '&mode='.$mode.'">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
@ -551,19 +625,37 @@ if ($action == 'create') {
print $formaccounting->select_account($account_number, 'account_number', 0, array (), 1, 1, ''); print $formaccounting->select_account($account_number, 'account_number', 0, array (), 1, 1, '');
print '</td>'; print '</td>';
print '<td>'; print '<td>';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
{
print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1); print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1);
}
else
{
print '<input type="text" name="subledger_account" value="">';
}
print '</td>'; print '</td>';
print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>'; print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>';
print '<td><input type="text" size="15" name="label_operation" value="' . $line->label_operation. '"/></td>'; print '<td><input type="text" size="15" name="label_operation" value="' . $line->label_operation. '"/></td>';
print '<td align="right"><input type="text" size="6" name="debit" value="' . price($debit) . '"/></td>'; print '<td align="right"><input type="text" size="6" name="debit" value="' . ($debit ? price($debit) : '') . '"/></td>';
print '<td align="right"><input type="text" size="6" name="credit" value="' . price($credit) . '"/></td>'; print '<td align="right"><input type="text" size="6" name="credit" value="' . ($credit ? price($credit) : '') . '"/></td>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>'; print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';
print '</tr>'; print '</tr>';
} }
print '</table>'; print '</table>';
if ($mode=='_tmp' && $total_debit == $total_credit && $action=='') {
if ($mode=='_tmp' && $action=='')
{
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($total_debit == $total_credit)
{
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '&action=valid">'.$langs->trans("ValidTransaction").'</a>'; print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '&action=valid">'.$langs->trans("ValidTransaction").'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("MvtNotCorrectlyBalanced", $credit, $debit)).'">'.$langs->trans("ValidTransaction").'</a>';
}
print "</div>"; print "</div>";
} }
print '</form>'; print '</form>';

View File

@ -399,11 +399,29 @@ print '</td>';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<div class="nowrap">'; print '<div class="nowrap">';
print $langs->trans('From'); print $langs->trans('From');
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
{
print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1); print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
}
else
{
print '<input type="text" name="search_accountancy_aux_code_start" value="'.$search_accountancy_aux_code_start.'">';
}
print '</div>'; print '</div>';
print '<div class="nowrap">'; print '<div class="nowrap">';
print $langs->trans('to'); print $langs->trans('to');
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
{
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1); print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
}
else
{
print '<input type="text" name="search_accountancy_aux_code_end" value="'.$search_accountancy_aux_code_end.'">';
}
print '</div>'; print '</div>';
print '</td>'; print '</td>';
print '<td class="liste_titre">'; print '<td class="liste_titre">';

View File

@ -0,0 +1,331 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* \file accounting/bookkeeping/thirdparty_lettrage.php
* \ingroup Accounting Expert
* \brief Onglet de gestion de parametrages des ventilations
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
$action=GETPOST('action','aZ09');
$massaction=GETPOST('massaction','alpha');
$show_files=GETPOST('show_files','int');
$confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC";
if ($sortfield == "") $sortfield = "bk.rowid";
$search_year = GETPOST ( "search_year" );
// Security check
$socid = GETPOST("socid",'int');
// if ($user->societe_id) $socid=$user->societe_id;
$object = new Societe($db);
$object->id = $socid;
$object->fetch($socid);
$form = new Form($db);
$BookKeeping = new lettering($db);
$formaccounting = new FormAccounting($db);
/*
* Action
*/
if ($action == 'lettering') {
$result = $BookKeeping->updatelettrage($_POST['ids']);
// var_dump($result);
if( $result < 0 ){
setEventMessages('', $BookKeeping->errors, 'errors' );
$error++;
}
}
if ($action == 'autolettrage') {
$result = $BookKeeping->LettrageTiers($socid);
if( $result < 0 ){
setEventMessages('', $BookKeeping->errors, 'errors' );
$error++;
}
}
llxHeader ( '', 'Compta - Grand Livre' );
/*
* Affichage onglets
*/
$head = societe_prepare_head($object);
dol_htmloutput_mesg(is_numeric($error)?'':$error, $errors, 'error');
dol_fiche_head($head, 'TabAccounting', $langs->trans("ThirdParty"),0,'company');
print '<table width="100%" class="border">';
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td><td width="70%" colspan="3">';
$object->next_prev_filter="te.fournisseur = 1";
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
print '<tr>';
print '<td class="nowrap">'.$langs->trans("CustomerCode"). '</td><td colspan="3">';
print $object->code_client;
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
print '</td>';
print '</tr>';
$langs->load('compta');
print '<tr>';
print '<td>';
print $form->editfieldkey("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer);
print '</td><td colspan="3">';
print $form->editfieldval("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer);
print '</td>';
print '</tr>';
// Address
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">';
dol_print_address($object->address,'gmap','thirdparty',$object->id);
print '</td></tr>';
// Zip / Town
print '<tr><td class="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'</td>';
print '</tr>';
// Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
//$img=picto_from_langcode($object->country_code);
$img='';
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country;
print '</td></tr>';
print '</table>';
$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 , bk.piece_num, bk.lettering_code ";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " WHERE (bk.code_tiers = '" . $object->code_compta . "' AND bk.numero_compte = '" .$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER. "' )" ;
if (dol_strlen ( $search_year )) {
$sql .= " AND ( bk.doc_date BETWEEN '" . $search_year . "-0-0' AND '" . ($search_year+1). "-0-0' )";
}
$sql .= " ORDER BY bk.lettering_code ASC, bk.doc_date ASC" ;//. $db->plimit ( $conf->liste_limit + 1, $offset );
// echo $sql;
// dol_syslog ( "bookkeping:liste:create sql=" . $sql, LOG_DEBUG );
$resql = $db->query ( $sql );
if ($resql) {
$num = $db->num_rows ( $resql );
$i = 0;
print '<form name="add" action="?socid='.$object->id.'" method="POST">';
print '<input type="hidden" name="action" value="lettering">';
print '<input type="hidden" name="socid" value="'.$object->id.'">';
print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print '<td></td>';
print_liste_field_titre ( $langs->trans ( "Doctype" ), "liste.php", "bk.doc_type" );
print_liste_field_titre ( $langs->trans ( "Docdate" ), "liste.php", "bk.doc_date" );
print_liste_field_titre ( $langs->trans ( "Docref" ), "liste.php", "bk.doc_ref" );
// print_liste_field_titre ( $langs->trans ( "Numerocompte" ), "liste.php", "bk.numero_compte" );
// print_liste_field_titre ( $langs->trans ( "Code_tiers" ), "liste.php", "bk.code_tiers" );
print_liste_field_titre ( $langs->trans ( "Labelcompte" ), "liste.php", "bk_label_compte" );
print_liste_field_titre ( $langs->trans ( "Debit" ), "liste.php", "bk.debit" );
print_liste_field_titre ( $langs->trans ( "Credit" ), "liste.php", "bk.credit" );
// print_liste_field_titre ( $langs->trans ( "Amount" ), "liste.php", "bk.montant" );
// print_liste_field_titre ( $langs->trans ( "Sens" ), "liste.php", "bk.sens" );
print_liste_field_titre ( $langs->trans ( "Codejournal" ), "liste.php", "bk.code_journal" );
print '<td></td>';
print '<td></td>';
print "</tr>\n";
print '<tr class="liste_titre">';
print '<form action="" method="GET">';
print '<input type="hidden" name="socid" value="' . $_GET ["socid"] . '">';
print '<td><input type="text" name="search_doc_type" value="' . $_GET ["search_doc_type"] . '"></td>';
print '<td><input type="text" name="search_year" value="' . $_GET ["search_year"] . '"></td>';
print '<td><input type="text" name="search_doc_refe" value="' . $_GET ["search_doc_ref"] . '"></td>';
// print '<td><input type="text" name="search_compte" value="' . $_GET ["search_compte"] . '"></td>';
// print '<td><input type="text" name="search_tiers" value="' . $_GET ["search_tiers"] . '"></td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
// print '<td>&nbsp;</td>';
// print '<td>&nbsp;</td>';
print '<td align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" value="' . dol_escape_htmltag ( $langs->trans ( "Search" ) ) . '" title="' . dol_escape_htmltag ( $langs->trans ( "Search" ) ) . '">';
print '</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '</form>';
print '</tr>';
$var = false;
$debit = 0;
$credit = 0;
$solde = 0;
$tmp = '';
while ( $i < $num ) {
$obj = $db->fetch_object ( $resql );
if($tmp !=$obj->lettering_code || empty($tmp) )
$tmp =$obj->lettering_code;
if($tmp !=$obj->lettering_code || empty($obj->lettering_code))
$var = ! $var;
$debit+= $obj->debit;
$credit+= $obj->credit;
$solde+=($obj->credit-$obj->debit);
print "<tr $bc[$var]>";
print '<td>' . $obj->rowid . '</td>';
if(empty($obj->lettering_code)){
print '<td><a href="'.dol_buildpath('/accountancy/bookkeeping/card.php', 1).'?piece_num=' . $obj->piece_num . '">';
print img_edit ();
print '</a>&nbsp;' . $obj->doc_type . '</td>' . "\n";
}
else
print '<td>'.$obj->doc_type . '</td>' . "\n";
print '<td>' . dol_print_date ( $db->jdate ( $obj->doc_date ), 'day' ) . '</td>';
print '<td>' . $obj->doc_ref . '</td>';
// print '<td>' . $obj->numero_compte . '</td>';
// print '<td>' . $obj->code_tiers . '</td>';
print '<td>' . $obj->label_compte . '</td>';
print '<td>' . $obj->debit . '</td>';
print '<td>' . $obj->credit . '</td>';
// print '<td>' . $obj->montant . '</td>';
// print '<td>' . $obj->sens . '</td>';
print '<td>' . $obj->code_journal . '</td>';
print '<td>' . round($solde, 2) . '</td>';
if(empty($obj->lettering_code)){
print '<td><input type="checkbox" name="ids[]" value="' . $obj->rowid . '" /></td>';
}
else
print '<td>' . $obj->lettering_code . '</td>';
print "</tr>\n";
$i ++;
}
print '<tr class="oddeven">';
print '<td colspan="4">Mouvement totaux</td>' . "\n";
print '<td></td>';
// print '<td></td>';
// print '<td></td>';
print '<td><strong>' . $debit . '</strong></td>';
print '<td><strong>' . $credit . '</strong></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
print "<tr $bc[$var]>";
print '<td colspan="5">Solde Comptable</td>' . "\n";
// print '<td></td>';
// print '<td></td>';
print '<td></td>';
print '<td><strong>' . ($credit-$debit) . '</strong></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
print "</table>";
print '<input class="butAction" type="submit" value="lettering">';
print '<a class="butAction" href="?socid='.$object->id.'&action=autolettrage">auto lettering</a>';
print "</form>";
$db->free($resql);
} else {
dol_print_error($db);
}
// End of page
llxFooter();
$db->close();

View File

@ -0,0 +1,335 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* \file accounting/bookkeeping/thirdparty_lettrage.php
* \ingroup Accounting Expert
* \brief Onglet de gestion de parametrages des ventilations
*/
// Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
$action=GETPOST('action','aZ09');
$massaction=GETPOST('massaction','alpha');
$show_files=GETPOST('show_files','int');
$confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC";
if ($sortfield == "") $sortfield = "bk.rowid";
$search_year = GETPOST ( "search_year" );
// Security check
$socid = GETPOST("socid",'int');
// if ($user->societe_id) $socid=$user->societe_id;
$object = new Societe($db);
$object->id = $socid;
$object->fetch($socid);
$form = new Form($db);
$BookKeeping = new lettering($db);
$formaccounting = new FormAccounting($db);
/*
* Action
*/
if ($action == 'lettering') {
$result = $BookKeeping->updatelettrage($_POST['ids']);
// var_dump($result);
if( $result < 0 ){
setEventMessages('', $BookKeeping->errors, 'errors' );
$error++;
}
}
if ($action == 'autolettrage') {
$result = $BookKeeping->LettrageTiers($socid);
if( $result < 0 ){
setEventMessages('', $BookKeeping->errors, 'errors' );
$error++;
}
}
llxHeader ( '', 'Compta - Grand Livre' );
/*
* Affichage onglets
*/
$head = societe_prepare_head($object);
dol_htmloutput_mesg(is_numeric($error)?'':$error, $errors, 'error');
dol_fiche_head($head, 'TabAccounting', $langs->trans("ThirdParty"),0,'company');
print '<table width="100%" class="border">';
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td><td width="70%" colspan="3">';
$object->next_prev_filter="te.fournisseur = 1";
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
print '<tr>';
print '<td class="nowrap">'.$langs->trans("SupplierCode"). '</td><td colspan="3">';
print $object->code_fournisseur;
if ($object->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
print '</td>';
print '</tr>';
$langs->load('compta');
print '<tr>';
print '<td>';
print $form->editfieldkey("SupplierAccountancyCode",'supplieraccountancycode',$object->code_compta_fournisseur,$object,$user->rights->societe->creer);
print '</td><td colspan="3">';
print $form->editfieldval("SupplierAccountancyCode",'supplieraccountancycode',$object->code_compta_fournisseur,$object,$user->rights->societe->creer);
print '</td>';
print '</tr>';
// Address
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">';
dol_print_address($object->address,'gmap','thirdparty',$object->id);
print '</td></tr>';
// Zip / Town
print '<tr><td class="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'</td>';
print '</tr>';
// Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
//$img=picto_from_langcode($object->country_code);
$img='';
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country;
print '</td></tr>';
print '</table>';
// print_r($soc);
// exit;
// [code_compta] => 411DOUA
// [code_compta_fournisseur] => 401SUPPCODE
/*
* Mode Liste
*
*
*
*/
$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 , bk.piece_num, bk.lettering ";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " WHERE (bk.code_tiers = '" . $object->code_compta_fournisseur . "' AND bk.numero_compte = '" .$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER. "' )" ;
if (dol_strlen ( $search_year )) {
$sql .= " AND ( bk.doc_date BETWEEN '" . $search_year . "-0-0' AND '" . ($search_year+1). "-0-0' )";
}
$sql .= " ORDER BY bk.lettering ASC, bk.doc_date ASC" ;//. $db->plimit ( $conf->liste_limit + 1, $offset );
// echo $sql;
// dol_syslog ( "bookkeping:liste:create sql=" . $sql, LOG_DEBUG );
$resql = $db->query ( $sql );
if ($resql) {
$num = $db->num_rows ( $resql );
$i = 0;
print '<form name="add" action="?socid='.$object->id.'" method="POST">';
print '<input type="hidden" name="action" value="lettering">';
print '<input type="hidden" name="socid" value="'.$object->id.'">';
print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">';
print '<td></td>';
print_liste_field_titre ( $langs->trans ( "Doctype" ), "liste.php", "bk.doc_type" );
print_liste_field_titre ( $langs->trans ( "Docdate" ), "liste.php", "bk.doc_date" );
print_liste_field_titre ( $langs->trans ( "Docref" ), "liste.php", "bk.doc_ref" );
// print_liste_field_titre ( $langs->trans ( "Numerocompte" ), "liste.php", "bk.numero_compte" );
// print_liste_field_titre ( $langs->trans ( "Code_tiers" ), "liste.php", "bk.code_tiers" );
print_liste_field_titre ( $langs->trans ( "Labelcompte" ), "liste.php", "bk_label_compte" );
print_liste_field_titre ( $langs->trans ( "Debit" ), "liste.php", "bk.debit" );
print_liste_field_titre ( $langs->trans ( "Credit" ), "liste.php", "bk.credit" );
print_liste_field_titre ( $langs->trans ( "Amount" ), "liste.php", "bk.montant" );
print_liste_field_titre ( $langs->trans ( "Sens" ), "liste.php", "bk.sens" );
print_liste_field_titre ( $langs->trans ( "Codejournal" ), "liste.php", "bk.code_journal" );
print '<td></td>';
print '<td></td>';
print "</tr>\n";
print '<tr class="liste_titre">';
print '<form action="" method="GET">';
print '<input type="hidden" name="socid" value="' . $_GET ["socid"] . '">';
print '<td><input type="text" name="search_doc_type" value="' . $_GET ["search_doc_type"] . '"></td>';
print '<td><input type="text" name="search_year" value="' . $_GET ["search_year"] . '"></td>';
print '<td><input type="text" name="search_doc_refe" value="' . $_GET ["search_doc_ref"] . '"></td>';
// print '<td><input type="text" name="search_compte" value="' . $_GET ["search_compte"] . '"></td>';
// print '<td><input type="text" name="search_tiers" value="' . $_GET ["search_tiers"] . '"></td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" value="' . dol_escape_htmltag ( $langs->trans ( "Search" ) ) . '" title="' . dol_escape_htmltag ( $langs->trans ( "Search" ) ) . '">';
print '</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '</form>';
print '</tr>';
$var = false;
$debit = 0;
$credit = 0;
$solde = 0;
$tmp = '';
while ( $i < $num ) {
$obj = $db->fetch_object ( $resql );
if($tmp !=$obj->lettering || empty($tmp) )
$tmp =$obj->lettering;
if($tmp !=$obj->lettering || empty($obj->lettering))
$var = ! $var;
$debit+= $obj->debit;
$credit+= $obj->credit;
$solde+=($obj->credit-$obj->debit);
print "<tr $bc[$var]>";
print '<td>' . $obj->rowid . '</td>';
if(empty($obj->lettering)){
print '<td><a href="'.dol_buildpath('/accountancy/bookkeeping/card.php', 1).'?piece_num=' . $obj->piece_num . '">';
print img_edit ();
print '</a>&nbsp;' . $obj->doc_type . '</td>' . "\n";
}
else
print '<td>'.$obj->doc_type . '</td>' . "\n";
print '<td>' . dol_print_date ( $db->jdate ( $obj->doc_date ), 'day' ) . '</td>';
print '<td>' . $obj->doc_ref . '</td>';
// print '<td>' . $obj->numero_compte . '</td>';
// print '<td>' . $obj->code_tiers . '</td>';
print '<td>' . $obj->label_compte . '</td>';
print '<td>' . $obj->debit . '</td>';
print '<td>' . $obj->credit . '</td>';
print '<td>' . $obj->montant . '</td>';
print '<td>' . $obj->sens . '</td>';
print '<td>' . $obj->code_journal . '</td>';
print '<td>' . round($solde, 2) . '</td>';
if(empty($obj->lettering)){
print '<td><input type="checkbox" name="ids[]" value="' . $obj->rowid . '" /></td>';
}
else
print '<td>' . $obj->lettering . '</td>';
print "</tr>\n";
$i ++;
}
print '<tr class="oddeven">';
print '<td colspan="4">Mouvement totaux</td>' . "\n";
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td><strong>' . $debit . '</strong></td>';
print '<td><strong>' . $credit . '</strong></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
print "<tr $bc[$var]>";
print '<td colspan="5">Solde Comptable</td>' . "\n";
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td><strong>' . ($credit-$debit) . '</strong></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
print "</table>";
print '<input class="butAction" type="submit" value="lettering">';
print '<a class="butAction" href="?socid='.$object->id.'&action=autolettrage">auto lettering</a>';
print "</form>";
$db->free ( $resql );
} else {
dol_print_error ( $db );
}
// End of page
llxFooter();
$db->close();

View File

@ -430,6 +430,9 @@ class BookKeeping extends CommonObject
if (empty($this->debit)) $this->debit = 0; if (empty($this->debit)) $this->debit = 0;
if (empty($this->credit)) $this->credit = 0; if (empty($this->credit)) $this->credit = 0;
$this->debit = price2num($this->debit, 'MT');
$this->credit = price2num($this->credit, 'MT');
$now = dol_now(); $now = dol_now();
if (empty($this->date_create)) { if (empty($this->date_create)) {
$this->date_create = $now; $this->date_create = $now;
@ -609,6 +612,7 @@ class BookKeeping extends CommonObject
} }
} }
/** /**
* Load object in memory from the database * Load object in memory from the database
* *
@ -998,6 +1002,9 @@ class BookKeeping extends CommonObject
$this->piece_num = trim($this->piece_num); $this->piece_num = trim($this->piece_num);
} }
$this->debit = price2num($this->debit, 'MT');
$this->credit = price2num($this->credit, 'MT');
// Check parameters // Check parameters
// Put here code to add a control on parameters values // Put here code to add a control on parameters values
@ -1068,9 +1075,10 @@ class BookKeeping extends CommonObject
public function updateByMvt($piece_num='', $field='', $value='', $mode='') { public function updateByMvt($piece_num='', $field='', $value='', $mode='') {
$this->db->begin(); $this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . $mode . " as ab"; $sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . $mode . " as ab";
$sql .= ' SET ab.' . $field . '=' . $value; $sql .= ' SET ab.' . $field . '=' . (is_numeric($value)?$value:"'".$value."'");
$sql .= ' WHERE ab.piece_num=' . $piece_num ; $sql .= ' WHERE ab.piece_num=' . $piece_num ;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { if (! $resql) {
$error ++; $error ++;
$this->errors[] = 'Error ' . $this->db->lasterror(); $this->errors[] = 'Error ' . $this->db->lasterror();
@ -1093,7 +1101,6 @@ class BookKeeping extends CommonObject
* @param User $user User that deletes * @param User $user User that deletes
* @param bool $notrigger false=launch triggers after, true=disable triggers * @param bool $notrigger false=launch triggers after, true=disable triggers
* @param string $mode Mode * @param string $mode Mode
*
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function delete(User $user, $notrigger = false, $mode='') { public function delete(User $user, $notrigger = false, $mode='') {
@ -1576,6 +1583,7 @@ class BookKeeping extends CommonObject
$this->db->rollback(); $this->db->rollback();
return - 1; return - 1;
} }
/*
$sql = "DELETE FROM "; $sql = "DELETE FROM ";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = ab.numero_compte"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = ab.numero_compte";
@ -1584,6 +1592,7 @@ class BookKeeping extends CommonObject
$sql .= " AND asy.rowid = " . $pcgver; $sql .= " AND asy.rowid = " . $pcgver;
$sql .= " AND ab.entity IN (" . getEntity('accountancy') . ")"; $sql .= " AND ab.entity IN (" . getEntity('accountancy') . ")";
$sql .= " ORDER BY account_number ASC"; $sql .= " ORDER BY account_number ASC";
*/
} }
/** /**

View File

@ -0,0 +1,330 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file accountancy/class/bookkeeping.class.php
* \ingroup Accounting Expert
* \brief Fichier de la classe des comptes comptable
*/
include_once DOL_DOCUMENT_ROOT."/accountancy/class/bookkeeping.class.php";
include_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
include_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
/**
* Class lettering
*/
class lettering extends BookKeeping
{
/**
* lettrageTiers
*
* @param int $socid Thirdparty id
* @return void
*/
public function lettrageTiers($socid) {
$db = $this->db;
$object = new Societe($this->db);
$object->id = $socid;
$object->fetch($socid);
if( $object->code_compta == '411CUSTCODE')
$object->code_compta = '';
if( $object->code_compta_fournisseur == '401SUPPCODE')
$object->code_compta_fournisseur = '';
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.lettering_code, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.date_lettering ";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " WHERE code_journal = 'BQ' AND ( ";
if(!empty($object->code_compta) )
$sql .= " bk.code_tiers = '" . $object->code_compta . "' ";
if(!empty($object->code_compta) && !empty($object->code_compta_fournisseur) )
$sql .= " OR ";
if(!empty($object->code_compta_fournisseur) )
$sql .= " bk.code_tiers = '" . $object->code_compta_fournisseur . "' ";
$sql .= " ) AND ( bk.date_lettering ='' OR bk.date_lettering IS NULL ) AND bk.lettering_code !='' ";
$sql .= " GROUP BY bk.lettering_code ";
$resql = $db->query ( $sql );
if ($resql) {
$num = $db->num_rows ( $resql );
$i = 0;
while ( $i < $num ) {
$obj = $db->fetch_object ( $resql );
$i++;
$sql = "SELECT bk.rowid ";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " WHERE bk.lettering_code = '".$obj->lettering_code."' ";
$sql .= " AND ( ";
if(!empty($object->code_compta) )
$sql .= " bk.code_tiers = '" . $object->code_compta . "' ";
if(!empty($object->code_compta) && !empty($object->code_compta_fournisseur) )
$sql .= " OR ";
if(!empty($object->code_compta_fournisseur) )
$sql .= " bk.code_tiers = '" . $object->code_compta_fournisseur . "' ";
$sql .= " ) ";
// echo $sql;
$resql2 = $db->query ( $sql );
if ($resql2) {
$num2 = $db->num_rows ( $resql2 );
$i2 = 0;
$ids = array();
while ( $i2 < $num2 ) {
$obj2 = $db->fetch_object ( $resql2 );
$i2++;
$ids[] = $obj2->rowid;
}
if(count($ids) > 1 ){
$result = $this->updatelettrage($ids);
// var_dump($result);
// if( $result < 0 ){
// setEventMessages('', $BookKeeping->errors, 'errors' );
// $error++;
//
// }
}
}
}
}
/**
Prise en charge des lettering complexe avec prelevment , virement
*/
$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 , bk.piece_num, bk.date_lettering, bu.url_id , bu.type ";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu ON(bk.fk_doc = bu.fk_bank AND bu.type IN ('payment', 'payment_supplier') ) ";
$sql .= " WHERE code_journal = 'BQ' AND ( ";
if(!empty($object->code_compta) )
$sql .= " bk.code_tiers = '" . $object->code_compta . "' ";
if(!empty($object->code_compta) && !empty($object->code_compta_fournisseur) )
$sql .= " OR ";
if(!empty($object->code_compta_fournisseur) )
$sql .= " bk.code_tiers = '" . $object->code_compta_fournisseur . "' ";
$sql .= " ) AND date_lettering ='' ";
$sql .= " GROUP BY bk.lettering_code ";
// echo $sql;
//
$resql = $db->query ( $sql );
if ($resql) {
$num = $db->num_rows ( $resql );
$i = 0;
while ( $i < $num ) {
$obj = $db->fetch_object ( $resql );
$ids = array();
$i++;
// print_r($obj);
if($obj->type =='payment_supplier' ) {
$ids[] = $obj->rowid;
$sql= 'SELECT bk.rowid, facf.ref, facf.ref_supplier, payf.fk_bank ';
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
$sql.= " INNER JOIN " .MAIN_DB_PREFIX . "accounting_bookkeeping as bk ON( bk.fk_doc = facf.ref) ";
// $sqlmid.= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid=facf.fk_soc";
// $sqlmid.= " INNER JOIN " . MAIN_DB_PREFIX . "c_paiement as payc ON payc.id=payf.fk_paiement";
$sql .= " WHERE 1 ";
$sql .= " AND fk_paiementfourn = '".$obj->url_id."' ";
// $sql .= " AND (bk.numero_compte = '" . $object->code_compta . "' OR bk.numero_compte = '" . $object->code_compta_fournisseur . "') ";
$sql .= " AND ( ";
if(!empty($object->code_compta) )
$sql .= " bk.code_tiers = '" . $object->code_compta . "' ";
if(!empty($object->code_compta) && !empty($object->code_compta_fournisseur) )
$sql .= " OR ";
if(!empty($object->code_compta_fournisseur) )
$sql .= " bk.code_tiers = '" . $object->code_compta_fournisseur . "' ";
$sql .= " ) ";
// echo $sql;
// exit;
}
elseif($obj->type =='payment' ){
$ids[] = $obj->rowid;
$sql= 'SELECT bk.rowid,fac.facnumber , pay.fk_bank ';
$sql.= " FROM " . MAIN_DB_PREFIX . "facture fac ";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
$sql.= " INNER JOIN " .MAIN_DB_PREFIX . "accounting_bookkeeping as bk ON( bk.fk_doc = fac.rowid) ";
$sql .= " WHERE 1 ";
$sql .= " AND payfac.fk_paiement = '".$obj->url_id."' ";
$sql .= " AND ( ";
if(!empty($object->code_compta) )
$sql .= " bk.code_tiers = '" . $object->code_compta . "' ";
if(!empty($object->code_compta) && !empty($object->code_compta_fournisseur) )
$sql .= " OR ";
if(!empty($object->code_compta_fournisseur) )
$sql .= " bk.code_tiers = '" . $object->code_compta_fournisseur . "' ";
$sql .= " ) ";
// echo $sql;
}
$resql2 = $db->query ( $sql );
if ($resql2) {
$num2 = $db->num_rows ( $resql2 );
$i2 = 0;
while ( $i2 < $num2 ) {
$obj2 = $db->fetch_object ( $resql2 );
$i2++;
$ids[] = $obj2->rowid;
}
// print_r($ids);
// exit;
if(count($ids) > 1 ){
$result = $this->updatelettrage($ids);
// var_dump($result);
// if( $result < 0 ){
// setEventMessages('', $BookKeeping->errors, 'errors' );
// $error++;
//
// }
}
// exit;
}
}
}
}
public function updatelettrage($ids, $notrigger=false){
$error = 0;
$sql = "SELECT lettering_code FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE ";
$sql .= " lettering_code != '' GROUP BY lettering_code ORDER BY lettering_code DESC limit 1; ";
// echo $sql;
$result = $this->db->query ( $sql );
if ($result) {
$obj = $this->db->fetch_object ( $result );
$lettre = (empty($obj->lettering_code)? 'AAA' : $obj->lettering_code );
if(!empty($obj->lettering_code))
$lettre++;
}
else{
$this->errors[] = 'Error'.$this->db->lasterror();;
$error++;
}
// var_dump(__line__, $error);
$sql = "SELECT SUM(ABS(debit)) as deb, SUM(ABS(credit)) as cred FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE ";
$sql .= " rowid IN (".implode(',', $ids).") ";
$result = $this->db->query ( $sql );
if ($result) {
$obj = $this->db->fetch_object ( $result );
// print_r($obj);
if( !(round(abs($obj->deb),2) === round(abs($obj->cred),2)) ){
// echo $sql;
// print_r($obj);
$this->errors[] = 'Total not exacts '.round(abs($obj->deb),2).' vs '. round(abs($obj->cred),2);
$error++;
}
}
else{
$this->errors[] = 'Erreur sql'.$this->db->lasterror();;
$error++;
}
// Update request
$now = dol_now();
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping SET";
$sql.= " lettering_code='".$lettre."'";
$sql.= " , date_lettering = " .$now ; // todo correct date it's false
$sql.= " WHERE rowid IN (".implode(',', $ids).") ";
// echo $sql ;
//
// var_dump(__line__, $error);
// print_r($this->errors);
// exit;
$this->db->begin();
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
}
// var_dump(__line__, $error);
// Commit or rollback
if ($error)
{
// foreach($this->errors as $errmsg)
// {
// dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
// $this->error.=($this->error?', '.$errmsg:$errmsg);
// }
$this->db->rollback();
// echo $this->error;
// var_dump(__line__, $error);
return -1*$error;
}
else
{
$this->db->commit();
return 1;
}
}
}

View File

@ -189,7 +189,8 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accounta
$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 l.fk_code_ventilation <= 0"; $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND product_type <= 2"; $sql .= " AND product_type <= 2";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')"; $sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='' OR p.accountancy_code_sell NOT IN
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid ='" . $conf->global->CHARTOFACCOUNTS . "'))";
// Add search filter like // Add search filter like
if ($search_lineid) { if ($search_lineid) {
$sql .= natural_search("l.rowid", $search_lineid, 1); $sql .= natural_search("l.rowid", $search_lineid, 1);

View File

@ -75,7 +75,7 @@ $date_endyear = GETPOST('date_endyear');
$in_bookkeeping = GETPOST('in_bookkeeping'); $in_bookkeeping = GETPOST('in_bookkeeping');
$now = dol_now(); $now = dol_now();
$action = GETPOST('action','alpha'); $action = GETPOST('action','aZ09');
// Security check // Security check
if ($user->societe_id > 0 && empty($id_journal)) if ($user->societe_id > 0 && empty($id_journal))
@ -612,7 +612,7 @@ if (! $error && $action == 'writebookkeeping') {
} }
// Export // Export
if ($action == 'export_csv') { if ($action == 'exportcsv') {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
@ -760,7 +760,7 @@ if (empty($action) || $action == 'view') {
<script type="text/javascript"> <script type="text/javascript">
function launch_export() { function launch_export() {
console.log("Set value into form and submit"); console.log("Set value into form and submit");
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv"); $("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click(); $("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val(""); $("div.fiche div.tabBar form input[name=\"action\"]").val("");
} }

View File

@ -106,7 +106,7 @@ $sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don'
if ($date_start && $date_end) if ($date_start && $date_end)
$sql .= " AND er.date_debut >= '" . $db->idate($date_start) . "' AND er.date_debut <= '" . $db->idate($date_end) . "'"; $sql .= " AND er.date_debut >= '" . $db->idate($date_start) . "' AND er.date_debut <= '" . $db->idate($date_end) . "'";
if ($in_bookkeeping == 'yes') if ($in_bookkeeping == 'yes')
$sql .= " AND (er.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='expense_report') )"; $sql .= " AND er.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='expense_report')";
$sql .= " ORDER BY er.date_debut"; $sql .= " ORDER BY er.date_debut";
dol_syslog('accountancy/journal/expensereportsjournal.php:: $sql=' . $sql); dol_syslog('accountancy/journal/expensereportsjournal.php:: $sql=' . $sql);
@ -595,7 +595,7 @@ if (empty($action) || $action == 'view') {
} }
else print $accountoshow; else print $accountoshow;
print "</td>"; print "</td>";
print "<td>" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("subledger_account") . "</td>"; print "<td>" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("SubledgerAccount") . "</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

@ -110,7 +110,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
if ($date_start && $date_end) if ($date_start && $date_end)
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'"; $sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
if ($in_bookkeeping == 'yes') if ($in_bookkeeping == 'yes')
$sql .= " AND (f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='supplier_invoice') )"; $sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='supplier_invoice')";
$sql .= " ORDER BY f.datef"; $sql .= " ORDER BY f.datef";
dol_syslog('accountancy/journal/purchasesjournal.php:: $sql=' . $sql); dol_syslog('accountancy/journal/purchasesjournal.php:: $sql=' . $sql);
@ -226,11 +226,11 @@ if ($action == 'writebookkeeping') {
$bookkeeping->thirdparty_code = $companystatic->code_fournisseur; $bookkeeping->thirdparty_code = $companystatic->code_fournisseur;
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur']; $bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur'];
$bookkeeping->subledger_label = ''; // TODO To complete $bookkeeping->subledger_label = ''; // TODO To complete
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("subledger_account"); $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("SubledgerAccount");
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
$bookkeeping->montant = $mt; $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt <= 0) ? $mt : 0; $bookkeeping->debit = ($mt <= 0) ? -$mt : 0;
$bookkeeping->credit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt > 0) ? $mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label; $bookkeeping->journal_label = $journal_label;
@ -280,7 +280,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->montant = $mt; $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label; $bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
@ -327,7 +327,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->montant = $mt; $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? -$mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label; $bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
@ -391,7 +391,7 @@ $companystatic = new Fournisseur($db);
$invoicestatic = new FactureFournisseur($db); $invoicestatic = new FactureFournisseur($db);
// Export // Export
if ($action == 'export_csv') { if ($action == 'exportcsv') {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
@ -519,7 +519,7 @@ if (empty($action) || $action == 'view') {
print ' print '
<script type="text/javascript"> <script type="text/javascript">
function launch_export() { function launch_export() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv"); $("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click(); $("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val(""); $("div.fiche div.tabBar form input[name=\"action\"]").val("");
} }
@ -629,7 +629,7 @@ if (empty($action) || $action == 'view') {
} }
else print $accountoshow; else print $accountoshow;
print "</td>"; print "</td>";
print "<td>" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("subledger_account") . "</td>"; print "<td>" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("SubledgerAccount") . "</td>";
// print "</td><td>" . $langs->trans("ThirdParty"); // print "</td><td>" . $langs->trans("ThirdParty");
// print ' (' . $companystatic->getNomUrl(0, 'supplier', 16) . ')'; // print ' (' . $companystatic->getNomUrl(0, 'supplier', 16) . ')';
// print "</td>"; // print "</td>";

View File

@ -28,6 +28,7 @@
* \ingroup Advanced accountancy * \ingroup Advanced accountancy
* \brief Page with sells journal * \brief Page with sells journal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
@ -46,7 +47,7 @@ $langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
$id_journal = GETPOST('id_journal', 'int'); $id_journal = GETPOST('id_journal', 'int');
$action = GETPOST('action','alpha'); $action = GETPOST('action','aZ09');
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $date_startday = GETPOST('date_startday');
@ -115,7 +116,7 @@ $sql .= " AND fd.product_type IN (0,1)";
if ($date_start && $date_end) if ($date_start && $date_end)
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'"; $sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
if ($in_bookkeeping == 'yes') if ($in_bookkeeping == 'yes')
$sql .= " AND (f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice') )"; $sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')";
$sql .= " ORDER BY f.datef"; $sql .= " ORDER BY f.datef";
dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG); dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG);
@ -242,11 +243,11 @@ if ($action == 'writebookkeeping') {
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; $bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
$bookkeeping->subledger_label = ''; // TODO To complete $bookkeeping->subledger_label = ''; // TODO To complete
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("subledger_account"); $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount");
$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;
$bookkeeping->credit = ($mt < 0) ? $mt : 0; $bookkeeping->credit = ($mt < 0) ? -$mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label; $bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
@ -292,7 +293,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label; $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $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;
$bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label; $bookkeeping->journal_label = $journal_label;
@ -338,7 +339,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]); $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.join(', ',$def_tva[$key][$k]);
$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;
$bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label; $bookkeeping->journal_label = $journal_label;
@ -404,7 +405,7 @@ if ($action == 'writebookkeeping') {
$form = new Form($db); $form = new Form($db);
// Export // Export
if ($action == 'export_csv') { if ($action == 'exportcsv') {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
@ -529,7 +530,7 @@ if (empty($action) || $action == 'view') {
print ' print '
<script type="text/javascript"> <script type="text/javascript">
function launch_export() { function launch_export() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv"); $("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click(); $("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val(""); $("div.fiche div.tabBar form input[name=\"action\"]").val("");
} }
@ -588,7 +589,7 @@ if (empty($action) || $action == 'view') {
// print "</td><td>" . $langs->trans("ThirdParty"); // print "</td><td>" . $langs->trans("ThirdParty");
// print ' (' . $companystatic->getNomUrl(0, 'customer', 16) . ')'; // print ' (' . $companystatic->getNomUrl(0, 'customer', 16) . ')';
print '</td>'; print '</td>';
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("subledger_account") . "</td>"; print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount") . "</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

@ -191,7 +191,8 @@ $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountan
$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 l.fk_code_ventilation <= 0"; $sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql.= " AND product_type <= 2"; $sql.= " AND product_type <= 2";
$sql.= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_buy IS NULL OR p.accountancy_code_buy ='')"; $sql.= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_buy IS NULL OR p.accountancy_code_buy =''OR p.accountancy_code_buy NOT IN
(SELECT aa.account_number FROM " . MAIN_DB_PREFIX . "accounting_account as aa , " . MAIN_DB_PREFIX . "accounting_system as asy WHERE fk_pcg_version = asy.pcg_version AND asy.rowid ='" . $conf->global->CHARTOFACCOUNTS . "'))";
// Add search filter like // Add search filter like
if ($search_lineid) { if ($search_lineid) {
$sql .= natural_search("l.rowid", $search_lineid, 1); $sql .= natural_search("l.rowid", $search_lineid, 1);

View File

@ -101,7 +101,7 @@ else
$head = member_stats_prepare_head($adh); $head = member_stats_prepare_head($adh);
dol_fiche_head($head, 'statsbyproperties', $langs->trans("Statistics"), 0, 'user'); dol_fiche_head($head, 'statsbyproperties', $langs->trans("Statistics"), -1, 'user');
// Print title // Print title

View File

@ -198,7 +198,7 @@ if ($mode)
$head = member_stats_prepare_head($adh); $head = member_stats_prepare_head($adh);
dol_fiche_head($head, $tab, $langs->trans("Statistics"), 0, 'user'); dol_fiche_head($head, $tab, $langs->trans("Statistics"), -1, 'user');
// Print title // Print title

View File

@ -274,7 +274,7 @@ if ($rowid && $action != 'edit')
$head = subscription_prepare_head($object); $head = subscription_prepare_head($object);
dol_fiche_head($head, 'general', $langs->trans("Subscription"), '', 'payment'); dol_fiche_head($head, 'general', $langs->trans("Subscription"), -1, 'payment');
// Confirmation to delete subscription // Confirmation to delete subscription
if ($action == 'delete') if ($action == 'delete')

View File

@ -53,7 +53,17 @@ $result = $object->fetch($rowid);
$head = subscription_prepare_head($object); $head = subscription_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("Subscription"), '', 'payment'); dol_fiche_head($head, 'info', $langs->trans("Subscription"), -1, 'payment');
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'rowid', $linkback, 1);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
$object->info($rowid); $object->info($rowid);
@ -64,5 +74,7 @@ print '</td></tr></table>';
print '</div>'; print '</div>';
dol_fiche_end();
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -347,8 +347,9 @@ if ($rowid > 0)
/* /*
* Hotbar * Buttons
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// Edit // Edit
@ -482,18 +483,8 @@ if ($rowid > 0)
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Nature"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre // Lignes des champs de filtre
print '<tr class="liste_titre">'; print '<tr class="liste_titre_filter">';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="12"></td>'; print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="12"></td>';
@ -516,6 +507,16 @@ if ($rowid > 0)
print "</tr>\n"; print "</tr>\n";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Nature"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
print "</tr>\n";
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
@ -645,9 +646,9 @@ if ($rowid > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="15%">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="label" size="40" value="'.dol_escape_htmltag($object->label).'"></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" size="40" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>'; print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
print $form->selectyesno("subscription",$object->subscription,1); print $form->selectyesno("subscription",$object->subscription,1);

View File

@ -385,7 +385,7 @@ print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n"; print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n"; print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n"; print '<td align="right">'."\n";
$tmplist=array('show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_list'=>$langs->trans("ViewList"), 'show_peruser'=>$langs->trans("ViewPerUser")); $tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
print '</td></tr>'."\n"; print '</td></tr>'."\n";

View File

@ -174,8 +174,8 @@ $message.='<br>';
print $message; print $message;
$message=$langs->trans("AgendaUrlOptions1",$user->login,$user->login).'<br>'; $message=$langs->trans("AgendaUrlOptions1",$user->login,$user->login).'<br>';
//$message.=$langs->trans("AgendaUrlOptions2",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptions3",$user->login,$user->login).'<br>'; $message.=$langs->trans("AgendaUrlOptions3",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptionsNotAdmin",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'<br>'; $message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptionsProject",$user->login,$user->login); $message.=$langs->trans("AgendaUrlOptionsProject",$user->login,$user->login);

View File

@ -1752,8 +1752,9 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
} }
elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm")
{ {
$type = (! empty($obj->type)?$obj->type:'user'); // Check if type is different of 'user' (external module)
print '<td>'; print '<td>';
print 'user<input type="hidden" name="type" value="user">'; print $type.'<input type="hidden" name="type" value="'.$type.'">';
print '</td>'; print '</td>';
} }
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {

View File

@ -131,9 +131,9 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (is_readable($dir.$file) && preg_match("/^mod(.*)\.class\.php$/i",$file,$reg)) if (is_readable($dir.$file) && preg_match("/^mod(.*)\.class\.php$/i",$file,$regmod))
{ {
$module = strtolower($reg[1]); $module = strtolower($regmod[1]);
$moduledirforclass = getModuleDirForApiClass($module); $moduledirforclass = getModuleDirForApiClass($module);
$moduleforperm = $module; $moduleforperm = $module;
if ($module == 'propale') { $moduleforperm='propal'; } if ($module == 'propale') { $moduleforperm='propal'; }
@ -159,9 +159,9 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
if ($file_searched == 'api_access.class.php') continue; if ($file_searched == 'api_access.class.php') continue;
// Support of the deprecated API. // Support of the deprecated API.
if (is_readable($dir_part.$file_searched) && preg_match("/^api_deprecated_(.*)\.class\.php$/i",$file_searched,$reg)) if (is_readable($dir_part.$file_searched) && preg_match("/^api_deprecated_(.*)\.class\.php$/i",$file_searched,$regapi))
{ {
$classname = ucwords($reg[1]).'Api'; $classname = ucwords($regapi[1]).'Api';
require_once $dir_part.$file_searched; require_once $dir_part.$file_searched;
if (class_exists($classname)) if (class_exists($classname))
{ {
@ -173,9 +173,9 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
dol_syslog("We found an api_xxx file (".$file_searched.") but class ".$classname." does not exists after loading file", LOG_WARNING); dol_syslog("We found an api_xxx file (".$file_searched.") but class ".$classname." does not exists after loading file", LOG_WARNING);
} }
} }
elseif (is_readable($dir_part.$file_searched) && preg_match("/^api_(.*)\.class\.php$/i",$file_searched,$reg)) elseif (is_readable($dir_part.$file_searched) && preg_match("/^api_(.*)\.class\.php$/i",$file_searched,$regapi))
{ {
$classname = ucwords($reg[1]); $classname = ucwords($regapi[1]);
$classname = str_replace('_', '', $classname); $classname = str_replace('_', '', $classname);
require_once $dir_part.$file_searched; require_once $dir_part.$file_searched;
if (class_exists($classname)) if (class_exists($classname))
@ -206,7 +206,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
} }
// Call one APIs or one definition of an API // Call one APIs or one definition of an API
if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json' && preg_match('/^\/resources.json\/(.+)$/', $reg[2], $regbis)))) if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json' && preg_match('/^\/resources.json\/(.+)$/', $reg[2], $regbis) && $regbis[1] != 'root')))
{ {
$module = $reg[1]; $module = $reg[1];
if ($module == 'explorer') // If we call page to explore details of a service if ($module == 'explorer') // If we call page to explore details of a service

View File

@ -37,6 +37,7 @@ $action=GETPOST('action','aZ09');
/* /*
* Actions * Actions
*/ */
if (preg_match('/set_(.*)/',$action,$reg)) if (preg_match('/set_(.*)/',$action,$reg))
{ {
$code=$reg[1]; $code=$reg[1];
@ -82,7 +83,7 @@ print load_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'title_setup')
$head=categoriesadmin_prepare_head(); $head=categoriesadmin_prepare_head();
dol_fiche_head($head, 'setup', $langs->trans("Categories"), 0, 'category'); dol_fiche_head($head, 'setup', $langs->trans("Categories"), -1, 'category');
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -68,7 +68,7 @@ print load_fiche_titre($langs->trans("CategoriesSetup"),$linkback,'title_setup')
$head = categoriesadmin_prepare_head(); $head = categoriesadmin_prepare_head();
dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), 0, 'category'); dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), -1, 'category');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -49,6 +49,7 @@ class Categorie extends CommonObject
const TYPE_MEMBER = 3; // TODO Replace this value with 'member' const TYPE_MEMBER = 3; // TODO Replace this value with 'member'
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact' const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user' const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
const TYPE_ACCOUNT = 5; // TODO Replace this value with 'bank_account' const TYPE_ACCOUNT = 5; // TODO Replace this value with 'bank_account'
const TYPE_PROJECT = 6; const TYPE_PROJECT = 6;
const TYPE_BANK_LINE = 'bank_line'; const TYPE_BANK_LINE = 'bank_line';
@ -447,9 +448,10 @@ class Categorie extends CommonObject
* Delete a category from database * Delete a category from database
* *
* @param User $user Object user that ask to delete * @param User $user Object user that ask to delete
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 KO >0 OK * @return int <0 KO >0 OK
*/ */
function delete($user) function delete($user, $notrigger=0)
{ {
global $conf,$langs; global $conf,$langs;
@ -462,6 +464,14 @@ class Categorie extends CommonObject
$this->db->begin(); $this->db->begin();
if (! $error && ! $notrigger)
{
// Call trigger
$result=$this->call_trigger('CATEGORY_DELETE',$user);
if ($result < 0) $error++;
// End call triggers
}
/* FIX #1317 : Check for child category and move up 1 level*/ /* FIX #1317 : Check for child category and move up 1 level*/
if (! $error) if (! $error)
{ {
@ -580,12 +590,10 @@ class Categorie extends CommonObject
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
$error++; $error++;
} }
else }
{
// Removed extrafields // Removed extrafields
if (! $error) if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{ {
$result=$this->deleteExtraFields(); $result=$this->deleteExtraFields();
if ($result < 0) if ($result < 0)
@ -594,13 +602,6 @@ class Categorie extends CommonObject
dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR);
} }
} }
}
// Call trigger
$result=$this->call_trigger('CATEGORY_DELETE',$user);
if ($result < 0) { $error++; }
// End call triggers
}
}
if (! $error) if (! $error)
{ {
@ -1174,11 +1175,11 @@ class Categorie extends CommonObject
*/ */
if($obj[0] > 0 && $obj[0] != $this->id) if($obj[0] > 0 && $obj[0] != $this->id)
{ {
dol_syslog(get_class($this)."::already_exists category with name=".$this->label." exist rowid=".$obj[0]." current_id=".$this->id, LOG_DEBUG); dol_syslog(get_class($this)."::already_exists category with name=".$this->label." and parent ".$this->fk_parent." exists: rowid=".$obj[0]." current_id=".$this->id, LOG_DEBUG);
return 1; return 1;
} }
} }
dol_syslog(get_class($this)."::already_exists no category with same name=".$this->label." rowid=".$obj[0]." current_id=".$this->id, LOG_DEBUG); dol_syslog(get_class($this)."::already_exists no category with same name=".$this->label." and same parent ".$this->fk_parent." than category id=".$this->id, LOG_DEBUG);
return 0; return 0;
} }
else else

View File

@ -956,7 +956,14 @@ if ($id > 0)
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{ {
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">'; print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
if ($object->type_code != 'AC_OTH_AUTO')
{
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto");
}
else
{
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">'.$langs->trans("Action".$object->type_code);
}
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -1279,7 +1279,7 @@ class ActionComm extends CommonObject
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
// We must filter on assignement table // We must filter on assignement table
if ($filters['logint'] || $filters['login']) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; if ($filters['logint']) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
$sql.= " WHERE a.fk_action=c.id"; $sql.= " WHERE a.fk_action=c.id";
$sql.= " AND a.entity IN (".getEntity('agenda').")"; $sql.= " AND a.entity IN (".getEntity('agenda').")";
foreach ($filters as $key => $value) foreach ($filters as $key => $value)
@ -1291,20 +1291,34 @@ class ActionComm extends CommonObject
if ($key == 'idto') $sql.=" AND a.id <= ".(is_numeric($value)?$value:0); if ($key == 'idto') $sql.=" AND a.id <= ".(is_numeric($value)?$value:0);
if ($key == 'project') $sql.=" AND a.fk_project=".(is_numeric($value)?$value:0); if ($key == 'project') $sql.=" AND a.fk_project=".(is_numeric($value)?$value:0);
// We must filter on assignement table // We must filter on assignement table
if ($key == 'logint' || $key == 'login') $sql.= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; if ($key == 'logint') $sql.= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
if ($key == 'logina') if ($key == 'logina')
{ {
$logina=$value; $logina=$value;
$userforfilter=new User($this->db); $condition='=';
$result=$userforfilter->fetch('',$value); if (preg_match('/^!/',$logina))
$sql.= " AND a.fk_user_author = ".$userforfilter->id; {
$logina=preg_replace('/^!/','',$logina);
$condition='<>';
} }
if ($key == 'logint' || $key == 'login') $userforfilter=new User($this->db);
$result=$userforfilter->fetch('',$logina);
if ($result > 0) $sql.= " AND a.fk_user_author ".$condition." ".$userforfilter->id;
elseif ($result < 0 || $condition == '=') $sql.= " AND a.fk_user_author = 0";
}
if ($key == 'logint')
{ {
$logint=$value; $logint=$value;
$condition='=';
if (preg_match('/^!/',$logint))
{
$logint=preg_replace('/^!/','',$logint);
$condition='<>';
}
$userforfilter=new User($this->db); $userforfilter=new User($this->db);
$result=$userforfilter->fetch('',$value); $result=$userforfilter->fetch('',$logint);
$sql.= " AND ar.fk_element = ".$userforfilter->id; if ($result > 0) $sql.= " AND ar.fk_element = ".$userforfilter->id;
elseif ($result < 0 || $condition == '=') $sql.= " AND ar.fk_element = 0";
} }
} }
$sql.= " AND a.datep IS NOT NULL"; // To exclude corrupted events and avoid errors in lightning/sunbird import $sql.= " AND a.datep IS NOT NULL"; // To exclude corrupted events and avoid errors in lightning/sunbird import

View File

@ -59,9 +59,9 @@ else
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
$search_title=GETPOST('search_title','alpha'); $search_title=GETPOST('search_title','alpha');
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); $dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int'));
$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear')); $datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int'));
$dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear')); $dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int'));
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
@ -168,7 +168,7 @@ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&con
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($actioncode != '') $param.="&actioncode=".$actioncode; if ($actioncode != '') $param.="&actioncode=".$actioncode;
if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($status != '' && $status > -1) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
if ($filtert) $param.="&filtert=".$filtert; if ($filtert) $param.="&filtert=".$filtert;
if ($socid) $param.="&socid=".$socid; if ($socid) $param.="&socid=".$socid;
@ -177,6 +177,13 @@ if ($pid) $param.="&projectid=".$pid;
if ($type) $param.="&type=".$type; if ($type) $param.="&type=".$type;
if ($usergroup) $param.="&usergroup=".$usergroup; if ($usergroup) $param.="&usergroup=".$usergroup;
if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_title != '') $param.='&search_title='.$search_title;
if (GETPOST('datestartday','int')) $param.='&datestartday='.GETPOST('datestartday','int');
if (GETPOST('datestartmonth','int')) $param.='&datestartmonth='.GETPOST('datestartmonth','int');
if (GETPOST('datestartyear','int')) $param.='&datestartyear='.GETPOST('datestartyear','int');
if (GETPOST('dateendday','int')) $param.='&dateendday='.GETPOST('dateendday','int');
if (GETPOST('dateendmonth','int')) $param.='&dateendmonth='.GETPOST('dateendmonth','int');
if (GETPOST('dateendyear','int')) $param.='&dateendyear='.GETPOST('dateendyear','int');
$sql = "SELECT"; $sql = "SELECT";
if ($usergroup > 0) $sql.=" DISTINCT"; if ($usergroup > 0) $sql.=" DISTINCT";
@ -340,11 +347,13 @@ if ($resql)
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
{ {
$newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; $tmpforcreatebutton=dol_getdate(dol_now(), true);
$newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
//$param='month='.$monthshown.'&year='.$year; //$param='month='.$monthshown.'&year='.$year;
$hourminsec='100000'; $hourminsec='100000';
$link = '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d",$year,$month,$day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'">'; $link = '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d",$tmpforcreatebutton['year'],$tmpforcreatebutton['mon'],$tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'">';
$link.= $langs->trans("NewAction"); $link.= $langs->trans("NewAction");
$link.= '</a>'; $link.= '</a>';
} }
@ -520,7 +529,7 @@ if ($resql)
// Status/Percent // Status/Percent
$datep=$db->jdate($obj->datep); $datep=$db->jdate($obj->datep);
print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent,3,1,$datep).'</td>'; print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent,3,0,$datep).'</td>';
print '<td></td>'; print '<td></td>';

View File

@ -618,9 +618,10 @@ class Propal extends CommonObject
* @param array $array_options extrafields array * @param array $array_options extrafields array
* @param string $fk_unit Code of the unit to use. Null to use the default one * @param string $fk_unit Code of the unit to use. Null to use the default one
* @param double $pu_ht_devise Unit price in currency * @param double $pu_ht_devise Unit price in currency
* @param int $notrigger disable line update trigger
* @return int 0 if OK, <0 if KO * @return int 0 if OK, <0 if KO
*/ */
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise = 0) function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise = 0, $notrigger=0)
{ {
global $mysoc; global $mysoc;
@ -745,7 +746,7 @@ class Propal extends CommonObject
$this->line->multicurrency_total_tva = $multicurrency_total_tva; $this->line->multicurrency_total_tva = $multicurrency_total_tva;
$this->line->multicurrency_total_ttc = $multicurrency_total_ttc; $this->line->multicurrency_total_ttc = $multicurrency_total_ttc;
$result=$this->line->update(); $result=$this->line->update($notrigger);
if ($result > 0) if ($result > 0)
{ {
// Reorder if child line // Reorder if child line
@ -909,23 +910,23 @@ class Propal extends CommonObject
$sql.= $this->socid; $sql.= $this->socid;
$sql.= ", 0"; $sql.= ", 0";
$sql.= ", ".$this->remise; $sql.= ", ".$this->remise;
$sql.= ", ".($this->remise_percent?$this->db->escape($this->remise_percent):'null'); $sql.= ", ".($this->remise_percent?$this->db->escape($this->remise_percent):'NULL');
$sql.= ", ".($this->remise_absolue?$this->db->escape($this->remise_absolue):'null'); $sql.= ", ".($this->remise_absolue?$this->db->escape($this->remise_absolue):'NULL');
$sql.= ", 0"; $sql.= ", 0";
$sql.= ", 0"; $sql.= ", 0";
$sql.= ", '".$this->db->idate($this->date)."'"; $sql.= ", '".$this->db->idate($this->date)."'";
$sql.= ", '".$this->db->idate($now)."'"; $sql.= ", '".$this->db->idate($now)."'";
$sql.= ", '(PROV)'"; $sql.= ", '(PROV)'";
$sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null"); $sql.= ", ".($user->id > 0 ? "'".$user->id."'":"NULL");
$sql.= ", '".$this->db->escape($this->note_private)."'"; $sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->db->escape($this->note_public)."'"; $sql.= ", '".$this->db->escape($this->note_public)."'";
$sql.= ", '".$this->db->escape($this->modelpdf)."'"; $sql.= ", '".$this->db->escape($this->modelpdf)."'";
$sql.= ", ".($this->fin_validite!=''?"'".$this->db->idate($this->fin_validite)."'":"null"); $sql.= ", ".($this->fin_validite!=''?"'".$this->db->idate($this->fin_validite)."'":"NULL");
$sql.= ", ".$this->cond_reglement_id; $sql.= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'NULL');
$sql.= ", ".$this->mode_reglement_id; $sql.= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'NULL');
$sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL');
$sql.= ", '".$this->db->escape($this->ref_client)."'"; $sql.= ", '".$this->db->escape($this->ref_client)."'";
$sql.= ", ".($this->date_livraison!=''?"'".$this->db->idate($this->date_livraison)."'":"null"); $sql.= ", ".($this->date_livraison!=''?"'".$this->db->idate($this->date_livraison)."'":"NULL");
$sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:'NULL'); $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:'NULL');
$sql.= ", ".$this->availability_id; $sql.= ", ".$this->availability_id;
$sql.= ", ".$this->demand_reason_id; $sql.= ", ".$this->demand_reason_id;

View File

@ -1359,8 +1359,8 @@ class Commande extends CommonOrder
$this->line->vat_src_code=$vat_src_code; $this->line->vat_src_code=$vat_src_code;
$this->line->tva_tx=$txtva; $this->line->tva_tx=$txtva;
$this->line->localtax1_tx=$txlocaltax1; $this->line->localtax1_tx=$localtaxes_type[1];
$this->line->localtax2_tx=$txlocaltax2; $this->line->localtax2_tx=$localtaxes_type[3];
$this->line->localtax1_type=$localtaxes_type[0]; $this->line->localtax1_type=$localtaxes_type[0];
$this->line->localtax2_type=$localtaxes_type[2]; $this->line->localtax2_type=$localtaxes_type[2];
$this->line->fk_product=$fk_product; $this->line->fk_product=$fk_product;
@ -1411,7 +1411,7 @@ class Commande extends CommonOrder
if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); if (! empty($fk_parent_line)) $this->line_order(true,'DESC');
// Mise a jour informations denormalisees au niveau de la commande meme // Mise a jour informations denormalisees au niveau de la commande meme
$result=$this->update_price(1,'auto'); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. $result=$this->update_price(1,'auto',0,$mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
if ($result > 0) if ($result > 0)
{ {
$this->db->commit(); $this->db->commit();
@ -2778,9 +2778,10 @@ class Commande extends CommonOrder
* @param array $array_options extrafields array * @param array $array_options extrafields array
* @param string $fk_unit Code of the unit to use. Null to use the default one * @param string $fk_unit Code of the unit to use. Null to use the default one
* @param double $pu_ht_devise Amount in currency * @param double $pu_ht_devise Amount in currency
* @param int $notrigger disable line update trigger
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null, $pu_ht_devise = 0) function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null, $pu_ht_devise = 0, $notrigger=0)
{ {
global $conf, $mysoc, $langs, $user; global $conf, $mysoc, $langs, $user;
@ -2935,7 +2936,7 @@ class Commande extends CommonOrder
$this->line->array_options=$array_options; $this->line->array_options=$array_options;
} }
$result=$this->line->update($user); $result=$this->line->update($user, $notrigger);
if ($result > 0) if ($result > 0)
{ {
// Reorder if child line // Reorder if child line
@ -3243,7 +3244,8 @@ class Commande extends CommonOrder
$response->nbtodo++; $response->nbtodo++;
$generic_commande->statut = $obj->fk_statut; $generic_commande->statut = $obj->fk_statut;
$generic_commande->date_livraison = $obj->delivery_date; $generic_commande->date_commande = $this->db->jdate($obj->date_commande);
$generic_commande->date_livraison = $this->db->jdate($obj->delivery_date);
if ($generic_commande->hasDelay()) { if ($generic_commande->hasDelay()) {
$response->nbtodolate++; $response->nbtodolate++;
@ -3370,14 +3372,14 @@ class Commande extends CommonOrder
* Return clicable link of object (with eventually picto) * Return clicable link of object (with eventually picto)
* *
* @param int $withpicto Add picto into link * @param int $withpicto Add picto into link
* @param int $option Where point the link (0=> main card, 1,2 => shipment) * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param int $max Max length to show * @param int $max Max length to show
* @param int $short ??? * @param int $short ???
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto=0, $option=0, $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1) function getNomUrl($withpicto=0, $option='', $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1)
{ {
global $conf, $langs, $user; global $conf, $langs, $user;
@ -3385,7 +3387,7 @@ class Commande extends CommonOrder
$result=''; $result='';
if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; if (! empty($conf->expedition->enabled) && ($option == '1' || $option == '2')) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
else $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id; else $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id;
if ($option !== 'nolink') if ($option !== 'nolink')

View File

@ -37,38 +37,40 @@ if (! $user->rights->banque->transfer)
accessforbidden(); accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$error = 0;
/* /*
* Actions * Actions
*/ */
if ($action == 'add') if ($action == 'add_confirm')
{ {
$langs->load("errors"); $langs->load("errors");
$dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int')); $dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$amount= GETPOST('amount'); $amount= GETPOST('amount');
$amount_to= GETPOST('amount_to');
if (! $label) if (! $label)
{ {
$error=1;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors');
} }
if (! $amount) if (! $amount)
{ {
$error=1; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
} }
if (! GETPOST('account_from','int')) if (! GETPOST('account_from','int'))
{ {
$error=1; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferFrom")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferFrom")), null, 'errors');
} }
if (! GETPOST('account_to','int')) if (! GETPOST('account_to','int'))
{ {
$error=1; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), null, 'errors');
} }
if (! $error) if (! $error)
@ -81,17 +83,16 @@ if ($action == 'add')
$accountto=new Account($db); $accountto=new Account($db);
$accountto->fetch(GETPOST('account_to','int')); $accountto->fetch(GETPOST('account_to','int'));
if (($accountto->id != $accountfrom->id) && ($accountto->currency_code == $accountfrom->currency_code)) if ($accountto->id != $accountfrom->id)
{ {
$db->begin(); $db->begin();
$error=0;
$bank_line_id_from=0; $bank_line_id_from=0;
$bank_line_id_to=0; $bank_line_id_to=0;
$result=0; $result=0;
// By default, electronic transfert from bank to bank // By default, electronic transfert from bank to bank
$typefrom='VIR'; $typefrom='PRE';
$typeto='VIR'; $typeto='VIR';
if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH) if ($accountto->courant == Account::TYPE_CASH || $accountfrom->courant == Account::TYPE_CASH)
{ {
@ -102,7 +103,8 @@ if ($action == 'add')
if (! $error) $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1*price2num($amount), '', '', $user); if (! $error) $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1*price2num($amount), '', '', $user);
if (! ($bank_line_id_from > 0)) $error++; if (! ($bank_line_id_from > 0)) $error++;
if (! $error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amount), '', '', $user); if ((! $error) && ($accountto->currency_code == $accountfrom->currency_code)) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amount), '', '', $user);
if ((! $error) && ($accountto->currency_code != $accountfrom->currency_code)) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amount_to), '', '', $user);
if (! ($bank_line_id_to > 0)) $error++; if (! ($bank_line_id_to > 0)) $error++;
if (! $error) $result=$accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/ligne.php?rowid=', '(banktransfert)', 'banktransfert'); if (! $error) $result=$accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/ligne.php?rowid=', '(banktransfert)', 'banktransfert');
@ -112,7 +114,7 @@ if ($action == 'add')
if (! $error) if (! $error)
{ {
$mesgs = $langs->trans("TransferFromToDone","<a href=\"bankentries.php?id=".$accountfrom->id."\">".$accountfrom->label."</a>","<a href=\"bankentries.php?id=".$accountto->id."\">".$accountto->label."</a>",$amount,$langs->transnoentities("Currency".$conf->currency)); $mesgs = $langs->trans("TransferFromToDone","<a href=\"card.php?id=".$accountfrom->id."\">".$accountfrom->label."</a>","<a href=\"card.php?id=".$accountto->id."\">".$accountto->label."</a>",$amount,$langs->transnoentities("Currency".$conf->currency));
setEventMessages($mesgs, null, 'mesgs'); setEventMessages($mesgs, null, 'mesgs');
$db->commit(); $db->commit();
} }
@ -124,6 +126,7 @@ if ($action == 'add')
} }
else else
{ {
$error++;
setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors'); setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors');
} }
} }
@ -143,6 +146,7 @@ $account_from='';
$account_to=''; $account_to='';
$label=''; $label='';
$amount=''; $amount='';
$amount_to='';
if ($error) if ($error)
{ {
@ -160,11 +164,12 @@ print "<br><br>";
print '<form name="add" method="post" action="'.$_SERVER["PHP_SELF"].'">'; print '<form name="add" method="post" action="'.$_SERVER["PHP_SELF"].'">';
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="add">'; print '<input type="hidden" name="action" value="add_confirm">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("Amount").'</td>'; print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("Description").'</td><td>'.$langs->trans("Amount").'</td>';
print '</tr>'; print '</tr>';
$var=false; $var=false;
@ -181,7 +186,6 @@ $form->select_date((! empty($dateo)?$dateo:''),'','','','','add');
print "</td>\n"; print "</td>\n";
print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.$label.'"></td>'; print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.$label.'"></td>';
print '<td><input name="amount" class="flat" type="text" size="6" value="'.$amount.'"></td>'; print '<td><input name="amount" class="flat" type="text" size="6" value="'.$amount.'"></td>';
print "</table>"; print "</table>";
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Add").'"></div>'; print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Add").'"></div>';

View File

@ -475,7 +475,13 @@ class FactureRec extends CommonInvoice
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_rec WHERE rowid = ".$rowid; $sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_rec WHERE rowid = ".$rowid;
dol_syslog($sql); dol_syslog($sql);
if (! $this->db->query($sql)) if ($this->db->query($sql))
{
// Delete linked object
$res = $this->deleteObjectLinked();
if ($res < 0) $error=-3;
}
else
{ {
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
$error=-1; $error=-1;

View File

@ -2652,9 +2652,10 @@ class Facture extends CommonInvoice
* @param int $situation_percent Situation advance percentage * @param int $situation_percent Situation advance percentage
* @param string $fk_unit Code of the unit to use. Null to use the default one * @param string $fk_unit Code of the unit to use. Null to use the default one
* @param double $pu_ht_devise Unit price in currency * @param double $pu_ht_devise Unit price in currency
* @param int $notrigger disable line update trigger
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=100, $fk_unit = null, $pu_ht_devise = 0) function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=100, $fk_unit = null, $pu_ht_devise = 0, $notrigger=0)
{ {
global $conf,$user; global $conf,$user;
// Deprecation warning // Deprecation warning
@ -2812,7 +2813,7 @@ class Facture extends CommonInvoice
$this->line->array_options=$array_options; $this->line->array_options=$array_options;
} }
$result=$this->line->update($user); $result=$this->line->update($user, $notrigger);
if ($result > 0) if ($result > 0)
{ {
// Reorder if child line // Reorder if child line

View File

@ -594,6 +594,7 @@ if ($resql)
$i = 0; $i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';

View File

@ -173,7 +173,6 @@ class Tva extends CommonObject
// Update request // Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."tva SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."tva SET";
$sql.= " tms=".$this->db->idate($this->tms).","; $sql.= " tms=".$this->db->idate($this->tms).",";
$sql.= " datep=".$this->db->idate($this->datep).","; $sql.= " datep=".$this->db->idate($this->datep).",";
$sql.= " datev=".$this->db->idate($this->datev).","; $sql.= " datev=".$this->db->idate($this->datev).",";
@ -182,9 +181,7 @@ class Tva extends CommonObject
$sql.= " note='".$this->db->escape($this->note)."',"; $sql.= " note='".$this->db->escape($this->note)."',";
$sql.= " fk_bank=".$this->fk_bank.","; $sql.= " fk_bank=".$this->fk_bank.",";
$sql.= " fk_user_creat=".$this->fk_user_creat.","; $sql.= " fk_user_creat=".$this->fk_user_creat.",";
$sql.= " fk_user_modif=".$this->fk_user_modif.""; $sql.= " fk_user_modif=".($this->fk_user_modif>0?$this->fk_user_modif:$user->id)."";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG); dol_syslog(get_class($this)."::update", LOG_DEBUG);

View File

@ -220,22 +220,67 @@ print '</table>';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
print load_fiche_titre($langs->trans("VATPaid"), '', ''); print load_fiche_titre($langs->trans("VATPaid"), '', '');
/* /*
* Payed * Payed
*/ */
$sql = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm"; $sql = "SELECT SUM(amount) as mm, date_format(f.datep,'%Y-%m') as dm";
$sql.= " FROM ".MAIN_DB_PREFIX."tva as f"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as f";
$sql.= " WHERE f.entity = ".$conf->entity; $sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'"; $sql.= " AND f.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'"; $sql.= " AND f.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
$sql.= " GROUP BY dm ORDER BY dm ASC"; $sql.= " GROUP BY dm ORDER BY dm ASC";
pt($db, $sql,$langs->trans("Year")." $y"); pt($db, $sql,$langs->trans("Year")." $y");
print '<br>';
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
{
/*
* Recap
*/
print load_fiche_titre($langs->trans("VATRecap"), '', ''); // need to add translation
$sql1 = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y') as dm";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "tva as f";
$sql1 .= " WHERE f.entity = " . $conf->entity;
$sql1 .= " AND f.datev >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql1 .= " AND f.datev <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql1 .= " GROUP BY dm ORDER BY dm ASC";
$result = $db->query($sql1);
if ($result) {
$obj = $db->fetch_object($result);
print '<table class="noborder" width="100%">';
print "<tr>";
print '<td align="right">' . $langs->trans("VATDue") . '</td>'; // need to add translation
print '<td class="nowrap" align="right">' . price(price2num($total, 1)) . '</td>';
print "</tr>\n";
print "<tr>";
print '<td align="right">' . $langs->trans("VATPaid") . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 1)) . "</td>\n";
print "</tr>\n";
$restopay = $total - $obj->mm;
print "<tr>";
print '<td align="right">' . $langs->trans("VATRestopay") . '</td>'; // need to add translation
print '<td class="nowrap" align="right">' . price(price2num($restopay, 1)) . '</td>';
print "</tr>\n";
print '</table>';
}
}
print '</div></div>'; print '</div></div>';
llxFooter(); llxFooter();

View File

@ -228,7 +228,7 @@ class Contrat extends CommonObject
*/ */
function active_line($user, $line_id, $date, $date_end='', $comment='') function active_line($user, $line_id, $date, $date_end='', $comment='')
{ {
$this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); return $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment);
} }
@ -243,7 +243,7 @@ class Contrat extends CommonObject
*/ */
function close_line($user, $line_id, $date_end, $comment='') function close_line($user, $line_id, $date_end, $comment='')
{ {
$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); return $this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment);
} }

View File

@ -320,34 +320,6 @@ abstract class CommonDocGenerator
} }
/**
* Define array with couple subtitution key => subtitution value
*
* @param Object $object Dolibarr Object
* @param Translate $outputlangs Language object for output
* @param boolean $recursive Want to fetch child array or child object
* @return array Array of substitution key->code
*/
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) {
$array_other = array();
if(!empty($object)) {
foreach($object as $key => $value) {
if(!empty($value)) {
if(!is_array($value) && !is_object($value)) {
$array_other['object_'.$key] = $value;
}
if(is_array($value) && $recursive){
$array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false);
}
}
}
}
return $array_other;
}
/** /**
* Define array with couple substitution key => substitution value * Define array with couple substitution key => substitution value
* *
@ -410,6 +382,15 @@ abstract class CommonDocGenerator
$array_key.'_total_ttc'=>price2num($object->total_ttc), $array_key.'_total_ttc'=>price2num($object->total_ttc),
$array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()), $array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()),
$array_key.'_multicurrency_code' => price2num($object->multicurrency_code),
$array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx),
$array_key.'_multicurrency_total_ht' => price2num($object->multicurrency_total_ht),
$array_key.'_multicurrency_total_tva' => price2num($object->multicurrency_total_tva),
$array_key.'_multicurrency_total_ttc' => price2num($object->multicurrency_total_ttc),
$array_key.'_multicurrency_total_ht_locale' => price($object->multicurrency_total_ht, 0, $outputlangs),
$array_key.'_multicurrency_total_tva_locale' => price($object->multicurrency_total_tva, 0, $outputlangs),
$array_key.'_multicurrency_total_ttc_locale' => price($object->multicurrency_total_ttc, 0, $outputlangs),
$array_key.'_note_private'=>$object->note, $array_key.'_note_private'=>$object->note,
$array_key.'_note_public'=>$object->note_public, $array_key.'_note_public'=>$object->note_public,
$array_key.'_note'=>$object->note_public, // For backward compatibility $array_key.'_note'=>$object->note_public, // For backward compatibility
@ -423,7 +404,7 @@ abstract class CommonDocGenerator
$array_key.'_already_creditnote'=>price2num($sumcreditnote), $array_key.'_already_creditnote'=>price2num($sumcreditnote),
$array_key.'_already_payed_all_locale'=>price(price2num($sumpayed + $sumdeposit + $sumcreditnote, 'MT'), 0, $outputlangs), $array_key.'_already_payed_all_locale'=>price(price2num($sumpayed + $sumdeposit + $sumcreditnote, 'MT'), 0, $outputlangs),
$array_key.'already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'), $array_key.'_already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'),
// Remain to pay with all know infrmation (except open direct debit requests) // Remain to pay with all know infrmation (except open direct debit requests)
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT'), 0, $outputlangs), $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT'), 0, $outputlangs),
@ -493,6 +474,16 @@ abstract class CommonDocGenerator
'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'), 'line_date_end'=>dol_print_date($line->date_end, 'day', 'tzuser'),
'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs), 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzuser', $outputlangs),
'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'), 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc', 'tzuser'),
'line_multicurrency_code' => price2num($line->multicurrency_code),
'line_multicurrency_subprice' => price2num($line->multicurrency_subprice),
'line_multicurrency_total_ht' => price2num($line->multicurrency_total_ht),
'line_multicurrency_total_tva' => price2num($line->multicurrency_total_tva),
'line_multicurrency_total_ttc' => price2num($line->multicurrency_total_ttc),
'line_multicurrency_subprice_locale' => price($line->multicurrency_subprice, 0, $outputlangs),
'line_multicurrency_total_ht_locale' => price($line->multicurrency_total_ht, 0, $outputlangs),
'line_multicurrency_total_tva_locale' => price($line->multicurrency_total_tva, 0, $outputlangs),
'line_multicurrency_total_ttc_locale' => price($line->multicurrency_total_ttc, 0, $outputlangs),
); );
// Retrieve extrafields // Retrieve extrafields
@ -601,6 +592,33 @@ abstract class CommonDocGenerator
); );
} }
/**
* Define array with couple subtitution key => subtitution value
*
* @param Object $object Dolibarr Object
* @param Translate $outputlangs Language object for output
* @param boolean $recursive Want to fetch child array or child object
* @return array Array of substitution key->code
*/
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) {
$array_other = array();
if(!empty($object)) {
foreach($object as $key => $value) {
if(!empty($value)) {
if(!is_array($value) && !is_object($value)) {
$array_other['object_'.$key] = $value;
}
if(is_array($value) && $recursive){
$array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false);
}
}
}
}
return $array_other;
}
/** /**
* Fill array with couple extrafield key => extrafield value * Fill array with couple extrafield key => extrafield value
* *

View File

@ -600,6 +600,20 @@ abstract class CommonObject
$datecreate = dol_now(); $datecreate = dol_now();
// Socpeople must have already been added by some a trigger, then we have to check it to avoid DB_ERROR_RECORD_ALREADY_EXISTS error
$TListeContacts=$this->liste_contact(-1, $source);
$already_added=false;
if(!empty($TListeContacts)) {
foreach($TListeContacts as $array_contact) {
if($array_contact['status'] == 4 && $array_contact['id'] == $fk_socpeople && $array_contact['fk_c_type_contact'] == $id_type_contact) {
$already_added=true;
break;
}
}
}
if(!$already_added) {
$this->db->begin(); $this->db->begin();
// Insertion dans la base // Insertion dans la base
@ -632,6 +646,7 @@ abstract class CommonObject
{ {
$this->error=$this->db->errno(); $this->error=$this->db->errno();
$this->db->rollback(); $this->db->rollback();
echo 'err rollback';
return -2; return -2;
} }
else else
@ -641,6 +656,7 @@ abstract class CommonObject
return -1; return -1;
} }
} }
} else return 0;
} }
/** /**

View File

@ -58,7 +58,7 @@ class DolEditor
* 'Out:name' share toolbar into the div called 'name' * 'Out:name' share toolbar into the div called 'name'
* @param boolean $toolbarstartexpanded Bar is visible or not at start * @param boolean $toolbarstartexpanded Bar is visible or not at start
* @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. * @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content.
* @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor) * @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor). If false, use simple textarea.
* @param int $rows Size of rows for textarea tool * @param int $rows Size of rows for textarea tool
* @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%')
* @param int $readonly 0=Read/Edit, 1=Read only * @param int $readonly 0=Read/Edit, 1=Read only
@ -100,7 +100,7 @@ class DolEditor
$this->editor->Height = $height; $this->editor->Height = $height;
if (! empty($width)) $this->editor->Width = $width; if (! empty($width)) $this->editor->Width = $width;
$this->editor->ToolbarSet = $shorttoolbarname; // Profile of this toolbar set is deinfed into theme/mytheme/ckeditor/config.js $this->editor->ToolbarSet = $shorttoolbarname; // Profile of this toolbar set is deinfed into theme/mytheme/ckeditor/config.js
$this->editor->Config['AutoDetectLanguage'] = 'true'; $this->editor->Config['AutoDetectLanguage'] = 'true'; // Language of user (browser)
$this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In'; $this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In';
$this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded; $this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded;

View File

@ -6098,7 +6098,9 @@ class Form
*/ */
global $dolibarr_main_url_root; global $dolibarr_main_url_root;
$ret.='<!-- Put link to gravatar -->'; $ret.='<!-- Put link to gravatar -->';
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.urlencode(dol_buildpath($nophoto,3)).'">'; // gravatar need md5 hash //$defaultimg=urlencode(dol_buildpath($nophoto,3));
$defaultimg='mm';
$ret.='<img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)),3).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
} }
else else
{ {

View File

@ -262,6 +262,8 @@ class Interfaces
{ {
if (is_readable($newdir.'/'.$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/',$file,$reg)) if (is_readable($newdir.'/'.$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/',$file,$reg))
{ {
if (preg_match('/\.back$/',$file)) continue;
$part1=$reg[1]; $part1=$reg[1];
$part2=$reg[2]; $part2=$reg[2];
$part3=$reg[3]; $part3=$reg[3];
@ -335,7 +337,7 @@ class Interfaces
$triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key]; $triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key];
$triggers[$j]['version'] = $objMod->getVersion(); $triggers[$j]['version'] = $objMod->getVersion();
$triggers[$j]['status'] = img_picto($langs->trans("Active"),'tick'); $triggers[$j]['status'] = img_picto($langs->trans("Active"),'tick');
if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = "&nbsp;"; if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = '';
$text ='<b>'.$langs->trans("Description").':</b><br>'; $text ='<b>'.$langs->trans("Description").':</b><br>';
$text.=$objMod->getDesc().'<br>'; $text.=$objMod->getDesc().'<br>';

View File

@ -735,7 +735,7 @@ class DoliDBMysqli extends DoliDB
{ {
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD `".$field_name."` "; $sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
$sql.= $field_desc['type']; $sql.= $field_desc['type'];
if(preg_match("/^[^\s]/i",$field_desc['value'])) if(preg_match("/^[^\s]/i",$field_desc['value']))
if (! in_array($field_desc['type'],array('date','datetime'))) if (! in_array($field_desc['type'],array('date','datetime')))

View File

@ -1048,8 +1048,11 @@ class DoliDBPgsql extends DoliDB
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
$sql .= $field_desc['type']; $sql .= $field_desc['type'];
if ($field_desc['type'] != 'int' && preg_match("/^[^\s]/i",$field_desc['value'])) if(preg_match("/^[^\s]/i",$field_desc['value']))
if (! in_array($field_desc['type'],array('int','date','datetime')))
{
$sql.= "(".$field_desc['value'].")"; $sql.= "(".$field_desc['value'].")";
}
if (preg_match("/^[^\s]/i",$field_desc['attribute'])) if (preg_match("/^[^\s]/i",$field_desc['attribute']))
$sql .= " ".$field_desc['attribute']; $sql .= " ".$field_desc['attribute'];
if (preg_match("/^[^\s]/i",$field_desc['null'])) if (preg_match("/^[^\s]/i",$field_desc['null']))

View File

@ -429,7 +429,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
break; break;
case 'aZ09': case 'aZ09':
$out=trim($out); $out=trim($out);
if (preg_match('/[^a-z0-9_\-]+/i',$out)) $out=''; if (preg_match('/[^a-z0-9_\-\.]+/i',$out)) $out='';
break; break;
case 'array': case 'array':
if (! is_array($out) || empty($out)) $out=array(); if (! is_array($out) || empty($out)) $out=array();
@ -2463,12 +2463,12 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie',
* MAIN_DISABLE_TRUNC=1 can disable all truncings * MAIN_DISABLE_TRUNC=1 can disable all truncings
* *
* @param string $string String to truncate * @param string $string String to truncate
* @param int $size Max string size visible. 0 for no limit. Final string size can be 1 more (if size was max+1) or 3 more (if we added ...) * @param int $size Max string size visible (excluding ...). 0 for no limit. WARNING: Final string size can have 3 more chars (if we added ..., or if size was max+1 or max+2 or max+3 so it does not worse to replace with ...)
* @param string $trunc Where to trunc: right, left, middle (size must be a 2 power), wrap * @param string $trunc Where to trunc: right, left, middle (size must be a 2 power), wrap
* @param string $stringencoding Tell what is source string encoding * @param string $stringencoding Tell what is source string encoding
* @param int $nodot Truncation do not add ... after truncation. So it's an exact truncation. * @param int $nodot Truncation do not add ... after truncation. So it's an exact truncation.
* @param int $display Trunc is use to display and can be changed for small screen. TODO Remove this param (must be dealt with CSS) * @param int $display Trunc is use to display and can be changed for small screen. TODO Remove this param (must be dealt with CSS)
* @return string Truncated string * @return string Truncated string. WARNING: length is never higher than $size if $nodot is set, but can be 3 chars higher otherwise.
*/ */
function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodot=0, $display=0) function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodot=0, $display=0)
{ {
@ -2484,9 +2484,10 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
if ($trunc == 'right') if ($trunc == 'right')
{ {
$newstring=dol_textishtml($string)?dol_string_nohtmltag($string,1):$string; $newstring=dol_textishtml($string)?dol_string_nohtmltag($string,1):$string;
if (dol_strlen($newstring,$stringencoding) > ($size+($nodot?0:1))) if (dol_strlen($newstring,$stringencoding) > ($size+($nodot?0:3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ...
return dol_substr($newstring,0,$size,$stringencoding).($nodot?'':'...'); return dol_substr($newstring,0,$size,$stringencoding).($nodot?'':'...');
else else
//return 'u'.$size.'-'.$newstring.'-'.dol_strlen($newstring,$stringencoding).'-'.$string;
return $string; return $string;
} }
elseif ($trunc == 'middle') elseif ($trunc == 'middle')
@ -2504,7 +2505,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
elseif ($trunc == 'left') elseif ($trunc == 'left')
{ {
$newstring=dol_textishtml($string)?dol_string_nohtmltag($string,1):$string; $newstring=dol_textishtml($string)?dol_string_nohtmltag($string,1):$string;
if (dol_strlen($newstring,$stringencoding) > ($size+1)) if (dol_strlen($newstring,$stringencoding) > ($size+($nodot?0:3))) // If nodot is 0 and size is 1,2 or 3 chars more, we don't trunc and don't add ...
return '...'.dol_substr($newstring,dol_strlen($newstring,$stringencoding) - $size,$size,$stringencoding); return '...'.dol_substr($newstring,dol_strlen($newstring,$stringencoding) - $size,$size,$stringencoding);
else else
return $string; return $string;
@ -4160,7 +4161,7 @@ function getTaxesFromId($vatrate, $buyer=null, $seller=null, $firstparamisid=1)
* @param Societe $buyer Company object * @param Societe $buyer Company object
* @param Societe $seller Company object * @param Societe $seller Company object
* @param int $firstparamisid 1 if first param is id into table (use this if you can) * @param int $firstparamisid 1 if first param is id into table (use this if you can)
* @return array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type1, rate localtax2, accountancycodecust, accountancycodesupp) * @return array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type2, rate localtax2, accountancycodecust, accountancycodesupp)
* @see getTaxesFromId * @see getTaxesFromId
*/ */
function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0) function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0)

0
htdocs/core/lib/functions2.lib.php Executable file → Normal file
View File

View File

@ -345,16 +345,18 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
* @param Societe|Contact $thirdparty Contact or thirdparty * @param Societe|Contact $thirdparty Contact or thirdparty
* @param Translate $outputlangs Output language * @param Translate $outputlangs Output language
* @param int $includealias 1=Include alias name after name * @param int $includealias 1=Include alias name after name
* @return string * @return string String with name of thirdparty (+ alias if requested)
*/ */
function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0) function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
{ {
global $conf;
// Recipient name // Recipient name
$socname = ''; $socname = '';
if ($thirdparty instanceof Societe) { if ($thirdparty instanceof Societe) {
$socname .= $thirdparty->name; $socname .= $thirdparty->name;
if ($includealias && !empty($thirdparty->name_alias)) { if (($includealias || ! empty($conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME)) && !empty($thirdparty->name_alias)) {
$socname .= "\n".$thirdparty->name_alias; $socname .= "\n".$thirdparty->name_alias;
} }
} elseif ($thirdparty instanceof Contact) { } elseif ($thirdparty instanceof Contact) {

View File

@ -357,6 +357,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
$sql = "SELECT rowid, code, label, nature"; $sql = "SELECT rowid, code, label, nature";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal";
$sql.= " WHERE entity = ".$conf->entity; $sql.= " WHERE entity = ".$conf->entity;
$sql.= " active = 1";
$sql.= " ORDER BY label"; $sql.= " ORDER BY label";
$resql = $db->query($sql); $resql = $db->query($sql);
@ -373,10 +374,10 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
$nature=''; $nature='';
// Must match array $sourceList defined into journals_list.php // Must match array $sourceList defined into journals_list.php
if ($objp->nature == 2) $nature="sells"; if ($objp->nature == 2 && ! empty($conf->facture->enabled)) $nature="sells";
if ($objp->nature == 3) $nature="purchases"; if ($objp->nature == 3 && ! empty($conf->fournisseur->enabled)) $nature="purchases";
if ($objp->nature == 4) $nature="bank"; if ($objp->nature == 4 && ! empty($conf->banque->enabled)) $nature="bank";
if ($objp->nature == 5) $nature="expensereports"; if ($objp->nature == 5 && ! empty($conf->expensereport->enabled)) $nature="expensereports";
if ($objp->nature == 1) $nature="various"; if ($objp->nature == 1) $nature="various";
if ($objp->nature == 9) $nature="hasnew"; if ($objp->nature == 9) $nature="hasnew";

View File

@ -992,6 +992,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$sql = "SELECT rowid, code, label, nature"; $sql = "SELECT rowid, code, label, nature";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal";
$sql.= " WHERE entity = ".$conf->entity; $sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND active = 1";
$sql.= " ORDER BY label"; $sql.= " ORDER BY label";
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -617,7 +617,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
* Gives the long description of a module. First check README-la_LA.md then README.md * Gives the long description of a module. First check README-la_LA.md then README.md
* If not markdown files found, it return translated value of the key ->descriptionlong. * If not markdown files found, it return translated value of the key ->descriptionlong.
* *
* @return string Long description of a module * @return string Long description of a module from README.md of from property.
*/ */
function getDescLong() function getDescLong()
{ {
@ -627,25 +627,9 @@ class DolibarrModules // Can not be abstract, because we need to insta
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
$filefound= false; $pathoffile = $this->getDescLongReadmeFound();
// Define path to file README.md. if ($pathoffile) // Mostly for external modules
// First check README-la_LA.md then README.md
$pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$langs->defaultlang.'.md', 0);
if (dol_is_file($pathoffile))
{
$filefound = true;
}
if (! $filefound)
{
$pathoffile = dol_buildpath(strtolower($this->name).'/README.md', 0);
if (dol_is_file($pathoffile))
{
$filefound = true;
}
}
if ($filefound) // Mostly for external modules
{ {
$content = file_get_contents($pathoffile); $content = file_get_contents($pathoffile);
@ -683,6 +667,35 @@ class DolibarrModules // Can not be abstract, because we need to insta
return $content; return $content;
} }
/**
* Return path of file if a README file was found.
*
* @return string Path of file if a README file was found.
*/
function getDescLongReadmeFound()
{
$filefound= false;
// Define path to file README.md.
// First check README-la_LA.md then README.md
$pathoffile = dol_buildpath(strtolower($this->name).'/README-'.$langs->defaultlang.'.md', 0);
if (dol_is_file($pathoffile))
{
$filefound = true;
}
if (! $filefound)
{
$pathoffile = dol_buildpath(strtolower($this->name).'/README.md', 0);
if (dol_is_file($pathoffile))
{
$filefound = true;
}
}
return ($filefound?$pathoffile:'');
}
/** /**
* Gives the changelog. First check ChangeLog-la_LA.md then ChangeLog.md * Gives the changelog. First check ChangeLog-la_LA.md then ChangeLog.md
* *
@ -1508,11 +1521,11 @@ class DolibarrModules // Can not be abstract, because we need to insta
// Clean // Clean
if (empty($visible)) $visible='0'; if (empty($visible)) $visible='0';
if (empty($val)) $val=''; if (empty($val) && $val != '0') $val='';
$sql = "SELECT count(*)"; $sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."const"; $sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE ".$this->db->decrypt('name')." = '".$name."'"; $sql.= " WHERE ".$this->db->decrypt('name')." = '".$this->db->escape($name)."'";
$sql.= " AND entity = ".$entity; $sql.= " AND entity = ".$entity;
$result=$this->db->query($sql); $result=$this->db->query($sql);
@ -1526,7 +1539,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= $this->db->encrypt($name,1); $sql.= $this->db->encrypt($name,1);
$sql.= ",'".$type."'"; $sql.= ",'".$type."'";
$sql.= ",".($val?$this->db->encrypt($val,1):"''"); $sql.= ",".(($val != '')?$this->db->encrypt($val,1):"''");
$sql.= ",".($note?"'".$this->db->escape($note)."'":"null"); $sql.= ",".($note?"'".$this->db->escape($note)."'":"null");
$sql.= ",'".$visible."'"; $sql.= ",'".$visible."'";
$sql.= ",".$entity; $sql.= ",".$entity;

View File

@ -146,7 +146,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {

View File

@ -132,7 +132,7 @@ class pdf_crabe extends ModelePDFFactures
$this->posxdiscount=162; $this->posxdiscount=162;
$this->posxprogress=126; // Only displayed for situation invoices $this->posxprogress=126; // Only displayed for situation invoices
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {

View File

@ -292,10 +292,11 @@ class ImportXlsx extends ModeleImports
* @param Object $objimport Object import (contains objimport->array_import_tables, objimport->array_import_fields, objimport->array_import_convertvalue, ...) * @param Object $objimport Object import (contains objimport->array_import_tables, objimport->array_import_fields, objimport->array_import_convertvalue, ...)
* @param int $maxfields Max number of fields to use * @param int $maxfields Max number of fields to use
* @param string $importid Import key * @param string $importid Import key
* @param array $updatekeys Array of keys to use to try to do update
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// What is this doing here ? it is common to all imports, is should be in the parent class // What is this doing here ? it is common to all imports, is should be in the parent class
function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid) function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys)
{ {
global $langs,$conf,$user; global $langs,$conf,$user;
global $thirdparty_static; // Specific to thirdparty import global $thirdparty_static; // Specific to thirdparty import
@ -326,13 +327,15 @@ class ImportXlsx extends ModeleImports
else else
{ {
$last_insert_id_array = array(); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id (eg: extrafields fk_object will be set with the last inserted object's id) $last_insert_id_array = array(); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id (eg: extrafields fk_object will be set with the last inserted object's id)
$updatedone = false;
$insertdone = false;
// For each table to insert, me make a separate insert // For each table to insert, me make a separate insert
foreach($objimport->array_import_tables[0] as $alias => $tablename) foreach($objimport->array_import_tables[0] as $alias => $tablename)
{ {
// Build sql request // Build sql request
$sql=''; $sql='';
$listfields=''; $listfields=array();
$listvalues=''; $listvalues=array();
$i=0; $i=0;
$errorforthistable=0; $errorforthistable=0;
@ -399,7 +402,7 @@ class ImportXlsx extends ModeleImports
if ($isidorref == 'ref') // If value into input import file is a ref, we apply the function defined into descriptor if ($isidorref == 'ref') // If value into input import file is a ref, we apply the function defined into descriptor
{ {
$file=$objimport->array_import_convertvalue[0][$val]['classfile']; $file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']);
$class=$objimport->array_import_convertvalue[0][$val]['class']; $class=$objimport->array_import_convertvalue[0][$val]['class'];
$method=$objimport->array_import_convertvalue[0][$val]['method']; $method=$objimport->array_import_convertvalue[0][$val]['method'];
if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] != '') if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] != '')
@ -408,7 +411,12 @@ class ImportXlsx extends ModeleImports
} }
else else
{ {
dol_include_once($file); $resultload = dol_include_once($file);
if (empty($resultload))
{
dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method);
break;
}
$classinstance=new $class($this->db); $classinstance=new $class($this->db);
// Try the fetch from code or ref // Try the fetch from code or ref
call_user_func_array(array($classinstance, $method),array('', $newval)); call_user_func_array(array($classinstance, $method),array('', $newval));
@ -481,6 +489,26 @@ class ImportXlsx extends ModeleImports
} }
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
} }
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getrefifauto')
{
$defaultref='';
// TODO provide the $modTask (module of generation of ref) as parameter of import_insert function
$obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON;
if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php"))
{
require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php';
$modTask = new $obj;
$defaultref = $modTask->getNextValue(null,null);
}
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
$newval=$defaultref;
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
{
$newval = price2num($newval);
}
//print 'Val to use as insert is '.$newval.'<br>'; //print 'Val to use as insert is '.$newval.'<br>';
} }
@ -541,41 +569,36 @@ class ImportXlsx extends ModeleImports
} }
// Define $listfields and $listvalues to build SQL request // Define $listfields and $listvalues to build SQL request
if ($listfields) { $listfields.=', '; $listvalues.=', '; } $listfields[] = $fieldname;
$listfields.=$fieldname;
// Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert
if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues.=($newval=='0'?$newval:"null"); if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues[] = ($newval=='0'?$newval:"null");
elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues.="''"; elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues[] = "''";
else $listvalues.="'".$this->db->escape($newval)."'"; else $listvalues[] = "'".$this->db->escape($newval)."'";
} }
$i++; $i++;
} }
// We add hidden fields (but only if there is at least one field to add into table) // We add hidden fields (but only if there is at least one field to add into table)
if ($listfields && is_array($objimport->array_import_fieldshidden[0])) if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0]))
{ {
// Loop on each hidden fields to add them into listfields/listvalues // Loop on each hidden fields to add them into listfields/listvalues
foreach($objimport->array_import_fieldshidden[0] as $key => $val) foreach($objimport->array_import_fieldshidden[0] as $key => $val)
{ {
if (! preg_match('/^'.preg_quote($alias).'\./', $key)) continue; // Not a field of current table if (! preg_match('/^'.preg_quote($alias).'\./', $key)) continue; // Not a field of current table
if ($listfields) { $listfields.=', '; $listvalues.=', '; }
if ($val == 'user->id') if ($val == 'user->id')
{ {
$listfields.=preg_replace('/^'.preg_quote($alias).'\./','',$key); $listfields[] = preg_replace('/^'.preg_quote($alias).'\./','',$key);
$listvalues.=$user->id; $listvalues[] = $user->id;
} }
elseif (preg_match('/^lastrowid-/',$val)) elseif (preg_match('/^lastrowid-/',$val))
{ {
$tmp=explode('-',$val); $tmp=explode('-',$val);
$lastinsertid=(isset($last_insert_id_array[$tmp[1]]))?$last_insert_id_array[$tmp[1]]:0; $lastinsertid=(isset($last_insert_id_array[$tmp[1]]))?$last_insert_id_array[$tmp[1]]:0;
$listfields.=preg_replace('/^'.preg_quote($alias).'\./','',$key); $keyfield = preg_replace('/^'.preg_quote($alias).'\./','',$key);
$listvalues.=$lastinsertid; $listfields[] = $keyfield;
$listvalues[] = $lastinsertid;
//print $key."-".$val."-".$listfields."-".$listvalues."<br>";exit; //print $key."-".$val."-".$listfields."-".$listvalues."<br>";exit;
} else
{
$listfields.=preg_replace('/^'.preg_quote($alias).'\./','',$key);
$listvalues.=$val;
} }
} }
} }
@ -585,41 +608,39 @@ class ImportXlsx extends ModeleImports
if (! $errorforthistable) if (! $errorforthistable)
{ {
//print "$alias/$tablename/$listfields/$listvalues<br>"; //print "$alias/$tablename/$listfields/$listvalues<br>";
if ($listfields) if (!empty($listfields))
{ {
//var_dump($objimport->array_import_convertvalue); exit; $updatedone = false;
$insertdone = false;
if (!empty($updatekeys)) {
// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
if (empty($lastinsertid)) {
$sqlSelect = 'SELECT rowid FROM '.$tablename;
// Build SQL request $data = array_combine($listfields, $listvalues);
if (empty($tablewithentity_cache[$tablename])) $where = array();
{ $filters = array();
$sql ='INSERT INTO '.$tablename.'('.$listfields.', import_key'; foreach ($updatekeys as $key) {
if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$objimport->array_import_tables_creator[0][$alias]; $col = $objimport->array_import_updatekeys[0][$key];
$sql.=') VALUES('.$listvalues.", '".$importid."'"; $key=preg_replace('/^.*\./i','',$key);
$where[] = $key.' = '.$data[$key];
$filters[] = $col.' = '.$data[$key];
} }
else $sqlSelect.= ' WHERE '.implode(' AND ', $where);
{
$sql ='INSERT INTO '.$tablename.'('.$listfields.', import_key, entity'; $resql=$this->db->query($sqlSelect);
if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$objimport->array_import_tables_creator[0][$alias]; if($resql) {
$sql.=') VALUES('.$listvalues.", '".$importid."', ".$conf->entity ; $res = $this->db->fetch_object($resql);
if($resql->num_rows == 1) {
$lastinsertid = $res->rowid;
$last_insert_id_array[$tablename] = $lastinsertid;
} else if($resql->num_rows > 1) {
$this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', '));
$this->errors[$error]['type']='SQL';
$error++;
} else {
// No record found with filters, insert will be tried below
} }
if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$user->id;
$sql.=')';
//print($sql).'<br>';
dol_syslog("import_csv.modules", LOG_DEBUG);
//print '> '.join(',',$arrayrecord);
//print 'sql='.$sql;
//print '<br>'."\n";
// Run insert request
if ($sql)
{
$resql=$this->db->query($sql);
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
if ($resql)
{
//print '.';
} }
else else
{ {
@ -629,6 +650,73 @@ class ImportXlsx extends ModeleImports
$error++; $error++;
} }
} }
if (!empty($lastinsertid)) {
// Build SQL UPDATE request
$sqlstart = 'UPDATE '.$tablename;
$data = array_combine($listfields, $listvalues);
$set = array();
foreach ($data as $key => $val) {
$set[] = $key.' = '.$val;
}
$sqlstart.= ' SET '.implode(', ', $set);
if(empty($keyfield)) $keyfield = 'rowid';
$sqlend = ' WHERE '.$keyfield.' = '.$lastinsertid;
$sql = $sqlstart.$sqlend;
// Run update request
$resql=$this->db->query($sql);
if($resql) {
// No error, update has been done. $this->db->db->affected_rows can be 0 if data hasn't changed
$updatedone = true;
}
else
{
//print 'E';
$this->errors[$error]['lib']=$this->db->lasterror();
$this->errors[$error]['type']='SQL';
$error++;
}
}
}
// Update not done, we do insert
if (!$error && !$updatedone) {
// Build SQL INSERT request
$sqlstart = 'INSERT INTO '.$tablename.'('.implode(', ', $listfields).', import_key';
$sqlend = ') VALUES('.implode(', ', $listvalues).", '".$importid."'";
if (! empty($tablewithentity_cache[$tablename])) {
$sqlstart.= ', entity';
$sqlend.= ', '.$conf->entity;
}
if (! empty($objimport->array_import_tables_creator[0][$alias])) {
$sqlstart.= ', '.$objimport->array_import_tables_creator[0][$alias];
$sqlend.=', '.$user->id;
}
$sql = $sqlstart.$sqlend.')';
dol_syslog("import_xlsx.modules", LOG_DEBUG);
// Run insert request
if ($sql)
{
$resql=$this->db->query($sql);
if ($resql)
{
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
$insertdone = true;
}
else
{
//print 'E';
$this->errors[$error]['lib']=$this->db->lasterror();
$this->errors[$error]['type']='SQL';
$error++;
}
}
}
} }
/*else /*else
{ {
@ -638,6 +726,9 @@ class ImportXlsx extends ModeleImports
if ($error) break; if ($error) break;
} }
if($updatedone) $this->nbupdate++;
if($insertdone) $this->nbinsert++;
} }
return 1; return 1;

View File

@ -120,7 +120,7 @@ class pdf_azur extends ModelePDFPropales
} }
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_payment/modules_supplier
/** /**
* Class to manage customer payment numbering rules Ant * Class to manage customer payment numbering rules Ant
*/ */
class mod_supplier_payment_brodator extends ModeleNumRefPayments class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments
{ {
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $error = ''; var $error = '';

View File

@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_payment/modules_supplier
/** /**
* Class to manage customer payment numbering rules Cicada * Class to manage customer payment numbering rules Cicada
*/ */
class mod_supplier_payment_bronan extends ModeleNumRefPayments class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments
{ {
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='SPAY'; var $prefix='SPAY';

View File

@ -48,11 +48,11 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator
} }
/** /**
* \class ModeleNumRefPayments * \class ModeleNumRefSupplierPayments
* \brief Payment numbering references mother class * \brief Payment numbering references mother class
*/ */
abstract class ModeleNumRefPayments abstract class ModeleNumRefSupplierPayments
{ {
var $error=''; var $error='';

View File

@ -108,7 +108,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$this->posxqty=145; $this->posxqty=145;
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=174; $this->postotalht=174;
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxtva=$this->posxup;
$this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {

0
htdocs/core/tpl/objectline_view.tpl.php Executable file → Normal file
View File

View File

@ -780,3 +780,23 @@ class EcmFiles //extends CommonObject
} }
class EcmfilesLine
{
public $label;
public $entity;
public $filename;
public $filepath;
public $fullpath_orig;
public $description;
public $keywords;
public $cover;
public $position;
public $gen_or_uploaded; // can be 'generated', 'uploaded', 'unknown'
public $extraparams;
public $date_c = '';
public $date_m = '';
public $fk_user_c;
public $fk_user_m;
public $acl;
}

View File

@ -716,6 +716,7 @@ class Expedition extends CommonObject
if ($result < 0) { if ($result < 0) {
$error++; $error++;
$this->errors[]=$mouvS->error; $this->errors[]=$mouvS->error;
$this->errors = array_merge($this->errors, $mouvS->errors);
break; break;
} }
} }
@ -729,6 +730,7 @@ class Expedition extends CommonObject
if ($result < 0) { if ($result < 0) {
$error++; $error++;
$this->errors[]=$mouvS->error; $this->errors[]=$mouvS->error;
$this->errors = array_merge($this->errors, $mouvS->errors);
break; break;
} }
} }

View File

@ -479,6 +479,7 @@ if (empty($reshook))
} }
*/ */
// PREPARE SEND // PREPARE SEND
$mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename); $mailfile = new CMailFile($subject,$emailTo,$emailFrom,$message,$filedir,$mimetype,$filename);
@ -1063,7 +1064,8 @@ if (empty($reshook))
$object_ligne = new ExpenseReportLine($db); $object_ligne = new ExpenseReportLine($db);
$vatrate = GETPOST('vatrate'); $vatrate = GETPOST('vatrate','alpha'); // May be 8.5* (8.5NPROM)
$object_ligne->comments = GETPOST('comments'); $object_ligne->comments = GETPOST('comments');
$qty = GETPOST('qty','int'); $qty = GETPOST('qty','int');
if (empty($qty)) $qty=1; if (empty($qty)) $qty=1;
@ -1078,11 +1080,10 @@ if (empty($reshook))
// if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary. // if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary.
if (empty($vatrate)) $vatrate = "0.000"; if (empty($vatrate)) $vatrate = "0.000";
$object_ligne->vatrate = price2num($vatrate);
$object_ligne->fk_projet = $fk_projet; $object_ligne->fk_projet = $fk_projet;
if (! GETPOST('fk_c_type_fees') > 0) if (! (GETPOST('fk_c_type_fees') > 0))
{ {
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
@ -1125,13 +1126,34 @@ if (empty($reshook))
$object_ligne->fk_expensereport = $_POST['fk_expensereport']; $object_ligne->fk_expensereport = $_POST['fk_expensereport'];
$type = 0; // TODO What if service ? $type = 0; // TODO What if service ?
$seller = ''; // seller is unknown
$tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type, $seller);
// We don't know seller and buyer for expense reports
$seller = $mysoc;
$buyer = new Societe($db);
$localtaxes_type=getLocalTaxesFromRate($vatrate,0,$buyer,$seller);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $vatrate, $reg))
{
$vat_src_code = $reg[1];
$vatrate = preg_replace('/\s*\(.*\)/', '', $vatrate); // Remove code into vatrate.
}
$vatrate = preg_replace('/\*/','',$vatrate);
$tmp = calcul_price_total($qty, $up, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type, $seller, $localtaxes_type);
$object_ligne->vat_src_code = $vat_src_code;
$object_ligne->vatrate = price2num($vatrate); $object_ligne->vatrate = price2num($vatrate);
$object_ligne->total_ttc = $tmp[2]; $object_ligne->total_ttc = $tmp[2];
$object_ligne->total_ht = $tmp[0]; $object_ligne->total_ht = $tmp[0];
$object_ligne->total_tva = $tmp[1]; $object_ligne->total_tva = $tmp[1];
$object_ligne->localtax1_tx = $localtaxes_type[1];
$object_ligne->localtax2_tx = $localtaxes_type[3];
$object_ligne->localtax1_type = $localtaxes_type[0];
$object_ligne->localtax2_type = $localtaxes_type[2];
$result = $object_ligne->insert(); $result = $object_ligne->insert();
if ($result > 0) if ($result > 0)
@ -1862,7 +1884,8 @@ else
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
print '<tr class="oddseven"><td>'; print '<tr class="oddseven">';
print '<td>';
$paymentexpensereportstatic->id = $objp->rowid; $paymentexpensereportstatic->id = $objp->rowid;
$paymentexpensereportstatic->datepaye = $db->jdate($objp->dp); $paymentexpensereportstatic->datepaye = $db->jdate($objp->dp);
$paymentexpensereportstatic->ref = $objp->rowid; $paymentexpensereportstatic->ref = $objp->rowid;
@ -1893,6 +1916,7 @@ else
print '</td>'; print '</td>';
} }
print '<td align="right">'.price($objp->amount)."</td>"; print '<td align="right">'.price($objp->amount)."</td>";
print '<td></td>';
print "</tr>"; print "</tr>";
$totalpaid += $objp->amount; $totalpaid += $objp->amount;
$i++; $i++;
@ -1900,21 +1924,21 @@ else
if ($object->paid == 0) if ($object->paid == 0)
{ {
print '<tr><td colspan="' . $nbcols . '" align="right">'.$langs->trans("AlreadyPaid").':</td><td align="right">'.price($totalpaid).'</td></tr>'; print '<tr><td colspan="' . $nbcols . '" align="right">'.$langs->trans("AlreadyPaid").':</td><td align="right">'.price($totalpaid).'</td><td></td></tr>';
print '<tr><td colspan="' . $nbcols . '" align="right">'.$langs->trans("AmountExpected").':</td><td align="right">'.price($object->total_ttc).'</td></tr>'; print '<tr><td colspan="' . $nbcols . '" align="right">'.$langs->trans("AmountExpected").':</td><td align="right">'.price($object->total_ttc).'</td><td></td></tr>';
$remaintopay = $object->total_ttc - $totalpaid; $remaintopay = $object->total_ttc - $totalpaid;
print '<tr><td colspan="' . $nbcols . '" align="right">'.$langs->trans("RemainderToPay").':</td>'; print '<tr><td colspan="' . $nbcols . '" align="right">'.$langs->trans("RemainderToPay").':</td>';
print '<td align="right"'.($remaintopay?' class="amountremaintopay"':'').'>'.price($remaintopay).'</td></tr>'; print '<td align="right"'.($remaintopay?' class="amountremaintopay"':'').'>'.price($remaintopay).'</td><td></td></tr>';
} }
print "</table>";
$db->free($resql); $db->free($resql);
} }
else else
{ {
dol_print_error($db); dol_print_error($db);
} }
print "</table>";
print '</div>'; print '</div>';
print '</div>'; print '</div>';
@ -1924,7 +1948,7 @@ else
// Fetch Lines of current expense report // Fetch Lines of current expense report
$sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,'; $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,';
$sql.= ' fde.tva_tx as vatrate, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,';
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
@ -2003,7 +2027,7 @@ else
// print '<td style="text-align:center;">'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).'</td>'; // print '<td style="text-align:center;">'.$langs->trans("TF_".strtoupper(empty($objp->type_fees_libelle)?'OTHER':$objp->type_fees_libelle)).'</td>';
print '<td style="text-align:center;">'.($langs->trans(($objp->type_fees_code)) == $objp->type_fees_code ? $objp->type_fees_libelle : $langs->trans(($objp->type_fees_code))).'</td>'; print '<td style="text-align:center;">'.($langs->trans(($objp->type_fees_code)) == $objp->type_fees_code ? $objp->type_fees_libelle : $langs->trans(($objp->type_fees_code))).'</td>';
print '<td style="text-align:left;">'.$objp->comments.'</td>'; print '<td style="text-align:left;">'.$objp->comments.'</td>';
print '<td style="text-align:right;">'.vatrate($objp->vatrate,true).'</td>'; print '<td style="text-align:right;">'.vatrate($objp->vatrate.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''),true).'</td>';
print '<td style="text-align:right;">'.price($objp->value_unit).'</td>'; print '<td style="text-align:right;">'.price($objp->value_unit).'</td>';
print '<td style="text-align:right;">'.$objp->qty.'</td>'; print '<td style="text-align:right;">'.$objp->qty.'</td>';
@ -2057,22 +2081,25 @@ else
// Add comments // Add comments
print '<td>'; print '<td>';
print '<textarea name="comments" class="flat_ndf centpercent">'.$objp->comments.'</textarea>'; print '<textarea name="comments" class="flat_ndf centpercent">'.dol_escape_htmltag($objp->comments).'</textarea>';
print '</td>'; print '</td>';
// VAT // VAT
print '<td style="text-align:right;">'; print '<td style="text-align:right;">';
print $form->load_tva('vatrate', (isset($_POST["vatrate"])?$_POST["vatrate"]:$objp->vatrate), $mysoc, ''); $seller=$mysoc;
$buyer=new Societe($db);
$selectedvat=(GETPOST("vatrate",'alpha')?GETPOST("vatrate",'alpha'):$objp->vatrate.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
print $form->load_tva('vatrate', $selectedvat, $seller, $buyer, 0, 0, '', false, 1);
print '</td>'; print '</td>';
// Unit price // Unit price
print '<td style="text-align:right;">'; print '<td style="text-align:right;">';
print '<input type="text" min="0" class="maxwidth100" name="value_unit" value="'.$objp->value_unit.'" />'; print '<input type="text" min="0" class="maxwidth100" name="value_unit" value="'.dol_escape_htmltag($objp->value_unit).'" />';
print '</td>'; print '</td>';
// Quantity // Quantity
print '<td style="text-align:right;">'; print '<td style="text-align:right;">';
print '<input type="number" min="0" class="maxwidth100" name="qty" value="'.$objp->qty.'" />'; print '<input type="text" min="0" class="maxwidth50" name="qty" value="'.$objp->qty.'" />'; // We must be able to enter decimal qty
print '</td>'; print '</td>';
if ($action != 'editline') if ($action != 'editline')
@ -2093,13 +2120,6 @@ else
$db->free($resql); $db->free($resql);
} }
else
{
/* print '<table width="100%">';
print '<tr><td><div class="error" style="display:block;">'.$langs->trans("AucuneLigne").'</div></td></tr>';
print '</table>';*/
}
//print '</div>';
// Add a line // Add a line
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline' && $user->rights->expensereport->creer) if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline' && $user->rights->expensereport->creer)
@ -2116,7 +2136,6 @@ else
print '<td colspan="3"></td>'; print '<td colspan="3"></td>';
print '</tr>'; print '</tr>';
print '<tr '.$bc[true].'>'; print '<tr '.$bc[true].'>';
print '<td></td>'; print '<td></td>';
@ -2148,17 +2167,17 @@ else
print '<td align="right">'; print '<td align="right">';
$defaultvat=-1; $defaultvat=-1;
if (! empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; if (! empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none';
print $form->load_tva('vatrate', ($vatrate!=''?$vatrate:$defaultvat), $mysoc, '', 0, 0, '', false); print $form->load_tva('vatrate', ($vatrate!=''?$vatrate:$defaultvat), $mysoc, '', 0, 0, '', false, 1);
print '</td>'; print '</td>';
// Unit price // Unit price
print '<td align="right">'; print '<td align="right">';
print '<input type="text" class="right maxwidth50" name="value_unit" value="'.$value_unit.'">'; print '<input type="text" class="right maxwidth50" name="value_unit" value="'.(GETPOST('value_unit','alpha')?GETPOST('value_unit','alpha'):dol_escape_htmltag($value_unit)).'">';
print '</td>'; print '</td>';
// Quantity // Quantity
print '<td align="right">'; print '<td align="right">';
print '<input type="number" min="0" class="right maxwidth50" name="qty" value="'.($qty?$qty:1).'">'; print '<input type="text" min="0" class="right maxwidth50" name="qty" value="'.($qty?$qty:1).'">'; // We must be able to enter decimal qty
print '</td>'; print '</td>';
if ($action != 'editline') if ($action != 'editline')

View File

@ -268,7 +268,6 @@ class ExpenseReport extends CommonObject
if (empty($fk_user_author)) $fk_user_author = $user->id; if (empty($fk_user_author)) $fk_user_author = $user->id;
$this->context['createfromclone'] = 'createfromclone'; $this->context['createfromclone'] = 'createfromclone';
$this->db->begin(); $this->db->begin();
// get extrafields so they will be clone // get extrafields so they will be clone
@ -307,6 +306,7 @@ class ExpenseReport extends CommonObject
// Call trigger // Call trigger
$result=$this->call_trigger('EXPENSEREPORT_CLONE',$user); $result=$this->call_trigger('EXPENSEREPORT_CLONE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
@ -620,7 +620,7 @@ class ExpenseReport extends CommonObject
$sql.= " f.tms as date_modification,"; $sql.= " f.tms as date_modification,";
$sql.= " f.date_valid as datev,"; $sql.= " f.date_valid as datev,";
$sql.= " f.date_approve as datea,"; $sql.= " f.date_approve as datea,";
$sql.= " f.fk_user_author as fk_user_creation,"; //$sql.= " f.fk_user_author as fk_user_creation,"; // This is not user of creation but user the expense is for.
$sql.= " f.fk_user_modif as fk_user_modification,"; $sql.= " f.fk_user_modif as fk_user_modification,";
$sql.= " f.fk_user_valid,"; $sql.= " f.fk_user_valid,";
$sql.= " f.fk_user_approve"; $sql.= " f.fk_user_approve";
@ -1577,7 +1577,7 @@ class ExpenseReport extends CommonObject
* @param int $rowid Line to edit * @param int $rowid Line to edit
* @param int $type_fees_id Type payment * @param int $type_fees_id Type payment
* @param int $projet_id Project id * @param int $projet_id Project id
* @param double $vatrate Vat rate * @param double $vatrate Vat rate. Can be '8.5* (8.5NPROM...)'
* @param string $comments Description * @param string $comments Description
* @param real $qty Qty * @param real $qty Qty
* @param double $value_unit Value init * @param double $value_unit Value init
@ -1587,14 +1587,34 @@ class ExpenseReport extends CommonObject
*/ */
function updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $expensereport_id) function updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $expensereport_id)
{ {
global $user; global $user, $mysoc;
if ($this->fk_statut==0 || $this->fk_statut==99) if ($this->fk_statut==0 || $this->fk_statut==99)
{ {
$this->db->begin(); $this->db->begin();
$type = 0; // TODO What if type is service ?
// We don't know seller and buyer for expense reports
$seller = $mysoc;
$buyer = new Societe($this->db);
$localtaxes_type=getLocalTaxesFromRate($vatrate,0,$buyer,$seller);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $vatrate, $reg))
{
$vat_src_code = $reg[1];
$vatrate = preg_replace('/\s*\(.*\)/', '', $vatrate); // Remove code into vatrate.
}
$vatrate = preg_replace('/\*/','',$vatrate);
$tmp = calcul_price_total($qty, $value_unit, 0, $vatrate, 0, 0, 0, 'TTC', 0, $type, $seller, $localtaxes_type);
// calcul de tous les totaux de la ligne // calcul de tous les totaux de la ligne
$total_ttc = price2num($qty*$value_unit, 'MT'); //$total_ttc = price2num($qty*$value_unit, 'MT');
$tx_tva = $vatrate / 100; $tx_tva = $vatrate / 100;
$tx_tva = $tx_tva + 1; $tx_tva = $tx_tva + 1;
@ -1604,6 +1624,9 @@ class ExpenseReport extends CommonObject
// fin calculs // fin calculs
$ligne = new ExpenseReportLine($this->db); $ligne = new ExpenseReportLine($this->db);
$ligne->rowid = $rowid;
$ligne->comments = $comments; $ligne->comments = $comments;
$ligne->qty = $qty; $ligne->qty = $qty;
$ligne->value_unit = $value_unit; $ligne->value_unit = $value_unit;
@ -1613,11 +1636,21 @@ class ExpenseReport extends CommonObject
$ligne->fk_c_type_fees = $type_fees_id; $ligne->fk_c_type_fees = $type_fees_id;
$ligne->fk_projet = $projet_id; $ligne->fk_projet = $projet_id;
$ligne->total_ht = $total_ht; //$ligne->total_ht = $total_ht;
$ligne->total_tva = $total_tva; //$ligne->total_tva = $total_tva;
$ligne->total_ttc = $total_ttc; //$ligne->total_ttc = $total_ttc;
//$ligne->vatrate = price2num($vatrate);
$ligne->vat_src_code = $vat_src_code;
$ligne->vatrate = price2num($vatrate); $ligne->vatrate = price2num($vatrate);
$ligne->rowid = $rowid; $ligne->total_ttc = $tmp[2];
$ligne->total_ht = $tmp[0];
$ligne->total_tva = $tmp[1];
$ligne->localtax1_tx = $localtaxes_type[1];
$ligne->localtax2_tx = $localtaxes_type[3];
$ligne->localtax1_type = $localtaxes_type[0];
$ligne->localtax2_type = $localtaxes_type[2];
// Select des infos sur le type fees // Select des infos sur le type fees
$sql = "SELECT c.code as code_type_fees, c.label as libelle_type_fees"; $sql = "SELECT c.code as code_type_fees, c.label as libelle_type_fees";
@ -2025,7 +2058,7 @@ class ExpenseReportLine
function fetch($rowid) function fetch($rowid)
{ {
$sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,'; $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_projet, fde.date,';
$sql.= ' fde.tva_tx as vatrate, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,';
$sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,';
$sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref';
$sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
@ -2054,6 +2087,7 @@ class ExpenseReportLine
$this->projet_ref = $objp->projet_ref; $this->projet_ref = $objp->projet_ref;
$this->projet_title = $objp->projet_title; $this->projet_title = $objp->projet_title;
$this->vatrate = $objp->vatrate; $this->vatrate = $objp->vatrate;
$this->vat_src_code = $objp->vat_src_code;
$this->total_ht = $objp->total_ht; $this->total_ht = $objp->total_ht;
$this->total_tva = $objp->total_tva; $this->total_tva = $objp->total_tva;
$this->total_ttc = $objp->total_ttc; $this->total_ttc = $objp->total_ttc;
@ -2088,11 +2122,12 @@ class ExpenseReportLine
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'expensereport_det'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'expensereport_det';
$sql.= ' (fk_expensereport, fk_c_type_fees, fk_projet,'; $sql.= ' (fk_expensereport, fk_c_type_fees, fk_projet,';
$sql.= ' tva_tx, comments, qty, value_unit, total_ht, total_tva, total_ttc, date)'; $sql.= ' tva_tx, vat_src_code, comments, qty, value_unit, total_ht, total_tva, total_ttc, date)';
$sql.= " VALUES (".$this->fk_expensereport.","; $sql.= " VALUES (".$this->fk_expensereport.",";
$sql.= " ".$this->fk_c_type_fees.","; $sql.= " ".$this->fk_c_type_fees.",";
$sql.= " ".($this->fk_projet>0?$this->fk_projet:'null').","; $sql.= " ".($this->fk_projet>0?$this->fk_projet:'null').",";
$sql.= " ".$this->vatrate.","; $sql.= " ".$this->vatrate.",";
$sql.= " '".$this->db->escape($this->vat_src_code)."',";
$sql.= " '".$this->db->escape($this->comments)."',"; $sql.= " '".$this->db->escape($this->comments)."',";
$sql.= " ".$this->qty.","; $sql.= " ".$this->qty.",";
$sql.= " ".$this->value_unit.","; $sql.= " ".$this->value_unit.",";
@ -2163,6 +2198,7 @@ class ExpenseReportLine
$sql.= ",total_tva=".$this->total_tva.""; $sql.= ",total_tva=".$this->total_tva."";
$sql.= ",total_ttc=".$this->total_ttc.""; $sql.= ",total_ttc=".$this->total_ttc."";
$sql.= ",tva_tx=".$this->vatrate; $sql.= ",tva_tx=".$this->vatrate;
$sql.= ",vat_src_code='".$this->db->escape($this->vat_src_code)."'";
if ($this->fk_c_type_fees) $sql.= ",fk_c_type_fees=".$this->fk_c_type_fees; if ($this->fk_c_type_fees) $sql.= ",fk_c_type_fees=".$this->fk_c_type_fees;
else $sql.= ",fk_c_type_fees=null"; else $sql.= ",fk_c_type_fees=null";
if ($this->fk_projet) $sql.= ",fk_projet=".$this->fk_projet; if ($this->fk_projet) $sql.= ",fk_projet=".$this->fk_projet;

View File

@ -547,18 +547,18 @@ class PaymentExpenseReport extends CommonObject
// Add link 'user' in bank_url between user and bank transaction // Add link 'user' in bank_url between user and bank transaction
if (! $error) if (! $error)
{ {
foreach ($this->amounts as $key => $value) // We should have always same third party but we loop in case of. foreach ($this->amounts as $key => $value) // We should have always same user but we loop in case of.
{ {
if ($mode == 'payment_expensereport') if ($mode == 'payment_expensereport')
{ {
$er = new ExpenseReport($this->db); $fuser = new User($this->db);
$er->fetch($key); $fuser->fetch($key);
$er->fetch_user($er->fk_user_author);
$result=$acc->add_url_line( $result=$acc->add_url_line(
$bank_line_id, $bank_line_id,
$er->user->id, $fuser->id,
DOL_URL_ROOT.'/user/card.php?id=', DOL_URL_ROOT.'/user/card.php?id=',
$er->user->getFullName($langs), $fuser->getFullName($langs),
'user' 'user'
); );
if ($result <= 0) if ($result <= 0)

View File

@ -1553,7 +1553,7 @@ class CommandeFournisseur extends CommonOrder
if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); if (! empty($fk_parent_line)) $this->line_order(true,'DESC');
// Mise a jour informations denormalisees au niveau de la commande meme // Mise a jour informations denormalisees au niveau de la commande meme
$result=$this->update_price(1,'auto'); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. $result=$this->update_price(1,'auto',0,$this->thirdparty); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
if ($result > 0) if ($result > 0)
{ {
$this->db->commit(); $this->db->commit();

View File

@ -1430,7 +1430,7 @@ class FactureFournisseur extends CommonInvoice
if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); if (! empty($fk_parent_line)) $this->line_order(true,'DESC');
// Mise a jour informations denormalisees au niveau de la facture meme // Mise a jour informations denormalisees au niveau de la facture meme
$result=$this->update_price(1,'auto',0,$mysoc); // The addline method is designed to add line from user input so total calculation with update_price must be done using 'auto' mode. $result=$this->update_price(1,'auto',0,$this->thirdparty); // The addline method is designed to add line from user input so total calculation with update_price must be done using 'auto' mode.
if ($result > 0) if ($result > 0)
{ {
$this->db->commit(); $this->db->commit();

View File

@ -703,13 +703,32 @@ class ProductFournisseur extends Product
* @param int $showsuptitle Show "Supplier" into output string * @param int $showsuptitle Show "Supplier" into output string
* @param int $maxlen Max length of name * @param int $maxlen Max length of name
* @param integer $notooltip 1=Disable tooltip * @param integer $notooltip 1=Disable tooltip
* @param array $productFournList list of ProductFournisseur objects
* to display in table format.
* @return string String with supplier price * @return string String with supplier price
*/ */
function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0) function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0, $productFournList=array())
{ {
global $langs; global $langs;
$out = '';
$langs->load("suppliers"); $langs->load("suppliers");
if (count($productFournList) > 0) {
$out .= '<table class="nobordernopadding" width="100%">';
$out .= '<tr><td class="liste_titre" align="right">'.($showunitprice?$langs->trans("Price").' '.$langs->trans("HT"):'').'</td>';
$out .= '<td class="liste_titre" align="right">'.($showunitprice?$langs->trans("QtyMin"):'').'</td>';
$out .= '<td class="liste_titre">'.$langs->trans("Supplier").'</td>';
$out .= '<td class="liste_titre">'.$langs->trans("SupplierRef").'</td></tr>';
foreach ($productFournList as $productFourn) {
$out.= '<tr><td align="right">'.($showunitprice?price($productFourn->fourn_unitprice * (1 -$productFourn->fourn_remise_percent/100) + $productFourn->fourn_unitcharges - $productFourn->fourn_remise):'').'</td>';
$out.= '<td align="right">'.($showunitprice?$productFourn->fourn_qty:'').'</td>';
$out.= '<td>'.$productFourn->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).'</td>';
$out.= '<td>'.$productFourn->fourn_ref.'<td></tr>';
}
$out .= '</table>';
} else {
$out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").' &nbsp; (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").' &nbsp; (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
}
return $out; return $out;
} }

View File

@ -896,7 +896,7 @@ if (empty($reshook))
} }
// Actions to build doc // Actions to build doc
$upload_dir = $conf->commande->dir_output; $upload_dir = $conf->fournisseur->commande->dir_output;
$permissioncreate = $user->rights->fournisseur->commande->creer; $permissioncreate = $user->rights->fournisseur->commande->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
@ -2704,7 +2704,7 @@ elseif (! empty($object->id))
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>'; //print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
print '<tr><td>'.$langs->trans("OrderDate").'</td><td>'; print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
$date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
print $form->select_date($date_com,'',1,1,'',"commande",1,0,1); print $form->select_date($date_com,'',1,1,'',"commande",1,1,1);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("OrderMode").'</td><td>'; print '<tr><td>'.$langs->trans("OrderMode").'</td><td>';
@ -2756,7 +2756,7 @@ if ($action != 'makeorder')
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Receive").'</td></tr>'; //print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Receive").'</td></tr>';
print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>'; print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>';
print $form->select_date('','',1,1,'',"commande",1,0,1); print $form->select_date('','',1,1,'',"commande",1,1,1);
print "</td></tr>\n"; print "</td></tr>\n";
print "<tr><td>".$langs->trans("Delivery")."</td><td>\n"; print "<tr><td>".$langs->trans("Delivery")."</td><td>\n";

View File

@ -2756,7 +2756,6 @@ else
} }
} }
print '</div>'; print '</div>';
print '<br>';
if ($action != 'edit') if ($action != 'edit')
{ {

View File

@ -3,8 +3,8 @@
* Copyright (C) 2012-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2012-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012-2016 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com> * Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2014-2017 Ferran Marcet <fmarcet@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
@ -41,7 +41,6 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
$myparam = GETPOST("myparam"); $myparam = GETPOST("myparam");
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$id=GETPOST('id', 'int'); $id=GETPOST('id', 'int');
$userid = GETPOST('userid')?GETPOST('userid'):$user->id;
// Protection if external user // Protection if external user
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
@ -61,7 +60,8 @@ if ($action == 'create')
$object = new Holiday($db); $object = new Holiday($db);
// If no right to create a request // If no right to create a request
if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) $fuserid = GETPOST('fuserid');
if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
{ {
$error++; $error++;
setEventMessages($langs->trans('CantCreateCP'), null, 'errors'); setEventMessages($langs->trans('CantCreateCP'), null, 'errors');
@ -86,7 +86,6 @@ if ($action == 'create')
$valideur = GETPOST('valideur'); $valideur = GETPOST('valideur');
$description = trim(GETPOST('description')); $description = trim(GETPOST('description'));
$userID = GETPOST('userID');
// If no type // If no type
if ($type <= 0) if ($type <= 0)
@ -722,7 +721,7 @@ llxHeader('', $langs->trans('CPTitreMenu'));
if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create') if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create')
{ {
// Si l'utilisateur n'a pas le droit de faire une demande // Si l'utilisateur n'a pas le droit de faire une demande
if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all))) if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
{ {
$errors[]=$langs->trans('CantCreateCP'); $errors[]=$langs->trans('CantCreateCP');
} }
@ -802,7 +801,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
// Formulaire de demande // Formulaire de demande
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n"; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n";
print '<input type="hidden" name="action" value="create" />'."\n"; print '<input type="hidden" name="action" value="create" />'."\n";
print '<input type="hidden" name="userID" value="'.$userid.'" />'."\n";
dol_fiche_head(); dol_fiche_head();
@ -833,10 +831,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
print '<td>'; print '<td>';
if (empty($user->rights->holiday->write_all)) if (empty($user->rights->holiday->write_all))
{ {
print $form->select_dolusers($userid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print $form->select_dolusers($fuserid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '<input type="hidden" name="userid" value="'.$userid.'">'; print '<input type="hidden" name="fuserid" value="'.($fuserid?$fuserid:$user->id).'">';
} }
else print $form->select_dolusers(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0); else print $form->select_dolusers(GETPOST('fuserid')?GETPOST('fuserid'):$user->id,'fuserid',0,'',0);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/holiday/list.php * \file htdocs/holiday/list.php
* \ingroup holiday * \ingroup holiday
* \brief List of holiday. * \brief List of holiday
*/ */
require('../main.inc.php'); require('../main.inc.php');
@ -63,14 +63,13 @@ $month_start = GETPOST('month_start');
$year_start = GETPOST('year_start'); $year_start = GETPOST('year_start');
$month_end = GETPOST('month_end'); $month_end = GETPOST('month_end');
$year_end = GETPOST('year_end'); $year_end = GETPOST('year_end');
$search_employe = GETPOST('search_employe'); $search_employee = GETPOST('search_employee');
$search_valideur = GETPOST('search_valideur'); $search_valideur = GETPOST('search_valideur');
$search_statut = GETPOST('select_statut'); $search_statut = GETPOST('select_statut');
$type = GETPOST('type','int'); $search_type = GETPOST('search_type','int');
// List of fields to search into when doing a "search in all" // List of fields to search into when doing a "search in all"
$fieldstosearchall = array( $fieldstosearchall = array(
'cp.rowid'=>'Ref',
'cp.description'=>'Description', 'cp.description'=>'Description',
'uu.lastname'=>'EmployeeLastname', 'uu.lastname'=>'EmployeeLastname',
'uu.firstname'=>'EmployeeFirstname' 'uu.firstname'=>'EmployeeFirstname'
@ -91,10 +90,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$year_start=""; $year_start="";
$month_end=""; $month_end="";
$year_end=""; $year_end="";
$search_employe=""; $search_employee="";
$search_valideur=""; $search_valideur="";
$search_statut=""; $search_statut="";
$type=''; $search_type='';
} }
@ -121,13 +120,13 @@ llxHeader('', $langs->trans('CPTitreMenu'));
$order = $db->order($sortfield,$sortorder).$db->plimit($limit + 1, $offset); $order = $db->order($sortfield,$sortorder).$db->plimit($limit + 1, $offset);
// WHERE // Ref
if(!empty($search_ref)) if(!empty($search_ref))
{ {
$filter.= " AND cp.rowid LIKE '%".$db->escape($search_ref)."%'\n"; $filter.= " AND cp.rowid = ".$db->escape($search_ref);
} }
// DATE START // Start date
if($year_start > 0) { if($year_start > 0) {
if($month_start > 0) { if($month_start > 0) {
$filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,$month_start,1))."' AND '".$db->idate(dol_get_last_day($year_start,$month_start,1))."')"; $filter .= " AND (cp.date_debut BETWEEN '".$db->idate(dol_get_first_day($year_start,$month_start,1))."' AND '".$db->idate(dol_get_last_day($year_start,$month_start,1))."')";
@ -142,7 +141,7 @@ if($year_start > 0) {
} }
} }
// DATE FIN // End date
if($year_end > 0) { if($year_end > 0) {
if($month_end > 0) { if($month_end > 0) {
$filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,$month_end,1))."' AND '".$db->idate(dol_get_last_day($year_end,$month_end,1))."')"; $filter .= " AND (cp.date_fin BETWEEN '".$db->idate(dol_get_first_day($year_end,$month_end,1))."' AND '".$db->idate(dol_get_last_day($year_end,$month_end,1))."')";
@ -157,7 +156,7 @@ if($year_end > 0) {
} }
} }
// DATE CREATE // Create date
if($year_create > 0) { if($year_create > 0) {
if($month_create > 0) { if($month_create > 0) {
$filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($year_create,$month_create,1))."' AND '".$db->idate(dol_get_last_day($year_create,$month_create,1))."')"; $filter .= " AND (cp.date_create BETWEEN '".$db->idate(dol_get_first_day($year_create,$month_create,1))."' AND '".$db->idate(dol_get_last_day($year_create,$month_create,1))."')";
@ -172,17 +171,22 @@ if($year_create > 0) {
} }
} }
// EMPLOYE // Employee
if(!empty($search_employe) && $search_employe != -1) { if(!empty($search_employee) && $search_employee != -1) {
$filter.= " AND cp.fk_user = '".$db->escape($search_employe)."'\n"; $filter.= " AND cp.fk_user = '".$db->escape($search_employee)."'\n";
} }
// VALIDEUR // Validator
if(!empty($search_valideur) && $search_valideur != -1) { if(!empty($search_valideur) && $search_valideur != -1) {
$filter.= " AND cp.fk_validator = '".$db->escape($search_valideur)."'\n"; $filter.= " AND cp.fk_validator = '".$db->escape($search_valideur)."'\n";
} }
// STATUT // Type
if (!empty($search_type) && $search_type != -1) {
$filter.= ' AND cp.fk_type IN ('.$db->escape($search_type).')';
}
// Status
if(!empty($search_statut) && $search_statut != -1) { if(!empty($search_statut) && $search_statut != -1) {
$filter.= " AND cp.statut = '".$db->escape($search_statut)."'\n"; $filter.= " AND cp.statut = '".$db->escape($search_statut)."'\n";
} }
@ -194,7 +198,6 @@ if (!empty($sall))
if (empty($user->rights->holiday->read_all)) $filter.=' AND cp.fk_user IN ('.join(',',$childids).')'; if (empty($user->rights->holiday->read_all)) $filter.=' AND cp.fk_user IN ('.join(',',$childids).')';
if ($type > 0) $filter.=' AND cp.fk_type IN ('.$db->escape($type).')';
// Récupération de l'ID de l'utilisateur // Récupération de l'ID de l'utilisateur
$user_id = $user->id; $user_id = $user->id;
@ -297,34 +300,34 @@ if ($sall)
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
// FILTRES // Filters
print '<tr class="liste_titre_filter">'; print '<tr class="liste_titre_filter">';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" size="4" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">'; print '<input class="flat" size="4" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>'; print '</td>';
// DATE CREATE // Create date
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_create" value="'.dol_escape_htmltag($month_create).'">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month_create" value="'.dol_escape_htmltag($month_create).'">';
$formother->select_year($year_create,'year_create',1, $min_year, 0); $formother->select_year($year_create,'year_create',1, $min_year, 0);
print '</td>'; print '</td>';
// UTILISATEUR // User
if ($user->rights->holiday->write_all) if ($user->rights->holiday->write_all)
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="left">'; print '<td class="liste_titre maxwidthonsmartphone" align="left">';
print $form->select_dolusers($search_employe,"search_employe",1,"",0,'','',0,0,0,'',0,'','maxwidth200'); print $form->select_dolusers($search_employee,"search_employee",1,"",0,'','',0,0,0,'',0,'','maxwidth200');
print '</td>'; print '</td>';
} }
else else
{ {
//print '<td class="liste_titre">&nbsp;</td>'; //print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre maxwidthonsmartphone" align="left">'; print '<td class="liste_titre maxwidthonsmartphone" align="left">';
print $form->select_dolusers($user->id,"search_employe",1,"",1,'','',0,0,0,'',0,'','maxwidth200'); print $form->select_dolusers($user->id,"search_employee",1,"",1,'','',0,0,0,'',0,'','maxwidth200');
print '</td>'; print '</td>';
} }
// APPROVER // Approve
if($user->rights->holiday->write_all) if($user->rights->holiday->write_all)
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="left">'; print '<td class="liste_titre maxwidthonsmartphone" align="left">';
@ -352,30 +355,30 @@ foreach($typeleaves as $key => $val)
//$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':''); //$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':'');
$arraytypeleaves[$val['rowid']]=$labeltoshow; $arraytypeleaves[$val['rowid']]=$labeltoshow;
} }
print $form->selectarray('type', $arraytypeleaves, (GETPOST('type')?GETPOST('type'):''), 1); print $form->selectarray('search_type', $arraytypeleaves, (GETPOST('search_type')?GETPOST('search_type'):''), 1);
print '</td>'; print '</td>';
// DUREE // Duration
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
// DATE DEBUT // Start date
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_start" value="'.dol_escape_htmltag($month_start).'">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month_start" value="'.dol_escape_htmltag($month_start).'">';
$formother->select_year($year_start,'year_start',1, $min_year, $max_year); $formother->select_year($year_start,'year_start',1, $min_year, $max_year);
print '</td>'; print '</td>';
// DATE FIN // End date
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.dol_escape_htmltag($month_end).'">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.dol_escape_htmltag($month_end).'">';
$formother->select_year($year_end,'year_end',1, $min_year, $max_year); $formother->select_year($year_end,'year_end',1, $min_year, $max_year);
print '</td>'; print '</td>';
// STATUT // Status
print '<td class="liste_titre maxwidthonsmartphone maxwidth200" align="right">'; print '<td class="liste_titre maxwidthonsmartphone maxwidth200" align="right">';
$holiday->selectStatutCP($search_statut); $holiday->selectStatutCP($search_statut);
print '</td>'; print '</td>';
// ACTION // Actions
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
@ -404,7 +407,7 @@ if (! empty($holiday->holiday))
foreach($holiday->holiday as $infos_CP) foreach($holiday->holiday as $infos_CP)
{ {
// Utilisateur // User
$userstatic->id=$infos_CP['fk_user']; $userstatic->id=$infos_CP['fk_user'];
$userstatic->lastname=$infos_CP['user_lastname']; $userstatic->lastname=$infos_CP['user_lastname'];
$userstatic->firstname=$infos_CP['user_firstname']; $userstatic->firstname=$infos_CP['user_firstname'];
@ -412,7 +415,7 @@ if (! empty($holiday->holiday))
$userstatic->statut=$infos_CP['user_statut']; $userstatic->statut=$infos_CP['user_statut'];
$userstatic->photo=$infos_CP['user_photo']; $userstatic->photo=$infos_CP['user_photo'];
// Valideur // Validator
$approbatorstatic->id=$infos_CP['fk_validator']; $approbatorstatic->id=$infos_CP['fk_validator'];
$approbatorstatic->lastname=$infos_CP['validator_lastname']; $approbatorstatic->lastname=$infos_CP['validator_lastname'];
$approbatorstatic->firstname=$infos_CP['validator_firstname']; $approbatorstatic->firstname=$infos_CP['validator_firstname'];

View File

View File

@ -62,7 +62,7 @@ pHeader('',''); // No next step for navigation buttons. Next step is defined
//print "<br>\n"; //print "<br>\n";
//print $langs->trans("InstallEasy")."<br><br>\n"; //print $langs->trans("InstallEasy")."<br><br>\n";
print '<h3>'.$langs->trans("MiscellaneousChecks").":</h3>\n"; print '<h3><img class="valigntextbottom" src="../theme/common/octicons/lib/svg/gear.svg" width="20" alt="Database"> '.$langs->trans("MiscellaneousChecks").":</h3>\n";
// Check browser // Check browser
$useragent=$_SERVER['HTTP_USER_AGENT']; $useragent=$_SERVER['HTTP_USER_AGENT'];

View File

@ -63,7 +63,7 @@ ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL; ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00'; -- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00';
-- Clean corrupted values for tms -- Clean corrupted values for tms
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; -- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
@ -74,7 +74,7 @@ ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL; -- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL; -- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP; -- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL; ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
@ -204,9 +204,14 @@ CREATE TABLE llx_payment_salary (
fk_user_modif integer fk_user_modif integer
)ENGINE=innodb; )ENGINE=innodb;
DELETE FROM llx_product_batch where fk_product_stock NOT IN (SELECT rowid from llx_product_stock);
ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock); ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock);
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid); ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);
DELETE FROM llx_expeditiondet_batch where fk_expeditiondet NOT IN (SELECT rowid from llx_expeditiondet);
ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet); ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet);
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid); ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);

View File

@ -70,6 +70,10 @@ ALTER TABLE llx_extrafields ADD COLUMN fielddefault varchar(255);
ALTER TABLE llx_c_typent MODIFY COLUMN libelle varchar(64); ALTER TABLE llx_c_typent MODIFY COLUMN libelle varchar(64);
ALTER TABLE llx_holiday ADD COLUMN ref varchar(30) NULL;
ALTER TABLE llx_holiday ADD COLUMN ref_ext varchar(255);
create table llx_notify_def_object create table llx_notify_def_object
( (
id integer AUTO_INCREMENT PRIMARY KEY, id integer AUTO_INCREMENT PRIMARY KEY,
@ -242,6 +246,7 @@ ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_lettering datetime AFTER
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN journal_label varchar(255) AFTER code_journal; ALTER TABLE llx_accounting_bookkeeping ADD COLUMN journal_label varchar(255) AFTER code_journal;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_validated datetime AFTER validated; ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_validated datetime AFTER validated;
DROP TABLE llx_accounting_bookkeeping_tmp;
CREATE TABLE llx_accounting_bookkeeping_tmp CREATE TABLE llx_accounting_bookkeeping_tmp
( (
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
@ -254,14 +259,14 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug) thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug)
subledger_account varchar(32), -- FEC:CompAuxNum | account number of subledger account subledger_account varchar(32), -- FEC:CompAuxNum | account number of subledger account
subledger_label varchar(255), -- FEC:CompAuxLib | label of subledger account subledger_label varchar(255), -- FEC:CompAuxLib | label of subledger account
numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number numero_compte varchar(32), -- FEC:CompteNum | account number
label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account
label_operation varchar(255), -- FEC:EcritureLib | label of the operation label_operation varchar(255), -- FEC:EcritureLib | label of the operation
debit numeric(24,8) NOT NULL, -- FEC:Debit debit double(24,8) NOT NULL, -- FEC:Debit
credit numeric(24,8) NOT NULL, -- FEC:Credit credit double(24,8) NOT NULL, -- FEC:Credit
montant numeric(24,8) NOT NULL, -- FEC:Montant (Not necessary) montant double(24,8) NOT NULL, -- FEC:Montant (Not necessary)
sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary) sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary)
multicurrency_amount numeric(24,8), -- FEC:Montantdevise multicurrency_amount double(24,8), -- FEC:Montantdevise
multicurrency_code varchar(255), -- FEC:Idevise multicurrency_code varchar(255), -- FEC:Idevise
lettering_code varchar(255), -- FEC:EcritureLet lettering_code varchar(255), -- FEC:EcritureLet
date_lettering datetime, -- FEC:DateLet date_lettering datetime, -- FEC:DateLet
@ -282,6 +287,13 @@ ALTER TABLE llx_accounting_bookkeeping_tmp ADD INDEX idx_accounting_bookkeeping_
ALTER TABLE llx_accounting_bookkeeping_tmp ADD INDEX idx_accounting_bookkeeping_numero_compte (numero_compte); ALTER TABLE llx_accounting_bookkeeping_tmp ADD INDEX idx_accounting_bookkeeping_numero_compte (numero_compte);
ALTER TABLE llx_accounting_bookkeeping_tmp ADD INDEX idx_accounting_bookkeeping_code_journal (code_journal); ALTER TABLE llx_accounting_bookkeeping_tmp ADD INDEX idx_accounting_bookkeeping_code_journal (code_journal);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN debit double(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN credit double(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN montant double(24,8);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN multicurrency_amount double(24,8);
ALTER TABLE llx_paiementfourn ADD COLUMN model_pdf varchar(255); ALTER TABLE llx_paiementfourn ADD COLUMN model_pdf varchar(255);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201);
@ -346,7 +358,7 @@ ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_tx d
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL; ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL; ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL;
UPDATE TABLE llx_contrat set ref = rowid where ref is null or ref = ''; UPDATE llx_contrat set ref = rowid where ref is null or ref = '';
create table llx_payment_various create table llx_payment_various
( (

View File

@ -327,6 +327,14 @@ DELETE FROM llx_c_shipment_mode where code IN (select code from tmp_c_shipment_m
drop table tmp_c_shipment_mode; drop table tmp_c_shipment_mode;
-- Restore id of user on link for payment of expense report
drop table tmp_bank_url_expense_user;
create table tmp_bank_url_expense_user (select e.fk_user_author, bu2.fk_bank from llx_expensereport as e, llx_bank_url as bu2 where bu2.url_id = e.rowid and bu2.type = 'payment_expensereport');
update llx_bank_url as bu set url_id = (select e.fk_user_author from tmp_bank_url_expense_user as e where e.fk_bank = bu.fk_bank) where bu.url_id = 0 and bu.type ='user';
drop table tmp_bank_url_expense_user;
-- Clean product prices -- Clean product prices
--delete from llx_product_price where date_price between '2017-04-20 06:51:00' and '2017-04-20 06:51:05'; --delete from llx_product_price where date_price between '2017-04-20 06:51:00' and '2017-04-20 06:51:05';
-- Set product prices into llx_product with last price into llx_product_prices -- Set product prices into llx_product with last price into llx_product_prices

View File

@ -32,11 +32,11 @@ CREATE TABLE llx_accounting_bookkeeping
numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number
label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account
label_operation varchar(255), -- FEC:EcritureLib | label of the operation label_operation varchar(255), -- FEC:EcritureLib | label of the operation
debit double NOT NULL, -- FEC:Debit debit double(24,8) NOT NULL, -- FEC:Debit
credit double NOT NULL, -- FEC:Credit credit double(24,8) NOT NULL, -- FEC:Credit
montant double NOT NULL, -- FEC:Montant (Not necessary) montant double(24,8) NOT NULL, -- FEC:Montant (Not necessary)
sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary) sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary)
multicurrency_amount double, -- FEC:Montantdevise multicurrency_amount double(24,8), -- FEC:Montantdevise
multicurrency_code varchar(255), -- FEC:Idevise multicurrency_code varchar(255), -- FEC:Idevise
lettering_code varchar(255), -- FEC:EcritureLet lettering_code varchar(255), -- FEC:EcritureLet
date_lettering datetime, -- FEC:DateLet date_lettering datetime, -- FEC:DateLet

View File

@ -29,14 +29,14 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug) thirdparty_code varchar(32), -- Third party code (customer or supplier) when record is saved (may help debug)
subledger_account varchar(32), -- FEC:CompAuxNum | account number of subledger account subledger_account varchar(32), -- FEC:CompAuxNum | account number of subledger account
subledger_label varchar(255), -- FEC:CompAuxLib | label of subledger account subledger_label varchar(255), -- FEC:CompAuxLib | label of subledger account
numero_compte varchar(32) NOT NULL, -- FEC:CompteNum | account number numero_compte varchar(32), -- FEC:CompteNum | account number
label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account label_compte varchar(255) NOT NULL, -- FEC:CompteLib | label of account
label_operation varchar(255), -- FEC:EcritureLib | label of the operation label_operation varchar(255), -- FEC:EcritureLib | label of the operation
debit numeric(24,8) NOT NULL, -- FEC:Debit debit double(24,8) NOT NULL, -- FEC:Debit
credit numeric(24,8) NOT NULL, -- FEC:Credit credit double(24,8) NOT NULL, -- FEC:Credit
montant numeric(24,8) NOT NULL, -- FEC:Montant (Not necessary) montant double(24,8) NOT NULL, -- FEC:Montant (Not necessary)
sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary) sens varchar(1) DEFAULT NULL, -- FEC:Sens (Not necessary)
multicurrency_amount numeric(24,8), -- FEC:Montantdevise multicurrency_amount double(24,8), -- FEC:Montantdevise
multicurrency_code varchar(255), -- FEC:Idevise multicurrency_code varchar(255), -- FEC:Idevise
lettering_code varchar(255), -- FEC:EcritureLet lettering_code varchar(255), -- FEC:EcritureLet
date_lettering datetime, -- FEC:DateLet date_lettering datetime, -- FEC:DateLet

View File

@ -19,6 +19,8 @@
CREATE TABLE llx_holiday CREATE TABLE llx_holiday
( (
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NOT NULL, -- number
ref_ext varchar(255),
entity integer DEFAULT 1 NOT NULL, -- Multi company id entity integer DEFAULT 1 NOT NULL, -- Multi company id
fk_user integer NOT NULL, fk_user integer NOT NULL,
fk_user_create integer, fk_user_create integer,

View File

@ -69,7 +69,9 @@ if (! is_writable($conffile))
} }
print '<br>'.$langs->trans("LastStepDesc").'<br><br>'; print '<h3><img class="valigntextbottom" src="../theme/common/octicons/lib/svg/key.svg" width="20" alt="Database"> '.$langs->trans("DolibarrAdminLogin").'</h3>';
print $langs->trans("LastStepDesc").'<br><br>';
print '<table cellspacing="0" cellpadding="2" width="100%">'; print '<table cellspacing="0" cellpadding="2" width="100%">';
@ -78,7 +80,7 @@ $db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db-
if ($db->ok) if ($db->ok)
{ {
print '<tr><td>'.$langs->trans("DolibarrAdminLogin").' :</td><td>'; print '<tr><td>'.$langs->trans("Login").' :</td><td>';
print '<input name="login" type="text" value="' . (!empty($_GET["login"]) ? GETPOST("login") : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"' . (@$force_install_noedit == 2 && $force_install_dolibarrlogin !== null ? ' disabled' : '') . '></td></tr>'; print '<input name="login" type="text" value="' . (!empty($_GET["login"]) ? GETPOST("login") : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"' . (@$force_install_noedit == 2 && $force_install_dolibarrlogin !== null ? ' disabled' : '') . '></td></tr>';
print '<tr><td>'.$langs->trans("Password").' :</td><td>'; print '<tr><td>'.$langs->trans("Password").' :</td><td>';
print '<input type="password" name="pass"></td></tr>'; print '<input type="password" name="pass"></td></tr>';

View File

@ -41,11 +41,15 @@ $action=GETPOST('action', 'alpha');
// Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install // Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install
// or MAIN_VERSION_LAST_UPGRADE for upgrade. // or MAIN_VERSION_LAST_UPGRADE for upgrade.
$targetversion=DOL_VERSION; // It it's last upgrade $targetversion=DOL_VERSION; // If it's latest upgrade
if (! empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upgrade if (! empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upgrade
{ {
$tmp=explode('_', $action, 2); $tmp=explode('_', $action, 2);
if ($tmp[0]=='upgrade' && ! empty($tmp[1])) $targetversion=$tmp[1]; if ($tmp[0]=='upgrade')
{
if (! empty($tmp[1])) $targetversion=$tmp[1]; // if $action = 'upgrade_6.0.0-beta', we use '6.0.0-beta'
else $targetversion=DOL_VERSION; // if $action = 'upgrade', we use DOL_VERSION
}
} }
$langs->load("admin"); $langs->load("admin");

View File

@ -106,7 +106,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
{ {
$actiondone=1; $actiondone=1;
print '<h3>'.$langs->trans("DatabaseMigration").'</h3>'; print '<h3><img class="valigntextbottom" src="../theme/common/octicons/lib/svg/database.svg" width="20" alt="Database"> '.$langs->trans("DatabaseMigration").'</h3>';
print '<table cellspacing="0" cellpadding="1" border="0" width="100%">'; print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';
$error=0; $error=0;

View File

@ -106,7 +106,7 @@ pHeader('','step5',GETPOST('action','aZ09')?GETPOST('action','aZ09'):'upgrade','
if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09'))) if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09')))
{ {
print '<h3>'.$langs->trans('DataMigration').'</h3>'; print '<h3><img class="valigntextbottom" src="../theme/common/octicons/lib/svg/database.svg" width="20" alt="Database"> '.$langs->trans('DataMigration').'</h3>';
print '<table cellspacing="0" cellpadding="1" border="0" width="100%">'; print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';

View File

@ -28,6 +28,7 @@ OverviewOfAmountOfLinesBound=Overview of amount of lines already bound to accoun
OtherInfo=Other information OtherInfo=Other information
DeleteCptCategory=Remove accounting account from group DeleteCptCategory=Remove accounting account from group
ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account from the accounting account group ? ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account from the accounting account group ?
AlreadyInGeneralLedger=Already journalized in ledgers
AccountancyArea=Accountancy area AccountancyArea=Accountancy area
AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: AccountancyAreaDescIntro=Usage of the accountancy module is done in several step:
@ -62,7 +63,6 @@ Addanaccount=إضافة حساب محاسبي
AccountAccounting=حساب محاسبي AccountAccounting=حساب محاسبي
AccountAccountingShort=حساب AccountAccountingShort=حساب
SubledgerAccount=Subledger Account SubledgerAccount=Subledger Account
subledger_account=Subledger Account
ShowAccountingAccount=Show accounting account ShowAccountingAccount=Show accounting account
ShowAccountingJournal=Show accounting journal ShowAccountingJournal=Show accounting journal
AccountAccountingSuggest=Accounting account suggested AccountAccountingSuggest=Accounting account suggested
@ -79,6 +79,7 @@ SuppliersVentilation=Supplier invoice binding
ExpenseReportsVentilation=Expense report binding ExpenseReportsVentilation=Expense report binding
CreateMvts=Create new transaction CreateMvts=Create new transaction
UpdateMvts=Modification of a transaction UpdateMvts=Modification of a transaction
ValidTransaction=Validate transaction
WriteBookKeeping=Journalize transactions in Ledger WriteBookKeeping=Journalize transactions in Ledger
Bookkeeping=Ledger Bookkeeping=Ledger
AccountBalance=Account balance AccountBalance=Account balance
@ -142,6 +143,7 @@ NumPiece=Piece number
TransactionNumShort=Num. transaction TransactionNumShort=Num. transaction
AccountingCategory=Accounting account groups AccountingCategory=Accounting account groups
GroupByAccountAccounting=Group by accounting account GroupByAccountAccounting=Group by accounting account
ByAccounts=By accounts
NotMatch=Not Set NotMatch=Not Set
DeleteMvt=Delete Ledger lines DeleteMvt=Delete Ledger lines
DelYear=Year to delete DelYear=Year to delete
@ -214,12 +216,14 @@ AccountingJournalType1=Various operation
AccountingJournalType2=مبيعات AccountingJournalType2=مبيعات
AccountingJournalType3=مشتريات AccountingJournalType3=مشتريات
AccountingJournalType4=بنك AccountingJournalType4=بنك
AccountingJournalType5=Expenses report
AccountingJournalType9=Has-new AccountingJournalType9=Has-new
ErrorAccountingJournalIsAlreadyUse=This journal is already use ErrorAccountingJournalIsAlreadyUse=This journal is already use
## Export ## Export
Exports=صادرات Exports=صادرات
Export=تصدير Export=تصدير
ExportDraftJournal=Export draft journal
Modelcsv=نموذج التصدير Modelcsv=نموذج التصدير
OptionsDeactivatedForThisExportModel=تم الغاء الخيارات لنموذج التصدير هذا OptionsDeactivatedForThisExportModel=تم الغاء الخيارات لنموذج التصدير هذا
Selectmodelcsv=تحديد نموذج للتصدير Selectmodelcsv=تحديد نموذج للتصدير

View File

@ -536,7 +536,7 @@ Module1120Desc=اقتراح تجاري طلب المورد والأسعار
Module1200Name=فرس النبي Module1200Name=فرس النبي
Module1200Desc=فرس النبي التكامل Module1200Desc=فرس النبي التكامل
Module1400Name=المحاسبة Module1400Name=المحاسبة
Module1400Desc=المحاسبة الإدارية (ضعف الأحزاب) Module1400Desc=Accounting management (double entries)
Module1520Name=الجيل ثيقة Module1520Name=الجيل ثيقة
Module1520Desc=الجيل ثيقة الإلكتروني الشامل Module1520Desc=الجيل ثيقة الإلكتروني الشامل
Module1780Name=الكلمات / فئات Module1780Name=الكلمات / فئات
@ -585,7 +585,7 @@ Module50100Desc=Point of sales module (POS).
Module50200Name=باي بال Module50200Name=باي بال
Module50200Desc=وحدة لتقديم على صفحة الدفع عبر الإنترنت عن طريق بطاقة الائتمان مع بايبال Module50200Desc=وحدة لتقديم على صفحة الدفع عبر الإنترنت عن طريق بطاقة الائتمان مع بايبال
Module50400Name=المحاسبة (متقدم) Module50400Name=المحاسبة (متقدم)
Module50400Desc=المحاسبة الإدارية (الأحزاب مزدوجة) Module50400Desc=Accounting management (double entries)
Module54000Name=PrintIPP Module54000Name=PrintIPP
Module54000Desc=(يجب أن تكون الطابعة مرئية من الخادم، ويجب أن تكون الكؤوس تركيبها على الخادم) الطباعة مباشرة (دون فتح المستندات) باستخدام واجهة الكؤوس IPP. Module54000Desc=(يجب أن تكون الطابعة مرئية من الخادم، ويجب أن تكون الكؤوس تركيبها على الخادم) الطباعة مباشرة (دون فتح المستندات) باستخدام واجهة الكؤوس IPP.
Module55000Name=استطلاع للرأي، أو مسح التصويت Module55000Name=استطلاع للرأي، أو مسح التصويت

View File

@ -48,12 +48,13 @@ InvoiceDeleteDolibarr=تم حذف %s من الفاتورة
InvoicePaidInDolibarr=تغيير فاتورة%s لدفع InvoicePaidInDolibarr=تغيير فاتورة%s لدفع
InvoiceCanceledInDolibarr=فاتورة%s إلغاء InvoiceCanceledInDolibarr=فاتورة%s إلغاء
MemberValidatedInDolibarr=عضو%s التأكد من صلاحيتها MemberValidatedInDolibarr=عضو%s التأكد من صلاحيتها
MemberModifiedInDolibarr=Member %s modified
MemberResiliatedInDolibarr=Member %s terminated MemberResiliatedInDolibarr=Member %s terminated
MemberDeletedInDolibarr=عضو٪ الصورة حذفها MemberDeletedInDolibarr=عضو٪ الصورة حذفها
MemberSubscriptionAddedInDolibarr=وأضاف الاشتراك لعضو٪ الصورة MemberSubscriptionAddedInDolibarr=وأضاف الاشتراك لعضو٪ الصورة
ShipmentValidatedInDolibarr=شحنة%s التأكد من صلاحيتها ShipmentValidatedInDolibarr=شحنة%s التأكد من صلاحيتها
ShipmentClassifyClosedInDolibarr=Shipment %s classify billed ShipmentClassifyClosedInDolibarr=Shipment %s classified billed
ShipmentUnClassifyCloseddInDolibarr=Shipment %s classify reopened ShipmentUnClassifyCloseddInDolibarr=Shipment %s classified reopened
ShipmentDeletedInDolibarr=شحنة٪ الصورة حذفها ShipmentDeletedInDolibarr=شحنة٪ الصورة حذفها
OrderCreatedInDolibarr=Order %s created OrderCreatedInDolibarr=Order %s created
OrderValidatedInDolibarr=تم توثيق %s من الطلب OrderValidatedInDolibarr=تم توثيق %s من الطلب
@ -74,13 +75,17 @@ InterventionSentByEMail=التدخل%s إرسالها عن طريق البريد
ProposalDeleted=Proposal deleted ProposalDeleted=Proposal deleted
OrderDeleted=Order deleted OrderDeleted=Order deleted
InvoiceDeleted=Invoice deleted InvoiceDeleted=Invoice deleted
PRODUCT_CREATEInDolibarr=Product %s created
PRODUCT_MODIFYInDolibarr=Product %s modified
PRODUCT_DELETEInDolibarr=Product %s deleted
##### End agenda events ##### ##### End agenda events #####
AgendaModelModule=Document templates for event
DateActionStart=تاريخ البدء DateActionStart=تاريخ البدء
DateActionEnd=تاريخ النهاية DateActionEnd=تاريخ النهاية
AgendaUrlOptions1=يمكنك أيضا إضافة المعايير التالية لترشيح النتائج: AgendaUrlOptions1=يمكنك أيضا إضافة المعايير التالية لترشيح النتائج:
AgendaUrlOptions2=<b>تسجيل الدخول =٪ s إلى</b> تقييد الإخراج إلى الإجراءات التي أنشأتها أو المخصصة <b>للمستخدم%s.</b>
AgendaUrlOptions3=<b>وجينا =٪ s إلى</b> تقييد الإخراج إلى الإجراءات التي <b>يملكها%s</b> المستخدم. AgendaUrlOptions3=<b>وجينا =٪ s إلى</b> تقييد الإخراج إلى الإجراءات التي <b>يملكها%s</b> المستخدم.
AgendaUrlOptions4=<b>logint=<b>logint=%s</b> لتقييد الانتاج للإجراءات المناطة للمستخدم <b>%s</b> AgendaUrlOptionsNotAdmin=<b>logina=!%s</b> to restrict output to actions not owned by user <b>%s</b>.
AgendaUrlOptions4=<b>logint=%s</b> to restrict output to actions assigned to user <b>%s</b> (owner and others).
AgendaUrlOptionsProject=<b>مشروع = PROJECT_ID</b> لتقييد الإخراج إلى الإجراءات المرتبطة <b>PROJECT_ID</b> المشروع. AgendaUrlOptionsProject=<b>مشروع = PROJECT_ID</b> لتقييد الإخراج إلى الإجراءات المرتبطة <b>PROJECT_ID</b> المشروع.
AgendaShowBirthdayEvents=Show birthdays of contacts AgendaShowBirthdayEvents=Show birthdays of contacts
AgendaHideBirthdayEvents=Hide birthdays of contacts AgendaHideBirthdayEvents=Hide birthdays of contacts

View File

@ -66,6 +66,7 @@ RemoveFromRubriqueConfirm=Are you sure you want to remove link between the entry
ListBankTransactions=List of bank entries ListBankTransactions=List of bank entries
IdTransaction=رقم المعاملات IdTransaction=رقم المعاملات
BankTransactions=Bank entries BankTransactions=Bank entries
BankTransaction=Bank entry
ListTransactions=List entries ListTransactions=List entries
ListTransactionsByCategory=List entries/category ListTransactionsByCategory=List entries/category
TransactionsToConciliate=Entries to reconcile TransactionsToConciliate=Entries to reconcile
@ -150,3 +151,7 @@ CheckRejectedAndInvoicesReopened=تحقق عاد والفواتير فتح
BankAccountModelModule=Document templates for bank accounts BankAccountModelModule=Document templates for bank accounts
DocumentModelSepaMandate=Template of SEPA mandate. Usefull for european countries in EEC only. DocumentModelSepaMandate=Template of SEPA mandate. Usefull for european countries in EEC only.
DocumentModelBan=Template to print a page with BAN information. DocumentModelBan=Template to print a page with BAN information.
NewVariousPayment=New various payment
VariousPayment=Various payment
VariousPayments=Various payments
ShowVariousPayment=Show various payment

View File

@ -15,9 +15,9 @@ DisabledBecauseNotErasable=Disabled because cannot be erased
InvoiceStandard=فاتورة موحدة InvoiceStandard=فاتورة موحدة
InvoiceStandardAsk=فاتورة موحدة InvoiceStandardAsk=فاتورة موحدة
InvoiceStandardDesc=هذا النوع من الفاتورة هي فاتورة عام. InvoiceStandardDesc=هذا النوع من الفاتورة هي فاتورة عام.
InvoiceDeposit=إيداع فاتورة InvoiceDeposit=Down payment invoice
InvoiceDepositAsk=إيداع فاتورة InvoiceDepositAsk=Down payment invoice
InvoiceDepositDesc=هذا النوع من الفاتورة يتم فيه ايداع وقد وردت. InvoiceDepositDesc=This kind of invoice is done when a down payment has been received.
InvoiceProForma=Proforma الفاتورة InvoiceProForma=Proforma الفاتورة
InvoiceProFormaAsk=الفاتورة الأولية InvoiceProFormaAsk=الفاتورة الأولية
InvoiceProFormaDesc=<b>Proforma الفاتورة</b> هو صورة حقيقية فاتورة المحاسبة ولكن ليس له قيمة. InvoiceProFormaDesc=<b>Proforma الفاتورة</b> هو صورة حقيقية فاتورة المحاسبة ولكن ليس له قيمة.
@ -62,7 +62,7 @@ PaymentsBack=عودة المدفوعات
paymentInInvoiceCurrency=in invoices currency paymentInInvoiceCurrency=in invoices currency
PaidBack=تسديدها PaidBack=تسديدها
DeletePayment=حذف الدفع DeletePayment=حذف الدفع
ConfirmDeletePayment=هل أنت متأكد من أنك تريد حذف هذا المبلغ؟ ConfirmDeletePayment=Are you sure you want to delete this payment?
ConfirmConvertToReduc=Do you want to convert this %s into an absolute discount ?<br>The amount will so be saved among all discounts and could be used as a discount for a current or a future invoice for this customer. ConfirmConvertToReduc=Do you want to convert this %s into an absolute discount ?<br>The amount will so be saved among all discounts and could be used as a discount for a current or a future invoice for this customer.
SupplierPayments=الموردين والمدفوعات SupplierPayments=الموردين والمدفوعات
ReceivedPayments=تلقت مدفوعات ReceivedPayments=تلقت مدفوعات
@ -115,7 +115,7 @@ BillStatus=حالة الفاتورة
StatusOfGeneratedInvoices=Status of generated invoices StatusOfGeneratedInvoices=Status of generated invoices
BillStatusDraft=مشروع (لا بد من التحقق من صحة) BillStatusDraft=مشروع (لا بد من التحقق من صحة)
BillStatusPaid=دفع BillStatusPaid=دفع
BillStatusPaidBackOrConverted=Refund or converted into discount BillStatusPaidBackOrConverted=Credit note refund or converted into discount
BillStatusConverted=وتحول إلى خصم BillStatusConverted=وتحول إلى خصم
BillStatusCanceled=المهجورة BillStatusCanceled=المهجورة
BillStatusValidated=مصادق عليه (لا بد من دفعها) BillStatusValidated=مصادق عليه (لا بد من دفعها)
@ -127,7 +127,7 @@ BillStatusClosedPaidPartially=دفعت (جزئيا)
BillShortStatusDraft=مسودة BillShortStatusDraft=مسودة
BillShortStatusPaid=دفع BillShortStatusPaid=دفع
BillShortStatusPaidBackOrConverted=Refund or converted BillShortStatusPaidBackOrConverted=Refund or converted
BillShortStatusConverted=تجهيز BillShortStatusConverted=دفع
BillShortStatusCanceled=المهجورة BillShortStatusCanceled=المهجورة
BillShortStatusValidated=صادق BillShortStatusValidated=صادق
BillShortStatusStarted=بدأت BillShortStatusStarted=بدأت
@ -198,12 +198,12 @@ ShowBill=وتظهر الفاتورة
ShowInvoice=وتظهر الفاتورة ShowInvoice=وتظهر الفاتورة
ShowInvoiceReplace=وتظهر استبدال الفاتورة ShowInvoiceReplace=وتظهر استبدال الفاتورة
ShowInvoiceAvoir=وتظهر المذكرة الائتمان ShowInvoiceAvoir=وتظهر المذكرة الائتمان
ShowInvoiceDeposit=وتبين أن تودع الفاتورة ShowInvoiceDeposit=Show down payment invoice
ShowInvoiceSituation=Show situation invoice ShowInvoiceSituation=Show situation invoice
ShowPayment=وتظهر الدفع ShowPayment=وتظهر الدفع
AlreadyPaid=دفعت بالفعل AlreadyPaid=دفعت بالفعل
AlreadyPaidBack=دفعت بالفعل العودة AlreadyPaidBack=دفعت بالفعل العودة
AlreadyPaidNoCreditNotesNoDeposits=دفعت بالفعل (بدون تلاحظ الائتمان والودائع) AlreadyPaidNoCreditNotesNoDeposits=Already paid (without credit notes and down payments)
Abandoned=المهجورة Abandoned=المهجورة
RemainderToPay=تبقى بدون أجر RemainderToPay=تبقى بدون أجر
RemainderToTake=المتبقي لاتخاذ RemainderToTake=المتبقي لاتخاذ
@ -270,10 +270,10 @@ RelativeDiscount=الخصم النسبي
GlobalDiscount=خصم العالمية GlobalDiscount=خصم العالمية
CreditNote=علما الائتمان CreditNote=علما الائتمان
CreditNotes=ويلاحظ الائتمان CreditNotes=ويلاحظ الائتمان
Deposit=إيداع Deposit=Down payment
Deposits=الودائع Deposits=Down payments
DiscountFromCreditNote=خصم من دائن %s DiscountFromCreditNote=خصم من دائن %s
DiscountFromDeposit=المدفوعات من فاتورة %s DiscountFromDeposit=Down payments from invoice %s
DiscountFromExcessReceived=Payments from excess received of invoice %s DiscountFromExcessReceived=Payments from excess received of invoice %s
AbsoluteDiscountUse=هذا النوع من الائتمان يمكن استخدامها على الفاتورة قبل المصادقة AbsoluteDiscountUse=هذا النوع من الائتمان يمكن استخدامها على الفاتورة قبل المصادقة
CreditNoteDepositUse=Invoice must be validated to use this kind of credits CreditNoteDepositUse=Invoice must be validated to use this kind of credits
@ -447,7 +447,7 @@ CantRemovePaymentWithOneInvoicePaid=تصنيف لا يمكن إزالة الدف
ExpectedToPay=من المتوقع الدفع ExpectedToPay=من المتوقع الدفع
CantRemoveConciliatedPayment=Can't remove conciliated payment CantRemoveConciliatedPayment=Can't remove conciliated payment
PayedByThisPayment=سيولي هذا الدفع PayedByThisPayment=سيولي هذا الدفع
ClosePaidInvoicesAutomatically=تصنيف "مدفوع" كل مستوى، حالة أو الفواتير استبدال دفعت بالكامل. ClosePaidInvoicesAutomatically=Classify "Paid" all standard, down payment or replacement invoices entirely paid.
ClosePaidCreditNotesAutomatically=تصنيف "مدفوع" كل الملاحظات الائتمان تدفع بالكامل مرة أخرى. ClosePaidCreditNotesAutomatically=تصنيف "مدفوع" كل الملاحظات الائتمان تدفع بالكامل مرة أخرى.
ClosePaidContributionsAutomatically=Classify "Paid" all social or fiscal contributions entirely paid. ClosePaidContributionsAutomatically=Classify "Paid" all social or fiscal contributions entirely paid.
AllCompletelyPayedInvoiceWillBeClosed=كل فاتورة مع عدم وجود لا تزال لدفع ستغلق تلقائيا إلى &quot;فياض&quot; الوضع. AllCompletelyPayedInvoiceWillBeClosed=كل فاتورة مع عدم وجود لا تزال لدفع ستغلق تلقائيا إلى &quot;فياض&quot; الوضع.
@ -462,9 +462,9 @@ YouMustCreateStandardInvoiceFirstDesc=You have to create a standard invoice firs
PDFCrabeDescription=نموذج فاتورة Crabe. نموذج الفاتورة كاملة (دعم الخيار الضريبة على القيمة المضافة ، والخصومات ، وشروط الدفع ، والشعار ، الخ..) PDFCrabeDescription=نموذج فاتورة Crabe. نموذج الفاتورة كاملة (دعم الخيار الضريبة على القيمة المضافة ، والخصومات ، وشروط الدفع ، والشعار ، الخ..)
PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice template for situation invoices PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice template for situation invoices
TerreNumRefModelDesc1=عودة عدد مع الشكل syymm NNNN عن الفواتير القياسية و٪ syymm-NNNN لتلاحظ الائتمان حيث هو YY العام٪، مم هو الشهر وnnnn هو تسلسل مع أي انقطاع وعدم العودة إلى 0 TerreNumRefModelDesc1=عودة عدد مع الشكل syymm NNNN عن الفواتير القياسية و٪ syymm-NNNN لتلاحظ الائتمان حيث هو YY العام٪، مم هو الشهر وnnnn هو تسلسل مع أي انقطاع وعدم العودة إلى 0
MarsNumRefModelDesc1=عودة عدد مع الشكل syymm NNNN عن الفواتير القياسية٪،٪ syymm-NNNN عن الفواتير استبدال،٪ syymm-NNNN لفواتير الودائع و٪ syymm-NNNN لتلاحظ الائتمان حيث هو YY العام، مم هو الشهر وnnnn هو تسلسل مع عدم وجود كسر وعدم العودة إلى 0 MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for down payment invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
TerreNumRefModelError=وهناك مشروع قانون بدءا من دولار ويوجد بالفعل syymm لا تتفق مع هذا النموذج من التسلسل. إزالة أو تغيير تسميتها لتصبح لتفعيل هذه الوحدة. TerreNumRefModelError=وهناك مشروع قانون بدءا من دولار ويوجد بالفعل syymm لا تتفق مع هذا النموذج من التسلسل. إزالة أو تغيير تسميتها لتصبح لتفعيل هذه الوحدة.
CactusNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for deposit invoices where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 CactusNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for down payment invoices where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
##### Types de contacts ##### ##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=ممثل العميل متابعة فاتورة TypeContact_facture_internal_SALESREPFOLL=ممثل العميل متابعة فاتورة
TypeContact_facture_external_BILLING=الزبون فاتورة الاتصال TypeContact_facture_external_BILLING=الزبون فاتورة الاتصال

View File

@ -2,6 +2,8 @@
AddThisPageToBookmarks=أضف هذه الصفحة إلى المفضلة AddThisPageToBookmarks=أضف هذه الصفحة إلى المفضلة
Bookmark=احفظ Bookmark=احفظ
Bookmarks=العناوين Bookmarks=العناوين
ListOfBookmarks=قائمة العناوين
EditBookmarks=List/edit bookmarks
NewBookmark=إشارة مرجعية جديدة NewBookmark=إشارة مرجعية جديدة
ShowBookmark=وتظهر علامة ShowBookmark=وتظهر علامة
OpenANewWindow=فتح نافذة جديدة OpenANewWindow=فتح نافذة جديدة

View File

@ -1,4 +1,5 @@
# Dolibarr language file - Source file is en_US - boxes # Dolibarr language file - Source file is en_US - boxes
BoxLoginInformation=Login information
BoxLastRssInfos=المعلومات RSS BoxLastRssInfos=المعلومات RSS
BoxLastProducts=Latest %s products/services BoxLastProducts=Latest %s products/services
BoxProductsAlertStock=Stock alerts for products BoxProductsAlertStock=Stock alerts for products
@ -82,3 +83,4 @@ ForCustomersOrders=أوامر العملاء
ForProposals=اقتراحات ForProposals=اقتراحات
LastXMonthRolling=The latest %s month rolling LastXMonthRolling=The latest %s month rolling
ChooseBoxToAdd=Add widget to your dashboard ChooseBoxToAdd=Add widget to your dashboard
BoxAdded=Widget was added in your dashboard

View File

@ -1,6 +1,7 @@
# Dolibarr language file - Source file is en_US - categories # Dolibarr language file - Source file is en_US - categories
Rubrique=العلامة / الفئة Rubrique=العلامة / الفئة
Rubriques=الكلمات / فئات Rubriques=الكلمات / فئات
RubriquesTransactions=Tags/Categories of transactions
categories=علامات / فئات categories=علامات / فئات
NoCategoryYet=أي علامة / فئة من هذا النوع تم إنشاؤها NoCategoryYet=أي علامة / فئة من هذا النوع تم إنشاؤها
In=في In=في

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