Merged revisions 5056,5058-5206,5209-5215 via svnmerge from
svn+ssh://danydb@svn/svn/phpcompta/tags/rel650 ........ r5056 | danydb | 2012-06-30 14:39:28 +0200 (Sat, 30 Jun 2012) | 2 lines 0000666: Limiter dans le tableau accueil, le calendrier à exercice courant 0000667: DASHBOAD : agrandir les éléments ........ r5058 | danydb | 2012-06-30 18:43:34 +0200 (Sat, 30 Jun 2012) | 6 lines ------------------------------------------------------------------------ r5057 | danydb | 2012-06-30 18:40:12 +0200 (Sat, 30 Jun 2012) | 1 line bug follow_up::get_late ------------------------------------------------------------------------ ........ r5059 | danydb | 2012-06-30 18:57:18 +0200 (Sat, 30 Jun 2012) | 1 line bug follow_up::get_late ........ r5060 | danydb | 2012-06-30 18:58:55 +0200 (Sat, 30 Jun 2012) | 1 line bug follow_up::get_late ........ r5061 | danydb | 2012-06-30 19:03:29 +0200 (Sat, 30 Jun 2012) | 1 line bug follow_up::get_late ........ r5062 | danydb | 2012-06-30 19:36:51 +0200 (Sat, 30 Jun 2012) | 1 line bug follow_up::get_late ........ r5063 | danydb | 2012-07-01 17:42:31 +0200 (Sun, 01 Jul 2012) | 1 line correct check_formula ........ r5064 | danydb | 2012-07-03 00:56:38 +0200 (Tue, 03 Jul 2012) | 1 line Due to rewrite of parse formula, formula are not evaluated properly ........ r5065 | danydb | 2012-07-08 20:58:45 +0200 (Sun, 08 Jul 2012) | 1 line Bug cannot create a new profile due a javascript error ........ r5066 | danydb | 2012-07-09 18:43:20 +0200 (Mon, 09 Jul 2012) | 1 line 0000674: Deux actions-gestion ne peuvent avoir le même numéro de pièce ........ r5067 | danydb | 2012-07-10 12:34:55 +0200 (Tue, 10 Jul 2012) | 1 line duplicate Ref ........ r5068 | danydb | 2012-07-15 11:14:27 +0200 (Sun, 15 Jul 2012) | 2 lines New function : select exercice with end & start date ........ r5069 | danydb | 2012-07-15 11:15:05 +0200 (Sun, 15 Jul 2012) | 2 lines Javascript var ask_global to reload window if it is <> 0 ........ r5070 | danydb | 2012-07-16 01:10:32 +0200 (Mon, 16 Jul 2012) | 1 line Fix bug in tool_uos ........ r5071 | danydb | 2012-07-19 02:22:15 +0200 (Thu, 19 Jul 2012) | 1 line Improve printing of action - gestion ........ r5072 | danydb | 2012-07-19 12:50:48 +0200 (Thu, 19 Jul 2012) | 2 lines 0000672: Amélioration apparence ........ r5073 | danydb | 2012-07-19 12:51:27 +0200 (Thu, 19 Jul 2012) | 2 lines Enlève background blanc pour les notices ........ r5074 | danydb | 2012-07-19 13:49:10 +0200 (Thu, 19 Jul 2012) | 1 line Improve printing of action - gestion ........ r5075 | danydb | 2012-07-19 16:31:11 +0200 (Thu, 19 Jul 2012) | 1 line Add script for Javascript sort of table ........ r5076 | danydb | 2012-07-19 17:52:24 +0200 (Thu, 19 Jul 2012) | 1 line Add script for Javascript sort of table ........ r5077 | danydb | 2012-07-19 18:13:18 +0200 (Thu, 19 Jul 2012) | 1 line Add script for Javascript sort of table for reconciliation bank ........ r5078 | danydb | 2012-07-20 14:55:50 +0200 (Fri, 20 Jul 2012) | 1 line Show default sorted column ........ r5079 | danydb | 2012-07-20 14:57:16 +0200 (Fri, 20 Jul 2012) | 1 line add documentation ........ r5080 | danydb | 2012-07-26 17:31:54 +0200 (Thu, 26 Jul 2012) | 1 line Add ID ........ r5081 | danydb | 2012-07-29 13:56:59 +0200 (Sun, 29 Jul 2012) | 4 lines add new function default_value_get default_value_post default_value_request ........ r5082 | danydb | 2012-07-29 14:14:51 +0200 (Sun, 29 Jul 2012) | 1 line improve documentation ........ r5083 | danydb | 2012-07-29 14:50:29 +0200 (Sun, 29 Jul 2012) | 1 line Add constant for year ........ r5084 | danydb | 2012-07-29 15:08:11 +0200 (Sun, 29 Jul 2012) | 1 line Message for exercice ........ r5085 | danydb | 2012-07-29 15:08:56 +0200 (Sun, 29 Jul 2012) | 1 line New constant for date range ........ r5086 | danydb | 2012-07-30 20:13:30 +0200 (Mon, 30 Jul 2012) | 1 line cosmetic ........ r5087 | danydb | 2012-07-30 20:38:17 +0200 (Mon, 30 Jul 2012) | 1 line cosmetic ........ r5088 | danydb | 2012-07-30 21:28:46 +0200 (Mon, 30 Jul 2012) | 1 line define max_card_search ........ r5089 | danydb | 2012-07-30 21:36:55 +0200 (Mon, 30 Jul 2012) | 1 line 0000695: ajout d'un bouton pour chercher une fiche ........ r5090 | danydb | 2012-07-30 21:42:06 +0200 (Mon, 30 Jul 2012) | 1 line Amélioration recherche ........ r5091 | danydb | 2012-07-30 21:44:23 +0200 (Mon, 30 Jul 2012) | 1 line Amélioration recherche ........ r5092 | danydb | 2012-08-23 20:29:52 +0200 (Thu, 23 Aug 2012) | 1 line add a field hidden ........ r5093 | danydb | 2012-08-23 22:52:06 +0200 (Thu, 23 Aug 2012) | 2 lines 0000705: Perte info lettrage lors de l'export .csv Nom de fichier comprennent la date et le poste comptable ........ r5094 | danydb | 2012-08-23 23:00:58 +0200 (Thu, 23 Aug 2012) | 1 line 0000700: CARD : historique, Dans le PDF, il manque le quick code et dans le CSV, il manque le nom ........ r5095 | danydb | 2012-08-23 23:06:00 +0200 (Thu, 23 Aug 2012) | 1 line recherche aussi sur quick-code ........ r5096 | danydb | 2012-08-23 23:20:32 +0200 (Thu, 23 Aug 2012) | 1 line #699 CARD : liste des fiches ........ r5097 | danydb | 2012-08-24 22:27:20 +0200 (Fri, 24 Aug 2012) | 1 line replace ob_clean by ob_end_clean ........ r5098 | danydb | 2012-09-04 19:55:56 +0200 (Tue, 04 Sep 2012) | 1 line ajout ag_ref dans action aujourd'hui et action en retard ........ r5099 | danydb | 2012-09-06 18:47:29 +0200 (Thu, 06 Sep 2012) | 1 line 0000721: Nouveaux tag pour les stocks dans génération de documents ........ r5100 | danydb | 2012-09-12 23:05:12 +0200 (Wed, 12 Sep 2012) | 1 line fix bug : when a value is empty then value is n ull ........ r5101 | danydb | 2012-09-15 00:30:02 +0200 (Sat, 15 Sep 2012) | 1 line fix : missing closing tag </a> ........ r5102 | danydb | 2012-09-15 15:22:08 +0200 (Sat, 15 Sep 2012) | 1 line Show type of menu ........ r5103 | danydb | 2012-09-15 17:39:55 +0200 (Sat, 15 Sep 2012) | 1 line Improve add menu printing ........ r5104 | danydb | 2012-09-15 17:48:42 +0200 (Sat, 15 Sep 2012) | 1 line Improve the profile configuration ........ r5105 | danydb | 2012-09-16 03:01:44 +0200 (Sun, 16 Sep 2012) | 1 line Improve the style sheet with hx.title ........ r5106 | danydb | 2012-09-16 18:40:59 +0200 (Sun, 16 Sep 2012) | 1 line bug : Impossible d'avoir impression GRAND LIVRE Pour compte non soldé ........ r5107 | danydb | 2012-09-16 18:53:59 +0200 (Sun, 16 Sep 2012) | 1 line Améliore apparence calculatrice ........ r5108 | danydb | 2012-09-17 20:28:04 +0200 (Mon, 17 Sep 2012) | 1 line When adding a menu it cannot depend on itself ........ r5109 | danydb | 2012-09-17 20:29:23 +0200 (Mon, 17 Sep 2012) | 1 line When adding a menu it cannot depend on itself (update) ........ r5110 | danydb | 2012-09-17 20:46:17 +0200 (Mon, 17 Sep 2012) | 1 line Show default menu ........ r5111 | danydb | 2012-09-17 20:55:13 +0200 (Mon, 17 Sep 2012) | 1 line bug : show default module ........ r5112 | danydb | 2012-09-17 20:57:00 +0200 (Mon, 17 Sep 2012) | 1 line bug : show default module, otherwise menu ........ r5113 | danydb | 2012-09-17 21:07:25 +0200 (Mon, 17 Sep 2012) | 1 line Default module otherwise try to find default menu if several results then returns the first one ........ r5114 | danydb | 2012-09-17 21:13:43 +0200 (Mon, 17 Sep 2012) | 1 line Fix bug when clicking several times on search_poste ........ r5115 | danydb | 2012-09-18 23:37:02 +0200 (Tue, 18 Sep 2012) | 1 line problème quand utilisateur est administrateur global, impossible de voir les postes comptables ........ r5116 | danydb | 2012-09-18 23:46:37 +0200 (Tue, 18 Sep 2012) | 1 line Improve the style sheet with hx.title ........ r5117 | danydb | 2012-09-18 23:47:27 +0200 (Tue, 18 Sep 2012) | 1 line improve html widget with un ID ........ r5118 | danydb | 2012-09-19 22:55:43 +0200 (Wed, 19 Sep 2012) | 1 line Bug locale must be in uppercase ........ r5119 | danydb | 2012-09-29 23:28:46 +0200 (Sat, 29 Sep 2012) | 1 line add the javascript function check_date and check_date_id ........ r5120 | danydb | 2012-09-30 00:04:17 +0200 (Sun, 30 Sep 2012) | 1 line correct javascript function check_date_id ........ r5121 | danydb | 2012-10-01 19:57:15 +0200 (Mon, 01 Oct 2012) | 1 line 0000736: Totaux dans écran ........ r5122 | danydb | 2012-10-01 20:47:26 +0200 (Mon, 01 Oct 2012) | 1 line 0000733: Impression opération depuis POP ME OUT ........ r5123 | danydb | 2012-10-01 20:47:56 +0200 (Mon, 01 Oct 2012) | 1 line Bug : id inconnu dans irelated_action ........ r5124 | danydb | 2012-10-01 20:56:07 +0200 (Mon, 01 Oct 2012) | 1 line 0000733: Impression opération depuis POP ME OUT ........ r5125 | danydb | 2012-10-01 20:58:53 +0200 (Mon, 01 Oct 2012) | 1 line bug css for select ........ r5126 | danydb | 2012-10-01 21:07:00 +0200 (Mon, 01 Oct 2012) | 1 line 0000732: Pouvoir imprimer les opérations avant confirmation ........ r5127 | danydb | 2012-10-01 21:16:04 +0200 (Mon, 01 Oct 2012) | 1 line bug financier le nom de la banque n'est pas mis à jour ........ r5128 | danydb | 2012-10-01 21:23:16 +0200 (Mon, 01 Oct 2012) | 1 line CSS cosmetic nom de journal en h2.title ........ r5129 | danydb | 2012-10-01 21:30:20 +0200 (Mon, 01 Oct 2012) | 1 line Grand Livre : surligné ligne paire ........ r5130 | danydb | 2012-10-01 22:03:42 +0200 (Mon, 01 Oct 2012) | 1 line CSS présentation, remplace fieldset ........ r5131 | danydb | 2012-10-01 22:04:03 +0200 (Mon, 01 Oct 2012) | 1 line Ne surligne pas les actions cloturées ........ r5132 | danydb | 2012-10-01 22:04:19 +0200 (Mon, 01 Oct 2012) | 1 line Les readonly sont en bleus ........ r5133 | danydb | 2012-10-01 22:16:55 +0200 (Mon, 01 Oct 2012) | 1 line Bug in the search button if id was not set ........ r5134 | danydb | 2012-10-02 18:49:40 +0200 (Tue, 02 Oct 2012) | 1 line underline properly ........ r5135 | danydb | 2012-10-02 18:58:09 +0200 (Tue, 02 Oct 2012) | 3 lines Fix several some bugs : * PRINTJRN column name for ledget ACH, simple without VAT * PRINTPOSTE show everything even when unlettered is choosen ........ r5136 | danydb | 2012-10-02 18:58:34 +0200 (Tue, 02 Oct 2012) | 1 line Improve documentation ........ r5137 | danydb | 2012-10-02 23:01:27 +0200 (Tue, 02 Oct 2012) | 1 line Fix problem with date suggest ........ r5138 | danydb | 2012-10-03 11:27:52 +0200 (Wed, 03 Oct 2012) | 1 line Bug auto compute for action ........ r5139 | danydb | 2012-10-16 00:58:52 +0200 (Tue, 16 Oct 2012) | 1 line Suggérer la date = oui ne met plus la date à jour dans les achats ........ r5140 | danydb | 2012-10-16 01:13:30 +0200 (Tue, 16 Oct 2012) | 1 line Suggérer la date = oui ne met plus la date à jour dans les achats ........ r5141 | danydb | 2012-10-16 01:14:01 +0200 (Tue, 16 Oct 2012) | 1 line Suggérer la date = oui ne met plus la date à jour dans les achats ........ r5142 | danydb | 2012-10-17 17:54:22 +0200 (Wed, 17 Oct 2012) | 1 line 0000749: poste alphanumérique (fournisseur 44xxx) ........ r5143 | danydb | 2012-10-20 19:13:04 +0200 (Sat, 20 Oct 2012) | 2 lines #754 Les totaux dans Prévisions #753 Les totaux dans FOURNISSEUR, CLIENT et ADMINISTRATION incorrectes ........ r5144 | danydb | 2012-10-30 20:41:29 +0100 (Tue, 30 Oct 2012) | 1 line #372 système de nouvelles ........ r5145 | danydb | 2012-10-30 20:42:45 +0100 (Tue, 30 Oct 2012) | 1 line add id to submit button ........ r5146 | danydb | 2012-10-30 20:43:04 +0100 (Tue, 30 Oct 2012) | 1 line add a label to ibutton ........ r5147 | danydb | 2012-10-30 20:43:43 +0100 (Tue, 30 Oct 2012) | 1 line add niceEdit.js ........ r5148 | danydb | 2012-10-30 20:44:20 +0100 (Tue, 30 Oct 2012) | 1 line get_folder_access must also test global admin ........ r5149 | danydb | 2012-10-30 22:14:26 +0100 (Tue, 30 Oct 2012) | 1 line 0000755: Erreur en création de fiche avec un compte (455) déjà utilisé. ........ r5150 | danydb | 2012-10-30 22:20:07 +0100 (Tue, 30 Oct 2012) | 2 lines 0000744: (classe) 5Actif 0000746: ajouter un espace là où il faut ........ r5151 | danydb | 2012-10-30 22:25:19 +0100 (Tue, 30 Oct 2012) | 1 line 0000743: le pointeur se trouve sur 'effacer' ........ r5152 | danydb | 2012-11-11 20:47:20 +0100 (Sun, 11 Nov 2012) | 1 line 0000756: Achat ou vente pour rembourser de la TVA, marchandise ou quant. = 0 ........ r5153 | danydb | 2012-11-11 20:51:40 +0100 (Sun, 11 Nov 2012) | 1 line 0000750: place de nouvelle fiche et effacer ........ r5154 | danydb | 2012-11-11 20:55:08 +0100 (Sun, 11 Nov 2012) | 1 line 0000742: remplacer le mot 'classe ' par le mot ' poste (comptable)' ........ r5155 | danydb | 2012-11-22 21:50:27 +0100 (Thu, 22 Nov 2012) | 1 line fix problem with french accounting ........ r5156 | danydb | 2012-11-29 23:17:33 +0100 (Thu, 29 Nov 2012) | 1 line #738: Attribut en pourcent doit être compris entre 0 et 100 au lieu de 0 et 1 ........ r5157 | danydb | 2012-12-05 21:08:07 +0100 (Wed, 05 Dec 2012) | 2 lines 0000766: Utilisation des moyens de paiements : libellé différent pour l'opération de paiement et d'achat/vente. 0000765: affichage des colonnes Prix HTVA quand la société n'est pas assujettie à la TVA ........ r5158 | danydb | 2012-12-06 21:42:51 +0100 (Thu, 06 Dec 2012) | 1 line 0000762: TVA intracommunautaire ........ r5159 | danydb | 2012-12-06 21:43:22 +0100 (Thu, 06 Dec 2012) | 1 line Bug : the history doesn't show the first_name for VEN ........ r5160 | danydb | 2012-12-06 21:51:09 +0100 (Thu, 06 Dec 2012) | 1 line 0000762: TVA intracommunautaire typo ........ r5161 | danydb | 2012-12-06 22:56:36 +0100 (Thu, 06 Dec 2012) | 1 line 0000762: TVA intracommunautaire : montant facture au lieu montant opération ........ r5162 | danydb | 2012-12-06 23:09:20 +0100 (Thu, 06 Dec 2012) | 1 line 0000745: en bas de page il apparaît un pop up ........ r5163 | danydb | 2012-12-08 19:10:52 +0100 (Sat, 08 Dec 2012) | 1 line patch version 104 ........ r5164 | danydb | 2012-12-08 20:48:57 +0100 (Sat, 08 Dec 2012) | 1 line patch version 104 ........ r5165 | danydb | 2012-12-08 21:12:14 +0100 (Sat, 08 Dec 2012) | 1 line cosmetique ........ r5166 | danydb | 2012-12-08 21:30:44 +0100 (Sat, 08 Dec 2012) | 1 line rewriting ........ r5167 | danydb | 2012-12-08 23:48:30 +0100 (Sat, 08 Dec 2012) | 1 line Ajout IMPJRN, détail opération ........ r5168 | danydb | 2012-12-14 19:35:46 +0100 (Fri, 14 Dec 2012) | 1 line add personal expense ........ r5169 | danydb | 2012-12-14 19:58:23 +0100 (Fri, 14 Dec 2012) | 1 line remove "choississez votre exercice" ........ r5170 | danydb | 2013-01-03 21:15:40 +0100 (Thu, 03 Jan 2013) | 1 line 0000773: Bug sur fiches avec double postes comptables ........ r5171 | danydb | 2013-01-19 00:28:52 +0100 (Sat, 19 Jan 2013) | 1 line 0000778: Si dossier n'existe pas alors il y a une erreur dans administration > dossier ........ r5172 | danydb | 2013-01-20 15:57:40 +0100 (Sun, 20 Jan 2013) | 1 line 0000778: Si dossier n'existe pas alors il y a une erreur dans administration > dossier ........ r5173 | danydb | 2013-01-23 22:38:28 +0100 (Wed, 23 Jan 2013) | 2 lines #780 & #776 forbids some character in the quickcode ........ r5174 | danydb | 2013-01-23 22:58:53 +0100 (Wed, 23 Jan 2013) | 1 line Improve format_name ........ r5175 | danydb | 2013-01-23 22:59:52 +0100 (Wed, 23 Jan 2013) | 1 line #778 skip the unexisting folder ........ r5176 | danydb | 2013-02-06 19:34:25 +0100 (Wed, 06 Feb 2013) | 1 line 0000783: Apparence dans HISTO des notes ........ r5177 | danydb | 2013-02-06 19:53:39 +0100 (Wed, 06 Feb 2013) | 1 line 0000783: Apparence dans HISTO des notes ........ r5178 | danydb | 2013-02-13 18:05:32 +0100 (Wed, 13 Feb 2013) | 1 line 0000788: Lettrage : date invalide, bloque ........ r5179 | danydb | 2013-02-13 18:15:46 +0100 (Wed, 13 Feb 2013) | 1 line 0000788: Lettrage : date invalide, bloque ........ r5180 | danydb | 2013-02-13 18:25:43 +0100 (Wed, 13 Feb 2013) | 1 line 0000787: Rapprochement bancaire ........ r5181 | danydb | 2013-02-13 19:13:10 +0100 (Wed, 13 Feb 2013) | 1 line Erreur si db inexistante alors echec ........ r5182 | danydb | 2013-02-28 14:04:44 +0100 (Thu, 28 Feb 2013) | 1 line small bugs in javascript : typo ........ r5183 | danydb | 2013-03-05 15:40:08 +0100 (Tue, 05 Mar 2013) | 2 lines 0000791: Afficher dans la vue Paramètres / Divers / TVA le code TVA ........ r5184 | danydb | 2013-03-13 16:23:22 +0100 (Wed, 13 Mar 2013) | 2 lines 0000795: Orthographe : dans le calendrier : tâche suivi ........ r5185 | danydb | 2013-03-13 16:30:37 +0100 (Wed, 13 Mar 2013) | 2 lines 0000796: Lettrage : en code Hexadécimal ou en base 36 (A à Z + 0 à 10) ........ r5186 | danydb | 2013-03-13 22:10:15 +0100 (Wed, 13 Mar 2013) | 2 lines 0000796: Lettrage : en code Hexadécimal ou en base 36 (A à Z + 0 à 10) ........ r5187 | danydb | 2013-03-14 00:04:53 +0100 (Thu, 14 Mar 2013) | 2 lines esthétique ........ r5188 | danydb | 2013-03-17 01:24:05 +0100 (Sun, 17 Mar 2013) | 3 lines 0000797: Amélioration du workflow : statut des documents / actions ........ r5189 | danydb | 2013-03-20 13:57:01 +0100 (Wed, 20 Mar 2013) | 1 line code cleaning : remove function Acc_Payment::row ........ r5190 | danydb | 2013-03-20 14:02:36 +0100 (Wed, 20 Mar 2013) | 1 line Code cleaning ........ r5191 | danydb | 2013-03-25 23:42:49 +0100 (Mon, 25 Mar 2013) | 1 line Documentation : doxygen tag misplaced due to netbeans ........ r5192 | danydb | 2013-03-27 19:54:37 +0100 (Wed, 27 Mar 2013) | 1 line cosmetic : width div for operation detail ........ r5193 | danydb | 2013-03-27 20:08:09 +0100 (Wed, 27 Mar 2013) | 1 line cosmetic : orthographe profile -> profil ........ r5194 | danydb | 2013-03-27 20:17:51 +0100 (Wed, 27 Mar 2013) | 1 line cosmetic : ajout bouton fermeture si détail non disponible ........ r5195 | danydb | 2013-03-27 20:20:33 +0100 (Wed, 27 Mar 2013) | 1 line 0000802: Bug : visibilité des actions ........ r5196 | danydb | 2013-03-27 20:22:53 +0100 (Wed, 27 Mar 2013) | 1 line 0000802: Bug : visibilité des actions ........ r5197 | danydb | 2013-03-27 23:25:34 +0100 (Wed, 27 Mar 2013) | 1 line 0000801: Ajouter un lien vers l'action ........ r5198 | danydb | 2013-03-27 23:26:17 +0100 (Wed, 27 Mar 2013) | 1 line typo profile -> profil ........ r5199 | danydb | 2013-03-28 00:12:02 +0100 (Thu, 28 Mar 2013) | 1 line javascript bug ........ r5200 | danydb | 2013-03-28 00:12:25 +0100 (Thu, 28 Mar 2013) | 1 line bug last_operation <> late_operation ........ r5201 | danydb | 2013-03-28 00:14:27 +0100 (Thu, 28 Mar 2013) | 1 line cosmetic ........ r5202 | danydb | 2013-03-28 18:05:08 +0100 (Thu, 28 Mar 2013) | 1 line Add patch upgrade105 ........ r5203 | danydb | 2013-03-28 18:13:22 +0100 (Thu, 28 Mar 2013) | 1 line 0000799: Pouvoir augmenter le nombre de lignes proposées pour un rapprochement ........ r5204 | danydb | 2013-03-28 18:54:15 +0100 (Thu, 28 Mar 2013) | 1 line voir les heures dans commentaire ........ r5205 | danydb | 2013-03-28 22:58:34 +0100 (Thu, 28 Mar 2013) | 1 line Cannot save a detail operation ........ r5206 | danydb | 2013-03-28 23:23:50 +0100 (Thu, 28 Mar 2013) | 1 line Cannot save financial ........ r5209 | danydb | 2013-04-04 20:53:49 +0200 (Thu, 04 Apr 2013) | 1 line 0000807: Legend n'est pas agrandi ........ r5210 | danydb | 2013-04-14 23:46:39 +0200 (Sun, 14 Apr 2013) | 1 line 0000819: Note de débit et de crédit négative avec TVA autoliquidation ........ r5211 | danydb | 2013-04-15 18:57:05 +0200 (Mon, 15 Apr 2013) | 1 line Impossible de sauver dans journaux financiers dans certains cas ........ r5212 | danydb | 2013-04-15 19:56:50 +0200 (Mon, 15 Apr 2013) | 1 line 0000819: Note de débit et de crédit négative avec TVA autoliquidation ........ r5213 | danydb | 2013-04-24 23:28:32 +0200 (Wed, 24 Apr 2013) | 1 line 0000824: Impossible de rechercher une action pour les actions liées ........ r5214 | danydb | 2013-05-02 22:54:28 +0200 (Thu, 02 May 2013) | 1 line improve doc ........ r5215 | danydb | 2013-05-03 23:56:40 +0200 (Fri, 03 May 2013) | 3 lines #0000822: Génération document : changer le type de cellule Attention problème si on a utiliser = devant le tag pour forcer le type numérique ........
This commit is contained in:
parent
7520787770
commit
31f5ddc9ca
161 changed files with 3804 additions and 1237 deletions
Binary file not shown.
|
|
@ -585,7 +585,8 @@ WARN_LOGFILE = doxygen-warn.log
|
|||
# with spaces.
|
||||
|
||||
INPUT = ../../include \
|
||||
../../html
|
||||
../../html
|
||||
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||
|
|
@ -660,7 +661,7 @@ EXCLUDE = ../../html/addon ../../include/tfpdf
|
|||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
||||
# from the input.
|
||||
|
||||
EXCLUDE_SYMLINKS = YES
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -461,11 +461,21 @@ $MaxDossier=$cn->size($Resdossier);
|
|||
//----------------------------------------------------------------------
|
||||
|
||||
for ($e=0;$e < $MaxDossier;$e++) {
|
||||
$db_row=$cn->fetch($e);
|
||||
$db_row=Database::fetch_array($Resdossier,$e);
|
||||
echo "<h3>Patching ".$db_row['dos_name'].'</h3>';
|
||||
$db=new Database($db_row['dos_id'],'dos');
|
||||
$db->apply_patch($db_row['dos_name']);
|
||||
Dossier::synchro_admin($db_row['dos_id']);
|
||||
|
||||
$name=$cn->format_name($db_row['dos_id'],'dos');
|
||||
|
||||
if ( $cn->exist_database($name)> 0 )
|
||||
{
|
||||
$db=new Database($db_row['dos_id'],'dos');
|
||||
$db->apply_patch($db_row['dos_name']);
|
||||
Dossier::synchro_admin($db_row['dos_id']);
|
||||
|
||||
} else
|
||||
{
|
||||
echo_warning(_("Dossier inexistant")." $name");
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
@ -476,10 +486,18 @@ $MaxDossier=$cn->size();
|
|||
echo "<h2>Mise à jour modèle</h2>";
|
||||
|
||||
for ($e=0;$e < $MaxDossier;$e++) {
|
||||
$db_row=$cn->fetch($e);
|
||||
$db_row=Database::fetch_array($Resdossier,$e);
|
||||
echo "<h3>Patching ".$db_row['mod_name']."</h3>";
|
||||
$db=new Database($db_row['mod_id'],'mod');
|
||||
$db->apply_patch($db_row['mod_name']);
|
||||
$name=$cn->format_name($db_row['mod_id'],'mod');
|
||||
|
||||
if ( $cn->exist_database($name)> 0 )
|
||||
{
|
||||
$db=new Database($db_row['mod_id'],'mod');
|
||||
$db->apply_patch($db_row['mod_name']);
|
||||
} else
|
||||
{
|
||||
echo_warning(_("Modèle inexistant")." $name");
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -578,10 +578,10 @@ INSERT INTO document_type (dt_id, dt_value) VALUES (22, 'Réception magazine');
|
|||
|
||||
|
||||
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (2, '400', 'Client', true, 9);
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (2, '410', 'Client', true, 9);
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (1, '604', 'Marchandises', true, 2);
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (3, '5500', 'Banque', true, 4);
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (4, '440', 'Fournisseur', true, 8);
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (3, '51', 'Banque', true, 4);
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (4, '400', 'Fournisseur', true, 8);
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (5, '61', 'S & B D', true, 3);
|
||||
INSERT INTO fiche_def (fd_id, fd_class_base, fd_label, fd_create_account, frd_id) VALUES (6, '700', 'Vente', true, 1);
|
||||
|
||||
|
|
|
|||
37
html/admin/sql/patch/upgrade103.sql
Normal file
37
html/admin/sql/patch/upgrade103.sql
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
begin;
|
||||
CREATE OR REPLACE FUNCTION comptaproc.format_account(p_account account_type)
|
||||
RETURNS account_type AS
|
||||
$BODY$
|
||||
|
||||
declare
|
||||
|
||||
sResult account_type;
|
||||
|
||||
begin
|
||||
sResult := lower(p_account);
|
||||
|
||||
sResult := translate(sResult,E'éèêëàâäïîüûùöôç','eeeeaaaiiuuuooc');
|
||||
sResult := translate(sResult,E' $€µ£%.+-/\\!(){}(),;_&|"#''^<>*','');
|
||||
|
||||
return upper(sResult);
|
||||
|
||||
end;
|
||||
$BODY$
|
||||
LANGUAGE plpgsql ;
|
||||
|
||||
COMMENT ON FUNCTION comptaproc.format_account(account_type) IS 'format the accounting :
|
||||
- upper case
|
||||
- remove space and special char.
|
||||
';
|
||||
|
||||
update tmp_pcmn set pcm_val_parent = '62' where pcm_val='6202';
|
||||
|
||||
update fiche_detail set ad_value = (to_number(ad_value,'9.99')*100)::text where ad_id in (21,22,20,31) and ad_value is not null and ad_value <> '';
|
||||
|
||||
update menu_ref set me_code='ACHISTO' WHERE me_code='ACHIMP';
|
||||
update menu_ref set me_code='VEHISTO' WHERE me_code='VENIMP';
|
||||
update menu_ref set me_code='FIHISTO' WHERE me_code='FIMP';
|
||||
update menu_ref set me_code='ODHISTO' WHERE me_code='ODSIMP';
|
||||
update version set val=104;
|
||||
|
||||
commit;
|
||||
105
html/admin/sql/patch/upgrade104.sql
Normal file
105
html/admin/sql/patch/upgrade104.sql
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
begin;
|
||||
CREATE OR REPLACE FUNCTION comptaproc.insert_quick_code(nf_id integer, tav_text text)
|
||||
RETURNS integer AS
|
||||
$BODY$
|
||||
declare
|
||||
ns integer;
|
||||
nExist integer;
|
||||
tText text;
|
||||
begin
|
||||
tText := lower(trim(tav_text));
|
||||
tText := replace(tText,' ','');
|
||||
tText := translate(tText,E' $€µ£%.+-/\\!(){}(),;_&|"#''^<>*','');
|
||||
tText := translate(tText,E'éèêëàâäïîüûùöôç','eeeeaaaiiuuuooc');
|
||||
|
||||
|
||||
loop
|
||||
-- take the next sequence
|
||||
select nextval('s_jnt_fic_att_value') into ns;
|
||||
if length (tText) = 0 or tText is null then
|
||||
tText := 'FID'||ns;
|
||||
end if;
|
||||
-- av_text already used ?
|
||||
select count(*) into nExist
|
||||
from fiche_detail
|
||||
where
|
||||
ad_id=23 and ad_value=upper(tText);
|
||||
|
||||
if nExist = 0 then
|
||||
exit;
|
||||
end if;
|
||||
tText:='FID'||ns;
|
||||
end loop;
|
||||
|
||||
|
||||
insert into fiche_detail(jft_id,f_id,ad_id,ad_value) values (ns,nf_id,23,upper(tText));
|
||||
return ns;
|
||||
end;
|
||||
$BODY$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
|
||||
|
||||
CREATE OR REPLACE FUNCTION comptaproc.update_quick_code(njft_id integer, tav_text text)
|
||||
RETURNS integer AS
|
||||
$BODY$
|
||||
declare
|
||||
ns integer;
|
||||
nExist integer;
|
||||
tText text;
|
||||
old_qcode varchar;
|
||||
begin
|
||||
-- get current value
|
||||
select ad_value into old_qcode from fiche_detail where jft_id=njft_id;
|
||||
-- av_text didn't change so no update
|
||||
if tav_text = upper( trim(old_qcode)) then
|
||||
return 0;
|
||||
end if;
|
||||
|
||||
tText := trim(lower(tav_text));
|
||||
tText := replace(tText,' ','');
|
||||
tText := translate(tText,E' $€µ£%.+-/\\!(){}(),;_&|"#''^<>*','');
|
||||
tText := translate(tText,E'éèêëàâäïîüûùöôç','eeeeaaaiiuuuooc');
|
||||
tText := upper(tText);
|
||||
if length ( tText) = 0 or tText is null then
|
||||
return 0;
|
||||
end if;
|
||||
|
||||
ns := njft_id;
|
||||
|
||||
loop
|
||||
-- av_text already used ?
|
||||
select count(*) into nExist
|
||||
from fiche_detail
|
||||
where
|
||||
ad_id=23 and ad_value=tText;
|
||||
|
||||
if nExist = 0 then
|
||||
exit;
|
||||
end if;
|
||||
if tText = 'FID'||ns then
|
||||
-- take the next sequence
|
||||
select nextval('s_jnt_fic_att_value') into ns;
|
||||
end if;
|
||||
tText :='FID'||ns;
|
||||
|
||||
end loop;
|
||||
update fiche_detail set ad_value = tText where jft_id=njft_id;
|
||||
|
||||
-- update also the contact
|
||||
update fiche_detail set ad_value = tText
|
||||
where jft_id in
|
||||
( select jft_id
|
||||
from fiche_detail
|
||||
where ad_id=25 and ad_value=old_qcode);
|
||||
|
||||
|
||||
update jrnx set j_qcode=tText where j_qcode = old_qcode;
|
||||
return ns;
|
||||
end;
|
||||
$BODY$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
update version set val=105;
|
||||
|
||||
commit;
|
||||
109
html/admin/sql/patch/upgrade105.sql
Normal file
109
html/admin/sql/patch/upgrade105.sql
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
begin;
|
||||
|
||||
CREATE OR REPLACE FUNCTION comptaproc.insert_quick_code(nf_id integer, tav_text text)
|
||||
RETURNS integer AS
|
||||
$BODY$
|
||||
declare
|
||||
ns integer;
|
||||
nExist integer;
|
||||
tText text;
|
||||
begin
|
||||
tText := lower(trim(tav_text));
|
||||
tText := replace(tText,' ','');
|
||||
tText := translate(tText,E' $€µ£%.+-/\\!(){}(),;_&|"#''^<>*','');
|
||||
tText := translate(tText,E'éèêëàâäïîüûùöôç','eeeeaaaiiuuuooc');
|
||||
|
||||
|
||||
loop
|
||||
-- take the next sequence
|
||||
select nextval('s_jnt_fic_att_value') into ns;
|
||||
if length (tText) = 0 or tText is null then
|
||||
tText := 'FID'||ns;
|
||||
end if;
|
||||
-- av_text already used ?
|
||||
select count(*) into nExist
|
||||
from fiche_detail
|
||||
where
|
||||
ad_id=23 and ad_value=upper(tText);
|
||||
|
||||
if nExist = 0 then
|
||||
exit;
|
||||
end if;
|
||||
tText:='FID'||ns;
|
||||
end loop;
|
||||
|
||||
|
||||
insert into fiche_detail(jft_id,f_id,ad_id,ad_value) values (ns,nf_id,23,upper(tText));
|
||||
return ns;
|
||||
end;
|
||||
$BODY$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION comptaproc.update_quick_code(njft_id integer, tav_text text)
|
||||
RETURNS integer AS
|
||||
$BODY$
|
||||
declare
|
||||
ns integer;
|
||||
nExist integer;
|
||||
tText text;
|
||||
old_qcode varchar;
|
||||
begin
|
||||
-- get current value
|
||||
select ad_value into old_qcode from fiche_detail where jft_id=njft_id;
|
||||
-- av_text didn't change so no update
|
||||
if tav_text = upper( trim(old_qcode)) then
|
||||
return 0;
|
||||
end if;
|
||||
|
||||
tText := trim(lower(tav_text));
|
||||
tText := replace(tText,' ','');
|
||||
tText := translate(tText,E' $€µ£%.+-/\\!(){}(),;_&|"#''^<>*','');
|
||||
tText := translate(tText,E'éèêëàâäïîüûùöôç','eeeeaaaiiuuuooc');
|
||||
tText := upper(tText);
|
||||
if length ( tText) = 0 or tText is null then
|
||||
return 0;
|
||||
end if;
|
||||
|
||||
ns := njft_id;
|
||||
|
||||
loop
|
||||
-- av_text already used ?
|
||||
select count(*) into nExist
|
||||
from fiche_detail
|
||||
where
|
||||
ad_id=23 and ad_value=tText;
|
||||
|
||||
if nExist = 0 then
|
||||
exit;
|
||||
end if;
|
||||
if tText = 'FID'||ns then
|
||||
-- take the next sequence
|
||||
select nextval('s_jnt_fic_att_value') into ns;
|
||||
end if;
|
||||
tText :='FID'||ns;
|
||||
|
||||
end loop;
|
||||
update fiche_detail set ad_value = tText where jft_id=njft_id;
|
||||
|
||||
-- update also the contact
|
||||
update fiche_detail set ad_value = tText
|
||||
where jft_id in
|
||||
( select jft_id
|
||||
from fiche_detail
|
||||
where ad_id=25 and ad_value=old_qcode);
|
||||
|
||||
|
||||
update jrnx set j_qcode=tText where j_qcode = old_qcode;
|
||||
return ns;
|
||||
end;
|
||||
$BODY$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
|
||||
alter table document_state add s_status char(1);
|
||||
|
||||
update document_state set s_status='C' where s_id in (1,4);
|
||||
|
||||
update version set val=106;
|
||||
|
||||
commit;
|
||||
|
|
@ -116,7 +116,7 @@ case 'rmfa':
|
|||
echo $e->getMessage();
|
||||
}
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
break;
|
||||
/* ------------------------------------------------------------ */
|
||||
/* Display card detail */
|
||||
|
|
@ -327,9 +327,11 @@ case 'fs':
|
|||
$r.='<form method="GET" onsubmit="this.ctl=\'ipop_card\';search_get_card(this);return false;">';
|
||||
$q=new IText('query');
|
||||
$q->value=(isset($query))?$query:'';
|
||||
$r.=_('Fiche contenant');
|
||||
$r.='<span style="margin-left:50px">';
|
||||
$r.=_('Fiche contenant').HtmlInput::infobulle(19);
|
||||
$r.=$q->input();
|
||||
$r.=HtmlInput::submit('fs',_('Recherche'));
|
||||
$r.='</span>';
|
||||
$r.=dossier::hidden().HtmlInput::hidden('op','fs');
|
||||
$array=array();
|
||||
foreach (array('query','inp','jrn','label','typecard','price','tvaid') as $i)
|
||||
|
|
@ -393,7 +395,7 @@ case 'fs':
|
|||
ob_start();
|
||||
require_once('template/card_result.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
$ctl=$ctl.'_content';
|
||||
$html=$r;
|
||||
break;
|
||||
|
|
@ -442,7 +444,7 @@ case 'ac':
|
|||
ob_start();
|
||||
require('template/category_of_card.php');
|
||||
$html.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
}
|
||||
else
|
||||
|
|
@ -511,7 +513,7 @@ case 'upc':
|
|||
ob_start();
|
||||
$f->update($_GET);
|
||||
$html.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
$html.=$f->Display(true);
|
||||
$html.=HtmlInput::button('close_'.$ctl,'Fermer',"onclick=\"removeDiv('$ctl')\"");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ if ( isset($_GET['f_id']))
|
|||
echo $old;
|
||||
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -185,7 +185,7 @@ if ( isset($_REQUEST['pcm_val']))
|
|||
echo $old;
|
||||
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
$html=escape_xml($html);
|
||||
|
|
|
|||
|
|
@ -71,8 +71,9 @@ if ( $g_user->check_dossier(dossier::id(),true)=='X' )
|
|||
{
|
||||
ob_start();
|
||||
require_once ('template/ledger_detail_forbidden.php');
|
||||
echo HtmlInput::button_close($div);
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
$html=escape_xml($html);
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
echo <<<EOF
|
||||
|
|
@ -97,8 +98,9 @@ if ($ledger=="")
|
|||
ob_start();
|
||||
echo HtmlInput::title_box(_("Information"), $div);
|
||||
require_once ('template/ledger_detail_forbidden.php');
|
||||
echo HtmlInput::button_close($div);
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
$html=escape_xml($html);
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
|
|
@ -118,9 +120,9 @@ if ( $access == 'X' )
|
|||
ob_start();
|
||||
echo HtmlInput::title_box(_("Information"), $div);
|
||||
require_once ('template/ledger_detail_forbidden.php');
|
||||
echo HtmlInput::button_close($div);
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
|
||||
ob_end_clean();
|
||||
$html=escape_xml($html);
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
echo <<<EOF
|
||||
|
|
@ -158,7 +160,7 @@ case 'rmop':
|
|||
$cn->rollback;
|
||||
}
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
}
|
||||
break;
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -197,7 +199,7 @@ case 'de':
|
|||
echo '<h2 class="error">Désolé il y a une erreur</h2>';
|
||||
}
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
break;
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -221,7 +223,7 @@ case 'file':
|
|||
echo "<div>";
|
||||
|
||||
}
|
||||
echo "<h2>Document</h2>";
|
||||
echo "<h1 class=\"legend\">Document</h1>";
|
||||
if ( $access=='W')
|
||||
{
|
||||
echo '<FORM METHOD="POST" ENCTYPE="multipart/form-data" id="form_file">';
|
||||
|
|
@ -278,7 +280,7 @@ case 'file':
|
|||
echo "<div>";
|
||||
|
||||
}
|
||||
echo "<h2>Document</h2>";
|
||||
echo "<h1 class=\"legend\">Document</h1>";
|
||||
echo '<div class="op_detail_frame">';
|
||||
$x='';
|
||||
if ($access=='W')
|
||||
|
|
@ -477,7 +479,7 @@ case 'save':
|
|||
alert( "Changement impossible: on ne peut pas changer la date dans une période fermée");
|
||||
}
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
break;
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -525,7 +527,7 @@ case 'reverseop':
|
|||
}
|
||||
}
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
break;
|
||||
}
|
||||
$html=escape_xml($html);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
* \brief this file respond to an ajax request
|
||||
* The parameters are
|
||||
* - gDossier
|
||||
|
|
@ -323,14 +323,33 @@ EOF;
|
|||
$line.=td($max->input());
|
||||
$r.=tr($line);
|
||||
|
||||
$date_error="";
|
||||
// start date
|
||||
$start = new IDate('search_start');
|
||||
$start->value = (isset($search_start)) ? $search_start : $first_per->first_day();
|
||||
|
||||
/* check if date are valid */
|
||||
if (isset($search_start) && isDate($search_start) == null)
|
||||
{
|
||||
ob_start();
|
||||
alert(_('Date malformée'));
|
||||
$date_error = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$search_start=$first_per->first_day();
|
||||
}
|
||||
$start->value = (isset($search_start)) ? $search_start : $first_per->first_day();
|
||||
|
||||
$line = td('Date Debut') . td($start->input());
|
||||
// end date
|
||||
$end = new IDate('search_end');
|
||||
/* check if date are valid */
|
||||
if (isset($search_end) && isDate($search_end) == null)
|
||||
{
|
||||
ob_start();
|
||||
alert(_('Date malformée'));
|
||||
$date_error = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$search_end=$last_per->last_day();
|
||||
}
|
||||
$end->value = (isset($search_end)) ? $search_end : $last_per->last_day();
|
||||
$line.=td('Date Fin') . td($end->input());
|
||||
$r.=tr($line);
|
||||
|
|
@ -396,27 +415,7 @@ EOF;
|
|||
$form.=HtmlInput::hidden('sb', $_REQUEST['sb']);
|
||||
if (isset($_REQUEST['f_id']))
|
||||
$form.=HtmlInput::hidden('f_id', $_REQUEST['f_id']);
|
||||
/* check if date are valid */
|
||||
if ((isset($search_end) && isDate($search_end) == null) ||
|
||||
(isset($search_start) && isDate($search_start) == null))
|
||||
{
|
||||
ob_start();
|
||||
alert(_('Date malformée, désolé'));
|
||||
$html = ob_get_contents();
|
||||
ob_clean();
|
||||
|
||||
$html = escape_xml($html);
|
||||
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
echo <<<EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<data>
|
||||
<code>detail</code>
|
||||
<value>$html</value>
|
||||
</data>
|
||||
EOF;
|
||||
exit();
|
||||
}
|
||||
|
||||
// display a list of operation from the other side + box button
|
||||
if ($ot == 'account')
|
||||
|
|
@ -458,7 +457,9 @@ EOF;
|
|||
$form.=HtmlInput::submit('record', _('Sauver')) . $ret->input();
|
||||
$form.='</FORM>';
|
||||
$form.='</div>';
|
||||
|
||||
$html = $r . $form;
|
||||
$html.=$date_error;
|
||||
// echo $html;exit;
|
||||
$html = escape_xml($html);
|
||||
|
||||
|
|
@ -501,6 +502,9 @@ EOF;
|
|||
case 'add_menu':
|
||||
require_once 'ajax_add_menu.php';
|
||||
break;
|
||||
case 'cardsearch':
|
||||
require_once 'ajax_boxcard_search.php';
|
||||
break;
|
||||
case 'add_plugin':
|
||||
$me_code = new IText('me_code');
|
||||
$me_file = new IText('me_file');
|
||||
|
|
@ -561,6 +565,9 @@ EOF;
|
|||
case 'fddetail':
|
||||
require_once 'ajax_fiche_def_detail.php';
|
||||
break;
|
||||
case 'vw_action':
|
||||
require_once 'ajax_view_action.php';
|
||||
break;
|
||||
default:
|
||||
var_dump($_GET);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ include_once ("class_user.php");
|
|||
global $g_user;
|
||||
$g_user=new User($cn);
|
||||
$g_user->Check();
|
||||
if ($g_user->get_folder_access(dossier::id()) == 'X') exit();
|
||||
if ($g_user->check_dossier(dossier::id()) == 'X') exit();
|
||||
$xml="";
|
||||
|
||||
switch ($op)
|
||||
|
|
@ -88,7 +88,7 @@ case "sf":
|
|||
ob_start();
|
||||
require_once('template/account_search.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
$r.=dossier::hidden();
|
||||
$r.=(isset ($c))?HtmlInput::hidden('account',$c):"";
|
||||
$r.=(isset ($l))?HtmlInput::hidden('label',$l):"";
|
||||
|
|
@ -163,7 +163,7 @@ case "sf":
|
|||
|
||||
require_once('template/account_result.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
$html=$r;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
* \brief Main file
|
||||
*/
|
||||
require_once 'class_database.php';
|
||||
|
|
|
|||
|
|
@ -1,147 +1,147 @@
|
|||
# Les postesg*(-1)
|
||||
$C10=round([10%S],2)*(-1)
|
||||
$C100=round([100%S],2)*(-1)
|
||||
$C101=round([101%S],2)
|
||||
$C11=round([11%S],2)*(-1)
|
||||
$C12=round([12%S],2)*(-1)
|
||||
$C13=round([13%S],2)*(-1)
|
||||
$C130=round([130%S],2)*(-1)
|
||||
$C131=round([131%S],2)*(-1)
|
||||
$C1310=round([1310%S],2)*(-1)
|
||||
$C1311=round([1311%S],2)*(-1)
|
||||
$C132=round([132%S],2)*(-1)
|
||||
$C133=round([133%S],2)*(-1)
|
||||
$C14=round([14%S],2)*(-1)
|
||||
$C140=round([140%S],2)*(-1)
|
||||
$C141=round([141%S],2)
|
||||
$C15=round([15%S],2)*(-1)
|
||||
$C16=round([16%S],2)*(-1)
|
||||
$C160=round([160%S],2)*(-1)
|
||||
$C161=round([161%S],2)*(-1)
|
||||
$C162=round([162%S],2)*(-1)
|
||||
$C163=round([163%S],2)*(-1)
|
||||
$C164=round([164%S],2)*(-1)
|
||||
$C165=round([165%S],2)*(-1)
|
||||
$C168=round([168%S],2)*(-1)
|
||||
$C17=round([17%S],2)*(-1)
|
||||
$C170=round([170%S],2)*(-1)
|
||||
$C171=round([171%S],2)*(-1)
|
||||
$C172=round([172%S],2)*(-1)
|
||||
$C173=round([173%S],2)*(-1)
|
||||
$C174=round([174%S],2)*(-1)
|
||||
$C175=round([175%S],2)*(-1)
|
||||
$C176=round([176%S],2)*(-1)
|
||||
$C178=round([178%S],2)*(-1)
|
||||
$C179=round([179%S],2)*(-1)
|
||||
$C2=round([2%S],2)*(-1)
|
||||
$C20=round([20%S],2)
|
||||
$C21=round([21%S],2)
|
||||
$C22=round([22%S],2)
|
||||
$C23=round([23%S],2)
|
||||
$C24=round([24%S],2)
|
||||
$C25=round([25%S],2)
|
||||
$C26=round([26%S],2)
|
||||
$C27=round([27%S],2)
|
||||
$C28=round([28%S],2)
|
||||
$C29=round([29%S],2)
|
||||
$C290=round([290%S],2)
|
||||
$C291=round([291%S],2)
|
||||
$C3=round([3%S],2)
|
||||
$C30=round([30%S],2)
|
||||
$C31=round([31%S],2)
|
||||
$C32=round([32%S],2)
|
||||
$C33=round([33%S],2)
|
||||
$C34=round([34%S],2)
|
||||
$C35=round([35%S],2)
|
||||
$C36=round([36%S],2)
|
||||
$C37=round([37%S],2)
|
||||
$C40=round([40%S],2)
|
||||
$C41=round([41%S],2)
|
||||
$C42=round([42%S],2)*(-1)
|
||||
$C43=round([43%S],2)*(-1)
|
||||
$C439=round([439%S],2)*(-1)
|
||||
$C44=round([44%S],2)*(-1)
|
||||
$C440=round([440%S],2)*(-1)
|
||||
$C441=round([441%S],2)*(-1)
|
||||
$C444=round([444%S],2)*(-1)
|
||||
$C45=round([45%S],2)*(-1)
|
||||
$C450=round([450%S],2)*(-1)
|
||||
$C451=round([451%S],2)*(-1)
|
||||
$C452=round([452%S],2)*(-1)
|
||||
$C453=round([453%S],2)*(-1)
|
||||
$C454=round([454%S],2)*(-1)
|
||||
$C455=round([455%S],2)*(-1)
|
||||
$C456=round([456%S],2)*(-1)
|
||||
$C457=round([457%S],2)*(-1)
|
||||
$C458=round([458%S],2)*(-1)
|
||||
$C459=round([459%S],2)*(-1)
|
||||
$C46=round([46%S],2)
|
||||
$C47=round([47%S],2)*(-1)
|
||||
$C48=round([48%S],2)*(-1)
|
||||
$C49=round([49%S],2)
|
||||
$C490=round([490%S],2)
|
||||
$C491=round([491%S],2)
|
||||
$C492=round([492%S],2)*(-1)
|
||||
$C493=round([493%S],2)*(-1)
|
||||
$C50=round([50%S],2)
|
||||
$C51=round([51%S],2)
|
||||
$C52=round([52%S],2)
|
||||
$C53=round([53%S],2)
|
||||
$C54=round([54%S],2)
|
||||
$C55=round([55%S],2)
|
||||
$C56=round([56%S],2)
|
||||
$C57=round([57%S],2)
|
||||
$C58=round([58%S],2)
|
||||
$C60=round([60%S],2)
|
||||
$C61=round([61%S],2)
|
||||
$C62=round([62%S],2)
|
||||
$C63=round([63%S],2)
|
||||
$C630=round([630%S],2)
|
||||
$C631=round([631%S],2)
|
||||
$C632=round([632%S],2)
|
||||
$C633=round([633%S],2)
|
||||
$C634=round([634%S],2)
|
||||
$C635=round([635%S],2)
|
||||
$C636=round([636%S],2)
|
||||
$C637=round([637%S],2)
|
||||
$C10=round([10%s],2)*(-1)
|
||||
$C100=round([100%s],2)*(-1)
|
||||
$C101=round([101%s],2)
|
||||
$C11=round([11%s],2)*(-1)
|
||||
$C12=round([12%s],2)*(-1)
|
||||
$C13=round([13%s],2)*(-1)
|
||||
$C130=round([130%s],2)*(-1)
|
||||
$C131=round([131%s],2)*(-1)
|
||||
$C1310=round([1310%s],2)*(-1)
|
||||
$C1311=round([1311%s],2)*(-1)
|
||||
$C132=round([132%s],2)*(-1)
|
||||
$C133=round([133%s],2)*(-1)
|
||||
$C14=round([14%s],2)*(-1)
|
||||
$C140=round([140%s],2)*(-1)
|
||||
$C141=round([141%s],2)
|
||||
$C15=round([15%s],2)*(-1)
|
||||
$C16=round([16%s],2)*(-1)
|
||||
$C160=round([160%s],2)*(-1)
|
||||
$C161=round([161%s],2)*(-1)
|
||||
$C162=round([162%s],2)*(-1)
|
||||
$C163=round([163%s],2)*(-1)
|
||||
$C164=round([164%s],2)*(-1)
|
||||
$C165=round([165%s],2)*(-1)
|
||||
$C168=round([168%s],2)*(-1)
|
||||
$C17=round([17%s],2)*(-1)
|
||||
$C170=round([170%s],2)*(-1)
|
||||
$C171=round([171%s],2)*(-1)
|
||||
$C172=round([172%s],2)*(-1)
|
||||
$C173=round([173%s],2)*(-1)
|
||||
$C174=round([174%s],2)*(-1)
|
||||
$C175=round([175%s],2)*(-1)
|
||||
$C176=round([176%s],2)*(-1)
|
||||
$C178=round([178%s],2)*(-1)
|
||||
$C179=round([179%s],2)*(-1)
|
||||
$C2=round([2%s],2)*(-1)
|
||||
$C20=round([20%s],2)
|
||||
$C21=round([21%s],2)
|
||||
$C22=round([22%s],2)
|
||||
$C23=round([23%s],2)
|
||||
$C24=round([24%s],2)
|
||||
$C25=round([25%s],2)
|
||||
$C26=round([26%s],2)
|
||||
$C27=round([27%s],2)
|
||||
$C28=round([28%s],2)
|
||||
$C29=round([29%s],2)
|
||||
$C290=round([290%s],2)
|
||||
$C291=round([291%s],2)
|
||||
$C3=round([3%s],2)
|
||||
$C30=round([30%s],2)
|
||||
$C31=round([31%s],2)
|
||||
$C32=round([32%s],2)
|
||||
$C33=round([33%s],2)
|
||||
$C34=round([34%s],2)
|
||||
$C35=round([35%s],2)
|
||||
$C36=round([36%s],2)
|
||||
$C37=round([37%s],2)
|
||||
$C40=round([40%s],2)
|
||||
$C41=round([41%s],2)
|
||||
$C42=round([42%s],2)*(-1)
|
||||
$C43=round([43%s],2)*(-1)
|
||||
$C439=round([439%s],2)*(-1)
|
||||
$C44=round([44%s],2)*(-1)
|
||||
$C440=round([440%s],2)*(-1)
|
||||
$C441=round([441%s],2)*(-1)
|
||||
$C444=round([444%s],2)*(-1)
|
||||
$C45=round([45%s],2)*(-1)
|
||||
$C450=round([450%s],2)*(-1)
|
||||
$C451=round([451%s],2)*(-1)
|
||||
$C452=round([452%s],2)*(-1)
|
||||
$C453=round([453%s],2)*(-1)
|
||||
$C454=round([454%s],2)*(-1)
|
||||
$C455=round([455%s],2)*(-1)
|
||||
$C456=round([456%s],2)*(-1)
|
||||
$C457=round([457%s],2)*(-1)
|
||||
$C458=round([458%s],2)*(-1)
|
||||
$C459=round([459%s],2)*(-1)
|
||||
$C46=round([46%s],2)
|
||||
$C47=round([47%s],2)*(-1)
|
||||
$C48=round([48%s],2)*(-1)
|
||||
$C49=round([49%s],2)
|
||||
$C490=round([490%s],2)
|
||||
$C491=round([491%s],2)
|
||||
$C492=round([492%s],2)*(-1)
|
||||
$C493=round([493%s],2)*(-1)
|
||||
$C50=round([50%s],2)
|
||||
$C51=round([51%s],2)
|
||||
$C52=round([52%s],2)
|
||||
$C53=round([53%s],2)
|
||||
$C54=round([54%s],2)
|
||||
$C55=round([55%s],2)
|
||||
$C56=round([56%s],2)
|
||||
$C57=round([57%s],2)
|
||||
$C58=round([58%s],2)
|
||||
$C60=round([60%s],2)
|
||||
$C61=round([61%s],2)
|
||||
$C62=round([62%s],2)
|
||||
$C63=round([63%s],2)
|
||||
$C630=round([630%s],2)
|
||||
$C631=round([631%s],2)
|
||||
$C632=round([632%s],2)
|
||||
$C633=round([633%s],2)
|
||||
$C634=round([634%s],2)
|
||||
$C635=round([635%s],2)
|
||||
$C636=round([636%s],2)
|
||||
$C637=round([637%s],2)
|
||||
|
||||
$C649=round([649%S],2)*(-1)
|
||||
$C64=round([64%S],2)
|
||||
$C649=round([649%s],2)*(-1)
|
||||
$C64=round([64%s],2)
|
||||
|
||||
$C65=round([65%S],2)
|
||||
$C66=round([66%S],2)
|
||||
$C67=round([67%S],2)
|
||||
$C68=round([68%S],2)
|
||||
$C680=round([680%S],2)
|
||||
$C689=round([689%S],2)
|
||||
$C69=round([69%S],2)
|
||||
$C690=round([690%S],2)
|
||||
$C691=round([691%S],2)
|
||||
$C692=round([692%S],2)
|
||||
$C6920=round([6920%S],2)
|
||||
$C6921=round([6921%S],2)
|
||||
$C693=round([693%S],2)
|
||||
$C694=round([694%S],2)
|
||||
$C695=round([695%S],2)
|
||||
$C696=round([696%S],2)
|
||||
$C65=round([65%s],2)
|
||||
$C66=round([66%s],2)
|
||||
$C67=round([67%s],2)
|
||||
$C68=round([68%s],2)
|
||||
$C680=round([680%s],2)
|
||||
$C689=round([689%s],2)
|
||||
$C69=round([69%s],2)
|
||||
$C690=round([690%s],2)
|
||||
$C691=round([691%s],2)
|
||||
$C692=round([692%s],2)
|
||||
$C6920=round([6920%s],2)
|
||||
$C6921=round([6921%s],2)
|
||||
$C693=round([693%s],2)
|
||||
$C694=round([694%s],2)
|
||||
$C695=round([695%s],2)
|
||||
$C696=round([696%s],2)
|
||||
|
||||
$C7=round([7%S],2)*(-1)
|
||||
$C70=round([70%S],2)*(-1)
|
||||
$C71=round([71%S],2)*(-1)
|
||||
$C73=round([73%S],2)*(-1)
|
||||
$C72=round([72%S],2)*(-1)
|
||||
$C74=round([74%S],2)*(-1)
|
||||
$C75=round([75%S],2)*(-1)
|
||||
$C76=round([76%S],2)*(-1)
|
||||
$C77=round([77%S],2)*(-1)
|
||||
$C780=round([780%S],2)*(-1)
|
||||
$C789=round([789%S],2)*(-1)
|
||||
$C79=round([79%S],2)*(-1)
|
||||
$C790=round([790%S],2)*(-1)
|
||||
$C791=round([791%S],2)*(-1)
|
||||
$C792=round([792%S],2)*(-1)
|
||||
$C793=round([793%S],2)*(-1)
|
||||
$C794=round([794%S],2)*(-1)
|
||||
$C7=round([7%s],2)*(-1)
|
||||
$C70=round([70%s],2)*(-1)
|
||||
$C71=round([71%s],2)*(-1)
|
||||
$C73=round([73%s],2)*(-1)
|
||||
$C72=round([72%s],2)*(-1)
|
||||
$C74=round([74%s],2)*(-1)
|
||||
$C75=round([75%s],2)*(-1)
|
||||
$C76=round([76%s],2)*(-1)
|
||||
$C77=round([77%s],2)*(-1)
|
||||
$C780=round([780%s],2)*(-1)
|
||||
$C789=round([789%s],2)*(-1)
|
||||
$C79=round([79%s],2)*(-1)
|
||||
$C790=round([790%s],2)*(-1)
|
||||
$C791=round([791%s],2)*(-1)
|
||||
$C792=round([792%s],2)*(-1)
|
||||
$C793=round([793%s],2)*(-1)
|
||||
$C794=round([794%s],2)*(-1)
|
||||
# Les formules (*-1)
|
||||
#
|
||||
$S1=abs($C2-$C29)
|
||||
|
|
|
|||
|
|
@ -324,6 +324,7 @@ function compute_ledger(p_ctl_nb)
|
|||
a=trim(g("e_march"+p_ctl_nb+'_tva_amount').value);
|
||||
g("e_march"+p_ctl_nb+'_tva_amount').value=a;
|
||||
}
|
||||
if ( ! document.getElementById("e_march"+p_ctl_nb)) {return;}
|
||||
g("e_march"+p_ctl_nb).value=trim(g("e_march"+p_ctl_nb).value);
|
||||
var qcode=g("e_march"+p_ctl_nb).value;
|
||||
|
||||
|
|
@ -375,12 +376,12 @@ function refresh_ledger()
|
|||
for (var i=0;i<g("nb_item").value;i++)
|
||||
{
|
||||
if( g('tva_march'+i)) tva+=g('tva_march'+i).value*1;
|
||||
htva+=g('htva_march'+i).value*1;
|
||||
tvac+=g('tvac_march'+i).value*1;
|
||||
if (g('htva_march'+i)) htva+=g('htva_march'+i).value*1;
|
||||
if (g('tvac_march'+i)) tvac+=g('tvac_march'+i).value*1;
|
||||
}
|
||||
|
||||
if ( g('tva') ) g('tva').innerHTML=Math.round(tva*100)/100;
|
||||
g('htva').innerHTML=Math.round(htva*100)/100;
|
||||
if (g('htva')) g('htva').innerHTML=Math.round(htva*100)/100;
|
||||
if (g('tvac')) g('tvac').innerHTML=Math.round(tvac*100)/100;
|
||||
}
|
||||
/**
|
||||
|
|
@ -449,12 +450,12 @@ function compute_all_ledger()
|
|||
for (var i=0;i<g("nb_item").value;i++)
|
||||
{
|
||||
if ( g('tva_march') ) tva+=g('tva_march'+i).value*1;
|
||||
htva+=g('htva_march'+i).value*1;
|
||||
tvac+=g('tvac_march'+i).value*1;
|
||||
if( g('htva_march'+i)) htva+=g('htva_march'+i).value*1;
|
||||
if( g('tvac_march'+i))tvac+=g('tvac_march'+i).value*1;
|
||||
}
|
||||
|
||||
if ( g('tva') ) g('tva').innerHTML=Math.round(tva*100)/100;
|
||||
g('htva').innerHTML=Math.round(htva*100)/100;
|
||||
if (g('htva')) g('htva').innerHTML=Math.round(htva*100)/100;
|
||||
if (g('tvac'))g('tvac').innerHTML=Math.round(tvac*100)/100;
|
||||
|
||||
|
||||
|
|
@ -564,17 +565,22 @@ function view_history_account(p_value,dossier)
|
|||
|
||||
querystring='gDossier='+dossier+'&act=de&pcm_val='+p_value+'&div='+id;
|
||||
add_div(popup);
|
||||
|
||||
var action=new Ajax.Request(
|
||||
"ajax_history.php",
|
||||
{
|
||||
method:'get',
|
||||
parameters:querystring,
|
||||
onFailure:error_box,
|
||||
onSuccess:success_box
|
||||
onSuccess:function (req,xml)
|
||||
{
|
||||
success_box(req,xml);
|
||||
g(id).style.top=calcy(140+(layer*3));
|
||||
g(id).style.left="10%";
|
||||
g(id).style.width='80%';
|
||||
}
|
||||
}
|
||||
);
|
||||
g(id).style.top=posY-40;
|
||||
g(id).style.left=posX-10;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -588,7 +594,13 @@ function update_history_account(obj)
|
|||
method:'get',
|
||||
parameters:querystring,
|
||||
onFailure:error_box,
|
||||
onSuccess:success_box
|
||||
onSuccess:function (req,xml)
|
||||
{
|
||||
success_box(req,xml);
|
||||
g(obj.div).style.top=calcy(140+(layer*3));
|
||||
g(obj.div).style.left="10%";
|
||||
g(obj.div).style.width='80%';
|
||||
}
|
||||
});
|
||||
} catch (e)
|
||||
{
|
||||
|
|
@ -618,12 +630,15 @@ var popup={'id':
|
|||
method:'get',
|
||||
parameters:querystring,
|
||||
onFailure:error_box,
|
||||
onSuccess:success_box
|
||||
onSuccess:function (req,xml)
|
||||
{
|
||||
success_box(req,xml);
|
||||
g(id).style.top=calcy(140+(layer*3));
|
||||
g(id).style.left="10%";
|
||||
g(id).style.width='80%';
|
||||
}
|
||||
}
|
||||
);
|
||||
g(id).style.top=posY-40;
|
||||
g(id).style.left=posX-10;
|
||||
|
||||
}
|
||||
|
||||
function update_history_card(obj)
|
||||
|
|
@ -636,7 +651,13 @@ function update_history_card(obj)
|
|||
method:'get',
|
||||
parameters:querystring,
|
||||
onFailure:error_box,
|
||||
onSuccess:success_box
|
||||
onSuccess:function (req,xml)
|
||||
{
|
||||
success_box(req,xml);
|
||||
g(obj.div).style.top=calcy(140+(layer*3));
|
||||
g(obj.div).style.left="10%";
|
||||
g(obj.div).style.width='80%';
|
||||
}
|
||||
});
|
||||
} catch (e)
|
||||
{
|
||||
|
|
@ -693,29 +714,31 @@ function reverseOperation(obj)
|
|||
/*!\brief
|
||||
* \param p_value jrn.jr_id
|
||||
*/
|
||||
function modifyOperation(p_value,dossier)
|
||||
function modifyOperation(p_value, dossier)
|
||||
{
|
||||
layer++;
|
||||
id='det'+layer;
|
||||
var popup={'id':
|
||||
id,'cssclass':'inner_box'
|
||||
,'html':
|
||||
loading(),'drag':
|
||||
true};
|
||||
querystring='gDossier='+dossier+'&act=de&jr_id='+p_value+'&div='+id;
|
||||
add_div(popup);
|
||||
var action=new Ajax.Request(
|
||||
"ajax_ledger.php",
|
||||
{
|
||||
method:'get',
|
||||
parameters:querystring,
|
||||
onFailure:error_box,
|
||||
onSuccess:success_box
|
||||
}
|
||||
);
|
||||
g(id).style.top=posY-40;
|
||||
g(id).style.left=300;
|
||||
|
||||
layer++;
|
||||
id = 'det' + layer;
|
||||
var popup = {'id':
|
||||
id, 'cssclass': 'inner_box'
|
||||
, 'html':
|
||||
loading(), 'drag':
|
||||
true};
|
||||
querystring = 'gDossier=' + dossier + '&act=de&jr_id=' + p_value + '&div=' + id;
|
||||
add_div(popup);
|
||||
var action = new Ajax.Request(
|
||||
"ajax_ledger.php",
|
||||
{
|
||||
method: 'get',
|
||||
parameters: querystring,
|
||||
onFailure: error_box,
|
||||
onSuccess: function(xml, txt) {
|
||||
success_box(xml, txt);
|
||||
g(id).style.top = calcy(100 + (layer * 3));
|
||||
g(id).style.left = '10%';
|
||||
g(id).style.width = "80%";
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/*!\brief
|
||||
|
|
@ -868,10 +891,11 @@ function search_letter(obj)
|
|||
*@brief save an operation in ajax, it concerns only the
|
||||
* comment, the pj and the rapt
|
||||
* the form elements are access by their name
|
||||
*@param form
|
||||
*@param obj form
|
||||
*/
|
||||
function op_save(obj)
|
||||
{
|
||||
try {
|
||||
var queryString=$(obj).serialize();
|
||||
queryString+="&lib="+obj.lib.value;
|
||||
queryString+="&gDossier="+obj.gDossier.value;
|
||||
|
|
@ -906,6 +930,8 @@ function op_save(obj)
|
|||
);
|
||||
}
|
||||
return false;
|
||||
} catch (e)
|
||||
{ alert(e.message);}
|
||||
}
|
||||
function get_history_account(ctl,dossier) {
|
||||
if ( $(ctl).value != '')
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ function search_poste(obj)
|
|||
}
|
||||
|
||||
var div_style="z-index:15;top:"+sx;
|
||||
removeDiv('search_account');
|
||||
add_div({id:'search_account',cssclass:'inner_box',html:loading(),style:div_style,drag:true});
|
||||
|
||||
var dossier=$('gDossier').value;
|
||||
|
|
|
|||
|
|
@ -124,6 +124,9 @@ function anc_refresh_remain(p_table,p_seq)
|
|||
*/
|
||||
function verify_ca(div)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var idx=0;
|
||||
var amount_error=0;
|
||||
// put a maximum
|
||||
|
|
@ -168,6 +171,12 @@ function verify_ca(div)
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
alert(e.message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*!
|
||||
* \brief open a window for searching a CA account,
|
||||
|
|
@ -209,7 +218,7 @@ function search_ca (p_dossier,p_target,p_source)
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
function search_anc_form(obj)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,6 +24,35 @@
|
|||
*/
|
||||
|
||||
var card_layer=1;
|
||||
/**
|
||||
*@brief search a card an display the result into a inner box
|
||||
*/
|
||||
function boxsearch_card(p_dossier)
|
||||
{
|
||||
try
|
||||
{
|
||||
waiting_box();
|
||||
removeDiv('boxsearch_card_div');
|
||||
var queryString="gDossier="+p_dossier+"&op=cardsearch"+"&card="+$(card_search).value;
|
||||
var action = new Ajax.Request(
|
||||
"ajax_misc.php" ,
|
||||
{
|
||||
method:'get', parameters:queryString,
|
||||
onFailure:ajax_misc_failure,
|
||||
onSuccess:function(req){
|
||||
remove_waiting_box();
|
||||
var y=posY+15;
|
||||
var div_style="left:10%;width:80%;"+";top:"+y;
|
||||
add_div({id:'boxsearch_card_div',cssclass:'inner_box',html:loading(),style:div_style,drag:true});
|
||||
$('boxsearch_card_div').innerHTML=req.responseText;
|
||||
}
|
||||
}
|
||||
);
|
||||
}catch( e)
|
||||
{
|
||||
alert(e.getMessage);
|
||||
}
|
||||
}
|
||||
/**
|
||||
*@brief show the ipopup with the form to search a card
|
||||
* the properties
|
||||
|
|
|
|||
|
|
@ -44,7 +44,11 @@ content[13]="Vous pouvez utiliser le % pour indiquer le poste parent";
|
|||
content[14]="Attention, le poste comptable doit exister, il ne sera pas vérifié";
|
||||
content[15]="Laissez à 0 pour ne rien changer";
|
||||
content[16]="Vous devez donner la date par opération";
|
||||
|
||||
content[17]="Cliquez sur le titre d'une colonne pour trier";
|
||||
content[18]="Donnez une partie du nom, prénom, de la description, du poste comptable, du n° de TVA ou quick code";
|
||||
content[19]="Donnez une partie du nom, de la description, du n° de TVA ou quick code";
|
||||
content[20]="Les menus ne peuvent dépendre que dans d'un menu principal ou d'un menu, si cette liste est vide, ajouter des modules ou menu principal sans donner de dépendance";
|
||||
content[21]="Donnez un nombre entre 0 & 100";
|
||||
function showBulle(p_ctl)
|
||||
{
|
||||
d=document.getElementById('bulle');
|
||||
|
|
|
|||
|
|
@ -89,8 +89,7 @@ Calendar._TT["WEEKEND"] = "0,6";
|
|||
|
||||
Calendar._TT["CLOSE"] = "Mbyll";
|
||||
Calendar._TT["TODAY"] = "Sot";
|
||||
Calendar._TT["TIME_PART"] = "Kliko me (Shift-)ose terhiqe per te ndryshuar
|
||||
vleren";
|
||||
Calendar._TT["TIME_PART"] = "Kliko me (Shift-)ose terhiqe per te ndryshuar vleren";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ Calendar._TT["ABOUT"] =
|
|||
"הגירסא האחרונה זמינה ב: http://www.dynarch.com/projects/calendar/\n" +
|
||||
"מופץ תחת זיכיון ה GNU LGPL. עיין ב http://gnu.org/licenses/lgpl.html לפרטים נוספים." +
|
||||
"\n\n" +
|
||||
בחירת תאריך:\n" +
|
||||
"בחירת תאריך:\n" +
|
||||
"- השתמש בכפתורים \xab, \xbb לבחירת שנה\n" +
|
||||
"- השתמש בכפתורים " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " לבחירת חודש\n" +
|
||||
"- החזק העכבר לחוץ מעל הכפתורים המוזכרים לעיל לבחירה מהירה יותר.";
|
||||
|
|
|
|||
112
html/js/nicEdit.js
Normal file
112
html/js/nicEdit.js
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/* NicEdit - Micro Inline WYSIWYG
|
||||
* Copyright 2007-2008 Brian Kirchoff
|
||||
*
|
||||
* NicEdit is distributed under the terms of the MIT license
|
||||
* For more information visit http://nicedit.com/
|
||||
* Do not remove this copyright message
|
||||
*/
|
||||
var bkExtend=function(){var A=arguments;if(A.length==1){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(C){var A=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var B=new this(bkClass);bkExtend(B,C);A.prototype=B;A.extend=this.extend;return A};var bkElement=bkClass.extend({construct:function(B,A){if(typeof (B)=="string"){B=(A||document).createElement(B)}B=$BK(B);return B},appendTo:function(A){A.appendChild(this);return this},appendBefore:function(A){A.parentNode.insertBefore(this,A);return this},addEvent:function(B,A){bkLib.addEvent(this,B,A);return this},setContent:function(A){this.innerHTML=A;return this},pos:function(){var C=curtop=0;var B=obj=this;if(obj.offsetParent){do{C+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var A=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[C+A,curtop+A+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(A){var B=this;do{if(B&&B.nodeName&&B.nodeName.toUpperCase()==A){return B}B=B.parentNode}while(B);return false},hasClass:function(A){return this.className.match(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)"))},addClass:function(A){if(!this.hasClass(A)){this.className+=" nicEdit-"+A}return this},removeClass:function(A){if(this.hasClass(A)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)")," ")}return this},setStyle:function(A){var B=this.style;for(var C in A){switch(C){case"float":B.cssFloat=B.styleFloat=A[C];break;case"opacity":B.opacity=A[C];B.filter="alpha(opacity="+Math.round(A[C]*100)+")";break;case"className":this.className=A[C];break;default:B[C]=A[C]}}return this},getStyle:function(A,C){var B=(!C)?document.defaultView:C;if(this.nodeType==1){return(B&&B.getComputedStyle)?B.getComputedStyle(this,null).getPropertyValue(A):this.currentStyle[bkLib.camelize(A)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(A){for(var B in A){this[B]=A[B]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(C,B,A){(C.addEventListener)?C.addEventListener(B,A,false):C.attachEvent("on"+B,A)},toArray:function(C){var B=C.length,A=new Array(B);while(B--){A[B]=C[B]}return A},noSelect:function(B){if(B.setAttribute&&B.nodeName.toLowerCase()!="input"&&B.nodeName.toLowerCase()!="textarea"){B.setAttribute("unselectable","on")}for(var A=0;A<B.childNodes.length;A++){bkLib.noSelect(B.childNodes[A])}},camelize:function(A){return A.replace(/\-(.)/g,function(B,C){return C.toUpperCase()})},inArray:function(A,B){return(bkLib.search(A,B)!=null)},search:function(A,C){for(var B=0;B<A.length;B++){if(A[B]==C){return B}}return null},cancelEvent:function(A){A=A||window.event;if(A.preventDefault&&A.stopPropagation){A.preventDefault();A.stopPropagation()}return false},domLoad:[],domLoaded:function(){if(arguments.callee.done){return }arguments.callee.done=true;for(i=0;i<bkLib.domLoad.length;i++){bkLib.domLoad[i]()}},onDomLoaded:function(A){this.domLoad.push(A);if(document.addEventListener){document.addEventListener("DOMContentLoaded",bkLib.domLoaded,null)}else{if(bkLib.isMSIE){document.write("<style>.nicEdit-main p { margin: 0; }</style><script id=__ie_onload defer "+((location.protocol=="https:")?"src='javascript:void(0)'":"src=//0")+"><\/script>");$BK("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){bkLib.domLoaded()}}}}window.onload=bkLib.domLoaded}};function $BK(A){if(typeof (A)=="string"){A=document.getElementById(A)}return(A&&!A.appendTo)?bkExtend(A,bkElement.prototype):A}var bkEvent={addEvent:function(A,B){if(B){this.eventList=this.eventList||{};this.eventList[A]=this.eventList[A]||[];this.eventList[A].push(B)}return this},fireEvent:function(){var A=bkLib.toArray(arguments),C=A.shift();if(this.eventList&&this.eventList[C]){for(var B=0;B<this.eventList[C].length;B++){this.eventList[C][B].apply(this,A)}}}};function __(A){return A}Function.prototype.closure=function(){var A=this,B=bkLib.toArray(arguments),C=B.shift();return function(){if(typeof (bkLib)!="undefined"){return A.apply(C,B.concat(bkLib.toArray(arguments)))}}};Function.prototype.closureListener=function(){var A=this,C=bkLib.toArray(arguments),B=C.shift();return function(E){E=E||window.event;if(E.target){var D=E.target}else{var D=E.srcElement}return A.apply(B,[E,D].concat(C))}};
|
||||
|
||||
|
||||
|
||||
var nicEditorConfig = bkClass.extend({
|
||||
buttons : {
|
||||
'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'},
|
||||
'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'},
|
||||
'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'},
|
||||
'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true},
|
||||
'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true},
|
||||
'right' : {name : __('Right Align'), command : 'justifyright', noActive : true},
|
||||
'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true},
|
||||
'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']},
|
||||
'ul' : {name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']},
|
||||
'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']},
|
||||
'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']},
|
||||
'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}},
|
||||
'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true},
|
||||
'indent' : {name : __('Indent Text'), command : 'indent', noActive : true},
|
||||
'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true},
|
||||
'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true}
|
||||
},
|
||||
iconsPath : '../nicEditorIcons.gif',
|
||||
buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'],
|
||||
iconList : {"bgcolor":1,"forecolor":2,"bold":3,"center":4,"hr":5,"indent":6,"italic":7,"justify":8,"left":9,"ol":10,"outdent":11,"removeformat":12,"right":13,"save":24,"strikethrough":15,"subscript":16,"superscript":17,"ul":18,"underline":19,"image":20,"link":21,"unlink":22,"close":23,"arrow":25,"upload":26}
|
||||
|
||||
});
|
||||
;
|
||||
var nicEditors={nicPlugins:[],editors:[],registerPlugin:function(B,A){this.nicPlugins.push({p:B,o:A})},allTextAreas:function(C){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){nicEditors.editors.push(new nicEditor(C).panelInstance(A[B]))}return nicEditors.editors},findEditor:function(C){var B=nicEditors.editors;for(var A=0;A<B.length;A++){if(B[A].instanceById(C)){return B[A].instanceById(C)}}}};var nicEditor=bkClass.extend({construct:function(C){this.options=new nicEditorConfig();bkExtend(this.options,C);this.nicInstances=new Array();this.loadedPlugins=new Array();var A=nicEditors.nicPlugins;for(var B=0;B<A.length;B++){this.loadedPlugins.push(new A[B].p(this,A[B].o))}nicEditors.editors.push(this);bkLib.addEvent(document.body,"mousedown",this.selectCheck.closureListener(this))},panelInstance:function(B,C){B=this.checkReplace($BK(B));var A=new bkElement("DIV").setStyle({width:(parseInt(B.getStyle("width"))||B.clientWidth)+"px"}).appendBefore(B);this.setPanel(A);return this.addInstance(B,C)},checkReplace:function(B){var A=nicEditors.findEditor(B);if(A){A.removeInstance(B);A.removePanel()}return B},addInstance:function(B,C){B=this.checkReplace($BK(B));if(B.contentEditable||!!window.opera){var A=new nicEditorInstance(B,C,this)}else{var A=new nicEditorIFrameInstance(B,C,this)}this.nicInstances.push(A);return this},removeInstance:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){B[A].remove();this.nicInstances.splice(A,1)}}},removePanel:function(A){if(this.nicPanel){this.nicPanel.remove();this.nicPanel=null}},instanceById:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){return B[A]}}},setPanel:function(A){this.nicPanel=new nicEditorPanel($BK(A),this.options,this);this.fireEvent("panel",this.nicPanel);return this},nicCommand:function(B,A){if(this.selectedInstance){this.selectedInstance.nicCommand(B,A)}},getIcon:function(D,A){var C=this.options.iconList[D];var B=(A.iconFiles)?A.iconFiles[D]:"";return{backgroundImage:"url('"+((C)?this.options.iconsPath:B)+"')",backgroundPosition:((C)?((C-1)*-18):0)+"px 0px"}},selectCheck:function(C,A){var B=false;do{if(A.className&&A.className.indexOf("nicEdit")!=-1){return false}}while(A=A.parentNode);this.fireEvent("blur",this.selectedInstance,A);this.lastSelectedInstance=this.selectedInstance;this.selectedInstance=null;return false}});nicEditor=nicEditor.extend(bkEvent);
|
||||
var nicEditorInstance=bkClass.extend({isSelected:false,construct:function(G,D,C){this.ne=C;this.elm=this.e=G;this.options=D||{};newX=parseInt(G.getStyle("width"))||G.clientWidth;newY=parseInt(G.getStyle("height"))||G.clientHeight;this.initialHeight=newY-8;var H=(G.nodeName.toLowerCase()=="textarea");if(H||this.options.hasPanel){var B=(bkLib.isMSIE&&!((typeof document.body.style.maxHeight!="undefined")&&document.compatMode=="CSS1Compat"));var E={width:newX+"px",border:"1px solid #ccc",borderTop:0,overflowY:"auto",overflowX:"hidden"};E[(B)?"height":"maxHeight"]=(this.ne.options.maxHeight)?this.ne.options.maxHeight+"px":null;this.editorContain=new bkElement("DIV").setStyle(E).appendBefore(G);var A=new bkElement("DIV").setStyle({width:(newX-8)+"px",margin:"4px",minHeight:newY+"px"}).addClass("main").appendTo(this.editorContain);G.setStyle({display:"none"});A.innerHTML=G.innerHTML;if(H){A.setContent(G.value);this.copyElm=G;var F=G.parentTag("FORM");if(F){bkLib.addEvent(F,"submit",this.saveContent.closure(this))}}A.setStyle((B)?{height:newY+"px"}:{overflow:"hidden"});this.elm=A}this.ne.addEvent("blur",this.blur.closure(this));this.init();this.blur()},init:function(){this.elm.setAttribute("contentEditable","true");if(this.getContent()==""){this.setContent("<br />")}this.instanceDoc=document.defaultView;this.elm.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keypress",this.keyDown.closureListener(this)).addEvent("focus",this.selected.closure(this)).addEvent("blur",this.blur.closure(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},remove:function(){this.saveContent();if(this.copyElm||this.options.hasPanel){this.editorContain.remove();this.e.setStyle({display:"block"});this.ne.removePanel()}this.disable();this.ne.fireEvent("remove",this)},disable:function(){this.elm.setAttribute("contentEditable","false")},getSel:function(){return(window.getSelection)?window.getSelection():document.selection},getRng:function(){var A=this.getSel();if(!A||A.rangeCount===0){return }return(A.rangeCount>0)?A.getRangeAt(0):A.createRange()},selRng:function(A,B){if(window.getSelection){B.removeAllRanges();B.addRange(A)}else{A.select()}},selElm:function(){var C=this.getRng();if(!C){return }if(C.startContainer){var D=C.startContainer;if(C.cloneContents().childNodes.length==1){for(var B=0;B<D.childNodes.length;B++){var A=D.childNodes[B].ownerDocument.createRange();A.selectNode(D.childNodes[B]);if(C.compareBoundaryPoints(Range.START_TO_START,A)!=1&&C.compareBoundaryPoints(Range.END_TO_END,A)!=-1){return $BK(D.childNodes[B])}}}return $BK(D)}else{return $BK((this.getSel().type=="Control")?C.item(0):C.parentElement())}},saveRng:function(){this.savedRange=this.getRng();this.savedSel=this.getSel()},restoreRng:function(){if(this.savedRange){this.selRng(this.savedRange,this.savedSel)}},keyDown:function(B,A){if(B.ctrlKey){this.ne.fireEvent("key",this,B)}},selected:function(C,A){if(!A&&!(A=this.selElm)){A=this.selElm()}if(!C.ctrlKey){var B=this.ne.selectedInstance;if(B!=this){if(B){this.ne.fireEvent("blur",B,A)}this.ne.selectedInstance=this;this.ne.fireEvent("focus",B,A)}this.ne.fireEvent("selected",B,A);this.isFocused=true;this.elm.addClass("selected")}return false},blur:function(){this.isFocused=false;this.elm.removeClass("selected")},saveContent:function(){if(this.copyElm||this.options.hasPanel){this.ne.fireEvent("save",this);(this.copyElm)?this.copyElm.value=this.getContent():this.e.innerHTML=this.getContent()}},getElm:function(){return this.elm},getContent:function(){this.content=this.getElm().innerHTML;this.ne.fireEvent("get",this);return this.content},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.elm.innerHTML=this.content},nicCommand:function(B,A){document.execCommand(B,false,A)}});
|
||||
var nicEditorIFrameInstance=nicEditorInstance.extend({savedStyles:[],init:function(){var B=this.elm.innerHTML.replace(/^\s+|\s+$/g,"");this.elm.innerHTML="";(!B)?B="<br />":B;this.initialContent=B;this.elmFrame=new bkElement("iframe").setAttributes({src:"javascript:;",frameBorder:0,allowTransparency:"true",scrolling:"no"}).setStyle({height:"100px",width:"100%"}).addClass("frame").appendTo(this.elm);if(this.copyElm){this.elmFrame.setStyle({width:(this.elm.offsetWidth-4)+"px"})}var A=["font-size","font-family","font-weight","color"];for(itm in A){this.savedStyles[bkLib.camelize(itm)]=this.elm.getStyle(itm)}setTimeout(this.initFrame.closure(this),50)},disable:function(){this.elm.innerHTML=this.getContent()},initFrame:function(){var B=$BK(this.elmFrame.contentWindow.document);B.designMode="on";B.open();var A=this.ne.options.externalCSS;B.write("<html><head>"+((A)?'<link href="'+A+'" rel="stylesheet" type="text/css" />':"")+'</head><body id="nicEditContent" style="margin: 0 !important; background-color: transparent !important;">'+this.initialContent+"</body></html>");B.close();this.frameDoc=B;this.frameWin=$BK(this.elmFrame.contentWindow);this.frameContent=$BK(this.frameWin.document.body).setStyle(this.savedStyles);this.instanceDoc=this.frameWin.document.defaultView;this.heightUpdate();this.frameDoc.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keyup",this.heightUpdate.closureListener(this)).addEvent("keydown",this.keyDown.closureListener(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},getElm:function(){return this.frameContent},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.frameContent.innerHTML=this.content;this.heightUpdate()},getSel:function(){return(this.frameWin)?this.frameWin.getSelection():this.frameDoc.selection},heightUpdate:function(){this.elmFrame.style.height=Math.max(this.frameContent.offsetHeight,this.initialHeight)+"px"},nicCommand:function(B,A){this.frameDoc.execCommand(B,false,A);setTimeout(this.heightUpdate.closure(this),100)}});
|
||||
var nicEditorPanel=bkClass.extend({construct:function(E,B,A){this.elm=E;this.options=B;this.ne=A;this.panelButtons=new Array();this.buttonList=bkExtend([],this.ne.options.buttonList);this.panelContain=new bkElement("DIV").setStyle({overflow:"hidden",width:"100%",border:"1px solid #cccccc",backgroundColor:"#efefef"}).addClass("panelContain");this.panelElm=new bkElement("DIV").setStyle({margin:"2px",marginTop:"0px",zoom:1,overflow:"hidden"}).addClass("panel").appendTo(this.panelContain);this.panelContain.appendTo(E);var C=this.ne.options;var D=C.buttons;for(button in D){this.addButton(button,C,true)}this.reorder();E.noSelect()},addButton:function(buttonName,options,noOrder){var button=options.buttons[buttonName];var type=(button.type)?eval("(typeof("+button.type+') == "undefined") ? null : '+button.type+";"):nicEditorButton;var hasButton=bkLib.inArray(this.buttonList,buttonName);if(type&&(hasButton||this.ne.options.fullPanel)){this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName)}}},findButton:function(B){for(var A=0;A<this.panelButtons.length;A++){if(this.panelButtons[A].name==B){return this.panelButtons[A]}}},reorder:function(){var C=this.buttonList;for(var B=0;B<C.length;B++){var A=this.findButton(C[B]);if(A){this.panelElm.appendChild(A.margin)}}},remove:function(){this.elm.remove()}});
|
||||
var nicEditorButton=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.name=A;this.ne=B;this.elm=D;this.margin=new bkElement("DIV").setStyle({"float":"left",marginTop:"2px"}).appendTo(D);this.contain=new bkElement("DIV").setStyle({width:"20px",height:"20px"}).addClass("buttonContain").appendTo(this.margin);this.border=new bkElement("DIV").setStyle({backgroundColor:"#efefef",border:"1px solid #efefef"}).appendTo(this.contain);this.button=new bkElement("DIV").setStyle({width:"18px",height:"18px",overflow:"hidden",zoom:1,cursor:"pointer"}).addClass("button").setStyle(this.ne.getIcon(A,C)).appendTo(this.border);this.button.addEvent("mouseover",this.hoverOn.closure(this)).addEvent("mouseout",this.hoverOff.closure(this)).addEvent("mousedown",this.mouseClick.closure(this)).noSelect();if(!window.opera){this.button.onmousedown=this.button.onclick=bkLib.cancelEvent}B.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this)).addEvent("key",this.key.closure(this));this.disable();this.init()},init:function(){},hide:function(){this.contain.setStyle({display:"none"})},updateState:function(){if(this.isDisabled){this.setBg()}else{if(this.isHover){this.setBg("hover")}else{if(this.isActive){this.setBg("active")}else{this.setBg()}}}},setBg:function(A){switch(A){case"hover":var B={border:"1px solid #666",backgroundColor:"#ddd"};break;case"active":var B={border:"1px solid #666",backgroundColor:"#ccc"};break;default:var B={border:"1px solid #efefef",backgroundColor:"#efefef"}}this.border.setStyle(B).addClass("button-"+A)},checkNodes:function(A){var B=A;do{if(this.options.tags&&bkLib.inArray(this.options.tags,B.nodeName)){this.activate();return true}}while(B=B.parentNode&&B.className!="nicEdit");B=$BK(A);while(B.nodeType==3){B=$BK(B.parentNode)}if(this.options.css){for(itm in this.options.css){if(B.getStyle(itm,this.ne.selectedInstance.instanceDoc)==this.options.css[itm]){this.activate();return true}}}this.deactivate();return false},activate:function(){if(!this.isDisabled){this.isActive=true;this.updateState();this.ne.fireEvent("buttonActivate",this)}},deactivate:function(){this.isActive=false;this.updateState();if(!this.isDisabled){this.ne.fireEvent("buttonDeactivate",this)}},enable:function(A,B){this.isDisabled=false;this.contain.setStyle({opacity:1}).addClass("buttonEnabled");this.updateState();this.checkNodes(B)},disable:function(A,B){this.isDisabled=true;this.contain.setStyle({opacity:0.6}).removeClass("buttonEnabled");this.updateState()},toggleActive:function(){(this.isActive)?this.deactivate():this.activate()},hoverOn:function(){if(!this.isDisabled){this.isHover=true;this.updateState();this.ne.fireEvent("buttonOver",this)}},hoverOff:function(){this.isHover=false;this.updateState();this.ne.fireEvent("buttonOut",this)},mouseClick:function(){if(this.options.command){this.ne.nicCommand(this.options.command,this.options.commandArgs);if(!this.options.noActive){this.toggleActive()}}this.ne.fireEvent("buttonClick",this)},key:function(A,B){if(this.options.key&&B.ctrlKey&&String.fromCharCode(B.keyCode||B.charCode).toLowerCase()==this.options.key){this.mouseClick();if(B.preventDefault){B.preventDefault()}}}});
|
||||
var nicPlugin=bkClass.extend({construct:function(B,A){this.options=A;this.ne=B;this.ne.addEvent("panel",this.loadPanel.closure(this));this.init()},loadPanel:function(C){var B=this.options.buttons;for(var A in B){C.addButton(A,this.options)}C.reorder()},init:function(){}});
|
||||
|
||||
|
||||
var nicPaneOptions = { };
|
||||
|
||||
var nicEditorPane=bkClass.extend({construct:function(D,C,B,A){this.ne=C;this.elm=D;this.pos=D.pos();this.contain=new bkElement("div").setStyle({zIndex:"99999",overflow:"hidden",position:"absolute",left:this.pos[0]+"px",top:this.pos[1]+"px"});this.pane=new bkElement("div").setStyle({fontSize:"12px",border:"1px solid #ccc",overflow:"hidden",padding:"4px",textAlign:"left",backgroundColor:"#ffffc9"}).addClass("pane").setStyle(B).appendTo(this.contain);if(A&&!A.options.noClose){this.close=new bkElement("div").setStyle({"float":"right",height:"16px",width:"16px",cursor:"pointer"}).setStyle(this.ne.getIcon("close",nicPaneOptions)).addEvent("mousedown",A.removePane.closure(this)).appendTo(this.pane)}this.contain.noSelect().appendTo(document.body);this.position();this.init()},init:function(){},position:function(){if(this.ne.nicPanel){var B=this.ne.nicPanel.elm;var A=B.pos();var C=A[0]+parseInt(B.getStyle("width"))-(parseInt(this.pane.getStyle("width"))+8);if(C<this.pos[0]){this.contain.setStyle({left:C+"px"})}}},toggle:function(){this.isVisible=!this.isVisible;this.contain.setStyle({display:((this.isVisible)?"block":"none")})},remove:function(){if(this.contain){this.contain.remove();this.contain=null}},append:function(A){A.appendTo(this.pane)},setContent:function(A){this.pane.setContent(A)}});
|
||||
|
||||
var nicEditorAdvancedButton=nicEditorButton.extend({init:function(){this.ne.addEvent("selected",this.removePane.closure(this)).addEvent("blur",this.removePane.closure(this))},mouseClick:function(){if(!this.isDisabled){if(this.pane&&this.pane.pane){this.removePane()}else{this.pane=new nicEditorPane(this.contain,this.ne,{width:(this.width||"270px"),backgroundColor:"#fff"},this);this.addPane();this.ne.selectedInstance.saveRng()}}},addForm:function(C,G){this.form=new bkElement("form").addEvent("submit",this.submit.closureListener(this));this.pane.append(this.form);this.inputs={};for(itm in C){var D=C[itm];var F="";if(G){F=G.getAttribute(itm)}if(!F){F=D.value||""}var A=C[itm].type;if(A=="title"){new bkElement("div").setContent(D.txt).setStyle({fontSize:"14px",fontWeight:"bold",padding:"0px",margin:"2px 0"}).appendTo(this.form)}else{var B=new bkElement("div").setStyle({overflow:"hidden",clear:"both"}).appendTo(this.form);if(D.txt){new bkElement("label").setAttributes({"for":itm}).setContent(D.txt).setStyle({margin:"2px 4px",fontSize:"13px",width:"50px",lineHeight:"20px",textAlign:"right","float":"left"}).appendTo(B)}switch(A){case"text":this.inputs[itm]=new bkElement("input").setAttributes({id:itm,value:F,type:"text"}).setStyle({margin:"2px 0",fontSize:"13px","float":"left",height:"20px",border:"1px solid #ccc",overflow:"hidden"}).setStyle(D.style).appendTo(B);break;case"select":this.inputs[itm]=new bkElement("select").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left",margin:"2px 0"}).appendTo(B);for(opt in D.options){var E=new bkElement("option").setAttributes({value:opt,selected:(opt==F)?"selected":""}).setContent(D.options[opt]).appendTo(this.inputs[itm])}break;case"content":this.inputs[itm]=new bkElement("textarea").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left"}).setStyle(D.style).appendTo(B);this.inputs[itm].value=F}}}new bkElement("input").setAttributes({type:"submit"}).setStyle({backgroundColor:"#efefef",border:"1px solid #ccc",margin:"3px 0","float":"left",clear:"both"}).appendTo(this.form);this.form.onsubmit=bkLib.cancelEvent},submit:function(){},findElm:function(B,A,E){var D=this.ne.selectedInstance.getElm().getElementsByTagName(B);for(var C=0;C<D.length;C++){if(D[C].getAttribute(A)==E){return $BK(D[C])}}},removePane:function(){if(this.pane){this.pane.remove();this.pane=null;this.ne.selectedInstance.restoreRng()}}});
|
||||
|
||||
var nicButtonTips=bkClass.extend({construct:function(A){this.ne=A;A.addEvent("buttonOver",this.show.closure(this)).addEvent("buttonOut",this.hide.closure(this))},show:function(A){this.timer=setTimeout(this.create.closure(this,A),400)},create:function(A){this.timer=null;if(!this.pane){this.pane=new nicEditorPane(A.button,this.ne,{fontSize:"12px",marginTop:"5px"});this.pane.setContent(A.options.name)}},hide:function(A){if(this.timer){clearTimeout(this.timer)}if(this.pane){this.pane=this.pane.remove()}}});nicEditors.registerPlugin(nicButtonTips);
|
||||
|
||||
|
||||
var nicSelectOptions = {
|
||||
buttons : {
|
||||
'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'},
|
||||
'fontFamily' : {name : __('Select Font Family'), type : 'nicEditorFontFamilySelect', command : 'fontname'},
|
||||
'fontFormat' : {name : __('Select Font Format'), type : 'nicEditorFontFormatSelect', command : 'formatBlock'}
|
||||
}
|
||||
};
|
||||
|
||||
var nicEditorSelect=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.elm=D;this.ne=B;this.name=A;this.selOptions=new Array();this.margin=new bkElement("div").setStyle({"float":"left",margin:"2px 1px 0 1px"}).appendTo(this.elm);this.contain=new bkElement("div").setStyle({width:"90px",height:"20px",cursor:"pointer",overflow:"hidden"}).addClass("selectContain").addEvent("click",this.toggle.closure(this)).appendTo(this.margin);this.items=new bkElement("div").setStyle({overflow:"hidden",zoom:1,border:"1px solid #ccc",paddingLeft:"3px",backgroundColor:"#fff"}).appendTo(this.contain);this.control=new bkElement("div").setStyle({overflow:"hidden","float":"right",height:"18px",width:"16px"}).addClass("selectControl").setStyle(this.ne.getIcon("arrow",C)).appendTo(this.items);this.txt=new bkElement("div").setStyle({overflow:"hidden","float":"left",width:"66px",height:"14px",marginTop:"1px",fontFamily:"sans-serif",textAlign:"center",fontSize:"12px"}).addClass("selectTxt").appendTo(this.items);if(!window.opera){this.contain.onmousedown=this.control.onmousedown=this.txt.onmousedown=bkLib.cancelEvent}this.margin.noSelect();this.ne.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this));this.disable();this.init()},disable:function(){this.isDisabled=true;this.close();this.contain.setStyle({opacity:0.6})},enable:function(A){this.isDisabled=false;this.close();this.contain.setStyle({opacity:1})},setDisplay:function(A){this.txt.setContent(A)},toggle:function(){if(!this.isDisabled){(this.pane)?this.close():this.open()}},open:function(){this.pane=new nicEditorPane(this.items,this.ne,{width:"88px",padding:"0px",borderTop:0,borderLeft:"1px solid #ccc",borderRight:"1px solid #ccc",borderBottom:"0px",backgroundColor:"#fff"});for(var C=0;C<this.selOptions.length;C++){var B=this.selOptions[C];var A=new bkElement("div").setStyle({overflow:"hidden",borderBottom:"1px solid #ccc",width:"88px",textAlign:"left",overflow:"hidden",cursor:"pointer"});var D=new bkElement("div").setStyle({padding:"0px 4px"}).setContent(B[1]).appendTo(A).noSelect();D.addEvent("click",this.update.closure(this,B[0])).addEvent("mouseover",this.over.closure(this,D)).addEvent("mouseout",this.out.closure(this,D)).setAttributes("id",B[0]);this.pane.append(A);if(!window.opera){D.onmousedown=bkLib.cancelEvent}}},close:function(){if(this.pane){this.pane=this.pane.remove()}},over:function(A){A.setStyle({backgroundColor:"#ccc"})},out:function(A){A.setStyle({backgroundColor:"#fff"})},add:function(B,A){this.selOptions.push(new Array(B,A))},update:function(A){this.ne.nicCommand(this.options.command,A);this.close()}});var nicEditorFontSizeSelect=nicEditorSelect.extend({sel:{1:"1 (8pt)",2:"2 (10pt)",3:"3 (12pt)",4:"4 (14pt)",5:"5 (18pt)",6:"6 (24pt)"},init:function(){this.setDisplay("Font Size...");for(itm in this.sel){this.add(itm,'<font size="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFamilySelect=nicEditorSelect.extend({sel:{arial:"Arial","comic sans ms":"Comic Sans","courier new":"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact","times new roman":"Times","trebuchet ms":"Trebuchet",verdana:"Verdana"},init:function(){this.setDisplay("Font Family...");for(itm in this.sel){this.add(itm,'<font face="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFormatSelect=nicEditorSelect.extend({sel:{p:"Paragraph",pre:"Pre",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1"},init:function(){this.setDisplay("Font Format...");for(itm in this.sel){var A=itm.toUpperCase();this.add("<"+A+">","<"+itm+' style="padding: 0px; margin: 0px;">'+this.sel[itm]+"</"+A+">")}}});nicEditors.registerPlugin(nicPlugin,nicSelectOptions);
|
||||
|
||||
|
||||
var nicLinkOptions = {
|
||||
buttons : {
|
||||
'link' : {name : 'Add Link', type : 'nicLinkButton', tags : ['A']},
|
||||
'unlink' : {name : 'Remove Link', command : 'unlink', noActive : true}
|
||||
}
|
||||
};
|
||||
|
||||
var nicLinkButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("A");this.addForm({"":{type:"title",txt:"Add/Edit Link"},href:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},title:{type:"text",txt:"Title"},target:{type:"select",txt:"Open In",options:{"":"Current Window",_blank:"New Window"},style:{width:"100px"}}},this.ln)},submit:function(C){var A=this.inputs.href.value;if(A=="http://"||A==""){alert("You must enter a URL to Create a Link");return false}this.removePane();if(!this.ln){var B="javascript:nicTemp();";this.ne.nicCommand("createlink",B);this.ln=this.findElm("A","href",B)}if(this.ln){this.ln.setAttributes({href:this.inputs.href.value,title:this.inputs.title.value,target:this.inputs.target.options[this.inputs.target.selectedIndex].value})}}});nicEditors.registerPlugin(nicPlugin,nicLinkOptions);
|
||||
|
||||
|
||||
var nicColorOptions = {
|
||||
buttons : {
|
||||
'forecolor' : {name : __('Change Text Color'), type : 'nicEditorColorButton', noClose : true},
|
||||
'bgcolor' : {name : __('Change Background Color'), type : 'nicEditorBgColorButton', noClose : true}
|
||||
}
|
||||
};
|
||||
|
||||
var nicEditorColorButton=nicEditorAdvancedButton.extend({addPane:function(){var D={0:"00",1:"33",2:"66",3:"99",4:"CC",5:"FF"};var H=new bkElement("DIV").setStyle({width:"270px"});for(var A in D){for(var F in D){for(var E in D){var I="#"+D[A]+D[E]+D[F];var C=new bkElement("DIV").setStyle({cursor:"pointer",height:"15px","float":"left"}).appendTo(H);var G=new bkElement("DIV").setStyle({border:"2px solid "+I}).appendTo(C);var B=new bkElement("DIV").setStyle({backgroundColor:I,overflow:"hidden",width:"11px",height:"11px"}).addEvent("click",this.colorSelect.closure(this,I)).addEvent("mouseover",this.on.closure(this,G)).addEvent("mouseout",this.off.closure(this,G,I)).appendTo(G);if(!window.opera){C.onmousedown=B.onmousedown=bkLib.cancelEvent}}}}this.pane.append(H.noSelect())},colorSelect:function(A){this.ne.nicCommand("foreColor",A);this.removePane()},on:function(A){A.setStyle({border:"2px solid #000"})},off:function(A,B){A.setStyle({border:"2px solid "+B})}});var nicEditorBgColorButton=nicEditorColorButton.extend({colorSelect:function(A){this.ne.nicCommand("hiliteColor",A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicColorOptions);
|
||||
|
||||
|
||||
var nicImageOptions = {
|
||||
buttons : {
|
||||
'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Image"},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);
|
||||
|
||||
|
||||
var nicSaveOptions = {
|
||||
buttons : {
|
||||
'save' : {name : __('Save this content'), type : 'nicEditorSaveButton'}
|
||||
}
|
||||
};
|
||||
|
||||
var nicEditorSaveButton=nicEditorButton.extend({init:function(){if(!this.ne.options.onSave){this.margin.setStyle({display:"none"})}},mouseClick:function(){var B=this.ne.options.onSave;var A=this.ne.selectedInstance;B(A.getContent(),A.elm.id,A)}});nicEditors.registerPlugin(nicPlugin,nicSaveOptions);
|
||||
|
||||
|
||||
var nicUploadOptions = {
|
||||
buttons : {
|
||||
'upload' : {name : 'Upload Image', type : 'nicUploadButton'}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var nicUploadButton=nicEditorAdvancedButton.extend({nicURI:"http://api.imgur.com/2/upload.json",errorText:"Failed to upload image",addPane:function(){if(typeof window.FormData==="undefined"){return this.onError("Image uploads are not supported in this browser, use Chrome, Firefox, or Safari instead.")}this.im=this.ne.selectedInstance.selElm().parentTag("IMG");var A=new bkElement("div").setStyle({padding:"10px"}).appendTo(this.pane.pane);new bkElement("div").setStyle({fontSize:"14px",fontWeight:"bold",paddingBottom:"5px"}).setContent("Insert an Image").appendTo(A);this.fileInput=new bkElement("input").setAttributes({type:"file"}).appendTo(A);this.progress=new bkElement("progress").setStyle({width:"100%",display:"none"}).setAttributes("max",100).appendTo(A);this.fileInput.onchange=this.uploadFile.closure(this)},onError:function(A){this.removePane();alert(A||"Failed to upload image")},uploadFile:function(){var B=this.fileInput.files[0];if(!B||!B.type.match(/image.*/)){this.onError("Only image files can be uploaded");return }this.fileInput.setStyle({display:"none"});this.setProgress(0);var A=new FormData();A.append("image",B);A.append("key","b7ea18a4ecbda8e92203fa4968d10660");var C=new XMLHttpRequest();C.open("POST",this.ne.options.uploadURI||this.nicURI);C.onload=function(){try{var D=JSON.parse(C.responseText)}catch(E){return this.onError()}this.onUploaded(D.upload)}.closure(this);C.onerror=this.onError.closure(this);C.upload.onprogress=function(D){this.setProgress(D.loaded/D.total)}.closure(this);C.send(A)},setProgress:function(A){this.progress.setStyle({display:"block"});if(A<0.98){this.progress.value=A}else{this.progress.removeAttribute("value")}},onUploaded:function(B){this.removePane();var D=B.links.original;if(!this.im){this.ne.selectedInstance.restoreRng();var C="javascript:nicImTemp();";this.ne.nicCommand("insertImage",D);this.im=this.findElm("IMG","src",D)}var A=parseInt(this.ne.selectedInstance.elm.getStyle("width"));if(this.im){this.im.setAttributes({src:D,width:(A&&B.image.width)?Math.min(A,B.image.width):""})}}});nicEditors.registerPlugin(nicPlugin,nicUploadOptions);
|
||||
|
||||
BIN
html/js/nicEditorIcons.gif
Normal file
BIN
html/js/nicEditorIcons.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
|
|
@ -23,6 +23,8 @@
|
|||
* \brief javascript script, always added to every page
|
||||
*
|
||||
*/
|
||||
|
||||
var ask_reload=0;
|
||||
/**
|
||||
* callback function when we just need to update a hidden div with an info
|
||||
* message
|
||||
|
|
@ -135,7 +137,7 @@ function enable_type_periode()
|
|||
|
||||
/**
|
||||
*@brief will reload the window but it is dangerous if we have submitted
|
||||
* a form
|
||||
* a form with POST
|
||||
*/
|
||||
function refresh_window()
|
||||
{
|
||||
|
|
@ -653,6 +655,13 @@ function removeDiv(elt)
|
|||
{
|
||||
document.body.removeChild(g(elt));
|
||||
}
|
||||
// if reloaded if asked the window will be reloaded when
|
||||
// the box is closed
|
||||
if ( ask_reload == 1)
|
||||
{
|
||||
// avoid POST window.location = window.location.href;
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
/**
|
||||
*show a box while loading
|
||||
|
|
@ -664,6 +673,7 @@ function waiting_box()
|
|||
obj={
|
||||
id:'wait_box',html:loading()
|
||||
};
|
||||
obj.style=fixed_position(350,200)+";width:200px";
|
||||
if ($('wait_box')){
|
||||
removeDiv('wait_box');
|
||||
}
|
||||
|
|
@ -892,6 +902,8 @@ function show_calc()
|
|||
}
|
||||
var sid='calc1';
|
||||
var shtml='';
|
||||
shtml+='<div style="float:right;height:10px;display:block;margin-top:2px;margin-right:2px"> <a onclick="removeDiv(\'calc1\');" href="javascript:void(0)" id="close_div">Fermer</a></div>';
|
||||
shtml+='<div> <h2 class="info">Calculatrice</h2></div>';
|
||||
shtml+='<form name="calc_line" method="GET" onSubmit="cal();return false;" >Calculatrice simplifiée: écrivez simplement les opérations que vous voulez puis la touche retour. exemple : 1+2+3*(1/5) <input class="input_text" type="text" size="30" id="inp" name="calculator"> <input type="button" value="Efface tout" class="button" onClick="Clean();return false;" > <input type="button" class="button" value="Fermer" onClick="removeDiv(\'calc1\')" >';
|
||||
shtml+='</form><span id="result"> </span><br><span id="sub_total"> Taper une formule (ex 20*5.1) puis enter </span><br><span id="listing"> </span>';
|
||||
|
||||
|
|
@ -1080,7 +1092,7 @@ function search_reconcile(dossier,ctl_concern,amount_id,ledger)
|
|||
var target="search_op";
|
||||
removeDiv(target);
|
||||
var str_style=fixed_position(77, 99);
|
||||
str_style+=";width:80%";
|
||||
str_style+=";width:92%;overflow:auto;";
|
||||
|
||||
var div={id:target, cssclass:'inner_box',style:str_style,html:loading(),drag:1};
|
||||
|
||||
|
|
@ -1184,7 +1196,7 @@ function get_profile_detail(gDossier,profile_id)
|
|||
$('detail_profile').innerHTML=req.responseText;
|
||||
req.responseText.evalScripts();
|
||||
$('detail_profile').show();
|
||||
profile_show('profile_gen_div');
|
||||
if ( profile_id != "-1" ) profile_show('profile_gen_div');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
@ -1248,11 +1260,12 @@ function mod_menu(gdossier,pm_id)
|
|||
}
|
||||
function add_menu(obj)
|
||||
{
|
||||
pdossier=obj.dossier;
|
||||
p_id=obj.p_id
|
||||
var pdossier=obj.dossier;
|
||||
var p_id=obj.p_id;
|
||||
var p_type=obj.type;
|
||||
waiting_box();
|
||||
removeDiv('divdm'+p_id);
|
||||
var qs="op=add_menu&gDossier="+pdossier+"&p_id="+p_id+"&ctl=divdm"+p_id;
|
||||
var qs="op=add_menu&gDossier="+pdossier+"&p_id="+p_id+"&ctl=divdm"+p_id+"&type="+p_type;
|
||||
var pos=fixed_position(250,150);
|
||||
var action=new Ajax.Request ( 'ajax_misc.php',
|
||||
{
|
||||
|
|
@ -1626,4 +1639,77 @@ function detail_category_show(p_div,p_dossier,p_id)
|
|||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @brief check if the parameter is a valid a valid date or not, returns true if it is valid otherwise
|
||||
* false
|
||||
* @parameter p_str_date the string of the date (format DD.MM.YYYY)
|
||||
*/
|
||||
function check_date(p_str_date)
|
||||
{
|
||||
var format = /^\d{2}\.\d{2}\.\d{4}$/;
|
||||
if(!format.test(p_str_date)){
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
var date_temp = p_str_date.split('.');
|
||||
var nMonth=parseFloat(date_temp[1])-1;
|
||||
var ma_date = new Date(date_temp[2], nMonth, date_temp[0]);
|
||||
if(ma_date.getFullYear()==date_temp[2] && ma_date.getMonth()==nMonth && ma_date.getDate()==date_temp[0]){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* @brief get the string in the id and check if the date is valid
|
||||
* @parameter p_id_date is the id of the element to check
|
||||
* @return true if the date is valid
|
||||
* @see check_date
|
||||
*/
|
||||
function check_date_id(p_id_date)
|
||||
{
|
||||
var str_date=$(p_id_date).value;
|
||||
return check_date(str_date);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param ag_id to view
|
||||
* @param dossier is the folder
|
||||
* @param modify : show the modify button values : 0 for no 1 for yes
|
||||
*/
|
||||
function view_action(ag_id,dossier,modify)
|
||||
{
|
||||
waiting_box();
|
||||
layer++;
|
||||
id = 'action' + layer;
|
||||
|
||||
querystring = 'gDossier=' + dossier + '&op=vw_action&ag_id=' + ag_id + '&div=' + id+'&mod='+modify;
|
||||
var action = new Ajax.Request(
|
||||
"ajax_misc.php",
|
||||
{
|
||||
method: 'get',
|
||||
parameters: querystring,
|
||||
onFailure: error_box,
|
||||
onSuccess: function(req) {
|
||||
try {
|
||||
remove_waiting_box();
|
||||
var pos = fixed_position(0, 50) + ";width:90%;left:5%;";
|
||||
add_div({
|
||||
id: id,
|
||||
drag: 1,
|
||||
cssclass: "inner_box",
|
||||
style: pos
|
||||
});
|
||||
$(id).innerHTML = req.responseText;
|
||||
compute_all_ledger();
|
||||
} catch (e) {
|
||||
alert(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
515
html/js/sorttable.js
Normal file
515
html/js/sorttable.js
Normal file
|
|
@ -0,0 +1,515 @@
|
|||
/**
|
||||
*
|
||||
SortTable
|
||||
version 2
|
||||
7th April 2007
|
||||
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
|
||||
|
||||
Instructions:
|
||||
Download this file
|
||||
Add <script src="sorttable.js"></script> to your HTML
|
||||
Add class="sortable" to any table you'd like to make sortable
|
||||
Click on the headers to sort
|
||||
|
||||
Thanks to many, many people for contributions and suggestions.
|
||||
Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
|
||||
This basically means: do what you want with it.
|
||||
|
||||
@note
|
||||
Documentation http://www.kryogenix.org/code/browser/sorttable/
|
||||
|
||||
Show the default order
|
||||
example:
|
||||
<th class=" sorttable_sorted_reverse">
|
||||
....<span id="sorttable_sortrevind"> ▴</span>
|
||||
<th class=" sorttable_sorted">
|
||||
....<span id="sorttable_sortfwdind"> ▾</span>
|
||||
|
||||
Sort on date
|
||||
<td sorttable_customkey="<?=$row_bank['b_date']?>"> // format YYYYMMDD
|
||||
|
||||
force as numeric (normally useless):
|
||||
<th class="sorttable_numeric">Part number</th>
|
||||
|
||||
To avoid the sort on the last row, use tfoot
|
||||
|
||||
*/
|
||||
|
||||
|
||||
var stIsIE = /*@cc_on!@*/false;
|
||||
|
||||
sorttable = {
|
||||
init: function() {
|
||||
// quit if this function has already been called
|
||||
if (arguments.callee.done) return;
|
||||
// flag this function so we don't do the same thing twice
|
||||
arguments.callee.done = true;
|
||||
// kill the timer
|
||||
if (_timer) clearInterval(_timer);
|
||||
|
||||
if (!document.createElement || !document.getElementsByTagName) return;
|
||||
|
||||
sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
|
||||
|
||||
forEach(document.getElementsByTagName('table'), function(table) {
|
||||
if (table.className.search(/\bsortable\b/) != -1) {
|
||||
sorttable.makeSortable(table);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
makeSortable: function(table) {
|
||||
if (table.getElementsByTagName('thead').length == 0) {
|
||||
// table doesn't have a tHead. Since it should have, create one and
|
||||
// put the first table row in it.
|
||||
the = document.createElement('thead');
|
||||
the.appendChild(table.rows[0]);
|
||||
table.insertBefore(the,table.firstChild);
|
||||
}
|
||||
// Safari doesn't support table.tHead, sigh
|
||||
if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
|
||||
|
||||
if (table.tHead.rows.length != 1) return; // can't cope with two header rows
|
||||
|
||||
// Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
|
||||
// "total" rows, for example). This is B&R, since what you're supposed
|
||||
// to do is put them in a tfoot. So, if there are sortbottom rows,
|
||||
// for backwards compatibility, move them to tfoot (creating it if needed).
|
||||
sortbottomrows = [];
|
||||
for (var i=0; i<table.rows.length; i++) {
|
||||
if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
|
||||
sortbottomrows[sortbottomrows.length] = table.rows[i];
|
||||
}
|
||||
}
|
||||
if (sortbottomrows) {
|
||||
if (table.tFoot == null) {
|
||||
// table doesn't have a tfoot. Create one.
|
||||
tfo = document.createElement('tfoot');
|
||||
table.appendChild(tfo);
|
||||
}
|
||||
for (var i=0; i<sortbottomrows.length; i++) {
|
||||
tfo.appendChild(sortbottomrows[i]);
|
||||
}
|
||||
delete sortbottomrows;
|
||||
}
|
||||
|
||||
// work through each column and calculate its type
|
||||
headrow = table.tHead.rows[0].cells;
|
||||
for (var i=0; i<headrow.length; i++) {
|
||||
// manually override the type with a sorttable_type attribute
|
||||
if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
|
||||
mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
|
||||
if (mtch) { override = mtch[1]; }
|
||||
if (mtch && typeof sorttable["sort_"+override] == 'function') {
|
||||
headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
|
||||
} else {
|
||||
headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
|
||||
}
|
||||
// make it clickable to sort
|
||||
headrow[i].sorttable_columnindex = i;
|
||||
headrow[i].sorttable_tbody = table.tBodies[0];
|
||||
dean_addEvent(headrow[i],"click", function(e) {
|
||||
|
||||
if (this.className.search(/\bsorttable_sorted\b/) != -1) {
|
||||
// if we're already sorted by this column, just
|
||||
// reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted',
|
||||
'sorttable_sorted_reverse');
|
||||
this.removeChild(document.getElementById('sorttable_sortfwdind'));
|
||||
sortrevind = document.createElement('span');
|
||||
sortrevind.id = "sorttable_sortrevind";
|
||||
sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴';
|
||||
this.appendChild(sortrevind);
|
||||
return;
|
||||
}
|
||||
if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
|
||||
// if we're already sorted by this column in reverse, just
|
||||
// re-reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted_reverse',
|
||||
'sorttable_sorted');
|
||||
this.removeChild(document.getElementById('sorttable_sortrevind'));
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
|
||||
this.appendChild(sortfwdind);
|
||||
return;
|
||||
}
|
||||
|
||||
// remove sorttable_sorted classes
|
||||
theadrow = this.parentNode;
|
||||
forEach(theadrow.childNodes, function(cell) {
|
||||
if (cell.nodeType == 1) { // an element
|
||||
cell.className = cell.className.replace('sorttable_sorted_reverse','');
|
||||
cell.className = cell.className.replace('sorttable_sorted','');
|
||||
}
|
||||
});
|
||||
sortfwdind = document.getElementById('sorttable_sortfwdind');
|
||||
if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
|
||||
sortrevind = document.getElementById('sorttable_sortrevind');
|
||||
if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
|
||||
|
||||
this.className += ' sorttable_sorted';
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾';
|
||||
this.appendChild(sortfwdind);
|
||||
|
||||
// build an array to sort. This is a Schwartzian transform thing,
|
||||
// i.e., we "decorate" each row with the actual sort key,
|
||||
// sort based on the sort keys, and then put the rows back in order
|
||||
// which is a lot faster because you only do getInnerText once per row
|
||||
row_array = [];
|
||||
col = this.sorttable_columnindex;
|
||||
rows = this.sorttable_tbody.rows;
|
||||
for (var j=0; j<rows.length; j++) {
|
||||
row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
|
||||
}
|
||||
/* If you want a stable sort, uncomment the following line */
|
||||
//sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
|
||||
/* and comment out this one */
|
||||
row_array.sort(this.sorttable_sortfunction);
|
||||
|
||||
tb = this.sorttable_tbody;
|
||||
for (var j=0; j<row_array.length; j++) {
|
||||
tb.appendChild(row_array[j][1]);
|
||||
}
|
||||
|
||||
delete row_array;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
guessType: function(table, column) {
|
||||
// guess the type of a column based on its first non-blank row
|
||||
sortfn = sorttable.sort_alpha;
|
||||
for (var i=0; i<table.tBodies[0].rows.length; i++) {
|
||||
text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
|
||||
if (text != '') {
|
||||
if (text.match(/^-?[<5B>$<24>]?[\d,.]+%?$/)) {
|
||||
return sorttable.sort_numeric;
|
||||
}
|
||||
// check for a date: dd/mm/yyyy or dd/mm/yy
|
||||
// can have / or . or - as separator
|
||||
// can be mm/dd as well
|
||||
possdate = text.match(sorttable.DATE_RE)
|
||||
if (possdate) {
|
||||
// looks like a date
|
||||
first = parseInt(possdate[1]);
|
||||
second = parseInt(possdate[2]);
|
||||
if (first > 12) {
|
||||
// definitely dd/mm
|
||||
return sorttable.sort_ddmm;
|
||||
} else if (second > 12) {
|
||||
return sorttable.sort_mmdd;
|
||||
} else {
|
||||
// looks like a date, but we can't tell which, so assume
|
||||
// that it's dd/mm (English imperialism!) and keep looking
|
||||
sortfn = sorttable.sort_ddmm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sortfn;
|
||||
},
|
||||
|
||||
getInnerText: function(node) {
|
||||
// gets the text we want to use for sorting for a cell.
|
||||
// strips leading and trailing whitespace.
|
||||
// this is *not* a generic getInnerText function; it's special to sorttable.
|
||||
// for example, you can override the cell text with a customkey attribute.
|
||||
// it also gets .value for <input> fields.
|
||||
|
||||
if (!node) return "";
|
||||
|
||||
hasInputs = (typeof node.getElementsByTagName == 'function') &&
|
||||
node.getElementsByTagName('input').length;
|
||||
|
||||
if (node.getAttribute("sorttable_customkey") != null) {
|
||||
return node.getAttribute("sorttable_customkey");
|
||||
}
|
||||
else if (typeof node.textContent != 'undefined' && !hasInputs) {
|
||||
return node.textContent.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else if (typeof node.innerText != 'undefined' && !hasInputs) {
|
||||
return node.innerText.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else if (typeof node.text != 'undefined' && !hasInputs) {
|
||||
return node.text.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
else {
|
||||
switch (node.nodeType) {
|
||||
case 3:
|
||||
if (node.nodeName.toLowerCase() == 'input') {
|
||||
return node.value.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
case 4:
|
||||
return node.nodeValue.replace(/^\s+|\s+$/g, '');
|
||||
break;
|
||||
case 1:
|
||||
case 11:
|
||||
var innerText = '';
|
||||
for (var i = 0; i < node.childNodes.length; i++) {
|
||||
innerText += sorttable.getInnerText(node.childNodes[i]);
|
||||
}
|
||||
return innerText.replace(/^\s+|\s+$/g, '');
|
||||
break;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
reverse: function(tbody) {
|
||||
// reverse the rows in a tbody
|
||||
newrows = [];
|
||||
for (var i=0; i<tbody.rows.length; i++) {
|
||||
newrows[newrows.length] = tbody.rows[i];
|
||||
}
|
||||
for (var i=newrows.length-1; i>=0; i--) {
|
||||
tbody.appendChild(newrows[i]);
|
||||
}
|
||||
delete newrows;
|
||||
},
|
||||
|
||||
/* sort functions
|
||||
each sort function takes two parameters, a and b
|
||||
you are comparing a[0] and b[0] */
|
||||
sort_numeric: function(a,b) {
|
||||
aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
|
||||
if (isNaN(aa)) aa = 0;
|
||||
bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
|
||||
if (isNaN(bb)) bb = 0;
|
||||
return aa-bb;
|
||||
},
|
||||
sort_alpha: function(a,b) {
|
||||
if (a[0]==b[0]) return 0;
|
||||
if (a[0]<b[0]) return -1;
|
||||
return 1;
|
||||
},
|
||||
sort_ddmm: function(a,b) {
|
||||
mtch = a[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; m = mtch[2]; d = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt1 = y+m+d;
|
||||
mtch = b[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; m = mtch[2]; d = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt2 = y+m+d;
|
||||
if (dt1==dt2) return 0;
|
||||
if (dt1<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
sort_mmdd: function(a,b) {
|
||||
mtch = a[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; d = mtch[2]; m = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt1 = y+m+d;
|
||||
mtch = b[0].match(sorttable.DATE_RE);
|
||||
y = mtch[3]; d = mtch[2]; m = mtch[1];
|
||||
if (m.length == 1) m = '0'+m;
|
||||
if (d.length == 1) d = '0'+d;
|
||||
dt2 = y+m+d;
|
||||
if (dt1==dt2) return 0;
|
||||
if (dt1<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
|
||||
shaker_sort: function(list, comp_func) {
|
||||
// A stable sort function to allow multi-level sorting of data
|
||||
// see: http://en.wikipedia.org/wiki/Cocktail_sort
|
||||
// thanks to Joseph Nahmias
|
||||
var b = 0;
|
||||
var t = list.length - 1;
|
||||
var swap = true;
|
||||
|
||||
while(swap) {
|
||||
swap = false;
|
||||
for(var i = b; i < t; ++i) {
|
||||
if ( comp_func(list[i], list[i+1]) > 0 ) {
|
||||
var q = list[i]; list[i] = list[i+1]; list[i+1] = q;
|
||||
swap = true;
|
||||
}
|
||||
} // for
|
||||
t--;
|
||||
|
||||
if (!swap) break;
|
||||
|
||||
for(var i = t; i > b; --i) {
|
||||
if ( comp_func(list[i], list[i-1]) < 0 ) {
|
||||
var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
|
||||
swap = true;
|
||||
}
|
||||
} // for
|
||||
b++;
|
||||
|
||||
} // while(swap)
|
||||
}
|
||||
}
|
||||
|
||||
/* ******************************************************************
|
||||
Supporting functions: bundled here to avoid depending on a library
|
||||
****************************************************************** */
|
||||
|
||||
// Dean Edwards/Matthias Miller/John Resig
|
||||
|
||||
/* for Mozilla/Opera9 */
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("DOMContentLoaded", sorttable.init, false);
|
||||
}
|
||||
|
||||
/* for Internet Explorer */
|
||||
/*@cc_on @*/
|
||||
/*@if (@_win32)
|
||||
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
|
||||
var script = document.getElementById("__ie_onload");
|
||||
script.onreadystatechange = function() {
|
||||
if (this.readyState == "complete") {
|
||||
sorttable.init(); // call the onload handler
|
||||
}
|
||||
};
|
||||
/*@end @*/
|
||||
|
||||
/* for Safari */
|
||||
if (/WebKit/i.test(navigator.userAgent)) { // sniff
|
||||
var _timer = setInterval(function() {
|
||||
if (/loaded|complete/.test(document.readyState)) {
|
||||
sorttable.init(); // call the onload handler
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
|
||||
/* for other browsers */
|
||||
window.onload = sorttable.init;
|
||||
|
||||
// written by Dean Edwards, 2005
|
||||
// with input from Tino Zijdel, Matthias Miller, Diego Perini
|
||||
|
||||
// http://dean.edwards.name/weblog/2005/10/add-event/
|
||||
|
||||
function dean_addEvent(element, type, handler) {
|
||||
if (element.addEventListener) {
|
||||
element.addEventListener(type, handler, false);
|
||||
} else {
|
||||
// assign each event handler a unique ID
|
||||
if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
|
||||
// create a hash table of event types for the element
|
||||
if (!element.events) element.events = {};
|
||||
// create a hash table of event handlers for each element/event pair
|
||||
var handlers = element.events[type];
|
||||
if (!handlers) {
|
||||
handlers = element.events[type] = {};
|
||||
// store the existing event handler (if there is one)
|
||||
if (element["on" + type]) {
|
||||
handlers[0] = element["on" + type];
|
||||
}
|
||||
}
|
||||
// store the event handler in the hash table
|
||||
handlers[handler.$$guid] = handler;
|
||||
// assign a global event handler to do all the work
|
||||
element["on" + type] = handleEvent;
|
||||
}
|
||||
};
|
||||
// a counter used to create unique IDs
|
||||
dean_addEvent.guid = 1;
|
||||
|
||||
function removeEvent(element, type, handler) {
|
||||
if (element.removeEventListener) {
|
||||
element.removeEventListener(type, handler, false);
|
||||
} else {
|
||||
// delete the event handler from the hash table
|
||||
if (element.events && element.events[type]) {
|
||||
delete element.events[type][handler.$$guid];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function handleEvent(event) {
|
||||
var returnValue = true;
|
||||
// grab the event object (IE uses a global event object)
|
||||
event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
|
||||
// get a reference to the hash table of event handlers
|
||||
var handlers = this.events[event.type];
|
||||
// execute each event handler
|
||||
for (var i in handlers) {
|
||||
this.$$handleEvent = handlers[i];
|
||||
if (this.$$handleEvent(event) === false) {
|
||||
returnValue = false;
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
function fixEvent(event) {
|
||||
// add W3C standard event methods
|
||||
event.preventDefault = fixEvent.preventDefault;
|
||||
event.stopPropagation = fixEvent.stopPropagation;
|
||||
return event;
|
||||
};
|
||||
fixEvent.preventDefault = function() {
|
||||
this.returnValue = false;
|
||||
};
|
||||
fixEvent.stopPropagation = function() {
|
||||
this.cancelBubble = true;
|
||||
}
|
||||
|
||||
// Dean's forEach: http://dean.edwards.name/base/forEach.js
|
||||
/*
|
||||
forEach, version 1.0
|
||||
Copyright 2006, Dean Edwards
|
||||
License: http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
// array-like enumeration
|
||||
if (!Array.forEach) { // mozilla already supports this
|
||||
Array.forEach = function(array, block, context) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
block.call(context, array[i], i, array);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// generic enumeration
|
||||
Function.prototype.forEach = function(object, block, context) {
|
||||
for (var key in object) {
|
||||
if (typeof this.prototype[key] == "undefined") {
|
||||
block.call(context, object[key], key, object);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// character enumeration
|
||||
String.forEach = function(string, block, context) {
|
||||
Array.forEach(string.split(""), function(chr, index) {
|
||||
block.call(context, chr, index, string);
|
||||
});
|
||||
};
|
||||
|
||||
// globally resolve forEach enumeration
|
||||
var forEach = function(object, block, context) {
|
||||
if (object) {
|
||||
var resolve = Object; // default
|
||||
if (object instanceof Function) {
|
||||
// functions have a "length" property
|
||||
resolve = Function;
|
||||
} else if (object.forEach instanceof Function) {
|
||||
// the object implements a custom forEach method so use that
|
||||
object.forEach(block, context);
|
||||
return;
|
||||
} else if (typeof object == "string") {
|
||||
// the object is a string
|
||||
resolve = String;
|
||||
} else if (typeof object.length == "number") {
|
||||
// the object is array-like
|
||||
resolve = Array;
|
||||
}
|
||||
resolve.forEach(object, block, context);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
/* $Revision$ */
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
// Verify parameters
|
||||
/* ! \file
|
||||
/** \file
|
||||
* \brief retrieve a document
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ BODY {
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
table.table_large, table.result ,table.resultfooter {
|
||||
table.sortable, table.table_large, table.result ,table.resultfooter {
|
||||
color:blue;
|
||||
/* border:blue solid 1px; */
|
||||
width:100%;
|
||||
|
|
@ -27,7 +27,7 @@ table.resultfooter tfoot {
|
|||
|
||||
|
||||
}
|
||||
table.table_large th,table.result th {
|
||||
table.sortable th, table.table_large th,table.result th {
|
||||
font-weight:bold;
|
||||
font-family:verdana,helvetica,sans-serif;
|
||||
border-bottom:1px solid blue;
|
||||
|
|
@ -104,11 +104,6 @@ h2.error {
|
|||
font-size:14px;
|
||||
}
|
||||
|
||||
h1.title {
|
||||
color: blue;
|
||||
font-size:25px;
|
||||
}
|
||||
|
||||
div.u_tmenu {
|
||||
margin-top:0px;
|
||||
width:100%;
|
||||
|
|
@ -555,7 +550,7 @@ a.document:hover {
|
|||
margin:1px;
|
||||
background-color: orange;
|
||||
}
|
||||
legend {
|
||||
h1.legend, legend {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
font-size: 120% ;
|
||||
|
|
@ -945,14 +940,14 @@ div#search_form
|
|||
position:absolute;
|
||||
border:1px solid black;
|
||||
top:15%;left:100;
|
||||
margin-left:25%
|
||||
z-index:2;
|
||||
margin-left:25%;
|
||||
z-index:2;
|
||||
width:50%;
|
||||
display:none;
|
||||
background-color:#e4e7ed;
|
||||
}
|
||||
|
||||
table.table_large td, table.result td
|
||||
table.sortable td,table.table_large td, table.result td
|
||||
{
|
||||
padding-left:5px;
|
||||
padding-right:5px;
|
||||
|
|
@ -1117,4 +1112,40 @@ a.nav:hover,div.content a.nav:hover,div.redcontent a.nav:hover {
|
|||
div.foldercontent {
|
||||
width:80%;
|
||||
margin-left:10%;
|
||||
}
|
||||
}
|
||||
h1.title {
|
||||
color: #046fff;
|
||||
font-size:24px;
|
||||
font-style: italic;
|
||||
}
|
||||
h2.title {
|
||||
color: #046fff;
|
||||
font-size:16px;
|
||||
font-style: italic;
|
||||
margin-left: 15px;
|
||||
}
|
||||
h3.title {
|
||||
color: #046fff;
|
||||
font-size:14px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
h4.title {
|
||||
color: #046fff;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
h5.title {
|
||||
color: #046fff;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: none;
|
||||
font-style: italic;
|
||||
}
|
||||
div.myfieldset
|
||||
{
|
||||
margin-top: 5px;
|
||||
margin-left:5px;
|
||||
margin-right: 5px;
|
||||
border:lightgrey 2px groove;
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ BODY {
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
table.table_large, table.result ,table.resultfooter {
|
||||
table.table_large, table.result ,table.resultfooter,table.sortable {
|
||||
color:blue;
|
||||
/* border:blue solid 1px; */
|
||||
width:100%;
|
||||
|
|
@ -27,7 +27,7 @@ table.resultfooter tfoot {
|
|||
|
||||
|
||||
}
|
||||
table.table_large th,table.result th {
|
||||
table.table_large th,table.result th,table.sortable th {
|
||||
font-weight:bold;
|
||||
font-family:verdana,helvetica,sans-serif;
|
||||
border-bottom:1px solid blue;
|
||||
|
|
@ -104,11 +104,6 @@ h2.error {
|
|||
font-size:16px;
|
||||
}
|
||||
|
||||
h1.title {
|
||||
color: blue;
|
||||
font-size:27px;
|
||||
}
|
||||
|
||||
div.u_tmenu {
|
||||
margin-top:0px;
|
||||
width:100%;
|
||||
|
|
@ -555,7 +550,7 @@ a.document:hover {
|
|||
margin:1px;
|
||||
background-color: orange;
|
||||
}
|
||||
legend {
|
||||
h1.legend,legend {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
font-size: 120% ;
|
||||
|
|
@ -947,7 +942,7 @@ div#search_form
|
|||
background-color:#e4e7ed;
|
||||
}
|
||||
|
||||
table.table_large td, table.result td
|
||||
table.table_large td, table.result td,table.sortable td
|
||||
{
|
||||
padding-left:5px;
|
||||
padding-right:5px;
|
||||
|
|
@ -1104,4 +1099,40 @@ a.nav:hover,div.content a.nav:hover,div.redcontent a.nav:hover {
|
|||
display:inline;
|
||||
float:left;
|
||||
top:0px;
|
||||
}
|
||||
h1.title {
|
||||
color: #046fff;
|
||||
font-size:30px;
|
||||
font-style: italic;
|
||||
}
|
||||
h2.title {
|
||||
color: #046fff;
|
||||
font-size:24px;
|
||||
font-style: italic;
|
||||
margin-left: 15px;
|
||||
}
|
||||
h3.title {
|
||||
color: #046fff;
|
||||
font-size:16px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
h4.title {
|
||||
color: blue;
|
||||
font-size:14px;
|
||||
margin-left: 45px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
h5.title {
|
||||
color: blue;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: none;
|
||||
font-style: italic;
|
||||
}
|
||||
div.myfieldset
|
||||
{
|
||||
margin-top: 5px;
|
||||
margin-left:5px;
|
||||
margin-right: 5px;
|
||||
border:lightgrey 2px groove;
|
||||
}
|
||||
|
|
@ -9,11 +9,12 @@ BODY {
|
|||
color:blue;
|
||||
}
|
||||
.notice {
|
||||
background: white;
|
||||
color:red;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
table.table_large, table.result ,table.resultfooter {
|
||||
table.sortable, table.table_large, table.result ,table.resultfooter {
|
||||
color:blue;
|
||||
/* border:blue solid 1px; */
|
||||
width:100%;
|
||||
|
|
@ -24,10 +25,9 @@ table.table_large, table.result ,table.resultfooter {
|
|||
table.resultfooter tfoot {
|
||||
font-size:110%;
|
||||
font-weight: bold;
|
||||
|
||||
|
||||
}
|
||||
table.table_large th,table.result th {
|
||||
|
||||
table.table_large th,table.result th ,table.sortable th{
|
||||
font-weight:bold;
|
||||
font-family:verdana,helvetica,sans-serif;
|
||||
border-bottom:1px solid blue;
|
||||
|
|
@ -86,7 +86,7 @@ table h2.info
|
|||
h3.info {
|
||||
background:#879ed4;
|
||||
color:white;
|
||||
font-size:14px;
|
||||
font-size:12px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
|
|
@ -104,11 +104,6 @@ h2.error {
|
|||
font-size:14px;
|
||||
}
|
||||
|
||||
h1.title {
|
||||
color: blue;
|
||||
font-size:25px;
|
||||
}
|
||||
|
||||
div.u_tmenu {
|
||||
margin-top:0px;
|
||||
width:100%;
|
||||
|
|
@ -550,7 +545,7 @@ a.document:hover {
|
|||
margin:1px;
|
||||
background-color: orange;
|
||||
}
|
||||
legend {
|
||||
h1.legend, legend {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
font-size: 120% ;
|
||||
|
|
@ -947,7 +942,7 @@ div#search_form
|
|||
background-color:#e4e7ed;
|
||||
}
|
||||
|
||||
table.table_large td, table.result td
|
||||
table.table_large td, table.result td,table.sortable td
|
||||
{
|
||||
padding-left:5px;
|
||||
padding-right:5px;
|
||||
|
|
@ -1108,4 +1103,41 @@ a.nav:hover,div.content a.nav:hover,div.redcontent a.nav:hover {
|
|||
}
|
||||
div.foldercontent {
|
||||
padding:20px 30px 0px 40px;
|
||||
}
|
||||
}
|
||||
|
||||
h1.title {
|
||||
color: #046fff;
|
||||
font-size:24px;
|
||||
font-style: italic;
|
||||
}
|
||||
h2.title {
|
||||
color: #046fff;
|
||||
font-size:16px;
|
||||
font-style: italic;
|
||||
margin-left: 15px;
|
||||
}
|
||||
h3.title {
|
||||
color: #046fff;
|
||||
font-size:14px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
h4.title {
|
||||
color: #046fff;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
h5.title {
|
||||
color: #046fff;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: none;
|
||||
font-style: italic;
|
||||
}
|
||||
div.myfieldset
|
||||
{
|
||||
margin-top: 5px;
|
||||
margin-left:5px;
|
||||
margin-right: 5px;
|
||||
border:lightgrey 2px groove;
|
||||
}
|
||||
|
|
@ -1,13 +1,15 @@
|
|||
body {
|
||||
font-size:7px;
|
||||
font-size:8px;
|
||||
}
|
||||
select ,.input_text{
|
||||
input, select ,.input_text{
|
||||
font-size:8px;
|
||||
border:1px solid #FFFFFF;
|
||||
}
|
||||
form {
|
||||
display:none;
|
||||
}
|
||||
.print {
|
||||
font-size:8px;
|
||||
display: block;
|
||||
}
|
||||
.noprint {
|
||||
|
|
@ -30,6 +32,11 @@ table.result th {
|
|||
font-size:7px;
|
||||
font-family:sans-serif;
|
||||
}
|
||||
h3,h4 {
|
||||
font-size:10px;
|
||||
text-decoration: underline;
|
||||
font-family:sans-serif;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size:12px;
|
||||
|
|
@ -42,7 +49,7 @@ div.info {
|
|||
.content {
|
||||
font-size:7px;
|
||||
}
|
||||
h1.content,h1,h2.info {
|
||||
h1.content,h1,h2.info,legend {
|
||||
font-size:14px;
|
||||
font-weight:bold;
|
||||
font-family:sans-serif;
|
||||
|
|
@ -244,6 +251,39 @@ a.detail:hover
|
|||
}
|
||||
.num {
|
||||
text-align:right;
|
||||
font-size:8px;
|
||||
}
|
||||
h1.title {
|
||||
font-size:24px;
|
||||
font-style: italic;
|
||||
}
|
||||
h2.title {
|
||||
font-size:16px;
|
||||
font-style: italic;
|
||||
margin-left: 15px;
|
||||
}
|
||||
h3.title {
|
||||
font-size:14px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
h4.title {
|
||||
color: blue;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
h5.title {
|
||||
color: blue;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: none;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* </style> */
|
||||
div.myfieldset
|
||||
{
|
||||
margin-top: 5px;
|
||||
margin-left:5px;
|
||||
margin-right: 5px;
|
||||
border:lightgrey 2px groove;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
span.tmenu {
|
||||
padding-left:20px;
|
||||
padding-right:20px;
|
||||
padding-left:20px;
|
||||
padding-right:20px;
|
||||
border:solid 1px blue;
|
||||
background-color: #6699dd ;
|
||||
}
|
||||
|
|
@ -14,8 +14,7 @@ span.tmenu {
|
|||
width:150px;
|
||||
}
|
||||
a.tmenu:link {
|
||||
background-color: #6699dd ;
|
||||
// color:#683af2;
|
||||
background-color: #6699dd ;
|
||||
color:white;
|
||||
}
|
||||
a.tmenu:visited {
|
||||
|
|
@ -47,7 +46,7 @@ div.dcontent {
|
|||
}
|
||||
div.ddownload {
|
||||
color:white;
|
||||
background-color:#6699dd ;
|
||||
background-color:#6699dd ;
|
||||
}
|
||||
div.content {
|
||||
margin-left:10%;
|
||||
|
|
@ -60,7 +59,7 @@ H2 {
|
|||
color:blue;
|
||||
background-color:white;
|
||||
}
|
||||
table.result td
|
||||
table.sortable td,table.result td
|
||||
{
|
||||
padding-left:5px;
|
||||
padding-right:5px;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ BODY {
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
table.table_large, table.result ,table.resultfooter {
|
||||
table.sortable, table.table_large, table.result ,table.resultfooter {
|
||||
color:blue;
|
||||
/* border:blue solid 1px; */
|
||||
width:100%;
|
||||
|
|
@ -27,7 +27,7 @@ table.resultfooter tfoot {
|
|||
|
||||
|
||||
}
|
||||
table.table_large th,table.result th {
|
||||
table.sortable th, table.table_large th,table.result th {
|
||||
font-weight:bold;
|
||||
font-family:verdana,helvetica,sans-serif;
|
||||
border-bottom:1px solid blue;
|
||||
|
|
@ -99,10 +99,6 @@ h2.error {
|
|||
font-size:14px;
|
||||
}
|
||||
|
||||
h1.title {
|
||||
color: blue;
|
||||
font-size:25px;
|
||||
}
|
||||
|
||||
div.u_tmenu {
|
||||
margin-top:0px;
|
||||
|
|
@ -539,6 +535,7 @@ a.document:hover {
|
|||
.input_text_ro {
|
||||
border:solid 1px blue;
|
||||
background:#EDEDED;
|
||||
color:blue;
|
||||
margin:1px;
|
||||
}
|
||||
.input_text {
|
||||
|
|
@ -550,10 +547,10 @@ a.document:hover {
|
|||
margin:1px;
|
||||
background-color: orange;
|
||||
}
|
||||
legend {
|
||||
h1.legend, legend {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
font-size: 120% ;
|
||||
font-size: 110% ;
|
||||
|
||||
}
|
||||
fieldset fieldset legend {
|
||||
|
|
@ -565,7 +562,6 @@ border: 1px solid blue;
|
|||
margin:2px;
|
||||
background-color:white;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -880,7 +876,7 @@ h2.gest_name {
|
|||
border-top:1px solid #b4bbc2;
|
||||
border-right:1px solid #b4bbc2;
|
||||
padding: 5px;
|
||||
width: 30%;
|
||||
width: 40%;
|
||||
}
|
||||
body.op_detail_frame,div.op_detail_frame {
|
||||
background-color:#e4e7ed;
|
||||
|
|
@ -946,7 +942,7 @@ div#search_form
|
|||
background-color:#e4e7ed;
|
||||
}
|
||||
|
||||
table.table_large td, table.result td
|
||||
table.sortable td, table.table_large td, table.result td
|
||||
{
|
||||
padding-left:5px;
|
||||
padding-right:5px;
|
||||
|
|
@ -1107,3 +1103,41 @@ a.nav:hover,div.content a.nav:hover,div.redcontent a.nav:hover {
|
|||
div.foldercontent {
|
||||
padding:20px 30px 0px 40px;
|
||||
}
|
||||
|
||||
h1.title {
|
||||
color: blue;
|
||||
font-size:18px;
|
||||
font-style: italic;
|
||||
}
|
||||
h2.title {
|
||||
color: blue;
|
||||
font-size:14px;
|
||||
font-weight:bold;
|
||||
font-style: italic;
|
||||
margin-left: 15px;
|
||||
}
|
||||
h3.title {
|
||||
color: blue;
|
||||
font-size:14px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
h4.title {
|
||||
color: blue;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
h5.title {
|
||||
color: blue;
|
||||
font-size:12px;
|
||||
margin-left: 45px;
|
||||
text-decoration: none;
|
||||
font-style: italic;
|
||||
}
|
||||
div.myfieldset
|
||||
{
|
||||
margin-top: 5px;
|
||||
margin-left:5px;
|
||||
margin-right: 5px;
|
||||
border:lightgrey 2px groove;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ include_once("constant.php");
|
|||
require_once('class_database.php');
|
||||
require_once('class_periode.php');
|
||||
|
||||
/* !\brief to protect again bad characters which can lead to a cross scripting attack
|
||||
/**\brief to protect again bad characters which can lead to a cross scripting attack
|
||||
the string to be diplayed must be protected
|
||||
*/
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ function h1($p_string, $p_class)
|
|||
{
|
||||
return '<h1 ' . $p_class . '>' . htmlspecialchars($p_string) . '</h1>';
|
||||
}
|
||||
/* !\brief surround the string with td
|
||||
/**\brief surround the string with td
|
||||
* \param $p_string string to surround by TD
|
||||
* \param $p_extra extra info (class, style, javascript...)
|
||||
* \return string surrounded by td
|
||||
|
|
@ -87,7 +87,7 @@ function tr($p_string, $p_extra='')
|
|||
return '<tr ' . $p_extra . '>' . $p_string . '</tr>';
|
||||
}
|
||||
|
||||
/* !\brief escape correctly php string to javascript */
|
||||
/**\brief escape correctly php string to javascript */
|
||||
|
||||
function j($p_string)
|
||||
{
|
||||
|
|
@ -133,7 +133,7 @@ function nbm($p_number)
|
|||
return $r;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief log error into the /tmp/phpcompta_error.log it doesn't work on windows
|
||||
*
|
||||
* \param p_log message
|
||||
|
|
@ -155,7 +155,7 @@ function echo_error($p_log, $p_line="", $p_message="")
|
|||
}
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Compare 2 dates
|
||||
* \param p_date
|
||||
* \param p_date_oth
|
||||
|
|
@ -230,7 +230,7 @@ function isDate($p_date)
|
|||
if (sizeof($l_date) != 3)
|
||||
return null;
|
||||
|
||||
if ($l_date[2] > 2050)
|
||||
if ($l_date[2] > COMPTA_MAX_YEAR || $l_date[2] < COMPTA_MIN_YEAR)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
@ -243,7 +243,7 @@ function isDate($p_date)
|
|||
return $p_date;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Default page header for each page
|
||||
*
|
||||
* \param p_theme default theme
|
||||
|
|
@ -317,7 +317,7 @@ function html_page_start($p_theme="", $p_script="", $p_script2="")
|
|||
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Minimal page header for each page, used for small popup window
|
||||
*
|
||||
* \param p_theme default theme
|
||||
|
|
@ -372,7 +372,7 @@ function html_min_page_start($p_theme="", $p_script="", $p_script2="")
|
|||
}
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief end tag
|
||||
*
|
||||
*/
|
||||
|
|
@ -383,7 +383,7 @@ function html_page_stop()
|
|||
echo "</HTML>";
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Echo no access and stop
|
||||
*
|
||||
* \return nothing
|
||||
|
|
@ -413,7 +413,7 @@ function FormatString($p_string)
|
|||
{
|
||||
return sql_string($p_string);
|
||||
}
|
||||
/* !
|
||||
/**
|
||||
* \brief Fix the problem with the quote char for the database
|
||||
*
|
||||
* \param $p_string
|
||||
|
|
@ -430,7 +430,7 @@ function sql_string($p_string)
|
|||
return $p_string;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
/* \brief store the string which print
|
||||
* the content of p_array in a table
|
||||
* used to display the menu
|
||||
|
|
@ -499,7 +499,7 @@ function ShowItem($p_array, $p_dir='V', $class="mtitle", $class_ref="mtitle", $d
|
|||
return $ret;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief warns
|
||||
*
|
||||
* \param p_string error message
|
||||
|
|
@ -514,7 +514,7 @@ function echo_warning($p_string)
|
|||
echo '<H2 class="error">' . $p_string . "</H2>";
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Show the periode which found thanks its id
|
||||
*
|
||||
*
|
||||
|
|
@ -534,7 +534,7 @@ function getPeriodeName($p_cn, $p_id, $pos='p_start')
|
|||
return $ret;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Return the period corresponding to the
|
||||
* date
|
||||
*
|
||||
|
|
@ -554,7 +554,7 @@ function getPeriodeFromMonth($p_cn, $p_date)
|
|||
return $R;
|
||||
}
|
||||
|
||||
/* !\brief Decode the html for the widegt richtext and remove newline
|
||||
/**\brief Decode the html for the widegt richtext and remove newline
|
||||
* \param $p_html string to decode
|
||||
* \return the html code without new line
|
||||
*/
|
||||
|
|
@ -567,7 +567,7 @@ function Decode($p_html)
|
|||
return $p_html;
|
||||
}
|
||||
|
||||
/* !\brief Create the condition to filter on the j_tech_per
|
||||
/**\brief Create the condition to filter on the j_tech_per
|
||||
* thanks a from and to date.
|
||||
* \param $p_cn database conx
|
||||
* \param $p_from start date (date)
|
||||
|
|
@ -611,7 +611,7 @@ function sql_filter_per($p_cn, $p_from, $p_to, $p_form='p_id', $p_field='jr_tech
|
|||
return $periode;
|
||||
}
|
||||
|
||||
/* !\brief alert in javascript
|
||||
/**\brief alert in javascript
|
||||
* \param $p_msg is the message
|
||||
* \param $buffer if false, echo directly and execute the javascript, if $buffer is true, the alert javascript
|
||||
* is in the return string
|
||||
|
|
@ -853,27 +853,53 @@ function find_default_module()
|
|||
p_type_display='M' and
|
||||
user_name=$1 and pm_default=1", array($g_user->login));
|
||||
|
||||
/*
|
||||
* Try to find the smallest order for module
|
||||
*/
|
||||
if (empty($default_module))
|
||||
{
|
||||
$default_module = $cn->get_array("select me_code
|
||||
from profile_menu join profile_user using (p_id)
|
||||
where
|
||||
user_name=$1 and p_order=(select min(p_order) from profile_menu join profile_user using (p_id)
|
||||
where user_name=$2) limit 1", array($g_user->login, $g_user->login));
|
||||
/*
|
||||
* if nothing found, there is no profile for this user => exit
|
||||
*/
|
||||
from profile_menu join profile_user using (p_id)
|
||||
where
|
||||
p_type_display='M' and
|
||||
user_name=$1 order by p_order limit 1", array($g_user->login));
|
||||
|
||||
// if no default try to find the default menu
|
||||
if ( empty ($default_module))
|
||||
{
|
||||
echo_warning(_("Utilisateur n'a pas de profile"));
|
||||
exit();
|
||||
$default_module = $cn->get_array("select me_code
|
||||
from profile_menu join profile_user using (p_id)
|
||||
where
|
||||
p_type_display='E' and
|
||||
user_name=$1 and pm_default=1 ", array($g_user->login));
|
||||
/*
|
||||
* Try to find a default menu by order
|
||||
*/
|
||||
if (empty ($default_module))
|
||||
{
|
||||
$default_module = $cn->get_array("select me_code
|
||||
from profile_menu join profile_user using (p_id)
|
||||
where
|
||||
user_name=$1 and p_order=(select min(p_order) from profile_menu join profile_user using (p_id)
|
||||
where user_name=$2) limit 1", array($g_user->login, $g_user->login));
|
||||
}
|
||||
|
||||
/*
|
||||
* if nothing found, there is no profile for this user => exit
|
||||
*/
|
||||
if (empty ($default_module))
|
||||
{
|
||||
echo_warning(_("Utilisateur n'a pas de profile"));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
return $default_module[0]['me_code'];
|
||||
}
|
||||
|
||||
if (count($default_module) > 1)
|
||||
{
|
||||
echo_error(_("Plusieurs modules sont le module par défaut"), __LINE__, __FILE__);
|
||||
// return the first module found
|
||||
return $default_module[0]['me_code'];
|
||||
}
|
||||
elseif (count($default_module) == 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
* \brief this file is common to suivi client, suivi fournisseur, suivi
|
||||
* administration.
|
||||
* The needed variables are
|
||||
|
|
@ -84,19 +84,16 @@ if ($sub_action == "update")
|
|||
{
|
||||
$act2 = new Follow_Up($cn);
|
||||
$act2->fromArray($_POST);
|
||||
$sub_action = "detail";
|
||||
put_global(array(array('key' => "sa", "value" => "detail")));
|
||||
if ($g_user->can_write_action($act2->ag_id))
|
||||
{
|
||||
$act2->Update();
|
||||
}
|
||||
else
|
||||
if ($g_user->can_write_action($act2->ag_id) == false )
|
||||
{
|
||||
echo '<div class="redcontent">';
|
||||
echo '<h2 class="error"> Cette action ne vous est pas autorisée Contactez votre responsable</h2>';
|
||||
echo '</div>';
|
||||
exit();
|
||||
}
|
||||
$sub_action = "detail";
|
||||
put_global(array(array('key' => "sa", "value" => "detail")));
|
||||
$act2->Update() ;
|
||||
}
|
||||
//----------------------------------------------------------------------
|
||||
// Add a related action
|
||||
|
|
@ -194,7 +191,7 @@ if ($sub_action == "list")
|
|||
Follow_Up::show_action_list($cn, $base);
|
||||
// Add a button to export to Csv
|
||||
echo '<form method="GET" ACTION="export.php">';
|
||||
echo HtmlInput::request_to_hidden(array("remind_date_end","remind_date","sag_ref", "remind_date","only_internal", "state", "gDossier", "qcode", "start_date", "end_date", "ag_id", "ag_dest_query",
|
||||
echo HtmlInput::request_to_hidden(array("closed_action","remind_date_end","remind_date","sag_ref", "remind_date","only_internal", "state", "gDossier", "qcode", "start_date", "end_date", "ag_id", "ag_dest_query",
|
||||
"tdoc", "query"));
|
||||
echo HtmlInput::hidden("act", "CSV:ActionGestion");
|
||||
echo HtmlInput::submit("follow_up_csv", "Export CSV");
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
require_once('class_ipopup.php');
|
||||
global $g_user;
|
||||
$retour=HtmlInput::button_anchor(_('Retour liste'),
|
||||
HtmlInput::request_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","query","tdoc","date_start","date_end","hsstate")));
|
||||
HtmlInput::request_to_string(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","query","tdoc","date_start","date_end","hsstate")));
|
||||
//-----------------------------------------------------
|
||||
// Follow_Up
|
||||
//-----------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
* @file
|
||||
* @brief show the form to add a menu
|
||||
*/
|
||||
$type=$_GET['type'];
|
||||
if ( $type=='me')
|
||||
{
|
||||
$ame_code_dep=$cn->make_array("
|
||||
select me_code,me_code||' '||me_menu||' '||coalesce(me_description,'') from
|
||||
menu_ref
|
||||
|
|
@ -38,10 +41,20 @@ $ame_code_dep=$cn->make_array("
|
|||
order by 1
|
||||
",1);
|
||||
$ame_code=$cn->make_array("
|
||||
select me_code,me_code||' '||me_menu||' '||coalesce(me_description,'') from
|
||||
select me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,'')
|
||||
||'('|| case when me_type='SP' then 'Special'
|
||||
when me_type='PR' then 'Impression'
|
||||
when me_type='PL' then 'Plugin'
|
||||
when me_type='ME' and me_file is null and me_javascript is null and me_url is null then 'Module - Menu principal'
|
||||
when me_type='ME' then 'Menu'
|
||||
else
|
||||
me_type
|
||||
end||')'
|
||||
from
|
||||
menu_ref
|
||||
order by 1
|
||||
");
|
||||
|
||||
$p_order=new INum("p_order","10");
|
||||
$atype=$cn->make_array("select pm_type,pm_desc from profile_menu_type order by 1");
|
||||
|
||||
|
|
@ -67,7 +80,7 @@ echo HtmlInput::title_box("Nouveau menu", $ctl);
|
|||
<td><?=$me_code->input()?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dépendant de </td>
|
||||
<td>Dépendant de <?=HtmlInput::infobulle(20)?></td>
|
||||
<td><?=$me_code_dep->input()?></td>
|
||||
</tr>
|
||||
|
||||
|
|
@ -87,4 +100,47 @@ echo HtmlInput::title_box("Nouveau menu", $ctl);
|
|||
<?
|
||||
echo HtmlInput::submit('add_menu',"Valider");
|
||||
echo '</form>';
|
||||
}
|
||||
if ($type=='pr')
|
||||
{
|
||||
|
||||
$ame_code=$cn->make_array("
|
||||
select me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,'')
|
||||
from
|
||||
menu_ref
|
||||
where me_type='PR'
|
||||
and me_code not in (select me_code from profile_menu where p_id=".sql_string($p_id).")
|
||||
order by 1
|
||||
");
|
||||
|
||||
$me_code=new ISelect('me_code');
|
||||
$me_code->value=$ame_code;
|
||||
|
||||
echo HtmlInput::title_box("Nouveau menu", $ctl);
|
||||
if (count($ame_code)==0)
|
||||
{
|
||||
echo h2("Aucune impression disponible à ajouter",'class="notice"');
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<form method="POST" onsubmit="return confirm('Vous confirmez ?')">
|
||||
<?
|
||||
echo HtmlInput::hidden('tab','profile_print_div');
|
||||
?>
|
||||
<?=HtmlInput::hidden('p_id',$p_id)?>
|
||||
<?=HtmlInput::hidden('p_order',10)?>
|
||||
<?=HtmlInput::hidden('me_code_dep','')?>
|
||||
<?=HtmlInput::hidden('p_type','PR')?>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Code</td>
|
||||
<td><?=$me_code->input()?></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<?
|
||||
echo HtmlInput::submit('add_impress',"Valider");
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
105
include/ajax_boxcard_search.php
Normal file
105
include/ajax_boxcard_search.php
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of PhpCompta.
|
||||
*
|
||||
* PhpCompta 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.
|
||||
*
|
||||
* PhpCompta 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 PhpCompta; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
/* $Revision$ */
|
||||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief show result card search
|
||||
*
|
||||
*/
|
||||
$sql="
|
||||
select vw.f_id,vw_name,vw_first_name,vw_description,fd_label,quick_code,pc.ad_value as poste,tva_num
|
||||
from vw_fiche_attr as vw
|
||||
join fiche_def as fd on (vw.fd_id=fd.fd_id)
|
||||
left join (select f_id,ad_value from fiche_detail where ad_id=5) as pc on (pc.f_id=vw.f_id)
|
||||
where
|
||||
vw_name ~* $1
|
||||
or vw_first_name ~* $1
|
||||
or vw_description ~* $1
|
||||
or tva_num ~* $1
|
||||
or pc.ad_value like $1||'%'
|
||||
or quick_code like upper($1||'%')
|
||||
order by 2
|
||||
";
|
||||
$array=$cn->get_array($sql,array($_GET['card']));
|
||||
echo HtmlInput::title_box("Résultat recherche", "boxsearch_card_div");
|
||||
$max=(count($array)>MAX_CARD_SEARCH)?MAX_CARD_SEARCH:count($array);
|
||||
?>
|
||||
<? if (count($array)>MAX_CARD_SEARCH ): ?>
|
||||
<h2 class="notice">Résultat limité à <?=MAX_CARD_SEARCH?>, nombre de fiches trouvées : <?=count($array)?> </h2>
|
||||
|
||||
<? endif?>
|
||||
<table class="sortable">
|
||||
<tr>
|
||||
<th>
|
||||
Categorie
|
||||
</th>
|
||||
<th>
|
||||
Quick Code
|
||||
</th>
|
||||
<th>
|
||||
Nom
|
||||
</th>
|
||||
<th>
|
||||
Description
|
||||
</th>
|
||||
<th>
|
||||
Numéro TVA
|
||||
</th>
|
||||
<th>
|
||||
Poste comptable
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
<? if (count($array)==0) : ?>
|
||||
<h2 class="notice"> Aucun résultat</h2>
|
||||
<?endif?>
|
||||
<? for ($i=0;$i<$max;$i++):?>
|
||||
<tr>
|
||||
<td>
|
||||
<?=h($array[$i]['fd_label'])?>
|
||||
</td>
|
||||
<td>
|
||||
<?=HtmlInput::card_detail($array[$i]['quick_code'])?>
|
||||
</td>
|
||||
<td>
|
||||
<?=h($array[$i]['vw_name'])?>
|
||||
<?=h($array[$i]['vw_first_name'])?>
|
||||
</td>
|
||||
<td>
|
||||
<?=h($array[$i]['vw_description'])?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?=h($array[$i]['tva_num'])?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?=h($array[$i]['poste'])?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<? endfor; ?>
|
||||
</table>
|
||||
<?=HtmlInput::button_close("boxsearch_card_div")?>
|
||||
|
|
@ -94,12 +94,15 @@ if ($array[0]['p_type_display']!='P'):
|
|||
<? endif;?>
|
||||
</table>
|
||||
<p>
|
||||
Cochez cette case si vous souhaitez effacer ce menu
|
||||
Cochez cette case si vous souhaitez effacer ce menu
|
||||
<?
|
||||
$delete=new ICheckBox('delete',"1");
|
||||
echo $delete->input();
|
||||
?>
|
||||
</p>
|
||||
<?
|
||||
if ($array[0]['p_type_display']!='P'):
|
||||
?>
|
||||
<p>
|
||||
Cochez cette case si vous souhaitez effacer ce menu ainsi que ceux qui en dépendent
|
||||
<?
|
||||
|
|
@ -107,6 +110,7 @@ $delete=new ICheckBox('del_dep',"1");
|
|||
echo $delete->input();
|
||||
?>
|
||||
</p>
|
||||
<? endif;?>
|
||||
<?
|
||||
echo HtmlInput::submit('mod',"Valider");
|
||||
echo '</form>';
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ require_once 'class_profile_sql.php';
|
|||
require_once 'class_profile_menu.php';
|
||||
$profile=new Profile_sql($cn,$p_id);
|
||||
$gDossier=Dossier::id();
|
||||
$add_one=HtmlInput::button("add", "Ajout Menu","onclick=\"add_menu({dossier:$gDossier,p_id:$p_id})\"");
|
||||
$add_menu=HtmlInput::button("add", "Ajout Menu","onclick=\"add_menu({dossier:$gDossier,p_id:$p_id,type:'me'})\"");
|
||||
$add_impression=HtmlInput::button("add", "Ajout Menu","onclick=\"add_menu({dossier:$gDossier,p_id:$p_id,type:'pr'})\"");
|
||||
?>
|
||||
<hr>
|
||||
<h1>Profil <?=$profile->p_name?></h1>
|
||||
|
|
@ -89,21 +90,21 @@ if ($profile->p_id > 0)
|
|||
echo '<div style="display:none" id="profile_menu_div">';
|
||||
//Menu / Module /plugin in this profile
|
||||
echo "<h2>Menu</h2>";
|
||||
echo $add_one;
|
||||
echo $add_menu;
|
||||
$profile_menu = new Profile_Menu($cn);
|
||||
$profile_menu->listing_profile($p_id);
|
||||
echo '</div>';
|
||||
echo '<div style="display:none" id="profile_print_div">';
|
||||
echo "<h2>Impression</h2>";
|
||||
$profile_menu->printing($p_id);
|
||||
echo $add_one;
|
||||
echo $add_impression;
|
||||
echo '</div>';
|
||||
echo '<div style="display:none" id="profile_gestion_div">';
|
||||
echo "<h1>Action gestion accessible</h1>";
|
||||
echo "<h2>Action gestion accessible</h2>";
|
||||
$profile_menu->available_profile($p_id);
|
||||
echo '</div>';
|
||||
echo '<div style="display:none" id="profile_repo_div">';
|
||||
echo "<h1>Dépôt de stock accessible</h1>";
|
||||
echo "<h2>Dépôt de stock accessible</h2>";
|
||||
$profile_menu->available_repository($p_id);
|
||||
echo '</div>';
|
||||
if ( isset ($_POST['tab']))
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ ob_start();
|
|||
require('template/modele_document.php');
|
||||
|
||||
$html=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
$html=escape_xml($html);
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
require_once('class_periode.php');
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
* \brief display or save a periode
|
||||
* variable received $op, $cn $g_user
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
* \brief display a form to change the name of a predefined operation
|
||||
*/
|
||||
ob_start();
|
||||
|
|
@ -41,7 +41,7 @@ echo '</form>';
|
|||
|
||||
|
||||
$html = ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
$html = escape_xml($html);
|
||||
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
|
|
|
|||
55
include/ajax_view_action.php
Normal file
55
include/ajax_view_action.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of PhpCompta.
|
||||
*
|
||||
* PhpCompta 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.
|
||||
*
|
||||
* PhpCompta 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 PhpCompta; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
/* $Revision$ */
|
||||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief show the detail of an action
|
||||
*
|
||||
*/
|
||||
require_once 'class_follow_up.php';
|
||||
echo HtmlInput::title_box(_("Détail action"), $div);
|
||||
$act = new Follow_Up($cn);
|
||||
$act->ag_id = $ag_id;
|
||||
$act->get();
|
||||
if ($g_user->can_write_action($ag_id) == true || $g_user->can_read_action($ag_id) == true || $act->ag_dest == -1)
|
||||
{
|
||||
echo $act->Display('READ', false, "ajax", "");
|
||||
$action=HtmlInput::array_to_string(array("gDossier","ag_id"), $_GET)."&ac=FOLLOW&sa=detail";
|
||||
if ( $_GET['mod']== 1) :
|
||||
?>
|
||||
<a href="<?=$action?>" target="_blank" class="button">Modifier </a>
|
||||
<?
|
||||
endif;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo h2(_("Ce document n'est pas accessible"),"error");
|
||||
?>
|
||||
<div style="margin:0;padding:0;background-color:red;text-align:center;">
|
||||
<h2 class="error">Accès interdit : vous n'avez pas accès à cette information, contactez votre responsable</h2>;
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
echo HtmlInput::button_close($div);
|
||||
|
||||
?>
|
||||
|
|
@ -36,8 +36,10 @@ require_once('class_follow_up.php');
|
|||
*/
|
||||
$sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
|
||||
$ag_id=(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
|
||||
if (! isset($_GET['submit_query'])) {$_REQUEST['closed_action']=1;$_GET['closed_action']=1;}
|
||||
|
||||
$p_action=$_REQUEST['ac'];
|
||||
$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id']."&".HtmlInput::request_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc","date_start","date_end","hsstate","sb","sc"),"");
|
||||
$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id']."&".HtmlInput::request_to_string(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc","date_start","date_end","hsstate","sb","sc"),"");
|
||||
$retour=HtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base);
|
||||
$fiche=new Fiche($cn,$_REQUEST['f_id']);
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,8 @@ class Acc_Account_Ledger
|
|||
if ( $solded == 1)
|
||||
{
|
||||
$filter=str_replace('jrn_def_id','jr_def_id',$filter_sql);
|
||||
$bal_sql="select sum(amount_deb) as s_deb,sum(amount_cred) as s_cred, j_poste from (select case when j_debit='t' then j_montant else 0 end as amount_deb,
|
||||
$bal_sql="select sum(amount_deb) as s_deb,sum(amount_cred) as s_cred, j_poste
|
||||
from (select case when j_debit='t' then j_montant else 0 end as amount_deb,
|
||||
case when j_debit='f' then j_montant else 0 end as amount_cred,
|
||||
j_poste
|
||||
from jrnx join jrn on (j_grpt = jr_grpt_id)
|
||||
|
|
@ -354,7 +355,7 @@ class Acc_Account_Ledger
|
|||
$vw_operation=sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s</A>',
|
||||
$op['jr_id'], dossier::id(), $op['jr_internal']);
|
||||
$let='';
|
||||
if ( $op['letter'] !=-1) $let=$op['letter'];
|
||||
if ( $op['letter'] !=-1) $let= strtoupper (base_convert ( $op['letter'],10,36));
|
||||
$tmp_diff=bcsub($op['deb_montant'],$op['cred_montant']);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class Acc_Balance
|
|||
var $jrn; /*!< idx of a table of ledger create by user->get_ledger */
|
||||
var $from_poste; /*!< from_poste filter on the post */
|
||||
var $to_poste; /*!< to_poste filter on the post*/
|
||||
var $unsold; /*!< if true only the no solded account (saldo != 0) */
|
||||
var $unsold; /**= 0) */
|
||||
function Acc_Balance($p_cn)
|
||||
{
|
||||
$this->db=$p_cn;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
'nd_vat_rate'=>'nd_vat_rate',
|
||||
'amount_perso'=>'amount_perso',
|
||||
'amount_perso_rate'=>'amount_perso_rate' );
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -126,9 +126,11 @@ class Acc_Compute
|
|||
if ( $this->check && $this->order > 2 ) throw new Exception ('ORDER NOT RESPECTED');
|
||||
|
||||
$this->amount_nd=bcmul($this->amount,$this->amount_nd_rate);
|
||||
$this->amount_nd=bcdiv($this->amount_nd,100);
|
||||
$this->amount_nd=round($this->amount_nd,2);
|
||||
// the nd part for the vat
|
||||
$nd_vat=bcmul($this->amount_vat,$this->amount_nd_rate);
|
||||
$nd_vat=bcdiv($nd_vat,100);
|
||||
$nd_vat=round($nd_vat,2);
|
||||
|
||||
}
|
||||
|
|
@ -139,6 +141,7 @@ class Acc_Compute
|
|||
|
||||
if ($this->amount_vat == 0 ) $this->compute_vat();
|
||||
$this->nd_vat=bcmul($this->amount_vat,$this->nd_vat_rate);
|
||||
$this->nd_vat=bcdiv($this->nd_vat,100);
|
||||
$this->nd_vat=round($this->nd_vat,2);
|
||||
}
|
||||
|
||||
|
|
@ -149,6 +152,7 @@ class Acc_Compute
|
|||
|
||||
if ($this->amount_vat == 0 ) $this->compute_vat();
|
||||
$this->nd_ded_vat=bcmul($this->amount_vat,$this->nd_ded_vat_rate);
|
||||
$this->nd_ded_vat=bcdiv($this->nd_ded_vat,100);
|
||||
$this->nd_ded_vat=round($this->nd_ded_vat,2);
|
||||
}
|
||||
|
||||
|
|
@ -158,6 +162,7 @@ class Acc_Compute
|
|||
$this->order=2;
|
||||
if ( $this->amount == 0 ) return;
|
||||
$this->amount_perso=bcmul($this->amount,$this->amount_perso_rate);
|
||||
$this->amount_perso=bcdiv($this->amount_perso,100);
|
||||
$this->amount_perso=round($this->amount_perso,2);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,24 +44,24 @@ require_once('class_lettering.php');
|
|||
require_once 'class_sort_table.php';
|
||||
require_once 'class_jrn_def_sql.php';
|
||||
require_once 'class_acc_payment.php';
|
||||
/* !\file
|
||||
* \brief Class for jrn, class acc_ledger for manipulating the ledger
|
||||
/** \file
|
||||
* @brief Class for jrn, class acc_ledger for manipulating the ledger
|
||||
*/
|
||||
|
||||
/* !\brief Class for jrn, class acc_ledger for manipulating the ledger
|
||||
/** @brief Class for jrn, class acc_ledger for manipulating the ledger
|
||||
*
|
||||
*/
|
||||
|
||||
class Acc_Ledger extends jrn_def_sql
|
||||
{
|
||||
|
||||
var $id; /* !< jrn_def.jrn_def_id */
|
||||
var $name; /* !< jrn_def.jrn_def_name */
|
||||
var $db; /* !< database connextion */
|
||||
var $row; /* !< row of the ledger */
|
||||
var $type; /* !< type of the ledger ACH ODS FIN
|
||||
var $id; /**< jrn_def.jrn_def_id */
|
||||
var $name; /**< jrn_def.jrn_def_name */
|
||||
var $db; /**< database connextion */
|
||||
var $row; /**< row of the ledger */
|
||||
var $type; /**< type of the ledger ACH ODS FIN
|
||||
VEN or GL */
|
||||
var $nb; /* !< default number of rows by
|
||||
var $nb; /**< default number of rows by
|
||||
default 10 */
|
||||
|
||||
/**
|
||||
|
|
@ -84,7 +84,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
{
|
||||
$ret = $this->db->get_array("select last_value,is_called from s_jrn_pj" . $this->id);
|
||||
$last = $ret[0]['last_value'];
|
||||
/* !
|
||||
/**
|
||||
* \note With PSQL sequence , the last_value column is 1 when before AND after the first call, to make the difference between them
|
||||
* I have to check whether the sequence has been already called or not */
|
||||
if ($ret[0]['is_called'] == 'f')
|
||||
|
|
@ -96,8 +96,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Return the type of a ledger (ACH,VEN,ODS or FIN) or GL
|
||||
/**
|
||||
* @brief Return the type of a ledger (ACH,VEN,ODS or FIN) or GL
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -331,8 +331,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
}
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Return the name of a ledger
|
||||
/**
|
||||
* @brief Return the name of a ledger
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -354,14 +354,14 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $ret['jrn_def_name'];
|
||||
}
|
||||
|
||||
/* ! \function get_row
|
||||
* \brief Get The data
|
||||
/** \function get_row
|
||||
* @brief Get The data
|
||||
*
|
||||
*
|
||||
* \param p_from from periode
|
||||
* \param p_to to periode
|
||||
* \param p_limit starting line
|
||||
* \param p_offset number of lines
|
||||
* @paramp_from from periode
|
||||
* @paramp_to to periode
|
||||
* @paramp_limit starting line
|
||||
* @paramp_offset number of lines
|
||||
* \return Array with the asked data
|
||||
*
|
||||
*/
|
||||
|
|
@ -509,13 +509,13 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $a;
|
||||
}
|
||||
|
||||
/* ! \brief Get simplified row from ledger
|
||||
/** @brief Get simplified row from ledger
|
||||
*
|
||||
* \param from periode
|
||||
* \param to periode
|
||||
* \param p_limit starting line
|
||||
* \param p_offset number of lines
|
||||
* \param trunc if data must be truncated (pdf export)
|
||||
* @paramfrom periode
|
||||
* @paramto periode
|
||||
* @paramp_limit starting line
|
||||
* @paramp_offset number of lines
|
||||
* @paramtrunc if data must be truncated (pdf export)
|
||||
*
|
||||
* \return an Array with the asked data
|
||||
*/
|
||||
|
|
@ -545,7 +545,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
jrn_def_type,
|
||||
jrn.jr_tech_per
|
||||
FROM jrn join jrn_def on (jrn_def_id=jr_def_id)
|
||||
WHERE $periode $jrn order by jr_date $cond_limite";
|
||||
WHERE $periode $jrn order by jr_date,substring(jrn.jr_pj_number,'\\\d+$')::numeric asc $cond_limite";
|
||||
|
||||
$Res = $this->db->exec_sql($sql);
|
||||
$Max = Database::num_row($Res);
|
||||
|
|
@ -580,7 +580,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
|
||||
// end function get_rowSimple
|
||||
|
||||
/* !\brief guess what the next pj should be
|
||||
/**
|
||||
* @brief guess what the next pj should be
|
||||
*/
|
||||
|
||||
function guess_pj()
|
||||
|
|
@ -591,10 +592,11 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $pj_pref . $pj_seq;
|
||||
}
|
||||
|
||||
/* !\brief Show all the operation
|
||||
* \param $sql is the sql stmt, normally created by build_search_sql
|
||||
* \param $offset the offset
|
||||
* \param $p_paid if we want to see info about payment
|
||||
/**
|
||||
* @brief Show all the operation
|
||||
* @param$sql is the sql stmt, normally created by build_search_sql
|
||||
* @param$offset the offset
|
||||
* @param$p_paid if we want to see info about payment
|
||||
\code
|
||||
// Example
|
||||
// Build the sql
|
||||
|
|
@ -625,7 +627,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
{
|
||||
global $g_parameter, $g_user;
|
||||
$gDossier = dossier::id();
|
||||
$limit = " LIMIT 25";
|
||||
$limit = " LIMIT ".MAX_RECONCILE;
|
||||
// Sort
|
||||
// Count
|
||||
$count = $this->db->count_sql($sql);
|
||||
|
|
@ -716,7 +718,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$tmp_jr_comment = h($row['jr_comment']);
|
||||
$r.=$tmp_jr_comment;
|
||||
$r.="</TD>";
|
||||
$r.=td(h($row['n_text']), ' style="font-size:6"');
|
||||
$r.=td(h($row['n_text']), ' style="font-size:90%"');
|
||||
// Amount
|
||||
// If the ledger is financial :
|
||||
// the credit must be negative and written in red
|
||||
|
|
@ -766,10 +768,11 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return array($count, $r);
|
||||
}
|
||||
|
||||
/* !\brief Show all the operation
|
||||
* \param $sql is the sql stmt, normally created by build_search_sql
|
||||
* \param $offset the offset
|
||||
* \param $p_paid if we want to see info about payment
|
||||
/**
|
||||
* @brief Show all the operation
|
||||
* @param$sql is the sql stmt, normally created by build_search_sql
|
||||
* @param$offset the offset
|
||||
* @param$p_paid if we want to see info about payment
|
||||
\code
|
||||
// Example
|
||||
// Build the sql
|
||||
|
|
@ -799,6 +802,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
public function list_operation($sql, $offset, $p_paid = 0)
|
||||
{
|
||||
global $g_parameter, $g_user;
|
||||
bcscale(2);
|
||||
$table = new Sort_Table();
|
||||
$gDossier = dossier::id();
|
||||
$amount_paid = 0.0;
|
||||
|
|
@ -910,7 +914,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$tmp_jr_comment = h($row['jr_comment']);
|
||||
$r.=$tmp_jr_comment;
|
||||
$r.="</TD>";
|
||||
$r.=td(h($row['n_text']), ' style="font-size:6"');
|
||||
$r.=td(h($row['n_text']), ' style="font-size:90%"');
|
||||
// Amount
|
||||
// If the ledger is financial :
|
||||
// the credit must be negative and written in red
|
||||
|
|
@ -924,10 +928,19 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$positive = ($positive < 0) ? 1 : 0;
|
||||
}
|
||||
$r.="<TD align=\"right\">";
|
||||
|
||||
$tot = ($positive != 0) ? $tot - $row['jr_montant'] : $tot + $row['jr_montant'];
|
||||
$t_amount=$row['jr_montant'];
|
||||
if ($row['total_invoice'] != null && $row['total_invoice'] != $row['jr_montant'])
|
||||
$t_amount=$row['total_invoice'];
|
||||
$tot = ($positive != 0) ? bcsub($tot , $t_amount ): bcadd($tot , $t_amount);
|
||||
//STAN $positive always == 0
|
||||
$r.=( $positive != 0 ) ? "<font color=\"red\"> - " . nbm($row['jr_montant']) . "</font>" : nbm($row['jr_montant']);
|
||||
if ($row [ 'jrn_def_type']=='FIN')
|
||||
{
|
||||
$r.=( $positive != 0 ) ? "<font color=\"red\"> - " . nbm($t_amount) . "</font>" : nbm($t_amount);
|
||||
}
|
||||
else
|
||||
{
|
||||
$r.=( $t_amount < 0 ) ? "<font color=\"red\"> " . nbm($t_amount) . "</font>" : nbm($t_amount);
|
||||
}
|
||||
$r.="</TD>";
|
||||
|
||||
|
||||
|
|
@ -943,9 +956,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$h->name = "set_jr_id" . $row['jr_id'];
|
||||
$r.='<TD>' . $w->input() . $h->input() . '</TD>';
|
||||
if ($row['jr_rapt'] == 'paid')
|
||||
$amount_paid+=$row['jr_montant'];
|
||||
$amount_paid=bcadd($amount_paid,$t_amount);
|
||||
else
|
||||
$amount_unpaid+=$row['jr_montant'];
|
||||
$amount_unpaid=bcadd($amount_unpaid,$t_amount);
|
||||
}
|
||||
|
||||
// Rapprochement
|
||||
|
|
@ -1011,8 +1024,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return array($count, $r);
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief get_detail gives the detail of row
|
||||
/**
|
||||
* @brief get_detail gives the detail of row
|
||||
* this array must contains at least the field
|
||||
* <ul>
|
||||
* <li> montant</li>
|
||||
|
|
@ -1029,12 +1042,12 @@ class Acc_Ledger extends jrn_def_sql
|
|||
* </ul>
|
||||
* </ul>
|
||||
*
|
||||
* \param p_array the structure is set in get_rowSimple, this array is
|
||||
* @paramp_array the structure is set in get_rowSimple, this array is
|
||||
* modified,
|
||||
* \param $trunc if the data must be truncated, usefull for pdf export
|
||||
* \param p_jrn_type is the type of the ledger (ACH or VEN)
|
||||
* \param $a_TVA TVA Array (default null)
|
||||
* \param $a_ParmCode Array (default null)
|
||||
* @param$trunc if the data must be truncated, usefull for pdf export
|
||||
* @paramp_jrn_type is the type of the ledger (ACH or VEN)
|
||||
* @param$a_TVA TVA Array (default null)
|
||||
* @param$a_ParmCode Array (default null)
|
||||
* \return p_array
|
||||
*/
|
||||
|
||||
|
|
@ -1193,8 +1206,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
}
|
||||
|
||||
// retrieve data from jrnx
|
||||
/* !
|
||||
* \brief Get the properties of a journal
|
||||
/**
|
||||
* @brief Get the properties of a journal
|
||||
*
|
||||
* \return an array containing properties
|
||||
*
|
||||
|
|
@ -1219,9 +1232,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return Database::fetch_array($Res, 0);
|
||||
}
|
||||
|
||||
/* ! \function GetDefLine
|
||||
* \brief Get the number of lines of a journal
|
||||
* \param $p_cred deb or cred
|
||||
/** \function GetDefLine
|
||||
* @brief Get the number of lines of a journal
|
||||
* @param$p_cred deb or cred
|
||||
*
|
||||
* \return an integer
|
||||
*/
|
||||
|
|
@ -1237,9 +1250,10 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $Res[0]['value'];
|
||||
}
|
||||
|
||||
/* !\brief get the saldo of a ledger for a specific period
|
||||
* \param $p_from start period
|
||||
* \param $p_to end period
|
||||
/**
|
||||
* @brief get the saldo of a ledger for a specific period
|
||||
* @param$p_from start period
|
||||
* @param$p_to end period
|
||||
*/
|
||||
|
||||
function get_solde($p_from, $p_to)
|
||||
|
|
@ -1270,11 +1284,11 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $response;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Show a select list of the ledgers you can access in
|
||||
/**
|
||||
* @brief Show a select list of the ledgers you can access in
|
||||
* writing, reading or simply accessing.
|
||||
* \param $p_type = ALL or the type of the ledger (ACH,VEN,FIN,ODS)
|
||||
* \param $p_access =3 for READ and WRITE, 2 for write and 1 for readonly
|
||||
* @param$p_type = ALL or the type of the ledger (ACH,VEN,FIN,ODS)
|
||||
* @param$p_access =3 for READ and WRITE, 2 for write and 1 for readonly
|
||||
* \return object HtmlInput select
|
||||
*/
|
||||
|
||||
|
|
@ -1302,8 +1316,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $select;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief retrieve the jrn_def_fiche and return them into a array
|
||||
/**
|
||||
* @brief retrieve the jrn_def_fiche and return them into a array
|
||||
* index deb, cred
|
||||
* \param
|
||||
* \param
|
||||
|
|
@ -1328,8 +1342,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $res[0];
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief retrieve the jrn_def_class_deb and return it
|
||||
/**
|
||||
* @brief retrieve the jrn_def_class_deb and return it
|
||||
*
|
||||
*
|
||||
* \return return an string
|
||||
|
|
@ -1351,10 +1365,10 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $res[0];
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief show the result of the array to confirm
|
||||
/**
|
||||
* @brief show the result of the array to confirm
|
||||
* before inserting
|
||||
* \param $p_array array from the form
|
||||
* @param$p_array array from the form
|
||||
* \return string
|
||||
*/
|
||||
|
||||
|
|
@ -1514,10 +1528,10 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $ret;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Show the form to encode your operation
|
||||
* \param $p_array if you correct or use a predef operation (default = null)
|
||||
* \param $p_readonly 1 for readonly 0 for writable (default 0)
|
||||
/**
|
||||
* @brief Show the form to encode your operation
|
||||
* @param$p_array if you correct or use a predef operation (default = null)
|
||||
* @param$p_readonly 1 for readonly 0 for writable (default 0)
|
||||
*
|
||||
* \return a string containing the form
|
||||
*/
|
||||
|
|
@ -1536,8 +1550,10 @@ class Acc_Ledger extends jrn_def_sql
|
|||
{
|
||||
$add_js = "update_pj();";
|
||||
}
|
||||
$add_js.='get_last_date();';
|
||||
|
||||
if ($g_parameter->MY_DATE_SUGGEST=='Y')
|
||||
{
|
||||
$add_js.='get_last_date();';
|
||||
}
|
||||
$ret = "";
|
||||
if ($g_user->check_action(FICADD) == 1)
|
||||
{
|
||||
|
|
@ -1750,7 +1766,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $ret;
|
||||
}
|
||||
|
||||
/* !\brief
|
||||
/**
|
||||
* @brief
|
||||
* check if the current ledger is closed
|
||||
* \return 1 for yes, otherwise 0
|
||||
* \see Periode::is_closed
|
||||
|
|
@ -1765,9 +1782,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $ret;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief verify that the operation can be saved
|
||||
* \param $p_array array of data same layout that the $_POST from show_form
|
||||
/**
|
||||
* @brief verify that the operation can be saved
|
||||
* @param$p_array array of data same layout that the $_POST from show_form
|
||||
*
|
||||
*
|
||||
* \throw the getcode value is 1 incorrect balance, 2 date
|
||||
|
|
@ -1897,11 +1914,11 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $msg;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief compute the internal code of the saved operation and set the $this->jr_internal to
|
||||
/**
|
||||
* @brief compute the internal code of the saved operation and set the $this->jr_internal to
|
||||
* the computed value
|
||||
*
|
||||
* \param $p_grpt id in jr_grpt_
|
||||
* @param$p_grpt id in jr_grpt_
|
||||
*
|
||||
* \return string internal_code
|
||||
* -
|
||||
|
|
@ -1920,10 +1937,10 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $internal_code;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief save the operation into the jrnx,jrn, ,
|
||||
/**
|
||||
* @brief save the operation into the jrnx,jrn, ,
|
||||
* CA and pre_def
|
||||
* \param $p_array
|
||||
* @param$p_array
|
||||
*
|
||||
* \return array with [0] = false if failed otherwise true, [1] error
|
||||
* code
|
||||
|
|
@ -2087,8 +2104,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return true;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief get all the data from request and build the object
|
||||
/**
|
||||
* @brief get all the data from request and build the object
|
||||
*/
|
||||
|
||||
function get_request()
|
||||
|
|
@ -2096,10 +2113,10 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$this->id = $_REQUEST['p_jrn'];
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief retrieve the next number for this type of ledger
|
||||
* \param p_cn connx
|
||||
* \param p_type ledger type
|
||||
/**
|
||||
* @brief retrieve the next number for this type of ledger
|
||||
* @paramp_cn connx
|
||||
* @paramp_type ledger type
|
||||
*
|
||||
* \return the number
|
||||
*
|
||||
|
|
@ -2113,8 +2130,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $Ret + 1;
|
||||
}
|
||||
|
||||
/* !\brief get the first ledger
|
||||
* \param the type
|
||||
/**
|
||||
* @brief get the first ledger
|
||||
* @paramthe type
|
||||
* \return the j_id
|
||||
*/
|
||||
|
||||
|
|
@ -2125,8 +2143,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $all[0];
|
||||
}
|
||||
|
||||
/* !\brief Update the paiment in the list of operation
|
||||
* \param $p_array is normally $_GET
|
||||
/**
|
||||
* @brief Update the paiment in the list of operation
|
||||
* @param$p_array is normally $_GET
|
||||
*/
|
||||
|
||||
function update_paid($p_array)
|
||||
|
|
@ -2161,9 +2180,10 @@ class Acc_Ledger extends jrn_def_sql
|
|||
" jr_grpt_id = " . $this->grpt_id);
|
||||
}
|
||||
|
||||
/* !\brief retrieve all the card for this type of ledger, make them
|
||||
/**
|
||||
* @brief retrieve all the card for this type of ledger, make them
|
||||
* into a string separated by comma
|
||||
* \param none
|
||||
* @paramnone
|
||||
* \return all the card or null is nothing is found
|
||||
*/
|
||||
|
||||
|
|
@ -2197,8 +2217,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $card;
|
||||
}
|
||||
|
||||
/* !\brief get the saldo of an exercice, used for the opening of a folder
|
||||
* \param $p_exercice is the exercice we want
|
||||
/**
|
||||
* @brief get the saldo of an exercice, used for the opening of a folder
|
||||
* @param$p_exercice is the exercice we want
|
||||
* \return an array
|
||||
* index =
|
||||
* - solde (debit > 0 ; credit < 0)
|
||||
|
|
@ -2225,8 +2246,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $res;
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Check if a Dossier is using the strict mode or not
|
||||
/**
|
||||
* @brief Check if a Dossier is using the strict mode or not
|
||||
* \return true if we are using the strict_mode
|
||||
*/
|
||||
|
||||
|
|
@ -2240,8 +2261,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
exit("Valeur invalid " . __FILE__ . ':' . __LINE__);
|
||||
}
|
||||
|
||||
/* !
|
||||
* \brief Check if a Dossier is using the check on the periode, if true than the user has to enter the date
|
||||
/**
|
||||
* @brief Check if a Dossier is using the check on the periode, if true than the user has to enter the date
|
||||
* and the periode, it is a security check
|
||||
* \return true if we are using the double encoding (date+periode)
|
||||
*/
|
||||
|
|
@ -2256,7 +2277,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
exit("Valeur invalid " . __FILE__ . ':' . __LINE__);
|
||||
}
|
||||
|
||||
/* !\brief get the date of the last operation
|
||||
/**
|
||||
* @brief get the date of the last operation
|
||||
*/
|
||||
|
||||
function get_last_date()
|
||||
|
|
@ -2268,9 +2290,10 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $date;
|
||||
}
|
||||
|
||||
/* !\brief retrieve the jr_id thanks the internal code, do not change
|
||||
/**
|
||||
* @brief retrieve the jr_id thanks the internal code, do not change
|
||||
* anything to the current object
|
||||
* \param the internal code
|
||||
* @paramthe internal code
|
||||
* \return the jr_id or 0 if not found
|
||||
*/
|
||||
|
||||
|
|
@ -2283,10 +2306,11 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $value;
|
||||
}
|
||||
|
||||
/* !\brief create the invoice and saved it as attachment to the
|
||||
/**
|
||||
* @brief create the invoice and saved it as attachment to the
|
||||
* operation,
|
||||
* \param $internal is the internal code
|
||||
* \param $p_array is normally the $_POST
|
||||
* @param$internal is the internal code
|
||||
* @param$p_array is normally the $_POST
|
||||
* \return a string
|
||||
*/
|
||||
|
||||
|
|
@ -2309,8 +2333,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return h($doc->d_name . ' (' . $doc->d_filename . ')');
|
||||
}
|
||||
|
||||
/* !\brief check if the payment method is valid
|
||||
* \param $e_mp is the value and $e_mp_qcode is the quickcode
|
||||
/**
|
||||
* @brief check if the payment method is valid
|
||||
* @param$e_mp is the value and $e_mp_qcode is the quickcode
|
||||
* \return nothing throw an Exception
|
||||
*/
|
||||
|
||||
|
|
@ -2346,7 +2371,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
}
|
||||
}
|
||||
|
||||
/* !\brief increment the sequence for the pj */
|
||||
/**
|
||||
* @brief increment the sequence for the pj */
|
||||
|
||||
function inc_seq_pj()
|
||||
{
|
||||
|
|
@ -2354,7 +2380,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$this->db->exec_sql($sql);
|
||||
}
|
||||
|
||||
/* !@brief return a HTML string with the form for the search
|
||||
/**
|
||||
* @brief return a HTML string with the form for the search
|
||||
* @param $p_type if the type of ledger possible values=ALL,VEN,ACH,ODS,FIN
|
||||
* @param $all_type_ledger
|
||||
* values :
|
||||
|
|
@ -2462,15 +2489,16 @@ class Acc_Ledger extends jrn_def_sql
|
|||
ob_start();
|
||||
require_once('template/ledger_search.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
|
||||
/* !\brief this function will create a sql stmt to use to create the list for
|
||||
/**
|
||||
* @brief this function will create a sql stmt to use to create the list for
|
||||
* the ledger,
|
||||
* \param $p_array is usually the $_GET,
|
||||
* \param $p_order the order of the row
|
||||
* \param $p_where is the sql condition if not null then the $p_array will not be used
|
||||
* @param$p_array is usually the $_GET,
|
||||
* @param$p_order the order of the row
|
||||
* @param$p_where is the sql condition if not null then the $p_array will not be used
|
||||
* \note the p_action will be used to filter the ledger but gl means ALL
|
||||
* struct array $p_array
|
||||
\verbatim
|
||||
|
|
@ -2526,7 +2554,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
|
||||
end as name,
|
||||
case
|
||||
when jrn_def_type='VEB' then (select ad_value from fiche_detail where ad_id=32 and f_id=(select max(qs_client) from quant_sold join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
|
||||
when jrn_def_type='VEN' then (select ad_value from fiche_detail where ad_id=32 and f_id=(select max(qs_client) from quant_sold join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
|
||||
when jrn_def_type = 'ACH' then (select ad_value from fiche_detail where ad_id=32 and f_id=(select max(qp_supplier) from quant_purchase join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
|
||||
when jrn_def_type = 'FIN' then (select ad_value from fiche_detail where ad_id=32 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
|
||||
end as first_name,
|
||||
|
|
@ -2534,7 +2562,20 @@ class Acc_Ledger extends jrn_def_sql
|
|||
when jrn_def_type='VEN' then (select ad_value from fiche_detail where ad_id=23 and f_id=(select max(qs_client) from quant_sold join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
|
||||
when jrn_def_type = 'ACH' then (select ad_value from fiche_detail where ad_id=23 and f_id=(select max(qp_supplier) from quant_purchase join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
|
||||
when jrn_def_type = 'FIN' then (select ad_value from fiche_detail where ad_id=23 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
|
||||
end as quick_code
|
||||
end as quick_code,
|
||||
case
|
||||
when jrn_def_type='VEN' then
|
||||
(select sum(qs_price)+sum(vat) from
|
||||
(select qs_internal,qs_price,case when qs_vat_sided<>0 then 0 else qs_vat end as vat from quant_sold where qs_internal=X.jr_internal) as ven_invoice
|
||||
)
|
||||
when jrn_def_type = 'ACH' then
|
||||
(
|
||||
select sum(qp_price)+sum(vat)+sum(qp_nd_tva)+sum(qp_nd_tva_recup)
|
||||
from
|
||||
(select qp_internal,qp_price,qp_nd_tva,qp_nd_tva_recup,case when qp_vat_sided<>0 then 0 else qp_vat end as vat from quant_purchase where qp_internal=X.jr_internal) as invoice_purchase
|
||||
)
|
||||
else null
|
||||
end as total_invoice
|
||||
|
||||
|
||||
from
|
||||
|
|
@ -2708,7 +2749,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return array($sql, $where);
|
||||
}
|
||||
|
||||
/* !\brief return a html string with the search_form
|
||||
/**
|
||||
* @brief return a html string with the search_form
|
||||
* \return a HTML string with the FORM
|
||||
* \see build_search_sql
|
||||
* \see search_form
|
||||
|
|
@ -2753,8 +2795,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
return $r;
|
||||
}
|
||||
|
||||
/* !\brief return the last p_limit operation into an array
|
||||
* \param $p_limit is the max of operation to return
|
||||
/**
|
||||
* @brief return the last p_limit operation into an array
|
||||
* @param$p_limit is the max of operation to return
|
||||
* \return $p_array of Follow_Up object
|
||||
*/
|
||||
|
||||
|
|
@ -2977,8 +3020,8 @@ class Acc_Ledger extends jrn_def_sql
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// TEST MODULE
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/* !
|
||||
* \brief this function is intended to test this class
|
||||
/**
|
||||
* @brief this function is intended to test this class
|
||||
*/
|
||||
static function test_me($pCase = '')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
* \brief the class Acc_Ledger_Fin inherits from Acc_Ledger, this
|
||||
* object permit to manage the financial ledger
|
||||
*/
|
||||
|
|
@ -46,7 +46,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
$this->type = 'FIN';
|
||||
}
|
||||
|
||||
/* !\brief verify that the data are correct before inserting or confirming
|
||||
/**\brief verify that the data are correct before inserting or confirming
|
||||
* \param an array (usually $_POST)
|
||||
* \return String
|
||||
* \throw Exception on error occurs
|
||||
|
|
@ -223,7 +223,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
}
|
||||
}
|
||||
|
||||
/* !\brief
|
||||
/**\brief
|
||||
* \param $p_array contains the value usually it is $_POST
|
||||
* \return string with html code
|
||||
* \note the form tag are not set here
|
||||
|
|
@ -291,12 +291,14 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
|
||||
// Ledger (p_jrn)
|
||||
//--
|
||||
|
||||
$add_js = 'onchange="update_pj();update_bank();get_last_date();ajax_saldo(\'first_sold\');update_name();"';
|
||||
$onchange="update_bank();ajax_saldo('first_sold');update_name();";
|
||||
|
||||
if ($g_parameter->MY_DATE_SUGGEST == 'Y')
|
||||
$add_js = 'onchange="update_pj();update_bank();get_last_date();ajax_saldo(\'first_sold\')";';
|
||||
$onchange .= 'get_last_date();';
|
||||
if ($g_parameter->MY_PJ_SUGGEST=='Y')
|
||||
$onchange .= 'update_pj();';
|
||||
|
||||
$add_js = 'onchange="'.$onchange.'"';
|
||||
$wLedger = $this->select_ledger('FIN', 2);
|
||||
if ($wLedger == null)
|
||||
exit('Pas de journal disponible');
|
||||
|
|
@ -367,6 +369,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
$W1 = new ICard();
|
||||
$W1->label = "";
|
||||
$W1->name = "e_other" . $i;
|
||||
$W1->id = "e_other" . $i;
|
||||
$W1->value = $tiers;
|
||||
$W1->extra = 'deb'; // credits
|
||||
$W1->typecard = 'deb';
|
||||
|
|
@ -396,6 +399,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
}
|
||||
|
||||
$wcard_name = new IText("e_other_name" . $i, $card_name);
|
||||
$wcard_name->id=$wcard_name->name;
|
||||
$wcard_name->readOnly = true;
|
||||
$array[$i]['cname'] = $wcard_name->input();
|
||||
|
||||
|
|
@ -425,13 +429,13 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
ob_start();
|
||||
require_once('template/form_ledger_fin.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
/* !\brief show the summary before inserting into the database, it
|
||||
/**\brief show the summary before inserting into the database, it
|
||||
* calls the function for adding a attachment. The function verify
|
||||
* should be called before
|
||||
* \param $p_array an array usually is $_POST
|
||||
|
|
@ -440,7 +444,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
|
||||
public function confirm($p_array, $p_nothing = 0)
|
||||
{
|
||||
global $g_parameter;
|
||||
global $g_parameter,$g_user;
|
||||
$r = "";
|
||||
bcscale(2);
|
||||
extract($p_array);
|
||||
|
|
@ -451,7 +455,11 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
}
|
||||
else
|
||||
{
|
||||
$pPeriode->find_periode($e_date);
|
||||
if (isDate($e_date) != null) {
|
||||
$pPeriode->find_periode($e_date);
|
||||
} else {
|
||||
$pPeriode->p_id=$g_user->get_periode();
|
||||
}
|
||||
}
|
||||
|
||||
list ($l_date_start, $l_date_end) = $pPeriode->get_date_limit();
|
||||
|
|
@ -459,7 +467,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
$r.='';
|
||||
$r.='<fieldset><legend>Banque, caisse </legend>';
|
||||
$r.= '<div id="jrn_name_div">';
|
||||
$r.='<h2 id="jrn_name" style="display:inline">' . $this->get_name() . '</h2>';
|
||||
$r.='<h2 class="title" id="jrn_name" style="display:inline">' . $this->get_name() . '</h2>';
|
||||
$r.= '</div>';
|
||||
$r.='<TABLE width="100%">';
|
||||
// Date
|
||||
|
|
@ -502,23 +510,22 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
|
||||
$r.='</fieldset>';
|
||||
|
||||
$r.='<fieldset><legend>Opérations financières</legend>';
|
||||
$r.='<div class="myfieldset"><h1 class="legend">Extrait de compte</h1>';
|
||||
//--------------------------------------------------
|
||||
// Saldo begin end
|
||||
//-------------------------------------------------
|
||||
$r.='<fieldset><legend>Extrait de compte</legend>';
|
||||
$r.='<table>';
|
||||
$r.='<tr>';
|
||||
// Extrait
|
||||
//--
|
||||
$r.='<td> Numéro d\'extrait</td>' . h($e_pj);
|
||||
$r.='<td >Solde début extrait </td>';
|
||||
$r.='<td>' . $first_sold . '</td>';
|
||||
$r.='<td>Solde fin extrait </td>';
|
||||
$r.='<td>' . $last_sold . '</td>';
|
||||
$r.=tr('<td> Numéro d\'extrait</td>' . td(h($e_pj)));
|
||||
$r.='<tr><td >Solde début extrait </td>';
|
||||
$r.='<td style="num">' . nbm($first_sold) . '</td></tr>';
|
||||
$r.='<tr><td>Solde fin extrait </td>';
|
||||
$r.='<td style="num">' . nbm($last_sold) . '</td></tr>';
|
||||
$r.='</table>';
|
||||
$r.='</fieldset>';
|
||||
|
||||
$r.='<h1 class="legend">Opérations financières</h1>';
|
||||
//--------------------------------------------------
|
||||
// financial operation
|
||||
//-------------------------------------------------
|
||||
|
|
@ -582,9 +589,11 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
if (${"e_concerned" . $i} != '')
|
||||
{
|
||||
$jr_internal = $this->db->get_array("select jr_internal from jrn where jr_id in (" . ${"e_concerned" . $i} . ")");
|
||||
$comma="";
|
||||
for ($x = 0; $x < count($jr_internal); $x++)
|
||||
{
|
||||
$r.=HtmlInput::detail_op(${"e_concerned" . $i}, $jr_internal[$x]['jr_internal']);
|
||||
$r.=$comma.HtmlInput::detail_op(${"e_concerned" . $i}, $jr_internal[$x]['jr_internal']);
|
||||
$comma=" , ";
|
||||
}
|
||||
}
|
||||
$r.='</td>';
|
||||
|
|
@ -618,7 +627,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
$r.="<br>Ajoutez une pièce justificative ";
|
||||
$r.=$file->input("pj", "");
|
||||
|
||||
$r.='</fieldset>';
|
||||
$r.='</div>';
|
||||
//--------------------------------------------------
|
||||
// Hidden variables
|
||||
//--------------------------------------------------
|
||||
|
|
@ -652,7 +661,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
return $r;
|
||||
}
|
||||
|
||||
/* !\brief save the data into the database, included the attachment,
|
||||
/**\brief save the data into the database, included the attachment,
|
||||
* and the reconciliations
|
||||
* \param $p_array usually $_POST
|
||||
* \return string with HTML code
|
||||
|
|
@ -718,7 +727,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
$get_solde=true;
|
||||
for ($i = 0; $i < $nb_item; $i++)
|
||||
{
|
||||
// if tiers is set and amount != 0 insert it into the database
|
||||
// insert it into the database
|
||||
// and quit the loop ?
|
||||
if (strlen(trim(${"e_other$i"})) == 0)
|
||||
continue;
|
||||
|
|
@ -949,7 +958,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
return $ret;
|
||||
}
|
||||
|
||||
/* !\brief display operation of a FIN ledger
|
||||
/**\brief display operation of a FIN ledger
|
||||
* \return html code into a string
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -342,18 +342,19 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$tot_perso=0;
|
||||
$tot_tva_nd=0;
|
||||
$tot_tva_ndded=0;
|
||||
$tva=array();
|
||||
/* Save all the items without vat and no deductible vat and expense*/
|
||||
for ($i=0;$i< $nb_item;$i++)
|
||||
{
|
||||
$n_both=0;
|
||||
if ( strlen(trim(${'e_march'.$i})) == 0 ) continue;
|
||||
if ( ${'e_march'.$i.'_price'} == 0 ) continue;
|
||||
/* if ( ${'e_march'.$i.'_price'} == 0 ) continue;
|
||||
if ( ${'e_quant'.$i} == 0 ) continue;
|
||||
|
||||
*/
|
||||
/* First we save all the items without vat */
|
||||
$fiche=new Fiche($this->db);
|
||||
$fiche->get_by_qcode(${"e_march".$i});
|
||||
|
||||
$tva_both=0;
|
||||
/* tva */
|
||||
if ($g_parameter->MY_TVA_USE=='Y')
|
||||
{
|
||||
|
|
@ -361,6 +362,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$oTva=new Acc_Tva($this->db);
|
||||
$oTva->set_parameter('id',$idx_tva);
|
||||
$oTva->load();
|
||||
$tva_both=$oTva->get_parameter("both_side");
|
||||
}
|
||||
|
||||
/* We have to compute all the amount thanks Acc_Compute */
|
||||
|
|
@ -381,7 +383,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$acc_amount->amount_vat= ${'e_march'.$i.'_tva_amount'};
|
||||
|
||||
}
|
||||
if ($oTva->get_parameter("both_side")==0) $tot_tva=bcadd($tot_tva,$acc_amount->amount_vat);
|
||||
if ($tva_both==0) $tot_tva=bcadd($tot_tva,$acc_amount->amount_vat);
|
||||
}
|
||||
|
||||
$acc_operation=new Acc_Operation($this->db);
|
||||
|
|
@ -414,7 +416,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$tot_perso+=$acc_amount->amount_perso;
|
||||
}
|
||||
|
||||
if ( ! $fiche->empty_attribute(ATTR_DEF_TVA_NON_DEDUCTIBLE))
|
||||
if ( ! $fiche->empty_attribute(ATTR_DEF_TVA_NON_DEDUCTIBLE) && $tva_both==0)
|
||||
{
|
||||
$acc_amount->nd_vat_rate=$fiche->strAttribut(ATTR_DEF_TVA_NON_DEDUCTIBLE);
|
||||
$acc_amount->compute_nd_vat();
|
||||
|
|
@ -422,7 +424,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
/* save op. */
|
||||
|
||||
}
|
||||
if ( ! $fiche->empty_attribute(ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP))
|
||||
if ( ! $fiche->empty_attribute(ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP) && $tva_both==0)
|
||||
{
|
||||
$acc_amount->nd_ded_vat_rate=$fiche->strAttribut(ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP);
|
||||
$acc_amount->compute_ndded_vat();
|
||||
|
|
@ -449,7 +451,6 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$acc_operation->amount=$acc_amount->amount;
|
||||
$acc_operation->qcode=${"e_march".$i};
|
||||
if( $acc_amount->amount > 0 ) $tot_debit=bcadd($tot_debit,$acc_amount->amount);
|
||||
|
||||
$j_id=$acc_operation->insert_jrnx();
|
||||
|
||||
/* Compute sum vat */
|
||||
|
|
@ -491,7 +492,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
//-----
|
||||
if ( $g_parameter->MY_TVA_USE=='Y')
|
||||
{
|
||||
if ( $oTva->get_parameter("both_side")==1) $n_both=$acc_amount->amount_vat;
|
||||
if ( $tva_both==1) $n_both=$acc_amount->amount_vat;
|
||||
|
||||
$r=$this->db->exec_sql("select insert_quant_purchase ".
|
||||
"(null".
|
||||
|
|
@ -539,7 +540,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$acc_operation->type='c';
|
||||
$acc_operation->periode=$tperiode;
|
||||
$acc_operation->qcode=${"e_client"};
|
||||
if ( $cust_amount < 0 ) $tot_debit=bcadd($tot_debit,abs($cust_amount));
|
||||
if ( $cust_amount < 0 )
|
||||
$tot_debit=bcadd($tot_debit,abs($cust_amount));
|
||||
$let_client=$acc_operation->insert_jrnx();
|
||||
/*
|
||||
* Save all the no deductible
|
||||
|
|
@ -601,7 +603,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
/* save op. */
|
||||
$acc_operation->type='d';
|
||||
$acc_operation->qcode='';
|
||||
if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND_TVA_ND))
|
||||
if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND_TVA_ND) && $tva_both==0)
|
||||
{
|
||||
$dna=$fiche->strAttribut(ATTR_DEF_ACCOUNT_ND_TVA_ND);
|
||||
}
|
||||
|
|
@ -621,7 +623,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
{
|
||||
$dna_default=new Acc_Parm_Code($this->db,'TVA_DED_IMPOT');
|
||||
/* save op. */
|
||||
if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND_TVA))
|
||||
if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND_TVA) && $tva_both==0)
|
||||
{
|
||||
$dna=$fiche->strAttribut(ATTR_DEF_ACCOUNT_ND_TVA);
|
||||
}
|
||||
|
|
@ -665,7 +667,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$acc_operation->jrn=$p_jrn;
|
||||
$acc_operation->type='d';
|
||||
$acc_operation->periode=$tperiode;
|
||||
if ( $value > 0 ) $tot_debit=bcadd($tot_debit,$value);
|
||||
if ( $value > 0 ) $tot_debit=bcadd($tot_debit,abs($value));
|
||||
$acc_operation->insert_jrnx();
|
||||
// if TVA is on both side, we deduce it immediately
|
||||
if ( $oTva->get_parameter("both_side")==1)
|
||||
|
|
@ -681,6 +683,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$acc_operation->type='c';
|
||||
$acc_operation->periode=$tperiode;
|
||||
$acc_operation->insert_jrnx();
|
||||
if ( $value < 0 ) $tot_debit=bcadd($tot_debit,abs($value));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -706,7 +709,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$this->db->exec_sql('update quant_purchase set qp_internal = $1 where j_id in (select j_id from jrnx where j_grpt=$2)',
|
||||
array($internal,$seq));
|
||||
|
||||
/* if e_suggest != e_pj then do not increment sequence */
|
||||
/**= e_pj then do not increment sequence */
|
||||
if ( strcmp($e_pj,$e_pj_suggest) == 0 && strlen(trim($e_pj)) != 0 )
|
||||
{
|
||||
$this->inc_seq_pj();
|
||||
|
|
@ -794,7 +797,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
|
||||
/* insert into jrn */
|
||||
$acc_pay->mt=$mt;
|
||||
$acc_pay->desc=$e_comm;
|
||||
$acc_pay->desc=(!isset($e_comm_paiement) || strlen(trim($e_comm_paiement)) == 0) ?$e_comm:$e_comm_paiement;
|
||||
$mp_jr_id=$acc_pay->insert_jrn();
|
||||
$acjrn->grpt_id=$acseq;
|
||||
$acjrn->update_internal_code($acinternal);
|
||||
|
|
@ -972,7 +975,10 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
{
|
||||
$add_js="update_pj();";
|
||||
}
|
||||
$add_js.='get_last_date();';
|
||||
if ($g_parameter->MY_DATE_SUGGEST == 'Y')
|
||||
{
|
||||
$add_js.='get_last_date();';
|
||||
}
|
||||
$add_js.='update_name();';
|
||||
$add_js.='update_pay_method()';
|
||||
|
||||
|
|
@ -1083,10 +1089,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
/* use vat */
|
||||
if ( $g_parameter->MY_TVA_USE=='Y')
|
||||
{
|
||||
$march_tva_id=(isset(${"e_march$i"."_tva_id"}))?${"e_march$i"."_tva_id"}:""
|
||||
;
|
||||
$march_tva_amount=(isset(${"e_march$i"."_tva_amount"}))?${"e_march$i"."_tva_amount"}:""
|
||||
;
|
||||
$march_tva_id=(isset(${"e_march$i"."_tva_id"}))?${"e_march$i"."_tva_id"}:"";
|
||||
$march_tva_amount=(isset(${"e_march$i"."_tva_amount"}))?${"e_march$i"."_tva_amount"}:"";
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1210,7 +1214,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
ob_start();
|
||||
require_once('template/form_ledger_detail.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
// Set correctly the REQUEST param for jrn_type
|
||||
$r.= HtmlInput::hidden('jrn_type','ACH');
|
||||
|
|
@ -1267,7 +1271,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
$r.="<fieldset>";
|
||||
$r.="<legend>"._('En-tête facture fournisseur')." </legend>";
|
||||
$r.='<div id="jrn_name_div">';
|
||||
$r.='<h2 id="jrn_name">'.$this->get_name().'</h2>';
|
||||
$r.='<h2 class="title" id="jrn_name">'.$this->get_name().'</h2>';
|
||||
$r.='</div>';
|
||||
$r.='<TABLE width="100%">';
|
||||
$r.='<tr>';
|
||||
|
|
@ -1525,13 +1529,16 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
{
|
||||
$r.=HtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.$e_mp});
|
||||
$r.=HtmlInput::hidden('acompte',$acompte);
|
||||
$r.=HtmlInput::hidden('e_comm_paiement',$e_comm_paiement);
|
||||
/* needed for generating a invoice */
|
||||
$r.=HtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_mp});
|
||||
$fname = new Fiche($this->db);
|
||||
$fname->get_by_qcode(${'e_mp_qcode_' . $e_mp});
|
||||
$r.="<div style=\"clear:both\"></div>";
|
||||
$r.='<div style="float:left"><h2 class="info">' . "Payé par " . ${'e_mp_qcode_' . $e_mp} .
|
||||
" ".$fname->getName() ."</h2> ". _('Déduction acompte ').h($acompte).'</div>';
|
||||
" ".$fname->getName() ."</h2> ".
|
||||
'<p>'._('Déduction acompte ').h($acompte).'</p>'.
|
||||
_('Libellé :' ).h($e_comm_paiement).'</div>';
|
||||
$r.='<br>';
|
||||
}
|
||||
// check for upload piece
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PhpCompta.
|
||||
*
|
||||
|
|
@ -275,13 +275,12 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
$tot_tva=0;
|
||||
$tot_debit=0;
|
||||
$this->db->start();
|
||||
$tva=array();
|
||||
/* Save all the items without vat */
|
||||
for ($i=0;$i< $nb_item;$i++)
|
||||
{
|
||||
$n_both=0;
|
||||
if ( strlen(trim(${'e_march'.$i})) == 0 ) continue;
|
||||
if ( ${'e_march'.$i.'_price'} == 0 ) continue;
|
||||
if ( ${'e_quant'.$i} == 0 ) continue;
|
||||
|
||||
/* First we save all the items without vat */
|
||||
$fiche=new Fiche($this->db);
|
||||
|
|
@ -325,8 +324,8 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
$oTva=new Acc_Tva($this->db);
|
||||
$idx_tva=${'e_march'.$i.'_tva_id'};
|
||||
$tva_item=${'e_march'.$i.'_tva_amount'};
|
||||
$oTva->set_parameter("id",$idx_tva);
|
||||
$oTva->load();
|
||||
$oTva->set_parameter("id",$idx_tva);
|
||||
$oTva->load();
|
||||
/* if empty then we need to compute it */
|
||||
if (trim($tva_item)=='')
|
||||
{
|
||||
|
|
@ -339,18 +338,19 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
$tva[$idx_tva]+=$tva_item;
|
||||
else
|
||||
$tva[$idx_tva]=$tva_item;
|
||||
if ($oTva->get_parameter("both_side")==0) $tot_tva=round(bcadd($tva_item,$tot_tva),2);
|
||||
else $n_both=$tva_item;
|
||||
if ($oTva->get_parameter("both_side")==0) {
|
||||
$tot_tva=round(bcadd($tva_item,$tot_tva),2);
|
||||
}else {
|
||||
$n_both=$tva_item;
|
||||
if ( $n_both < 0 ) $tot_debit=bcadd($tot_debit,abs($n_both));
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the stock */
|
||||
/* if the quantity is < 0 then the stock increase (return of
|
||||
* material)
|
||||
*/
|
||||
$nNeg=($
|
||||
{"e_quant".$i
|
||||
}
|
||||
<0)?-1:1;
|
||||
$nNeg=(${"e_quant".$i}<0)?-1:1;
|
||||
|
||||
// always save quantity but in withStock we can find
|
||||
// what card need a stock management
|
||||
|
|
@ -478,7 +478,7 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
|
||||
$this->pj=$acc_operation->set_pj();
|
||||
|
||||
/* if e_suggest != e_pj then do not increment sequence */
|
||||
/**= e_pj then do not increment sequence */
|
||||
/* and e_pj is not null */
|
||||
if ( strcmp($e_pj,$e_pj_suggest) == 0 && strlen( trim($e_pj)) != 0 )
|
||||
{
|
||||
|
|
@ -566,8 +566,9 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
$let_other=$acc_pay->insert_jrnx();
|
||||
|
||||
/* insert into jrn */
|
||||
$acjrn->desc=$e_comm;
|
||||
$acc_pay->mt=$mt;
|
||||
$acjrn->grpt_id=$acseq;
|
||||
$acc_pay->desc=(!isset($e_comm_paiement) || strlen(trim($e_comm_paiement)) == 0) ?$e_comm:$e_comm_paiement;
|
||||
$mp_jr_id=$acc_pay->insert_jrn();
|
||||
$acjrn->update_internal_code($acinternal);
|
||||
|
||||
|
|
@ -664,7 +665,7 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
$r.="<fieldset>";
|
||||
$r.="<legend>"._('En-tête facture client')." </legend>";
|
||||
$r.='<div id="jrn_name_div">';
|
||||
$r.='<h2 id="jrn_name" style="display:inline">' . $this->get_name() . '</h2>';
|
||||
$r.='<h2 class="title" id="jrn_name" style="display:inline">' . $this->get_name() . '</h2>';
|
||||
$r.= '</div>';
|
||||
$r.='<TABLE width="100%">';
|
||||
$r.='<tr>';
|
||||
|
|
@ -906,6 +907,7 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
{
|
||||
$r.=HtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.$e_mp});
|
||||
$r.=HtmlInput::hidden('acompte',$acompte);
|
||||
$r.=HtmlInput::hidden('e_comm_paiement',$e_comm_paiement);
|
||||
/* needed for generating a invoice */
|
||||
$r.=HtmlInput::hidden('qcode_benef',${'e_mp_qcode_'.$e_mp});
|
||||
|
||||
|
|
@ -913,7 +915,8 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
$fname->get_by_qcode(${'e_mp_qcode_'.$e_mp});
|
||||
$r.="<div style=\"clear:both\"></div>";
|
||||
$r.='<div style="float:left"><h2 class="info">'."Payé par ".${'e_mp_qcode_'.$e_mp}.
|
||||
" ".$fname->getName().'</H2> '._('Déduction acompte ').h($acompte).'</div>';
|
||||
" ".$fname->getName().'</H2> '.'<p>'._('Déduction acompte ').h($acompte).'</p>'.
|
||||
_('Libellé :' ).h($e_comm_paiement).'</div>';
|
||||
$r.='<br>';
|
||||
}
|
||||
|
||||
|
|
@ -1104,7 +1107,10 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
{
|
||||
$add_js="update_pj();";
|
||||
}
|
||||
$add_js.='get_last_date();';
|
||||
if ($g_parameter->MY_DATE_SUGGEST == 'Y')
|
||||
{
|
||||
$add_js.='get_last_date();';
|
||||
}
|
||||
$add_js.='update_name();';
|
||||
$add_js.='update_pay_method()';
|
||||
|
||||
|
|
@ -1336,7 +1342,7 @@ class Acc_Ledger_Sold extends Acc_Ledger
|
|||
ob_start();
|
||||
require_once('template/form_ledger_detail.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ class Acc_Operation
|
|||
$csv="";
|
||||
foreach ($show as $l)
|
||||
{
|
||||
if ( $l['j_poste'] == $this->poste || $l['j_qcode']==$this->qcode)
|
||||
if ( $l['j_poste'] == $this->poste || ($l['j_qcode']==$this->qcode && trim($this->qcode) != ''))
|
||||
$border=' style="border-bottom:1px solid red;"';
|
||||
else
|
||||
$border='';
|
||||
|
|
@ -468,7 +468,7 @@ class Acc_Operation
|
|||
}
|
||||
/**
|
||||
*@brief retrieve data from jrnx and jrn
|
||||
*@return return an object
|
||||
*@return return an object
|
||||
*@note
|
||||
*@see
|
||||
@code
|
||||
|
|
@ -562,7 +562,7 @@ class Acc_Detail extends Acc_Operation
|
|||
/**
|
||||
*@brief this class manage data from the JRNX and JRN
|
||||
* table
|
||||
*@note Data member are the column of the table
|
||||
*@note Data member are the column of the table
|
||||
*/
|
||||
class Acc_Misc extends Acc_Detail
|
||||
{
|
||||
|
|
@ -588,7 +588,7 @@ class Acc_Misc extends Acc_Detail
|
|||
/**
|
||||
*@brief this class manage data from the QUANT_SOLD
|
||||
* table
|
||||
*@note Data member are the column of the table
|
||||
*@note Data member are the column of the table
|
||||
*/
|
||||
class Acc_Sold extends Acc_Detail
|
||||
{
|
||||
|
|
@ -602,7 +602,7 @@ class Acc_Sold extends Acc_Detail
|
|||
{
|
||||
parent::get();
|
||||
$sql="SELECT qs_id, qs_internal, qs_fiche, qs_quantite, qs_price, qs_vat,
|
||||
qs_vat_code, qs_client, qs_valid, j_id,j_text
|
||||
qs_vat_code, qs_client, qs_valid, j_id,j_text,qs_vat_sided
|
||||
FROM quant_sold join jrnx using(j_id) where j_grpt=$1";
|
||||
$this->det->array=$this->db->get_array($sql,array($this->det->jr_grpt_id));
|
||||
}
|
||||
|
|
@ -611,8 +611,8 @@ class Acc_Sold extends Acc_Detail
|
|||
/**
|
||||
*@brief this class manage data from the QUANT_PURCHASE
|
||||
* table
|
||||
*@note Data member are the column of the table
|
||||
|
||||
*@note Data member are the column of the table
|
||||
|
||||
*/
|
||||
class Acc_Purchase extends Acc_Detail
|
||||
{
|
||||
|
|
@ -627,7 +627,7 @@ class Acc_Purchase extends Acc_Detail
|
|||
parent::get();
|
||||
$sql="SELECT qp_id, qp_internal, j_id, qp_fiche, qp_quantite, qp_price, qp_vat,
|
||||
qp_vat_code, qp_nd_amount, qp_nd_tva, qp_nd_tva_recup, qp_supplier,
|
||||
qp_valid, qp_dep_priv,j_text
|
||||
qp_valid, qp_dep_priv,j_text,qp_vat_sided
|
||||
FROM quant_purchase join jrnx using(j_id) where j_grpt=$1";
|
||||
$this->det->array=$this->db->get_array($sql,array($this->det->jr_grpt_id));
|
||||
}
|
||||
|
|
@ -636,7 +636,7 @@ class Acc_Purchase extends Acc_Detail
|
|||
/**
|
||||
*@brief this class manage data from the QUANT_FIN
|
||||
* table
|
||||
*@note Data member are the column of the table
|
||||
*@note Data member are the column of the table
|
||||
*/
|
||||
class Acc_Fin extends Acc_Detail
|
||||
{
|
||||
|
|
|
|||
|
|
@ -225,50 +225,6 @@ class Acc_Payment
|
|||
}
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
*@deprecated
|
||||
* @return string
|
||||
*/
|
||||
public function row_deprecated()
|
||||
{
|
||||
//---------------------------------------------------------------------------
|
||||
// Common variable
|
||||
$td='<TD>';
|
||||
$etd='</td>';
|
||||
$tr='<tr>';
|
||||
$etr='</tr>';
|
||||
$th='<th>';
|
||||
$eth='</th>';
|
||||
|
||||
$r='';
|
||||
if ( $this->jrn_def_id != '' )
|
||||
{
|
||||
$name=$this->cn->get_value("select jrn_def_name from jrn_def where jrn_def_id=$1",
|
||||
array($this->jrn_def_id));
|
||||
}
|
||||
$r.=td($this->mp_lib);
|
||||
|
||||
if ( $this->mp_fd_id != NULL && $this->mp_fd_id !=0)
|
||||
{
|
||||
$fiche=new Fiche_Def($this->cn,$this->mp_fd_id);
|
||||
$fiche->Get();
|
||||
$r.=td($fiche->label);
|
||||
}
|
||||
else
|
||||
$r.=$td.$etd;
|
||||
$jrn=new Acc_Ledger($this->cn,$this->mp_jrn_def_id);
|
||||
$r.=$td.$jrn->get_name().$etd;
|
||||
if ( strlen(trim($this->mp_qcode)) != 0 )
|
||||
{
|
||||
$f=new Fiche($this->cn);
|
||||
$f->get_by_qcode($this->mp_qcode);
|
||||
$r.=td($f->strAttribut(ATTR_DEF_NAME));
|
||||
|
||||
}
|
||||
else
|
||||
$r.=$td.$etd;
|
||||
return $r;
|
||||
}
|
||||
/*!\brief return a string with a form (into a table)
|
||||
*\param none
|
||||
*\return a html string
|
||||
|
|
@ -335,7 +291,16 @@ class Acc_Payment
|
|||
$acompte->value=0;
|
||||
$r.=_(" Acompte à déduire");
|
||||
$r.=$acompte->input();
|
||||
}
|
||||
$r.='<p>';
|
||||
$e_comm_paiement=new IText('e_comm_paiement');
|
||||
$e_comm_paiement->table = 0;
|
||||
$e_comm_paiement->setReadOnly(false);
|
||||
$e_comm_paiement->size = 60;
|
||||
$e_comm_paiement->tabindex = 3;
|
||||
$r.=_(" Libellé du paiement");
|
||||
$r.=$e_comm_paiement->input();
|
||||
$r.='</p>';
|
||||
}
|
||||
|
||||
$r.='<ol>';
|
||||
$r.='<li ><input type="radio" name="e_mp" value="0" checked>'._('Paiement encodé plus tard');
|
||||
|
|
@ -350,7 +315,7 @@ class Acc_Payment
|
|||
{
|
||||
$a=new ICard();
|
||||
$a->jrn=$row->mp_jrn_def_id;
|
||||
$a->set_attribute('typecard',$row->mp_fd_id);
|
||||
$a->set_attribute('typecard',$row->mp_fd_id);
|
||||
$a->name='e_mp_qcode_'.$row->mp_id;
|
||||
$a->set_dblclick("fill_ipopcard(this);");
|
||||
$a->set_callback('filter_card');
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ class Anticipation
|
|||
*/
|
||||
public function display()
|
||||
{
|
||||
bcscale(4);
|
||||
$forecast=new Forecast($this->cn,$this->f_id);
|
||||
$forecast->load();
|
||||
$str_name=h($forecast->get_parameter('name'));
|
||||
|
|
@ -176,7 +177,7 @@ class Anticipation
|
|||
ob_start();
|
||||
require_once('template/forecast_result.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
public static function div()
|
||||
|
|
@ -246,7 +247,7 @@ class Anticipation
|
|||
ob_start();
|
||||
require_once('template/forecast_cat.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
|
|
@ -309,7 +310,7 @@ class Anticipation
|
|||
ob_start();
|
||||
require_once('template/forecast_cat.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
|
||||
}
|
||||
|
|
@ -342,7 +343,7 @@ class Anticipation
|
|||
$cat=new Forecast_Cat($this->cn);
|
||||
$array=$cat->make_array($this->f_id);
|
||||
$periode=new Periode($this->cn);
|
||||
$aPeriode=$this->cn->make_array("select p_id,to_char(p_start,'MM.YYYY') as label from parm_periode
|
||||
$aPeriode=$this->cn->make_array("select p_id,to_char(p_start,'MM.YYYY') as label from parm_periode
|
||||
where p_start >= (select p_start from parm_periode where p_id=$str_start)
|
||||
and p_end <= (select p_end from parm_periode where p_id=$str_end)
|
||||
order by p_start");
|
||||
|
|
@ -433,7 +434,7 @@ class Anticipation
|
|||
ob_start();
|
||||
require_once('template/forecast-detail.php');
|
||||
$r.=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class Calendar
|
|||
for ($i=0;$i<count($array);$i++)
|
||||
{
|
||||
$ind=$array[$i]['ag_timestamp_day'];
|
||||
$p_array[$ind].="<span class=\"notice\">".$array[$i]['nb']." "._("Tâches suivis").'</span>';
|
||||
$p_array[$ind].="<span class=\"notice\">".$array[$i]['nb']." "._("Tâches suivies").'</span>';
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -90,6 +90,8 @@ class Calendar
|
|||
*/
|
||||
function display()
|
||||
{
|
||||
global $g_user;
|
||||
$exercice_user=$g_user->get_exercice();
|
||||
/* day */
|
||||
$cell=array();
|
||||
for ($i=0;$i<42;$i++)
|
||||
|
|
@ -104,7 +106,7 @@ class Calendar
|
|||
$this->fill_from_todo($cell);
|
||||
$wMonth=new ISelect('per');
|
||||
$cn=new Database(dossier::id());
|
||||
$wMonth->value=$cn->make_array("select p_id,to_char(p_start,'MM/YYYY') from parm_periode order by p_start");
|
||||
$wMonth->value=$cn->make_array("select p_id,to_char(p_start,'MM/YYYY') from parm_periode where p_exercice = '$exercice_user' order by p_start");
|
||||
$wMonth->selected=$this->default_periode;
|
||||
$wMonth->javascript="onchange=change_month(this)";
|
||||
$wMonth->set_attribute('gDossier',dossier::id());
|
||||
|
|
|
|||
|
|
@ -549,6 +549,39 @@ class Database
|
|||
if ( $r > 0 ) return true;
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* return the name of the database with the domain name
|
||||
* @param $p_id of the folder WITHOUT the domain name
|
||||
* @param $p_type dos for folder mod for template
|
||||
* @return formatted name
|
||||
*/
|
||||
function format_name($p_id,$p_type)
|
||||
{
|
||||
switch ($p_type)
|
||||
{
|
||||
case 'dos':
|
||||
$sys_name=sprintf("%sdossier%d",strtolower(domaine),$p_id);
|
||||
break;
|
||||
case 'mod':
|
||||
$sys_name=sprintf("%smod%d",strtolower(domaine),$p_id);
|
||||
break;
|
||||
default:
|
||||
echo_error(__FILE__." format_name invalid type ".$p_type, __LINE__);
|
||||
exit();
|
||||
}
|
||||
return $sys_name;
|
||||
}
|
||||
/**
|
||||
* Count the database name in a system view
|
||||
* @param $p_name string database name
|
||||
* @return number of database found (normally 0 or 1)
|
||||
*/
|
||||
function exist_database($p_name)
|
||||
{
|
||||
$database_exist=$this->get_value('select count(*)
|
||||
from pg_catalog.pg_database where datname = lower($1)',array($p_name));
|
||||
return $database_exist;
|
||||
}
|
||||
/**
|
||||
*@brief check if the large object exists
|
||||
*@param $p_oid of the large object
|
||||
|
|
|
|||
|
|
@ -235,13 +235,23 @@ class Document
|
|||
|
||||
$to_remove=$pattern;
|
||||
// we remove the < and > from the pattern
|
||||
$pattern=str_replace($lt,'',$pattern);
|
||||
$pattern=str_replace($gt,'',$pattern);
|
||||
$tag=str_replace($lt,'',$pattern);
|
||||
$tag=str_replace($gt,'',$tag);
|
||||
|
||||
|
||||
// if the pattern if found we replace it
|
||||
$value=$this->Replace($pattern,$p_array);
|
||||
$value=$this->Replace($tag,$p_array);
|
||||
if ( strpos($value,'ERROR') != false ) $value="";
|
||||
/*
|
||||
* Change type of cell to numeric
|
||||
* allow numeric cel in ODT for the formatting and formula
|
||||
*/
|
||||
if ( is_numeric($value) && $p_type=='OOo')
|
||||
{
|
||||
$searched='/office:value-type="string"><text:p>'.$pattern.'/';
|
||||
$replaced='office:value-type="float" office:value="'.$value.'"><text:p>'.$pattern;
|
||||
$buffer=preg_replace($searched, $replaced, $buffer,1);
|
||||
}
|
||||
// replace into the $buffer
|
||||
// take the position in the buffer
|
||||
$pos=strpos($buffer,$to_remove);
|
||||
|
|
@ -368,7 +378,7 @@ class Document
|
|||
$r='<A class="mtitle" HREF="show_document.php?d_id='.$this->d_id.'&'.dossier::get().'">'.$image.'</A>';
|
||||
return $r;
|
||||
}
|
||||
/* ! Get
|
||||
/** Get
|
||||
* \brief Send the document
|
||||
*/
|
||||
function Send()
|
||||
|
|
@ -1080,7 +1090,28 @@ class Document
|
|||
return $p_array['acompte'];
|
||||
return "0";
|
||||
break;
|
||||
}
|
||||
case 'STOCK_NAME':
|
||||
if ( ! isset ($p_array['repo'])) return "";
|
||||
$ret=$this->db->get_value('select r_name from public.stock_repository where r_id=$1',array($p_array['repo']));
|
||||
return $ret;
|
||||
case 'STOCK_ADRESS':
|
||||
if ( ! isset ($p_array['repo'])) return "";
|
||||
$ret=$this->db->get_value('select r_adress from public.stock_repository where r_id=$1',array($p_array['repo']));
|
||||
return $ret;
|
||||
case 'STOCK_COUNTRY':
|
||||
if ( ! isset ($p_array['repo'])) return "";
|
||||
$ret=$this->db->get_value('select r_country from public.stock_repository where r_id=$1',array($p_array['repo']));
|
||||
return $ret;
|
||||
case 'STOCK_CITY':
|
||||
if ( ! isset ($p_array['repo'])) return "";
|
||||
$ret=$this->db->get_value('select r_city from public.stock_repository where r_id=$1',array($p_array['repo']));
|
||||
return $ret;
|
||||
case 'STOCK_PHONE':
|
||||
if ( ! isset ($p_array['repo'])) return "";
|
||||
$ret=$this->db->get_value('select r_phone from public.stock_repository where r_id=$1',array($p_array['repo']));
|
||||
return $ret;
|
||||
|
||||
}
|
||||
/*
|
||||
* retrieve the value of ATTR for e_march
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -20,17 +20,17 @@
|
|||
/* $Revision$ */
|
||||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
/* ! \file
|
||||
/** \file
|
||||
* \brief class for the table document_type
|
||||
*/
|
||||
|
||||
/* ! \brief class for the table document_type
|
||||
/** \brief class for the table document_type
|
||||
* < dt_id pk document_type
|
||||
* < dt_value value
|
||||
*/
|
||||
class Document_type
|
||||
{
|
||||
/* ! document_type
|
||||
/** document_type
|
||||
* \brief constructor
|
||||
* \param $p_cn database connx
|
||||
*/
|
||||
|
|
@ -41,7 +41,7 @@ class Document_type
|
|||
$this->dt_id = $p_id;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Get all the data for this dt_id
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/*!\file
|
||||
* \brief about the accountant exercice
|
||||
* \brief about the accountant exercice
|
||||
*/
|
||||
require_once('class_database.php');
|
||||
require_once('class_iselect.php');
|
||||
|
|
@ -56,4 +56,23 @@ class Exercice
|
|||
$iselect->javascript=$js;
|
||||
return $iselect;
|
||||
}
|
||||
/**
|
||||
*Show a ISelect with the different exercices, display start and end date
|
||||
*@param $name of the iselect
|
||||
*@param $selected the selected year (default = '')
|
||||
*@param $js javascript (default = '')
|
||||
*@return ISelect object
|
||||
*/
|
||||
function select_date($name,$selected='',$js='')
|
||||
{
|
||||
$iselect=new ISelect($name);
|
||||
$iselect->value=$this->cn->make_array("select distinct p_exercice,to_char (min(p_start),'DD.MM.YY')
|
||||
||' - '
|
||||
||to_char (max(p_end),'DD.MM.YY')
|
||||
from parm_periode
|
||||
group by p_exercice order by 1");
|
||||
$iselect->selected=$selected;
|
||||
$iselect->javascript=$js;
|
||||
return $iselect;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,7 +178,9 @@ class Fiche
|
|||
if ( sizeof($this->attribut) != sizeof($e->attribut ) )
|
||||
{
|
||||
|
||||
// !!! Missing attribute
|
||||
/*
|
||||
* !! Missing attribute
|
||||
*/
|
||||
foreach ($e->attribut as $f )
|
||||
{
|
||||
$flag=0;
|
||||
|
|
@ -428,7 +430,7 @@ class Fiche
|
|||
foreach ($array as $attr)
|
||||
{
|
||||
$table=0;
|
||||
$msg="";
|
||||
$msg="";$bulle='';
|
||||
if ( $attr->ad_id == ATTR_DEF_ACCOUNT)
|
||||
{
|
||||
$w=new IPoste("av_text".$attr->ad_id);
|
||||
|
|
@ -521,8 +523,11 @@ class Fiche
|
|||
$w->table = $table;
|
||||
$w->label = $attr->ad_text;
|
||||
$w->name = "av_text" . $attr->ad_id;
|
||||
|
||||
$r.="<TR>" . td($w->label, ' class="input_text" ') . td($w->input()." $msg")." </TR>";
|
||||
if ($attr->ad_id == 21 || $attr->ad_id==22||$attr->ad_id==20||$attr->ad_id==31)
|
||||
{
|
||||
$bulle=HtmlInput::infobulle(21);
|
||||
}
|
||||
$r.="<TR>" . td($w->label." $bulle", ' class="input_text" ') . td($w->input()." $msg")." </TR>";
|
||||
}
|
||||
$r.= '</table>';
|
||||
return $r;
|
||||
|
|
@ -690,7 +695,10 @@ class Fiche
|
|||
$w->name = "av_text" . $r->ad_id;
|
||||
$w->readOnly = $p_readonly;
|
||||
|
||||
|
||||
if ($r->ad_id == 21 || $r->ad_id==22||$r->ad_id==20||$r->ad_id==31)
|
||||
{
|
||||
$bulle=HtmlInput::infobulle(21);
|
||||
}
|
||||
$ret.="<TR>" . td($r->ad_text . $bulle) . td($w->input()." ". $msg) . " </TR>";
|
||||
}
|
||||
|
||||
|
|
@ -774,6 +782,19 @@ class Fiche
|
|||
|
||||
if ( strlen(trim($v)) != 0)
|
||||
{
|
||||
if( strpos($value,',')==0)
|
||||
{
|
||||
$v=$this->cn->get_value("select format_account($1)",array($value));
|
||||
} else {
|
||||
$ac_array = explode(",", $value);
|
||||
if (count($ac_array) <> 2)
|
||||
throw new Exception('Désolé, il y a trop de virgule dans le poste comptable ' . h($value));
|
||||
$part1 = $ac_array[0];
|
||||
$part2 = $ac_array[1];
|
||||
$part1 = $this->cn->get_value('select format_account($1)', array($part1));
|
||||
$part2 = $this->cn->get_value('select format_account($1)', array($part2));
|
||||
$v = $part1 . ',' . $part2;
|
||||
}
|
||||
$parameter=array($this->id,$v);
|
||||
}
|
||||
else
|
||||
|
|
@ -895,6 +916,10 @@ class Fiche
|
|||
$part2 = $this->cn->get_value('select format_account($1)', array($part2));
|
||||
$v = $part1 . ',' . $part2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$v=$this->cn->get_value('select format_account($1)',array($value));
|
||||
}
|
||||
$sql = sprintf("select account_update(%d,'%s')", $this->id, $v);
|
||||
try
|
||||
{
|
||||
|
|
@ -1262,7 +1287,7 @@ class Fiche
|
|||
$vw_operation=sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s</A>',
|
||||
$op['jr_id'], dossier::id(), $op['jr_internal']);
|
||||
$let='';
|
||||
if ( $op['letter'] !=-1) $let=$op['letter'];
|
||||
if ( $op['letter'] !=-1) $let= strtoupper(base_convert($op['letter'],10,36));
|
||||
|
||||
$tmp_diff=bcsub($op['deb_montant'],$op['cred_montant']);
|
||||
|
||||
|
|
@ -1483,6 +1508,7 @@ class Fiche
|
|||
function Summary($p_search="",$p_action="",$p_sql="",$p_amount=false)
|
||||
{
|
||||
global $g_user;
|
||||
bcscale(4);
|
||||
$str_dossier=dossier::get();
|
||||
$p_search=sql_string($p_search);
|
||||
$script=$_SERVER['PHP_SELF'];
|
||||
|
|
@ -1535,7 +1561,7 @@ class Fiche
|
|||
return $r;
|
||||
|
||||
$i=0;
|
||||
|
||||
$deb=0;$cred=0;
|
||||
foreach ($step_tiers as $tiers )
|
||||
{
|
||||
$i++;
|
||||
|
|
@ -1559,14 +1585,18 @@ class Fiche
|
|||
" ".$tiers->strAttribut(ATTR_DEF_PAYS)).
|
||||
"</TD>";
|
||||
|
||||
$r.='<TD align="right"> '.(($amount['debit']==0)?0:nbm($amount['debit'])).'€</TD>';
|
||||
$r.='<TD align="right"> '.(($amount['credit']==0)?0:nbm($amount['credit'])).'€</TD>';
|
||||
$r.='<TD align="right"> '.nbm($amount['solde'])."€</TD>";
|
||||
|
||||
$r.='<TD align="right"> '.(($amount['debit']==0)?0:nbm($amount['debit'])).'</TD>';
|
||||
$r.='<TD align="right"> '.(($amount['credit']==0)?0:nbm($amount['credit'])).'</TD>';
|
||||
$r.='<TD align="right"> '.nbm($amount['solde'])."</TD>";
|
||||
$deb=bcadd($deb,$amount['debit']);
|
||||
$cred=bcadd($cred,$amount['credit']);
|
||||
|
||||
$r.="</TR>";
|
||||
|
||||
}
|
||||
$r.="<tr>";
|
||||
$solde=bcsub($deb,$cred);
|
||||
$r.=td("").td("").td("Totaux").td(nbm($deb),'class="num"').td(nbm($cred),'class="num"').td(nbm($solde),'class="num"');
|
||||
$r.="</TABLE>";
|
||||
$r.=$bar;
|
||||
return $r;
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ $order
|
|||
alert (_('Le nom de la catégorie ne peut pas être vide'));
|
||||
return 1;
|
||||
}
|
||||
// $p_FICHE_REF cannot be null !!! (== fiche_def_ref.frd_id
|
||||
/**!! (== fiche_def_ref.frd_id
|
||||
if (! isset ($p_FICHE_REF) || strlen($p_FICHE_REF) == 0 )
|
||||
{
|
||||
echo alert (_('Vous devez choisir une categorie'));
|
||||
|
|
@ -254,15 +254,13 @@ $order
|
|||
$sql="select account_add($1,$2)";
|
||||
$Res=$this->cn->exec_sql($sql,array($p_class_base,$p_nom_mod));
|
||||
}
|
||||
// Get the fd_id
|
||||
$fd_id=$this->cn->get_current_seq('s_fdef');
|
||||
|
||||
// Get the fd_id
|
||||
$fd_id=$this->cn->get_current_seq('s_fdef');
|
||||
|
||||
// update jnt_fic_attr
|
||||
$sql=sprintf("insert into jnt_fic_attr(fd_id,ad_id,jnt_order)
|
||||
values (%d,%d,10)",$fd_id,ATTR_DEF_ACCOUNT);
|
||||
$Res=$this->cn->exec_sql($sql);
|
||||
|
||||
// update jnt_fic_attr
|
||||
$sql=sprintf("insert into jnt_fic_attr(fd_id,ad_id,jnt_order)
|
||||
values (%d,%d,10)",$fd_id,ATTR_DEF_ACCOUNT);
|
||||
$Res=$this->cn->exec_sql($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -291,11 +289,15 @@ $order
|
|||
$order=$jnt_order;
|
||||
if ( $v['ad_id'] == ATTR_DEF_NAME )
|
||||
$order=0;
|
||||
$sql=sprintf("insert into jnt_fic_Attr(fd_id,ad_id,jnt_order)
|
||||
$count=$this->cn->get_value("select count(*) from jnt_fic_attr where fd_id=$1 and ad_id=$2",array($fd_id,$v['ad_id']));
|
||||
if ($count == 0)
|
||||
{
|
||||
$sql=sprintf("insert into jnt_fic_Attr(fd_id,ad_id,jnt_order)
|
||||
values (%d,%s,%d)",
|
||||
$fd_id,$v['ad_id'],$order);
|
||||
$this->cn->exec_sql($sql);
|
||||
$jnt_order+=10;
|
||||
$this->cn->exec_sql($sql);
|
||||
$jnt_order+=10;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->id=$fd_id;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ require_once('class_inum.php');
|
|||
require_once 'class_sort_table.php';
|
||||
require_once 'class_irelated_action.php';
|
||||
|
||||
/* !\file
|
||||
/**
|
||||
* \file
|
||||
* \brief class_action for manipulating actions
|
||||
* action can be :
|
||||
* <ul>
|
||||
|
|
@ -49,7 +50,7 @@ require_once 'class_irelated_action.php';
|
|||
* </ul>
|
||||
* The table document_type are the possible actions
|
||||
*/
|
||||
/* !
|
||||
/**
|
||||
* \brief class_action for manipulating actions
|
||||
* action can be :
|
||||
* <ul>
|
||||
|
|
@ -62,24 +63,25 @@ require_once 'class_irelated_action.php';
|
|||
|
||||
class Follow_Up
|
||||
{
|
||||
|
||||
|
||||
var $db; /* !< $db database connexion */
|
||||
var $ag_timestamp; /* !< $ag_timestamp document date (ag_gestion.ag_timestamp) */
|
||||
var $dt_id; /* !< $dt_id type of the document (document_type.dt_id) */
|
||||
var $ag_state; /* !< $ag_state stage of the document (printed, send to client...) */
|
||||
var $d_number; /* !< $d_number number of the document */
|
||||
var $d_filename; /* !< $d_filename filename's document */
|
||||
var $d_mimetype; /* !< $d_mimetype document's filename */
|
||||
var $ag_title; /* !< $ag_title title document */
|
||||
var $f_id; /* !< $f_id_dest fiche id (From field ) */
|
||||
var $ag_ref; /* !< $ag_ref is the ref */
|
||||
var $ag_hour; /* !< $ag_hour is the hour of the meeting, action */
|
||||
var $ag_priority; /* !< $ag_priority is the priority 1 High, 2 medium, 3 low */
|
||||
var $ag_dest; /* !< $ag_dest person who is in charged */
|
||||
var $ag_contact; /* !< $ag_contact contact */
|
||||
var $ag_remind_date; /* !< $ag_contact contact */
|
||||
var $db; /*!< $db database connexion */
|
||||
var $ag_timestamp; /*!< $ag_timestamp document date (ag_gestion.ag_timestamp) */
|
||||
var $dt_id; /*!< $dt_id type of the document (document_type.dt_id) */
|
||||
var $ag_state; /*!< $ag_state stage of the document (printed, send to client...) */
|
||||
var $d_number; /*!< $d_number number of the document */
|
||||
var $d_filename; /*!< $d_filename filename's document */
|
||||
var $d_mimetype; /*!< $d_mimetype document's filename */
|
||||
var $ag_title; /*!< $ag_title title document */
|
||||
var $f_id; /*!< $f_id_dest fiche id (From field ) */
|
||||
var $ag_ref; /*!< $ag_ref is the ref */
|
||||
var $ag_hour; /*!< $ag_hour is the hour of the meeting, action */
|
||||
var $ag_priority; /*!< $ag_priority is the priority 1 High, 2 medium, 3 low */
|
||||
var $ag_dest; /*!< $ag_dest person who is in charged */
|
||||
var $ag_contact; /*!< $ag_contact contact */
|
||||
var $ag_remind_date; /*!< $ag_contact contact */
|
||||
|
||||
/* ! constructor
|
||||
/** constructor
|
||||
* \brief constructor
|
||||
* \param p_cn database connection
|
||||
*/
|
||||
|
|
@ -106,7 +108,7 @@ class Follow_Up
|
|||
return $sql;
|
||||
}
|
||||
//----------------------------------------------------------------------
|
||||
/* !
|
||||
/**
|
||||
* \brief Display the object, the tags for the FORM
|
||||
* are in the caller. It will be used for adding and updating
|
||||
* action
|
||||
|
|
@ -114,7 +116,7 @@ class Follow_Up
|
|||
* it is a new document
|
||||
*
|
||||
* \param $p_view if set to true the form will be in readonly mode (value: true or false)
|
||||
* \param $p_gen true we show the tag for generating a doc (value : true or false)
|
||||
* \param $p_gen true we show the tag for generating a doc (value : true or false) and adding files
|
||||
* \param $p_base is the ac parameter
|
||||
* \param $retour is the html code for the return button
|
||||
* \note update the reference number or the document type is not allowed
|
||||
|
|
@ -177,7 +179,7 @@ class Follow_Up
|
|||
$desc->width = 120;
|
||||
$desc->heigh = 40;
|
||||
}
|
||||
$acomment = $this->db->get_array("SELECT agc_id, ag_id, to_char(agc_date,'DD.MM.YYYY') as str_agc_date, agc_comment, tech_user
|
||||
$acomment = $this->db->get_array("SELECT agc_id, ag_id, to_char(agc_date,'DD.MM.YYYY HH24:MI') as str_agc_date, agc_comment, tech_user
|
||||
FROM action_gestion_comment where ag_id=$1 order by agc_id;", array($this->ag_id)
|
||||
);
|
||||
|
||||
|
|
@ -414,7 +416,7 @@ class Follow_Up
|
|||
/* TVA */
|
||||
$itva = new ITva_Popup($this->db);
|
||||
$itva->in_table = true;
|
||||
|
||||
$aCard=array();
|
||||
/* create aArticle for the detail section */
|
||||
for ($i = 0; $i < MAX_ARTICLE; $i++)
|
||||
{
|
||||
|
|
@ -428,6 +430,7 @@ class Follow_Up
|
|||
$tmp_ad = (isset($this->aAction_detail[$i])) ? $this->aAction_detail[$i] : false;
|
||||
$icard->readOnly=$readonly;
|
||||
$icard->value = '';
|
||||
$aCard[$i]=0;
|
||||
if ($tmp_ad)
|
||||
{
|
||||
$march = new Fiche($this->db);
|
||||
|
|
@ -436,6 +439,7 @@ class Follow_Up
|
|||
{
|
||||
$march->id = $f;
|
||||
$icard->value = $march->get_quick_code();
|
||||
$aCard[$i]=$f;
|
||||
}
|
||||
}
|
||||
$icard->set_dblclick("fill_ipopcard(this);");
|
||||
|
|
@ -451,6 +455,7 @@ class Follow_Up
|
|||
|
||||
$text->javascript = ' onchange="clean_tva(' . $i . ');compute_ledger(' . $i . ')"';
|
||||
$text->name = "e_march" . $i . "_label";
|
||||
$text->id = "e_march" . $i . "_label";
|
||||
$text->size = 40;
|
||||
$text->value = ($tmp_ad) ? $tmp_ad->get_parameter('text') : "";
|
||||
$text->readOnly=$readonly;
|
||||
|
|
@ -458,17 +463,20 @@ class Follow_Up
|
|||
|
||||
$num->javascript = ' onchange="format_number(this);clean_tva(' . $i . ');compute_ledger(' . $i . ')"';
|
||||
$num->name = "e_march" . $i . "_price";
|
||||
$num->id = "e_march" . $i . "_price";
|
||||
$num->size = 8;
|
||||
$num->readOnly=$readonly;
|
||||
$num->value = ($tmp_ad) ? $tmp_ad->get_parameter('price_unit') : 0;
|
||||
$aArticle[$i]['pu'] = $num->input();
|
||||
|
||||
$num->name = "e_quant" . $i;
|
||||
$num->id = "e_quant" . $i;
|
||||
$num->size = 8;
|
||||
$num->value = ($tmp_ad) ? $tmp_ad->get_parameter('quantity') : 0;
|
||||
$aArticle[$i]['quant'] = $num->input();
|
||||
|
||||
$itva->name = 'e_march' . $i . '_tva_id';
|
||||
$itva->id = 'e_march' . $i . '_tva_id';
|
||||
$itva->value = ($tmp_ad) ? $tmp_ad->get_parameter('tva_id') : 0;
|
||||
$itva->readOnly=$readonly;
|
||||
$itva->js = ' onchange="format_number(this);clean_tva(' . $i . ');compute_ledger(' . $i . ')"';
|
||||
|
|
@ -477,12 +485,14 @@ class Follow_Up
|
|||
$aArticle[$i]['tvaid'] = $itva->input();
|
||||
|
||||
$num->name = "e_march" . $i . "_tva_amount";
|
||||
$num->id = "e_march" . $i . "_tva_amount";
|
||||
$num->value = ($tmp_ad) ? $tmp_ad->get_parameter('tva_amount') : 0;
|
||||
$num->javascript = " onchange=\"compute_ledger(' . $i . ')\"";
|
||||
$num->size = 8;
|
||||
$aArticle[$i]['tva'] = $num->input();
|
||||
|
||||
$num->name = "tvac_march" . $i;
|
||||
$num->id = "tvac_march" . $i;
|
||||
$num->value = ($tmp_ad) ? $tmp_ad->get_parameter('total') : 0;
|
||||
$num->size = 8;
|
||||
$aArticle[$i]['tvac'] = $num->input();
|
||||
|
|
@ -498,7 +508,7 @@ class Follow_Up
|
|||
/* add the number of item */
|
||||
$Hid = new IHidden();
|
||||
$r.=$Hid->input("nb_item", MAX_ARTICLE);
|
||||
$r.=HtmlInput::request_to_hidden(array("remind_date_end","remind_date","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate"));
|
||||
$r.=HtmlInput::request_to_hidden(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate"));
|
||||
/* get template */
|
||||
ob_start();
|
||||
require_once 'template/detail-action.php';
|
||||
|
|
@ -518,7 +528,7 @@ class Follow_Up
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
/* !\brief This function shows the detail of an action thanks the ag_id
|
||||
/**\brief This function shows the detail of an action thanks the ag_id
|
||||
*/
|
||||
function get()
|
||||
{
|
||||
|
|
@ -565,7 +575,7 @@ class Follow_Up
|
|||
$this->qcode_dest = $aexp->strAttribut(ATTR_DEF_QUICKCODE);
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Save the document and propose to save the generated document or
|
||||
* to upload one, the data are included except the file. Temporary the generated
|
||||
* document is save
|
||||
|
|
@ -656,7 +666,7 @@ class Follow_Up
|
|||
$this->insert_action();
|
||||
}
|
||||
|
||||
/* ! myList($p_filter="")
|
||||
/** myList($p_filter="")
|
||||
* \brief Show list of action by default if sorted on date
|
||||
* \param $p_base base url with ac...
|
||||
* \param $p_filter filters on the document_type
|
||||
|
|
@ -667,7 +677,7 @@ class Follow_Up
|
|||
function myList($p_base, $p_filter = "", $p_search = "")
|
||||
{
|
||||
// for the sort
|
||||
$url = HtmlInput::get_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate")) . '&' . $p_base;
|
||||
$url = HtmlInput::get_to_string(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate")) . '&' . $p_base;
|
||||
|
||||
$table = new Sort_Table();
|
||||
$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_timestamp desc', 'da', 'dd');
|
||||
|
|
@ -741,7 +751,7 @@ class Follow_Up
|
|||
//show the sub_action
|
||||
foreach ($a_row as $row)
|
||||
{
|
||||
$href = '<A class="document" HREF="do.php?' . $p_base .HtmlInput::get_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","gDossier", "qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate", "ac"),"&") . '&sa=detail&ag_id=' . $row['ag_id'] . '">';
|
||||
$href = '<A class="document" HREF="do.php?' . $p_base .HtmlInput::get_to_string(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","gDossier", "qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate", "ac"),"&") . '&sa=detail&ag_id=' . $row['ag_id'] . '">';
|
||||
$i++;
|
||||
$tr = ($i % 2 == 0) ? 'even' : 'odd';
|
||||
if ($row['ag_priority'] < 2)
|
||||
|
|
@ -751,9 +761,9 @@ class Follow_Up
|
|||
$st = ' style="font-weight:bold; border:2px solid orange;"';
|
||||
$date_remind = format_date($row['my_remind'], 'DD.MM.YYYY', 'YYYYMMDD');
|
||||
$date_today = date('Ymd');
|
||||
if ($date_remind != "" && $date_remind == $date_today)
|
||||
if ($date_remind != "" && $date_remind == $date_today && $row['ag_state']!=1 && $row['ag_state']!=3)
|
||||
$st = ' style="font-weight:bold;background:orange"';
|
||||
if ($date_remind != "" && $date_remind < $date_today)
|
||||
if ($date_remind != "" && $date_remind < $date_today && $row['ag_state']!=1 && $row['ag_state']!=3)
|
||||
$st = ' style="font-weight:bold;background:#FF0000"';
|
||||
$r.="<tr class=\"$tr\" $st>";
|
||||
$r.="<td>" . $href . smaller_date($row['my_date']) . '</a>' . "</td>";
|
||||
|
|
@ -817,7 +827,7 @@ class Follow_Up
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
/* !\brief Update the data into the database
|
||||
/**\brief Update the data into the database
|
||||
*
|
||||
* \return true on success otherwise false
|
||||
*/
|
||||
|
|
@ -847,6 +857,22 @@ class Follow_Up
|
|||
if ($contact->get_by_qcode($this->ag_contact) == -1)
|
||||
$contact->id = 0;
|
||||
|
||||
// reload the old one
|
||||
$old=new Follow_Up($this->db);
|
||||
$old->ag_id=$this->ag_id;
|
||||
$old->get();
|
||||
|
||||
// If ag_ref changed then check if unique
|
||||
if ($old->ag_ref != $this->ag_ref)
|
||||
{
|
||||
$nAg_ref=$this->db->get_value("select count(*) from action_gestion where ag_ref=$1",array($this->ag_ref));
|
||||
if ($nAg_ref != 0 )
|
||||
{
|
||||
echo h2("Référence en double, référence non sauvée",'class="error"');
|
||||
$this->ag_ref=$old->ag_ref;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($this->ag_remind_date != null)
|
||||
{
|
||||
|
|
@ -930,7 +956,7 @@ class Follow_Up
|
|||
return true;
|
||||
}
|
||||
|
||||
/* !\brief generate the document and add it to the action
|
||||
/**\brief generate the document and add it to the action
|
||||
* \param md_id is the id of the document_modele
|
||||
* \param $p_array contains normally the $_POST
|
||||
*/
|
||||
|
|
@ -946,7 +972,7 @@ class Follow_Up
|
|||
$doc->Generate($p_array);
|
||||
}
|
||||
|
||||
/* !\brief put an array in the variable member, the indice
|
||||
/**\brief put an array in the variable member, the indice
|
||||
* is the member name
|
||||
* \param $p_array to parse
|
||||
* \return nothing
|
||||
|
|
@ -976,7 +1002,7 @@ class Follow_Up
|
|||
$this->action = (isset($p_array['action'])) ? $p_array['action'] : null;
|
||||
}
|
||||
|
||||
/* !\brief remove the action
|
||||
/**\brief remove the action
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -1000,7 +1026,7 @@ class Follow_Up
|
|||
}
|
||||
}
|
||||
|
||||
/* !\brief return the last p_limit operation into an array
|
||||
/**\brief return the last p_limit operation into an array
|
||||
* \param $p_limit is the max of operation to return
|
||||
* \return $p_array of Follow_Up object
|
||||
*/
|
||||
|
|
@ -1019,10 +1045,10 @@ class Follow_Up
|
|||
*/
|
||||
function get_today()
|
||||
{
|
||||
$sql = "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,ag_timestamp " .
|
||||
$sql = "select ag_ref,coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title,ag_ref, dt_value,to_char(ag_remind_date,'DD.MM.YYYY') as ag_timestamp_fmt,ag_timestamp " .
|
||||
" from action_gestion join document_type " .
|
||||
" on (ag_type=dt_id) left join vw_fiche_attr on (f_id=f_id_dest) where ag_state not in (1,4)
|
||||
and to_char(ag_remind_date,'DDMMYYYY')=to_char(now(),'DDMMYYYY') ";
|
||||
and to_char(ag_remind_date,'DDMMYYYY')=to_char(now(),'DDMMYYYY') ";
|
||||
$array = $this->db->get_array($sql);
|
||||
return $array;
|
||||
}
|
||||
|
|
@ -1032,10 +1058,10 @@ class Follow_Up
|
|||
*/
|
||||
function get_late()
|
||||
{
|
||||
$sql = "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,ag_timestamp " .
|
||||
$sql = "select ag_ref,coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title,ag_ref, dt_value,to_char(ag_remind_date,'DD.MM.YYYY') as ag_timestamp_fmt,ag_timestamp " .
|
||||
" from action_gestion join document_type " .
|
||||
" on (ag_type=dt_id) left join vw_fiche_attr on (f_id=f_id_dest) where ag_state not in (1,4)
|
||||
and ag_remind_date > trunc (now()) ";
|
||||
and ag_remind_date < now() ";
|
||||
$array = $this->db->get_array($sql);
|
||||
return $array;
|
||||
}
|
||||
|
|
@ -1141,6 +1167,11 @@ class Follow_Up
|
|||
$end = new IDate('date_end');
|
||||
$end->value = (isset($_GET['date_end'])) ? $_GET['date_end'] : "";
|
||||
|
||||
// Closed action
|
||||
$closed_action=new ICheckBox('closed_action');
|
||||
$closed_action->selected=(isset($_GET['closed_action']))?true:false;
|
||||
|
||||
// Internal
|
||||
$only_internal= new ICheckBox('only_internal');
|
||||
$only_internal->selected = (isset($_GET['only_internal'])) ? true : false;
|
||||
// select profile
|
||||
|
|
@ -1173,7 +1204,7 @@ class Follow_Up
|
|||
Follow_Up::display_search($cn);
|
||||
|
||||
$act = new Follow_Up($cn);
|
||||
/* ! \brief
|
||||
/** \brief
|
||||
* \note The field 'recherche' is about a part of the title or a ref. number
|
||||
*/
|
||||
$query = Follow_Up::create_query($cn);
|
||||
|
|
@ -1199,7 +1230,7 @@ class Follow_Up
|
|||
$query = "";
|
||||
|
||||
|
||||
if (isset($_REQUEST['query']))
|
||||
if (isset($_REQUEST['query']))
|
||||
{
|
||||
// if a query is request build the sql stmt
|
||||
$query = "and (ag_title ~* '" . sql_string($_REQUEST['query']) . "' " .
|
||||
|
|
@ -1254,12 +1285,13 @@ class Follow_Up
|
|||
}
|
||||
if (isset($ag_dest_query) && $ag_dest_query != -2 )
|
||||
{
|
||||
$query.= " and ag_dest = " . sql_string($ag_dest_query);
|
||||
$query.= " and ((ag_dest = " . sql_string($ag_dest_query)." and ".self::sql_security_filter($cn, "R").") or ".
|
||||
" ag_owner='" . $_SESSION['g_user'] . "')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query .=" and (ag_owner='" . $_SESSION['g_user'] . "' or ".self::sql_security_filter($cn, "R")." or ag_dest=-1 )";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query .=" and (ag_owner='" . $_SESSION['g_user'] . "' or ".self::sql_security_filter($cn, "R")." or ag_dest=-1 )";
|
||||
}
|
||||
|
||||
|
||||
if (isNumber($ag_id) == 1 && $ag_id != 0)
|
||||
|
|
@ -1274,6 +1306,9 @@ class Follow_Up
|
|||
{
|
||||
$query .= " and to_date('".sql_string($remind_date_end)."','DD.MM.YYYY')>= ag_remind_date";
|
||||
}
|
||||
if ( ! isset ($closed_action)) {
|
||||
$query.=" and s_status is null ";
|
||||
}
|
||||
return $query . $str;
|
||||
}
|
||||
|
||||
|
|
@ -1292,6 +1327,7 @@ class Follow_Up
|
|||
(select ad_value from fiche_Detail where f_id=action_gestion.f_id_dest and ad_id=1) as name
|
||||
from action_gestion
|
||||
join document_type on (ag_type=dt_id)
|
||||
join document_state on (s_id=ag_state)
|
||||
where $p_sql";
|
||||
$max_line = $cn->count_sql($sql);
|
||||
|
||||
|
|
@ -1342,6 +1378,7 @@ class Follow_Up
|
|||
coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest
|
||||
from action_gestion
|
||||
join document_type on (ag_type=dt_id)
|
||||
join document_state on(ag_state=s_id)
|
||||
where true $p_search order by ag_timestamp,ag_id";
|
||||
$ret=$this->db->exec_sql($sql);
|
||||
|
||||
|
|
@ -1360,5 +1397,16 @@ class Follow_Up
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
static function get_all_operation($p_jr_id)
|
||||
{
|
||||
global $cn;
|
||||
$array=$cn->get_array("
|
||||
select ag_id,ag_ref,
|
||||
ag_title
|
||||
from action_gestion
|
||||
join action_gestion_operation using(ag_id)
|
||||
where
|
||||
jr_id=$1",array($p_jr_id));
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class HtmlInput
|
|||
var $ctrl; /*!<$ctrl is the control to update (see js_search_card_control) */
|
||||
|
||||
var $tabindex;
|
||||
function __construct($p_name="",$p_value="")
|
||||
function __construct($p_name="",$p_value="",$p_id="")
|
||||
{
|
||||
$this->name=$p_name;
|
||||
$this->readOnly=false;
|
||||
|
|
@ -84,6 +84,7 @@ class HtmlInput
|
|||
$this->javascript="";
|
||||
$this->extra2="all";
|
||||
$this->attribute=array();
|
||||
$this->id=$p_id;
|
||||
|
||||
}
|
||||
function setReadOnly($p_read)
|
||||
|
|
@ -177,7 +178,7 @@ class HtmlInput
|
|||
static function submit ($p_name,$p_value,$p_javascript="")
|
||||
{
|
||||
|
||||
return '<INPUT TYPE="SUBMIT" class="button" NAME="'.$p_name.'" VALUE="'.$p_value.'" '.$p_javascript.'>';
|
||||
return '<INPUT TYPE="SUBMIT" class="button" NAME="'.$p_name.'" ID="'.$p_name.'_submit_id" VALUE="'.$p_value.'" '.$p_javascript.'>';
|
||||
}
|
||||
static function button ($p_name,$p_value,$p_javascript="")
|
||||
{
|
||||
|
|
@ -189,9 +190,10 @@ class HtmlInput
|
|||
{
|
||||
return '<INPUT TYPE="RESET" class="button" VALUE="'.$p_value.'">';
|
||||
}
|
||||
static function hidden($p_name,$p_value)
|
||||
static function hidden($p_name,$p_value,$p_id="")
|
||||
{
|
||||
return '<INPUT TYPE="hidden" id="'.$p_name.'" NAME="'.$p_name.'" VALUE="'.$p_value.'">';
|
||||
if ($p_id=="") $p_id=$p_name;
|
||||
return '<INPUT TYPE="hidden" id="'.$p_id.'" NAME="'.$p_name.'" VALUE="'.$p_value.'">';
|
||||
}
|
||||
|
||||
static function extension()
|
||||
|
|
@ -232,6 +234,18 @@ class HtmlInput
|
|||
{
|
||||
return sprintf('<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:modifyOperation(%d,%d)">%s</A>',
|
||||
$p_jr_id,dossier::id(),$p_mesg);
|
||||
}
|
||||
/**
|
||||
* @brief return an anchor to view the detail of an action
|
||||
* @param $ag_id
|
||||
* @param $p_mesg
|
||||
* @param $p_modify let you modify an operation
|
||||
*
|
||||
*/
|
||||
static function detail_action($ag_id,$p_mesg,$p_modify=1)
|
||||
{
|
||||
return sprintf('<A class="detail" style="text-decoration:underline;display:inline" HREF="javascript:view_action(%d,%d,%d)">%s</A>',
|
||||
$ag_id,dossier::id(),$p_modify,$p_mesg);
|
||||
}
|
||||
/**
|
||||
* return a string containing the html code for calling the modifyModeleDocument
|
||||
|
|
@ -324,7 +338,7 @@ class HtmlInput
|
|||
|
||||
echo '</div>';
|
||||
$ret=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
|
|
@ -365,7 +379,7 @@ class HtmlInput
|
|||
|
||||
echo '</div>';
|
||||
$r=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
static function display_periode($p_id)
|
||||
|
|
@ -575,7 +589,7 @@ class HtmlInput
|
|||
return $r;
|
||||
}
|
||||
/**
|
||||
* return default if the value if the array doesn't exist
|
||||
* return default if the value if the value doesn't exist in the array
|
||||
*@param $ind the index to check
|
||||
*@param $default the value to return
|
||||
*@param $array the array
|
||||
|
|
@ -588,6 +602,48 @@ class HtmlInput
|
|||
}
|
||||
return $array[$ind];
|
||||
}
|
||||
/**
|
||||
* return default if the value if the value doesn't exist in $_GET
|
||||
* @param $ind name of the variable
|
||||
* @param type $default
|
||||
* @return type
|
||||
*/
|
||||
static function default_value_get($ind, $default)
|
||||
{
|
||||
if (!isset($_GET[$ind]))
|
||||
{
|
||||
return $default;
|
||||
}
|
||||
return $_GET[$ind];
|
||||
}
|
||||
/**
|
||||
* return default if the value if the value doesn't exist in $_POST
|
||||
* @param $ind name of the variable
|
||||
* @param type $default
|
||||
* @return type
|
||||
*/
|
||||
static function default_value_post($ind, $default)
|
||||
{
|
||||
if (!isset($_POST[$ind]))
|
||||
{
|
||||
return $default;
|
||||
}
|
||||
return $_POST[$ind];
|
||||
}
|
||||
/**
|
||||
* return default if the value if the value doesn't exist in $_REQUEST
|
||||
* @param $ind name of the variable
|
||||
* @param type $default
|
||||
* @return type
|
||||
*/
|
||||
static function default_value_request($ind, $default)
|
||||
{
|
||||
if (!isset($_REQUEST[$ind]))
|
||||
{
|
||||
return $default;
|
||||
}
|
||||
return $_REQUEST[$ind];
|
||||
}
|
||||
static function title_box($name,$div,$mod="close")
|
||||
{
|
||||
if ($mod=='close') $r=HtmlInput::anchor_close($div);
|
||||
|
|
|
|||
|
|
@ -33,17 +33,18 @@ class IAction extends HtmlInput
|
|||
{
|
||||
$this->name=($p_name=="")?$this->name:$p_name;
|
||||
$this->value=($p_value=="")?$this->value:$p_value;
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
$this->javascript= (!isset ($this->javascript))?"":$this->javascript;
|
||||
if ( $this->value !="")
|
||||
$r=sprintf('<span id="%s" class="action"> <A class="action" HREF="%s" %s>%s</A></span>',
|
||||
$this->name,
|
||||
$this->id,
|
||||
$this->value,
|
||||
$this->javascript,
|
||||
$this->label);
|
||||
else
|
||||
$r=sprintf('<span id="%s" class="action"> <A class="action" href="javascript: %s">%s</A></span>',
|
||||
$this->name,
|
||||
$this->id,
|
||||
$this->javascript,
|
||||
$this->label);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,16 +26,16 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
* \brief
|
||||
* \brief
|
||||
*/
|
||||
require_once('class_html_input.php');
|
||||
require_once('function_javascript.php');
|
||||
|
||||
class IAncCard extends HtmlInput
|
||||
{
|
||||
function __construct($name="",$value="")
|
||||
function __construct($name="",$value="",$p_id="")
|
||||
{
|
||||
parent::__construct($name,$value);
|
||||
parent::__construct($name,$value,$p_id);
|
||||
$this->fct='update_value';
|
||||
$this->dblclick='';
|
||||
$this->callback='null';
|
||||
|
|
@ -63,7 +63,7 @@ class IAncCard extends HtmlInput
|
|||
{
|
||||
$this->fct=$p_name;
|
||||
}
|
||||
|
||||
|
||||
/*!\brief set the extra javascript property for a double click on
|
||||
* INPUT field
|
||||
*\param $p_action action when a double click happens
|
||||
|
|
@ -82,8 +82,9 @@ class IAncCard extends HtmlInput
|
|||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
|
||||
|
||||
|
||||
$label='';
|
||||
if ( $this->dblclick != '')
|
||||
|
|
@ -106,7 +107,7 @@ class IAncCard extends HtmlInput
|
|||
$div=sprintf('<div id="%s_choices" class="autocomplete"></div>',
|
||||
$this->name);
|
||||
$query="op=autoanc&".dossier::get();
|
||||
|
||||
|
||||
// add parameter to search into a plan (pa_id) or get the value from
|
||||
// a HtmlObject
|
||||
if ($this->plan <> 0)
|
||||
|
|
@ -138,7 +139,7 @@ class IAncCard extends HtmlInput
|
|||
/*!\brief print in html the readonly value of the widget*/
|
||||
public function display()
|
||||
{
|
||||
$r=sprintf('
|
||||
$r=sprintf('
|
||||
<INPUT TYPE="hidden" NAME="%s" VALUE="%s" SIZE="8">',
|
||||
$this->name,
|
||||
$this->value
|
||||
|
|
@ -195,6 +196,6 @@ class IAncCard extends HtmlInput
|
|||
|
||||
static public function test_me()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/*!\file
|
||||
* \brief Html Input
|
||||
* \brief Html Input
|
||||
*/
|
||||
require_once('class_html_input.php');
|
||||
class IButton extends HtmlInput
|
||||
|
|
@ -32,12 +32,13 @@ class IButton extends HtmlInput
|
|||
{
|
||||
$this->name=($p_name==null)?$this->name:$p_name;
|
||||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
$this->label=(trim($this->label) != '')?$this->label:$this->value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
$extra= ( isset($this->extra))?$this->extra:"";
|
||||
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
$r='<input type="BUTTON" name="'.$this->name.'"'.
|
||||
' class="button" '.
|
||||
' id="'.$this->name.'"'.
|
||||
' id="'.$this->id.'"'.
|
||||
' value="'.$this->label.'"'.
|
||||
' onClick="'.$this->javascript.'"'.$extra.'>';
|
||||
$attr=$this->get_js_attr();
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ require_once('function_javascript.php');
|
|||
|
||||
class ICard extends HtmlInput
|
||||
{
|
||||
function __construct($name="",$value="")
|
||||
function __construct($name="",$value="",$p_id="")
|
||||
{
|
||||
parent::__construct($name,$value);
|
||||
$this->fct='update_value';
|
||||
|
|
@ -128,6 +128,7 @@ class ICard extends HtmlInput
|
|||
$this->callback='null';
|
||||
$this->javascript='';
|
||||
$this->autocomplete=1;
|
||||
$this->id=($p_id != "")?$p_id:$name;
|
||||
}
|
||||
/*!\brief set the javascript callback function
|
||||
* by default it is update_value called BEFORE the querystring is send
|
||||
|
|
@ -191,7 +192,7 @@ class ICard extends HtmlInput
|
|||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
|
||||
if ( ! isset($this->id )) $this->id=$this->name;
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
$attr=$this->get_js_attr();
|
||||
|
||||
|
|
@ -293,8 +294,10 @@ class ICard extends HtmlInput
|
|||
if (isset($this->$att) )
|
||||
$a.="this.".$att."='".$this->$att."';";
|
||||
}
|
||||
if (isset($this->id))
|
||||
if (isset($this->id) && $this->id != "")
|
||||
$a.="this.inp='".$this->id."';";
|
||||
else
|
||||
$a.="this.inp='".$this->name."';";
|
||||
$a.="this.popup='ipop_card';";
|
||||
|
||||
$button->javascript=$a.' search_card(this)';
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/*!\file
|
||||
* \brief Html Input
|
||||
* \brief Html Input
|
||||
*/
|
||||
require_once('class_html_input.php');
|
||||
class ICheckBox extends HtmlInput
|
||||
|
|
@ -32,9 +32,10 @@ class ICheckBox extends HtmlInput
|
|||
$this->name=($p_name==null)?$this->name:$p_name;
|
||||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
$check=( $this->selected==true )?"checked":"unchecked";
|
||||
$r='<input type="CHECKBOX" id="'.$this->name.'" name="'.$this->name.'"'.' value="'.$this->value.'"';
|
||||
$r='<input type="CHECKBOX" id="'.$this->id.'" name="'.$this->name.'"'.' value="'.$this->value.'"';
|
||||
$r.=" $check";
|
||||
$r.=' '.$this->disabled." ".$this->javascript.'>';
|
||||
|
||||
|
|
|
|||
|
|
@ -30,12 +30,13 @@ require_once('class_html_input.php');
|
|||
class IConcerned extends HtmlInput
|
||||
{
|
||||
|
||||
public function __construct($p_name='',$p_value='')
|
||||
public function __construct($p_name='',$p_value='',$p_id="")
|
||||
{
|
||||
$this->name=$p_name;
|
||||
$this->value=$p_value;
|
||||
$this->amount_id=null;
|
||||
$this->paid='';
|
||||
$this->id=$p_id;
|
||||
}
|
||||
/*!\brief show the html input of the widget*/
|
||||
public function input($p_name=null,$p_value=null)
|
||||
|
|
@ -44,6 +45,7 @@ class IConcerned extends HtmlInput
|
|||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
|
||||
$r=sprintf("
|
||||
|
|
@ -56,9 +58,9 @@ class IConcerned extends HtmlInput
|
|||
$this->amount_id,
|
||||
$this->paid,
|
||||
$this->name,
|
||||
$this->name,
|
||||
$this->id,
|
||||
$this->value,
|
||||
$this->name
|
||||
$this->id
|
||||
);
|
||||
return $r;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class IDate extends HtmlInput
|
|||
$this->name=($p_name==null)?$this->name:$p_name;
|
||||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
if( ! isset ($this->id))
|
||||
if( $this->id=="")
|
||||
$this->id=self::generate_id($this->name);
|
||||
$r='<input type="text" name="'.$this->name.'" id="'.$this->id.'"'.
|
||||
'style="border:solid 1px blue;"'.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/*!\file
|
||||
* \brief Html Input
|
||||
* \brief Html Input
|
||||
*/
|
||||
require_once('class_html_input.php');
|
||||
class IHidden extends HtmlInput
|
||||
|
|
@ -31,7 +31,9 @@ class IHidden extends HtmlInput
|
|||
{
|
||||
$this->name=($p_name==null)?$this->name:$p_name;
|
||||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
$r='<INPUT TYPE="HIDDEN" id="'.$this->name.'" name="'.$this->name.'" value="'.$this->value.'">';
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
$r='<INPUT TYPE="HIDDEN" id="'.$this->id.'" name="'.$this->name.'" value="'.$this->value.'">';
|
||||
return $r;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
// $Revision$
|
||||
/*!\file
|
||||
* \brief contains function for the printing
|
||||
* \todo the functions of class_impress.php should be replaced in a OO way
|
||||
*/
|
||||
require_once('class_periode.php');
|
||||
|
||||
|
|
@ -208,8 +207,9 @@ class Impress
|
|||
$p_string=str_replace("<=","+",$p_string);
|
||||
$p_string=str_replace(">","+",$p_string);
|
||||
$p_string=str_replace("<","+",$p_string);
|
||||
// eat Space
|
||||
// eat Space + comma
|
||||
$p_string=str_replace(" ","",$p_string);
|
||||
$p_string=str_replace(",","",$p_string);
|
||||
// Remove D/C/S
|
||||
$p_string=str_replace("c","",$p_string);
|
||||
$p_string=str_replace("d","",$p_string);
|
||||
|
|
@ -219,11 +219,18 @@ class Impress
|
|||
|
||||
// remove date
|
||||
$p_string= preg_replace("/FROM*=*[0-9]+/", "", $p_string);
|
||||
// remove comment
|
||||
$p_string= preg_replace("/#.*/", "", $p_string);
|
||||
// remove $C=
|
||||
$p_string= preg_replace('/\$[a-z]*[A-Z]*[0-9]*[A-Z]*[a-z]*/', "", $p_string);
|
||||
$p_string= preg_replace('/=/', "", $p_string);
|
||||
|
||||
// remove account
|
||||
$p_string= preg_replace("/\[[0-9]*[A-Z]*%*\]/", "", $p_string);
|
||||
|
||||
$p_string= preg_replace("/\+|-|\/\*/", "", $p_string);
|
||||
$p_string= preg_replace("/\+|-|\/|\*/", "", $p_string);
|
||||
$p_string= preg_replace("/[0-9]*\.*[0-9]/", "", $p_string);
|
||||
|
||||
//********************************************************************************************************************
|
||||
// If the string is empty then formula should be good
|
||||
//
|
||||
|
|
|
|||
|
|
@ -27,7 +27,15 @@ require_once('class_itext.php');
|
|||
/*!\brief
|
||||
* This class handles only the numeric input, the input will
|
||||
* call a javascript
|
||||
* to change comma to period and will round it (2 decimal)
|
||||
* to change comma to period and will round it (2 decimal), the precision is given by
|
||||
* the attribute prec
|
||||
* attribute
|
||||
* extra = extra code (free)
|
||||
* size = size of the field
|
||||
* prec = precision default = 2
|
||||
* name = name of the html object
|
||||
* javascript = javascript to execute (default = onchange="format_number(this,2);)
|
||||
* value = value of the widget
|
||||
*
|
||||
*/
|
||||
class INum extends IText
|
||||
|
|
@ -45,10 +53,12 @@ class INum extends IText
|
|||
{
|
||||
|
||||
$readonly=" readonly ";
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
$style='style="border:solid 1px blue;color:black;background:#EDEDED;text-align:right"';
|
||||
$this->value=str_replace('"','',$this->value);
|
||||
$r='<INPUT '.$style.' TYPE="TEXT" id="'.
|
||||
$this->name.'"'.
|
||||
$this->id.'"'.
|
||||
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
|
||||
'SIZE="'.$this->size.'" '.$this->javascript." $readonly $this->extra >";
|
||||
|
||||
|
|
@ -66,6 +76,8 @@ class INum extends IText
|
|||
}
|
||||
$this->name=($p_name==null)?$this->name:$p_name;
|
||||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
|
||||
$t= ((isset($this->title)))?'title="'.$this->title.'" ':' ';
|
||||
|
|
@ -76,13 +88,13 @@ class INum extends IText
|
|||
if ( ! isset ($this->css_size))
|
||||
{
|
||||
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
|
||||
$this->name.'"'.$t.
|
||||
$this->id.'"'.$t.
|
||||
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
|
||||
'SIZE="'.$this->size.'" '.$this->javascript." $this->extra >";
|
||||
/* add tag for column if inside a table */
|
||||
} else {
|
||||
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
|
||||
$this->name.'"'.$t.
|
||||
$this->id.'"'.$t.
|
||||
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
|
||||
' style="width:'.$this->css_size.';" '.$this->javascript." $this->extra >";
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@
|
|||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/*!\file
|
||||
* \brief Html Input
|
||||
* \brief Html Input
|
||||
*/
|
||||
/*! \brief Generate the form for the periode
|
||||
* Data Members
|
||||
* - $cn connexion to the current folder
|
||||
* - $cn connexion to the current folder
|
||||
* - $type the type of the periode OPEN CLOSE NOTCENTRALIZED or ALL, IT MUST BE SET
|
||||
* - $filter_year make a filter on the default exercice by default true
|
||||
* - $user if a filter_year is required then we need who is the user (object User)
|
||||
|
|
@ -56,7 +56,7 @@ class IPeriod extends HtmlInput
|
|||
$this->extra2="all";
|
||||
$this->show_start_date=true;
|
||||
$this->show_end_date=true;
|
||||
$this->exercice=$p_exercice;
|
||||
$this->exercice=$p_exercice;
|
||||
}
|
||||
/*!
|
||||
* \brief show the input html for a periode
|
||||
|
|
@ -64,7 +64,7 @@ class IPeriod extends HtmlInput
|
|||
*\param $p_value is the default value
|
||||
*\param $p_exercice is the exercice, if not set then the user preference is used
|
||||
* \return string containing html code for the HTML
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function input($p_name=null,$p_value=null)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ $text->set_attribute('account','field');
|
|||
class IPoste extends HtmlInput
|
||||
{
|
||||
|
||||
function __construct($p_name="",$p_value="")
|
||||
function __construct($p_name="",$p_value="",$p_id="")
|
||||
{
|
||||
$this->name=$p_name;
|
||||
$this->readOnly=false;
|
||||
|
|
@ -92,6 +92,7 @@ class IPoste extends HtmlInput
|
|||
$this->javascript="";
|
||||
$this->extra2="all";
|
||||
$this->attribute=array();
|
||||
$this->id=$p_id;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +117,7 @@ class IPoste extends HtmlInput
|
|||
{
|
||||
list($name,$value)=$this->attribute[$i];
|
||||
$tmp1=sprintf("$('%s_bt').%s='%s';",
|
||||
$this->name,
|
||||
$this->id,
|
||||
$name,
|
||||
$value);
|
||||
$attr.=$tmp1;
|
||||
|
|
@ -127,7 +128,8 @@ class IPoste extends HtmlInput
|
|||
|
||||
public function dsp_button()
|
||||
{
|
||||
$ib=new IButton($this->name.'_bt');
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
$ib=new IButton($this->id.'_bt');
|
||||
$ib->javascript='search_poste(this)';
|
||||
|
||||
/* add the property */
|
||||
|
|
@ -144,9 +146,10 @@ class IPoste extends HtmlInput
|
|||
if ( ! isset($this->ctrl) ) $this->ctrl='none';
|
||||
|
||||
if ( ! isset($this->javascript)) $this->javascript="";
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
/* create the text */
|
||||
$itext=new IText($this->name,$this->value);
|
||||
$itext=new IText($this->name,$this->value,$this->id);
|
||||
|
||||
if ( isset ($this->css_size))
|
||||
$itext->css_size=$this->css_size;
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
* \brief Html Input
|
||||
*/
|
||||
require_once('class_html_input.php');
|
||||
|
||||
class IRadio extends HtmlInput
|
||||
{
|
||||
/* !\brief show the html input of the widget */
|
||||
/**\brief show the html input of the widget */
|
||||
|
||||
public function input($p_name=null, $p_value=null)
|
||||
{
|
||||
|
|
@ -45,7 +45,7 @@ class IRadio extends HtmlInput
|
|||
return $r;
|
||||
}
|
||||
|
||||
/* !\brief print in html the readonly value of the widget */
|
||||
/**\brief print in html the readonly value of the widget */
|
||||
|
||||
public function display()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class IRelated_Action extends HtmlInput
|
|||
$this->value=$p_value;
|
||||
$this->amount_id=null;
|
||||
$this->paid='';
|
||||
$this->id=$p_name;
|
||||
}
|
||||
/*!\brief show the html input of the widget*/
|
||||
public function input($p_name=null,$p_value=null)
|
||||
|
|
@ -41,6 +42,7 @@ class IRelated_Action extends HtmlInput
|
|||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
|
||||
$r=sprintf("
|
||||
|
|
@ -49,11 +51,11 @@ class IRelated_Action extends HtmlInput
|
|||
<INPUT TYPE=\"button\" onClick=\"$('%s').value=''\" value=\"X\">
|
||||
|
||||
",
|
||||
$this->id,
|
||||
$this->name,
|
||||
$this->name,
|
||||
$this->name,
|
||||
$this->id,
|
||||
$this->value,
|
||||
$this->name
|
||||
$this->id
|
||||
);
|
||||
return $r;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,12 +33,13 @@ class ISelect extends HtmlInput
|
|||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
$style=(isset($this->style))?$this->style:"";
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
$disabled=($this->disabled==true)?"disabled":"";
|
||||
|
||||
$r="";
|
||||
|
||||
$a="<SELECT id=\"$this->name\" NAME=\"$this->name\" $style $this->javascript $disabled>";
|
||||
$a="<SELECT id=\"$this->id\" NAME=\"$this->name\" $style $this->javascript $disabled>";
|
||||
|
||||
if (empty($this->value)) return '';
|
||||
for ( $i=0;$i<sizeof($this->value);$i++)
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
require_once('class_html_input.php');
|
||||
class IText extends HtmlInput
|
||||
{
|
||||
function __construct($name='',$value='')
|
||||
function __construct($name='',$value='',$p_id="")
|
||||
{
|
||||
parent::__construct($name,$value);
|
||||
parent::__construct($name,$value,$p_id);
|
||||
$this->style=' class="input_text" ';
|
||||
}
|
||||
/*!\brief show the html input of the widget*/
|
||||
|
|
@ -37,6 +37,7 @@ class IText extends HtmlInput
|
|||
$this->name=($p_name==null)?$this->name:$p_name;
|
||||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
$t= ((isset($this->title)))?'title="'.$this->title.'" ':' ';
|
||||
|
||||
|
|
@ -46,13 +47,13 @@ class IText extends HtmlInput
|
|||
if ( ! isset ($this->css_size))
|
||||
{
|
||||
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
|
||||
$this->name.'"'.$t.
|
||||
$this->id.'"'.$t.
|
||||
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
|
||||
'SIZE="'.$this->size.'" '.$this->javascript." $this->extra >";
|
||||
/* add tag for column if inside a table */
|
||||
} else {
|
||||
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
|
||||
$this->name.'"'.$t.
|
||||
$this->id.'"'.$t.
|
||||
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
|
||||
' style="width:'.$this->css_size.';" '.$this->javascript." $this->extra >";
|
||||
|
||||
|
|
@ -76,12 +77,12 @@ class IText extends HtmlInput
|
|||
if ( ! isset ($this->css_size))
|
||||
{
|
||||
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
|
||||
$this->name.'"'.$t.
|
||||
$this->id.'"'.$t.
|
||||
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
|
||||
'SIZE="'.$this->size.'" '.$this->javascript." $readonly $this->extra >";
|
||||
} else {
|
||||
$r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
|
||||
$this->name.'"'.$t.
|
||||
$this->id.'"'.$t.
|
||||
'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
|
||||
' style="width:'.$this->css_size.'" '.$this->javascript." $readonly $this->extra >";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,10 +32,12 @@ class ITextarea extends HtmlInput
|
|||
$this->name=($p_name==null)?$this->name:$p_name;
|
||||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
if ( !isset ($this->style )) $this->style=' style="border:solid blue 1px" ';
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
|
||||
$r="";
|
||||
$r.='<TEXTAREA '.$this->style.' name="'.$this->name.'" id="'.$this->name.'"';
|
||||
$r.='<TEXTAREA '.$this->style.' name="'.$this->name.'" id="'.$this->id.'"';
|
||||
$r.=" rows=\"$this->heigh\" ";
|
||||
$r.=" cols=\"$this->width\" ";
|
||||
$r.='>';
|
||||
|
|
|
|||
|
|
@ -55,11 +55,13 @@ class ITva_Popup extends HtmlInput
|
|||
* to have its own javascript for the button you can use this->but_javascript)
|
||||
* by default it is 'popup_select_tva(this)';
|
||||
*/
|
||||
public function __construct($p_name=null)
|
||||
public function __construct($p_name=null,$p_value="",$p_id="")
|
||||
{
|
||||
$this->name=$p_name;
|
||||
$this->button=true;
|
||||
$this->in_table=false;
|
||||
$this->value=$p_value;
|
||||
$this->id=$p_id;
|
||||
}
|
||||
function with_button($p)
|
||||
{
|
||||
|
|
@ -74,10 +76,12 @@ class ITva_Popup extends HtmlInput
|
|||
$this->name=($p_name==null)?$this->name:$p_name;
|
||||
$this->value=($p_value==null)?$this->value:$p_value;
|
||||
$this->js=(isset($this->js))?$this->js:'onchange="format_number(this);"';
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
if ( $this->readOnly==true) return $this->display();
|
||||
|
||||
$str='<input type="TEXT" class="input_text" name="%s" value="%s" id="%s" size="3" %s>';
|
||||
$r=sprintf($str,$this->name,$this->value,$this->name,$this->js);
|
||||
$r=sprintf($str,$this->name,$this->value,$this->id,$this->js);
|
||||
|
||||
if ($this->in_table)
|
||||
$table='<table>'.'<tr>'.td($r);
|
||||
|
|
@ -120,11 +124,13 @@ class ITva_Popup extends HtmlInput
|
|||
function dbutton()
|
||||
{
|
||||
if( trim($this->name)=='') throw new Exception (_('Le nom ne peut être vide'));
|
||||
$this->id=($this->id=="")?$this->name:$this->id;
|
||||
|
||||
// button
|
||||
$bt=new IButton('bt_'.$this->name);
|
||||
$bt=new IButton('bt_'.$this->id);
|
||||
$bt->label=_(' TVA ');
|
||||
$bt->set_attribute('gDossier',dossier::id());
|
||||
$bt->set_attribute('ctl',$this->name);
|
||||
$bt->set_attribute('ctl',$this->id);
|
||||
$bt->set_attribute('popup','popup_tva');
|
||||
if ( isset($this->code))
|
||||
$bt->set_attribute('jcode',$this->code->name);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ class Lettering
|
|||
ob_start();
|
||||
include('template/letter_all.php');
|
||||
$r=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
function get_linked($p_jlid)
|
||||
|
|
@ -289,7 +289,7 @@ class Lettering
|
|||
ob_start();
|
||||
include('template/letter_all.php');
|
||||
$r=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
|
|
@ -303,7 +303,7 @@ class Lettering
|
|||
ob_start();
|
||||
include('template/letter_all.php');
|
||||
$r=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
|
@ -319,7 +319,7 @@ class Lettering
|
|||
ob_start();
|
||||
include('template/letter_all.php');
|
||||
$r=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
|
|
@ -369,7 +369,7 @@ class Lettering
|
|||
ob_start();
|
||||
require_once('template/letter_prop.php');
|
||||
$r=ob_get_contents();
|
||||
ob_clean();
|
||||
ob_end_clean();
|
||||
$r.=HtmlInput::hidden('j_id',$p_jid);
|
||||
$r.=HtmlInput::hidden('jnt_id',$jnt_id);
|
||||
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ class Periode
|
|||
isDate($p_date_end) == null ||
|
||||
strlen (trim($p_exercice)) == 0 ||
|
||||
(string) $p_exercice != (string)(int) $p_exercice
|
||||
||$p_exercice < 2000 || $p_exercice > 2099 )
|
||||
||$p_exercice < COMPTA_MIN_YEAR || $p_exercice > COMPTA_MAX_YEAR)
|
||||
|
||||
{
|
||||
throw new Exception ("Paramètre invalide");
|
||||
|
|
|
|||
|
|
@ -239,13 +239,16 @@ class phpcompta_sql
|
|||
{
|
||||
$this->$value=$p_array[$value];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->$value=null;
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
function seek($cond='', $p_array=null)
|
||||
{
|
||||
$sql = "select * from ".$this->table." $cond";
|
||||
$aobj = array();
|
||||
$ret = $this->cn->exec_sql($sql, $p_array);
|
||||
return $ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
/*!\file
|
||||
* \brief print a listing of financial
|
||||
*\todo Must add the third part
|
||||
*/
|
||||
require_once('class_pdf.php');
|
||||
class Print_Ledger_Financial extends PDF
|
||||
|
|
@ -65,11 +64,7 @@ class Print_Ledger_Financial extends PDF
|
|||
|
||||
}
|
||||
/**
|
||||
*@brief print the pdf
|
||||
*@param
|
||||
*@param
|
||||
*@return
|
||||
*@see
|
||||
*@brief print the pdf for a financial ledger
|
||||
*/
|
||||
function export()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
/*!\file
|
||||
* \brief this class extends PDF and let you export the detailled printing
|
||||
* of any ledgers
|
||||
*\todo Must add the third part
|
||||
*/
|
||||
require_once('class_pdf.php');
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
/*!\file
|
||||
* \brief this class extends PDF and let you export the detailled printing
|
||||
* of any ledgers
|
||||
* *\todo Must add the third part
|
||||
*/
|
||||
require_once('class_pdf.php');
|
||||
|
||||
|
|
@ -78,11 +77,11 @@ class Print_Ledger_Simple_Without_Vat extends PDF
|
|||
else
|
||||
$this->Cell(60,6,'Fournisseur');
|
||||
$this->Cell(105,6,'Commentaire');
|
||||
$this->Cell(15,6,'Prix',0,0,'R');
|
||||
if ( $this->jrn_type=='ACH')
|
||||
{
|
||||
$this->Cell(15,6,'Privé',0,0,'R');
|
||||
}
|
||||
$this->Cell(15,6,'Prix',0,0,'R');
|
||||
|
||||
$this->Ln(5);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,11 @@ class Profile_Menu
|
|||
{
|
||||
$this->cn = $p_cn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the content of a profile
|
||||
* @param type $resource
|
||||
* @param type $p_id
|
||||
*/
|
||||
function sub_menu($resource, $p_id)
|
||||
{
|
||||
if (Database::num_row($resource) != 0)
|
||||
|
|
@ -35,13 +39,15 @@ class Profile_Menu
|
|||
|
||||
$me_menu = $menu['me_menu'];
|
||||
$me_desc = $menu['me_description'];
|
||||
$me_def=($menu['pm_default']=='1')?'<span class="notice" style="display:inline">Défaut</span>':'';
|
||||
$js = sprintf(
|
||||
'<a class="line" href="javascript:void(0)" onclick="mod_menu(\'%s\',\'%s\')">%s</A>', $gDossier, $menu['pm_id'], $me_code);
|
||||
?>
|
||||
<li>
|
||||
|
||||
<?= $me_menu?>
|
||||
( <?= $js?> )
|
||||
<?= $me_desc?>
|
||||
<?= $me_desc?> <?=$me_def?>
|
||||
<?
|
||||
$ret2 = $this->cn->exec_sql("
|
||||
SELECT pm_id,
|
||||
|
|
@ -145,9 +151,10 @@ class Profile_Menu
|
|||
$gDossier = Dossier::id();
|
||||
for ($i = 0; $i < count($array); $i++)
|
||||
{
|
||||
$me_def=($array[$i]['pm_default']=='1')?'<span class="notice" style="display:inline">Défaut</span>':'';
|
||||
$js = sprintf('<a class="line" style="display:inline;text-decoration:underline"
|
||||
href="javascript:void(0)" onclick="mod_menu(\'%s\',\'%s\')">%s</A>', $gDossier, $array[$i]['pm_id'], $array[$i]['me_code']);
|
||||
echo "<li>" . $array[$i]['me_menu'] . " (" . $js . ")" . $array[$i]['me_description'];
|
||||
echo "<li>" . $array[$i]['me_menu'] . " (" . $js . ")" . $array[$i]['me_description']." ".$me_def;
|
||||
|
||||
$ret = $this->cn->execute("menu", array($p_id, $array[$i]['me_code']));
|
||||
$this->sub_menu($ret, $p_id);
|
||||
|
|
|
|||
|
|
@ -19,13 +19,19 @@
|
|||
/* $Revision: $Revision $ */
|
||||
/**
|
||||
* @file
|
||||
* Objec to check a double insert into the database, this duplicate occurs after
|
||||
* @brief Objec to check a double insert into the database, this duplicate occurs after
|
||||
* a refresh of the web page
|
||||
*/
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
require_once 'class_database.php';
|
||||
define ('CODE_EXCP_DUPLICATE',901);
|
||||
/**
|
||||
* @brief Objec to check a double insert into the database, this duplicate occurs after
|
||||
* a refresh of the web page
|
||||
* in
|
||||
*/
|
||||
|
||||
class Tool_Uos
|
||||
{
|
||||
/**
|
||||
|
|
@ -54,15 +60,17 @@ class Tool_Uos
|
|||
* @global $cn Database connx
|
||||
* @throws Exception if the value $p_id is not unique
|
||||
*/
|
||||
function save()
|
||||
function save($p_array=null)
|
||||
{
|
||||
global $cn;
|
||||
if ( $p_array == null ) $p_array=$_POST;
|
||||
$this->id=$_POST[$this->name];
|
||||
$sql="insert into tool_uos(uos_value) values ($1)";
|
||||
try {
|
||||
$cn->exec_sql($sql,array($this->id));
|
||||
} catch (Exception $e)
|
||||
{
|
||||
throw new Exception('Duplicate value','CODE_EXCP_DUPLICATE',$e);
|
||||
throw new Exception('Duplicate value');
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
@ -89,7 +97,7 @@ class Tool_Uos
|
|||
try
|
||||
{
|
||||
$count=$cn->get_value('select count(*) from tool_uos where uos_value=$1',
|
||||
array($p_id));
|
||||
array($this->id));
|
||||
if ($count != 0 ) throw new Exception ('DUPLICATE',CODE_EXCP_DUPLICATE);
|
||||
}catch (Exception $e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@
|
|||
*/
|
||||
/* $Revision$ */
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
/* ! \file
|
||||
/** \file
|
||||
* \brief
|
||||
* Data & function about connected users
|
||||
*/
|
||||
/* !
|
||||
/**
|
||||
* \brief
|
||||
* Data & function about connected users
|
||||
*/
|
||||
|
|
@ -79,7 +79,7 @@ class User
|
|||
}
|
||||
}
|
||||
|
||||
/* !\brief load data from database.
|
||||
/**\brief load data from database.
|
||||
* if this->id == -1, it is unknown so we have to retrieve it
|
||||
from the database by the login
|
||||
* return -1 if nothing is found
|
||||
|
|
@ -130,7 +130,7 @@ class User
|
|||
$Res = $cn->exec_sql($Sql, array($this->first_name, $this->last_name, $this->active, $this->admin, $this->pass, $this->id));
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Check if user is active and exists in therepository
|
||||
* Automatically redirect, it doesn't check if a user can access a folder
|
||||
* \param $silent false, echo an error message and exit, true : exit without warning
|
||||
|
|
@ -190,7 +190,7 @@ class User
|
|||
return $ret;
|
||||
}
|
||||
|
||||
/* !\brief return the access to a folder,
|
||||
/**\brief return the access to a folder,
|
||||
* \param $p_dossier id if it is == 0 then we take the value from $_SESSION
|
||||
* \return the priv_priv
|
||||
* - X no access
|
||||
|
|
@ -204,7 +204,7 @@ class User
|
|||
|
||||
if ($p_dossier == 0)
|
||||
$p_dossier = dossier::id();
|
||||
if ($this->is_local_admin($p_dossier) == 1)
|
||||
if ($this->is_local_admin($p_dossier) == 1 || $this->admin == 1)
|
||||
return 'L';
|
||||
$cn = new Database();
|
||||
|
||||
|
|
@ -238,7 +238,7 @@ class User
|
|||
$Res = $cn->exec_sql("update priv_user set priv_priv=$1 where priv_jnt=$2", array($priv, $jnt));
|
||||
}
|
||||
|
||||
/* !\brief check that a user is valid and the access to the folder
|
||||
/**\brief check that a user is valid and the access to the folder
|
||||
* \param $p_ledger the ledger to check
|
||||
* \return the priv_priv
|
||||
* - O only predefined operation
|
||||
|
|
@ -264,7 +264,7 @@ class User
|
|||
return $res;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief get all the available ledgers for the current user
|
||||
* \param $p_type = ALL or the type of the ledger (ACH,VEN,FIN,ODS)
|
||||
* \param $p_access =3 for Read or WRITE, 2 write, 1 for readonly
|
||||
|
|
@ -326,7 +326,7 @@ class User
|
|||
return $array;
|
||||
}
|
||||
|
||||
/* !\brief return an sql condition for filtering the permitted ledger
|
||||
/**\brief return an sql condition for filtering the permitted ledger
|
||||
* \param $p_type = ALL or the type of the ledger (ACH,VEN,FIN,ODS)
|
||||
* \param $p_access =3 for READ or WRITE, 2 READ and write, 1 for readonly
|
||||
*
|
||||
|
|
@ -347,7 +347,7 @@ class User
|
|||
return $sql;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Check if an user is an admin
|
||||
*
|
||||
* \return 1 for yes 0 for no
|
||||
|
|
@ -373,7 +373,7 @@ class User
|
|||
return $this->admin;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Set the selected periode in the user's preferences
|
||||
*
|
||||
* \param $p_periode periode
|
||||
|
|
@ -415,7 +415,7 @@ class User
|
|||
$Res = $this->db->exec_sql($sql);
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Get the default periode from the user's preferences
|
||||
*
|
||||
* \return the default periode
|
||||
|
|
@ -435,7 +435,7 @@ class User
|
|||
return $array['PERIODE'];
|
||||
}
|
||||
|
||||
/* !\brief return the mini rapport to display on the welcome page
|
||||
/**\brief return the mini rapport to display on the welcome page
|
||||
* \return 0 if nothing if found or the report to display (formdef.fr_id)
|
||||
*/
|
||||
|
||||
|
|
@ -446,7 +446,7 @@ class User
|
|||
return $fr_id;
|
||||
}
|
||||
|
||||
/* !\brief set the mini rapport to display on the welcome page
|
||||
/**\brief set the mini rapport to display on the welcome page
|
||||
*/
|
||||
|
||||
function set_mini_report($p_id)
|
||||
|
|
@ -485,7 +485,7 @@ class User
|
|||
}
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Get the default user's preferences
|
||||
* \return array of (parameter_type => parameter_value)
|
||||
*/
|
||||
|
|
@ -524,7 +524,7 @@ class User
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Check if an user is allowed to do an action
|
||||
* \param p_action_id
|
||||
* \return
|
||||
|
|
@ -561,7 +561,7 @@ class User
|
|||
exit();
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Get the global preferences from user_global_pref
|
||||
* in the account_repository db
|
||||
*
|
||||
|
|
@ -605,7 +605,7 @@ class User
|
|||
}
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief insert default pref
|
||||
* if no parameter are given insert all the existing
|
||||
* parameter otherwise only the requested
|
||||
|
|
@ -640,7 +640,7 @@ class User
|
|||
}
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief update default pref
|
||||
* if value is not given then use the default value
|
||||
*
|
||||
|
|
@ -663,7 +663,7 @@ class User
|
|||
}
|
||||
|
||||
//end function
|
||||
/* !\brief Return the year of current Periode
|
||||
/**\brief Return the year of current Periode
|
||||
* it is the parm_periode.p_exercice col
|
||||
* if an error occurs return 0
|
||||
*/
|
||||
|
|
@ -681,7 +681,7 @@ class User
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* !\brief Check if the user can access
|
||||
/**\brief Check if the user can access
|
||||
* otherwise warn and exit
|
||||
* \param $p_action requested action
|
||||
* \param $p_js = 1 javascript, or 0 just a text
|
||||
|
|
@ -729,7 +729,7 @@ class User
|
|||
return $res;
|
||||
}
|
||||
|
||||
/* !\brief Check if the user can print (in menu_ref p_type_display=p)
|
||||
/**\brief Check if the user can print (in menu_ref p_type_display=p)
|
||||
* otherwise warn and exit
|
||||
* \param $p_action requested action
|
||||
* \return nothing the program exits automatically
|
||||
|
|
@ -756,7 +756,7 @@ class User
|
|||
}
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Check if an user is an local administrator
|
||||
*
|
||||
*
|
||||
|
|
@ -822,7 +822,7 @@ class User
|
|||
}
|
||||
return $r;
|
||||
}
|
||||
/* !
|
||||
/**
|
||||
* \brief return an array with all the users who can access $p_dossier including the global admin. The user
|
||||
* must be activated
|
||||
*
|
||||
|
|
@ -853,7 +853,7 @@ class User
|
|||
return $array;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief check the access of an user on a ledger
|
||||
*
|
||||
* \param $p_jrn the ledger id
|
||||
|
|
@ -870,7 +870,7 @@ class User
|
|||
return $this->get_ledger_access($p_jrn);
|
||||
}
|
||||
|
||||
/* !\brief check if an user can access a folder, if he cannot display a dialog box
|
||||
/**\brief check if an user can access a folder, if he cannot display a dialog box
|
||||
* and exit
|
||||
* \param the folder if
|
||||
* \param $silent false, echo an error message and exit, true : exit without warning
|
||||
|
|
@ -916,7 +916,7 @@ class User
|
|||
return array($start, $end);
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Show all the available folder for the users
|
||||
* at the login page. For the special case 'E'
|
||||
* go directly to extension and bypasse the dashboard
|
||||
|
|
@ -973,7 +973,7 @@ class User
|
|||
return $result;
|
||||
}
|
||||
|
||||
/* !
|
||||
/**
|
||||
* \brief Get all the available folders
|
||||
* for the users, checked with the security
|
||||
*
|
||||
|
|
@ -1032,7 +1032,7 @@ class User
|
|||
}
|
||||
$cn = new Database();
|
||||
if (isset($_REQUEST['gDossier']))
|
||||
$p_module.= "dossier : " . $_REQUEST['gDossier'];
|
||||
$p_module.= " dossier : " . $_REQUEST['gDossier'];
|
||||
$sql = "insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
|
||||
|
||||
$cn->exec_sql($sql, array(
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
/* $Revision$ */
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
/* !\brief include from client.inc.php and concerned only the customer card and
|
||||
/**\brief include from client.inc.php and concerned only the customer card and
|
||||
* the customer category
|
||||
*/
|
||||
require_once("class_iselect.php");
|
||||
|
|
@ -30,7 +30,7 @@ require_once('class_fiche_def.php');
|
|||
|
||||
|
||||
$low_action = (isset($_REQUEST['sb'])) ? $_REQUEST['sb'] : "list";
|
||||
/* ! \file
|
||||
/** \file
|
||||
* \brief Called from the module "Gestion" to manage the customer
|
||||
*/
|
||||
$href=basename($_SERVER['PHP_SELF']);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
* \brief file included to manage all the sold operation
|
||||
*/
|
||||
require_once("class_icheckbox.php");
|
||||
|
|
@ -29,7 +29,7 @@ require_once("class_acc_ledger_purchase.php");
|
|||
require_once ('class_pre_op_ach.php');
|
||||
require_once('class_ipopup.php');
|
||||
$gDossier = dossier::id();
|
||||
|
||||
global $g_parameter;
|
||||
$cn = new Database(dossier::id());
|
||||
//menu = show a list of ledger
|
||||
$str_dossier = dossier::get();
|
||||
|
|
@ -62,7 +62,7 @@ if (isset($_POST['view_invoice']))
|
|||
echo '<div class="content">';
|
||||
echo h2info('Confirmation');
|
||||
|
||||
echo '<form enctype="multipart/form-data" method="post">';
|
||||
echo '<form enctype="multipart/form-data" method="post" class="print">';
|
||||
echo dossier::hidden();
|
||||
|
||||
echo $Ledger->confirm($_POST);
|
||||
|
|
@ -232,7 +232,7 @@ echo HtmlInput::reset(_('Effacer '));
|
|||
echo '</div>';
|
||||
echo "</FORM>";
|
||||
|
||||
if (!isset($_POST['e_date']))
|
||||
if (!isset($_POST['e_date']) && $g_parameter->MY_DATE_SUGGEST=='Y')
|
||||
echo create_script(" get_last_date()");
|
||||
|
||||
echo '</div>';
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
require_once ('class_acc_ledger_fin.php');
|
||||
require_once('class_ipopup.php');
|
||||
global $g_user;
|
||||
global $g_user,$g_parameter;
|
||||
|
||||
$gDossier=dossier::id();
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ if ( isset($_POST['save']))
|
|||
{
|
||||
echo '<div class="content">';
|
||||
echo '<h2 class="info">'._('Confirmation').' </h2>';
|
||||
echo '<form name="form_detail" class="print" enctype="multipart/form-data" METHOD="POST">';
|
||||
echo '<form name="form_detail" class="print" enctype="multipart/form-data" class="print" METHOD="POST">';
|
||||
echo HtmlInput::hidden('ac',$_REQUEST['ac']);
|
||||
echo $Ledger->confirm($_POST);
|
||||
echo HtmlInput::submit('confirm',_('Confirmer'));
|
||||
|
|
@ -131,7 +131,7 @@ if ( isset($_POST['correct']))
|
|||
echo '<div class="content">';
|
||||
|
||||
|
||||
echo '<form class="print" name="form_detail" enctype="multipart/form-data" METHOD="POST">';
|
||||
echo '<form class="print" name="form_detail" enctype="multipart/form-data" class="print" METHOD="POST">';
|
||||
echo HtmlInput::hidden('ledger_type','fin');
|
||||
echo HtmlInput::hidden('ac',$_REQUEST['ac']);
|
||||
$array=( isset($correct))?$_POST:null;
|
||||
|
|
@ -142,9 +142,11 @@ echo HtmlInput::button('add_item',_('Ajout article'), ' onClick="ledger_fin_ad
|
|||
echo HtmlInput::submit('save',_('Sauve'));
|
||||
echo HtmlInput::reset(_('Effacer'));
|
||||
|
||||
if ( ! isset ($_POST['e_date']) )
|
||||
if ( ! isset ($_POST['e_date'])&& $g_parameter->MY_DATE_SUGGEST=='Y')
|
||||
{
|
||||
echo create_script(" get_last_date();ajax_saldo('first_sold');");
|
||||
}else {
|
||||
echo create_script(" ajax_saldo('first_sold');");
|
||||
}
|
||||
|
||||
exit();
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
*
|
||||
*
|
||||
* \brief reconcile operation
|
||||
|
|
@ -74,7 +74,7 @@ if (isset($_POST['save']))
|
|||
{
|
||||
echo '<div class="content">'.$g_succeed.' Mise à jour extrait '.$_POST['ext'].'</div>';
|
||||
}
|
||||
|
||||
|
||||
$cn->commit();
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +101,11 @@ echo '<form method="post" id="rec1">';
|
|||
echo dossier::hidden();
|
||||
echo HtmlInput::get_to_hidden(array('sa', 'p_action', 'p_jrn'));
|
||||
|
||||
$operation = $cn->get_array("select jr_id,jr_internal,jr_comment,to_char(jr_date,'DD.MM.YYYY') as fmt_date,jr_montant
|
||||
$operation = $cn->get_array("select jr_id,jr_internal,
|
||||
jr_comment,
|
||||
to_char(jr_date,'DD.MM.YYYY') as fmt_date,
|
||||
jr_montant,
|
||||
to_char(jr_date,'YYYYMMDD') as raw_date
|
||||
from jrn where jr_def_id=$1 and (jr_pj_number is null or jr_pj_number='') order by jr_date", array($Ledger->id));
|
||||
echo '<span id="bkname">' . hb(h($Ledger->get_bank_name())) . '</span>';
|
||||
echo '<p>';
|
||||
|
|
@ -118,8 +122,8 @@ echo 'solde Fin' . $nend_extrait->input();
|
|||
echo IButton::tooggle_checkbox('rec1');
|
||||
echo '</p>';
|
||||
echo HtmlInput::submit('save', 'Mettre à jour le n° de relevé bancaire');
|
||||
echo '<table class="result" style="width:80%;margin-left:10%">';
|
||||
$r = th('Date');
|
||||
echo '<table class="sortable" style="width:80%;margin-left:10%">';
|
||||
$r ='<th class=" sorttable_sorted_reverse">'.'Date '.HtmlInput::infobulle(17).'<span id="sorttable_sortrevind"> ▴</span>'.'</th>';
|
||||
$r.=th('Libellé');
|
||||
$r.=th('N° interne');
|
||||
$r.=th('Montant', ' style="text-align:right"');
|
||||
|
|
@ -133,11 +137,11 @@ for ($i = 0; $i < count($operation); $i++)
|
|||
$row = $operation[$i];
|
||||
$r = '';
|
||||
$js = HtmlInput::detail_op($row['jr_id'], $row['jr_internal']);
|
||||
$r.=td($row['fmt_date']);
|
||||
$r.='<td sorttable_customkey="'.$row['raw_date'].'">'.$row['fmt_date'].'</td>';
|
||||
$r.=td($row['jr_comment']);
|
||||
$r.=td($js);
|
||||
$amount=$cn->get_value('select qf_amount from quant_fin where jr_id=$1', array($row['jr_id']));
|
||||
$r.=td(nbm ($amount), ' class="num" ');
|
||||
$r.='<td class="num" class="sorttable_numeric" sortable_customekey="'.$amount.'" style="text-align:right">'.nbm ($amount).'</td>';
|
||||
|
||||
$diff=bcadd($diff,$amount);
|
||||
$tot_not_reconcilied+=$row['jr_montant'];
|
||||
|
|
@ -154,11 +158,11 @@ for ($i = 0; $i < count($operation); $i++)
|
|||
}
|
||||
}
|
||||
}
|
||||
$r.=td(HtmlInput::hidden('jrid[]', $row['jr_id']) . $iradio->input(), ' style="text-align:center" ');
|
||||
$r.=td(HtmlInput::hidden('jrid['.$i.']', $row['jr_id']) . $iradio->input(), ' style="text-align:center" ');
|
||||
if ($i % 2 == 0)
|
||||
echo tr($r, ' class="odd" ');
|
||||
else
|
||||
echo tr($r);
|
||||
echo tr($r,' class="even" ');
|
||||
}
|
||||
echo '</table>';
|
||||
$bk_card = new Fiche($cn);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
*
|
||||
*
|
||||
* \brief show bank saldo
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/* !\file
|
||||
/**\file
|
||||
*
|
||||
*
|
||||
* \brief to write directly into the ledgers,the stock and the tables
|
||||
|
|
@ -49,7 +49,7 @@ if ( empty ($first_ledger))
|
|||
}
|
||||
$ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id;
|
||||
|
||||
/* !\brief show a form for quick_writing */
|
||||
/**\brief show a form for quick_writing */
|
||||
$def = -1;
|
||||
$ledger->with_concerned = true;
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ elseif (isset($_POST['save']))
|
|||
printf('<a class="detail" style="display:inline" href="javascript:modifyOperation(%d,%d)">%s</a><hr>', $jr_id, dossier::id(), $ledger->internal);
|
||||
|
||||
// show feedback
|
||||
echo '<div id="jrn_name_div">'; echo '<h2 id="jrn_name" style="display:inline">' . $ledger->get_name() . '</h2>'; echo '</div>';
|
||||
echo '<div id="jrn_name_div">'; echo '<h2 id="jrn_name" class="title" style="display:inline">' . $ledger->get_name() . '</h2>'; echo '</div>';
|
||||
echo $ledger->confirm($_POST, true);
|
||||
}
|
||||
catch (Exception $e)
|
||||
|
|
|
|||
|
|
@ -251,8 +251,12 @@ global $g_parameter;
|
|||
/* if we suggest the pj n# the run the script */
|
||||
if ( $g_parameter->MY_PJ_SUGGEST=='Y')
|
||||
{
|
||||
if ( ! isset($_POST['e_date'])) echo '<script> update_pj();get_last_date()</script>';
|
||||
echo '<script> update_pj()</script>';
|
||||
}
|
||||
if (!isset($_POST['e_date']) && $g_parameter->MY_DATE_SUGGEST=='Y')
|
||||
{
|
||||
echo create_script(" get_last_date()");
|
||||
}
|
||||
exit();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ function config_file_create($p_array,$from_setup=1,$os=1)
|
|||
fputs($hFile, 'define ("phpcompta_psql_host","127.0.0.1");');
|
||||
fputs($hFile,"\r\n");
|
||||
|
||||
fputs($hFile, 'define ("locale",'.$clocale.');');
|
||||
fputs($hFile, 'define ("LOCALE",'.$clocale.');');
|
||||
fputs($hFile,"\r\n");
|
||||
|
||||
fputs($hFile, 'define ("domaine","");');
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue