diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 74479a9d39f62..e6bae2f73d8e3 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -142,18 +142,17 @@ } if ($action == 'setdisabledirectinput') { - $setdisabledirectinput = GETPOST('value', 'int'); - $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); - if (! $res > 0) - $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } + $setdisabledirectinput = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); + if (! $res > 0) + $error ++; + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } } - /* * View */ @@ -243,20 +242,20 @@ } print ''; - $var = ! $var; - print ""; - print '' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; - if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - + $var = ! $var; + print ""; + print '' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; + if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ''; + $var = ! $var; print ""; print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index aee7d7172c6a1..4174ee7809f7b 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -369,22 +369,23 @@ function delete($user, $notrigger = 0) { */ function getNomUrl($withpicto = 0) { global $langs; - + $result = ''; - + $link = ''; $linkend = ''; - + $picto = 'billr'; - + $label = $langs->trans("Show") . ': ' . $this->account_number . ' - ' . $this->label; - + if ($withpicto) $result .= ($link . img_object($label, $picto) . $linkend); if ($withpicto && $withpicto != 2) $result .= ' '; if ($withpicto != 2) - $result .= $link . $this->account_number . $linkend; + require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; + $result .= $link . length_accountg($this->account_number) . ' - ' . $this->label . $linkend; return $result; } diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php deleted file mode 100644 index cdeacefafe189..0000000000000 --- a/htdocs/comm/propal/apercu.php +++ /dev/null @@ -1,224 +0,0 @@ - - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2007 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2014 Frederic France - * - * 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 . - */ - -/** - * \file htdocs/comm/propal/apercu.php - * \ingroup propal - * \brief Preview tab of propal - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - -$langs->load('propal'); -$langs->load("bills"); -$langs->load('compta'); - -// Security check -$socid=0; -$id = GETPOST('id','int'); -$ref = GETPOST("ref"); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'propal', $id); - - -/* - * View Mode - */ - -$form = new Form($db); - -llxHeader(); - -if ($id > 0 || ! empty($ref)) -{ - $object = new Propal($db); - - if ($object->fetch($id,$ref) > 0) - { - $soc = new Societe($db); - $soc->fetch($object->socid); - - $head = propal_prepare_head($object); - dol_fiche_head($head, 'preview', $langs->trans('Proposal'), 0, 'propal'); - - - /* - * Propal - */ - print ''; - - $linkback = '' . $langs->trans("BackToList") . ''; - - // Ref - print ''; - - // Ref client - print ''; - print ''; - print ''; - - - // Thirdparty - print ''; - print ''; - print ''; - - // Status - print ''; - print ''; - print ''; - - // Discount - print ''; - print ''; - - // Date - print ''; - print ''; - - // Right part with $rowspan lines - $rowspan=4; - print ''; - print ''; - - // Total HT - left part - print ''; - print ''; - print ''; - - // Total VAT - left part - print ''; - print ''; - print ''; - - // Total TTC - left part - print ''; - print ''; - print ''; - - print '
' . $langs->trans('Ref') . ''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); - print '
'.$langs->trans('RefCustomer').''.$object->ref_client.'
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans('Discounts').''; - if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - $absolute_discount=$soc->getAvailableDiscounts(); - print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency)); - else print $langs->trans("CompanyHasNoAbsoluteDiscount"); - print '.
'.$langs->trans('Date').''.dol_print_date($object->date,'daytext').''; - - /* - * Documents - */ - $objectref = dol_sanitizeFileName($object->ref); - $dir_output = $conf->propal->dir_output . "/"; - $filepath = $dir_output . $objectref . "/"; - $file = $filepath . $objectref . ".pdf"; - $filedetail = $filepath . $objectref . "-detail.pdf"; - $relativepath = $objectref.'/'.$objectref.'.pdf'; - $relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf'; - - // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") - $fileimage = $file.'_preview.png'; // If PDF has 1 page - $fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page - $relativepathimage = $relativepath.'_preview.png'; - - $var=true; - - // Si fichier PDF existe - if (file_exists($file)) - { - $encfile = urlencode($file); - print ''; - print ''; - - print ''; - - print ''; - - print ''; - print ''; - print ''; - - print "
'.$langs->trans("Documents").'
'.$langs->trans("Proposal").' PDF'.$object->ref.'.pdf'.dol_print_size(dol_filesize($file)).''.dol_print_date(dol_filemtime($file),'dayhour').'
\n"; - - // Conversion du PDF en image png si fichier png non existant - if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file))) - { - if (class_exists("Imagick")) - { - $ret = dol_convert_file($file,'png',$fileimage); - if ($ret < 0) $error++; - } - else - { - $langs->load("errors"); - print ''.$langs->trans("ErrorNoImagickReadimage").''; - } - } - } - - print '
'.$langs->trans('AmountHT').'' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans('AmountVAT').'' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans('AmountTTC').'' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '
'; - - dol_fiche_end(); - } - else - { - // Propal non trouvee - print $langs->trans("ErrorPropalNotFound",$_GET["id"]); - } -} - -print ''; -print ''; -print '
'; -print '
'; -// Si fichier png PDF d'1 page trouve -if (file_exists($fileimage)) -{ - print ''; -} -// Si fichier png PDF de plus d'1 page trouve -elseif (file_exists($fileimagebis)) -{ - $multiple = preg_replace('/\.png/','',$relativepath) . "-"; - - for ($i = 0; $i < 20; $i++) - { - $preview = $multiple.$i.'.png'; - - if (file_exists($dir_output.$preview)) - { - print '

'; - } - } -} -print '

'; -print '
'; - - -llxFooter(); - -$db->close(); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e1224ad0e7273..9b70ee36acec6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1804,42 +1804,7 @@ print ''; - // Ref - /* - print ''; - */ - - // Ref customer - /* - print ''; - print ''; - */ - - // Company - /* - print ''; - print '';*/ - - // Lin for thirdparty discounts + // Link for thirdparty discounts print '
' . $langs->trans('Ref') . ''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); - print '
'; - print ''; - if ($action != 'refclient' && ! empty($object->brouillon)) - print ''; - print '
'; - print $langs->trans('RefCustomer') . '' . img_edit($langs->trans('Modify')) . '
'; - print '
'; - if ($user->rights->propal->creer && $action == 'refclient') { - print '
'; - print ''; - print ''; - print ''; - print ' '; - print '
'; - } else { - print $object->ref_client; - } - print '
' . $langs->trans('Company') . '' . $soc->getNomUrl(1) . '
' . $langs->trans('Discounts') . ''; if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent); diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php deleted file mode 100644 index 1ec3a0533cc28..0000000000000 --- a/htdocs/commande/apercu.php +++ /dev/null @@ -1,223 +0,0 @@ - - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2014 Frederic France - * - * 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 . - */ - -/** - * \file htdocs/commande/apercu.php - * \ingroup commande - * \brief Preview tab of order - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - -$langs->load('orders'); -$langs->load("bills"); -$langs->load('compta'); - -// Security check -$socid=0; -$id = GETPOST('id','int'); -$ref = GETPOST("ref"); -if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'commande',$id,''); - - -/* - * View Mode - */ - -$form = new Form($db); - -llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'); - -if ($id > 0 || ! empty($ref)) -{ - $object = new Commande($db); - - if ($object->fetch($id,$ref) > 0) - { - $soc = new Societe($db); - $soc->fetch($object->socid); - - - $head = commande_prepare_head($object); - dol_fiche_head($head, 'preview', $langs->trans("CustomerOrder"), 0, 'order'); - - print ''; - - //$linkback = '' . $langs->trans("BackToList") . ''; - - // Ref - print ''; - - // Ref cde client - print ''; - print ''; - print ''; - - // Client - print ''; - print ''; - print ''; - - // Statut - print ''; - print ''; - print ''; - - // Discount - left part - print ''; - print ''; - print ''; - - // Date - left part - print ''; - print ''; - - // Right part with $rowspan lines - $rowspan=4; - print ''; - - // Total HT - left part - print ''; - print ''; - print ''; - - // Total VAT - left part - print ''; - print ''; - print ''; - - // Total TTC - left part - print ''; - print ''; - print ''; - - print '
' . $langs->trans('Ref') . ''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); - print '
'.$langs->trans('RefCustomer').''.$object->ref_client.'
'.$langs->trans("Customer").''.$soc->getNomUrl(1).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans('Discounts').''.$object->remise_percent.'%
'.$langs->trans("Date").''.dol_print_date($object->date,"daytext").''; - - /* - * Documents - */ - $objectref = dol_sanitizeFileName($object->ref); - $dir_output = $conf->commande->dir_output . "/"; - $filepath = $dir_output . $objectref . "/"; - $file = $filepath . $objectref . ".pdf"; - $filedetail = $filepath . $objectref . "-detail.pdf"; - $relativepath = $objectref.'/'.$objectref.'.pdf'; - $relativepathdetail = $objectref.'/'.$objectref.'-detail.pdf'; - - // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") - $fileimage = $file.'_preview.png'; // If PDF has 1 page - $fileimagebis = $file.'_preview-0.pdf.png'; // If PDF has more than one page - $relativepathimage = $relativepath.'_preview.png'; - - $var=true; - - // if PDF file exist - if (file_exists($file)) - { - $encfile = urlencode($file); - print ''; - print ''; - - print ""; - - print ''; - print ''; - print ''; - print ''; - - // Si fichier detail PDF existe - // TODO deprecated ? - if (file_exists($filedetail)) - { - print ""; - - print ''; - print ''; - print ''; - print ''; - } - print "
'.$langs->trans("Documents").'
".$langs->trans("Order")." PDF'.$object->ref.'.pdf'.dol_print_size(dol_filesize($file)).''.dol_print_date(dol_filemtime($file),'dayhour').'
Commande detaillee'.$object->ref.'-detail.pdf'.dol_print_size(dol_filesize($filedetail)).''.dol_print_date(dol_filemtime($filedetail),'dayhour').'
\n"; - - // Conversion du PDF en image png si fichier png non existant - if ((! file_exists($fileimage) && ! file_exists($fileimagebis)) || (filemtime($fileimage) < filemtime($file))) - { - if (class_exists("Imagick")) - { - $ret = dol_convert_file($file,'png',$fileimage); - if ($ret < 0) $error++; - } - else - { - $langs->load("errors"); - print ''.$langs->trans("ErrorNoImagickReadimage").''; - } - } - } - - print '
'.$langs->trans('AmountHT').'' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans('AmountVAT').'' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
'.$langs->trans('AmountTTC').'' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '
'; - - dol_fiche_end(); - } - else - { - // Object not found - print $langs->trans("ErrorOrderNotFound",$id); - } -} - -print ''; -print ''; -print '
'; -print '
'; -// Si fichier png PDF d'1 page trouve -if (file_exists($fileimage)) -{ - print ''; -} -// Si fichier png PDF de plus d'1 page trouve -elseif (file_exists($fileimagebis)) -{ - $multiple = preg_replace('/\.png/','',$relativepath) . "-"; - - for ($i = 0; $i < 20; $i++) - { - $preview = $multiple.$i.'.png'; - - if (file_exists($dir_output.$preview)) - { - print '

'; - } - } -} -print '

'; -print '
'; - - -llxFooter(); - -$db->close(); diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index de0e6d70b4c7d..9af9b6f4707bd 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -4,8 +4,9 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Vinícius Nogueira * Copyright (C) 2014 Florian Henry - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2017 Alexandre Spangaro * * 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 @@ -396,40 +397,37 @@ foreach ($bankcateg->fetchAll() as $bankcategory) { $options[$bankcategory->id] = $bankcategory->label; } - + // Bank card - $head=bank_prepare_head($object); dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account'); - + $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - + dol_fiche_end(); - - /* * Buttons actions */ - if ($action != 'addline' && $action != 'reconcile') + if ($action != 'reconcile') { print '
'; - - if ($action != 'addline') - { - if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) - { - if ($user->rights->banque->modifier) { - print ''.$langs->trans("AddBankRecord").''; - } else { - print ''.$langs->trans("AddBankRecord").''; - } - } else { - print ''.$langs->trans("AddBankRecord").''; - } - } + + if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) + { + if ($user->rights->banque->modifier) { + print ''.$langs->trans("AddBankRecord").''; + } else { + print ''.$langs->trans("AddBankRecord").''; + } + } + else + { + print ''.$langs->trans("AddBankRecord").''; + } + if ($object->canBeConciliated() > 0) { // If not cash account and can be reconciliate if ($user->rights->banque->consolidate) { @@ -640,49 +638,6 @@ // print '
'; } - // Form to add a transaction with no invoice - if ($user->rights->banque->modifier && $action == 'addline') - { - print load_fiche_titre($langs->trans("AddBankRecordLong"),'',''); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("Date").' '.$langs->trans("Type").''.$langs->trans("Numero").''.$langs->trans("Description").''.$langs->trans("Debit").''.$langs->trans("Credit").' 
'; - $form->select_date(empty($dateop)?-1:$dateop,'op',0,0,0,'transaction'); - print ''; - $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1); - print ''; - print ''; - print ''; - if ($options) { - print '
'.$langs->trans("Rubrique").': '; - print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); - } - print '
'; - print '
'; - print ''; - print '
'; - print '
'; - } - - /// ajax to adjust value date with plus and less picto print '