From f36c5ce2b4490265c0977c1aa7bbb3cb712e1bea Mon Sep 17 00:00:00 2001 From: Ebersold Andre Date: Sun, 2 Jan 2022 21:10:03 +0100 Subject: [PATCH 1/1] Initial import from syndic-dev svn --- .gitmodules | 12 + accounting/accueil.en_US.UTF-8.xml | 72 + accounting/accueil.fr_FR.UTF-8.xml | 75 + accounting/bilan.fr_FR.UTF-8.xml | 7 + accounting/budget.fr_FR.UTF-8.xml | 13 + accounting/cgu.fr_FR.UTF-8.xml | 23 + accounting/contact.en_US.UTF-8.xml | 34 + accounting/contact.fr_FR.UTF-8.xml | 34 + accounting/copro_exercice.fr_FR.UTF-8.xml | 7 + accounting/copro_lots.fr_FR.UTF-8.xml | 6 + .../copro_lots_attribuer.fr_FR.UTF-8.xml | 4 + accounting/copropriete.fr_FR.UTF-8.xml | 8 + accounting/dede.txt | 16 + accounting/donates.fr_FR.UTF-8.xml | 29 + accounting/fournisseur.fr_FR.UTF-8.xml | 13 + accounting/journaux.fr_FR.UTF-8.xml | 17 + accounting/liens_syndic.en_US.UTF-8.xml | 21 + accounting/liens_syndic.fr_FR.UTF-8.xml | 30 + accounting/plan_comptable.fr_FR.UTF-8.xml | 10 + accounting/products.en_US.UTF-8.xml | 41 + accounting/products.fr_FR.UTF-8.xml | 42 + accounting/services.en_US.UTF-8.xml | 21 + accounting/services.fr_FR.UTF-8.xml | 34 + accueil.en_US.UTF-8.xml | 73 + accueil.fr_FR.UTF-8.xml | 71 + accueil.xml | 98 + app/admin/crontab.php | 28 + app/admin/index.js | 141 + app/admin/patch_db.php | 65 + app/admin/view/index.fr_FR.UTF-8.xml | 351 + app/basic.php | 222 + app/common.php | 138 + app/compta/Accounting.mysql.keep | 2414 ++++++ app/compta/Dialog.js | 83 + app/compta/api/bank.php | 55 + app/compta/api_base.php | 153 + app/compta/api_booking.php | 365 + app/compta/api_budget.php | 157 + app/compta/api_entretien.php | 90 + app/compta/api_exercice.php | 224 + app/compta/api_identity.php | 335 + app/compta/api_loan.php | 138 + app/compta/api_pcmn.php | 220 + app/compta/api_recurrent.php | 145 + app/compta/api_retrieve.php | 319 + app/compta/api_syndic.php | 295 + app/compta/bilan.js | 69 + app/compta/bilanBootstrap.js | 41 + app/compta/budget.js | 257 + app/compta/budgetBootstrap.js | 59 + app/compta/budget_edit.xml | 60 + app/compta/class.schema.php | 119 + app/compta/controler_base.php | 59 + app/compta/controlers/account.php | 75 + app/compta/controlers/admin.php | 44 + app/compta/controlers/bank.php | 90 + app/compta/controlers/bilan.php | 44 + app/compta/controlers/bill.php | 0 app/compta/controlers/budget.php | 74 + app/compta/controlers/chart.php | 44 + app/compta/controlers/compta.php | 137 + app/compta/controlers/exercice.php | 93 + app/compta/controlers/jrnx.php | 44 + app/compta/controlers/loan.php | 105 + app/compta/controlers/lot.php | 81 + app/compta/controlers/org.php | 44 + app/compta/controlers/recurrent.php | 106 + app/compta/controlers/supplier.php | 47 + app/compta/controlers/transaction.php | 41 + app/compta/copro.js | 787 ++ app/compta/coproBootstrap.js | 54 + app/compta/copro_decompte.xml | 102 + app/compta/copro_entretien.xml | 47 + app/compta/copro_pay.xml | 68 + app/compta/copro_role.xml | 54 + app/compta/copro_users.xml | 44 + app/compta/coprote.js | 193 + app/compta/coproteBootstrap.js | 71 + app/compta/entretien.js | 71 + app/compta/exercice.js | 204 + app/compta/exercice.xml | 62 + app/compta/exerciceBootstrap.js | 63 + app/compta/forms.php | 197 + app/compta/index.php | 117 + app/compta/index.xml | 240 + app/compta/journaux.js | 764 ++ app/compta/journaux.xml | 240 + app/compta/jrnx.xml | 62 + app/compta/jrnxBootstrap.js | 51 + app/compta/jrnx_detail.xml | 62 + app/compta/jrnx_record.xml | 80 + app/compta/jrnx_trans.xml | 60 + app/compta/ledger_church.xml | 396 + app/compta/ledger_create.xml | 179 + app/compta/ledger_syndic.xml | 538 ++ app/compta/logging.php | 120 + app/compta/lot.xml | 121 + app/compta/lot_attribuer.xml | 51 + app/compta/lot_charge.xml | 125 + app/compta/lots.js | 334 + app/compta/models/account.php | 61 + app/compta/models/bank.php | 58 + app/compta/models/budget.php | 48 + app/compta/models/loan.php | 121 + app/compta/models/lot.php | 65 + app/compta/models/recurrent.php | 119 + app/compta/models/transaction.php | 33 + app/compta/page_ledger.php | 286 + app/compta/page_ledger_coproprietaire.php | 129 + app/compta/page_ledger_entretien.php | 84 + app/compta/page_ledger_exercice.php | 85 + app/compta/page_ledger_fournisseur.php | 53 + app/compta/page_ledger_journaux.php | 85 + app/compta/page_ledger_mes_documents.php | 94 + app/compta/page_ledger_plan_comptable.php | 111 + app/compta/page_ledger_syndic.php | 26 + app/compta/pages.php | 127 + app/compta/parametre.js | 204 + app/compta/parametre.xml | 71 + .../patchs/00_missing_solde_compte_out.xml | 41 + app/compta/patchs/01_patch_tantieme.xml | 251 + app/compta/patchs/02_create_pcg.txt | 11 + app/compta/patchs/02_next.xml | 263 + app/compta/patchs/03_pcg_abegre.txt | 112 + app/compta/patchs/03_pcg_syndic.txt | 44 + app/compta/patchs/04_account.txt | 260 + app/compta/patchs/05_calo.txt | 23 + app/compta/patchs/backup_20210731.txt | 1653 ++++ app/compta/patchs/loan.txt | 77 + app/compta/patchs/procedures.txt | 115 + app/compta/patchs/recurrent.txt | 37 + app/compta/patchs/requetes_utils.txt | 21 + .../solde_compte_per_month_per_year.txt | 9 + app/compta/patchs/tantieme_per_lot.sql | 9 + .../patchs/update_transation_foreign_key.txt | 6 + app/compta/pcmn.js | 158 + app/compta/pcmn.xml | 395 + app/compta/pcmnBootstrap.js | 49 + app/compta/pcmn_syndic.txt | 120 + app/compta/reports/decompte_charge.php | 466 ++ app/compta/reports/recu_taxe.php | 195 + app/compta/reports/syndic_annexe1.php | 514 ++ app/compta/reports/syndic_annexe2.php | 536 ++ app/compta/reports/syndic_annexe3.php | 298 + app/compta/reports/syndic_annexe4.php | 97 + app/compta/reports/syndic_annexe_data.php | 267 + app/compta/reports/syndic_annexes.php | 1161 +++ app/compta/reports/syndic_builder_annexe.php | 135 + .../reports/syndic_builder_decompte.php | 217 + app/compta/reports/syndic_charges.php | 259 + app/compta/reports/syndic_compte.php | 419 + app/compta/schema_mysql.php | 988 +++ app/compta/schema_pcmn_abrege_mysql.php | 241 + app/compta/schema_pcmn_syndic_mysql.php | 124 + app/compta/services.js | 524 ++ app/compta/services.php | 117 + app/compta/session.php | 137 + app/compta/supplier.js | 479 ++ app/compta/supplierBootstrap.js | 35 + app/compta/supplier_account.xml | 104 + app/compta/supplier_add.xml | 109 + app/compta/supplier_bill.xml | 119 + app/compta/supplier_pay.xml | 109 + app/compta/supplier_remove.xml | 240 + app/compta/transaction.js | 189 + app/compta/upload.php | 30 + app/compta/users.xml | 240 + app/compta/views/account_detail.php | 150 + app/compta/views/admin_index.php | 100 + app/compta/views/bank_index.php | 138 + app/compta/views/bank_upload.php | 136 + app/compta/views/bilan_index.php | 153 + app/compta/views/budget_detail.php | 127 + app/compta/views/budget_index.php | 120 + app/compta/views/budget_nouveau.php | 172 + app/compta/views/chart_index.php | 144 + app/compta/views/compta_index.php | 289 + app/compta/views/exercice_index.php | 127 + app/compta/views/jrnx_index.php | 128 + app/compta/views/loan_detail.php | 159 + app/compta/views/loan_index.php | 278 + app/compta/views/loan_nouveau.php | 131 + app/compta/views/loan_payer.php | 139 + app/compta/views/lot_attribuer.php | 254 + app/compta/views/lot_index.php | 274 + app/compta/views/lot_nouveau.php | 268 + app/compta/views/lot_update.php | 268 + app/compta/views/org_index.php | 255 + app/compta/views/recurrent_detail.php | 113 + app/compta/views/recurrent_index.php | 310 + app/compta/views/recurrent_nouveau.php | 310 + app/compta/views/recurrent_payer.php | 203 + app/compta/views/recurrent_update.php | 119 + app/config/analystictracking_andre.php | 13 + app/config/analystictracking_syndic.php | 13 + app/config/andre.php | 543 ++ app/config/config.php.example | 191 + app/config/feebf.php | 161 + app/config/mysql.conf.php.example | 83 + app/config/mysql.conf.php.home | 86 + app/config/syndic.php | 510 ++ app/index.php | 137 + app/index.xml | 360 + app/member | 1 + app/registration/class.db_stats.php | 24 + app/registration/counting.php | 134 + app/registration/register.php | 160 + app/users.xml | 240 + app/xsl | 1 + calendar.en_US.UTF-8.xml | 26 + calendar.fr_FR.UTF-8.xml | 27 + calendar.xml | 33 + calendar_doc.xml | 44 + config.xml | 46 + contact.en_US.UTF-8.xml | 34 + contact.fr_FR.UTF-8.xml | 23 + contact.php | 71 + contact.xml | 62 + flist.txt | 46 + googlea757b08c9f17b183.html | 1 + header.xml | 41 + header_php.xml | 45 + images/accounting/NewMenuHBlack60px.png | Bin 0 -> 306 bytes images/accounting/barre_etat.png | Bin 0 -> 6701 bytes images/accounting/bilan.png | Bin 0 -> 25154 bytes images/accounting/book-dolars.png | Bin 0 -> 1499 bytes images/accounting/budget_edit.png | Bin 0 -> 23689 bytes images/accounting/budget_liste.png | Bin 0 -> 7313 bytes images/accounting/budget_menu.png | Bin 0 -> 1833 bytes images/accounting/building.jpg | Bin 0 -> 66146 bytes images/accounting/copro_exercices.png | Bin 0 -> 22825 bytes images/accounting/fournisseur_compte.png | Bin 0 -> 59553 bytes images/accounting/fournisseur_facture.png | Bin 0 -> 23108 bytes images/accounting/fournisseur_payer.png | Bin 0 -> 21415 bytes images/accounting/gestion_lots.png | Bin 0 -> 41832 bytes images/accounting/iu-bilan.jpg | Bin 0 -> 75847 bytes images/accounting/iu-budget.jpg | Bin 0 -> 151555 bytes images/accounting/iu-copro.jpg | Bin 0 -> 67649 bytes images/accounting/iu-coproprietaire.jpg | Bin 0 -> 44714 bytes images/accounting/iu-exercice.jpg | Bin 0 -> 40537 bytes images/accounting/iu-fournisseur.jpg | Bin 0 -> 49661 bytes images/accounting/iu-journaux.jpg | Bin 0 -> 107567 bytes images/accounting/iu-plan-comptable.jpg | Bin 0 -> 38418 bytes images/accounting/iu-syndic.jpg | Bin 0 -> 43100 bytes images/accounting/journaux.png | Bin 0 -> 41594 bytes images/accounting/journaux_menu.png | Bin 0 -> 11541 bytes images/accounting/menu_coprorpiete.png | Bin 0 -> 8728 bytes images/accounting/payer_facture.png | Bin 0 -> 9436 bytes images/accounting/plan_compte.png | Bin 0 -> 29103 bytes images/accounting/plan_menu.png | Bin 0 -> 11208 bytes images/accounting/poste_charge_affecter.png | Bin 0 -> 29387 bytes images/accounting/saisie_facture.png | Bin 0 -> 23463 bytes images/accounting/syndic-header-n.png | Bin 0 -> 14533 bytes images/accounting/syndic-logo.png | Bin 0 -> 8673 bytes images/button-dessin.svg | 198 + images/icons/news.svg | 80 + images/icons/style.svg | 74 + images/icons/summary.svg | 80 + images/icons/title.svg | 74 + images/template-trinity.svg | 1412 ++++ images/template.svg | 1245 +++ images/test-box3D.svg | 225 + images/test-clock.svg | 441 ++ images/x-click-butcc-donate.gif | Bin 0 -> 1040 bytes index.php | 202 + js/NameValuePairCollection.js | 110 + js/Tree-optimized.js | 3503 ++++++++ js/Tree.js | 5692 +++++++++++++ js/cstutils.js | 11 + js/custom-elements-es5-adapter.js | 1 + js/custom-elements-es5-adapter.min.js | 5 + js/drawing.js | 206 + js/email.js | 48 + js/index.html | 45 + js/jsmin | Bin 0 -> 9260 bytes js/jsmin.c | 278 + js/json2.js | 273 + js/lightbox.js | 497 ++ js/load_request.js | 31 + js/login.js | 509 ++ js/md5.js | 407 + js/mydate.js | 231 + js/mymenu.js | 230 + js/request.js | 64 + js/require-min.js | 5 + js/require.js | 2146 +++++ js/scriptaculus/builder.js | 136 + js/scriptaculus/controls.js | 965 +++ js/scriptaculus/dragdrop.js | 974 +++ js/scriptaculus/effects.js | 1123 +++ js/scriptaculus/proto.menu.0.6.js | 99 + js/scriptaculus/prototype.js | 7041 +++++++++++++++++ js/scriptaculus/scriptaculous.js | 68 + js/scriptaculus/slider.js | 275 + js/scriptaculus/sound.js | 59 + js/scriptaculus/unittest.js | 568 ++ js/slidemenu.js | 307 + js/styleswitcher.js | 70 + js/syntaxhighlight/shBrushBash.js | 51 + js/syntaxhighlight/shBrushCSharp.js | 51 + js/syntaxhighlight/shBrushCpp.js | 75 + js/syntaxhighlight/shBrushCss.js | 82 + js/syntaxhighlight/shBrushDelphi.js | 53 + js/syntaxhighlight/shBrushGroovy.js | 68 + js/syntaxhighlight/shBrushJScript.js | 41 + js/syntaxhighlight/shBrushJava.js | 47 + js/syntaxhighlight/shBrushPhp.js | 80 + js/syntaxhighlight/shBrushPython.js | 49 + js/syntaxhighlight/shBrushRuby.js | 47 + js/syntaxhighlight/shBrushScala.js | 46 + js/syntaxhighlight/shBrushSql.js | 61 + js/syntaxhighlight/shBrushVb.js | 48 + js/syntaxhighlight/shBrushXml.js | 89 + js/syntaxhighlight/shCore.js | 726 ++ js/tslib.js | 243 + js/urlparams.js | 20 + .../custom-elements-es5-adapter.js | 15 + js/webcomponentsjs/package.json | 51 + js/webcomponentsjs/webcomponents-bundle.js | 373 + js/webcomponentsjs/webcomponents-loader.js | 185 + js/xgui/CtrlDialogbox.js | 53 + js/xgui/Entry.js | 42 + js/xgui/Table.js | 249 + js/xgui/Xgui.js | 5 + js/xgui/aebw.bat | 2 + js/xgui/aebw.js | 135 + js/xgui/aebw.sh | 4 + js/xgui/index.js | 6 + js/xgui/torm/Entry.js | 42 + js/xgui/torm/Table.js | 249 + js/xgui/torm/Xgui.js | 5 + js/xgui/torm/index.js | 6 + js/xgui/xgui.js | 466 ++ js/xgui/xgui_asn1.js | 7 + js/xgui/xgui_base64.js | 107 + js/xgui/xgui_button.js | 7 + js/xgui/xgui_calendar.js | 300 + js/xgui/xgui_combobox.js | 79 + js/xgui/xgui_corba.js | 49 + js/xgui/xgui_dialogbox.js | 82 + js/xgui/xgui_hex.js | 46 + js/xgui/xgui_json.js | 87 + js/xgui/xgui_jsonrpc.js | 49 + js/xgui/xgui_menu.js | 67 + js/xgui/xgui_stream.js | 7 + js/xgui/xgui_tab.js | 61 + js/xgui/xgui_table.js | 165 + js/xgui/xgui_wizard.js | 81 + liens.xml | 63 + liens_php.xml | 60 + locale/de_DE/LC_MESSAGES/fr_FR.UTF-8.mo | Bin 0 -> 2742 bytes locale/default.mo | Bin 0 -> 388 bytes locale/default.po | 37 + locale/fr_FR.UTF-8.mo | Bin 0 -> 1389 bytes locale/fr_FR.UTF-8.po | 362 + locale/fr_FR/LC_MESSAGES/syndic.mo | Bin 0 -> 3839 bytes locale/syndic_fr_FR.UTF-8.mo | Bin 0 -> 3839 bytes locale/syndic_fr_FR.UTF-8.po | 408 + menu.xml | 334 + menu_andre.xml | 155 + messages.po | 409 + messages.pot | 42 + news.xml | 37 + phplib | 1 + robots.txt | 8 + site/article.xsl | 75 + site/cv.xsl | 279 + site/footer.xsl | 16 + site/generate_header.xsl | 134 + site/generate_html.xsl | 461 ++ site/menuh.xsl | 102 + site/menuv.xsl | 235 + site/news.xsl | 226 + site/page.xsl | 1257 +++ site/root.xsl | 10 + site/test.xsl | 15 + sitemap.php | 69 + src/app/compta/.@__thumb/adefaultcopro.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/adefaultcoprote.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/adefaultjournaux.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/adefaultpcmn.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/adefaultservices.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/adefaultsupplier.ts | Bin 0 -> 386 bytes .../compta/.@__thumb/adefaulttransaction.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s100copro.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s100coprote.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s100journaux.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s100pcmn.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s100services.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s100supplier.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s100transaction.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s800copro.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s800coprote.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s800journaux.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s800pcmn.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s800services.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s800supplier.ts | Bin 0 -> 386 bytes src/app/compta/.@__thumb/s800transaction.ts | Bin 0 -> 386 bytes src/app/compta/Dialog.ts | 120 + src/app/compta/bilan.ts | 104 + src/app/compta/budget.ts | 342 + src/app/compta/copro.ts | 1008 +++ src/app/compta/coprote.ts | 259 + src/app/compta/entretien.ts | 178 + src/app/compta/exercice.ts | 263 + src/app/compta/journaux.ts | 993 +++ src/app/compta/lots.ts | 453 ++ src/app/compta/pcmn.ts | 213 + src/app/compta/services.ts | 990 +++ src/app/compta/supplier.ts | 637 ++ src/app/compta/supplierBootstrap.ts | 41 + src/app/compta/transaction.ts | 280 + src/js/xgui/.@__thumb/adefaultEntry.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/adefaultTable.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/adefaultXgui.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/adefaultindex.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/s100Entry.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/s100Table.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/s100Xgui.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/s100index.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/s800Entry.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/s800Table.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/s800Xgui.ts | Bin 0 -> 386 bytes src/js/xgui/.@__thumb/s800index.ts | Bin 0 -> 386 bytes src/js/xgui/CtrlDialogbox.ts | 73 + src/js/xgui/Entry.ts | 62 + src/js/xgui/Table.ts | 374 + src/js/xgui/Xgui.ts | 3 + src/js/xgui/index.ts | 4 + .../custom-elements/CHANGELOG.md | 38 + .../@webcomponents/custom-elements/LICENSE.md | 19 + .../@webcomponents/custom-elements/README.md | 269 + .../custom-elements/custom-elements.min.js | 57 + .../custom-elements.min.js.map | 1 + .../externs/custom-elements.js | 108 + .../custom-elements/package.json | 75 + .../adefaultAlreadyConstructedMarker.d.ts | Bin 0 -> 386 bytes .../adefaultCustomElementInternals.d.ts | Bin 0 -> 386 bytes .../adefaultCustomElementRegistry.d.ts | Bin 0 -> 386 bytes .../.@__thumb/adefaultCustomElementState.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/adefaultDeferred.d.ts | Bin 0 -> 386 bytes .../adefaultDocumentConstructionObserver.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/adefaultExterns.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/adefaultUtilities.d.ts | Bin 0 -> 386 bytes .../.@__thumb/adefaultcustom-elements.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/adefaultnative-shim.d.ts | Bin 0 -> 386 bytes .../s100AlreadyConstructedMarker.d.ts | Bin 0 -> 386 bytes .../.@__thumb/s100CustomElementInternals.d.ts | Bin 0 -> 386 bytes .../.@__thumb/s100CustomElementRegistry.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s100CustomElementState.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s100Deferred.d.ts | Bin 0 -> 386 bytes .../s100DocumentConstructionObserver.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s100Externs.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s100Utilities.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s100custom-elements.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s100native-shim.d.ts | Bin 0 -> 386 bytes .../s800AlreadyConstructedMarker.d.ts | Bin 0 -> 386 bytes .../.@__thumb/s800CustomElementInternals.d.ts | Bin 0 -> 386 bytes .../.@__thumb/s800CustomElementRegistry.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s800CustomElementState.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s800Deferred.d.ts | Bin 0 -> 386 bytes .../s800DocumentConstructionObserver.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s800Externs.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s800Utilities.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s800custom-elements.d.ts | Bin 0 -> 386 bytes .../src/.@__thumb/s800native-shim.d.ts | Bin 0 -> 386 bytes .../src/AlreadyConstructedMarker.d.ts | 21 + .../src/AlreadyConstructedMarker.js | 19 + .../src/AlreadyConstructedMarker.js.map | 1 + .../src/CustomElementInternals.d.ts | 126 + .../src/CustomElementInternals.js | 471 ++ .../src/CustomElementInternals.js.map | 1 + .../src/CustomElementRegistry.d.ts | 68 + .../src/CustomElementRegistry.js | 271 + .../src/CustomElementRegistry.js.map | 1 + .../src/CustomElementState.d.ts | 16 + .../custom-elements/src/CustomElementState.js | 16 + .../src/CustomElementState.js.map | 1 + .../custom-elements/src/Deferred.d.ts | 18 + .../custom-elements/src/Deferred.js | 29 + .../custom-elements/src/Deferred.js.map | 1 + .../src/DocumentConstructionObserver.d.ts | 19 + .../src/DocumentConstructionObserver.js | 53 + .../src/DocumentConstructionObserver.js.map | 1 + .../custom-elements/src/Externs.d.ts | 86 + .../custom-elements/src/Externs.js | 11 + .../custom-elements/src/Externs.js.map | 1 + .../src/Patch/.@__thumb/adefaultDocument.d.ts | Bin 0 -> 386 bytes .../.@__thumb/adefaultDocumentFragment.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/adefaultElement.d.ts | Bin 0 -> 386 bytes .../Patch/.@__thumb/adefaultHTMLElement.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/adefaultNative.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/adefaultNode.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s100Document.d.ts | Bin 0 -> 386 bytes .../Patch/.@__thumb/s100DocumentFragment.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s100Element.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s100HTMLElement.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s100Native.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s100Node.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s800Document.d.ts | Bin 0 -> 386 bytes .../Patch/.@__thumb/s800DocumentFragment.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s800Element.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s800HTMLElement.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s800Native.d.ts | Bin 0 -> 386 bytes .../src/Patch/.@__thumb/s800Node.d.ts | Bin 0 -> 386 bytes .../custom-elements/src/Patch/Document.d.ts | 12 + .../custom-elements/src/Patch/Document.js | 38 + .../custom-elements/src/Patch/Document.js.map | 1 + .../src/Patch/DocumentFragment.d.ts | 12 + .../src/Patch/DocumentFragment.js | 19 + .../src/Patch/DocumentFragment.js.map | 1 + .../custom-elements/src/Patch/Element.d.ts | 12 + .../custom-elements/src/Patch/Element.js | 233 + .../custom-elements/src/Patch/Element.js.map | 1 + .../src/Patch/HTMLElement.d.ts | 12 + .../custom-elements/src/Patch/HTMLElement.js | 62 + .../src/Patch/HTMLElement.js.map | 1 + .../.@__thumb/adefaultChildNode.d.ts | Bin 0 -> 386 bytes .../.@__thumb/adefaultParentNode.d.ts | Bin 0 -> 386 bytes .../Interface/.@__thumb/s100ChildNode.d.ts | Bin 0 -> 386 bytes .../Interface/.@__thumb/s100ParentNode.d.ts | Bin 0 -> 386 bytes .../Interface/.@__thumb/s800ChildNode.d.ts | Bin 0 -> 386 bytes .../Interface/.@__thumb/s800ParentNode.d.ts | Bin 0 -> 386 bytes .../src/Patch/Interface/ChildNode.d.ts | 20 + .../src/Patch/Interface/ChildNode.js | 101 + .../src/Patch/Interface/ChildNode.js.map | 1 + .../src/Patch/Interface/ParentNode.d.ts | 18 + .../src/Patch/Interface/ParentNode.js | 58 + .../src/Patch/Interface/ParentNode.js.map | 1 + .../custom-elements/src/Patch/Native.d.ts | 56 + .../custom-elements/src/Patch/Native.js | 44 + .../custom-elements/src/Patch/Native.js.map | 1 + .../custom-elements/src/Patch/Node.d.ts | 12 + .../custom-elements/src/Patch/Node.js | 180 + .../custom-elements/src/Patch/Node.js.map | 1 + .../custom-elements/src/Utilities.d.ts | 14 + .../custom-elements/src/Utilities.js | 123 + .../custom-elements/src/Utilities.js.map | 1 + .../custom-elements/src/custom-elements.d.ts | 11 + .../custom-elements/src/custom-elements.js | 45 + .../src/custom-elements.js.map | 1 + .../custom-elements/src/native-shim.d.ts | 10 + .../custom-elements/src/native-shim.js | 46 + .../custom-elements/src/native-shim.js.map | 1 + .../webcomponentsjs/CHANGELOG.md | 57 + .../@webcomponents/webcomponentsjs/LICENSE.md | 19 + .../@webcomponents/webcomponentsjs/README.md | 232 + .../bundles/webcomponents-ce.js | 73 + .../bundles/webcomponents-ce.js.map | 1 + .../bundles/webcomponents-pf_dom.js | 60 + .../bundles/webcomponents-pf_dom.js.map | 1 + .../bundles/webcomponents-pf_js.js | 92 + .../bundles/webcomponents-pf_js.js.map | 1 + .../bundles/webcomponents-sd-ce-pf.js | 363 + .../bundles/webcomponents-sd-ce-pf.js.map | 1 + .../bundles/webcomponents-sd-ce.js | 234 + .../bundles/webcomponents-sd-ce.js.map | 1 + .../bundles/webcomponents-sd.js | 182 + .../bundles/webcomponents-sd.js.map | 1 + .../custom-elements-es5-adapter.js | 15 + .../webcomponentsjs/package.json | 83 + .../custom-elements-es5-adapter-index.js | 16 + .../entrypoints/webcomponents-bundle-index.js | 53 + .../src/entrypoints/webcomponents-ce-index.js | 17 + .../entrypoints/webcomponents-pf_dom-index.js | 17 + .../entrypoints/webcomponents-pf_js-index.js | 13 + .../entrypoints/webcomponents-sd-ce-index.js | 19 + .../webcomponents-sd-ce-pf-index.js | 25 + .../src/entrypoints/webcomponents-sd-index.js | 18 + .../webcomponentsjs/src/flag-parser.js | 64 + .../webcomponentsjs/src/platform/baseuri.js | 27 + .../src/platform/child-node/after.js | 42 + .../src/platform/child-node/before.js | 37 + .../src/platform/child-node/index.js | 14 + .../src/platform/child-node/remove.js | 34 + .../src/platform/child-node/replace-with.js | 39 + .../src/platform/custom-event.js | 83 + .../webcomponentsjs/src/platform/es6-misc.js | 36 + .../src/platform/get-attribute-names.js | 24 + .../webcomponentsjs/src/platform/matches.js | 16 + .../src/platform/parent-node/append.js | 30 + .../src/platform/parent-node/index.js | 13 + .../src/platform/parent-node/prepend.js | 39 + .../platform/parent-node/replace-children.js | 42 + .../webcomponentsjs/src/platform/promise.js | 50 + .../src/platform/svg-element-class-list.js | 27 + .../webcomponentsjs/src/platform/symbol.js | 64 + .../webcomponentsjs/src/unresolved.js | 30 + .../webcomponentsjs/webcomponents-bundle.js | 373 + .../webcomponents-bundle.js.map | 1 + .../webcomponentsjs/webcomponents-loader.js | 185 + .../tslib/.@__thumb/adefaulttslib.d.ts | Bin 0 -> 386 bytes .../tslib/.@__thumb/s100tslib.d.ts | Bin 0 -> 386 bytes .../tslib/.@__thumb/s800tslib.d.ts | Bin 0 -> 386 bytes src/node_modules/tslib/CopyrightNotice.txt | 15 + src/node_modules/tslib/LICENSE.txt | 12 + src/node_modules/tslib/README.md | 154 + src/node_modules/tslib/modules/index.js | 53 + src/node_modules/tslib/modules/package.json | 3 + src/node_modules/tslib/package.json | 65 + src/node_modules/tslib/tslib.d.ts | 40 + src/node_modules/tslib/tslib.es6.html | 1 + src/node_modules/tslib/tslib.es6.js | 237 + src/node_modules/tslib/tslib.html | 1 + src/node_modules/tslib/tslib.js | 304 + src/package-lock.json | 22 + src/package.json | 10 + src/tsconfig.json | 39 + src/tsconfig.xgui.json | 9 + src/types/aebw/.@__thumb/adefaultindex.d.ts | Bin 0 -> 386 bytes src/types/aebw/.@__thumb/s100index.d.ts | Bin 0 -> 386 bytes src/types/aebw/.@__thumb/s800index.d.ts | Bin 0 -> 386 bytes src/types/aebw/index.d.ts | 89 + src/types/prototypejs/index.d.ts | 80 + src/types/require.d.ts | 45 + src/types/require1.d.ts | 208 + src/types/requirejs.d.ts | 434 + src/types/requirejs/index.d.ts | 434 + syndic.pot | 271 + syndic_file_list.txt | 40 + tiers/tcpdf | 1 + tools/gen_tex.bat | 15 + tools/generate.bat | 32 + tools/generate.sh | 136 + tools/generate.wsf | 116 + tools/generate1.bat | 21 + update.php | 694 ++ web.xml | 89 + webfonts/fa-brands-400.eot | Bin 0 -> 125320 bytes webfonts/fa-brands-400.svg | 3296 ++++++++ webfonts/fa-brands-400.ttf | Bin 0 -> 125016 bytes webfonts/fa-brands-400.woff | Bin 0 -> 84564 bytes webfonts/fa-brands-400.woff2 | Bin 0 -> 72112 bytes webfonts/fa-regular-400.eot | Bin 0 -> 34388 bytes webfonts/fa-regular-400.svg | 799 ++ webfonts/fa-regular-400.ttf | Bin 0 -> 34092 bytes webfonts/fa-regular-400.woff | Bin 0 -> 16812 bytes webfonts/fa-regular-400.woff2 | Bin 0 -> 13592 bytes webfonts/fa-solid-900.eot | Bin 0 -> 186512 bytes webfonts/fa-solid-900.svg | 4516 +++++++++++ webfonts/fa-solid-900.ttf | Bin 0 -> 186228 bytes webfonts/fa-solid-900.woff | Bin 0 -> 96244 bytes webfonts/fa-solid-900.woff2 | Bin 0 -> 74348 bytes 643 files changed, 100174 insertions(+) create mode 100644 .gitmodules create mode 100644 accounting/accueil.en_US.UTF-8.xml create mode 100644 accounting/accueil.fr_FR.UTF-8.xml create mode 100644 accounting/bilan.fr_FR.UTF-8.xml create mode 100644 accounting/budget.fr_FR.UTF-8.xml create mode 100644 accounting/cgu.fr_FR.UTF-8.xml create mode 100644 accounting/contact.en_US.UTF-8.xml create mode 100644 accounting/contact.fr_FR.UTF-8.xml create mode 100644 accounting/copro_exercice.fr_FR.UTF-8.xml create mode 100644 accounting/copro_lots.fr_FR.UTF-8.xml create mode 100644 accounting/copro_lots_attribuer.fr_FR.UTF-8.xml create mode 100644 accounting/copropriete.fr_FR.UTF-8.xml create mode 100644 accounting/dede.txt create mode 100644 accounting/donates.fr_FR.UTF-8.xml create mode 100644 accounting/fournisseur.fr_FR.UTF-8.xml create mode 100644 accounting/journaux.fr_FR.UTF-8.xml create mode 100644 accounting/liens_syndic.en_US.UTF-8.xml create mode 100644 accounting/liens_syndic.fr_FR.UTF-8.xml create mode 100644 accounting/plan_comptable.fr_FR.UTF-8.xml create mode 100644 accounting/products.en_US.UTF-8.xml create mode 100644 accounting/products.fr_FR.UTF-8.xml create mode 100644 accounting/services.en_US.UTF-8.xml create mode 100644 accounting/services.fr_FR.UTF-8.xml create mode 100644 accueil.en_US.UTF-8.xml create mode 100644 accueil.fr_FR.UTF-8.xml create mode 100644 accueil.xml create mode 100644 app/admin/crontab.php create mode 100644 app/admin/index.js create mode 100644 app/admin/patch_db.php create mode 100644 app/admin/view/index.fr_FR.UTF-8.xml create mode 100644 app/basic.php create mode 100644 app/common.php create mode 100644 app/compta/Accounting.mysql.keep create mode 100644 app/compta/Dialog.js create mode 100644 app/compta/api/bank.php create mode 100644 app/compta/api_base.php create mode 100644 app/compta/api_booking.php create mode 100644 app/compta/api_budget.php create mode 100644 app/compta/api_entretien.php create mode 100644 app/compta/api_exercice.php create mode 100644 app/compta/api_identity.php create mode 100644 app/compta/api_loan.php create mode 100644 app/compta/api_pcmn.php create mode 100644 app/compta/api_recurrent.php create mode 100644 app/compta/api_retrieve.php create mode 100644 app/compta/api_syndic.php create mode 100644 app/compta/bilan.js create mode 100644 app/compta/bilanBootstrap.js create mode 100644 app/compta/budget.js create mode 100644 app/compta/budgetBootstrap.js create mode 100644 app/compta/budget_edit.xml create mode 100644 app/compta/class.schema.php create mode 100644 app/compta/controler_base.php create mode 100644 app/compta/controlers/account.php create mode 100644 app/compta/controlers/admin.php create mode 100644 app/compta/controlers/bank.php create mode 100644 app/compta/controlers/bilan.php create mode 100644 app/compta/controlers/bill.php create mode 100644 app/compta/controlers/budget.php create mode 100644 app/compta/controlers/chart.php create mode 100644 app/compta/controlers/compta.php create mode 100644 app/compta/controlers/exercice.php create mode 100644 app/compta/controlers/jrnx.php create mode 100644 app/compta/controlers/loan.php create mode 100644 app/compta/controlers/lot.php create mode 100644 app/compta/controlers/org.php create mode 100644 app/compta/controlers/recurrent.php create mode 100644 app/compta/controlers/supplier.php create mode 100644 app/compta/controlers/transaction.php create mode 100644 app/compta/copro.js create mode 100644 app/compta/coproBootstrap.js create mode 100644 app/compta/copro_decompte.xml create mode 100644 app/compta/copro_entretien.xml create mode 100644 app/compta/copro_pay.xml create mode 100644 app/compta/copro_role.xml create mode 100644 app/compta/copro_users.xml create mode 100644 app/compta/coprote.js create mode 100644 app/compta/coproteBootstrap.js create mode 100644 app/compta/entretien.js create mode 100644 app/compta/exercice.js create mode 100644 app/compta/exercice.xml create mode 100644 app/compta/exerciceBootstrap.js create mode 100644 app/compta/forms.php create mode 100644 app/compta/index.php create mode 100644 app/compta/index.xml create mode 100644 app/compta/journaux.js create mode 100644 app/compta/journaux.xml create mode 100644 app/compta/jrnx.xml create mode 100644 app/compta/jrnxBootstrap.js create mode 100644 app/compta/jrnx_detail.xml create mode 100644 app/compta/jrnx_record.xml create mode 100644 app/compta/jrnx_trans.xml create mode 100644 app/compta/ledger_church.xml create mode 100644 app/compta/ledger_create.xml create mode 100644 app/compta/ledger_syndic.xml create mode 100644 app/compta/logging.php create mode 100644 app/compta/lot.xml create mode 100644 app/compta/lot_attribuer.xml create mode 100644 app/compta/lot_charge.xml create mode 100644 app/compta/lots.js create mode 100644 app/compta/models/account.php create mode 100644 app/compta/models/bank.php create mode 100644 app/compta/models/budget.php create mode 100644 app/compta/models/loan.php create mode 100644 app/compta/models/lot.php create mode 100644 app/compta/models/recurrent.php create mode 100644 app/compta/models/transaction.php create mode 100644 app/compta/page_ledger.php create mode 100644 app/compta/page_ledger_coproprietaire.php create mode 100644 app/compta/page_ledger_entretien.php create mode 100644 app/compta/page_ledger_exercice.php create mode 100644 app/compta/page_ledger_fournisseur.php create mode 100644 app/compta/page_ledger_journaux.php create mode 100644 app/compta/page_ledger_mes_documents.php create mode 100644 app/compta/page_ledger_plan_comptable.php create mode 100644 app/compta/page_ledger_syndic.php create mode 100644 app/compta/pages.php create mode 100644 app/compta/parametre.js create mode 100644 app/compta/parametre.xml create mode 100644 app/compta/patchs/00_missing_solde_compte_out.xml create mode 100644 app/compta/patchs/01_patch_tantieme.xml create mode 100644 app/compta/patchs/02_create_pcg.txt create mode 100644 app/compta/patchs/02_next.xml create mode 100644 app/compta/patchs/03_pcg_abegre.txt create mode 100644 app/compta/patchs/03_pcg_syndic.txt create mode 100644 app/compta/patchs/04_account.txt create mode 100644 app/compta/patchs/05_calo.txt create mode 100644 app/compta/patchs/backup_20210731.txt create mode 100644 app/compta/patchs/loan.txt create mode 100644 app/compta/patchs/procedures.txt create mode 100644 app/compta/patchs/recurrent.txt create mode 100644 app/compta/patchs/requetes_utils.txt create mode 100644 app/compta/patchs/solde_compte_per_month_per_year.txt create mode 100644 app/compta/patchs/tantieme_per_lot.sql create mode 100644 app/compta/patchs/update_transation_foreign_key.txt create mode 100644 app/compta/pcmn.js create mode 100644 app/compta/pcmn.xml create mode 100644 app/compta/pcmnBootstrap.js create mode 100644 app/compta/pcmn_syndic.txt create mode 100644 app/compta/reports/decompte_charge.php create mode 100644 app/compta/reports/recu_taxe.php create mode 100644 app/compta/reports/syndic_annexe1.php create mode 100644 app/compta/reports/syndic_annexe2.php create mode 100644 app/compta/reports/syndic_annexe3.php create mode 100644 app/compta/reports/syndic_annexe4.php create mode 100644 app/compta/reports/syndic_annexe_data.php create mode 100644 app/compta/reports/syndic_annexes.php create mode 100644 app/compta/reports/syndic_builder_annexe.php create mode 100644 app/compta/reports/syndic_builder_decompte.php create mode 100644 app/compta/reports/syndic_charges.php create mode 100644 app/compta/reports/syndic_compte.php create mode 100644 app/compta/schema_mysql.php create mode 100644 app/compta/schema_pcmn_abrege_mysql.php create mode 100644 app/compta/schema_pcmn_syndic_mysql.php create mode 100644 app/compta/services.js create mode 100644 app/compta/services.php create mode 100644 app/compta/session.php create mode 100644 app/compta/supplier.js create mode 100644 app/compta/supplierBootstrap.js create mode 100644 app/compta/supplier_account.xml create mode 100644 app/compta/supplier_add.xml create mode 100644 app/compta/supplier_bill.xml create mode 100644 app/compta/supplier_pay.xml create mode 100644 app/compta/supplier_remove.xml create mode 100644 app/compta/transaction.js create mode 100644 app/compta/upload.php create mode 100644 app/compta/users.xml create mode 100644 app/compta/views/account_detail.php create mode 100644 app/compta/views/admin_index.php create mode 100644 app/compta/views/bank_index.php create mode 100644 app/compta/views/bank_upload.php create mode 100644 app/compta/views/bilan_index.php create mode 100644 app/compta/views/budget_detail.php create mode 100644 app/compta/views/budget_index.php create mode 100644 app/compta/views/budget_nouveau.php create mode 100644 app/compta/views/chart_index.php create mode 100644 app/compta/views/compta_index.php create mode 100644 app/compta/views/exercice_index.php create mode 100644 app/compta/views/jrnx_index.php create mode 100644 app/compta/views/loan_detail.php create mode 100644 app/compta/views/loan_index.php create mode 100644 app/compta/views/loan_nouveau.php create mode 100644 app/compta/views/loan_payer.php create mode 100644 app/compta/views/lot_attribuer.php create mode 100644 app/compta/views/lot_index.php create mode 100644 app/compta/views/lot_nouveau.php create mode 100644 app/compta/views/lot_update.php create mode 100644 app/compta/views/org_index.php create mode 100644 app/compta/views/recurrent_detail.php create mode 100644 app/compta/views/recurrent_index.php create mode 100644 app/compta/views/recurrent_nouveau.php create mode 100644 app/compta/views/recurrent_payer.php create mode 100644 app/compta/views/recurrent_update.php create mode 100644 app/config/analystictracking_andre.php create mode 100644 app/config/analystictracking_syndic.php create mode 100644 app/config/andre.php create mode 100644 app/config/config.php.example create mode 100644 app/config/feebf.php create mode 100644 app/config/mysql.conf.php.example create mode 100644 app/config/mysql.conf.php.home create mode 100644 app/config/syndic.php create mode 100644 app/index.php create mode 100644 app/index.xml create mode 160000 app/member create mode 100644 app/registration/class.db_stats.php create mode 100644 app/registration/counting.php create mode 100644 app/registration/register.php create mode 100644 app/users.xml create mode 160000 app/xsl create mode 100644 calendar.en_US.UTF-8.xml create mode 100644 calendar.fr_FR.UTF-8.xml create mode 100644 calendar.xml create mode 100644 calendar_doc.xml create mode 100644 config.xml create mode 100644 contact.en_US.UTF-8.xml create mode 100644 contact.fr_FR.UTF-8.xml create mode 100644 contact.php create mode 100644 contact.xml create mode 100644 flist.txt create mode 100644 googlea757b08c9f17b183.html create mode 100644 header.xml create mode 100644 header_php.xml create mode 100755 images/accounting/NewMenuHBlack60px.png create mode 100755 images/accounting/barre_etat.png create mode 100755 images/accounting/bilan.png create mode 100755 images/accounting/book-dolars.png create mode 100755 images/accounting/budget_edit.png create mode 100755 images/accounting/budget_liste.png create mode 100755 images/accounting/budget_menu.png create mode 100755 images/accounting/building.jpg create mode 100755 images/accounting/copro_exercices.png create mode 100755 images/accounting/fournisseur_compte.png create mode 100755 images/accounting/fournisseur_facture.png create mode 100755 images/accounting/fournisseur_payer.png create mode 100755 images/accounting/gestion_lots.png create mode 100644 images/accounting/iu-bilan.jpg create mode 100644 images/accounting/iu-budget.jpg create mode 100644 images/accounting/iu-copro.jpg create mode 100644 images/accounting/iu-coproprietaire.jpg create mode 100644 images/accounting/iu-exercice.jpg create mode 100644 images/accounting/iu-fournisseur.jpg create mode 100644 images/accounting/iu-journaux.jpg create mode 100644 images/accounting/iu-plan-comptable.jpg create mode 100644 images/accounting/iu-syndic.jpg create mode 100755 images/accounting/journaux.png create mode 100755 images/accounting/journaux_menu.png create mode 100755 images/accounting/menu_coprorpiete.png create mode 100755 images/accounting/payer_facture.png create mode 100755 images/accounting/plan_compte.png create mode 100755 images/accounting/plan_menu.png create mode 100755 images/accounting/poste_charge_affecter.png create mode 100755 images/accounting/saisie_facture.png create mode 100755 images/accounting/syndic-header-n.png create mode 100755 images/accounting/syndic-logo.png create mode 100644 images/button-dessin.svg create mode 100644 images/icons/news.svg create mode 100644 images/icons/style.svg create mode 100644 images/icons/summary.svg create mode 100644 images/icons/title.svg create mode 100644 images/template-trinity.svg create mode 100644 images/template.svg create mode 100644 images/test-box3D.svg create mode 100644 images/test-clock.svg create mode 100644 images/x-click-butcc-donate.gif create mode 100644 index.php create mode 100644 js/NameValuePairCollection.js create mode 100644 js/Tree-optimized.js create mode 100644 js/Tree.js create mode 100644 js/cstutils.js create mode 100644 js/custom-elements-es5-adapter.js create mode 100644 js/custom-elements-es5-adapter.min.js create mode 100644 js/drawing.js create mode 100644 js/email.js create mode 100644 js/index.html create mode 100755 js/jsmin create mode 100644 js/jsmin.c create mode 100644 js/json2.js create mode 100644 js/lightbox.js create mode 100644 js/load_request.js create mode 100644 js/login.js create mode 100644 js/md5.js create mode 100644 js/mydate.js create mode 100644 js/mymenu.js create mode 100644 js/request.js create mode 100644 js/require-min.js create mode 100644 js/require.js create mode 100644 js/scriptaculus/builder.js create mode 100644 js/scriptaculus/controls.js create mode 100644 js/scriptaculus/dragdrop.js create mode 100644 js/scriptaculus/effects.js create mode 100644 js/scriptaculus/proto.menu.0.6.js create mode 100644 js/scriptaculus/prototype.js create mode 100644 js/scriptaculus/scriptaculous.js create mode 100644 js/scriptaculus/slider.js create mode 100644 js/scriptaculus/sound.js create mode 100644 js/scriptaculus/unittest.js create mode 100644 js/slidemenu.js create mode 100644 js/styleswitcher.js create mode 100644 js/syntaxhighlight/shBrushBash.js create mode 100644 js/syntaxhighlight/shBrushCSharp.js create mode 100644 js/syntaxhighlight/shBrushCpp.js create mode 100644 js/syntaxhighlight/shBrushCss.js create mode 100644 js/syntaxhighlight/shBrushDelphi.js create mode 100644 js/syntaxhighlight/shBrushGroovy.js create mode 100644 js/syntaxhighlight/shBrushJScript.js create mode 100644 js/syntaxhighlight/shBrushJava.js create mode 100644 js/syntaxhighlight/shBrushPhp.js create mode 100644 js/syntaxhighlight/shBrushPython.js create mode 100644 js/syntaxhighlight/shBrushRuby.js create mode 100644 js/syntaxhighlight/shBrushScala.js create mode 100644 js/syntaxhighlight/shBrushSql.js create mode 100644 js/syntaxhighlight/shBrushVb.js create mode 100644 js/syntaxhighlight/shBrushXml.js create mode 100644 js/syntaxhighlight/shCore.js create mode 100644 js/tslib.js create mode 100644 js/urlparams.js create mode 100644 js/webcomponentsjs/custom-elements-es5-adapter.js create mode 100644 js/webcomponentsjs/package.json create mode 100644 js/webcomponentsjs/webcomponents-bundle.js create mode 100644 js/webcomponentsjs/webcomponents-loader.js create mode 100644 js/xgui/CtrlDialogbox.js create mode 100644 js/xgui/Entry.js create mode 100644 js/xgui/Table.js create mode 100644 js/xgui/Xgui.js create mode 100644 js/xgui/aebw.bat create mode 100644 js/xgui/aebw.js create mode 100755 js/xgui/aebw.sh create mode 100644 js/xgui/index.js create mode 100644 js/xgui/torm/Entry.js create mode 100644 js/xgui/torm/Table.js create mode 100644 js/xgui/torm/Xgui.js create mode 100644 js/xgui/torm/index.js create mode 100644 js/xgui/xgui.js create mode 100644 js/xgui/xgui_asn1.js create mode 100644 js/xgui/xgui_base64.js create mode 100644 js/xgui/xgui_button.js create mode 100644 js/xgui/xgui_calendar.js create mode 100644 js/xgui/xgui_combobox.js create mode 100644 js/xgui/xgui_corba.js create mode 100644 js/xgui/xgui_dialogbox.js create mode 100644 js/xgui/xgui_hex.js create mode 100644 js/xgui/xgui_json.js create mode 100644 js/xgui/xgui_jsonrpc.js create mode 100644 js/xgui/xgui_menu.js create mode 100644 js/xgui/xgui_stream.js create mode 100644 js/xgui/xgui_tab.js create mode 100644 js/xgui/xgui_table.js create mode 100644 js/xgui/xgui_wizard.js create mode 100644 liens.xml create mode 100644 liens_php.xml create mode 100644 locale/de_DE/LC_MESSAGES/fr_FR.UTF-8.mo create mode 100644 locale/default.mo create mode 100644 locale/default.po create mode 100644 locale/fr_FR.UTF-8.mo create mode 100644 locale/fr_FR.UTF-8.po create mode 100644 locale/fr_FR/LC_MESSAGES/syndic.mo create mode 100644 locale/syndic_fr_FR.UTF-8.mo create mode 100644 locale/syndic_fr_FR.UTF-8.po create mode 100644 menu.xml create mode 100644 menu_andre.xml create mode 100644 messages.po create mode 100644 messages.pot create mode 100644 news.xml create mode 160000 phplib create mode 100644 robots.txt create mode 100644 site/article.xsl create mode 100644 site/cv.xsl create mode 100644 site/footer.xsl create mode 100644 site/generate_header.xsl create mode 100644 site/generate_html.xsl create mode 100644 site/menuh.xsl create mode 100644 site/menuv.xsl create mode 100644 site/news.xsl create mode 100644 site/page.xsl create mode 100644 site/root.xsl create mode 100644 site/test.xsl create mode 100644 sitemap.php create mode 100644 src/app/compta/.@__thumb/adefaultcopro.ts create mode 100644 src/app/compta/.@__thumb/adefaultcoprote.ts create mode 100644 src/app/compta/.@__thumb/adefaultjournaux.ts create mode 100644 src/app/compta/.@__thumb/adefaultpcmn.ts create mode 100644 src/app/compta/.@__thumb/adefaultservices.ts create mode 100644 src/app/compta/.@__thumb/adefaultsupplier.ts create mode 100644 src/app/compta/.@__thumb/adefaulttransaction.ts create mode 100644 src/app/compta/.@__thumb/s100copro.ts create mode 100644 src/app/compta/.@__thumb/s100coprote.ts create mode 100644 src/app/compta/.@__thumb/s100journaux.ts create mode 100644 src/app/compta/.@__thumb/s100pcmn.ts create mode 100644 src/app/compta/.@__thumb/s100services.ts create mode 100644 src/app/compta/.@__thumb/s100supplier.ts create mode 100644 src/app/compta/.@__thumb/s100transaction.ts create mode 100644 src/app/compta/.@__thumb/s800copro.ts create mode 100644 src/app/compta/.@__thumb/s800coprote.ts create mode 100644 src/app/compta/.@__thumb/s800journaux.ts create mode 100644 src/app/compta/.@__thumb/s800pcmn.ts create mode 100644 src/app/compta/.@__thumb/s800services.ts create mode 100644 src/app/compta/.@__thumb/s800supplier.ts create mode 100644 src/app/compta/.@__thumb/s800transaction.ts create mode 100644 src/app/compta/Dialog.ts create mode 100644 src/app/compta/bilan.ts create mode 100644 src/app/compta/budget.ts create mode 100644 src/app/compta/copro.ts create mode 100644 src/app/compta/coprote.ts create mode 100644 src/app/compta/entretien.ts create mode 100644 src/app/compta/exercice.ts create mode 100644 src/app/compta/journaux.ts create mode 100644 src/app/compta/lots.ts create mode 100644 src/app/compta/pcmn.ts create mode 100644 src/app/compta/services.ts create mode 100644 src/app/compta/supplier.ts create mode 100644 src/app/compta/supplierBootstrap.ts create mode 100644 src/app/compta/transaction.ts create mode 100644 src/js/xgui/.@__thumb/adefaultEntry.ts create mode 100644 src/js/xgui/.@__thumb/adefaultTable.ts create mode 100644 src/js/xgui/.@__thumb/adefaultXgui.ts create mode 100644 src/js/xgui/.@__thumb/adefaultindex.ts create mode 100644 src/js/xgui/.@__thumb/s100Entry.ts create mode 100644 src/js/xgui/.@__thumb/s100Table.ts create mode 100644 src/js/xgui/.@__thumb/s100Xgui.ts create mode 100644 src/js/xgui/.@__thumb/s100index.ts create mode 100644 src/js/xgui/.@__thumb/s800Entry.ts create mode 100644 src/js/xgui/.@__thumb/s800Table.ts create mode 100644 src/js/xgui/.@__thumb/s800Xgui.ts create mode 100644 src/js/xgui/.@__thumb/s800index.ts create mode 100644 src/js/xgui/CtrlDialogbox.ts create mode 100644 src/js/xgui/Entry.ts create mode 100644 src/js/xgui/Table.ts create mode 100644 src/js/xgui/Xgui.ts create mode 100644 src/js/xgui/index.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/CHANGELOG.md create mode 100644 src/node_modules/@webcomponents/custom-elements/LICENSE.md create mode 100644 src/node_modules/@webcomponents/custom-elements/README.md create mode 100644 src/node_modules/@webcomponents/custom-elements/custom-elements.min.js create mode 100644 src/node_modules/@webcomponents/custom-elements/custom-elements.min.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/externs/custom-elements.js create mode 100644 src/node_modules/@webcomponents/custom-elements/package.json create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultAlreadyConstructedMarker.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultCustomElementInternals.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultCustomElementRegistry.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultCustomElementState.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultDeferred.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultDocumentConstructionObserver.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultExterns.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultUtilities.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultcustom-elements.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/adefaultnative-shim.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100AlreadyConstructedMarker.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100CustomElementInternals.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100CustomElementRegistry.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100CustomElementState.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100Deferred.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100DocumentConstructionObserver.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100Externs.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100Utilities.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100custom-elements.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s100native-shim.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800AlreadyConstructedMarker.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800CustomElementInternals.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800CustomElementRegistry.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800CustomElementState.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800Deferred.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800DocumentConstructionObserver.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800Externs.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800Utilities.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800custom-elements.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/.@__thumb/s800native-shim.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/AlreadyConstructedMarker.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/AlreadyConstructedMarker.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/AlreadyConstructedMarker.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementInternals.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementInternals.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementInternals.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementRegistry.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementRegistry.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementRegistry.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementState.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementState.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/CustomElementState.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Deferred.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Deferred.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Deferred.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/DocumentConstructionObserver.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/DocumentConstructionObserver.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/DocumentConstructionObserver.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Externs.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Externs.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Externs.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/adefaultDocument.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/adefaultDocumentFragment.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/adefaultElement.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/adefaultHTMLElement.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/adefaultNative.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/adefaultNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s100Document.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s100DocumentFragment.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s100Element.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s100HTMLElement.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s100Native.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s100Node.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s800Document.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s800DocumentFragment.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s800Element.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s800HTMLElement.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s800Native.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/.@__thumb/s800Node.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Document.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Document.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Document.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/DocumentFragment.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/DocumentFragment.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/DocumentFragment.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Element.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Element.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Element.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/HTMLElement.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/HTMLElement.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/HTMLElement.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/.@__thumb/adefaultChildNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/.@__thumb/adefaultParentNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/.@__thumb/s100ChildNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/.@__thumb/s100ParentNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/.@__thumb/s800ChildNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/.@__thumb/s800ParentNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/ChildNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/ChildNode.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/ChildNode.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/ParentNode.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/ParentNode.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Interface/ParentNode.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Native.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Native.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Native.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Node.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Node.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Patch/Node.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Utilities.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Utilities.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/Utilities.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/custom-elements.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/custom-elements.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/custom-elements.js.map create mode 100644 src/node_modules/@webcomponents/custom-elements/src/native-shim.d.ts create mode 100644 src/node_modules/@webcomponents/custom-elements/src/native-shim.js create mode 100644 src/node_modules/@webcomponents/custom-elements/src/native-shim.js.map create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/CHANGELOG.md create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/LICENSE.md create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/README.md create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-ce.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-ce.js.map create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_dom.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_dom.js.map create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_js.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-pf_js.js.map create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce.js.map create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd.js.map create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/package.json create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/custom-elements-es5-adapter-index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-bundle-index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-ce-index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-pf_dom-index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-pf_js-index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-pf-index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/entrypoints/webcomponents-sd-index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/flag-parser.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/baseuri.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/child-node/after.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/child-node/before.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/child-node/index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/child-node/remove.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/child-node/replace-with.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/custom-event.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/es6-misc.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/get-attribute-names.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/matches.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/parent-node/append.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/parent-node/index.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/parent-node/prepend.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/parent-node/replace-children.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/promise.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/svg-element-class-list.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/platform/symbol.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/src/unresolved.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js.map create mode 100644 src/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js create mode 100644 src/node_modules/tslib/.@__thumb/adefaulttslib.d.ts create mode 100644 src/node_modules/tslib/.@__thumb/s100tslib.d.ts create mode 100644 src/node_modules/tslib/.@__thumb/s800tslib.d.ts create mode 100644 src/node_modules/tslib/CopyrightNotice.txt create mode 100644 src/node_modules/tslib/LICENSE.txt create mode 100644 src/node_modules/tslib/README.md create mode 100644 src/node_modules/tslib/modules/index.js create mode 100644 src/node_modules/tslib/modules/package.json create mode 100644 src/node_modules/tslib/package.json create mode 100644 src/node_modules/tslib/tslib.d.ts create mode 100644 src/node_modules/tslib/tslib.es6.html create mode 100644 src/node_modules/tslib/tslib.es6.js create mode 100644 src/node_modules/tslib/tslib.html create mode 100644 src/node_modules/tslib/tslib.js create mode 100644 src/package-lock.json create mode 100644 src/package.json create mode 100644 src/tsconfig.json create mode 100644 src/tsconfig.xgui.json create mode 100644 src/types/aebw/.@__thumb/adefaultindex.d.ts create mode 100644 src/types/aebw/.@__thumb/s100index.d.ts create mode 100644 src/types/aebw/.@__thumb/s800index.d.ts create mode 100644 src/types/aebw/index.d.ts create mode 100644 src/types/prototypejs/index.d.ts create mode 100644 src/types/require.d.ts create mode 100644 src/types/require1.d.ts create mode 100644 src/types/requirejs.d.ts create mode 100644 src/types/requirejs/index.d.ts create mode 100644 syndic.pot create mode 100644 syndic_file_list.txt create mode 160000 tiers/tcpdf create mode 100644 tools/gen_tex.bat create mode 100644 tools/generate.bat create mode 100644 tools/generate.sh create mode 100644 tools/generate.wsf create mode 100644 tools/generate1.bat create mode 100644 update.php create mode 100644 web.xml create mode 100644 webfonts/fa-brands-400.eot create mode 100644 webfonts/fa-brands-400.svg create mode 100644 webfonts/fa-brands-400.ttf create mode 100644 webfonts/fa-brands-400.woff create mode 100644 webfonts/fa-brands-400.woff2 create mode 100644 webfonts/fa-regular-400.eot create mode 100644 webfonts/fa-regular-400.svg create mode 100644 webfonts/fa-regular-400.ttf create mode 100644 webfonts/fa-regular-400.woff create mode 100644 webfonts/fa-regular-400.woff2 create mode 100644 webfonts/fa-solid-900.eot create mode 100644 webfonts/fa-solid-900.svg create mode 100644 webfonts/fa-solid-900.ttf create mode 100644 webfonts/fa-solid-900.woff create mode 100644 webfonts/fa-solid-900.woff2 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1ee8a78 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "app/xsl"] + path = app/xsl + url = https://git.ebersold.fr/repos/www/app/xsl +[submodule "app/member"] + path = app/member + url = https://git.ebersold.fr/repos/www/app/user.git +[submodule "phplib"] + path = phplib + url = https://git.ebersold.fr/repos/www/common/phplib.git +[submodule "tiers/tcpdf"] + path = tiers/tcpdf + url = https://git.ebersold.fr/repos/www/tiers/tcpdf.git diff --git a/accounting/accueil.en_US.UTF-8.xml b/accounting/accueil.en_US.UTF-8.xml new file mode 100644 index 0000000..43fdd45 --- /dev/null +++ b/accounting/accueil.en_US.UTF-8.xml @@ -0,0 +1,72 @@ + + + + + + Welcome page of Aeb +

Welcome page to aeb website. You can find a porto folio of our realizations.

+ C++,CV,Linux,Development + $Date: 2010/08/25 15:10:02 $ + $Id: accueil.en_US.UTF-8.xml,v 1.4 2010/08/25 15:10:02 aebersol Exp $ + +
+
+
+
+
Who I am
+
+

Senior Software Engineer
+

39 years old
Married 1 child

+

Company : Alcatel Lucent

+

+

Specialized in C/C++ development

+
+
+
+
Studies / Projects
+
+
    +
  • Flash driver enhancement
  • +
  • Web reverse proxy comparison
  • +
  • Encapsulation of binary flow in http chucks
  • +
  • OmniPCX Office feature improvements
  • +
  • Porting Linux 2.4 drivers to kernel 2.6
  • +
  • Migration of x86 application to powerpc
  • +
+
+
+
+
+
+
+
News Events
+
+
    +
  • I work for Alcatel Lucent
  • +
  • I maintain a remote server (from dedibox) for an association
  • +
  • Accounting software
  • +
+
+
+
+
Activities
+
+
    +
  • I work for Alcatel Lucent as a sub-contractor
  • +
  • I remotely maintain a server (from dedibox) for an association
  • +
+
+
+
+
+
+ +
diff --git a/accounting/accueil.fr_FR.UTF-8.xml b/accounting/accueil.fr_FR.UTF-8.xml new file mode 100644 index 0000000..f0ddfb6 --- /dev/null +++ b/accounting/accueil.fr_FR.UTF-8.xml @@ -0,0 +1,75 @@ + + + + + + La page d'accueil de la gestion de copropriete en ligne. + En tant que syndics bénévoles, nous sommes fièrs de vous présenter notre solution de gestion pour le syndic bénévole. Cette application, simple d'utilisation, réponds précisément au besoin des syndics bénévoles qui gèrent de petite copropriété. Tous les services de comptabilités sont facile d'accès et vous permettent de gagner un temps précieux. + $Date: 2010/08/25 15:10:02 $ + $Id: accueil.fr_FR.UTF-8.xml,v 1.3 2010/08/25 15:10:02 aebersol Exp $ + SYNDIC,Bénévole,STRASBOURG,ANDRE,EBERSOLD,COMPTABILITE,CLOUD, syndic bénévole, le syndic bénévole, les syndics bénévoles, syndic bénévole compta, compta petite copropriété + + + +
+
Bookkeeping for trustee
+

+

GCopro une solution de gestion comptable

+

pour les Syndics non professionnel

+
+
+

Expérimentez la comptabilité pour le syndic en toute simplicité. Une nouvelle manière de gérer votre bâtiment et vos copropriétaires.
Joignez la communauté en ligne des syndics bénévoles qui ont choisis la comptabilité en ligne.

+
+
+
Services
+
+
    +
  • Disponible en tout temps
  • +
  • Détail des comptes
  • +
  • Gestion de lots
  • +
  • Gestion des fournisseurs
  • +
  • Gestion des copropriétaires
  • +
  • Synthèse à la cloture conforme aux exigences de la loi
  • +
+
+
+ +
+
Syndic bénévole
+
+ +

+
    +
+
+
+
+
En toute Simplicité
+
+
    +
  • Des fenêtres de saisies adaptées
  • +
  • Pour lancer les appels de fonds
  • +
  • Enregistrer les factures
  • +
  • Enregistrer les payements
  • +
  • Enregistrer les versements des corpropriértaires
  • +
  • Gérer les lots de la copropriété
  • +
  • Toutes les annexes comptable à la cloture conformes aux exigences de la loi
  • +
+
+
+
+
+ +
diff --git a/accounting/bilan.fr_FR.UTF-8.xml b/accounting/bilan.fr_FR.UTF-8.xml new file mode 100644 index 0000000..457f479 --- /dev/null +++ b/accounting/bilan.fr_FR.UTF-8.xml @@ -0,0 +1,7 @@ + +accounting/bilangestion, syndic bénévole bilan, logiciel comptabilité, synthèse des comptesDescription de la fenêtre de synthèse bilan. Cette onglet permet d'avoir une vue d'ensemble de la comptabilité sur une période. +

Bilan

+

Comme son nom l'indique, cette fenêtre permet au syndic bénévole d'avoir un accès rapide au bilan d'un exercice. Elle donne aussi une synthèse de l'ensemble des comptes. Un moyen simple pour vérifier le montant disponible en banque, les factures qui doivent encore être réglé.

+

Enfin, pour facilité la préparation de l'assemblée générale, un bouton de téléchargement permet d'avoir en un seul clic les annexes comptables qui doivent être jointes à la convocation.

+

Fenêtre bilan qui montre les simples options qui sont offertes. Le syndic peu séléctionner l'exercice et suite à cela, il a la possibilité de télécharger les annexes comptables au format PDF

+

Comme le montre la figure ci-dessus, les options qui sont disponibles sont trivials et suffisantes pour le syndic bénévole. Ce qui l'intéresse c'est d'avoir un synthèse des comptes et pourvoir joindre les annexes à la convocation de l'assemblée générale.

diff --git a/accounting/budget.fr_FR.UTF-8.xml b/accounting/budget.fr_FR.UTF-8.xml new file mode 100644 index 0000000..5143ff3 --- /dev/null +++ b/accounting/budget.fr_FR.UTF-8.xml @@ -0,0 +1,13 @@ + +accounting/budgetLiens,SYNDIC,Budget,gestionGestion du budget de la copropriété. +

L'onglet Budget

+

Les options offertes aux syndics bénévoles pour gérer les budgets

+

Il permet au syndic de préparer les budgets prévisionnels pour les années à venirs. Ces budgets sont automatiquement intégré dans les annexes comptable en fin d'exercice.

+

Cet espace de travail fournit deux service. La liste des budgets, la création d'un nouveau budget. Le logiciel se base sur le plan comptable pour créer les lignes qui doivent être budgété.

+

Liste des budgets

+

C'est un simple tableau qui affiche la liste de tous les budgets qui ont été créé. Le syndic peut supprimer un budget en cliquant sur le croix d'une ligne, ou il peut simplement selection un budget pour passer en mode édition.

+
Un tableau qui donne la liste des budgets que le syndic a créé.
+

Edition d'un budget

+

L'édition du budget est enfantine. Il suffit de selectionner un celulle dans la colonne "N". Le champ se met alors en mode édition et vous pouvez saisir la montant que vous souhaiter budgéter pour le poste en question. Il vous suffit de valider la saisie en appuyant sur entré. La celulle change de nouveau d'état et votre montant est enregistré. Le Total est égalelement mis à jour.

+
La fenêtre d'édition du budget. permet au syndic de sélectionner la class de compte. Puis, pour chaque entrée de la classe il peut affecter une valeur et une clé de charge.
+

diff --git a/accounting/cgu.fr_FR.UTF-8.xml b/accounting/cgu.fr_FR.UTF-8.xml new file mode 100644 index 0000000..ddbc79e --- /dev/null +++ b/accounting/cgu.fr_FR.UTF-8.xml @@ -0,0 +1,23 @@ + + + + Hobbies + $Date: 2008/03/06 18:11:29 $ + $Id: loisirs_music.xml,v 1.5 2008/03/06 18:11:29 aebersol Exp $ + + + +

Useful Links

+ +

+
+ + +
+ + +
diff --git a/accounting/contact.en_US.UTF-8.xml b/accounting/contact.en_US.UTF-8.xml new file mode 100644 index 0000000..dbcae01 --- /dev/null +++ b/accounting/contact.en_US.UTF-8.xml @@ -0,0 +1,34 @@ + + + + + Contact + Contact + Willkommen + $Date: 2009/04/27 06:38:44 $ + $Id: contact.xml,v 1.6 2009/04/27 06:38:44 aeb Exp $ + +

Contact

+

Feel free to leave a message or comments.

+
+
Comments:
+
Security
+ +
+
+ + +
+
+ diff --git a/accounting/contact.fr_FR.UTF-8.xml b/accounting/contact.fr_FR.UTF-8.xml new file mode 100644 index 0000000..cfd961c --- /dev/null +++ b/accounting/contact.fr_FR.UTF-8.xml @@ -0,0 +1,34 @@ + + + + + Contact + Contact + Willkommen + $Date: 2009/04/27 06:38:44 $ + $Id: contact.xml,v 1.6 2009/04/27 06:38:44 aeb Exp $ + +

Contact

+

Laissez nous votre message.

+
+
Comments:
+
Security
+ +
+
+ + +
+
+ diff --git a/accounting/copro_exercice.fr_FR.UTF-8.xml b/accounting/copro_exercice.fr_FR.UTF-8.xml new file mode 100644 index 0000000..f593189 --- /dev/null +++ b/accounting/copro_exercice.fr_FR.UTF-8.xml @@ -0,0 +1,7 @@ + +accounting/copro_exercicesyndic bénévole,gestion copropriété, créer comptabilité, exercice comptable,gestion de lots,gestion des postes de chargeDescription de la partie configuration. Cette oglet permet de gérer les exercices comptables. +

Copropriété / section exercice

+

Cette section du logiciel en ligne de comptabilité permet de gérer les exercices. La création d'un nouvelle exercice est relativement simple. Il suffit de renseigner les trois champs de la figure ci-dessous.

+

Les périodes sont à entrer sous la forme : 'AAAA-MM-JJ'

+

Liste des exercices. Comment créer un exercice comptable pour le syndic bénévole.

+

La suppression d'un exercice est réalisée en cliquant sur la croix rouge de la ligne correspondante.

diff --git a/accounting/copro_lots.fr_FR.UTF-8.xml b/accounting/copro_lots.fr_FR.UTF-8.xml new file mode 100644 index 0000000..7244337 --- /dev/null +++ b/accounting/copro_lots.fr_FR.UTF-8.xml @@ -0,0 +1,6 @@ + +accounting/copro_lotssyndic bénévole,gestion copropriété, créer comptabilité, exercice comptable,gestion de lots,gestion des postes de chargeDescription de la partie configuration. Cette oglet permet de gérer les lots. +

Gestion des lots

+

La gestion des lots est importante pour le calcul de la réparition des charges. A chaque lot est associer une valeur de tantieme par poste de charge. C'est cette valeur qui sera utilisée pour calculer la part de charge pour une facture donnée.

+

+

Cette section permet simplement de créer et gérer les lots d'une copropriété. Ultérieuement, ces lots seront affectés à des coprorpriétaires. Il faudra aussi, via un autre menu affecter les tantièmes suivant les postes de charges.

diff --git a/accounting/copro_lots_attribuer.fr_FR.UTF-8.xml b/accounting/copro_lots_attribuer.fr_FR.UTF-8.xml new file mode 100644 index 0000000..0d8156d --- /dev/null +++ b/accounting/copro_lots_attribuer.fr_FR.UTF-8.xml @@ -0,0 +1,4 @@ + +accounting/copro_lots_attribuersyndic bénévole,gestion copropriété, créer comptabilité, exercice comptable,gestion de lots,gestion des postes de chargeDescription de la partie configuration. Cette oglet permet de gérer les lots. +

Attribuer des lots

+

Une fois les lots créés, il faut les attribuer aux différents copropriétaires. Cette opération est faite une fois pour toute tant qu'il n'y a pas d'achat/vente en jeu.

diff --git a/accounting/copropriete.fr_FR.UTF-8.xml b/accounting/copropriete.fr_FR.UTF-8.xml new file mode 100644 index 0000000..ed20f32 --- /dev/null +++ b/accounting/copropriete.fr_FR.UTF-8.xml @@ -0,0 +1,8 @@ + +accounting/coprorietesyndic bénévole,gestion copropriété, créer comptabilité, exercice comptable,gestion de lots,gestion des postes de chargeDéscription générale des fonctions qui sont offert par la solution de gestion en ligne. +

L'onglet Copropriété

+

Les options de configuration de la copropriété.Il fournit tous les services relatifs à la configuration de la copropriété.

+

Un premier groupe permet de voir la liste des copropriétés dont vous faites partie. Il vous est possible de créer un nouvel environnement de gestion à l'aide du lien Nouvelle Organisation.

+

Un second groupe permet de gérer les exercices des périodes comptable.

+

Un troisième groupe permet de gérer les lots et d'attribuer des lots aux copropriétaires.

+

Et enfin un dernier groupe permet de gérer l'attribution des cotes part suivant le poste de charge.

diff --git a/accounting/dede.txt b/accounting/dede.txt new file mode 100644 index 0000000..02d06bf --- /dev/null +++ b/accounting/dede.txt @@ -0,0 +1,16 @@ + Conditions générales d'utilisation de l'espace client du site internet "Groupama.fr" et des services clients de l'application Groupama dédiés aux clients assurr +ance et services non bancaires + + + Version 5.0 mise �| jour le 11 FEVRIER 2019 + + Le site Internet « Groupama.fr » est accessible �| l'adresse : www.groupama.fr. + + L�~@~Yespace client Groupama est accessible �| l�~@~Yadresse : https://espaceclient.groupama.fr/ + L'application «Groupama» est accessible sur un terminal mobile après son téléchargement depuis l'Apple Store (IOS) ou le Play Store (Android). + + L'objet des présentes Conditions Générales d'Utilisation (CGU) est : + de définir les conditions d'accès et d'utilisation des services en ligne de l'espace client de « Groupama.fr » et de l'application Groupama + de présenter les différents services proposés + de prévoir une convention de preuve par laquelle l'Utilisateur, ci-après défini, accepte que lui soient opposables l'ensemble des opérations effectuées dans ll +'espace client du site « Groupama.fr » ou l'application diff --git a/accounting/donates.fr_FR.UTF-8.xml b/accounting/donates.fr_FR.UTF-8.xml new file mode 100644 index 0000000..7d7597f --- /dev/null +++ b/accounting/donates.fr_FR.UTF-8.xml @@ -0,0 +1,29 @@ + +Faites un dont pour nous soutenirSYNDIC,bénévoles,dons,comptabilité,STRASBOURG,gestion,fonds,andré ebersoldFaire des dons pour l'utilisation de l'application +

Faire Un don

+

Vous aimez la solution de ce site et vous souhaitez qu'elle vive parce qu'elle vous rend un service incommensurable par rapport à la gestion traditionnelle, alors, n'hésitez pas à faire un don annuel en fonction de la taille de votre copropriété.

+

Les fonds vont servir à financer le fournisseur de service qui héberge le site

+
+ + + + + + + + + + + +
Pour une copropriété de 1 à 20 lotsFaites un don de 5 euros/mois
Pour une copropriété de plus de 20 lots
+

Il vos mieux nous contacter

+
+
+
+ La mise en place des moyens de donations est en cours. + Vous pouvez malgré tout utiliser le service.
+
+
+
+
+
diff --git a/accounting/fournisseur.fr_FR.UTF-8.xml b/accounting/fournisseur.fr_FR.UTF-8.xml new file mode 100644 index 0000000..593f825 --- /dev/null +++ b/accounting/fournisseur.fr_FR.UTF-8.xml @@ -0,0 +1,13 @@ + +accounting/fournisseurLiens,SYNDICDescription générale des fonctions qui sont offert par la solution de gestion en ligne pour géré les aspects comptable liés aux fournisseurs.. +

L'onglet fournisseur.

+

Enregistrement des factures

+

Ci-dessous, un aperçu de la fenêtre de saisie d'une facture.

+
Fenêtre de sasie d'une nouvelle facture. Les champs que le syndic bénévole doit saisir pour enregistrer une nouvelle facture.
+

Après avoir sélectionné l'onglet Fournisseurs, puis l'entrée Nouvelle facture dans le menu gauche, le syndic peu commencer à faire la saisie. Il choisira un intitulé approprié, ensuite il selectionnera le fournisseur dans la liste déroulante aussi que le compte de charge à débiter. Bien sûr il ne faut pas oublier la date de la facture, son montant ainsi que sa référence. Avant d'enregistrer le tout, si le syndic dispose d'un scanner, il peut joindre à l'enregistrement une version électronique de la facture via l'entrée Fichier. Ce document pourra être consulté ultérieument sous plusieurs vue.

+

Une fois que tous les champs sont saisis (sans oublier la clé de charge), le syndic peu en toute tranquilité enregistrer la facture. Cette dernière sera automatiquement répartie au prorata des cotes parts des lots sur l'ensemble des propriétaires.

+

La saisie du payement d'une facture.

+
La fenêtre de saisie pour enregistrer le payement d'un fournisseur.
+

L'état des comptes d'un fournisseur

+

Ci-dessous, un aperçu des informations auquelles on peut rapidement avoir accès sans se casser la tête. En quatres clics vous avez accès au détail du compte d'un fournisseur.

+
Fenêtre qui affiche l'état du compte d'un fournisseur.
diff --git a/accounting/journaux.fr_FR.UTF-8.xml b/accounting/journaux.fr_FR.UTF-8.xml new file mode 100644 index 0000000..16acc2c --- /dev/null +++ b/accounting/journaux.fr_FR.UTF-8.xml @@ -0,0 +1,17 @@ + +accounting/journauxLiens,SYNDIC,syndic,bénévoles,journaux,comptabilité,consulter,strasbourg,compte,gestion

Déscription générale des fonctions qui sont offert par la solution de gestion en ligne.

+

Les Journaux

+

Le menu pour consulter les journaux.La gestion des journaux. est un onglet qui offre deux principaux services. Le premier est bien sûr celui de consulter les journaux. Le second celui de voir le détail d'un compte.

+

+

Le journal

+

Un journal répertorie toutes les opérations qui se sont déroulé durant un exercice donnée. La solution de gestion propose 7 types de journaux comme on peu le voir dans la figure ci-dessous.

+

Le premier type, appelé "Banque" répertorie toutes les opérations bancaires. Le syndic bénévole peut ainsi facilement controler les transactions enregistrées par la banque et celle qu'il a enregistré dans la comptabilité en ligne.

+

Le second type: "Ventes" ne devrait à priori pas être utilisé.

+

Le troisième type: "Achats et frais" concerne répertorie toutes les opérations d'achat. En principe on devrait y voir apparaître les mouvements entre des comptes de fournisseurs et des comptes de charges.

+

Le quatrième type: "Opération divers" sera utilisé pour toutes les opérations qui ne rentre dans aucun type prédéfini.

+

Le cinquième type: "Appels de fonds" répertorie toutes les opérations d'appels de fonds. C'est à dire les mouvements entre les comptes de la classe 7 et celle des copropriétaires qui devront régler l'appel de fonds.

+

La sixième catégorie:"Remboursement appels de fonds" est utilisé à la cloture des comptes où le syndic rembourse tous les appels de fonds. Après de remboursement des appels de fonds, le syndic vera apparaître sur les comptes des copropriétaires le trop percu ou le reste à percevoir.

+

La septième catégorie:"Report à nouveau" est utilisée pour l'enregistrement des mouvements en début d'exercice. Il s'agit de reporter les soldes créditeurs et débiteurs de l'exercice clos sur le nouvel exercice.

+

Le fenêtre journal. Le syndic bénévole peut séléctionner le journal et voir toutes les transations du journal pour l'exercice en cours

+

+

Détail d'un compte

diff --git a/accounting/liens_syndic.en_US.UTF-8.xml b/accounting/liens_syndic.en_US.UTF-8.xml new file mode 100644 index 0000000..1fa14dd --- /dev/null +++ b/accounting/liens_syndic.en_US.UTF-8.xml @@ -0,0 +1,21 @@ + + + + Hobbies + $Date: 2008/03/06 18:11:29 $ + $Id: loisirs_music.xml,v 1.5 2008/03/06 18:11:29 aebersol Exp $ + + + +

Useful Links

+ +

+
+
+ + +
diff --git a/accounting/liens_syndic.fr_FR.UTF-8.xml b/accounting/liens_syndic.fr_FR.UTF-8.xml new file mode 100644 index 0000000..159f500 --- /dev/null +++ b/accounting/liens_syndic.fr_FR.UTF-8.xml @@ -0,0 +1,30 @@ + + + + Liens vers d'autre site relatif a la gestion de copropriete + $Date: 2020/12/26 18:11:29 $ + $Id: liens_syndic.xml,v 1.5 2008/03/06 18:11:29 aebersol Exp $ + + Liens,SYNDIC,strasbourg,bénévoles,conseil,loi,copropriété,conseilLiens utiles pour le syndic bénévole. + +

Liens utiles

+

Les Associations de syndic bénévoles

+

UNARC, l'assocation des résponsables de copropriété.

+

ASIB, l'association des syndics d'immeuble bénévoles.

+

Conseil syndical de Besançon.

+

Ce que dit la loi

+

JPM-COPRO Droit et pratique de la copropriété de Jean-Pierre MANTELET une source d'information bien utile que vous pouvez consulter.

+

La répartition des charges

+

Loi N° 65-557 du 10 juillet 1965 fixant le status de la copropriété des immeubles bâtis.

+

Décret n°67-223 du 17 mars 1967 pris pour l'application de la loi n° 65-557 du 10 juillet 1965 fixant le statut de la copropriété des immeubles bâtis

+

Taux d'intéret légaux en cas de retard de versement des appels de fonds.

+

Quelques définitions utiles

+

Le conseil syndical Il a pour rôle d'assister le syndic dans ses décisions.

+

La répartition des charges

+

Un autre article de l'ANIL donne une définition similaire.

+

Une description exhaustive des types de charges sur le site de syneval.

+
+ + + +
diff --git a/accounting/plan_comptable.fr_FR.UTF-8.xml b/accounting/plan_comptable.fr_FR.UTF-8.xml new file mode 100644 index 0000000..c604e79 --- /dev/null +++ b/accounting/plan_comptable.fr_FR.UTF-8.xml @@ -0,0 +1,10 @@ + +accounting/plan_comptableSYNDIC,logiciel,cloud,syndic bénévole édition du plan comptable,plan comptable,plan comptable,comptabilité,gestion,syndicLogiciel de gestion comptable en ligne: La gestion du plan comptable. C'est une interface simple et intuitive. +

Le Plan comptable

+

Un plan comptable est créé automatiquement lors de la création d'un compte.

+

Le menu relatif au plan comptable

+

Le menu gauche du plan comptable. Le syndic bénévole peut choisir la classe de compte qu'il souhaite éditer ou visualiser.Pour plus de clarté sur la présentation du plan comptable, un menu sur le coté gauche permet de sélectionner la classe de compte qu'on souhaite visualiser ou éditer.

+

Cette sélection étant effectué le syndic peut maintenant aisément ajouter ou supprimer un comptes.

+

Tableau du plan comptable pour une classe de compte

+

L'ajout d'un compte se fait en choisissant un numéro de compte, un libellé, puis on selectionne le bouton ajouter.

+

La suppression de compte est tout aussi simple. Il suffit de cliquer sur "delete" pour supprimer un compte. (Attention aux conséquences de la suppression d'un compte. Toutes les opérations qui sont associées à ce compte seront supprimés. Le logiciel ne supprime pas le compte si celui-ci n'est pas soldé).

diff --git a/accounting/products.en_US.UTF-8.xml b/accounting/products.en_US.UTF-8.xml new file mode 100644 index 0000000..9680d9f --- /dev/null +++ b/accounting/products.en_US.UTF-8.xml @@ -0,0 +1,41 @@ + + + + + Mes activités privées + Activities + Willkommen + Activity + Description des mes activités de développement personnel + $Date: 2010/08/25 15:10:02 $ + $Id: activite.en_US.UTF-8.xml,v 1.3 2010/08/25 15:10:02 aebersol Exp $ + + + +
+
+
Bookkeeping for trustee
+
+

Bookkeeping for trustees.

+Experiment the Bookkeeping for trustee. A new way to to manage your building and deal with your part owners.
Join the great community of online accounting managers.
+
+
+
Bookkeeping for churches
+
+

Bookkeeping for churches.

+Experiment the Bookkeeping for churches. A new way to to manage the finances of the church and your members.
+
+
+ +
+ +
+ diff --git a/accounting/products.fr_FR.UTF-8.xml b/accounting/products.fr_FR.UTF-8.xml new file mode 100644 index 0000000..f695123 --- /dev/null +++ b/accounting/products.fr_FR.UTF-8.xml @@ -0,0 +1,42 @@ + + + + + Les solutions de gestion en ligne + SYNDIC,Comptabilité, Copropriété,Gestion + Description des mes activités de développement personnel + $Date: 2010/08/25 15:10:02 $ + $Id: activite.fr_FR.UTF-8.xml,v 1.2 2010/08/25 15:10:02 aebersol Exp $ + + + +
+
+
Bookkeeping for trustee
+
+

Comptabilité pour le syndic

+Experimentez la comptabilité pour le syndic Une nouvelle manière de gérer votre batiment et vos copropriétaires.
Joignez la communauté en ligne des syndics qui ont choisis la comptabilité en ligne.
+
+
+
Comptabilité pour les associations cultuelles
+
+

Comptabilité pour les associations cultuelles.

+Créé votre comptabilité en ligne pour associations cultuelles. Une façon simple pour maintenir les comptes de votre association.
+
+
+ + +
+ +
+ diff --git a/accounting/services.en_US.UTF-8.xml b/accounting/services.en_US.UTF-8.xml new file mode 100644 index 0000000..1fa14dd --- /dev/null +++ b/accounting/services.en_US.UTF-8.xml @@ -0,0 +1,21 @@ + + + + Hobbies + $Date: 2008/03/06 18:11:29 $ + $Id: loisirs_music.xml,v 1.5 2008/03/06 18:11:29 aebersol Exp $ + + + +

Useful Links

+ +

+
+
+ + +
diff --git a/accounting/services.fr_FR.UTF-8.xml b/accounting/services.fr_FR.UTF-8.xml new file mode 100644 index 0000000..89af823 --- /dev/null +++ b/accounting/services.fr_FR.UTF-8.xml @@ -0,0 +1,34 @@ + + + + <p>Documentation, les généralités</p> + $Date: 2008/03/06 18:11:29 $ + $Id: loisirs_music.xml,v 1.5 2008/03/06 18:11:29 aebersol Exp $ + + Liens,SYNDICDéscription générale des fonctions qui sont offert par la solution de gestion en ligne. + +

Services

+

L'ensemble des services que vous offre une gestion comptable d'une copropriété en ligne est sans égale par rapport aux solutions habituelles.

+

Disponible en toutes circonstances

+

Avec une gestion en ligne, plus de crainte à avoir pour changer de syndic. Toutes les données restent disponibles quelque soit le gestionnaire.

+

Un geste écologique puisque tous les documents sont conservés sur un support numérique.

+

Les copropriétaires peuvent à tout moment consulter les documents relatifs à la copropriété. Le carnet d'entretien, le détail des comptes, les factures des fournisseurs, les comptes rendus d'assemblées générales.

+

Réalisation des tâches courantes en toute simplicité et transparence

+

Les pricipales rubriques sont accessibles au travers d'une barre de menus.

+ +
    +
  • Copropriété:Dans cet espace, le syndic gère la configuration de la copropriété.
  • +
  • Plan: C'est un espace qui permet de gérer le plan comptable de la copropriété. Dans le cas de base, le syndic n'aura pas besoin de créer de compte directement. Les comptes des fournisseurs et des copropriétaire sont automatiquement crééer lors de l'ajout d'un nouveau copropriétaire où d'un nouveau fournisseur.
  • +
  • Fournisseurs:Cet espace permet de gérer les fournisseurs.
  • +
  • Copropriétaires: Cet espace est dédié aux opérations relatifs aux copropriétaires. On y retrouve principalement, le moyen d'enregistrer les versements des copropriétaires, le décompte des charges, la possibilité de lancer un appel de fonds.
  • +
  • Journaux: Cet espace offre une vue de toutes les opérations sur une période comptable. C'est très utile pour vérifier les comptes.
  • +
  • Bilan : Cet section donne une vue synthétique de tous les comptes. Le syndic pourra entre autre y retrouver les annexes comptable à joindre à la convocation de l'assemblée générale. Cette synthèse représente un gain de temps non négligable.
  • +
  • Budget: Gérez vos budget au travers de cet espace de travail.
  • +
+
+ + + +
diff --git a/accueil.en_US.UTF-8.xml b/accueil.en_US.UTF-8.xml new file mode 100644 index 0000000..7d14cd2 --- /dev/null +++ b/accueil.en_US.UTF-8.xml @@ -0,0 +1,73 @@ + + + + + + Welcome page of Aeb +

Welcome page to aeb website. You can find a porto folio of our realizations.

+ C++,CV,Linux,Development + $Date: 2010/08/25 15:10:02 $ + $Id: accueil.en_US.UTF-8.xml,v 1.4 2010/08/25 15:10:02 aebersol Exp $ + +
+
+
+
+
Who I am
+
+

Senior Software Engineer
+

39 years old
Married 1 child

+

Company : Alcatel Lucent

+

+

Specialized in C/C++ development

+
+
+
+
Studies / Projects
+
+
    +
  • Flash driver enhancement
  • +
  • Web reverse proxy comparison
  • +
  • Encapsulation of binary flow in http chucks
  • +
  • OmniPCX Office feature improvements
  • +
  • Porting Linux 2.4 drivers to kernel 2.6
  • +
  • Migration of x86 application to powerpc
  • +
+
+
+
+
+
+
+
News Events
+
+ +
+
+
+
Activities
+
+
    +
  • I work for Alcatel Lucent as a sub-contractor
  • +
  • I remotely maintain a server (from dedibox) for an association
  • +
+
+
+
+
+
+ +
diff --git a/accueil.fr_FR.UTF-8.xml b/accueil.fr_FR.UTF-8.xml new file mode 100644 index 0000000..a5b50eb --- /dev/null +++ b/accueil.fr_FR.UTF-8.xml @@ -0,0 +1,71 @@ + + + + + + La page d'accueil d'Andre EBERSOLD + About + Willkommen +

Toutes nos realisation et savoir faire en matière de service informatique. Développement de serveur pour des systèmes embarquées.

+ $Date: 2010/08/25 15:10:02 $ + $Id: accueil.fr_FR.UTF-8.xml,v 1.3 2010/08/25 15:10:02 aebersol Exp $ + C++,Ingénieur,Linux + + +
+
+
+
Profile
+
+

+Ingénieur Informatique
Marié 1 enfant
Français

+

Société : Adival Services

+

Spécialisé dans le développement C/C++

+
+
+
+
Projet et études
+
+
    +
  • Amélioration d'un driver flash
  • +
  • Comparaison de diférent reverse proxy
  • +
  • Encapsulation d'un flux binaire dans des chunks http
  • +
  • OmniPCX Office feature improvement
  • +
  • Porting Linux 2.4 drivers to kernel 2.6
  • +
  • Migration of x86 application to powerpc
  • +
+
+
+
+
+
+
Nouvelles
+
+ +
+
+
+
Activités
+
+
    +
  • Je travaille en tant que consultant pour Alcatel-Lucent
  • +
  • Pour le compte d'une association, je maintiens une dedibox
  • +
  • Source formating
  • +
+
+
+
+
+
+ +
diff --git a/accueil.xml b/accueil.xml new file mode 100644 index 0000000..50b696c --- /dev/null +++ b/accueil.xml @@ -0,0 +1,98 @@ + + + + + + La page d'accueil d'Andre EBERSOLD + About + Willkommen + + $Date: 2010/04/21 17:10:20 $ + $Id: accueil.xml,v 1.25 2010/04/21 17:10:20 aebersol Exp $ + + Accueil + About +

Introduction

+

Introduction

+

Introduction

+ + This site intends to help creating + relations, by showing my + and + + + Bienvenu sur ce site dont le but premier est de me faire connaitre au travers + des différentes activités et de mes centres d'intérets. + + + faire connaître / créer de nouveaux contactes / Promouvoir mon savoir faire (compétences) et + les projets personnels que j'ai développé. + + + De plus en plus, Internet devient un moyen pour + échanger, trouver du travail, créer de nouveaux contacts. + C'est le but de ce site qui présente mon cursus + professionnel au travers du + et de mes . + +

Compétences

+ + Mon activité principale est le développement en C et C++. Ceci aussi + bien sous Windows que sous Unix. Dans ce context rentre également la + gestion des sources, la mise en place de procedures de fabrications + de programmes. + +
+
+ Who I am + Senior Software Engineer +
+
+ Studies / Projects + +
    +
  • Flash driver enhancement
  • +
  • Web reverse proxy comparison
  • +
  • Encapsulation of binary flow in http chucks
  • +
  • OmniPCX Office feature improvements
  • +
  • Porting Linux 2.4 drivers to kernel 2.6
  • +
  • Migration of x86 application to powerpc
  • +
+
+
+
+ +
+
+ News Events + +
    +
  • Studied packagers for embedded systems (rpm, opkg/ipkg, npm,...)
  • +
  • Wrote distro, a small distribution builder
  • +
+
+
+
+ Activities + +
    +
  • I work for Alcatel Lucent as contracting
  • +
  • I maintain remotly a remote server (from dedibox) for an association
  • +
+
+
+ +
+
+ +
diff --git a/app/admin/crontab.php b/app/admin/crontab.php new file mode 100644 index 0000000..2748962 --- /dev/null +++ b/app/admin/crontab.php @@ -0,0 +1,28 @@ + + diff --git a/app/admin/index.js b/app/admin/index.js new file mode 100644 index 0000000..6022623 --- /dev/null +++ b/app/admin/index.js @@ -0,0 +1,141 @@ +/** + * This is my first try to associate javascript code with the user interface. + * It's still under work. + * First, I should remove prototype dependances here. I do have all I need. + */ + +AEBW.declare("Admin",AEBW.JsonRpc, { + listSection:function(section) { + this.handle({onSuccess: function(res) { + try { + $("dist-section").childElements().each (function (e) {e.remove();}); + var dists= $("dist-section"); + res.each(function(e) {dists.insert("");}); + } catch (e) + { + alert("Yes got Exception: "+e+"it:"+res); + } + } + ,onFailure:function(res) {alert("Finally failed:"+res);}}, + "listSection",{'section':section}) ; + }, + listDistributions:function(distId) { + this.handle( { + onSuccess:function(res) { + var cb=$("cbDists"); + cb.childElements().each(function(e) {e.remove();}); + res.each(function(e) { + if (e.id == distId) { + cb.insert(""); + $("enDistVersion").value = e.version; + $("enDistBoard").value = e.board_name; + } else { + cb.insert(""); + } + cb.childElements().each(function(e) {if (e.value==distId) e.selected=true;}); + }); + }, + onFailure:function(res) { + alert("Failed load Distributions:"+res); + } + }, + "listDistributions",{} + ); + }, + DistPackageList:function(d_id) { + this.handle( { + onSuccess:function(res) { + var selDist = $("dist-packages"); + selDist.childElements().each(function(e) {e.remove();}); + res.each( function(e) { + selDist.insert(""); + }); + }, + onFailure:function(res) { + alert("Failed Get Packages:"+res); + var selDist = $("dist-packages"); + selDist.childElements().each(function(e) {e.remove();}); + } + }, + "DistPackageList",{"dist": d_id} + ); + }, + newDistribution:function() { + this.handle( { + onSuccess:function(res) { + }, + onFailure:function(res) { + } + }, + "newDistribution",{} + ); + }, + addPackage:function(DistId,PkgId) { + this.handle( { + onSuccess:function(res) { + }, + onFailure:function(res) { + alert('addPackage Failed'+res); + } + }, + "addPackage",Array([ DistId , PkgId]) + ); + }, + rmPackage:function(PkgId) { + this.handle( { + onSuccess:function(res) { + }, + onFailure:function(res) { + alert("Failed remove Package and do not know why"+res); + } + }, + "rmPackage",Array([PkgId]) + ); + } + +}); + +AEBW.declare("Admin.Pages",AEBW.JsonRpc, { + }); + +if (!AEBW.admin) {} + +var d = new Admin(alias+"/app/admin/Admin.php"); + + +Event.observe('btNewPage','click',function (evt) { + alert("Call 1"); + var form =$("createPage"); + var str=form.serialize(); + alert("Call "+alias+" "+str); + new Ajax.Request(alias+"/update.php", + { + method:"post", + postBody:str + + }); + }); +/* +var pkgs = new AEBW.distro.packages; +Event.observe('btSearchPackage','click',function (evt) { + pkgs.search($('ipPackage').value); + }); + +Event.observe('cbDists','change',function (e) { + d.listDistributions(e.element().value); + d.DistPackageList(e.element().value); + }); + +Event.observe('btDistAdd','click',function(e) { + var sel = $('dist-section'); + var e = Element.extend(sel.options[sel.selectedIndex]); + d.addPackage($('cbDists').value,e.value); + d.DistPackageList($('cbDists').value); + }); +Event.observe('btDistRemove','click',function(e) { + var sel = $('dist-packages'); + var e = Element.extend(sel.options[sel.selectedIndex]); + d.rmPackage(e.value); + d.DistPackageList($('cbDists').value); + }); +*/ diff --git a/app/admin/patch_db.php b/app/admin/patch_db.php new file mode 100644 index 0000000..c5851ba --- /dev/null +++ b/app/admin/patch_db.php @@ -0,0 +1,65 @@ + + -p [patch file] -d database +setStartPoint($from); + $schema->updateCompta($orgid); + + } +?> diff --git a/app/admin/view/index.fr_FR.UTF-8.xml b/app/admin/view/index.fr_FR.UTF-8.xml new file mode 100644 index 0000000..8719e6b --- /dev/null +++ b/app/admin/view/index.fr_FR.UTF-8.xml @@ -0,0 +1,351 @@ + + + + + + + Distro + + + +

Administration

+

+ sa chaine de compilation, les paquets logiciels devant se trouver dans la distribution + final. +

+ +
+ + + + + Utilisateur + + + Hardware + + + + + +
+ + + + + + +
+
+ + + binutils + + display boxes : enable + + + + + Utilisateur + + Liste des utilisateurs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
List des utilisateurs
UtilisateurNom RealEmailGroupe
+ + +

+ + + + +
Search
+ +
d1d1d1d5
2 + 22
+ End Table +
+
+
+
+ + + + Groupes + + + Distribution + +
+ + + + +
+ + +
+
+ + +
+
+
+
+
+
+ + Catégories + + Base + + Core + + + Shell + + + Kernel + + + + Librarie + + + + +
+
+ + +
+ + + +

+ +
+
+ + + + Menu + +

Gestion des Menus

+ + Les Menus + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDNameLienLangueDirectionStyle
+ + + + + + + + + + +
1HMenu/fr/accueil.htmlfrHORIZONTALmenu1
+
+
+ +
+
+ + Style + + Test Table Stuff + + + + + + + + + + + +
Titre du tableau
r1r2
Un test pour voird1
Un bouton +
Un test pour voird1
Un bouton +
+ End Table +
+
+ + + Pages + +

Find existing pages or create new once.

+ + Pages + +
+ + + + + + + + + + + + + + + + +
Titre du tableau
TitleTypeStatus
accueild2
Un bouton +
Un test pour voird1
Un bouton +
+ + +
+
+ + Add Page + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Titre du tableau
ChampValeur
Titre:
Langue: + + + +
+
Type: + + + +
+
Résumé:
Mots Cle:
+ +
+ + +
+
+ +
+
+
+ + + + + + + Selection de la classe + +
+ + + + + + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + +
CompteLibelléN-1N
Total:0.00.0
+
+
+ +
+
diff --git a/app/compta/class.schema.php b/app/compta/class.schema.php new file mode 100644 index 0000000..ad3c70f --- /dev/null +++ b/app/compta/class.schema.php @@ -0,0 +1,119 @@ +xml = simplexml_load_string($XmlString); + } catch (Exception $e) { + error_log("Schema::_ctor failed ".$e->getMessage()); + } + } + + /** + * + */ + function __destructor() { + } + + /** + * + * + */ + private function process_statement($attrs,$child) { + $q = ""; + if (isset($attrs['set_org']) ) { + $patt = "/{org_id}/"; + $repl = $this->org_id; + + $q = preg_replace($patt,$repl,$child->__toString()); + } else { + $q = $child->__toString(); + } + $this->doQueryI($q); + } + /** + * + * + */ + function setStartPoint($from) { + $this->update_from = $from; + } + /** + * + * + */ + function createCompta($org_id) { + $this->org_id = $org_id; + if ($this->xml != null) + { + $req = $this->xml->xpath("//sql/statement[@mode='update']"); + foreach ($req as $child ) { + $attrs = $child->attributes(); + $this->process_stratement($attrs,$child); + } + } + } + /** + * + * + */ + function recreateCompta($org_id) { + $this->org_id = $org_id; + error_log("Schema::recreateCompta: ".$org_id); + if ($this->xml != null) + { + $q = ""; + $req = $this->xml->xpath("//sql/statement"); + foreach ($req as $child ) { + error_log("Schema::recreateCompta: in child"); + $attrs = $child->attributes(); + $this->process_statement($attrs,$child); + } + } else { + error_log("Schema::recreateCompta: xml is null ".$org_id); + } + } + /** + * + * + */ + function updateCompta($org_id) { + $this->org_id = $org_id; + error_log("Schema::updateCompta: ".$org_id); + if ($this->xml != null) + { + $req = $this->xml->xpath("//sql/statement"); + foreach ($req as $child ) { + $attrs = $child->attributes(); + if (isset($attrs['count']) && ($attrs['count'] >= $this->update_from) ) { + error_log("Schema::update Compta Yes: ".$attrs['count']." ".$this->update_from); + $this->process_statement($attrs,$child); + } + } + } else { + error_log("Schema::updateCompta: xml is null ".$org_id); + } + } +} +/** + * Test + */ +// $schema = new Schema($conf['auth']['mysql'],'demo'); + +// $schema->recreateCompta(); +?> diff --git a/app/compta/controler_base.php b/app/compta/controler_base.php new file mode 100644 index 0000000..c588b9e --- /dev/null +++ b/app/compta/controler_base.php @@ -0,0 +1,59 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; + +/** + * + */ +class controler +{ + /// Controler base dir + public static $basedir = ""; + /// + public static $viewdir = ""; + /// + public static $modeldir = ""; + /// + protected $_session = null; + /// + protected $_auth_cfg = null; + + /// + public function __construct() + { + GLOBAL $conf; + $conf_auth = $conf['auth']['mysql']; + $this->_session = new \SessionCompta($conf_auth,$conf_auth['req_file']); + $this->_auth_cfg = $conf['auth']['mysql']; + } + + public function getSession() + { + return $this->_session; + } + + public function getAuthConfig() + { + return $this->_auth_cfg; + } + static function init() + { + controler::$basedir = dirname(__FILE__); + controler::$viewdir = dirname(__FILE__)."/views/"; + controler::$modeldir = dirname(__FILE__)."/models/"; + } +} +/// Initialize static variables +controler::init(); + +?> diff --git a/app/compta/controlers/account.php b/app/compta/controlers/account.php new file mode 100644 index 0000000..0f8848a --- /dev/null +++ b/app/compta/controlers/account.php @@ -0,0 +1,75 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); +require_once(controler::$modeldir."/account.php"); + +/** + * + * + */ +class Account extends controler +{ + + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + $this->_model = new \compta\models\account\Model( + $this->getSession(),$this->getAuthConfig()); + } + + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + //require_once(controler::$basedir."/view_bank_index.php"); + //$page = new \compta\views\account\Index(); + return new \HtmlResult("Account to be coded"); + //return $page; + } + + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function upload() : \IActionResult + { + //require_once(controler::$basedir."/view_bank_upload.php"); + //$page = new \compta\views\bank\Upload(); + return $page; + } + + public function account($_account_id) + { + return new \HtmlResult("Bank account ".$_account_id); + } + + public function detail($_id) + { + require_once(controler::$viewdir."/account_detail.php"); + $this->_model->getDetails($_id); + $page = new \compta\views\account\Detail($this->_model); + return $page; + // return new \HtmlResult("Account ".$_id); + } + +} + diff --git a/app/compta/controlers/admin.php b/app/compta/controlers/admin.php new file mode 100644 index 0000000..07ac578 --- /dev/null +++ b/app/compta/controlers/admin.php @@ -0,0 +1,44 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); + +/** + * + * + */ +class Admin +{ + + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/admin_index.php"); + $page = new \compta\views\admin\Index(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/bank.php b/app/compta/controlers/bank.php new file mode 100644 index 0000000..c93a2bd --- /dev/null +++ b/app/compta/controlers/bank.php @@ -0,0 +1,90 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); +require_once(controler::$basedir."/models/bank.php"); + +/** + * + * + */ +class Bank +{ + + /** + * Constructor + */ + public function __construct() + { + GLOBAL $conf; + $conf_auth = $conf['auth']['mysql']; + $this->_session = new \SessionCompta($conf_auth,$conf_auth['req_file']); + $this->_auth_cfg = $conf['auth']['mysql']; + $this->_model = new \compta\models\bank\Model($this->_session,$this->_auth_cfg); + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/bank_index.php"); + $page = new \compta\views\bank\Index($this->_model); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function upload() : \IActionResult + { + require_once(controler::$basedir."/views/bank_upload.php"); + $page = new \compta\views\bank\Upload(); + return $page; + } + public function account($_account_id) + { + return new \HtmlResult("Bank account ".$_account_id); + } + + public function add() + { + return new \HtmlResult("Bank add"); + } + + /** + * @brief post uploadOFX + * + */ + public function uploadOFX() + { + $arr_file_type = ['text/ofx','text/csv']; + if ( ! in_array($_FILES['file']['type'],$arr_file_type)) + { + } + if ( ! file_exists('uploads')) + { + mkdir('uploads',0777); + } + $filename=time().'_'.$_FILES['file']['name']; + move_uploaded_file($_FILES['file']['tmp_name'],'uploads/'.$filename); + $this->_model->parse('uploads/'.$filename); + // Process ofx and return + return new \HtmlResult("Uploaded"); + } +} + +?> diff --git a/app/compta/controlers/bilan.php b/app/compta/controlers/bilan.php new file mode 100644 index 0000000..499eea6 --- /dev/null +++ b/app/compta/controlers/bilan.php @@ -0,0 +1,44 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); + +/** + * + * + */ +class Bilan +{ + + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/bilan_index.php"); + $page = new \compta\views\bilan\Index(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/bill.php b/app/compta/controlers/bill.php new file mode 100644 index 0000000..e69de29 diff --git a/app/compta/controlers/budget.php b/app/compta/controlers/budget.php new file mode 100644 index 0000000..0399c02 --- /dev/null +++ b/app/compta/controlers/budget.php @@ -0,0 +1,74 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/session.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); +require_once(controler::$basedir."/models/budget.php"); + +/** + * + * + */ +class Budget +{ + + private $_session = null; + private $_auth_cfg; + private $_model = null; + + /** + * Constructor + */ + public function __construct() + { + GLOBAL $conf; + $conf_auth = $conf['auth']['mysql']; + $this->_session = new \SessionCompta($conf_auth,$conf_auth['req_file']); + $this->_auth_cfg = $conf['auth']['mysql']; + $this->_model = new \compta\models\budget\Model($this->_session,$this->_auth_cfg); + } + /** + * Get default budget main page. + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/budget_index.php"); + $page = new \compta\views\budget\Index(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function detail($_id) : \IActionResult + { + require_once(controler::$basedir."/views/budget_detail.php"); + $page = new \compta\views\budget\Index(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function nouveau() : \IActionResult + { + require_once(controler::$basedir."/views/budget_nouveau.php"); + $page = new \compta\views\budget\Nouveau(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/chart.php b/app/compta/controlers/chart.php new file mode 100644 index 0000000..d08b31a --- /dev/null +++ b/app/compta/controlers/chart.php @@ -0,0 +1,44 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); + +/** + * + * + */ +class Chart +{ + + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/chart_index.php"); + $page = new \compta\views\chart\Index(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/compta.php b/app/compta/controlers/compta.php new file mode 100644 index 0000000..939efb9 --- /dev/null +++ b/app/compta/controlers/compta.php @@ -0,0 +1,137 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); + +/** + * + * + */ +class Compta +{ + + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/compta_index.php"); + $page = new \compta\views\compta\Index(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function organisation() : \IActionResult + { + require_once(controler::$basedir."/views/bank_upload.php"); + $page = new \compta\views\bank\Upload(); + return $page; + } + /** + * Get the details of plan comptable. + * @param string $_accout_id the supplier account + */ + public function pcmn() : \IActionResult + { + require_once(controler::$basedir."/views/bank_upload.php"); + $page = new \compta\views\bank\Upload(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function exercice() : \IActionResult + { + require_once(controler::$basedir."/views/bank_upload.php"); + $page = new \compta\views\bank\Upload(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function supplier() : \IActionResult + { + require_once(controler::$basedir."/views/supplier_index.php"); + $page = new \compta\views\bank\Upload(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function tiers() : \IActionResult + { + require_once(controler::$basedir."/views/supplier_index.php"); + $page = new \compta\views\bank\Upload(); + return $page; + } + /** + * Get the details of the books. (livres ou journaux) + * @param string $_accout_id the supplier account + */ + public function book() : \IActionResult + { + require_once(controler::$basedir."/views/supplier_index.php"); + $page = new \compta\views\bank\Upload(); + return $page; + } + /** + * + */ + public function bilan($_account_id) + { + return new \HtmlResult("Bank account ".$_account_id); + } + + public function budget() + { + return new \HtmlResult("Bank add"); + } + + /** + * @brief post uploadOFX + * + */ + public function uploadOFX() + { + $arr_file_type = ['text/ofx','text/csv']; + if ( ! in_array($_FILES['file']['type'],$arr_file_type)) + { + } + if ( ! file_exists('uploads')) + { + mkdir('uploads',0777); + } + $filename=time().'_'.$_FILES['file']['name']; + move_uploaded_file($_FILES['file']['tmp_name'],'uploads/'.$filename); + // Process ofx and return + return new \HtmlResult("Uploaded"); + } +} + + +?> diff --git a/app/compta/controlers/exercice.php b/app/compta/controlers/exercice.php new file mode 100644 index 0000000..a37a019 --- /dev/null +++ b/app/compta/controlers/exercice.php @@ -0,0 +1,93 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); + +/** + * + * + */ +class Exercice +{ + + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/exercice_index.php"); + $page = new \compta\views\exercice\Index(); + return $page; + } + + /** + * @brief show details of an exercice. If it's closed + * maybe a summary of a year to year comparison + * + */ + public function detail($id) : \IActionResult + { + require_once(controler::$basedir."/views/exercice_detail.php"); + $page = new \compta\views\exercice\Detail(); + return $page; + } + + public function select($id) : \IActionResult + { + require_once(controler::$basedir."/views/exercice_select.php"); + $page = new \compta\views\exercice\Index(); + return $page; + } + + /** + * @brief show a small window to add a new exercice + */ + public function cloture() : \IActionResult + { + require_once(controler::$basedir."/views/exercice_cloture.php"); + $page = new \compta\views\exercice\Index(); + return $page; + } + + /** + * @brief show a small window to add a new exercice + */ + public function add() : \IActionResult + { + require_once(controler::$basedir."/views/exercice_add.php"); + $page = new \compta\views\exercice\Index(); + return $page; + } + + /** + * @brief show a small window to add a new exercice + */ + public function addPost() : \IActionResult + { + require_once(controler::$basedir."/views/exercice_select.php"); + $page = new \compta\views\exercice\Index(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/jrnx.php b/app/compta/controlers/jrnx.php new file mode 100644 index 0000000..c42e11d --- /dev/null +++ b/app/compta/controlers/jrnx.php @@ -0,0 +1,44 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); + +/** + * + * + */ +class Jrnx +{ + + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/jrnx_index.php"); + $page = new \compta\views\jrnx\Index(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/loan.php b/app/compta/controlers/loan.php new file mode 100644 index 0000000..a33c042 --- /dev/null +++ b/app/compta/controlers/loan.php @@ -0,0 +1,105 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); +require_once(controler::$modeldir."/loan.php"); + +/** + * + * + */ +class Loan extends controler +{ + + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + $this->_model = new \compta\models\loan\Model( + $this->getSession() + ,$this->getAuthConfig()); + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/loan_index.php"); + $page = new \compta\views\loan\Index(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function detail($id) : \IActionResult + { + require_once(controler::$basedir."/views/loan_detail.php"); + // Be sure to know what we are working on + $this->_model->id = $id; + $page = new \compta\views\loan\Detail($this->_model); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function nouveau() : \IActionResult + { + require_once(controler::$basedir."/views/loan_nouveau.php"); + $page = new \compta\views\loan\Nouveau($this->_model); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_id the loan id + * TODO to be finalized ! + */ + public function payer($id) : \IActionResult + { + require_once(controler::$basedir."/views/loan_payer.php"); + $page = new \compta\views\loan\Index(); + return $page; + } + /** + * Paye the loan for the current month + * @param string $_id the supplier account + */ + public function payerPost() : \IActionResult + { + require_once(controler::$basedir."/views/loan_payer.php"); + $this->_model->payer(\AEB::$REQUEST['li'],\AEB::$REQUEST['lei']); + $page = new \compta\views\loan\Payer($this->model); + return $page; + } + /** + * Update the loan. Not sure if this is smart once we + * started to paye. Should only be possible id the start date + * is after the current date. + * @param string $_id the loan id + */ + public function update() : \IActionResult + { + require_once(controler::$basedir."/views/loan_update.php"); + $page = new \compta\views\loan\Index(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/lot.php b/app/compta/controlers/lot.php new file mode 100644 index 0000000..53ba08d --- /dev/null +++ b/app/compta/controlers/lot.php @@ -0,0 +1,81 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); +require_once(controler::$basedir."/session.php"); +require_once(controler::$basedir."/models/lot.php"); + +/** + * + * + */ +class Lot +{ + + /** + * Constructor + */ + public function __construct() + { + GLOBAL $conf; + $conf_auth = $conf['auth']['mysql']; + $this->_session = new \SessionCompta($conf_auth,$conf_auth['req_file']); + $this->_auth_cfg = $conf['auth']['mysql']; + $this->_model = new \compta\models\lot\Model($this->_session,$this->_auth_cfg); + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/lot_index.php"); + $page = new \compta\views\lot\Index(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function attribuer() : \IActionResult + { + require_once(controler::$basedir."/views/lot_attribuer.php"); + $page = new \compta\views\lot\Attribuer(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function nouveau() : \IActionResult + { + require_once(controler::$basedir."/views/lot_nouveau.php"); + $page = new \compta\views\lot\Index(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function update($id) : \IActionResult + { + require_once(controler::$basedir."/views/lot_update.php"); + $page = new \compta\views\lot\Index(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/org.php b/app/compta/controlers/org.php new file mode 100644 index 0000000..f118440 --- /dev/null +++ b/app/compta/controlers/org.php @@ -0,0 +1,44 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); + +/** + * + * + */ +class Org +{ + + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/org_index.php"); + $page = new \compta\views\org\Index(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/recurrent.php b/app/compta/controlers/recurrent.php new file mode 100644 index 0000000..06d54e4 --- /dev/null +++ b/app/compta/controlers/recurrent.php @@ -0,0 +1,106 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); +require_once(controler::$basedir."/../../phplib/iface.ActionResult.php"); +require_once(controler::$basedir."/../../phplib/class.ActionResults.php"); +require_once(controler::$basedir."/session.php"); +require_once(controler::$basedir."/models/recurrent.php"); + +/** + * + * + */ +class Recurrent +{ + private $_model = null; + private $_session = null; + private $_auth_cfg = null; + /** + * Constructor + */ + public function __construct() + { + GLOBAL $conf; + $conf_auth = $conf['auth']['mysql']; + $this->_session = new \SessionCompta($conf_auth,$conf_auth['req_file']); + $this->_auth_cfg = $conf['auth']['mysql']; + $this->_model = new \compta\models\recurrent\Model($this->_session,$this->_auth_cfg); + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function index() : \IActionResult + { + require_once(controler::$basedir."/views/recurrent_index.php"); + $page = new \compta\views\recurrent\Index(); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function detail($_id) : \IActionResult + { + require_once(controler::$basedir."/views/recurrent_detail.php"); + $this->_model->get($_id); + $page = new \compta\views\recurrent\Detail($this->_model); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function update($_id) : \IActionResult + { + require_once(controler::$basedir."/views/recurrent_update.php"); + $this->_model->get($_id); + $page = new \compta\views\recurrent\Update($this->_model); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function payer($_id) : \IActionResult + { + require_once(controler::$basedir."/views/recurrent_payer.php"); + $this->_model->payer($_id); + $page = new \compta\views\recurrent\Payer($this->_model); + return $page; + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function nouveau() : \IActionResult + { + require_once(controler::$basedir."/views/recurrent_nouveau.php"); + $page = new \compta\views\recurrent\Nouveau(); + return $page; + } + /** + * Handle post of new recurrent operation + * @param string $_accout_id the supplier account + */ + public function nouveauPost() : \IActionResult + { + require_once(controler::$basedir."/views/recurrent_nouveau.php"); + $page = new \compta\views\recurrent\Nouveau(); + return $page; + } +} + +?> diff --git a/app/compta/controlers/supplier.php b/app/compta/controlers/supplier.php new file mode 100644 index 0000000..9f79f83 --- /dev/null +++ b/app/compta/controlers/supplier.php @@ -0,0 +1,47 @@ + + * @version 1.0 + * @package Compta + */ + +namespace compta\controlers; +require_once(dirname(__FILE__)."/../controler_base.php"); + +class Supplier +{ + + /** + * Constructor + */ + public function __construct() + { + } + /** + * Get the details of the supplier account. + * @param string $_accout_id the supplier account + */ + public function account($_account_id) + { + } + + public function details() + { + } + + public function pay() + { + } + + public function bill() + { + } +} + +?> diff --git a/app/compta/controlers/transaction.php b/app/compta/controlers/transaction.php new file mode 100644 index 0000000..689e8c8 --- /dev/null +++ b/app/compta/controlers/transaction.php @@ -0,0 +1,41 @@ + diff --git a/app/compta/copro.js b/app/compta/copro.js new file mode 100644 index 0000000..f7a40ca --- /dev/null +++ b/app/compta/copro.js @@ -0,0 +1,787 @@ +define(["require", "exports", "./Dialog", "./transaction", "./services"], function (require, exports, Dialog_1, transaction_1, services_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Coproprieraite; + (function (Coproprieraite) { + class Roll { + constructor(_role_id, _uid, _role) { + var obj = this; + this.role_id = _role_id; + this.uid = _uid; + this.role = _role; + this.json = function () { + return { "role_id": obj.role_id, + "uid": obj.uid, + "role": obj.role + }; + }; + } + } + class TransactionInfoAppel { + constructor() { + var obj = this; + this.voucher_date = new Date($('tfDate').value); + this.act_trans_date = new Date($('tfDate').value); + this.trans_label = $('tfTitle').value; + this.amount = $('tfMontant').value; + this.voucher_ref = ""; + this.acc_id = $('cbCoproAppel').value; + this.json = function () { + return { "amount": obj.amount, + "voucher_date": obj.voucher_date, + "act_trans_date": obj.act_trans_date, + "trans_label": obj.trans_label, + "acc_id": obj.acc_id, + "voucher_ref": obj.voucher_ref + }; + }; + } + } + Coproprieraite.TransactionInfoAppel = TransactionInfoAppel; + class TransactionAppel extends transaction_1.Ledger.Transaction { + constructor(_tp) { + super(_tp, "copro"); + } + getInfo(pref) { + var info = new TransactionInfoAppel(); + console.log("TransactionAppel::getInfo"); + return info; + } + commit(_Req, _param, _onSuccess, _onFailure) { + console.log("TransactionBill::commit _Req('booking','appelFonds',_param,_onSuccess,_onFailure)"); + _onSuccess("Not sure"); + } + } + class TransactionPaye extends transaction_1.Ledger.Transaction { + constructor(_tp) { + super(_tp, "copro"); + } + getInfo(pref) { + var info = new transaction_1.Ledger.TransactionInfoVersement(pref); + console.log("TransactionPaye::getInfo"); + return info; + } + commit(_Req, _param, _onSuccess, _onFailure) { + console.log("TransactionPaye::commit _Req('booking','Versement',_param,_onSuccess,_onFailure)"); + _onSuccess("Success pay"); + } + } + class DlgPaye extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + this.onGetKeysCharge = function (resp) { + alert("onGetKeysCharge"); + }; + var req = new AEBW.Json(jurl); + this._booking = new services_1.Services.Booking(req); + this._pcmn = new services_1.Services.PlanComptable(req); + } + onDummy(response) { + alert("DlgPaye::Dummy Error" + response); + } + onDummyFail() { + alert("DlgPaye::Dummy Error"); + } + getCoproPaye() { + var bindFct = this.onGetCoproPaye.bind(this); + super.getCoproAccounts(bindFct, this.onDummyFail); + } + onGetBanks(response) { + var cb = $('copro_banque'); + console.log("DlgPaye::onGetBanks "); + if (Array.isArray(response.result)) { + super.fillCombo(cb, response.result); + } + else if (AEBW.isNumber(response.result)) { + cb.options.length = 0; + console.log("DlgMapy::onGetBanks...int " + response.result); + } + else { + console.log("DlgMapy::onGetBanks... un handled " + response.result); + } + } + onGetCoproPaye(response) { + var cb = $('copro_id'); + console.log("DlgPaye::onGetCoproPaye"); + super.fillCombo(cb, response.result); + } + getCoproAppel() { + var bindFct = this.onGetCoproAppel.bind(this); + super.getCoproAccounts(bindFct, this.onDummyFail); + } + onGetCoproAppel(response) { + var cb = $('cbCoproAppel'); + console.log("DlgPaye::onGetCoproAppel"); + super.fillCombo(cb, response.result); + } + doRecord(tp) { + var t = new TransactionPaye(tp); + console.log("Coproprietaire::DlgPaye doRecord to be coded"); + try { + var bindOnRecord = this.onRecord.bind(this); + this._booking.Versement(t, bindOnRecord, this.onDummyFail); + console.log('DlgPaye::doRecord done : '); + } + catch (e) { + alert("doRecord toJson failed" + e.message); + } + } + onRecord(_resp) { + console.log("Coproprietaire::onRecord to be coded"); + CoproUsers.showList(); + } + doAppel() { + var t = new TransactionAppel('BQ'); + console.log("Coproprietaire::DlgPaye doAppel to be coded"); + try { + var json = AEBW.toJson(t); + var req = new AEBW.Json(this.Url()); + t.commit(req, json, this.onAppel, this.onDummyFail); + console.log('Coproprietaire::DlgPaye::doAppel done : '); + } + catch (e) { + alert("doRecord toJson failed" + e.message); + CoproUsers.showList(); + } + } + onAppel() { + $('copro_result').innerHTML = "

L'appel de fond a été enregistre.

"; + } + showPay() { + this.show(); + try { + $('copro_appel').addClassName("hidden"); + } + catch (e) { + console.log("CoproPay::showPay error on $('copro_appel')"); + } + this.getCoproPaye(); + var bindFct = this.onGetBanks.bind(this); + super.getBanks(bindFct, this.onDummyFail); + var o = this; + var d = new Date(); + var m = d.getMonth() + 1; + var day = d.getDate(); + $('copro_date').value = d.getFullYear() + '-' + ('0' + m).slice(-2) + '-' + ('0' + day).slice(-2); + Prototype.Event.observe($('btFPCancel'), "click", function (evt) { + CoproUsers.showList(); + }); + Prototype.Event.observe($('btCoproPayeRecord'), "click", function () { + if (!AEBW.isDate($('copro_date').value)) { + alert('Validation mauvais format de date'); + $('copro_date').style.border = '1px solid red'; + return; + } + else { + $('copro_date').style.border = '1px solid green'; + } + if (!AEBW.isDate($('copro_voucher_date').value)) { + alert('Validation mauvais format de la date de facturation'); + $('copro_voucher_date').style.border = '1px solid red'; + $('copro_voucher_date').value = 'AAAA-MM-DD'; + return; + } + else { + $('copro_voucher_date').style.border = '1px solid green'; + } + var check_amount = $('copro_amount').value; + if (!AEBW.isNumber(check_amount)) { + alert('Validation mauvais format du montant. Peut-etre un probleme de point ou de virgule ' + check_amount); + $('copro_amount').style.border = '1px solid red'; + return; + } + else { + $('copro_amount').style.border = '1px solid green'; + } + o.doRecord('BQ'); + }); + $('copro_result').innerHTML = ""; + } + showAppel() { + this.show(); + this.getCoproAppel(); + var o = this; + var d = new Date(); + var m = d.getMonth() + 1; + var day = d.getDate(); + $('tfDate').value = d.getFullYear() + '-' + ('0' + m).slice(-2) + '-' + ('0' + day).slice(-2); + $('copro_payement').addClassName("hidden"); + Prototype.Event.observe($('btAppelRecord'), "click", function () { + var check_amount = $('tfMontant').value; + if (!AEBW.isNumber(check_amount)) { + alert('Validation mauvais format du montant. Peut-etre un probleme de point ou de virgule ' + check_amount); + $('tfMontant').style.border = '1px solid red'; + return; + } + else { + $('tfMontant').style.border = '1px solid green'; + } + o.doAppel(); + }); + $('copro_result').innerHTML = ""; + } + onLoaded(html) { + console.log("DlgPaye::onLoaded call showPay"); + } + } + Coproprieraite.DlgPaye = DlgPaye; + class DlgDecompte extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._pcmn = new services_1.Services.PlanComptable(req); + this._retrieve = new services_1.Services.Retrieve(req); + this._exercice = new services_1.Services.Exercice(req); + this._acc = "450"; + } + onDummy(response) { + alert("DlgDecompte::Dummy Error" + response); + } + onDummyFail() { + alert("DlgDecompte::Dummy Error"); + } + cleanTable(tb, sz) { + for (var i = 0; i < sz; i++) { + tb.delRow(0); + } + } + getCopro() { + var _param = new services_1.Services.AccountListReqParams(this._acc); + let bindFct = this.onGetCopro.bind(this); + this._pcmn.getAccountList(_param, bindFct, this.onDummyFail); + } + onGetCopro(response) { + var result = response.result; + if (result.length > 1) { + console.log("onGetCopro response too long " + result.length); + } + console.log("onGetCopro " + result[0]); + var item = result[0]; + try { + $('pAccount').innerHTML = "Compte " + item['acc_id'] + " - " + item['acc_desc']; + $('pAccount').setAttribute('account', item['acc_id']); + this._acc = item['acc_id']; + console.log("assign Event Handler"); + Prototype.Event.observe($('btCoproDownload'), "click", function () { + console.log("Download decompte " + this._acc); + window.open("/app/compta/reports/syndic_builder_decompte.php?period=" + gState.Exercice + "&compte=" + $('pAccount').getAttribute('account')); + }); + } + catch (e) { + console.log("onGetCopro Error " + e.message); + } + if (gState.Mode != 'S') { + this.getDecompte(); + } + } + getExercice(exer) { + var _param = new services_1.Services.DummyReqParams(); + _param.dummy = exer; + let bindOnGetExercice = this.onGetExercice.bind(this); + this._exercice.details(_param, bindOnGetExercice, this.onDummyFail); + } + onGetExercice(response) { + var result = response.result; + var ex = result[0]; + if (result.length > 1) { + console.log("onGetExercice Old way. More than one should not happen"); + } + this._exApproved = ex[6]; + this._exClosed = ex[5]; + this._exChargeEnd = ex[4]; + $('exercice').innerHTML = gState.Exercice; + } + getDecompte() { + console.log("getDecompte acc=" + this._acc); + var _param = new services_1.Services.EntriesReqParams(gState.Exercice, this._acc); + let bindOnGetDecompte = this.onGetDecompte.bind(this); + this._retrieve.getEntriesByAccount(_param, bindOnGetDecompte, this.onDummyFail); + } + onGetDecompte(response) { + var tb = new AEBW.control.table('copro_table_decompte'); + try { + this.cleanTable(tb, tb._NbRows); + } + catch (e) { + console.log("onGetDecompte unable to call cleanTable:" + e.message); + for (var i = 0; i < tb._NbRows; i++) { + tb.delRow(0); + } + } + var entries = response.result.entries; + for (var i = 0; i < entries.length; i++) { + var it = entries[i]; + var row = tb.addRow(); + tb.getCell(tb._NbRows - 1, 0).innerHTML = it[0]; + tb.getCell(tb._NbRows - 1, 1).innerHTML = it[1]; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it[2]; + row.cells[2].style.textAlign = "right"; + if (it[3] != 0.0) { + tb.getCell(tb._NbRows - 1, 3).innerHTML = it[3]; + row.cells[3].style.textAlign = "right"; + } + if (it[4] != 0.0) { + tb.getCell(tb._NbRows - 1, 4).innerHTML = it[4]; + row.cells[4].style.textAlign = "right"; + } + if (it[2] > it[3]) { + row.cells[4].style.color = "red"; + } + } + var res = response.result.solde; + $('coproSoldeDebit').innerHTML = parseFloat(res[0]).toFixed(2); + $('coproSoldeCredit').innerHTML = parseFloat(res[1]).toFixed(2); + $('coproSoldeDecompte').innerHTML = "Solde : " + res[2]; + if (parseFloat(res[2]) < 0.0) { + $('coproSoldeDecompte').setStyle({ color: "#FF0000" }); + } + else { + $('coproSoldeDecompte').setStyle({ color: "#000000" }); + } + this.getSoldeDecompte(); + } + addCharge(charge) { + var tb = new AEBW.control.table('copro_table_decompte'); + var row = tb.addRow(); + tb.getCell(tb._NbRows - 1, 1).innerHTML = "CHARGES"; + tb.getCell(tb._NbRows - 1, 2).innerHTML = "Charges courrantes latentes"; + row.cells[2].style.textAlign = "right"; + tb.getCell(tb._NbRows - 1, 3).innerHTML = charge; + row.cells[3].style.textAlign = "right"; + } + getSoldeDecompte() { + var obj = this; + var _param = new services_1.Services.EntriesReqParams(gState.Exercice, this._acc); + let bindOnGetSoldeDecompte = this.onGetSoldeDecompte.bind(this); + this._retrieve.getSoldeAccount(_param, bindOnGetSoldeDecompte, this.onDummyFail); + } + onGetSoldeDecompte(response) { + var bilan = ""; + var result = response.result; + var res = response.result.solde; + console.log("onGetSoldeDecompte: total_charge=" + result.total_charge + " appel=" + result.total_appel); + var detail_charge = response.result.detail_charge; + var total_charge = parseFloat(response.result.total_charge).toFixed(2); + var charges_laten = parseFloat(response.result.total_latente).toFixed(2); + var total_appel = parseFloat(response.result.total_appel).toFixed(2); + var total_ss_af = 0; + var charge_end = parseInt(this._exChargeEnd); + var closed = parseInt(this._exClosed); + if (parseFloat(res[2]) < 0.0) { + total_ss_af = parseFloat(res[2]) + parseFloat(total_appel); + } + else + total_ss_af = parseFloat(res[2]) - parseFloat(total_appel); + if (charge_end == 1) { + var debit = parseFloat(res[0]); + var solde = parseFloat(res[2]); + var solde_total = solde; + var debit_total = debit; + if (closed == 0) { + solde_total = solde_total - parseFloat(charges_laten); + debit_total = debit_total + parseFloat(charges_laten); + } + if (solde_total < 0.0) { + total_ss_af = solde_total + parseFloat(total_appel); + } + else + total_ss_af = solde_total + parseFloat(total_appel); + if (closed == 0) + this.addCharge(parseFloat(charges_laten)); + $('coproSoldeDebit').innerHTML = debit_total.toFixed(2); + $('coproSoldeCredit').innerHTML = parseFloat(res[1]).toFixed(2); + if (closed == 1) { + $('coproSoldeDecompte').innerHTML = "Solde : " + solde_total.toFixed(2) + " euros"; + } + else { + $('coproSoldeDecompte').innerHTML = "Solde : " + solde_total.toFixed(2) + " euros, (Solde sans appel de fonds:" + total_ss_af.toFixed(2) + " euros si non clos)"; + } + if (solde_total < 0.0) { + $('coproSoldeDecompte').setStyle({ color: "#FF0000" }); + } + else { + $('coproSoldeDecompte').setStyle({ color: "#000000" }); + } + } + else { + $('coproSoldeDebit').innerHTML = res[0]; + $('coproSoldeCredit').innerHTML = res[1]; + if (closed == 1) { + $('coproSoldeDecompte').innerHTML = "Solde : " + res[2] + " euros."; + } + else + $('coproSoldeDecompte').innerHTML = "Solde : " + res[2] + " euros, (Solde sans appel de fonds:" + total_ss_af.toFixed(2) + " euros si non clos)"; + if (parseFloat(res[2]) < 0.0) { + $('coproSoldeDecompte').setStyle({ color: "#FF0000" }); + } + else { + $('coproSoldeDecompte').setStyle({ color: "#000000" }); + } + } + try { + bilan += "

Total appel de fonds : " + total_appel + " €

Total charges : " + total_charge + " €

"; + for (var c = 0; c < detail_charge.length; c++) { + var i = detail_charge[c]; + bilan += "

" + i[0] + " " + i[1] + " €

"; + } + $('copro_detail').innerHTML = bilan; + } + catch (e) { + alert("Bilan Failed = " + e.message); + } + } + onLoaded(html) { + console.log("DlgDecompte::onLoaded call show"); + if (gState.Mode != "S") + this.show(); + } + showDecompte(_acc) { + this._acc = _acc; + this.show(); + console.log("showDecompte " + _acc); + } + onShow() { + this.getCopro(); + this.getExercice(gState.Exercice); + if (gState.Mode == 'S') { + this.getDecompte(); + } + } + } + Coproprieraite.DlgDecompte = DlgDecompte; + class DlgUsers extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._users = new services_1.Services.Users(req); + } + onDummy(response) { + alert("DlgUsers::Dummy Error" + response); + } + onDummyFail() { + alert("DlgUsers::Dummy Error"); + } + addCopro(i) { + console.log("TODO call Users addUserInOrg " + gState.Organization); + var _param = new services_1.Services.UserReqParams(gState.Organization, i); + let bindFct = this.onAddCopro.bind(this); + this._users.addInOrg(_param, bindFct, this.onDummyFail); + } + updateCopro(i) { + console.log("TODO call Users addUserInOrg update " + gState.Organization); + var _param = new services_1.Services.UserReqParams(gState.Organization, i, true); + let bindFct = this.onAddCopro.bind(this); + this._users.addInOrg(_param, bindFct, this.onDummyFail); + } + onAddCopro(response) { + console.log("DlgUser::onAddCopro "); + this.showList(); + } + getUsers() { + console.log("DlgUsers::getUsers maybe I should be able to decide which user"); + var _param = new services_1.Services.DummyReqParams(); + let bindOnGetUsers = this.onGetUsers.bind(this); + this._users.getCoproprietaires(_param, bindOnGetUsers, this.onDummyFail); + } + prepareUpdateUser(_uid) { + console.log("DlgUsers::prepareUpdateUser " + _uid); + var _param = new services_1.Services.DummyReqParams(_uid); + let bindFct = this.onPrepareUpdateUser.bind(this); + this._users.getCoproprietaires(_param, bindFct, this.onDummyFail); + } + onPrepareUpdateUser(response) { + try { + var it = response.result[0]; + if (!Array.isArray(it)) { + console.log("DlgUser::onPrepareUpdateUser result not an aray aieee"); + } + $('copro_name').value = it[1]; + $('copro_firstname').value = it[2]; + $('copro_address').value = it[3]; + $('copro_code').value = it[4]; + $('copro_ville').value = it[5]; + $('copro_email1').value = it[7]; + $('copro_mobile').value = it[6]; + this.toogleView(true); + } + catch (e) { + console.log("onPrepareUpdateUser " + e.message); + } + } + toogleView(_bool) { + if (_bool) { + $('copro-users-edit').removeClassName("hidden"); + $('copro-user-list').addClassName("hidden"); + $('copro-user-list').removeClassName("dcol-container"); + } + else { + $('copro-users-edit').addClassName("hidden"); + $('copro-user-list').addClassName("dcol-container"); + $('copro-user-list').removeClassName("hidden"); + } + } + onGetUsers(response) { + var entries = response.result; + this.fillUsers(entries); + } + associateAccount(_uid, _acc, _ass = 1) { + var _param = new services_1.Services.ReqThreeParams(_uid, _acc, _ass.toString()); + let bindFct = this.onAssociate.bind(this); + this._users.associateAccount(_param, bindFct, this.onDummyFail); + } + onAssociate(response) { + this.showList(); + } + getAccounts() { + let bindFct = this.onGetAccounts.bind(this); + super.getCoproAccounts(bindFct, this.onDummyFail); + } + onGetAccounts(response) { + var result = response.result; + var _s = super.fillCombo; + var _obj = this; + var _NullA = { 'acc_id': 0, 'acc_desc': 'No Account' }; + result.splice(0, 0, _NullA); + console.log("DlgUser::onGetAccounts length =" + result.length); + $$("select[id='user-account']").each(function (elt) { + _s(elt, result); + elt.on("change", function (evt) { + var uid = elt.getAttribute('uid'); + evt.stopImmediatePropagation(); + evt.preventDefault(); + console.log("Account Changed user : " + uid + " value=" + elt.value); + _obj.associateAccount(uid, elt.value, 1); + }); + }); + } + fillUsers(entries) { + var _obj = this; + var cl = 'copro-user-list'; + var c1 = $(cl + '-c1'); + var c2 = $(cl + '-c2'); + var ng = $(cl + ''); + c1.innerHTML = ""; + c2.innerHTML = ""; + for (var i = 0; i < entries.length; i++) { + var it = entries[i]; + if (i < entries.length / 2) { + this.fillUser2c(c1, it); + } + else { + this.fillUser2c(c2, it); + } + } + if (gState.Mode == 'S') { + this.getAccounts(); + } + $$("a[id='user-modifier']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("Modifier user : " + uid); + CoproUsers.prepareUpdateUser(uid); + }); + }); + $$("a[id='user-paye']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + var compte = elt.getAttribute('compte'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("DlgUser:: a paye user : " + uid); + CoproPay.showPay(); + }); + }); + $$("a[id='user-decompte']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + var compte = elt.getAttribute('compte'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("DlgUser:: a decompte user : " + uid); + Copropriete.showDecompte(compte); + }); + }); + $$("a[id='user-dissocier']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("DlgUser:: dissocier user : " + uid); + _obj.associateAccount(uid, "0", 0); + }); + }); + } + fillUser2c(row, it) { + var d = "

" + it[1] + " " + it[2]; + d += " Modifier"; + d += "
"; + d += "" + it[3] + " " + "
"; + if (gState.Mode == "S") { + if (it[8] != 0) { + d += "Compte associé : " + it[8] + " - Dissocier" + "

"; + } + else { + d += "Pas de compte associé :

"; + } + } + d += ""; + if (it[8] != 0) { + d += ""; + d += " Payer"; + d += ""; + d += " Décompte"; + } + d += ""; + d += "
"; + row.innerHTML += d; + } + onLoaded() { + console.log("DlgUsers Loaded initialize "); + if (gState.Mode == "S") + this.showList(); + } + showList() { + this.show(); + $('copro-users-edit').addClassName("hidden"); + this.getUsers(); + } + onShow() { + var obj = this; + Prototype.Event.observe($("btUpdateCoproUser"), "click", function () { + var i = new services_1.Services.structUser($('copro_name').value, $('copro_firstname').value, $('copro_address').value, $('copro_code').value, $('copro_ville').value, $('copro_email1').value); + i.mobile = $('copro_mobile').value; + i.email2 = $('copro_email2').value; + obj.updateCopro(i); + }); + Prototype.Event.observe($("btNewCoproIdentity"), "click", function () { + var i = new services_1.Services.structUser($('copro_name').value, $('copro_firstname').value, $('copro_address').value, $('copro_code').value, $('copro_ville').value, $('copro_email1').value); + i.mobile = $('copro_mobile').value; + i.email2 = $('copro_email2').value; + obj.addCopro(i); + }); + } + } + Coproprieraite.DlgUsers = DlgUsers; + class DlgRole extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._users = new services_1.Services.Users(req); + this._tbe = null; + } + onDummy(response) { + alert("DlgCoproRole::Dummy Error" + response); + } + onDummyFail() { + alert("DlgCoproRole::Dummy Error"); + } + getUsersRole(_role) { + console.log("DlgRole Implemented getUsersRole"); + var _param = new services_1.Services.DummyReqParams(); + _param.dummy = _role; + let bindOnGetUsersRole = this.onGetUsersRole.bind(this); + this._users.getByRole(_param, bindOnGetUsersRole, this.onDummyFail); + } + onGetUsersRole(response) { + var tb = this._tbe; + tb.eraseAllRows(); + console.log("onGetUsersRole ..."); + var entries = response.result; + var obj = this; + for (var i = 0; i < entries.length; i++) { + var it = entries[i]; + var row = tb.addRow(); + tb.getCell(tb._NbRows - 1, 0).innerHTML = it[0]; + tb.getCell(tb._NbRows - 1, 1).innerHTML = it[2]; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it[3]; + var c = tb.getCell(tb._NbRows - 1, 3); + try { + var ip = document.createElement('input'); + ip.setAttribute('type', 'checkbox'); + ip.setAttribute("role_id", it[0]); + ip.setAttribute("uid", it[1]); + ip.setAttribute("role", $('cbCoproRole').value); + Prototype.Event.observe(ip, 'change', function (evt) { + var elt = evt.target || evt.srcElement; + console.log("DlgRole... Select input changed"); + if (elt.checked) { + try { + obj.setUserRole(elt.getAttribute('role_id'), elt.getAttribute('uid'), elt.getAttribute('role')); + } + catch (e) { + alert("Failed call setUserRole:" + e); + } + } + else { + obj.resetUserRole(this.getAttribute('role_id'), this.getAttribute('uid'), this.getAttribute('role')); + } + }); + if (parseInt(it[5]) == 0) { + ip.checked = false; + } + else { + ip.checked = true; + } + c.appendChild(ip); + } + catch (e) { + alert("Failed:" + e); + } + } + } + setUserRole(role_id, user, role) { + var _param = new services_1.Services.UserRoleReqParams(role_id, user, role); + let bindOnSetUserRole = this.onSetUserRole.bind(this); + this._users.setRole(_param, bindOnSetUserRole, this.onDummyFail); + } + onSetUserRole(response) { + console.log("DlgRole::onSetUserRol ok;"); + } + resetUserRole(role_id, user, role) { + var _param = new services_1.Services.UserRoleReqParams(role_id, user, role); + let bindOnSetUserRole = this.onSetUserRole.bind(this); + this._users.resetRole(_param, bindOnSetUserRole, this.onDummyFail); + } + onShow() { + this._tbe = new AEBW.control.table('copro_role_edit'); + Prototype.Event.observe($("cbCoproRole"), "change", function () { + CoproRole.getUsersRole($('cbCoproRole').value); + }); + } + onLoaded(html) { + console.log("DlgRole::onLoaded"); + } + } + Coproprieraite.DlgRole = DlgRole; + var Copropriete = new DlgDecompte("copropriete", "./forms.php?panel=copro_decompte", "/app/compta/index.php"); + var CoproPay = new DlgPaye("copropriete", "./forms.php?panel=copro_pay", "/app/compta/index.php"); + var CoproUsers = new DlgUsers("copropriete", "./forms.php?panel=copro_users", "/app/compta/index.php"); + var CoproRole = new DlgRole("copropriete", "./forms.php?panel=copro_role", "/app/compta/index.php"); + Prototype.Event.observe($("btCoproDecompte"), "click", function () { + Copropriete.show(); + }); + Prototype.Event.observe($("btCoproPayer"), "click", function () { + CoproPay.showPay(); + }); + Prototype.Event.observe($("btCoproAppel"), "click", function () { + CoproPay.showAppel(); + }); + Prototype.Event.observe($("btCoproGerer"), "click", function () { + CoproUsers.show(); + $('copro-users-edit').addClassName("hidden"); + CoproUsers.getUsers(); + }); + Prototype.Event.observe($("btCoproAdd"), "click", function () { + CoproUsers.show(); + $('copro-user-list').addClassName("hidden"); + }); + Prototype.Event.observe($("btCoproRole"), "click", function () { + CoproRole.show(); + CoproRole.getUsersRole($('cbCoproRole').value); + }); + })(Coproprieraite || (Coproprieraite = {})); +}); diff --git a/app/compta/coproBootstrap.js b/app/compta/coproBootstrap.js new file mode 100644 index 0000000..d4b2141 --- /dev/null +++ b/app/compta/coproBootstrap.js @@ -0,0 +1,54 @@ +requirejs.config({ + baseUrl: '../..', + paths: { + "cpt": "/app/compta", + "xgui": "/js/xgui", + "tslib": "/js/tslib", + "" : "" + }, + shim: { + "copro": { + deps: [ 'aebw' + ,'xgui_json' + , 'cpt/ialog' + , 'xgui/CtrlDialogbox' + , 'js/scriptaculus/prototype'], + exports: 'Bilan', + init: function (x) { + } + }, + "CtrlDialogbox": { + deps: [''], + exports: '' + }, + "Dialog": { + deps: ['xgui/CtrlDialogbox'], + exports: '' + }, + "services": { + deps: ['xgui/aebw' + ,'xgui_json' ], + exports: '' + }, + "xgui_json": { + deps: ['xgui/aebw'], + exports: '' + } + } +}); +requirejs(["require", "exports" + , "tslib" + , "xgui/xgui_json" + , "xgui/CtrlDialogbox" + , "cpt/Dialog" + , "cpt/services" + , "cpt/copro"], function (req,exp,ts,xj,xd,srv,myApp) { + console.log("starting Coproprietaire application..."); + //CoproPay.showPay(); + // + if (gState.Mode != 'S') { + $('smCoproFonds').parentElement.style.display = 'none'; + $('smCoproTier').parentElement.style.display = 'none'; + } else { + } +}); diff --git a/app/compta/copro_decompte.xml b/app/compta/copro_decompte.xml new file mode 100644 index 0000000..f8678dd --- /dev/null +++ b/app/compta/copro_decompte.xml @@ -0,0 +1,102 @@ + + + + + + User Managment + + + + +

Décompte de charges

+

+ + + + + Information Générales + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Compte
DateRéfDésignaionDébitCrédit
02/01/201312435Facture fioul100
05/01/201398547Charge Assurance87
06/01/2013d1Virement211
10/01/2013xc1234Charge EDF PC2 178
Solde:0.00.0
+
+ +
+
+
diff --git a/app/compta/copro_entretien.xml b/app/compta/copro_entretien.xml new file mode 100644 index 0000000..8da2716 --- /dev/null +++ b/app/compta/copro_entretien.xml @@ -0,0 +1,47 @@ + + + + + + Carnet d'entretien + + + + + + Période d'entretien + +
+ + + + +
+
+
+ + Saisir + +
+ +
+
+ +
+ +
+ + + + + + + + + + diff --git a/app/compta/copro_pay.xml b/app/compta/copro_pay.xml new file mode 100644 index 0000000..ad91088 --- /dev/null +++ b/app/compta/copro_pay.xml @@ -0,0 +1,68 @@ + + + + + + User Managment + + + + + + +

Enregistré un payment

+ +Versement + +
+
+ + + + + +
+ + + +
+ + +
+ + + + +
+
+
+ + +

Enregistré un appel de fond

+ + Appel de fond + +
+
+ + + + +
+ + +
+ + + +
+
+ +
+ + +
+
diff --git a/app/compta/copro_role.xml b/app/compta/copro_role.xml new file mode 100644 index 0000000..468be6e --- /dev/null +++ b/app/compta/copro_role.xml @@ -0,0 +1,54 @@ + + + + + + User Managment + + + + + + + + Selection Role + +
+ + + + + +
+
+
+ + + + + + + + + + + + + + + + + +
NomPrénomSel
+
+
+ +
+
diff --git a/app/compta/copro_users.xml b/app/compta/copro_users.xml new file mode 100644 index 0000000..b0e837f --- /dev/null +++ b/app/compta/copro_users.xml @@ -0,0 +1,44 @@ + + + + + + User Managment + + + + +

Copropriétaires

+ + + Information Copropriétaire + +
+ +
+ +
+ +
+ +
+
+ + + + +
+
+
+ + + + + + +
+
+
diff --git a/app/compta/coprote.js b/app/compta/coprote.js new file mode 100644 index 0000000..9367d34 --- /dev/null +++ b/app/compta/coprote.js @@ -0,0 +1,193 @@ +define(["require", "exports", "../../js/xgui/CtrlDialogbox", "./services"], function (require, exports, CtrlDialogbox_1, services_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Copropriete; + (function (Copropriete) { + class DlgParameter extends CtrlDialogbox_1.Dialogbox { + constructor(_id, uipath, jurl) { + console.log("DlgParameter constructor"); + super(_id); + var req = new AEBW.Json(jurl); + this._pcmn = new services_1.Services.PlanComptable(req); + this._user = new services_1.Services.Users(req); + this.Current = 0; + super.load(uipath); + } + onDummy(response) { + alert("DlgParameter::Dummy Error" + response); + } + onDummyFail() { + alert("DlgParameter::Dummy Error"); + } + getAccountInfo() { + var _param = new services_1.Services.DummyReqParams(); + _param.dummy = ""; + let bindFct = this.ongetAccountInfo.bind(this); + this._pcmn.getAccountInfo(_param, bindFct, this.onDummyFail); + } + ongetAccountInfo(response) { + var result = response.result; + $('addr').value = result.addr; + $('act').value = result.act; + $('ville').value = result.ville; + $('cp').value = result.cp; + } + getDossiers() { + var _param = new services_1.Services.DummyReqParams(); + _param.dummy = ""; + let bindFct = this.ongetDossiers.bind(this); + this._user.Organisations(_param, bindFct, this.onDummyFail); + } + ongetDossiers(response) { + var res = response.result; + var sum = "
    "; + try { + for (var i = 0; i < res.length; i++) { + var row = res[i]; + if (this.Current == row[0]) { + sum += "
  • En cours d'utilisation " + row[1] + " voir ("; + sum += "detail)"; + sum += "
  • "; + } + else { + sum += "
  • " + row[1] + ""; + sum += "
  • "; + } + } + sum += "
  • Nouvelle Organisation"; + sum += "
"; + $('parameters-list').innerHTML = sum; + } + catch (e) { + alert("ongetDossiers Failed " + e.message); + } + } + switchDossier(dossier) { + var _param = new services_1.Services.DummyReqParams(); + _param.dummy = dossier; + let bindFct = this.onswitchDossier.bind(this); + this._user.switchOrg(_param, bindFct, this.onDummyFail); + } + onswitchDossier(response) { + console.log("Switched dossier go back to main"); + this.Current = response.result[0]; + $('gestion-compta').innerHTML = response.result[1]; + window.location.href = "/app/compta/services.php/"; + } + getCurrentOrg() { + var _param = new services_1.Services.DummyReqParams(); + _param.dummy = ""; + let bindFct = this.ongetCurrentOrg.bind(this); + this._user.currentOrg(_param, bindFct, this.onDummyFail); + } + ongetCurrentOrg(response) { + this.Current = response.result[0]; + try { + $('gestion-compta').innerHTML = response.result[1]; + } + catch (e) { + alert("ongetCurrentOrg Failed " + e.message); + } + } + showList() { + this.show(); + try { + var p = $("parameters"); + if (p != null) + $("parameters").addClassName("hidden"); + } + catch (e) { + alert("showList Failed " + e.message); + } + this.getCurrentOrg(); + this.getDossiers(); + } + showDetail() { + this.show(); + $("parameters-summary").addClassName("hidden"); + this.getAccountInfo(); + } + onShow() { + } + onLoaded(ht) { + this.showList(); + } + } + Copropriete.DlgParameter = DlgParameter; + class DlgWizard extends CtrlDialogbox_1.Dialogbox { + constructor(_id, uipath, jurl) { + console.log("DlgWizard constructor"); + super(_id); + var req = new AEBW.Json(jurl); + this._pcmn = new services_1.Services.PlanComptable(req); + this._user = new services_1.Services.Users(req); + super.load(uipath); + } + onDummy(response) { + alert("DlgWizard::Dummy Error" + response); + } + onDummyFail() { + alert("DlgWizard::Dummy Error"); + } + onShow() { + console.log("DlgWizard::onShow, create Wizard object"); + this._wizard = new AEBW.control.Wizard('wizard', ['wp1', 'wp2', 'wp3', 'wp4', 'wp6']); + AEBW.mixin(this._wizard, this); + } + onNext(curr_id) { + var _ret = false; + switch (curr_id) { + case "wp1": + _ret = this.createOrg(); + break; + case "wp2": + _ret = true; + break; + case "wp3": + _ret = true; + break; + case "wp4": + _ret = true; + break; + } + return _ret; + } + onPrev(curr_id) { + console.log("DlgWizard::onPrev"); + } + uploadCsv(name, obj) { + var req = AEBW.HTTPRequest(); + try { + var data = new FormData(); + data.append(name, obj); + req.open("POST", "/app/compta/upload.php", true); + req.send(data); + } + catch (e) { + alert("uploadCsv Failed:" + e.message); + } + } + createOrg() { + var _org = new services_1.Services.Organisation($('act').value, $('addr').value, $('cp').value, $('ville').value); + var _param = new services_1.Services.CreateOrgReqParams(_org); + let bindFct = this.onCreateOrg.bind(this); + if (_org.isValid()) { + this._user.createOrg(_param, bindFct, this.onDummyFail); + return true; + } + else { + return false; + } + } + onCreateOrg(response) { + if (response.error != null) { + } + else { + var _r = response.result; + console.log("onCreateOf:: success rid=" + _r.id + " new Org=" + _r.org_id); + } + } + } + Copropriete.DlgWizard = DlgWizard; + })(Copropriete = exports.Copropriete || (exports.Copropriete = {})); +}); diff --git a/app/compta/coproteBootstrap.js b/app/compta/coproteBootstrap.js new file mode 100644 index 0000000..9d5dba9 --- /dev/null +++ b/app/compta/coproteBootstrap.js @@ -0,0 +1,71 @@ +requirejs.config({ + baseUrl: '../..', + paths: { + "cpt": "/app/compta", + "xgui": "/js/xgui", + "tslib": "/js/tslib", + "" : "" + }, + shim: { + "coprote": { + deps: [ 'aebw' + , 'xgui_dialogbox' + , 'xgui/xgui_json' + , 'xgui/xgui_wizard' + , 'cpt/Dialog' + , 'js/scriptaculus/prototype'], + exports: 'Copropriete', + init: function (x) { + } + }, + "Dialog": { + deps: ['xgui/xgui_dialogbox'], + exports: '' + }, + "lots": { + deps: [ 'xgui/xgui_dialogbox' + , 'cpt/Dialog' + , 'cpt/services' + ], + exports: '' + }, + "xgui_dialogbox": { + deps: ['xgui/aebw'], + exports: '' + }, + "xgui_wizard": { + deps: ['xgui/aebw'], + exports: '' + }, + "xgui_json": { + deps: ['xgui/aebw'], + exports: '' + } +/* + , "xgui/xgui_wizard" + + */ + } +}); +requirejs(["require", "exports" + , "tslib" + , "xgui/xgui_json" + , "xgui/xgui_dialogbox" + , "xgui/xgui_wizard" + , "cpt/transaction" + , "cpt/services" + , "cpt/lots" + , "cpt/coprote"], function (req,exp,ts,xj,xd,xw,trs,srv,Lots,myApp) { + console.log("starting Copropriete application.."); + var Params = myApp.Copropriete.Params; + //CoproPay.showPay(); + // To allow access in web page. + window.Params = Params; + if (gState.Mode != 'S') { + console.log("Copropriete disable some menues application.."); + $('smCoproteLots').parentElement.style.display = 'none'; + $('smCoprotePostes').parentElement.style.display = 'none'; + $('smCoproteOrg').parentElement.style.display = 'none'; + } else { + } +}); diff --git a/app/compta/entretien.js b/app/compta/entretien.js new file mode 100644 index 0000000..ec29456 --- /dev/null +++ b/app/compta/entretien.js @@ -0,0 +1,71 @@ +define(["require", "exports", "../../js/xgui/CtrlDialogbox", "./services"], function (require, exports, CtrlDialogbox_1, services_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Coprorietaire; + (function (Coprorietaire) { + class DlgEntretien extends CtrlDialogbox_1.Dialogbox { + constructor(_id, jurl) { + console.log("DlgEntretien constructor"); + super(_id); + var req = new AEBW.Json(jurl); + this._pcmn = new services_1.Services.PlanComptable(req); + } + onDummy(response) { + alert("DlgEntretien::Dummy Error" + response); + } + onDummyFail() { + alert("DlgEntretien::Dummy Error"); + } + ongetExercices(response) { + var d = new Date(); + var cb = $('cbCoproExercices'); + cb.options.length = 0; + for (var i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item[3], item[3]); + if (d.getFullYear() == item[3]) + cb.selectedIndex = i; + } + var obj = this; + Prototype.Event.observe($('cbCoproExercices'), "change", function () { + obj.getEntretien(); + }); + this.getEntretien(); + } + updateEntretien(id, title, content) { + var params = { 'id': id, + 'title': title, + 'content': content + }; + var obj = this; + } + onupdateEntretien(response) { + } + newEntretien(dt, title, desc) { + var d = new Date(); + var m = d.getMonth() + 1; + var day = d.getDate(); + var params = { 'date': dt, + 'title': title, + 'content': desc + }; + } + getEntretien() { + var params = { 'period': $("cbCoproExercices").value }; + var obj = this; + } + ongetEntretien(response) { + var obj = this; + var details = $('copro_entretien_details'); + details.innerHTML = ""; + } + onShow() { + var obj = this; + Prototype.Event.observe($("btEntretienRecord"), "click", function () { + obj.newEntretien($('entretien_date').getValue(), $('entretien_title').getValue(), $('entretien_content').getValue()); + }); + } + } + Coprorietaire.DlgEntretien = DlgEntretien; + })(Coprorietaire = exports.Coprorietaire || (exports.Coprorietaire = {})); +}); diff --git a/app/compta/exercice.js b/app/compta/exercice.js new file mode 100644 index 0000000..0c31790 --- /dev/null +++ b/app/compta/exercice.js @@ -0,0 +1,204 @@ +define(["require", "exports", "./Dialog", "./services"], function (require, exports, Dialog_1, services_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Exercice; + (function (Exercice_1) { + class DlgExercice extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._exercice = new services_1.Services.Exercice(req); + this.tableExercices = function () { + return new AEBW.control.table('table_exercice'); + }; + } + onDummy(response) { + alert("DlgPaye::Dummy Error" + response); + } + onDummyFail() { + alert("DlgPaye::Dummy Error"); + } + getExercices() { + var _param = new services_1.Services.DummyReqParams(); + let bindOnGetExercice = this.onGetExercices.bind(this); + this._exercice.list(_param, bindOnGetExercice, this.onDummyFail); + } + onGetExercices(response) { + var tb = this.tableExercices(); + var Ex = this; + var bindSetCurrent = this.setCurrent.bind(this); + try { + this.cleanTable(tb, tb._NbRows); + } + catch (e) { + console.log("onGetExercices Failed:" + e.message); + } + if (response.result == null || response.result == 0) { + console.log("DlgExercice::onGetExercices ... result == null no exercices"); + return; + } + for (var i = 0; i < response.result.length; i++) { + var it = response.result[i]; + var act = ''; + var row = tb.addRow(); + if (it[3] == gState.Exercice) { + row.addClassName("current"); + } + try { + var exCell = tb.getCell(tb._NbRows - 1, 1); + console.log("Bind Event to element"); + exCell.on("click", function (evt, elt) { + console.log("Clicked on Exercice ->" + elt.innerHTML); + bindSetCurrent(elt.innerHTML); + }); + } + catch (e) { + console.log("Failed extend.bind " + e.message); + } + this.fillRow(row, it); + tb.getCell(tb._NbRows - 1, 1).innerHTML = it[3]; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it['1']; + tb.getCell(tb._NbRows - 1, 3).innerHTML = it['2']; + } + $$("i[action-confirm]").each(function (elt) { + elt.on("click", function (e) { + var r = elt.getAttribute('record'); + var msg = elt.getAttribute('action-confirm'); + if (!confirm(msg)) { + e.stopImmediatePropagation(); + e.preventDefault(); + } + else { + Ex.removeExercice(elt.getAttribute('record')); + } + }); + }); + $$("i[dist-charge]").each(function (elt) { + elt.on("click", function (e) { + var ex = elt.getAttribute('exercice'); + e.stopImmediatePropagation(); + e.preventDefault(); + Ex.repartirCharge(); + }); + }); + $$("i[close-exercice]").each(function (elt) { + elt.on("click", function (e) { + var ex = elt.getAttribute('exercice'); + e.stopImmediatePropagation(); + e.preventDefault(); + Ex.closing(ex); + }); + }); + } + fillRow(row, it) { + var sts = ""; + var act = ''; + } + else { + sts = sts + ''; + if (it[3] == gState.Exercice) { + act = act + ''; + act = act + ''; + } + } + if (it['6'] == 1) { + sts = sts + ''; + } + row.cells[0].innerHTML = sts; + row.cells[0].setAttribute('record', it[3]); + row.cells[4].innerHTML = act; + } + closing(ex) { + var _param = new services_1.Services.DummyReqParams(ex); + console.log("Exercice::closing year " + ex); + let bindOnUpdateExercice = this.onUpdateExercice.bind(this); + this._exercice.closing(_param, bindOnUpdateExercice, this.onDummyFail); + } + repartirCharge() { + var _param = new services_1.Services.EmptyReqParams(); + console.log("Exercice::repartirCharge "); + let bindOnUpdateExercice = this.onUpdateExercice.bind(this); + this._exercice.repartirCharge(_param, bindOnUpdateExercice, this.onDummyFail); + } + removeExercice(desc) { + var _param = new services_1.Services.DummyReqParams(desc); + console.log("Exercice::removeExercice: " + desc); + let bindOnUpdateExercice = this.onUpdateExercice.bind(this); + this._exercice.remove(_param, bindOnUpdateExercice, this.onDummyFail); + } + onUpdateExercice(response) { + var tb = this.tableExercices(); + this.cleanTable(tb, tb._NbRows); + this.getExercices(); + } + addExercice(desc, debut, fin) { + var _param = new services_1.Services.ExCreateReqParams(desc, debut, fin); + let bindOnAddExercice = this.onAddExercice.bind(this); + this._exercice.create(_param, bindOnAddExercice, this.onDummyFail); + } + onAddExercice(response) { + $('exercice-new').addClassName('hidden'); + $('exercice-liste').removeClassName('hidden'); + this.onUpdateExercice(response); + } + setCurrent(exer) { + var _param = new services_1.Services.DummyReqParams(); + _param.dummy = exer; + console.log("Exercice:SetCurrent :exercice=" + exer); + let bindOnSetCurrent = this.onSetCurrent.bind(this); + this._exercice.setCurrent(_param, bindOnSetCurrent, this.onDummyFail); + } + onSetCurrent(_res) { + console.log("Exercice:onSetCurrent 1=" + _res.result.exercice); + if (!(typeof (_res.result.exercice) === "undefined") + && _res.result.exercice != "") { + gState.Exercice = _res.result.exercice; + window.location.href = "/app/compta/services.php/"; + } + else { + console.log("onSetCurrent wrong response failed " + _res.error); + } + } + cleanTable(tb, sz) { + for (var i = 0; i < sz; i++) { + tb.delRow(0); + } + } + } + Exercice_1.DlgExercice = DlgExercice; + Exercice_1.Exercice = new DlgExercice("parameter", "/app/compta/forms.php?panel=exercice", "/app/compta/index.php"); + Prototype.Event.observe($("btExList"), "click", function () { + Exercice_1.Exercice.getExercices(); + $('exercice-new').addClassName('hidden'); + $('exercice-close').addClassName('hidden'); + $('exercice-liste').removeClassName('hidden'); + Prototype.Event.observe($('btExAdd'), "click", function () { + Exercice_1.Exercice.addExercice($("ex_desc").value, $('ex_start').value, $('ex_end').value); + }); + }); + Prototype.Event.observe($("btExNew"), "click", function () { + Exercice_1.Exercice.getExercices(); + $('exercice-liste').addClassName('hidden'); + $('exercice-close').addClassName('hidden'); + $('exercice-new').removeClassName('hidden'); + Prototype.Event.observe($('btExAdd'), "click", function (e) { + Exercice_1.Exercice.addExercice($("ex_desc").value, $('ex_start').value, $('ex_end').value); + e.stopImmediatePropagation(); + }); + }); + Prototype.Event.observe($("btExClore"), "click", function () { + Exercice_1.Exercice.getExercices(); + $('exercice-liste').addClassName('hidden'); + $('exercice-new').addClassName('hidden'); + Prototype.Event.observe($('btExAdd'), "click", function (e) { + Exercice_1.Exercice.addExercice($("ex_desc").value, $('ex_start').value, $('ex_end').value); + e.stopImmediatePropagation(); + }); + }); + })(Exercice = exports.Exercice || (exports.Exercice = {})); +}); diff --git a/app/compta/exercice.xml b/app/compta/exercice.xml new file mode 100644 index 0000000..7b715db --- /dev/null +++ b/app/compta/exercice.xml @@ -0,0 +1,62 @@ + + + + + + Exercice Managment + + + + + + + +Nouvel Exercice + +
+
+ +
+
+ +
+ + + + + + +

Les exerices

+ + + + + + + + + + + + + +
ExerciceDate de DébutDate de Fin
+
+ +

Cloture de compte

+
+ + + + + + diff --git a/app/compta/exerciceBootstrap.js b/app/compta/exerciceBootstrap.js new file mode 100644 index 0000000..eb0e00d --- /dev/null +++ b/app/compta/exerciceBootstrap.js @@ -0,0 +1,63 @@ +requirejs.config({ + baseUrl: '../..', + urlArgs: "v=" + (new Date()).getTime() , /* For debug*/ + paths: { + "cpt": "/app/compta", + "xgui": "/js/xgui", + "tslib": "/js/tslib", + "" : "" + }, + shim: { + "exercice": { + deps: [ 'aebw' + , 'xgui_dialogbox' + , 'xgui_json' + , 'cpt/transaction' + , 'cpt/Dialog' + , 'js/scriptaculus/prototype'], + exports: 'Exercice', + init: function (x) { + } + }, + "copro-ng": { + deps: ['aebw' + , 'xgui_dialogbox' + , 'xgui/xgui_json' + , 'cpt/Dialog' + , 'services' + ,'js/scriptaculus/prototype'], + exports: 'copro', + init: function (x) { + } + }, + "Dialog": { + deps: ['xgui/xgui_dialogbox'], + exports: '' + }, + "xgui_dialogbox": { + deps: ['xgui/aebw'], + exports: '' + }, + "xgui_json": { + deps: ['xgui/aebw'], + exports: '' + } + } +}); +requirejs(["require", "exports" + , "tslib" + , "xgui/xgui_json" + , "xgui/xgui_dialogbox" + , "cpt/Dialog" + , "cpt/services" + , "cpt/exercice"], function (req,exp,ts,a,b,dlg,serv,Ex) { + console.log("starting Exercice application..."); + $('exercice-new').addClassName('hidden'); + $('exercice-close').addClassName('hidden'); + try { + Ex.Exercice.Exercice.getExercices(); + } catch (e) { + console.log("Bootstrap getExercice faild:"+e.message); + } + //Ex.Exercice.Exercice.show(); +}); diff --git a/app/compta/forms.php b/app/compta/forms.php new file mode 100644 index 0000000..b9cfbca --- /dev/null +++ b/app/compta/forms.php @@ -0,0 +1,197 @@ +siteScheme().$_SERVER['SERVER_NAME']; + $this->panel = $_panel; + $this->retrieve = new Retrieve($this->getSession(),$this->conf_auth, $this->getSession()->getDb()); + } + /* + * @brief compute complete + * html output based on xsl and xml + */ + function showXML ($file) { + $xml = new DomDocument(); + $xml->load($file); + if ($html = $this->xp->transformToXML($xml) ) { + echo $html; + } else { + echo "Failed Transform XML\n"; + } + } + /* + * @brief compute embedded + * html output based on xsl and xml. + * unlike complete page, only the content + * is computed. header and footer are left + * to php script + * Compared to parent class that also performs script injection + * and script update. + */ + function showEmbeddedXML ($file) { + //$_books = array('jrnx','jrnx_record',',jrnx_transactions'); + $_books = array('jrnx_record','jrnx_transactions'); + $namespace = ""; + $params["mode"] = 'embedded-panel'; + $xml = new DomDocument(); + $xml->validateOnParse = true; + $xml->load($file); + if (in_array($this->panel,$_books)) { + $this->updateJrnxBookInXml($xml); + } + $this->xp->setParameter($namespace,$params); + if ($html = $this->xp->transformToXML($xml) ) { + echo $html; + } else { + echo "Failed Transform XML\n"; + } + } + function updateJrnxBookInXml($xml) { + $book = $this->getElementById($xml,"jrnxBook"); + // Remove all children + if ($book == null) + { + error_log("updateJrnxBookInXml book is null not good"); + return; + } + try { + //while ( $element = $book->item(0)) { + //error_log("updateJrnxBookInXml book rm"); + // $element->parentNode->removeChild($element); + //} + } catch (Exception $e) { + } + // Request all JrnxTypes through api_retrieve + $jrnxType = $this->retrieve->getEntryTypes(); + foreach ($jrnxType as $type) { + $entry = $xml->createElement('Entry'); + $key = $xml->createAttribute('key'); + $key->value = $type[1]; + $value = $xml->createAttribute('value'); + $value->value = $type[0]; + $entry->appendChild($key); + $entry->appendChild($value); + $book->appendChild($entry); + } + } + /** + * @brief TO REMOVE + */ + function compta($form) + { + switch ($form) + { + case "pcmn": + $this->file = "compta/pcmn.xml"; + break; + case "syndic": + $this->file = "compta/ledger_syndic.xml"; + break; + case "eglise": + $this->file = "compta/ledger_church.xml"; + break; + case "idx": + $this->file = "compta/index.xml"; + break; + case "jrnx": + $this->file ="compta/journaux.xml"; + break; + default: + $this->file = "compta/index.xml"; + } + } + function admin($form) + { + switch ($form) + { + case "user": + $this->file = "admin/view/index.fr_FR.UTF-8.xml"; + break; + default: + $this->file = "compta/index.xml"; + } + } + + function showHTML() { + echo "

PHP Applications

"; + $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); + + echo <<Applications + +END; + + } + + function main() { + if ($this->file == "") { + $this->showHTML(); + } else { + $this->showEmbeddedXML($this->file); + } + } + +} +/** + * Main entry point for Forms. Return a tranformed + * xml file. The file is selected according to the panel + * name. + */ +if (isset($_GET['form']) ) { + $form = $_GET['form']; + error_log("forms.php $_GET[form] should not be called"); +} elseif (isset($_GET['panel'])) { + $panel = $_GET['panel']; + $page = new Forms($frame['compta'][$panel],$panel); + if (isset($frame['compta'][$panel])) { + $page->showEmbeddedXML($frame['compta'][$panel]); + } else + $page->showXML('index.xml'); +} else { + error_log("forms.php GET['panel'] not set AIE"); +} +?> diff --git a/app/compta/index.php b/app/compta/index.php new file mode 100644 index 0000000..cf661f8 --- /dev/null +++ b/app/compta/index.php @@ -0,0 +1,117 @@ +conf_auth = $conf['auth']['mysql']; + $this->session = $_session; + } + /** + * + */ + function getDb() { + return $this->session->getDb(); + } + + /** + * + */ + function Service($request) { + return $request['service']; + } + /** + * + */ + private function getObjectInstance($request) + { + $conf_auth = $this->conf_auth; + $s = $this->session; + $pcmn = null; + switch ($this->Service($request)) + { + case "pcmn": + require_once(dirname(__FILE__)."/api_pcmn.php"); + $pcmn = new Pcmn($s,$conf_auth, $this->getDb()); + break; + case "ident": + require_once(dirname(__FILE__)."/api_identity.php"); + $pcmn = new Identity($s, $conf_auth); + break; + case "retrieve": + require_once(dirname(__FILE__)."/api_retrieve.php"); + $pcmn = new Retrieve($s,$conf_auth, $this->getDb()); + break; + case "booking": + require_once(dirname(__FILE__)."/api_booking.php"); + $pcmn = new Booking($s,$conf_auth, $this->getDb()); + break; + case "budget": + require_once(dirname(__FILE__)."/api_budget.php"); + $pcmn = new Budget($s,$conf_auth, $this->getDb()); + break; + case "syndic": + require_once(dirname(__FILE__)."/api_syndic.php"); + $pcmn = new Syndic($s,$conf_auth, $this->getDb()); + break; + case "entretien": + require_once(dirname(__FILE__)."/api_entretien.php"); + $pcmn = new Entretien($s,$conf_auth, $this->getDb()); + break; + case "exercice": + require_once(dirname(__FILE__)."/api_exercice.php"); + $pcmn = new Exercice($s,$conf_auth, $this->getDb()); + break; + } + return $pcmn; + } + /** + * + */ + function processRequest($request) { + $pcmn = $this->getObjectInstance($request); + if ($pcmn != null) + { + if ( ! JsonRPCServer::handle($pcmn,$request) ) { + log_error("Request is not Json.". " Content Meth:".$_SERVER['REQUEST_METHOD']." Content Type:".$_SERVER['CONTENT_TYPE']); + } + } else { + $res = array('id' => '1','result' => 'failed', 'error' => 'Unkonwn service'); + header('X-JSON: '.json_encode($res)); + } + } +} + +/** + * @brief Main entry + */ +GLOBAL $conf; +$conf_auth = $conf['auth']['mysql']; +$s = new SessionCompta($conf_auth,$conf_auth['req_file']); +if ($s->is_logged_in() ) { + $p = New Compta($s,"/sql-requests.xml"); + if ($_SERVER['REQUEST_METHOD'] == "POST") { + $request = $p->getContent(); + $p->processRequest($request); + } else { + $res = array('id' => "1",'result' => 'failed', 'error' => 'Unkonwn service wrong'); + header('X-JSON: '.json_encode($res)); + } +} else { + $res = array('result' => 'failed', 'reason' => 'User not authenticated'); + header('X-JSON: '.json_encode($res)); +} + + +/* + :vim:et:ts=2:sw=2:encoding=utf-8 + */ +?> diff --git a/app/compta/index.xml b/app/compta/index.xml new file mode 100644 index 0000000..284419e --- /dev/null +++ b/app/compta/index.xml @@ -0,0 +1,240 @@ + + + + + + User Managment + + + + +

Administration des utilisateurs

+

+

+ +
+ + + + + Utilisateur + +
+ Her +
+ + + Plan Comptable + + 1 Comptes de capitaux + + + 2 Comptes d immobilisation + + + 3 Stock et Command + + + 4 Comptes Tiers + + + 5 Comptes Financiers + + + 6 Comptes Charges + + + 7 Comptes Produits + + + 8 Hors Comptabilite + + + 9 Comptes Analytiques + + +
+
+

Test What happens here

+ + System + + + +

+ + + Groupes + + simpe test + + + + Frogs + + Ok, + + Info Gen + + Une info: + + + + + + +
+
+
+
+ + + + + Groupes + + Strange + + authentication + +

Test Content

+ +
+
+ + alias + + display boxes : enable + + + + ssl + + display boxes: + enable + disable + + + + + +
+
+ + + Eglise + + Page de debug pour web_server. + + Yes + Vide + + + + + + T table + + Test Table Stuff + + + + + + + + + + + +
Titre du tableau
r1r2
Un test pour voird1
Un bouton +
Un test pour voird1
Un bouton +
+ End Table + +
+
+ + Calendar + + Test12 +
+ +
+
+
+ +
+
diff --git a/app/compta/journaux.js b/app/compta/journaux.js new file mode 100644 index 0000000..546bc49 --- /dev/null +++ b/app/compta/journaux.js @@ -0,0 +1,764 @@ +define(["require", "exports", "../../js/xgui/Xgui", "./Dialog", "./transaction", "./services"], function (require, exports, Xgui_1, Dialog_1, transaction_1, services_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Journaux; + (function (Journaux) { + class DlgJrnxBase extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + console.log("DlgJrnxBase constructor"); + super(_id, uipath, jurl); + this._bookcb = "jrnxBook"; + var req = new AEBW.Json(jurl); + this._retrieve = new services_1.Services.Retrieve(req); + } + setSelectedIndex(s, v) { + try { + console.log("Try to set option on jrnxBook :" + s.options.length + " " + v); + for (var i = 0; i < s.options.length; i++) { + if (s.options[i].text == v) { + s.options[i].selected = true; + return; + } + } + } + catch (e) { + console.log("Failed set index " + e.message); + } + s.value = v; + } + getJrnxType() { + var params = new services_1.Services.EmptyReqParams(); + var bindFct = this.onGetJrnxType.bind(this); + this._retrieve.getEntryTypes(params, bindFct, this.onDummyFail); + } + onDummyFail() { + alert("DlgParameter::Dummy Error"); + } + onGetJrnxType(response) { + var obj = this; + try { + var cb = $(this._bookcb); + if (cb == null) { + alert('onGetJrnxType failed cb is NULL: '); + } + cb.options.length = 0; + for (var i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item[1], item[0]); + } + console.log("DlgJrnxBase::onGetJrnxType:" + cb.options.length); + } + catch (e) { + console.log("Failed :" + e.message); + } + } + } + class DlgJrnx extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + console.log("DlgJrnx constructor"); + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._retrieve = new services_1.Services.Retrieve(req); + this._load_jrnx = true; + this.table = null; + customElements.whenDefined('xgui-entry').then(() => { + console.log("xgui-entry defined"); + }); + } + onDummy(response) { + alert("DlgParameter::Dummy Error" + response); + } + onDummyFail() { + alert("DlgParameter::Dummy Error"); + } + getJrnxType() { + var params = new services_1.Services.EmptyReqParams(); + var bindFct = this.onGetJrnxType.bind(this); + this._retrieve.getEntryTypes(params, bindFct, this.onDummyFail); + } + onGetJrnxType(response) { + var obj = this; + try { + var cb = $('jrnxBook'); + if (cb == null) { + alert('onGetJrnxType failed cb is NULL: '); + } + cb.options.length = 0; + for (var i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item[1], item[0]); + } + } + catch (e) { + console.log("Failed :" + e.message); + } + } + updateJrnx() { + console.log("updateJrnx " + $('jrnxBook').value); + this.table.getJrnx(gState.Exercice, $('jrnxBook').value); + } + onShow() { + console.log("DlgJrnx::onShow"); + var obj = this; + this._load_jrnx = true; + this.getJrnxType(); + if ($('jrnxBook') != null) { + Prototype.Event.observe("jrnxBook", 'change', function () { + obj.updateJrnx(); + }); + } + try { + $("iExercice").innerHTML = gState.Exercice; + this.table = new TableJournal('table_jrnx', this.Url()); + this.table.eraseAllRows(); + this.updateJrnx(); + } + catch (e) { + console.log("onShow something went wrong :" + e.message); + } + } + onLoaded(ht) { + console.log("DlgJrnx::onLoad " + this.declaredClass + "\n"); + this.show(); + } + } + Journaux.DlgJrnx = DlgJrnx; + class TableJournal extends Xgui_1.Xgui.Table { + constructor(_id, _jurl) { + super(_id); + console.log("TableJournal::ctor"); + var req = new AEBW.Json(_jurl); + this._retrieve = new services_1.Services.Retrieve(req); + this._prop = { _limit: 12, _offset: 0, _max: 12 }; + try { + this.addFixedFooter(); + } + catch (e) { + console.log("TableRow::ctor " + e.message); + } + } + onDummyFail() { + alert("TableJournal::Dummy Error"); + } + onLeft() { + if (super.onLeft()) { + this.getJrnx(gState.Exercice, $('jrnxBook').value); + } + return false; + } + onRight() { + if (super.onRight()) { + this.getJrnx(gState.Exercice, $('jrnxBook').value); + } + return false; + } + getJrnx(period, jr) { + var params = new services_1.Services.EntriesReqParams(period, jr); + params.options.limit = this._prop._limit; + params.options.offset = this._prop._offset; + var bindFct = this.onGetJrnx.bind(this); + this._retrieve.getEntriesByType(params, bindFct, this.onDummyFail); + } + onGetJrnx(response) { + var tb = this; + this.eraseAllRows(); + for (var i = 0; i < response.result.records.length; i++) { + var it = response.result.records[i]; + var row = tb.addRow(); + tb.getCell(tb._NbRows - 1, 0).innerHTML = it['0']; + tb.getCell(tb._NbRows - 1, 1).innerHTML = it['1']; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it['2']; + tb.getCell(tb._NbRows - 1, 3).innerHTML = it['3']; + if (it[4] > 0.0) { + tb.getCell(tb._NbRows - 1, 4).innerHTML = it['4']; + row.cells[4].style.textAlign = "right"; + } + else { + tb.getCell(tb._NbRows - 1, 4).innerHTML = ""; + } + if (it[5] > 0.0) { + tb.getCell(tb._NbRows - 1, 5).innerHTML = it['5']; + row.cells[5].style.textAlign = "right"; + } + else { + tb.getCell(tb._NbRows - 1, 5).innerHTML = ""; + } + } + $('jrnxSoldeDebit').innerHTML = response.result.solde[0][0]; + $('jrnxSoldeCredit').innerHTML = response.result.solde[0][1]; + this._prop._max = response.result.solde[0][2]; + this.updateCounter("" + this._prop._offset + " / " + this._prop._max + " "); + } + } + class TableTransactions extends Xgui_1.Xgui.Table { + constructor(_id, _jurl) { + super(_id); + var req = new AEBW.Json(_jurl); + this._retrieve = new services_1.Services.Retrieve(req); + this._prop = { _limit: 13, _max: 13, _offset: 0 }; + try { + this.addFixedFooter(); + } + catch (e) { + console.log("TableRow::ctor " + e.message); + } + } + onLeft() { + if (super.onLeft()) { + this.loadTransactions($('jrnxBook').value); + } + return false; + } + onRight() { + if (super.onRight()) { + this.loadTransactions($('jrnxBook').value); + } + return false; + } + onSelectCell(cell, row, col) { + } + onDummyFail() { + alert("TableTransctions::Dummy Error"); + } + onTransLoaded(resp) { + var self = this; + try { + if (resp.hasOwnProperty('error') && resp.error != null) { + console.log("onTransLoaded Got Error:" + resp.error); + } + var trans = resp.result.transaction; + this.eraseAllRows(); + for (var i = 0; i < trans.length; i++) { + var item = trans[i]; + var trans_id = item['id']; + var trans_date = item['date']; + var trans_desc = item['label']; + var trans_total = item['debit']; + var a = document.createElement("a"); + a.setAttribute("id", "trans-" + trans_id); + a.setAttribute("trans", trans_id); + a.setAttribute("desc", trans_desc); + a.innerHTML = trans_desc; + a.onclick = function (e) { + var evt = (e || window.event); + var el = evt.target; + var acc = el.getAttribute("trans"); + var desc = el.getAttribute("desc"); + var book = $('jrnxBook').value; + Journaux.JrnxRecord.show(); + Journaux.JrnxRecord.update(acc, book); + }; + var row = this.addRow(); + row.cells[0].innerHTML = trans_date; + row.cells[1].appendChild(a); + row.cells[2].innerHTML = trans_total; + } + } + catch (e) { + console.log("onTransLoaded exp:" + e.message); + } + this._prop._max = resp.result.total; + this.updateCounter("" + this._prop._offset + " / " + this._prop._max + " "); + } + loadTransactions(_ttype) { + var params = new services_1.Services.TransactionsReqParams(_ttype, this._prop._limit, this._prop._offset); + var bindFct = this.onTransLoaded.bind(this); + this._retrieve.getTransactionByType(params, bindFct, this.onDummyFail); + } + } + class TableRecord extends Xgui_1.Xgui.Table { + constructor(_id, _drop) { + super(_id); + this._droplist = _drop; + } + onSelectCell(cell, row, col) { + } + totalDebitCredit() { + $("jrnxSoldeCredit").innerHTML = this._totalofCollection("credit").toFixed(2); + $("jrnxSoldeDebit").innerHTML = this._totalofCollection("debit").toFixed(2); + } + _getEntryId(cell) { + var entry_id = cell.getAttribute("entry_id"); + if (entry_id == null || entry_id == "") { + return -1; + } + else { + return entry_id; + } + } + bookingEntries() { + var rows = this.getRows(); + var entries = new Array(); + for (var i = 0; i < rows.length; i++) { + var row = rows[i]; + var cells = row.cells; + var id = cells[0]; + var acc = cells[1]; + var deb = cells[3]; + var cre = cells[4]; + if (parseFloat(deb.innerHTML) > 0.0) { + var entry = new transaction_1.Ledger.TransactionEntry('d', $('jrnxBook').value); + entry.setAccount(acc.innerHTML); + entry.amount = parseFloat(deb.innerHTML); + entry.entry_id = this._getEntryId(id); + entries.push(entry); + } + else if (parseFloat(cre.innerHTML) > 0.0) { + var entry = new transaction_1.Ledger.TransactionEntry('c', $('jrnxBook').value); + entry.setAccount(acc.innerHTML); + entry.amount = parseFloat(cre.innerHTML); + entry.entry_id = this._getEntryId(id); + entries.push(entry); + } + else { + var entry = new transaction_1.Ledger.TransactionEntry('c', $('jrnxBook').value); + entry.setAccount(acc.innerHTML); + entry.amount = 0; + entry.entry_id = this._getEntryId(id); + entries.push(entry); + } + } + return entries; + } + _totalofCollection(collId) { + var table = this._table; + var coll = table.getElementsByClassName(collId); + var total = 0.0; + console.log("Compute Solde on collection " + coll.length); + for (var i = 0; i < coll.length; i++) { + var cell = coll[i]; + if (cell.isActive()) { + cell.toggleState(); + } + var val = parseFloat(coll[i].innerHTML); + total = total + val; + } + return total; + } + addDropdown() { + this._droplist.accountDropFragment(); + } + cellGotDigit(cell, val) { + console.log("TableRecord : cellGotDigit :" + val); + this._droplist.onTableCell(this, cell); + this._droplist.getAccounts(val); + } + fillToReadWriteAccount(cell) { + var self_table = this; + cell._toWrite = function (e) { + e.save = e.innerHTML; + var edit = document.createElement('input', { is: "xgui-entry" }); + e.innerHTML = ""; + edit.value = e.save; + var holder = document.createElement('div'); + holder.classList.add("holder"); + holder.setAttribute("id", "holder"); + e.appendChild(holder); + holder.appendChild(edit); + edit.onReturn = function (val) { e.toggleState(); }; + edit.onDigit = function (val) { + self_table.cellGotDigit(e, val); + }; + self_table.addDropdown(); + }; + cell._toRead = function (e) { + e.innerHTML = e.firstChild.firstChild.value; + self_table.totalDebitCredit(); + }; + } + fillToReadWriteDC(cell) { + var self_table = this; + cell._toWrite = function (e) { + e.save = e.innerHTML; + var edit = document.createElement('input', { is: "xgui-entry" }); + e.innerHTML = ""; + edit.value = e.save; + e.appendChild(edit); + edit.onReturn = function (val) { e.toggleState(); }; + }; + cell._toRead = function (e) { + e.innerHTML = e.firstChild.value; + if (!AEBW.isNumber(e.innerHTML)) { + alert('Validation mauvais format du montant. Peut-etre un probleme de point ou de virgule'); + e.style.border = '1px solid red'; + return; + } + else { + e.style.border = '1px solid green'; + } + self_table.totalDebitCredit(); + }; + } + updateEntries(entries) { + this.eraseAllRows(); + for (var i = 0; i < entries.length; i++) { + var item = entries[i]; + var row = this.addRow(); + var cells = row.cells; + cells[0].setAttribute("entry_id", item[0]); + cells[0].setAttribute("trans_id", item[1]); + cells[1].innerHTML = item[2]; + cells[2].innerHTML = item[3]; + if (item[4] == 'd') { + cells[3].innerHTML = item[5]; + } + else { + cells[4].innerHTML = item[5]; + } + } + this.totalDebitCredit(); + } + addRow() { + var self_table = this; + var row = super.addRow(); + var cells = row.cells; + cells[0].innerHTML = ""; + cells[0].align = "center"; + var fchild = cells[0].querySelector("i"); + fchild.onclick = function (event) { + console.log("TableRecord :onClick "); + self_table.addRow(); + }; + for (var i = 1; i < cells.length; i++) { + var current_cell = cells[i]; + if (i == 2) + continue; + if (i == 1) { + this.fillToReadWriteAccount(cells[i]); + } + if (i > 2) + this.fillToReadWriteDC(cells[i]); + } + cells[1].innerHTML = ""; + cells[3].innerHTML = "0.0"; + cells[3].classList.add("debit"); + cells[4].innerHTML = "0.0"; + cells[4].classList.add("credit"); + return row; + } + } + class DroplistAccount { + constructor(_idToInsert, jurl) { + var req = new AEBW.Json(jurl); + this._retrieve = new services_1.Services.Retrieve(req); + this._pcmn = new services_1.Services.PlanComptable(req); + this._iCell = null; + this._idTo = _idToInsert; + } + onTableCell(table, cell) { + this._iCell = cell; + this._table = table; + } + getAccounts(c) { + var params = new services_1.Services.AccountListReqParams(c); + var bindFct = this.ongetListeComptes.bind(this); + this._pcmn.getAccountList(params, bindFct, this.onDummyFail); + } + onDummyFail() { + alert("Droplist::Dummy Error"); + } + onSelectAccount(acc, desc) { + console.log("onSelectAccount acc:" + acc + " desc:" + desc); + var row = this._iCell.getAttribute("row"); + var col = this._iCell.getAttribute("col"); + this._table.getCell(row - 1, col).innerHTML = desc; + this._iCell.toggleState(); + this._iCell.innerHTML = acc; + } + ongetListeComptes(resp) { + var self = this; + var cb = $("dropdown"); + cb.innerHTML = ""; + for (var i = 0; i < resp.result.length; i++) { + var item = resp.result[i]; + var acc_id = item['acc_id']; + var acc_desc = item['acc_desc']; + var a = document.createElement("a"); + a.setAttribute("id", "acc-" + acc_id); + a.setAttribute("acc", acc_id); + a.setAttribute("desc", acc_desc); + a.innerHTML = acc_id + "-" + acc_desc; + a.onclick = function (e) { + var evt = (e || window.event); + var el = evt.target; + var acc = el.getAttribute("acc"); + var desc = el.getAttribute("desc"); + self.onSelectAccount(acc, desc); + }; + cb.appendChild(a); + } + } + accountDropFragment() { + var div = document.createElement('div'); + div.classList.add("dropdown-content"); + div.setAttribute("id", "dropdown"); + div.innerHTML = "40014002"; + $(this._idTo).appendChild(div); + div.style.display = "block"; + } + } + class DlgJrnxRecord extends DlgJrnxBase { + constructor(_id, uipath, jurl) { + console.log("DlgJrnxRecord constructor"); + super(_id, uipath, jurl); + this.table = null; + this._dropdown = new DroplistAccount("holder", jurl); + var req = new AEBW.Json(jurl); + this._booking = new services_1.Services.Booking(req); + this._retrieve = new services_1.Services.Retrieve(req); + } + onDummy(response) { + alert("DlgParameter::Dummy Error" + response); + if (response.error !== 'undefined' && response.errorr != null) { + } + else { + var _r = response.result; + console.log("onDummy:: success "); + } + } + onDummyFail() { + alert("DlgParameter::Dummy Error"); + } + submit() { + var t = new transaction_1.Ledger.Transaction($("jrnxBook").value, "tiJrnx"); + console.log('DlgJrnxRescord::submit enter'); + if ($('jrnxBook').value != "AN") { + if (parseFloat($("jrnxSoldeCredit").innerHTML).toFixed(2) + != parseFloat($("jrnxSoldeDebit").innerHTML).toFixed(2)) { + alert("Transaction incomplete balance non "); + return; + } + } + t.entries = this.table.bookingEntries(); + console.log(t.json()); + try { + var bindOnSubmit = this.onSubmit.bind(this); + this._booking.postTransaction(t, bindOnSubmit, this.onDummyFail); + } + catch (e) { + } + } + onSubmit(resp) { + console.log('DlgJrnxRescord onSubmit'); + if (resp.error !== 'undefined' && resp.errorr != null) { + } + else { + var _r = resp.result; + console.log("onSubmit:: success "); + this.table.eraseAllRows(); + this.table.addRow(); + } + } + onGetTransaction(resp) { + console.log('DlgJrnxRescord onGetTransaction %o', resp); + if (resp.result.entries) { + this.table.updateEntries(resp.result.entries); + } + if (resp.result.transaction) { + var pref = 'tiJrnx'; + var items = resp.result.transaction; + console.log("Ok, fill transatction %o", items); + $(pref + '_voucher_ref').value = items[1]; + $(pref + '_voucher_date').value = items[2]; + $(pref + '_date').value = items[3]; + $(pref + '_desc').value = items[4]; + } + } + update(_trans_id, _ttype) { + var t = new services_1.Services.DummyReqParams(_trans_id); + var bindFct = this.onGetTransaction.bind(this); + $('tiJrnx_trans_id').setAttribute('trans_id', _trans_id); + console.log("try set jrnxBook tp:" + _ttype); + this.setSelectedIndex($("jrnxBook"), _ttype); + this._retrieve.getTransaction(t, bindFct, this.onDummyFail); + } + onShow() { + console.log("DlgJrnxRecord::onShow"); + var obj = this; + var d = new Date(); + var m = d.getMonth() + 1; + var day = d.getDate(); + this._load_jrnx = true; + this.table = new TableRecord('table_jrnx_record', this._dropdown); + this.table.eraseAllRows(); + this.table.addRow(); + $('tiJrnx_voucher_date').placeholder = 'AAAA-MM-DD'; + $('tiJrnx_date').value = d.getFullYear() + '-' + ('0' + m).slice(-2) + '-' + ('0' + day).slice(-2); + Prototype.Event.observe($("btJrnxSave"), "click", function () { + obj.submit(); + }); + console.log("DlgJrnxRecord::onShow done"); + } + onLoaded(html) { + console.log("DlgJrnxRecod::onLoaded"); + } + } + Journaux.DlgJrnxRecord = DlgJrnxRecord; + class DlgJrnxTransactions extends DlgJrnxBase { + constructor(_id, uipath, jurl) { + console.log("DlgJrnxTransaction constructor"); + super(_id, uipath, jurl); + this.table = null; + } + onDummy(response) { + alert("DlgJrnxTransaction::Dummy Error" + response); + } + onDummyFail() { + alert("DlgJrnxTransaction::Dummy Error"); + } + onLoaded(html) { + console.log("DlgJrnxTransaction::onLoaded"); + } + onShow() { + var self = this; + console.log("DlgJrnxTransaction::onShow"); + this.table = new TableTransactions('table_jrnx_transaction', this.Url()); + this.table.loadTransactions($('jrnxBook').value); + Prototype.Event.observe("jrnxBook", 'change', function () { + self.table.loadTransactions($('jrnxBook').value); + }); + } + } + Journaux.DlgJrnxTransactions = DlgJrnxTransactions; + class DlgJrnxCompte extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + console.log("DlgJrnxCompte constructor"); + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._retrieve = new services_1.Services.Retrieve(req); + this.table = function () { + return new AEBW.control.table('table_jrnx'); + }; + } + onDummy(response) { + alert("DlgJrnxCompte::Dummy Error" + response); + } + onDummyFail() { + alert("DlgJrnxCompte::Dummy Error"); + } + ongetExercices(response) { + } + getListeComptes(c) { + var params = new services_1.Services.AccountListReqParams(c); + var bindFct = this.ongetListeComptes.bind(this); + this._pcmn.getAccountList(params, bindFct, this.onDummyFail); + } + getExercices() { + console.log("DlgJrnxCompte::getExercices, simply update Ui with current Exercice"); + } + getEntriesByAccount(period, jr) { + var params = new services_1.Services.EntriesReqParams(period, jr); + var bindFct = this.ongetEntriesByAccount.bind(this); + this._retrieve.getEntriesByAccount(params, bindFct, this.onDummyFail); + } + ongetEntriesByAccount(response) { + var tb = new AEBW.control.table('jrnx_table_compte'); + super.cleanTable(tb, tb._NbRows); + var entries = response.result.entries; + for (var i = 0; i < entries.length; i++) { + var it = entries[i]; + var row = tb.addRow(); + tb.getCell(tb._NbRows - 1, 0).innerHTML = it[0]; + tb.getCell(tb._NbRows - 1, 1).innerHTML = it[1]; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it[2]; + row.cells[2].style.textAlign = "right"; + if (it[3] != 0.0) { + tb.getCell(tb._NbRows - 1, 3).innerHTML = it[3]; + row.cells[3].style.textAlign = "right"; + } + if (it[4] != 0.0) { + tb.getCell(tb._NbRows - 1, 4).innerHTML = it[4]; + row.cells[4].style.textAlign = "right"; + } + if (it[2] > it[3]) { + row.cells[4].style.color = "red"; + } + } + var res = response.result.solde; + $('jrnxSoldeDebit').innerHTML = res[0]; + $('jrnxSoldeCredit').innerHTML = res[1]; + $('jrnxSoldeDecompte').innerHTML = "Solde : " + res[2]; + if (parseFloat(res[2]) < 0.0) { + $('jrnxSoldeDecompte').setStyle({ color: "#FF0000" }); + } + else { + $('jrnxSoldeDecompte').setStyle({ color: "#000000" }); + } + } + ongetListeComptes(response) { + var cb = $('cbJrnxCompte'); + cb.options.length = 0; + for (var i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item['acc_id'] + "-" + item['acc_desc'], item['acc_id']); + } + var obj = this; + Prototype.Event.observe("cbJrnxCompte", 'change', function () { + obj.getEntriesByAccount(gState.Exercice, $('cbJrnxCompte').value); + }); + obj.getEntriesByAccount(gState.Exercice, $('cbJrnxCompte').value); + } + onLoaded(ht) { + console.log("DlgJrnxCompte::onLoad " + this.declaredClass); + } + onShow() { + $("iExercice").innerHTML = gState.Exercice; + } + } + Journaux.DlgJrnxCompte = DlgJrnxCompte; + Journaux.Jrnx = new DlgJrnx("pJournaux", "/app/compta/forms.php?panel=jrnx", "/app/compta/index.php"); + Journaux.JrnxCompte = new DlgJrnxCompte("pJournaux", "/app/compta/forms.php?panel=jrnx_detail", "/app/compta/index.php"); + Journaux.JrnxRecord = new DlgJrnxRecord("pJournaux", "/app/compta/forms.php?panel=jrnx_record", "/app/compta/index.php"); + Journaux.JrnxTransactions = new DlgJrnxTransactions("pJournaux", "/app/compta/forms.php?panel=jrnx_transactions", "/app/compta/index.php"); + if ($("btJnxConsulter") != null) { + Prototype.Event.observe($("btJnxConsulter"), "click", function () { + Journaux.Jrnx.show(); + Prototype.Event.observe("jrnxBook", 'change', function () { + Journaux.Jrnx.updateJrnx(); + }); + Journaux.Jrnx.updateJrnx(); + }); + } + Prototype.Event.observe($("btJnxTransactions"), "click", function () { + console.log("Presse btJnxTransactions"); + Journaux.JrnxTransactions.show(); + }); + if ($("btJnxSaisir") != null) { + Prototype.Event.observe($("btJnxSaisir"), "click", function () { + Journaux.JrnxRecord.show(); + }); + } + Prototype.Event.observe($("btJrnxC1"), "click", function () { + Journaux.JrnxCompte.show(); + Journaux.JrnxCompte.getListeComptes(1); + }); + Prototype.Event.observe($("btJrnxC2"), "click", function () { + Journaux.JrnxCompte.show(); + Journaux.JrnxCompte.getListeComptes(2); + }); + Prototype.Event.observe($("btJrnxC3"), "click", function () { + Journaux.JrnxCompte.show(); + Journaux.JrnxCompte.getListeComptes(3); + }); + Prototype.Event.observe($("btJrnxC4"), "click", function () { + Journaux.JrnxCompte.show(); + Journaux.JrnxCompte.getListeComptes(4); + }); + Prototype.Event.observe($("btJrnxC5"), "click", function () { + Journaux.JrnxCompte.show(); + Journaux.JrnxCompte.getListeComptes(5); + }); + Prototype.Event.observe($("btJrnxC6"), "click", function () { + Journaux.JrnxCompte.show(); + Journaux.JrnxCompte.getListeComptes(6); + }); + Prototype.Event.observe($("btJrnxC7"), "click", function () { + Journaux.JrnxCompte.show(); + Journaux.JrnxCompte.getListeComptes(7); + }); + Prototype.Event.observe($("btJrnxC8"), "click", function () { + Journaux.JrnxCompte.show(); + Journaux.JrnxCompte.getListeComptes(8); + }); + })(Journaux = exports.Journaux || (exports.Journaux = {})); +}); diff --git a/app/compta/journaux.xml b/app/compta/journaux.xml new file mode 100644 index 0000000..284419e --- /dev/null +++ b/app/compta/journaux.xml @@ -0,0 +1,240 @@ + + + + + + User Managment + + + + +

Administration des utilisateurs

+

+

+ +
+ + + + + Utilisateur + +
+ Her +
+ + + Plan Comptable + + 1 Comptes de capitaux + + + 2 Comptes d immobilisation + + + 3 Stock et Command + + + 4 Comptes Tiers + + + 5 Comptes Financiers + + + 6 Comptes Charges + + + 7 Comptes Produits + + + 8 Hors Comptabilite + + + 9 Comptes Analytiques + + +
+
+

Test What happens here

+ + System + + + +

+ + + Groupes + + simpe test + + + + Frogs + + Ok, + + Info Gen + + Une info: + + + + + + +
+
+
+
+ + + + + Groupes + + Strange + + authentication + +

Test Content

+ +
+
+ + alias + + display boxes : enable + + + + ssl + + display boxes: + enable + disable + + + + + +
+
+ + + Eglise + + Page de debug pour web_server. + + Yes + Vide + + + + + + T table + + Test Table Stuff + + + + + + + + + + + +
Titre du tableau
r1r2
Un test pour voird1
Un bouton +
Un test pour voird1
Un bouton +
+ End Table + +
+
+ + Calendar + + Test12 +
+ +
+
+
+ +
+
diff --git a/app/compta/jrnx.xml b/app/compta/jrnx.xml new file mode 100644 index 0000000..a393577 --- /dev/null +++ b/app/compta/jrnx.xml @@ -0,0 +1,62 @@ + + + + + + User Managment + + + + + + +

Exerice :

+ + Selection du journal + +
+ + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
DateN° CompteRéfLibelléDébitCrédit
Solde:0.00.0
+
+
+ +
+
diff --git a/app/compta/jrnxBootstrap.js b/app/compta/jrnxBootstrap.js new file mode 100644 index 0000000..1deccc2 --- /dev/null +++ b/app/compta/jrnxBootstrap.js @@ -0,0 +1,51 @@ +require.config({ + baseUrl: '../..', + urlArgs: "v=" + (new Date()).getTime() , /* For debug*/ + paths: { + "cpt" : "/app/compta", + "xgui" : "/js/xgui", + "tslib": "/js/tslib", + "proto": "/js/scriptaculus/prototype", + "" : "" + } + , + shim: { + "journaux": { + deps: [ 'cpt/Dialog' + , 'xgui/xgui_json' + , 'cpt/services'], + exports: 'Jour' + }, + "Dialog": { + deps: [ 'xgui/CtrlDialogbox' + , 'cpt/services' + ], + exports: 'Jour' + }, + "services": { + deps: [ 'xgui/xgui_json' + , 'proto'], + exports: 'Jour' + }, + "CtrlDialogbox": { + deps: [ 'proto' ], + exports: 'Jour' + } + } +}); + +require(["require", "exports" + , "tslib" + , "xgui/CtrlDialogbox" + , "cpt/services" + , "xgui/xgui_json" + , "cpt/Dialog" + , "cpt/journaux" + ], function (req,exp,ts,jso,cdlg,dlg,s,myApp) { + console.log("starting new Journaux application..."); + try { + var Jrnx = myApp.Journaux.Jrnx; + } catch (e) { + console.log("Journal Failed load ..."+e.message); + } +}); diff --git a/app/compta/jrnx_detail.xml b/app/compta/jrnx_detail.xml new file mode 100644 index 0000000..ed6556b --- /dev/null +++ b/app/compta/jrnx_detail.xml @@ -0,0 +1,62 @@ + + + + + + Détail de compte. + + + + +

Détail de compte

+

+ + + + + Compte / Exercice + +
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Compte
DateRéfDésignaionDébitCrédit
02/01/201312435Facture fioul100
05/01/201398547Charge Assurance87
06/01/2013d1Virement211
10/01/2013xc1234Charge EDF PC2 178
Solde:0.00.0
+
+ +
+
+
diff --git a/app/compta/jrnx_record.xml b/app/compta/jrnx_record.xml new file mode 100644 index 0000000..c397395 --- /dev/null +++ b/app/compta/jrnx_record.xml @@ -0,0 +1,80 @@ + + + + + + User Managment + + + + + + + + + + +

Transaction

+
+ +
+ + + +
+ +
+
+

Référence

+
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
AjouterCompteIntituléDébitCrédit
0.00.0
Solde:0.00.0
+
+ + + + +
+ +
+
diff --git a/app/compta/jrnx_trans.xml b/app/compta/jrnx_trans.xml new file mode 100644 index 0000000..8252d37 --- /dev/null +++ b/app/compta/jrnx_trans.xml @@ -0,0 +1,60 @@ + + + + + + User Managment + + + + + + + + + Transation info + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + +
DateIntituléMontant
0.0
+
+ +
+
+
diff --git a/app/compta/ledger_church.xml b/app/compta/ledger_church.xml new file mode 100644 index 0000000..29fc2e6 --- /dev/null +++ b/app/compta/ledger_church.xml @@ -0,0 +1,396 @@ + + + + + + Gestion comptable + + + + +

Gestion Comptable

+

+

+ +
+ + + + Organisation + + + + + Organisation + + + + + + + Exercice + + + + + + + + Type de compte + + + + + + + + + + + + + + + Plan + + + + + + Type de comptes + + + + + + + + + + + + + + +

Plan comptable

+ + + + + + + + + + + + + + + + + + + + + + + + +
Titre du tableau
classLibelléType
+ + Actif + Passif + Produit + Charge + Banque + + + +
1Compte de testActif + +
+ +

+
+
+
+
+ + + Fournisseurs + + + + + Facture + + + + + + + Gestion + + + + + + + + + + + +Nouvelle Facture + +
+
+ + + + + + + +
+ + + + + + +
+ + +
+ +
+ + + + + + + + + + + + Membres + + + + + Don + + + + + + Gestion + + + + + + + + + + +Don + +
+
+ + + + + + + +
+ + + +
+ + +
+ +
+ + + + + + + + + + + + Eglise + + + + + Membres + + + + + + + Gestion + + + + + + + +

Status

+
+
+
+
+ + Bilan + + + + Exercice + + + + + + + + + + + + + +
Bilan de L'exercice
CompteLibelleDebitCreditSolde
10Immoblisation000
+
+ +
+
+ + Trésorier + + +

Information Générales sur le trésorier

+
+ + General + +
+ +
+ + +
+ + +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + diff --git a/app/compta/ledger_create.xml b/app/compta/ledger_create.xml new file mode 100644 index 0000000..c429238 --- /dev/null +++ b/app/compta/ledger_create.xml @@ -0,0 +1,179 @@ + + + + + + + Wizard pour la creation d'un environnement de compta + + + + +

Création

+

+

+ +
+ + + + + Organisation + + + + + + +

Information sur l'organisation

+ + + Organisation + +
+
+
+ +
+ +
+ +
+
+ +
+
+

+ +
+
+
+
+ + + + + Plan Comptable + + + Organisation + +

Creation de l'organisation...

+
+
+ + Base de donnée + +

Creation de la base de donnée

+
+
+ + Plan comptable + +

Creation du plan comptable initiale

+
+
+ +
+
+ + + Poste charges creation + +

Creation des postes charges

+ + +
+
+ + Import des lots + +

Importation des lots au format csv

+

Nom du Lot; superficie; PC1 ; PC2 ; PC 3; PC4;

+ + Yes + Vide + + +
+
+ + + Calendar + + Test12 +
+ +
+
+
+ + +
+ +
diff --git a/app/compta/ledger_syndic.xml b/app/compta/ledger_syndic.xml new file mode 100644 index 0000000..9a6a835 --- /dev/null +++ b/app/compta/ledger_syndic.xml @@ -0,0 +1,538 @@ + + + + + + Gestion comptable + + + + +

Gestion Comptable :

+ + + + + Copropriété + + + + + Organisation + + + + + + + Exercice + + + + + + + + Lots + + + + + + + Clé de charges + + + + + + + + + + + + + +

Les organisations dont vous faites partie

+
+
+
+
+
+
+ + + + Plan + + + + + Type de comptes + + + + + + + + + + + + +

Plan comptable

+ + + + + + + + + + + + + + + + + + + + + + + + +
Titre du tableau
classLibelléType
+ + Actif + Passif + Produit + Charge + Banque + + + +
1Compte de testActif + +
+ +

+
+
+
+
+ + + Fournisseurs + + + + + + + Facture + + + + + + + Gestion + + + + + + + + + + + + + + Nouvelle Facture + +
+
+ + + + + + + +
+ + + + + + +
+ + +
+ +
+ + + + + + + + + + + + + + Coproprietaires + + + + + Fonds + + + + + + + + Gestion des Tiers + + + + + + + + + + + + +Versement + +
+
+ + + + + + + +
+ + + +
+ + +
+ +
+ + + + + + + + + + + + + + + + Journaux + + + + + journaux + + + + + + + Détail Comptes + + + + + + + + + + + + + Selection du journal + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + +
DateN° CompteRéfLibelléDébitCrédit
Solde:0.00.0
+
+
+ +
+
+
+
+ + Bilan + + + + Exercice + + + + + + + + + + + + + + + + + +
Bilan de L'exercice
CompteLibelleDebitCreditSolde
10Immoblisation000
+
+ +
+
+ + + + Budget + + + + + Budget + + + + + + + + + Nouveau + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + +
AnnéeLibellé
+
+ + + + + + + + + + + + + + + + + diff --git a/app/compta/logging.php b/app/compta/logging.php new file mode 100644 index 0000000..33fc8ee --- /dev/null +++ b/app/compta/logging.php @@ -0,0 +1,120 @@ +log_file = $path; + $this->lopen(); + } + } + /** + * + */ + function __destruct() { + if ( is_resource($this->fp) ) { + $this->lclose(); + } + } + + /** + * @brief computer the right file name for logging. + * Mainly databaseName should be used + * + */ + static function &getLogger($_log_file ) { + if (Logging::$logger == null) { + global $conf; + if ( isset($conf['datadir']) ) + { + $default_path = $conf['datadir']; + } else + $default_path = dirname(__FILE__)."/logs/"; + Logging::$logger = new Logging($default_path.$_log_file); + } + return Logging::$logger; + } + + /** + * + */ + public function logDebug($message) { + } + /** + * + */ + public function logError($message) { + // Log an error somewhere else then apache log file + if ( ! is_resource($this->fp) ) { + $this->lopen(); + } + $script_name = pathinfo($_SERVER['PHP_SELF'],PATHINFO_FILENAME); + $time = @date('[d/M/Y:H:i:s]'); + fwrite($this->fp,"".$time." (".$script_name.") ".$message.PHP_EOL); + } + /** + * + */ + public function logInfo($message) { + // Log information + if ( ! is_resource($this->fp) ) { + $this->lopen(); + } + $script_name = pathinfo($_SERVER['PHP_SELF'],PATHINFO_FILENAME); + $time = @date('[d/M/Y:H:i:s]'); + fwrite($this->fp,"".$time." (".$script_name.") ".$message.PHP_EOL); + } + + /** + * + */ + public function logTransaction($title,$message) { + // Log financial transaction + if ( ! is_resource($this->fp) ) { + $this->lopen(); + } + + $script_name = pathinfo($_SERVER['PHP_SELF'],PATHINFO_FILENAME); + $time = @date('[d/M/Y:H:i:s]'); + fwrite($this->fp,"-- ".$time." (".$script_name.") ".$title.PHP_EOL); + fwrite($this->fp," ".$message.PHP_EOL); + } + + /** + * + */ + private function lopen() { + if (strtoupper(substr(PHP_OS,0,3)) === 'WIN') { + $log_file_default = 'c://tmp/aebwww.log'; + } else { + $log_file_default = '/tmp/aebwww.log'; + } + $lfile = $this->log_file ? $this->log_file : $log_file_default; + + $this->fp = fopen($lfile,'a') or error_log("Logging can't open file : ".$this->log_file); + + } + + /** + * + */ + public function lclose() { + fclose($this->fp); + } + +} +?> diff --git a/app/compta/lot.xml b/app/compta/lot.xml new file mode 100644 index 0000000..1a6cfd2 --- /dev/null +++ b/app/compta/lot.xml @@ -0,0 +1,121 @@ + + + + + + User Managment + + + + + + + + Nouveau Lot + +
+
+ + + + + + +
+ +
+ +
+ +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + +
N°NameBatEtgPorteTypeSurf.
+
+
+ +
+
diff --git a/app/compta/lot_attribuer.xml b/app/compta/lot_attribuer.xml new file mode 100644 index 0000000..a57d4fa --- /dev/null +++ b/app/compta/lot_attribuer.xml @@ -0,0 +1,51 @@ + + + + + + User Managment + + + + + + + + Selection Copropriétaire + +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + +
NuméroNom du lotSel
+
+
+ +
+
diff --git a/app/compta/lot_charge.xml b/app/compta/lot_charge.xml new file mode 100644 index 0000000..7044fc6 --- /dev/null +++ b/app/compta/lot_charge.xml @@ -0,0 +1,125 @@ + + + + + + User Managment + + + + + + + +

Création d'un nouveau type de charges

+ + Nouveau Poste de Charge + +
+
+ +
+ + + + +
+
+
+ +

Selection du Poste de Charge pour affectation des Tantiemes

+ + Selection Poste pour affecation + +
+ + + + + + +
+
+
+
+ +

Affectation Tantieme

+ + + + + + + + + + + + + + + +
N° LotTantieme
Total:
+
+
+ +
+
diff --git a/app/compta/lots.js b/app/compta/lots.js new file mode 100644 index 0000000..1def011 --- /dev/null +++ b/app/compta/lots.js @@ -0,0 +1,334 @@ +define(["require", "exports", "./Dialog", "./services"], function (require, exports, Dialog_1, services_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Copropriete; + (function (Copropriete) { + class DlgLot extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + console.log("DlgLot constructor"); + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._pcmn = new services_1.Services.PlanComptable(req); + this._user = new services_1.Services.Users(req); + this._lots = new services_1.Services.Lots(req); + this.tableLots = function () { + return new AEBW.control.table('table_lots'); + }; + } + onDummy(response) { + alert("DlgLot::Dummy Error" + response); + } + onDummyFail() { + alert("DlgLot::Dummy Error"); + } + getLots() { + var bindFct = this.ongetLots.bind(this); + super.getLots(bindFct, this.onDummyFail); + } + ongetLots(response) { + console.log("DlgLot::ongetLots"); + var tb = this.tableLots(); + var obj = this; + super.cleanTable(tb, tb._NbRows); + for (var i = 0; i < response.result.length; i++) { + var it = response.result[i]; + tb.addRow(); + tb.getCell(tb._NbRows - 1, 0).innerHTML = ""; + tb.getCell(tb._NbRows - 1, 0).setAttribute('record', it[0]); + tb.getCell(tb._NbRows - 1, 0).onclick = function () { + alert('Remove ' + this.getAttribute('record')); + obj.removeLot(this.getAttribute('record')); + }; + tb.getCell(tb._NbRows - 1, 1).innerHTML = it['0']; + tb.getCell(tb._NbRows - 1, 1).onclick = function () { alert('Cliked '); }; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it['4']; + tb.getCell(tb._NbRows - 1, 3).innerHTML = it['6']; + tb.getCell(tb._NbRows - 1, 4).innerHTML = it['1']; + tb.getCell(tb._NbRows - 1, 5).innerHTML = it['7']; + tb.getCell(tb._NbRows - 1, 6).innerHTML = it['5']; + tb.getCell(tb._NbRows - 1, 7).innerHTML = it['2']; + } + } + addLot() { + if ($('lot_size').value == '') { + $('lot_size').value = '0'; + } + if ($('lot_number').value == '') { + $('lot_number').value = '0'; + } + var _params = new services_1.Services.ReqHeightParams($('lot_number').value, $('lot_type').value, $('lot_building').value, $('lot_floor').value, $('lot_door').value, $('lot_size').value, $('lot_name').value, $('lot_desc').value); + let bindFct = this.onaddLot.bind(this); + this._lots.add(_params, bindFct, this.onDummyFail); + } + onaddLot(response) { + var bindFct = this.ongetLots.bind(this); + super.getLots(bindFct, this.onDummyFail); + } + removeLot(lotnum) { + var params = { + 'number': lotnum + }; + var obj = this; + var url = this.Url(); + var Req = new AEBW.Json(url); + Req.handlefct('syndic', 'removeLot', params, function (response) { obj.onremoveLot(response); }, function () { alert("Failed removeLot"); }); + } + onremoveLot(response) { + var bindFct = this.ongetLots.bind(this); + super.getLots(bindFct, this.onDummyFail); + } + onShow() { + Prototype.Event.observe($('btLotCancel'), "click", function (evt) { + var elt = evt.target || evt.srcElement; + console.log("Lot Cancel I should go to coprote"); + try { + } + catch (e) { + console.log("Lot.Cancel ..." + e.message); + } + }); + } + onLoaded(_html) { + } + } + Copropriete.DlgLot = DlgLot; + ; + class DlgLotCharge extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + console.log("DlgLotCharge constructor"); + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._pcmn = new services_1.Services.PlanComptable(req); + this._user = new services_1.Services.Users(req); + this._tbe = null; + this.tableLots = function () { + console.log("DlgLotCharge::tableLots " + this._tbe); + return this._tbe; + }; + } + onDummy(response) { + alert("DlgCharge::Dummy Error" + response); + } + onDummyFail() { + alert("DlgCharge::Dummy Error"); + } + getKeysCharge(charge) { + var bindFct = this.ongetKeysCharge.bind(this); + super.getKeysCharge(bindFct, this.onDummy); + } + ongetKeysCharge(response) { + var cb = $('lot_charge_sel'); + cb.options.length = 0; + for (var i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item[1] + "-" + item[2], item[0]); + } + this.getLotsTantieme(cb.value); + } + getLotsTantieme(chrg) { + var params = { 'charge': chrg }; + var obj = this; + var url = this.Url(); + this._charge = chrg; + var SupplReq = new AEBW.Json(url); + SupplReq.handlefct('syndic', 'getTantieme', params, function (response) { obj.ongetLotsTantieme(response); }, function () { alert("Failed getLots"); }); + } + ongetLotsTantieme(response) { + console.log("ongetLotsTantieme"); + var tb = this.tableLots(); + var total = 0; + if (tb != null) { + this.cleanTable(tb, tb._NbRows); + } + tb.eraseAllRows(); + for (var i = 0; i < response.result.length; i++) { + var it = response.result[i]; + tb.addRow(); + tb.getCell(tb._NbRows - 1, 0).innerHTML = ""; + tb.getCell(tb._NbRows - 1, 0).setAttribute('record', it[0]); + tb.getCell(tb._NbRows - 1, 1).innerHTML = it['1']; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it[2]; + tb.getCell(tb._NbRows - 1, 2).setAttribute('tant_id', it[0]); + tb.getCell(tb._NbRows - 1, 2).setAttribute('lot_num', it[1]); + total += parseFloat(it[2]); + } + $("charge_total").innerHTML = total; + } + setTantieme(tan_id, lot_num, tantieme) { + var params = { + 'tant_id': tan_id, + 'charge_id': this._charge, + 'lot_num': lot_num, + 'tant': tantieme + }; + var obj = this; + var url = this.Url(); + var Req = new AEBW.Json(url); + Req.handlefct('syndic', 'setTantieme', params, function (response) { obj.onSetTantieme(response); }, function () { alert("Failed setTantieme"); }); + } + onSetTantieme(response) { + this.getLotsTantieme(this._charge); + } + setCharge(id, name, desc) { + var params = { + 'id': id, + 'name': name, + 'desc': desc + }; + var obj = this; + var url = this.Url(); + var Req = new AEBW.Json(url); + Req.handlefct('syndic', 'updateKeyCharge', params, function (response) { obj.onSetCharge(response); }, function () { alert("Failed cree ou mise à jour d'un poste"); }); + } + onSetCharge(response) { + var bindFct = this.ongetKeysCharge.bind(this); + super.getKeysCharge(bindFct, this.onDummyFail); + } + onShow() { + this._tbe = new AEBW.control.table('table_lots'); + var obj = this; + console.log("DlgLotCharge::onShow mixin _tbe onSelectCell"); + AEBW.mixin(obj._tbe, { + onSelectCell(elem, row, col) { + if (col == 3 && (elem.getAttribute('state') == 'RD')) { + elem.setAttribute('state', 'WR'); + var value = elem.innerHTML; + var inp = document.createElement('input'); + inp.setAttribute('type', 'text'); + inp.setAttribute('value', value); + inp.onkeypress = function (_event) { + var evt = _event || window.event; + if (evt.keyCode == Prototype.Event.KEY_RETURN) { + var amount = inp.value; + elem.innerHTML = inp.value; + elem.setAttribute('state', 'RD'); + obj.setTantieme(elem.getAttribute('tant_id'), elem.getAttribute('lot_num'), amount); + } + }; + elem.innerHTML = ""; + elem.appendChild(inp); + } + } + }); + Prototype.Event.observe($('btLotChargeAdd'), "click", function (evt) { + obj.setCharge(0, $("lot_chrg_name").value, $("lot_chrg_desc")); + }); + Prototype.Event.observe("lot_charge_sel", 'change', function (evt) { + obj.getLotsTantieme(this.value); + }); + } + } + Copropriete.DlgLotCharge = DlgLotCharge; + class DlgLotAttribuer extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + console.log("DlgLotAttribuer constructor"); + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._pcmn = new services_1.Services.PlanComptable(req); + this._user = new services_1.Services.Users(req); + this._tbe = null; + this._cUser = 0; + this.table = function () { return this._tbe; }; + } + onDummy(response) { + alert("DlgLot::Dummy Error" + response); + } + onDummyFail() { + alert("DlgLot::Dummy Error"); + } + getUsers() { + var params = { 'org_id': 0 }; + var obj = this; + var url = this.Url(); + var Req = new AEBW.Json(url); + Req.handlefct('ident', 'getCoproprietaires', params, function (response) { obj.onGetUsers(response); }, function () { alert("Failed getEntetien"); }); + } + onGetUsers(response) { + var tb = this.table(); + tb.eraseAllRows(); + var entries = response.result; + var cb = $('cbLotUser'); + cb.options.length = 0; + for (var i = 0; i < response.result.length; i++) { + var item = response.result[i]; + if (i == 0) { + this.getLotsUser(item[0]); + } + cb.options[cb.options.length] = new Option(item[1] + "-" + item[2], item[0]); + } + } + getLotsUser(user) { + var params = { 'uid': user }; + var obj = this; + var url = this.Url(); + var Req = new AEBW.Json(url); + console.log("DlgLotAttribuer::getLotsUser .. " + user); + Req.handlefct('syndic', 'getLotsUser', params, function (response) { obj.onGetLotsUser(response); }, function () { alert("Failed getLotsUser"); }); + } + onGetLotsUser(response) { + console.log("DlgLotAttribuer::onGetLotsUser result length=" + response.result.length); + var tb = this.table(); + if (tb == null) { + alert("onGetLotsUser table is null"); + } + tb.eraseAllRows(); + var entries = response.result; + for (var i = 0; i < entries.length; i++) { + var it = entries[i]; + var row = tb.addRow(); + tb.getCell(tb._NbRows - 1, 0).innerHTML = it[0]; + tb.getCell(tb._NbRows - 1, 1).innerHTML = it[2]; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it[3]; + this.fillCheckboxInCell(tb.getCell(tb._NbRows - 1, 3), it); + } + } + fillCheckboxInCell(cell, entry) { + try { + var ip = document.createElement('input'); + ip.setAttribute('type', 'checkbox'); + ip.setAttribute("lo_id", entry[0]); + ip.setAttribute("lot", entry[1]); + var obj = this; + Prototype.Event.observe(ip, 'change', function (evt) { + var elt = evt.target || evt.srcElement; + console.log("DlgLotAttributer... Select input changed"); + obj.toggleAssign(elt.checked, elt.getAttribute('lo_id'), elt.getAttribute('lot')); + }); + console.log("fillCheckboxInCell it[0]=" + entry[0]); + if (parseInt(entry[0]) == 0) { + ip.checked = false; + } + else { + ip.checked = true; + } + cell.appendChild(ip); + } + catch (e) { + console.log("DlgLotAttribute::fillCheckboxCell " + e.message); + } + } + toggleAssign(_check, _lo_id, _lot) { + var _cb = $('cbLotUser'); + var _user = _cb.options[_cb.selectedIndex].value; + var _param = new services_1.Services.ReqFourParams(_lo_id, _lot, _user, _check.toString()); + console.log("DlgLotAttribuer::toggleAssign ... lo_id " + _lo_id + " lt=" + _lot + " "); + let bindFct = this.onAssignLot.bind(this); + this._lots.assignToUser(_param, bindFct, this.onDummyFail); + } + onAssignLot(response) { + console.log("DlgLotAttribuer::onAssignLot "); + } + onShow() { + console.log("DlgLotAttribuer::onShow ..creates a new table !!!"); + var obj = this; + this._tbe = new AEBW.control.table('lot_attribuer_edit'); + this.getUsers(); + Prototype.Event.observe($('cbLotUser'), "change", function (evt) { + var elt = evt.target || evt.srcElement; + obj.getLotsUser($('cbLotUser').value); + }); + } + } + Copropriete.DlgLotAttribuer = DlgLotAttribuer; + })(Copropriete = exports.Copropriete || (exports.Copropriete = {})); +}); diff --git a/app/compta/models/account.php b/app/compta/models/account.php new file mode 100644 index 0000000..d62183f --- /dev/null +++ b/app/compta/models/account.php @@ -0,0 +1,61 @@ +_session = $_sess; + $this->_auth_cfg = $_auth; + } + + private function getSession() + { + return $this->_session; + } + public function getDetails($_id) + { + $_cfg = $this->_auth_cfg; + $pcmn = new \Retrieve( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $r = $pcmn->getEntriesByAccount( + $this->getSession()->getCurrentExercice() + , $_id + , ""); // Get Banks accounts + $this->_id = $_id; + $this->_mouvements = $r['entries']; + $this->_solde = $r['solde']; + } + + /** + * Required by JsonSerializable + */ + public function jsonSerialize() + { + return [ + 'account' => $this->_summary + , 'entries' => $this->_mouvements]; + } + +} +?> diff --git a/app/compta/models/bank.php b/app/compta/models/bank.php new file mode 100644 index 0000000..7727c8e --- /dev/null +++ b/app/compta/models/bank.php @@ -0,0 +1,58 @@ +_session = $_sess; + $this->_auth_cfg = $_auth; + } + + public function onMouvement($type,$date,$montant,$reste,$libelle,$info) + { + // error_log("Mvment: ".$type." ".$date." ".$montant."\n"); + } + + private function getSession() + { + return $this->_session; + } + + public function getAccounts() + { + $_cfg = $this->_auth_cfg; + $pcmn = new \Pcmn( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $pcmn->getAccountList("51"); // Get Banks accounts + } + /** + * Required by JsonSerializable + */ + public function jsonSerialize() + { + return [ + 'transi' => $this->_summary + , 'entries' => $this->_entries]; + } + +} +?> diff --git a/app/compta/models/budget.php b/app/compta/models/budget.php new file mode 100644 index 0000000..5063599 --- /dev/null +++ b/app/compta/models/budget.php @@ -0,0 +1,48 @@ +_session = $_sess; + $this->_auth_cfg = $_auth; + } + + private function getSession() + { + return $this->_session; + } + /** + * Required by JsonSerializable + */ + public function jsonSerialize() + { + return [ + 'transi' => $this->_summary + , 'entries' => $this->_entries]; + } + +} +?> diff --git a/app/compta/models/loan.php b/app/compta/models/loan.php new file mode 100644 index 0000000..16afa35 --- /dev/null +++ b/app/compta/models/loan.php @@ -0,0 +1,121 @@ +_session = $_sess; + $this->_auth = $_auth; + $this->loan = new \Loan( $this->getSession() + , $_auth + , $this->getSession()->getDb()); + } + + private function getSession() + { + return $this->_session; + } + /** + * @brief pay the loan for this month + * @return Array('trans_id') in case of success or empty Array() in case of failure + */ + private function payLoan($id,$lp) + { + $_cfg = $this->_auth; + $book = new \Booking( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $trans = Array("trans_label" => "Remboursement prêt N°".$id + ,"voucher_date" => $lp[6] + ,"act_trans_date" => $lp[6] + ); + $entries = Array( + "0" => Array("acc_id" => $lp[2] , "entry_type"=> "BQ" ,"amount" => $lp[7], "dc" => "c", "key_charge" => "1") + ,"1" => Array("acc_id" => $lp[3] , "entry_type"=> "BQ" ,"amount" => $lp[8], "dc" => "d", "key_charge" => "1") + ,"2" => Array("acc_id" => $lp[4] , "entry_type"=> "BQ" ,"amount" => $lp[9], "dc" => "d", "key_charge" => "1") + ); + try { + return $book->postTransaction($trans,$entries); + } catch (Exception $e) + { + return Array(); + } + } + + /** + * + * + */ + public function payer($id,$lei) + { + $loan = $this->loan; + + $this->lp = $loan->getNextPayement($id); + + $result = $this->payLoan($id,$this->lp); + + if (isset($result['trans_id'])) + { // Success book the entry + $loan->markBooked($lei); + } + } + + /** + * + * + */ + public function getSummary($id) + { + $loan = $this->loan; + $lst = $loan->getSummary($id); + return $lst; + } + + /** + * + * + */ + public function getNextPayement($id) + { + $loan = $this->loan; + $this->lp = $loan->getNextPayement($id); + return $this->lp; + } + + /** + * Required by JsonSerializable + * TODO + */ + public function jsonSerialize() + { + return [ + 'id' => $this->id + , 'entries' => $this->desc]; + } + +} +?> diff --git a/app/compta/models/lot.php b/app/compta/models/lot.php new file mode 100644 index 0000000..b3f02e7 --- /dev/null +++ b/app/compta/models/lot.php @@ -0,0 +1,65 @@ +_session = $_sess; + $this->_auth_cfg = $_auth; + } + + private function getSession() + { + return $this->_session; + } + /** + * @brief get the details of a recurrent entry. + * + */ + public function getLots() + { + $_cfg = $this->_auth_cfg; + $rec = new \Syndic( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $this->lst = $rec->getLots(); + return [ 'lst' => $this->lst]; + } + + /** + * Required by JsonSerializable + */ + public function jsonSerialize() + { + return [ + 'transi' => $this->_summary + , 'entries' => $this->_entries]; + } + +} + + +?> diff --git a/app/compta/models/recurrent.php b/app/compta/models/recurrent.php new file mode 100644 index 0000000..f83d64b --- /dev/null +++ b/app/compta/models/recurrent.php @@ -0,0 +1,119 @@ +_session = $_sess; + $this->_auth_cfg = $_auth; + } + + private function getSession() + { + return $this->_session; + } + + public function isPayed() + { + return $this->_payer; + } + /** + * @brief pay a recurrent entry for this month + * @return Array('trans_id') in case of success or empty Array() in case of failure + */ + private function pay($id,$lp) + { + $_cfg = $this->_auth_cfg; + $entries = array(); + $book = new \Booking( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $trans = Array("trans_label" => "Payement ".$lp[0][2] + ,"voucher_date" => $lp[0][1] + ,"act_trans_date" => $lp[0][1]); + foreach($lp as $e ) + { + $entries[] = Array("acc_id" => $e[5] , "entry_type"=> $e[3] ,"amount" => $e[6], "dc" => $e[4], "key_charge" => "1"); + } + try { + return $book->postTransaction($trans,$entries); + } catch (Exception $e) + { + error_log("Failed pay:".$e->message()); + return Array(); + } + } + /** + * @brief paye the available recurrent entry + */ + public function payer($id) + { + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lp = $rec->getNextPayement($id); + $result = $this->pay($id,$lp); + if (isset($result['trans_id'])) + { // Success book the entry + $rec->markBooked($id); + $this->_payer = true; + $this->lp = $lp; + $this->id = $id; + } else + { + error_log("Failed payer : unknown reason"); + } + } + + /** + * @brief get the details of a recurrent entry. + * + */ + public function get($id) + { + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $this->id = $id; + $this->des = $rec->get($id); + $this->lst = $rec->getSummary($id); + return [ 'des' => $this->des, 'lst' => $this->lst]; + } + + /** + * Required by JsonSerializable + */ + public function jsonSerialize() + { + return [ + 'transi' => $this->_summary + , 'entries' => $this->_entries]; + } +} + +?> diff --git a/app/compta/models/transaction.php b/app/compta/models/transaction.php new file mode 100644 index 0000000..34cfcec --- /dev/null +++ b/app/compta/models/transaction.php @@ -0,0 +1,33 @@ + $this->_summary + , 'entries' => $this->_entries]; + } +} + +?> diff --git a/app/compta/page_ledger.php b/app/compta/page_ledger.php new file mode 100644 index 0000000..287c323 --- /dev/null +++ b/app/compta/page_ledger.php @@ -0,0 +1,286 @@ +conf_auth = $conf['auth']['mysql']; + $this->_retrieve = new Retrieve( $this->session + , $this->conf_auth + , $this->session->getDb()); + } + + private function article($title,$img="iu-copro.jpg",$_content="") { + $_scheme = $this->request->getScheme(); + $root= $_scheme."".$this->request->getServerHost()."/".$this->alias."/images/accounting"; + $lnk = $_scheme."".$this->request->getServerHost()."/".$this->link($title); + echo '
'; + echo '
'; + echo "".$title."\n"; + echo '
'; + echo '
'; + echo ""; + $c=<< + et encore da tatrtre ertr rete
+ Il reste a comprendre la position de l'image
+EOF; + if ($_content !="") { + echo $_content; + } else + echo $c; + echo '
'; + echo '
'; + } + /** + * @brief Display most important information before + * showing the services. + * If syndic : Bank state and those owner that are negatif + */ + private function synthese() + { + if ( $this->session->in_groupe(COMPTA_SYNDIC) ) + { + $retrieve = $this->_retrieve; + $res = $retrieve->getSoldeBank(); + $solde = $res[0][2] * -1.0; + $_text =<<<_EOF +

Sur l'exerice {$this->session->getCurrentExercice()}, vous disposez en banque de {$solde} €

+_EOF; + echo $_text; + } else { + echo "

Vous disposez en banque de xxxx.€

"; + } + } + + /** + * + */ + private function plan_comptable() { + $_content =<< +Selectionner le plan comptable
+Associer les comptes au plan
+EOF; + + $this->article(_("Plan Comptable"),"iu-plan-comptable.jpg",$_content); + } + /** + * + */ + private function exercice() { + $_content =<<session->getCurrentExercice()}
+Gérer la création, l'ouverture
+les clotures des exercices
+EOF; + + $this->article(_("Exercices"),"iu-exercice.jpg",$_content); + } + /** + * + */ + private function fournisseurs() { + $_content =<< +les factures,
+les règlements.
+EOF; + $this->article(_("Fournisseurs"),"iu-fournisseur.jpg",$_content); + + } + /** + * + */ + private function prets() { + $_content =<<prêts, opération recurrentes
+création,détails
+les règlements.
+EOF; + $this->article(_("Prêts"),"iu-coproprietaire.jpg",$_content); + + } + /** + * + */ + private function journaux() { + $_content =<< +Saisir des transactions
+
+EOF; + $this->article(_("Journaux"),"iu-journaux.jpg",$_content); + + } + /** + * + */ + private function budget() { + $_content =<< +Créer un budget
+
+EOF; + $this->article(_("Budget"),"iu-budget.jpg",$_content); + + } + /** + * + */ + private function copropriete() { + $_content = ""; + $o = $this->session->getOrganization(); + if ($o != null) { + $_content =<< +{$o[1]}
+{$o[2]} {$o[3]} +EOF; + } else { + $_content =<< +Créer votre organisation..
+Joindre une organisation existante ?
+EOF; + } + + $this->article(_("Copropriété"),"iu-bilan.jpg",$_content); + } + /** + * @brief Fill bilan with usefull info that will + * prevent me from opening the box. + * A link to the report ... + * A ling to General assembly report + */ + function bilan() { + $ex = new Exercice( $this->session + , $this->conf_auth + , $this->session->getDb()); + $last_closed = $ex->getClosed(true); + $_content = ""; + if ( ! is_array($last_closed)) { + $_content =<<<__EOF +Pas d'exerice clos pour l'instant
+Procès verbal de la dernière AG +__EOF; + } else if (!is_array($last_closed[0] )) + { + $_content =<<<__EOF +Pas d'exerice clos pour l'instant
+Procès verbal de la dernière AG +__EOF; + } else{ + $_content =<<<__EOF +Bilan ({$last_closed[0][3]}), dernier exercice clos
+Procès verbal de la dernière AG +__EOF; + } + $this->article(_("Bilan"),"iu-bilan.jpg",$_content); + + } + + private function decompte($title) + { + $retrieve = $this->_retrieve; + $res = $retrieve->getSoldeCharge(); + $compte = $retrieve->getAccount($this->session->id()); + $_content =<<<_EOF +Les charges latentes: {$res[1]} €
+Le solde du compte :
+Télécharger +_EOF; + $this->article($title,"iu-coproprietaire.jpg",$_content); + } + + private function administration() + { + $_content=<<<_EOF +Aperçu de la version
+Le parametrage de la base
+Utile pour controler l'évolution de l'application
+_EOF; + $this->article(_("Administration"),"iu-coproprietaire.jpg",$_content); + } + + private function main_syndic() + { + $this->synthese(); + /** + * filter out available services depending on + */ + if (! $this->session->in_groupe(COMPTA_SYNDIC) ) { + // Regular users services + $this->copropriete(); + $this->decompte(_("Décompte Charge")); + $this->bilan(); + } else { + // Syndic services + $this->copropriete(); + $this->plan_comptable(); + $this->exercice(); + $this->fournisseurs(); + $this->decompte(_("Copropriétaires")); + $this->journaux(); + $this->bilan(); + $this->budget(); + } + } + private function main_tpe() + { + $this->synthese(); + /** + * filter out available services depending on + */ + // Syndic services + $this->copropriete(); + $this->plan_comptable(); + $this->exercice(); + $this->fournisseurs(); + $this->prets(); + $this->journaux(); + $this->bilan(); + $this->budget(); + $this->administration(); + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() + { + $compta = $this->_retrieve->baseType(); + echo '
'; + if ($compta == "tpe") + { + $this->main_tpe(); + } + else + { // Default is always syndic + $this->main_syndic(); + } + echo '
'; + } +} + +$page = new Compta(); + +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +/* + * vim:et:sw=2:list: + */ +?> diff --git a/app/compta/page_ledger_coproprietaire.php b/app/compta/page_ledger_coproprietaire.php new file mode 100644 index 0000000..969fb25 --- /dev/null +++ b/app/compta/page_ledger_coproprietaire.php @@ -0,0 +1,129 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + + + + + + +

Chargement ...

+
+ + + +
+
+XML; + + +/** + * @brief + */ +class PageJournaux extends PageCompta +{ + function __construct() + { + parent::__construct("",true); + } + + public function main() + { + } +}; + +/* Main entry point */ +$page = new PageCompta($XmlComptaBudget,true); + +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +?> diff --git a/app/compta/page_ledger_entretien.php b/app/compta/page_ledger_entretien.php new file mode 100644 index 0000000..26aeb3e --- /dev/null +++ b/app/compta/page_ledger_entretien.php @@ -0,0 +1,84 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + Nouveau + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + +
AnnéeLibellé
+
+ + + + + + + + +XML; + +$_default_file = "ledger_syndic.xml"; +$page = new PageCompta($XmlComptaBudget,true); + +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +?> diff --git a/app/compta/page_ledger_exercice.php b/app/compta/page_ledger_exercice.php new file mode 100644 index 0000000..05a8b4a --- /dev/null +++ b/app/compta/page_ledger_exercice.php @@ -0,0 +1,85 @@ + + + + + +Gestion comptable + + + + + + + + + + + + +

Gestion Des Exercices :

+ + + + Nouvel Exercice + +
+
+
+
+
+ +
+ + + + + +

Les exerices

+ + + + + + + + + + + + + + +
StatusExerciceDate de DébutDate de FinAction
+
+ +

Cloture de compte

+
+ + + + + + + + +XML; + +$_default_file = "ledger_syndic.xml"; +$page = new PageCompta($XmlComptaExercice,true); + +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +?> diff --git a/app/compta/page_ledger_fournisseur.php b/app/compta/page_ledger_fournisseur.php new file mode 100644 index 0000000..3250501 --- /dev/null +++ b/app/compta/page_ledger_fournisseur.php @@ -0,0 +1,53 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + +

Loading...

+
+ + + +
+
+XML; + +$_default_file = "ledger_syndic.xml"; +$page = new PageCompta($XmlComptaBudget,true); + +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +?> diff --git a/app/compta/page_ledger_journaux.php b/app/compta/page_ledger_journaux.php new file mode 100644 index 0000000..54edffc --- /dev/null +++ b/app/compta/page_ledger_journaux.php @@ -0,0 +1,85 @@ + + + + + + Gestion comptable + + + + + + + + + + + + + + + + + + + + + + + + + Sélection du journal + +
+ + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
DateN° CompteRéfLibelléDébitCrédit
Solde:0.00.0
+
+
+
+ + +
+
+XML; + +$page = new PageCompta($XmlComptaBudget,true); +$page->setTitle("Journal"); +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +?> diff --git a/app/compta/page_ledger_mes_documents.php b/app/compta/page_ledger_mes_documents.php new file mode 100644 index 0000000..6c5ed07 --- /dev/null +++ b/app/compta/page_ledger_mes_documents.php @@ -0,0 +1,94 @@ + + + + + +Gestion comptable + + + + + + + + + + + + +

Chargement ...

+
+ + + +
+
+XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class PageMesDocuments extends PageCompta { + + function __construct($s,$b) + { + parent::__construct($s,$b); + } + + private function decompte($period) + { + $_scheme = $this->request->getScheme(); + $root = $_scheme."".$this->request->getServerHost()."/".$this->alias."/app/compta/reports/decompte_charge.php?period="; + echo '
  • Décompte de charge '.$period.'
  • '; + } + private function documents() + { + $_cfg = $this->_auth_cfg; + $ex = new Exercice( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $syndic = new Syndic( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $acc = $syndic->getCoproprietaires(0); + $p = $ex->getClosed(false); + echo "
      "; + foreach ($p as $doc) + { + $this->decompte($doc[3]); + } + echo "
    "; + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() { + echo '
    '; + echo "

    Vos décomptes de charge

    "; + $this->documents(); + echo '
    '; + } +} + +$page = new PageMesDocuments($XmlComptaDocuments,true); + +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +?> diff --git a/app/compta/page_ledger_plan_comptable.php b/app/compta/page_ledger_plan_comptable.php new file mode 100644 index 0000000..edec8ea --- /dev/null +++ b/app/compta/page_ledger_plan_comptable.php @@ -0,0 +1,111 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + + +

    Plan comptable

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Titre du tableau
    classLibelléType
    + + +
    1Compte de testActif + +
    +

    + +
    + +
    +
    +XML; + +$_default_file = "ledger_syndic.xml"; +$page = new PageCompta($XmlComptaBudget,true); + +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +?> diff --git a/app/compta/page_ledger_syndic.php b/app/compta/page_ledger_syndic.php new file mode 100644 index 0000000..7db6859 --- /dev/null +++ b/app/compta/page_ledger_syndic.php @@ -0,0 +1,26 @@ +showEmbeddedXML($frame[$app][$panel]); + } +} else { + $page->show(); +} + +?> diff --git a/app/compta/pages.php b/app/compta/pages.php new file mode 100644 index 0000000..292d471 --- /dev/null +++ b/app/compta/pages.php @@ -0,0 +1,127 @@ +conf_auth = $conf_auth; + $s = new SessionCompta($conf_auth,$conf_auth['req_file']); + parent::__construct($s); + $namespace = ""; + $this->file = $_file; + $this->use_string = $_from_string; + $this->xp = new XsltProcessor(); + $xsl = new DomDocument; + $xsl->load(dirname(__FILE__).'/../xsl/gui.xsl'); + $this->xp->importStylesheet($xsl); + $params['site'] = "_xgui"; + $params["lang"] = "fr"; + $params["mode"] = 'standalone'; + $params["alias"] = $this->alias; + $params['server_base'] = $this->request->getScheme().$this->request->getServerHost(); + $this->xp->setParameter($namespace,$params); + $this->check_access(); + } + + /* + * @brief I think main entry point: + * + */ + function showEmbeddedXML ($file) { + $namespace= ""; + $xml = new DomDocument(); + if ($this->use_string == true) { + $xml->loadXML($file); + } else + $xml->load($file); + $params["mode"] = 'embedded'; + $this->xp->setParameter($namespace,$params); + $this->_injectJS($xml); + $this->_updateXML($xml); + if ($html = $this->xp->transformToXML($xml) ) { + echo $html; + } else { + echo "Failed Transform XML\n"; + } + } + + /** + * + */ + function getElementById($xml,$id) + { + $xpath = new DOMXPath($xml); + return $xpath->query("//*[@id='$id']")->item(0); + } + + /** + * + */ + function admin($form) + { + switch ($form) + { + case "user": + $this->file = "admin/view/index.fr_FR.UTF-8.xml"; + break; + default: + $this->file = "compta/index.xml"; + } + } + /** + * @brief Only display embedded content for the accounting + * application + */ + function main() { + $this->showEmbeddedXML($this->file); + } + + /** + * @brief the purpose of the function is to inject + * TODO Update Level accordinf to session. Still Missing the Organization Name + * and the users ledger account! would be helpfull for the other requests + */ + protected function _injectJS(&$xml) + { + $scripts = $xml->getElementsByTagName('script'); + $f = $scripts->item(0); + $level = "P"; // (S)yndic (P)roprietaire (L)ocataire (F)ournisseur + if ( $this->session->in_groupe(COMPTA_SYNDIC) ) { $level ="S"; } + $nscript = <<session->getOrganizationId()}" + ,Exercice : "{$this->session->getCurrentExercice()}" + ,Mode : "{$level}" +}; + } + (function() { + var mh1a = $('mh1').firstChild; + mh1a.href = "/fr/app/compta/services.php/"; + })(); +EOF; + $nel = $xml->createTextNode($nscript); + $f->appendChild($nel); + } + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) { } +} + +?> diff --git a/app/compta/parametre.js b/app/compta/parametre.js new file mode 100644 index 0000000..8622bde --- /dev/null +++ b/app/compta/parametre.js @@ -0,0 +1,204 @@ + +AEBW.declare("DlgParameter",AEBW.control.dialogbox ,{ + constructor : function(div_id,uipath,jurl ) { + AEBW.control.dialogbox(div_id); + this._uipath = uipath; + this.Current = 0; + this.load(uipath); + this.Url = function() {return jurl;}; + }, + getAccountInfo: function () { + var params= { + identity : "" + }; + var obj = this; + var url = this.Url(); + var SupplReq = new AEBW.Json(url); + SupplReq.handlefct('pcmn','getAccountInfo',params, + function(response) {obj.ongetAccountInfo(response);}, + function() { alert("Failed getAccountInfo");} + ); + }, + ongetAccountInfo: function(response) { + var result = response.result; + //alert("Ok, got Answer :"+result); + $('addr').value = result.addr; + $('act').value = result.act; + $('ville').value = result.ville; + $('cp').value = result.cp; + }, + getDossiers : function() { + var params= { + identity : "" + }; + var obj = this; + var url = this.Url(); + var SupplReq = new AEBW.Json(url); + SupplReq.handlefct('ident','getApplicationDbs',params, + function(response) {obj.ongetDossiers(response);}, + function() { alert("Failed getDossiers");} + ); + }, + ongetDossiers : function(response) { + var res = response.result; + var sum ="
      "; + try { + for (var i = 0 ; i < res.length ; i++) { + var row = res[i]; + // if (this.Current ==0 ) this.Current = row[0]; + if (this.Current == row[0]) { + sum += "
    • En cours d'utilisation "+row[1]+" voir ("; + sum += "detail)"; + sum +="
    • "; + } else { + sum += "
    • "+row[1]+""; + sum +="
    • "; + } + } + sum+="
    "; + $('parameters-list').innerHTML = sum; + } catch (e) { + alert("ongetDossiers Failed "+e.message); + } + }, + + switchDossier: function(dossier) { + var params= { + "org" : dossier + }; + var obj = this; + var url = this.Url(); + var SupplReq = new AEBW.Json(url); + SupplReq.handlefct('ident','switchOrg',params, + function(response) {obj.onswitchDossier(response);}, + function() { alert("Failed getDossiers");} + ); + }, + onswitchDossier: function(response) { + this.Current = response.result[0]; + $('gestion-compta').innerHTML = response.result[1]; + this.getDossiers(); + }, + getCurrentOrg : function() { + var params= { + }; + var obj = this; + var url = this.Url(); + var SupplReq = new AEBW.Json(url); + SupplReq.handlefct('ident','currentOrg',params, + function(response) {obj.ongetCurrentOrg(response);}, + function() { alert("Failed getCurrentOrg");} + ); + }, + ongetCurrentOrg: function(response) { + this.Current = response.result[0]; + try { + $('gestion-compta').innerHTML = response.result[1]; + } catch (e) { + alert("ongetCurrentOrg Failed "+e.message); + } + }, + showList:function() { + this.show(); + try { + p = $("parameters"); + if ( p != null) + $("parameters").addClassName("hidden"); + } catch (e) { + alert("showList Failed "+e.message); + } + this.getCurrentOrg(); + this.getDossiers(); + }, + showDetail:function() { + this.show(); + $("parameters-summary").addClassName("hidden"); + this.getAccountInfo(); + }, + onShow : function () { +// if (this.Current == 0 ) this.getCurrentOrg(); + }, + onLoaded: function (ht) { + this.showList(); + } + +}); + +AEBW.declare("DlgWizard",AEBW.control.dialogbox, { +constructor: function (div_id,uipath,jurl) { + AEBW.control.dialogbox(div_id); + this.load(uipath); + this._wizard = null; + this.Url = function() {return jurl;}; + } , + onShow : function() { + this._wizard = new AEBW.control.Wizard('wizard',['wp1','wp2','wp3','wp4','wp6']); + AEBW.mixin(this._wizard,this); + }, + onNext : function(curr_id) { + switch(curr_id) { + case "wp1" : /*Register Organisation then Create DB then Add User in ORG */ + this.createOrg(); + break; + case "wp2" : + break; + case "wp3" : + break; + case "wp4" : + break; + } + }, + onPrev: function(curr_id) { + }, + uploadCsv: function (name, obj) { + var req = AEBW.HTTPRequest(); + try { + var data = new FormData(); + data.append(name,obj); // The file to be uploadrd and add some aditionnal attributes + req.open("POST",alias+"/app/compta/upload.php",true); + req.send(data); + } catch (e) { + alert("uploadCsv Failed:"+e.message); + } + }, + createOrg : function() { + alert("Launch create Org"); + }, + onCreateOrg : function(response) { + } +}); + +var Params = new DlgParameter("parameter", + "./forms.php?panel=parameter", + alias+"/app/compta/index.php"); +Params.getCurrentOrg(); + +var Wizard = new DlgWizard("parameter", + "./forms.php?panel=wizard", + alias+"/app/compta/index.php"); + + +if ($('btOrgList') != null) { +Event.observe($("btOrgList"),"click", function () { + Params.showList(); + }); + +} + +var myWizard = null; + +Event.observe($("btOrgNew"),"click", function () { + Wizard.show(); + }); + + + +/* +setTimeout(function() { + Params.show(); + Params.showList(); + if ($("btNewIdentity") != null) + Event.observe($("btNewIdentity"),"click", function () {alert("to be coded 2");}); + +},2000); +*/ diff --git a/app/compta/parametre.xml b/app/compta/parametre.xml new file mode 100644 index 0000000..d8fcf83 --- /dev/null +++ b/app/compta/parametre.xml @@ -0,0 +1,71 @@ + + + + + + Exercice Managment + + + + + + +

    Information Générales

    + + Idendité + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + +
    +
    + + + Copropriété Lots + +
    + +
    +
    +
    + +
    + +

    Vos Organisations

    +
    +
    +
    +
    diff --git a/app/compta/patchs/00_missing_solde_compte_out.xml b/app/compta/patchs/00_missing_solde_compte_out.xml new file mode 100644 index 0000000..4936858 --- /dev/null +++ b/app/compta/patchs/00_missing_solde_compte_out.xml @@ -0,0 +1,41 @@ + + + + +DROP PROCEDURE IF EXISTS solde_compte_out; + + +CREATE PROCEDURE solde_compte_out(IN period VARCHAR(32), IN acc VARCHAR(32), OUT Debit_ DOUBLE , INOUT Credit_ DOUBLE , INOUT Solde_ DOUBLE,INOUT Pc_ INT) +BEGIN + +select + ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) as Debit, + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) as Credit, + CASE WHEN + sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) > sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) > 0 + THEN + -1 * ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) + ELSE + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) + END as Solde , t.tret_key_id INTO Debit_, Credit_, Solde_,Pc_ + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string =period + where acc_id=acc ORDER BY entry_date LIMIT 1; + +END; + + + + +XML; +?> diff --git a/app/compta/patchs/01_patch_tantieme.xml b/app/compta/patchs/01_patch_tantieme.xml new file mode 100644 index 0000000..b829a3d --- /dev/null +++ b/app/compta/patchs/01_patch_tantieme.xml @@ -0,0 +1,251 @@ + + + + + + + DROP PROCEDURE IF EXISTS rembourse_trans_chauffage; + + + CREATE PROCEDURE rembourse_trans_chauffage( IN trs_dt DATE , + IN ed DATE, + IN chrg VARCHAR(32), + IN vouch VARCHAR(32), + in am DOUBLE, + in cle INTEGER, + in des VARCHAR(256) + ) + + BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE tant DOUBLE; + DECLARE cur1 CURSOR FOR SELECT acc_id,FctTantiemeFrac(acc_id,cle) FROM Account where acc_id like '450%'; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + ( ed,trs_dt,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,chrg,am,'d',des); + OPEN cur1; + + read_loop: LOOP + FETCH cur1 INTO a, tant; + IF done THEN + LEAVE read_loop; + END IF; + IF tant > 0 THEN + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,a,am*tant,'c',des); + END IF; + END LOOP; + + CLOSE cur1; + END; + + + + +DROP FUNCTION IF EXISTS FctTantiemeFrac; + + + +CREATE FUNCTION FctTantiemeFrac( acc_id VARCHAR(32), + charge_key INTEGER) + RETURNS DOUBLE + NOT DETERMINISTIC + READS SQL DATA +BEGIN + DECLARE select_var DOUBLE; + SET @tantTotal := (SELECT COALESCE(sum(tant_lot_size),1.0) FROM Tantieme WHERE tant_pc_id = charge_key); + SET select_var =(SELECT sum(tant_lot_size) FROM Tantieme as tant + JOIN Lot as l on l.lot_num = tant.tant_lot_num + JOIN LotsOwners as lo on lo.lo_lot_id = l.lot_id + JOIN Account as a on a.acc_id = acc_id + JOIN JoinIdentityAccount as jia on jia.jia_acc = a.acc_id and jia_ident = lo.lo_owner_id + WHERE tant_pc_id =charge_key); + IF (select_var IS NULL) THEN + RETURN 0.0 ; + ELSE + RETURN select_var / @tantTotal; + END IF; +END; + + + +DROP PROCEDURE IF EXISTS repartir_trans_charge; + + + +CREATE PROCEDURE repartir_trans_charge(IN trs_dt DATE , + IN ed DATE, + IN chrg VARCHAR(32), + IN vouch VARCHAR(32), + in am DOUBLE, + in cle INTEGER, + in des VARCHAR(256) + ) + +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE tant DOUBLE; + DECLARE cur1 CURSOR FOR SELECT acc_id,FctTantiemeFrac(acc_id,cle) FROM Account where acc_id like '450%'; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + ( ed,trs_dt,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description,tret_key_id) VALUES + (@last_id,"OD",ed,vouch,chrg,am,'c',des,cle); + OPEN cur1; + + read_loop: LOOP + FETCH cur1 INTO a, tant; + IF done THEN + LEAVE read_loop; + END IF; + IF tant > 0 THEN + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,a,am*tant,'d',des); + END IF; + END LOOP; + + CLOSE cur1; +END; + + + + DROP PROCEDURE IF EXISTS detail_decompte_charge; + + + + CREATE PROCEDURE detail_decompte_charge( + IN user_id INTEGER, + IN poste_charge_id INTEGER, + IN period VARCHAR(32), + IN preci INTEGER) + BEGIN + SET @myAccount := (SELECT acc_id FROM Account + JOIN JoinIdentityAccount as jia on jia.jia_acc = acc_id + WHERE user_id = jia.jia_ident); + SELECT te.`entry_date` as Date, + te.acc_id as Compte, + ac.`acc_name`, + te.description, + amount as MontantTotal, + ROUND( FctTantieme(@myAccount,poste_charge_id) + ,preci) + + as Tan, + ROUND( (amount * FctTantiemeFrac(@myAccount,poste_charge_id) ) + ,preci + ) as Montant, + pc.pc_name as Cle from TransactionEntry as te + JOIN Account as ac on (ac.acc_id = te.acc_id) + JOIN PosteCharge as pc on (te.tret_key_id = pc.pc_id) + JOIN Period AS p on te.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + where te.acc_id like '6%' and te.debit_credit = 'd' and IF (poste_charge_id != 0,te.tret_key_id = poste_charge_id,1) + ORDER BY te.entry_date; + END; + + + +DROP PROCEDURE IF EXISTS detail_decompte_solde; + + +CREATE PROCEDURE detail_decompte_solde( + IN user_id INTEGER, + IN poste_charge_id INTEGER, + IN period VARCHAR(32), + IN preci INTEGER) +BEGIN + + SET @myAccount := (SELECT acc_id FROM Account + JOIN JoinIdentityAccount as jia on jia.jia_acc = acc_id + WHERE user_id = jia.jia_ident); + SELECT + sum(amount) as MontantTotal, + ROUND( sum((amount * (FctTantiemeFrac(@myAccount,pc.pc_id) + ))) ,preci + ) as Montant + from TransactionEntry as te + JOIN Account as ac on (ac.acc_id = te.acc_id) + JOIN PosteCharge as pc on (te.tret_key_id = pc.pc_id) + JOIN Period AS p on te.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + where te.acc_id like '6%' and te.debit_credit = 'd' and IF (poste_charge_id != 0,te.tret_key_id = poste_charge_id,1) + ORDER BY te.entry_date; + +END; + + + + + DROP PROCEDURE IF EXISTS repartir_charge_global; + + + + CREATE PROCEDURE repartir_charge_global(IN dt DATE,in period TEXT) + BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE deb DOUBLE; + DECLARE cre DOUBLE; + DECLARE sol DOUBLE; + DECLARE pc INT; + DECLARE cur2 CURSOR FOR SELECT acc_id FROM Account where acc_id like "6%"; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + SET @enabled = TRUE; + OPEN cur2; + read_loop_rg : LOOP + FETCH cur2 INTO a; + IF done THEN + LEAVE read_loop_rg; + END IF; + CALL solde_compte_out(period,a,deb,cre,sol,pc); + CALL debug_msg(@enabled,CONCAT(" Process account ",a," debit=",deb," cre=",cre," solde=",sol," pc=",pc," done=",done)); + IF sol < -0.01 THEN + CALL debug_msg(@enabled,CONCAT(" Process account repartir ",deb)); + CALL repartir_trans_charge(dt,dt,a,"",ABS(sol),pc,CONCAT("Répartion ",ROUND(ABS(sol),2),"€ du compte ",a," Clé ",pc)); + END IF; + END LOOP read_loop_rg; + CLOSE cur2; + END; + + + +DROP PROCEDURE IF EXISTS debug_msg; +CREATE PROCEDURE debug_msg (IN enabled INTEGER,IN msg VARCHAR(256)) +BEGIN + IF enabled THEN BEGIN + SELECT CONCAT("**",msg) AS '** DEBUG:'; + END; + END IF; +END; + + + + +XML; + +?> diff --git a/app/compta/patchs/02_create_pcg.txt b/app/compta/patchs/02_create_pcg.txt new file mode 100644 index 0000000..1638aeb --- /dev/null +++ b/app/compta/patchs/02_create_pcg.txt @@ -0,0 +1,11 @@ + +DROP TABLE IF EXISTS Pcg; + +CREATE TABLE IF NOT EXISTS Pcg ( + pcg_id INTEGER AUTO_INCREMENT PRIMARY KEY, + pcg_acc VARCHAR(16) DEFAULT "", + pcg_acc_name VARCHAR(255) DEFAULT "", + pcg_acc_type VARCHAR(1) DEFAULT "" +) CHARACTER SET utf8 COLLATE utf8_general_ci; + + diff --git a/app/compta/patchs/02_next.xml b/app/compta/patchs/02_next.xml new file mode 100644 index 0000000..a515bb5 --- /dev/null +++ b/app/compta/patchs/02_next.xml @@ -0,0 +1,263 @@ + + + + + + + + + DROP TABLE IF EXISTS Pcg; + + +CREATE TABLE IF NOT EXISTS Pcg ( + pcg_id INTEGER AUTO_INCREMENT PRIMARY KEY, + pcg_acc VARCHAR(16) DEFAULT "", + pcg_acc_name VARCHAR(255) DEFAULT "", + pcg_acc_type VARCHAR(1) DEFAULT "" +) CHARACTER SET utf8 COLLATE utf8_general_ci; + + + + DROP PROCEDURE IF EXISTS journal; + + + CREATE PROCEDURE journal(IN period VARCHAR(32),IN jrn VARCHAR(2),IN preci INTEGER,IN _offs INTEGER ,IN _limit INTEGER) + BEGIN + set @valPeriod= period; + set @valJrnx = jrn; + SET @valFrom = _offs; + SET @valLimit = _limit; + SET @v_query = CONCAT("SELECT t.act_trans_date AS Date, j.acc_id AS Compte, r.acc_name AS Ref, t.trans_label AS Libelle,", + "ROUND( ( CASE WHEN j.debit_credit = 'd' THEN j.amount ELSE 0 END), ",preci," ) AS Debit,", + "ROUND( ( CASE WHEN j.debit_credit = 'c' THEN j.amount ELSE 0 END), ",preci," ) AS Credit,", + " t.act_trans_date +FROM TransactionEntry AS j +JOIN Transactions AS t ON j.trans_id = t.trans_id +JOIN Account AS r ON j.acc_id = r.acc_id +JOIN Period AS p ON t.act_trans_date +BETWEEN p.per_begin +AND p.per_end +AND p.per_string ='", @valPeriod , +"' WHERE j.entry_type ='",@valJrnx , +"' ORDER BY t.act_trans_date DESC, t.trans_label + LIMIT ", @valFrom, ",",@valLimit,";"); + PREPARE q FROM @v_query; + EXECUTE q; + END; + + + + + DROP PROCEDURE IF EXISTS journal_solde; + + + CREATE PROCEDURE journal_solde(IN period VARCHAR(32),IN jrn VARCHAR(2),IN preci INTEGER ) + BEGIN + SELECT ROUND(sum(CASE WHEN j.debit_credit ='d' THEN j.amount ELSE 0 END), preci) as Debit , + ROUND(sum(CASE WHEN j.debit_credit ='c' THEN j.amount ELSE 0 END), preci) as Credit, + COUNT(*) as nbr + FROM TransactionEntry as j + JOIN Transactions as t ON j.trans_id = t.trans_id + JOIN Account AS r on j.acc_id = r.acc_id + JOIN Period AS p on t.act_trans_date BETWEEN p.per_begin and p.per_end and p.per_string = period + WHERE j.entry_type = jrn + ; + END; + + + + DROP PROCEDURE IF EXISTS detail_compte_sans_solde; + + +CREATE PROCEDURE detail_compte_sans_solde(IN period VARCHAR(32), IN acc VARCHAR(32) ) +BEGIN + SELECT t.act_trans_date as Date , + t.voucher_ref as Ref, + t.trans_label , + CASE WHEN debit_credit='d' THEN ROUND(amount,2) ELSE 0 END as Debit, + CASE WHEN debit_credit='c' THEN ROUND(amount,2) ELSE 0 END as Credit + FROM TransactionEntry as te + JOIN Transactions as t ON te.trans_id = t.trans_id + JOIN Period as p on t.act_trans_date BETWEEN p.per_begin and p.per_end and p.per_string =period + WHERE te.acc_id=acc ORDER BY t.act_trans_date ASC; +END; + + + + + DROP TABLE IF EXISTS Recurrent; + DROP TABLE IF EXISTS RecurrentEntry; + + + +CREATE TABLE IF NOT EXISTS Recurrent ( + rec_id INTEGER AUTO_INCREMENT PRIMARY KEY, + rec_reference VARCHAR(64) DEFAULT "", + rec_start_date DATE DEFAULT(CURRENT_DATE), + rec_end_date DATE DEFAULT(CURRENT_DATE), + rec_next_date DATE DEFAULT(CURRENT_DATE) +) ; + +CREATE TABLE IF NOT EXISTS RecurrentEntry ( + rece_id INTEGER AUTO_INCREMENT PRIMARY KEY, + rece_rec_id INTEGER, + rece_debit_credit ENUM('c','d'), + rece_amount DECIMAL(13,3), + FOREIGN KEY(rece_rec_id) + REFERENCES Recurrent(rec_id) + ON DELETE CASCADE +) ; + + + + + + + DROP PROCEDURE IF EXISTS bilan; + + + +CREATE PROCEDURE bilan(IN period VARCHAR(32)) +BEGIN +SELECT m.acc_id As Compte,m.acc_name AS Description, m.Debit,m.Credit,TRUNCATE(m.Debit-m.Credit,2) as sold FROM (SELECT c.acc_id, c.acc_name + , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit + , MONTHNAME(t.act_trans_date) as Month +FROM Account AS c +JOIN Account pc +JOIN Period AS p +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id + AND c.acc_left <= pc.acc_left AND c.acc_right >= pc.acc_right +WHERE p.per_string = period + AND t.act_trans_date BETWEEN p.per_begin AND p.per_end + +GROUP BY c.acc_id +ORDER BY c.acc_left ) AS m; +END; + + + + DROP VIEW IF EXISTS vSolde; + DROP FUNCTION IF EXISTS fPeriod; + + + CREATE function fPeriod() returns VARCHAR(32) DETERMINISTIC NO SQL return @fPeriod; +CREATE VIEW vSolde AS +SELECT c.acc_id + , c.acc_name + , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit + , c.acc_left + , c.acc_right +FROM Account AS c +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND c.acc_id = te.acc_id +JOIN Period AS p +WHERE t.act_trans_date BETWEEN p.per_begin AND p.per_end + AND p.per_string = fPeriod() + GROUP BY c.acc_id +UNION + +SELECT c.acc_id, c.acc_name + , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit + , c.acc_left,c.acc_right +FROM Account AS c +JOIN Account pc +JOIN Period AS p +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id + AND c.acc_left < pc.acc_left AND c.acc_right > pc.acc_right +WHERE p.per_string = fPeriod() + AND t.act_trans_date BETWEEN p.per_begin AND p.per_end + AND c.acc_right > c.acc_left + 1 +GROUP BY c.acc_id +ORDER BY acc_left + + + + + DROP PROCEDURE IF EXISTS solde_compte_per_month; + + + CREATE PROCEDURE solde_compte_per_month(IN period VARCHAR(32),IN acc VARCHAR(32)) + BEGIN +SELECT m.Month, m.acc_id As Account, m.Debit,m.Credit,(m.Debit-m.Credit) as sold FROM (SELECT c.acc_id, c.acc_name + , TRUNCATE(SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END),2) as Debit + , TRUNCATE(SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END),2) as Credit + , MONTH(t.act_trans_date) as Month +FROM Account AS c +JOIN Account pc +JOIN Period AS p +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id + AND c.acc_left <= pc.acc_left AND c.acc_right >= pc.acc_right +WHERE p.per_string = period + AND t.act_trans_date BETWEEN p.per_begin AND p.per_end + AND c.acc_id = acc +GROUP BY MONTH(t.act_trans_date) +ORDER BY c.acc_left , MONTH(t.act_trans_date) ) AS m; + END + + + + + DROP PROCEDURE IF EXISTS detail_compte; + + + CREATE PROCEDURE detail_compte(IN period VARCHAR(32),IN acc VARCHAR(32)) + BEGIN +SELECT Date + ,CASE WHEN trans_id IS NULL THEN "TOTAL" ELSE Ref END AS ref + ,CASE WHEN trans_id IS NULL THEN "TOTAL" ELSE description END AS description + ,CASE WHEN trans_id IS NULL THEN Sd ELSE Debit END AS Debit + ,CASE WHEN trans_id IS NULL THEN Sc ELSE Credit END AS Credit + +FROM (SELECT t.act_trans_date as Date , + t.voucher_ref as Ref, + t.trans_label AS description , + CASE WHEN debit_credit='d' THEN ROUND(amount,2) ELSE 0 END as Debit, + CASE WHEN debit_credit='c' THEN ROUND(amount,2) ELSE 0 END as Credit + , SUM(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) AS Sd + , SUM(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) AS Sc + , t.trans_id + FROM TransactionEntry as te + JOIN Transactions as t ON te.trans_id = t.trans_id + JOIN Period as p on t.act_trans_date BETWEEN p.per_begin and p.per_end and p.per_string = period + WHERE te.acc_id= acc + GROUP BY t.trans_id WITH ROLLUP ) AS Sub + ORDER BY trans_id,Date ASC ; + END + + + + + DROP PROCEDURE IF EXISTS solde_bank; + + + CREATE PROCEDURE solde_bank(IN period VARCHAR(32)) + +BEGIN +SELECT m.acc_id As Compte,m.acc_name AS Description, ROUND(m.Debit,2) As Debit ,ROUND(m.Credit,2) AS Credit ,ROUND(m.Debit-m.Credit,2) as sold FROM (SELECT c.acc_id, c.acc_name , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit , MONTHNAME(t.act_trans_date) as Month FROM Account AS c JOIN Account pc JOIN Period AS p JOIN Transactions AS t JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id AND c.acc_left <= pc.acc_left AND c.acc_right >= pc.acc_right WHERE p.per_string = period AND t.act_trans_date BETWEEN p.per_begin AND p.per_end AND c.acc_id like "51%" GROUP BY c.acc_id ORDER BY c.acc_id ) AS m; +END + + + + +XML; + +?> + diff --git a/app/compta/patchs/03_pcg_abegre.txt b/app/compta/patchs/03_pcg_abegre.txt new file mode 100644 index 0000000..141777b --- /dev/null +++ b/app/compta/patchs/03_pcg_abegre.txt @@ -0,0 +1,112 @@ +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1","COMPTES DE CAPITAUX",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("101","Capital",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("105","Ecarts de réévaluation",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1061","Réserve légale",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1062","Réserves indisponible",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1063","Réserves statutaires ou contractuelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1064","Réserves réglementées",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1068","Autres réserves",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("11","REPORT A NOUVEAU",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("12","RESULTAT NET DE L EXERCICE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("145","Amortissements dérogatories",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("146","Provision spéciale de réévaluation",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("147","Plus-values réinvesties",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("148","Autres provisions réglementées",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("15","PROVISIONS POUR RISQUES ET CHARGES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("16","EMPRUNTS ET DETTES ASSIMILEES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("2","COMPTES D'IMMOBILISATIONS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("201","Frais d'établissement",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("206","Droit au bail",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("207","Fonds commercial",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("208","Autres immobilisations incorporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("21","IMMOBILISATIONS CORPORELLES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("23","IMMOBILISATIONS EN COURS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("27","AUTRES IMMOBILISATIONS FINANCIERES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("280","Amortissements des immobilisations incorporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("281","Amortissements des immobilisations corporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("290","Provisions pour dépréciation des immobilisations incorporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("291","Provisions pour dépréciation des immobilisations corporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("297","Provisions pour dépréciation des autres immobilisations financières",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("3","COMPTES DE STOCKS ET D'EN-COURS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("31","MATIERES PREMIERES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("32","AUTRES APPROVISIONNEMENTS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("33","EN-COURS DE PRODUCTION DE BIENS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("34","EN-COURS DE PRODUCTION DE SERVICES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("35","STOCKS DE PRODUITS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("37","STOCKS DE MARCHANDISES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("391","Provisions pour dépréciation des matières premières",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("392","Provisions pour dépréciation des autres approvisionnements",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("393","Provisions pour dépréciation des en-cours de production des biens",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("394","Provisions pour dépréciation des en-cours de production de services",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("395","Provisions pour dépréciation des stocks de produits",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("397","Provisions pour dépréciation des stocks de marchandises",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("4","COMPTES DE TIERS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("400","Fournisseurs et Comptes rattachés",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("409","Fournisseurs débiteurs",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("410","Clients et Comptes rattachés",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("419","Clients débiteurs",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("421","Personnel - Rémunérations dues",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("428","Personnel - Charges à payer et produits à recevoir",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("43","SECURITE SOCIALE ET AUTRES ORGANISMES SOCIAUX",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("444","Etat - Impôts sur les bénéfices",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("445","Etat - Taxes sur le chiffre d'affaires",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("447","Autres impôts, taxes et versements assimilés",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("455","Associés - Comptes courants",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("46","DEBITEURS ET CREDITEURS DIVERS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("47","COMPTES TRANSITOIRES OU D'ATTENTE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("481","Charges à répartir sur plusieurs exercices",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("486","Charges constatées d'avance",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("487","Produits constatés d'avance",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("491","Provisions pour dépréciation des comptes de clients",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("496","Provisions pour dépréciation des débiteurs divers",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("5","COMPTES FINANCIERS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("50","VALEURS MOBILIERES DE PLACEMENT",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("51","BANQUES ETABLISSEMENTS FINANCIERS ET ASSIMILES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("53","CAISSE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("54","REGIS D'AVANCES ET ACCREDITIFS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("58","VIREMENTS INTERNES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("590","Provisions pour dépréciation des valeurs mobilières de placement",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("6","COMPTES DE CHARGES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("60","ACHATS (saufs 603)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("603","VARIATION DES STOCKS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("61","Services Exterieurs",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("62","Autres services extérieurs",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("63","IMPôTS TAXES ET VERSEMENT ASSIMILES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("641","Rémunération du personnel",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("644","Rémunération du travail de l'exploitant",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("645","Charges de sécurité sociale et de prévoyance",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("646","Cotisations sociales personnelles de l'exploitant",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("65","AUTRES CHARGES DE GESTIONS COURANTE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("66","CHARGES FINANCIERES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("67","CHARGES EXCEPTIONNELLES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("681","Dotations aux amortissements et aux provisions - Charges d'exploitation",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("686","Dotations aux amortissements et aux provisions - Charges financières",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("687","Dotations aux amortissements et aux provisions - Charges exceptionnelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("691","Participation des salariés aux fruits de l'expansion",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("695","Impôts sur les bénéfices",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("697","Imposition forfaitaire annuelle des sociétés",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("699","Produits - Reports en arrière des déficits",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("7","COMPTES DE PRODUITS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("701","Ventes de produits finis",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("706","Prestations de services",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("707","Ventes de marchandises",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("708","Produits des activités annexes",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("709","Rabais, remises et ristournes accordés par l'entreprise",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("713","VARIATION DES STOCKS (en-cours de production)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("72","PRODUCTION IMMOBILISEE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("74","SUBVENTIONS D'EXPLOITATION",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("75","AUTRES PRODUITS DE GESTION COURANTE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("76","PRODUITS FINANCIERS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("77","PRODUITS EXCEPTIONNELS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("781","Reprises sur amortissements et provisions (à inscrire dans les produits d'exploitation)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("786","Reprises sur provisions (à inscrire dans les produits fianciers)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("787","Reprises sur provisions (à inscrire dans les produits exceptionnels)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("79","TRANSFERTS DE CHARGES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("8","COMPTES SCPECIAUX",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("80","ENGAGEMENTS HORS BILAN",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("801","Engagements donnés par l'entreprise",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("802","Engagements reçus par l'entreprise",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("809","Contrepartie des engagements",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("88","RESULTAT EN INSTANCE D'AFFECTATION",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("89","BILAN",""); + diff --git a/app/compta/patchs/03_pcg_syndic.txt b/app/compta/patchs/03_pcg_syndic.txt new file mode 100644 index 0000000..3068f62 --- /dev/null +++ b/app/compta/patchs/03_pcg_syndic.txt @@ -0,0 +1,44 @@ + +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","102","Provisions pour travaux"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","103","Avances"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","1031","Avances de trésorerie"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","1032","Avances travaux"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","1033","Autres avances"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","131","Subventions et instance d'affectation"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","12","Solde en attente sur travaux ou opération exceptionnel"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","40","Fournisseurs"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","42","Autres"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","43","Autres"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","44","Autres"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","45","Collectivite des Coproprietaires"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","460","DEBITEURS ET CREDITEURS DIVERS"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","461","Debiteur Divers"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","462","Credit Divers"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","47","Comptes d'attente"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","48","Comptes de régularisation"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","49","Dépréciation des comptes de tiers"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","50","Fonds placés"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","51","Banques ou fonds disponible ne banque"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","53","Caisse"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","601","Eau"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","602","Electricite"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","603","Chauffage, energie et combustible"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","604","Achat produits d'entretien"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","605","Materiel"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","606","Fourniture"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","611","Nettoyage des locaux"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","614","Control de maintenance"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","615","Entretien et petites reparations"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","616","Prime d'assurance"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","620","Frais d'administration"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","6213","Frais postaux"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","6222","Prestation particulière"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","6223","Autres honoraires"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","671","Travaux decides par assemblee generale"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","672","Travaux urgents"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","700","Appels de fonds"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","701","Provision sur operations courantes"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","702","Provision sur travaux de l'article 14.2"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","703","Avances"); +INSERT INTO Pcg(pcg_acc_type,pcg_acc,pcg_acc_name) VALUE("","714","Produits divers"); + diff --git a/app/compta/patchs/04_account.txt b/app/compta/patchs/04_account.txt new file mode 100644 index 0000000..e9c6653 --- /dev/null +++ b/app/compta/patchs/04_account.txt @@ -0,0 +1,260 @@ +-- +-- 09/02/2021 +-- Add account_get_sub procedure +-- cls Account Id +-- _depth Subtree depth to retrieve +-- HAVING level ... equal 1 if we don't wont the parent + +DROP PROCEDURE IF EXISTS account_get_sub; +CREATE PROCEDURE account_get_sub(IN cls VARCHAR(32) , IN _depth INTEGER) +BEGIN +SELECT node.acc_id, node.acc_name AS acc_name , (COUNT(parent.acc_name) -1 ) AS _level +FROM Account AS node, + Account AS parent, + Account AS sub_parent, + ( + SELECT node.acc_id , ( COUNT(parent.acc_id) - 1) AS depth + FROM Account AS node, + Account AS parent + WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right + AND node.acc_id = cls + GROUP BY node.acc_id + ORDER BY node.acc_left + ) AS sub_tree +WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right + AND node.acc_left BETWEEN sub_parent.acc_left AND sub_parent.acc_right + AND sub_parent.acc_id = sub_tree.acc_id +GROUP BY node.acc_id +HAVING _level <= _depth +ORDER BY node.acc_left; +END; + +call account_get_sub("70",3); + +-- +-- Hack to create parameterized views +-- +DROP FUNCTION IF EXISTS fPeriod; +create function fPeriod() returns VARCHAR(32) DETERMINISTIC NO SQL return @fPeriod; + +-- +-- Create the view using fPeriod +-- + +-- select s.* from (select @fPeriod="2021") param , vSolds as s; + +-- +-- Try solde of tree +-- +SELECT node.acc_id, node.acc_name AS acc_name + , (COUNT(parent.acc_name) -1 ) AS _level + ,dc.Debit + ,dc.Credit +FROM Account AS node, + Account AS parent, + Account AS sub_parent, + ( + SELECT node.acc_id , ( COUNT(parent.acc_id) - 1) AS depth + + FROM Account AS node, + Account AS parent + WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right + AND node.acc_id = "600000" + GROUP BY node.acc_id + ORDER BY node.acc_left + ) AS sub_tree, + ( + SELECT t.acc_id + , SUM(CASE WHEN t.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN t.debit_credit ='c' THEN amount ELSE 0 END) as Credit + FROM TransactionEntry as t, + Period as p + WHERE + p.per_string = "2021" + AND t.entry_date BETWEEN p.per_begin and p.per_end + GROUP BY t.acc_id + + UNION + + SELECT c.acc_id, 0, 0 + FROM Account AS c + WHERE c.acc_id NOT + IN ( + + SELECT t.acc_id + FROM Account AS c + JOIN Period AS p + LEFT OUTER JOIN TransactionEntry AS t ON c.acc_id = t.acc_id + WHERE p.per_string = "2021" + AND t.entry_date + BETWEEN p.per_begin + AND p.per_end + GROUP BY c.acc_id + ) + ) AS dc + +WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right + AND node.acc_left BETWEEN sub_parent.acc_left AND sub_parent.acc_right + AND sub_parent.acc_id = sub_tree.acc_id + AND dc.acc_id = node.acc_id +GROUP BY node.acc_id +HAVING _level <= _depth +ORDER BY node.acc_left; + + +-- +-- Accounts that don't have debit or credit +-- +SELECT c.acc_id, 0, 0 +FROM Account AS c +WHERE c.acc_id NOT +IN ( + +SELECT t.acc_id +FROM Account AS c +JOIN Period AS p +LEFT OUTER JOIN TransactionEntry AS t ON c.acc_id = t.acc_id +WHERE p.per_string = "2021" +AND t.entry_date +BETWEEN p.per_begin +AND p.per_end +GROUP BY c.acc_id +) + + +-- No leaf account (for those I need to compute the Debit Credit) +SELECT * +FROM Account AS c +WHERE c.acc_right > c.acc_left +1 +ORDER BY acc_left + + +-- +-- Solde des comptes non leaf +-- +SELECT c . * , SUM( s.Debit ) , SUM( s.Credit ) +FROM ( + +SELECT @fPeriod := "2021" h +) AS hParam, Account AS c +JOIN vSolde AS s ON s.acc_left > c.acc_left +AND s.acc_right < c.acc_right +WHERE c.acc_right > c.acc_left +1 +GROUP BY acc_id +ORDER BY acc_left + + + +-- +-- Solde All accounts in period +-- should be based on transaction and TransactionEntry ... +-- +DROP VIEW IF EXISTS vSolde; +CREATE VIEW vSolde AS +SELECT c.acc_id + , c.acc_name + , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit + , c.acc_left + , c.acc_right +FROM Account AS c +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND c.acc_id = te.acc_id +JOIN Period AS p +WHERE t.act_trans_date BETWEEN p.per_begin AND p.per_end + AND p.per_string = fPeriod() + GROUP BY c.acc_id +UNION + +SELECT c.acc_id, c.acc_name + , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit + , c.acc_left,c.acc_right +FROM Account AS c +JOIN Account pc +JOIN Period AS p +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id + AND c.acc_left < pc.acc_left AND c.acc_right > pc.acc_right +WHERE p.per_string = fPeriod() + AND t.act_trans_date BETWEEN p.per_begin AND p.per_end + AND c.acc_right > c.acc_left + 1 +GROUP BY c.acc_id +ORDER BY acc_left + +-- vSolde 2021 +SELECT c.* FROM (SELECT @fPeriod:="2021") AS hParam, vSolde AS c; +-- vSolde without the leafs Could be call bilan +SELECT c.acc_id,c.acc_name,c.Debit,c.Credit , (c.Debit - c.Credit) as Solde FROM (SELECT @fPeriod:="2021") AS hParam, vSolde AS c where acc_left + 1 != acc_right + + +-- +-- Solde compte per month +-- Result example +-- Month Account Debit Credit sold +-- February 401004 390.13 252.64 137.49 +-- January 401004 366.6 504.09 -137.49 +SELECT m.Month, m.acc_id As Account, m.Debit,m.Credit,(m.Debit-m.Credit) as sold FROM (SELECT c.acc_id, c.acc_name + , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit + , MONTHNAME(t.act_trans_date) as Month +FROM Account AS c +JOIN Account pc +JOIN Period AS p +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id + AND c.acc_left <= pc.acc_left AND c.acc_right >= pc.acc_right +WHERE p.per_string = "2021" + AND t.act_trans_date BETWEEN p.per_begin AND p.per_end + AND c.acc_id = 401004 +GROUP BY MONTH(t.act_trans_date) +ORDER BY c.acc_left ) AS m + + +-- +-- New Bilan +-- +DROP PROCEDURE bilan// +CREATE PROCEDURE bilan(IN period VARCHAR(32)) +BEGIN +SELECT m.acc_id As Compte,m.acc_name AS Description, m.Debit,m.Credit,TRUNCATE(m.Debit-m.Credit,2) as sold FROM (SELECT c.acc_id, c.acc_name + , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit + , MONTHNAME(t.act_trans_date) as Month +FROM Account AS c +JOIN Account pc +JOIN Period AS p +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id + AND c.acc_left <= pc.acc_left AND c.acc_right >= pc.acc_right +WHERE p.per_string = period + AND t.act_trans_date BETWEEN p.per_begin AND p.per_end + +GROUP BY c.acc_id +ORDER BY c.acc_left ) AS m +END// + +-- +-- Tree View for Soldes of accounts with Hierachie and and Sum on parent nodes. +-- +SELECT node.acc_id, node.acc_name, node.Debit, node.Credit, node.Debit - node.Credit AS Solde, COUNT( parent.acc_id ) -1 AS _level +FROM ( SELECT @fPeriod := "2021") AS hParam + , vSolde AS node + , vSolde AS parent + , vSolde AS sub_parent, ( + SELECT node.acc_id, ( COUNT( parent.acc_id ) -1) AS depth + FROM ( SELECT @fPeriod := "2021" as p) AS hParam, vSolde AS node, vSolde AS parent + WHERE node.acc_left + BETWEEN parent.acc_left + AND parent.acc_right + AND node.acc_id = "600000" + GROUP BY node.acc_id + ORDER BY node.acc_left + ) AS sub_tree +WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right + AND node.acc_left BETWEEN sub_parent.acc_left AND sub_parent.acc_right + AND sub_parent.acc_id = sub_tree.acc_id +GROUP BY node.acc_id +HAVING _level <=3 +ORDER BY node.acc_left + diff --git a/app/compta/patchs/05_calo.txt b/app/compta/patchs/05_calo.txt new file mode 100644 index 0000000..2919c72 --- /dev/null +++ b/app/compta/patchs/05_calo.txt @@ -0,0 +1,23 @@ +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +-- +-- Base de donn├®es: `test` +-- + +-- -------------------------------------------------------- +-- +-- Structure de la table `CompteurCalorimetrique` +-- + + +CREATE TABLE IF NOT EXISTS `CompteurCalorimetrique` ( +`ccal_id` int(11) NOT NULL AUTO_INCREMENT, +`ccal_emplacement` varchar(2) DEFAULT NULL, +`ccal_num` int(11) DEFAULT NULL, +`ccal_lot_id` int(11) DEFAULT NULL, +`ccal_coef` double DEFAULT NULL, +PRIMARY KEY (`ccal_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=23 ; +- + diff --git a/app/compta/patchs/backup_20210731.txt b/app/compta/patchs/backup_20210731.txt new file mode 100644 index 0000000..c72490d --- /dev/null +++ b/app/compta/patchs/backup_20210731.txt @@ -0,0 +1,1653 @@ +-- MySQL dump 10.16 Distrib 10.1.48-MariaDB, for debian-linux-gnu (i686) +-- +-- Host: localhost Database: SYNDIC_26 +-- ------------------------------------------------------ +-- Server version 10.1.48-MariaDB-0ubuntu0.18.04.1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `Account` +-- + +DROP TABLE IF EXISTS `Account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Account` ( + `acc_id` varchar(32) NOT NULL, + `acc_info_id` int(11) DEFAULT NULL, + `acc_name` varchar(64) DEFAULT NULL, + `acc_desc` varchar(255) DEFAULT '', + `acc_balance` double DEFAULT '0', + `acc_left` int(11) DEFAULT NULL, + `acc_right` int(11) DEFAULT NULL, + PRIMARY KEY (`acc_id`), + KEY `acc_id` (`acc_id`) USING BTREE +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Account` +-- + +LOCK TABLES `Account` WRITE; +/*!40000 ALTER TABLE `Account` DISABLE KEYS */; +INSERT INTO `Account` VALUES ('100000',100000,'COMPTES DE CAPITAUX','',0,1,20),('400000',400000,'COMPTES DE TIERS','',0,43,102),('500000',500000,'COMPTES FINANCIERS','',0,103,124),('600000',600000,'COMPTES DE CHARGES','',0,125,178),('70',70,'COMPTES DE PROVISION','',0,179,192),('401000',401000,'Fournisseurs','',0,48,87),('103000',103000,'Avances','',0,16,19),('103100',103100,'Avances de tresorerie','',0,17,18),('450000',450000,'Collectivite des Coproprietaires','',0,88,95),('460000',460000,'DEBITEURS ET CREDITEURS DIVERS','',0,96,101),('461000',461000,'Debiteur Divers','',0,97,98),('462000',462000,'Credit Divers','',0,99,100),('512000',512000,'BANQUES','',0,110,123),('601000',601000,'Eau','',0,148,149),('602000',602000,'Electricite','',0,150,151),('603000',603000,'Chauffage, energie et combustible','',0,152,153),('604000',604000,'Achat produits d\'entretien','',0,154,155),('605000',605000,'Materiel','',0,156,157),('606000',606000,'Fourniture','',0,158,165),('611000',611000,'Frais scolaire','',0,133,134),('615000',615000,'Entretien et petites réparations','',0,129,130),('616000',616000,'Prime d\'assurance','',0,127,128),('620000',620000,'Frais d\'administration','',0,166,167),('621300',621300,'Frais postaux','',0,168,169),('622200',622200,'Prestation particulière','',0,170,171),('622300',622300,'Autres honoraires','',0,172,173),('671000',671000,'Travaux decides par assemblee generale','',0,174,175),('672000',672000,'Travaux urgents','',0,176,177),('700000',700000,'Appels de fonds','',0,182,183),('701000',701000,'Provision sur operations courantes','',0,184,185),('702000',702000,'Provision sur travaux de l\'article 14.2','',0,186,187),('703000',703000,'Avances','',0,188,189),('714000',714000,'Produits divers','',0,190,191),('450001',450001,'Ebersold Andre','',0,93,94),('450002',450002,'Ebersold Eloise','',0,91,92),('512001',512001,'Banque Postale CCP Andre','',0,121,122),('450003',450003,'Ebersold Marc','',0,89,90),('401001',401001,'EDF ES','',0,85,86),('401002',401002,'EAU','',0,83,84),('607000',607000,'Achats de marchandises','',0,146,147),('401004',401004,'LIDL','',0,81,82),('401005',401005,'AUCHAN','',0,79,80),('401006',401006,'Jet-Tankstelle','',0,77,78),('512002',512002,'Banque Postale M et Mme','',0,119,120),('512003',512003,'LCL M et Mme','',0,117,118),('401007',401007,'Groupama','',0,75,76),('401008',401008,'Matmut','',0,73,74),('626000',626000,'Frais postaux et frais de télécom','',0,144,145),('401009',401009,'Numericable','',0,71,72),('401010',401010,'OneAndOne','',0,69,70),('606101',606101,'Fourniture Carburant voiture','',0,163,164),('401011',401011,'GEMO','',0,67,68),('200000',200000,'COMPTES IMMOBILISATIONS','',0,21,42),('210000',210000,'IMMOBILISATIONS CORPORELLES','',0,34,41),('230000',230000,'IMMOBILISATIONS EN COURS','',0,32,33),('270000',270000,'AUTRES IMMOBILISATIONS FINANCIERES','',0,24,31),('280000',280000,'AMORTISSEMENTS DES IMMOBILISATIONS','',0,22,23),('512004',512004,'LCL Visa Mr','',0,115,116),('101000',101000,'Capital','',0,14,15),('110000',110000,'REPORT A NOUVEAU','',0,12,13),('160000',160000,'EMPRUNTS ET DETTES ASSIMILEES','',0,2,11),('627000',627000,'Services bancaires et assimilés','',0,142,143),('660000',660000,'CHARGES FINANCIERES','',0,140,141),('512005',512005,'Banque Postale LA','',0,113,114),('512006',512006,'Banque Postale CEL','',0,111,112),('630000',630000,'IMPOTS, TAXES ET VERSEMENT ASSIMILES','',0,138,139),('410000',410000,'Clients et comptes rattachés','',0,44,47),('410001',410001,'SIEMENS','',0,45,46),('271001',271001,'AMUNDI-EE PEE','',0,29,30),('271002',271002,'AMUNDI-EE PERCO','',0,27,28),('271003',271003,'NATIXIS PEE','',0,25,26),('614000',614000,'Charges de copropriété','',0,131,132),('401012',401012,'FREE','',0,65,66),('760000',760000,'PRODUITS FIANCIERS','',0,203,204),('213100',213100,'Bâtiments','',0,35,40),('213101',213101,'appartements','',0,38,39),('401013',401013,'Amazon','',0,63,64),('401014',401014,'Pharmacie','',0,61,62),('606102',606102,'Fourniture Santé','',0,161,162),('606103',606103,'Fourniture divers','',0,159,160),('623800',623800,'Divers (pourboires, dons courant...)','',0,136,137),('610000',610000,'Services extérieurs','',0,126,135),('8',8,'COMPTES SPECIAUX','',0,193,202),('89',89,'BILAN','',0,196,197),('88',88,'RESULTAT EN INTANCE D AFFECTATION','',0,198,199),('80',80,'ENGAGEMENTS HORS BILAN','',0,200,201),('401015',401015,'BIGMAT','',0,59,60),('401016',401016,'Aliexpress','',0,55,56),('701001',701001,'Provision sur opération Eloise','',0,180,181),('401017',401017,'Restaurant loisirs','',0,57,58),('164000',164000,'Emprunts auprès des établissements de crédit','',0,3,10),('164001',164001,'Emprunts LCL appartement principal','',0,8,9),('164002',164002,'Emprunts LPB appartement comble','',0,6,7),('213102',213102,'appartement comble','',0,36,37),('164003',164003,'Emprunt LBP voiture','',0,4,5),('401018',401018,'IKEA','',0,53,54),('530000',530000,'CAISSE','',0,104,109),('530001',530001,'Cash Andre','',0,107,108),('530002',530002,'Cash Eloise','',0,105,106),('401029',401029,'Divers vacances','',0,51,52),('401019',401019,'EDF ES appartement combles','',0,49,50); +/*!40000 ALTER TABLE `Account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Budget` +-- + +DROP TABLE IF EXISTS `Budget`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Budget` ( + `bu_id` int(11) NOT NULL AUTO_INCREMENT, + `bu_period_id` int(11) DEFAULT NULL, + `bu_desc` varchar(64) DEFAULT '', + PRIMARY KEY (`bu_id`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Budget` +-- + +LOCK TABLES `Budget` WRITE; +/*!40000 ALTER TABLE `Budget` DISABLE KEYS */; +INSERT INTO `Budget` VALUES (1,4,'Budget 2020'),(2,1,'Budget 2019'),(3,5,'Budget 2021'),(5,6,'Budget 2022'); +/*!40000 ALTER TABLE `Budget` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `BudgetEntry` +-- + +DROP TABLE IF EXISTS `BudgetEntry`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `BudgetEntry` ( + `buet_id` int(11) NOT NULL AUTO_INCREMENT, + `buet_budget_id` int(11) DEFAULT NULL, + `buet_acc_id` varchar(32) DEFAULT NULL, + `buet_amount` decimal(13,3) DEFAULT '0.000', + `buet_debit_credit` enum('d','c') DEFAULT 'c', + `buet_pc_id` int(11) DEFAULT '1', + PRIMARY KEY (`buet_id`) +) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `BudgetEntry` +-- + +LOCK TABLES `BudgetEntry` WRITE; +/*!40000 ALTER TABLE `BudgetEntry` DISABLE KEYS */; +INSERT INTO `BudgetEntry` VALUES (1,2,'601000',700.000,'c',1),(2,2,'602000',100.000,'c',1),(3,2,'603000',4000.000,'c',1),(4,2,'604000',50.000,'c',1),(5,2,'620000',100.000,'c',1),(6,2,'616000',250.000,'c',1),(7,2,'615000',10.000,'c',1),(8,3,'607000',6000.000,'c',1),(9,3,'614000',2160.000,'c',1),(10,3,'627000',160.000,'c',1),(11,3,'626000',288.000,'c',1),(12,3,'616000',1400.000,'c',1),(13,3,'672000',300.000,'c',1),(14,3,'602000',840.000,'c',1),(15,3,'606101',700.000,'c',1),(16,3,'630000',2800.000,'c',1),(17,3,'660000',1580.000,'c',1),(18,3,'700000',40000.000,'c',1); +/*!40000 ALTER TABLE `BudgetEntry` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Config` +-- + +DROP TABLE IF EXISTS `Config`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Config` ( + `cfg_id` varchar(32) NOT NULL, + `cfg_type` int(11) DEFAULT NULL, + `cfg_value` varchar(255) DEFAULT '', + PRIMARY KEY (`cfg_id`), + KEY `cfg_id` (`cfg_id`) USING BTREE +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Config` +-- + +LOCK TABLES `Config` WRITE; +/*!40000 ALTER TABLE `Config` DISABLE KEYS */; +INSERT INTO `Config` VALUES ('version',1,'1.0.0'),('stmt_counter',2,'41'),('state',1,'ready'),('accounting_type',1,'tpe'),('taxe_tva',2,'0'),('pcg',1,'abrege'); +/*!40000 ALTER TABLE `Config` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `JoinIdentityAccount` +-- + +DROP TABLE IF EXISTS `JoinIdentityAccount`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `JoinIdentityAccount` ( + `jia_id` int(11) NOT NULL AUTO_INCREMENT, + `jia_ident` int(11) DEFAULT NULL, + `jia_acc` int(11) DEFAULT NULL, + PRIMARY KEY (`jia_id`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `JoinIdentityAccount` +-- + +LOCK TABLES `JoinIdentityAccount` WRITE; +/*!40000 ALTER TABLE `JoinIdentityAccount` DISABLE KEYS */; +INSERT INTO `JoinIdentityAccount` VALUES (1,2,450001),(3,20,450002),(4,25,450003); +/*!40000 ALTER TABLE `JoinIdentityAccount` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Loan` +-- + +DROP TABLE IF EXISTS `Loan`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Loan` ( + `ln_id` int(11) NOT NULL AUTO_INCREMENT, + `ln_date` date DEFAULT NULL COMMENT 'Date du pret', + `ln_amount` double DEFAULT '0' COMMENT 'Montant emprunte', + `ln_rate` double DEFAULT '0.01' COMMENT 'taux du pret par an', + `ln_duree` int(11) DEFAULT NULL COMMENT 'Duree du pret en mois', + `ln_desc` varchar(255) DEFAULT '', + `ln_acc_bank` varchar(9) DEFAULT NULL COMMENT 'Bank account', + `ln_acc_charge` varchar(9) NOT NULL DEFAULT '660000', + `ln_acc_capital` varchar(9) NOT NULL DEFAULT '160000', + PRIMARY KEY (`ln_id`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Loan` +-- + +LOCK TABLES `Loan` WRITE; +/*!40000 ALTER TABLE `Loan` DISABLE KEYS */; +INSERT INTO `Loan` VALUES (1,'2021-02-10',86133.34,0.0185,106,'Prêt appartement résidence principale','512003','660000','160000'),(2,'2021-07-10',90000,0.009,240,'Prêt appart sous les combre','512002','660000','160000'); +/*!40000 ALTER TABLE `Loan` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `LoanEntry` +-- + +DROP TABLE IF EXISTS `LoanEntry`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `LoanEntry` ( + `le_id` int(11) NOT NULL AUTO_INCREMENT, + `le_loan_id` int(11) DEFAULT NULL, + `le_date` date DEFAULT NULL COMMENT 'Echéance de remboursement', + `le_interest` decimal(13,3) DEFAULT '0.000' COMMENT 'Interet restant du', + `le_annuite` decimal(13,3) DEFAULT '0.000' COMMENT 'Annuité mensuelle', + `le_ammorti` decimal(13,3) DEFAULT '0.000' COMMENT 'Montant ammorti', + `le_booked` tinyint(1) DEFAULT '0', + `le_value` decimal(13,3) DEFAULT '0.000', + PRIMARY KEY (`le_id`), + KEY `loan_id` (`le_loan_id`) +) ENGINE=MyISAM AUTO_INCREMENT=107 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `LoanEntry` +-- + +LOCK TABLES `LoanEntry` WRITE; +/*!40000 ALTER TABLE `LoanEntry` DISABLE KEYS */; +INSERT INTO `LoanEntry` VALUES (1,1,'2021-02-10',132.790,881.400,748.610,1,85384.730),(2,1,'2021-03-10',131.630,881.400,749.770,1,84634.960),(3,1,'2021-04-10',130.480,881.400,750.920,1,83884.040),(4,1,'2021-05-10',129.320,881.400,752.080,1,83131.960),(5,1,'2021-06-10',128.160,881.400,753.240,1,82378.720),(6,1,'2021-07-10',127.000,881.400,754.400,1,81624.320),(7,1,'2021-08-10',125.840,881.400,755.560,0,80868.760),(8,1,'2021-09-10',124.670,881.400,756.730,0,80112.030),(9,1,'2021-10-10',123.510,881.400,757.890,0,79354.140),(10,1,'2021-11-10',122.340,881.400,759.060,0,78595.080),(11,1,'2021-12-10',121.170,881.400,760.230,0,77834.850),(12,1,'2022-01-10',120.000,881.400,761.400,0,77073.450),(13,1,'2022-02-10',118.820,881.400,762.580,0,76310.870),(14,1,'2022-03-10',117.650,881.400,763.750,0,75547.120),(15,1,'2022-04-10',116.470,881.400,764.930,0,74782.190),(16,1,'2022-05-10',115.290,881.400,766.110,0,74016.080),(17,1,'2022-06-10',114.110,881.400,767.290,0,73248.790),(18,1,'2022-07-10',112.930,881.400,768.470,0,72480.320),(19,1,'2022-08-10',111.740,881.400,769.660,0,71710.660),(20,1,'2022-09-10',110.550,881.400,770.850,0,70939.810),(21,1,'2022-10-10',109.370,881.400,772.030,0,70167.780),(22,1,'2022-11-10',108.180,881.400,773.220,0,69394.560),(23,1,'2022-12-10',106.980,881.400,774.420,0,68620.140),(24,1,'2023-01-10',105.790,881.400,775.610,0,67844.530),(25,1,'2023-02-10',104.590,881.400,776.810,0,67067.720),(26,1,'2023-03-10',103.400,881.400,778.000,0,66289.720),(27,1,'2023-04-10',102.200,881.400,779.200,0,65510.520),(28,1,'2023-05-10',101.000,881.400,780.400,0,64730.120),(29,1,'2023-06-10',99.790,881.400,781.610,0,63948.510),(30,1,'2023-07-10',98.590,881.400,782.810,0,63165.700),(31,1,'2023-08-10',97.380,881.400,784.020,0,62381.680),(32,1,'2023-09-10',96.170,881.400,785.230,0,61596.450),(33,1,'2023-10-10',94.960,881.400,786.440,0,60810.010),(34,1,'2023-11-10',93.750,881.400,787.650,0,60022.360),(35,1,'2023-12-10',92.530,881.400,788.870,0,59233.490),(36,1,'2024-01-10',91.320,881.400,790.080,0,58443.410),(37,1,'2024-02-10',90.100,881.400,791.300,0,57652.110),(38,1,'2024-03-10',88.880,881.400,792.520,0,56859.590),(39,1,'2024-04-10',87.660,881.400,793.740,0,56065.850),(40,1,'2024-05-10',86.430,881.400,794.970,0,55270.880),(41,1,'2024-06-10',85.210,881.400,796.190,0,54474.690),(42,1,'2024-07-10',83.980,881.400,797.420,0,53677.270),(43,1,'2024-08-10',82.750,881.400,798.650,0,52878.620),(44,1,'2024-09-10',81.520,881.400,799.880,0,52078.740),(45,1,'2024-10-10',80.290,881.400,801.110,0,51277.630),(46,1,'2024-11-10',79.050,881.400,802.350,0,50475.280),(47,1,'2024-12-10',77.820,881.400,803.580,0,49671.700),(48,1,'2025-01-10',76.580,881.400,804.820,0,48866.880),(49,1,'2025-02-10',75.340,881.400,806.060,0,48060.820),(50,1,'2025-03-10',74.090,881.400,807.310,0,47253.510),(51,1,'2025-04-10',72.850,881.400,808.550,0,46444.960),(52,1,'2025-05-10',71.600,881.400,809.800,0,45635.160),(53,1,'2025-06-10',70.350,881.400,811.050,0,44824.110),(54,1,'2025-07-10',69.100,881.400,812.300,0,44011.810),(55,1,'2025-08-10',67.850,881.400,813.550,0,43198.260),(56,1,'2025-09-10',66.600,881.400,814.800,0,42383.460),(57,1,'2025-10-10',65.340,881.400,816.060,0,41567.400),(58,1,'2025-11-10',64.080,881.400,817.320,0,40750.080),(59,1,'2025-12-10',62.820,881.400,818.580,0,39931.500),(60,1,'2026-01-10',61.560,881.400,819.840,0,39111.660),(61,1,'2026-02-10',60.300,881.400,821.100,0,38290.560),(62,1,'2026-03-10',59.030,881.400,822.370,0,37468.190),(63,1,'2026-04-10',57.760,881.400,823.640,0,36644.550),(64,1,'2026-05-10',56.490,881.400,824.910,0,35819.640),(65,1,'2026-06-10',55.220,881.400,826.180,0,34993.460),(66,1,'2026-07-10',53.950,881.400,827.450,0,34166.010),(67,1,'2026-08-10',52.670,881.400,828.730,0,33337.280),(68,1,'2026-09-10',51.390,881.400,830.010,0,32507.270),(69,1,'2026-10-10',50.120,881.400,831.280,0,31675.990),(70,1,'2026-11-10',48.830,881.400,832.570,0,30843.420),(71,1,'2026-12-10',47.550,881.400,833.850,0,30009.570),(72,1,'2027-01-10',46.260,881.400,835.140,0,29174.430),(73,1,'2027-02-10',44.980,881.400,836.420,0,28338.010),(74,1,'2027-03-10',43.690,881.400,837.710,0,27500.300),(75,1,'2027-04-10',42.400,881.400,839.000,0,26661.300),(76,1,'2027-05-10',41.100,881.400,840.300,0,25821.000),(77,1,'2027-06-10',39.810,881.400,841.590,0,24979.410),(78,1,'2027-07-10',38.510,881.400,842.890,0,24136.520),(79,1,'2027-08-10',37.210,881.400,844.190,0,23292.330),(80,1,'2027-09-10',35.910,881.400,845.490,0,22446.840),(81,1,'2027-10-10',34.610,881.400,846.790,0,21600.050),(82,1,'2027-11-10',33.300,881.400,848.100,0,20751.950),(83,1,'2027-12-10',31.990,881.400,849.410,0,19902.540),(84,1,'2028-01-10',30.680,881.400,850.720,0,19051.820),(85,1,'2028-02-10',29.370,881.400,852.030,0,18199.790),(86,1,'2028-03-10',28.060,881.400,853.340,0,17346.450),(87,1,'2028-04-10',26.740,881.400,854.660,0,16491.790),(88,1,'2028-05-10',25.420,881.400,855.980,0,15635.810),(89,1,'2028-06-10',24.110,881.400,857.290,0,14778.520),(90,1,'2028-07-10',22.780,881.400,858.620,0,13919.900),(91,1,'2028-08-10',21.460,881.400,859.940,0,13059.960),(92,1,'2028-09-10',20.130,881.400,861.270,0,12198.690),(93,1,'2028-10-10',18.810,881.400,862.590,0,11336.100),(94,1,'2028-11-10',17.480,881.400,863.920,0,10472.180),(95,1,'2028-12-10',16.140,881.400,865.260,0,9606.920),(96,1,'2029-01-10',14.810,881.400,866.590,0,8740.330),(97,1,'2029-02-10',13.470,881.400,867.930,0,7872.400),(98,1,'2029-03-10',12.140,881.400,869.260,0,7003.140),(99,1,'2029-04-10',10.800,881.400,870.600,0,6132.540),(100,1,'2029-05-10',9.450,881.400,871.950,0,5260.590),(101,1,'2029-06-10',8.110,881.400,873.290,0,4387.300),(102,1,'2029-07-10',6.760,881.400,874.640,0,3512.660),(103,1,'2029-08-10',5.420,881.400,875.980,0,2636.680),(104,1,'2029-09-10',4.060,881.400,877.340,0,1759.340),(105,1,'2029-10-10',2.710,881.400,878.690,0,880.650),(106,1,'2029-11-10',1.360,881.400,880.040,0,0.610); +/*!40000 ALTER TABLE `LoanEntry` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Lot` +-- + +DROP TABLE IF EXISTS `Lot`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Lot` ( + `lot_id` int(11) NOT NULL AUTO_INCREMENT, + `lot_num` int(11) DEFAULT NULL, + `lot_floor` varchar(32) DEFAULT 'RDC', + `lot_area` int(11) DEFAULT '0', + `lot_room` int(11) DEFAULT '0', + `lot_name` varchar(32) DEFAULT NULL, + `lot_type` varchar(32) DEFAULT NULL, + `lot_building` varchar(32) DEFAULT NULL, + `lot_door` varchar(32) DEFAULT NULL, + `lot_description` varchar(256) DEFAULT NULL, + PRIMARY KEY (`lot_id`), + UNIQUE KEY `lot_num` (`lot_num`) +) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Lot` +-- + +LOCK TABLES `Lot` WRITE; +/*!40000 ALTER TABLE `Lot` DISABLE KEYS */; +INSERT INTO `Lot` VALUES (1,1,'1',98,0,'Lot1','Appartement','A','1','Appartement'),(2,2,'2',98,0,'Lot2','Appartement','A','1','Appartement'),(3,3,'2',15,0,'Lot3','Garage','A','1','garage'),(4,4,'1',0,0,'Lot4','Garage','A','','Garage a gauche'),(5,5,'1',0,0,'Lot 5','Jardinet','','','Garage a gauche'),(6,6,'1',5,0,'Lot 6','Appartement','A','1','Test'); +/*!40000 ALTER TABLE `Lot` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `LotsOwners` +-- + +DROP TABLE IF EXISTS `LotsOwners`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `LotsOwners` ( + `lo_id` int(11) NOT NULL AUTO_INCREMENT, + `lo_owner_id` int(11) DEFAULT NULL, + `lo_lot_id` int(11) DEFAULT NULL, + PRIMARY KEY (`lo_id`) +) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `LotsOwners` +-- + +LOCK TABLES `LotsOwners` WRITE; +/*!40000 ALTER TABLE `LotsOwners` DISABLE KEYS */; +INSERT INTO `LotsOwners` VALUES (1,25,3),(6,2,1),(4,25,5),(5,20,6); +/*!40000 ALTER TABLE `LotsOwners` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Temporary table structure for view `Owners` +-- + +DROP TABLE IF EXISTS `Owners`; +/*!50001 DROP VIEW IF EXISTS `Owners`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `Owners` ( + `ident_id` tinyint NOT NULL, + `ident_name` tinyint NOT NULL, + `ident_firstname` tinyint NOT NULL, + `ident_address` tinyint NOT NULL, + `ident_postalcode` tinyint NOT NULL, + `ident_city` tinyint NOT NULL, + `ident_country` tinyint NOT NULL, + `ident_mobile` tinyint NOT NULL, + `ident_phone` tinyint NOT NULL, + `ident_email1` tinyint NOT NULL, + `ident_email2` tinyint NOT NULL, + `idr_name` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +-- +-- Table structure for table `Pcg` +-- + +DROP TABLE IF EXISTS `Pcg`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Pcg` ( + `pcg_id` int(11) NOT NULL AUTO_INCREMENT, + `pcg_acc` varchar(16) DEFAULT '', + `pcg_acc_name` varchar(255) DEFAULT '', + `pcg_acc_type` varchar(1) DEFAULT '', + PRIMARY KEY (`pcg_id`) +) ENGINE=MyISAM AUTO_INCREMENT=112 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Pcg` +-- + +LOCK TABLES `Pcg` WRITE; +/*!40000 ALTER TABLE `Pcg` DISABLE KEYS */; +INSERT INTO `Pcg` VALUES (1,'1','COMPTES DE CAPITAUX',''),(2,'101','Capital',''),(3,'105','Ecarts de réévaluation',''),(4,'1061','Réserve légale',''),(5,'1062','Réserves indisponible',''),(6,'1063','Réserves statutaires ou contractuelles',''),(7,'1064','Réserves réglementées',''),(8,'1068','Autres réserves',''),(9,'11','REPORT A NOUVEAU',''),(10,'12','RESULTAT NET DE L EXERCICE',''),(11,'145','Amortissements dérogatories',''),(12,'146','Provision spéciale de réévaluation',''),(13,'147','Plus-values réinvesties',''),(14,'148','Autres provisions réglementées',''),(15,'15','PROVISIONS POUR RISQUES ET CHARGES',''),(16,'16','EMPRUNTS ET DETTES ASSIMILEES',''),(17,'2','COMPTES D\'IMMOBILISATIONS',''),(18,'201','Frais d\'établissement',''),(19,'206','Droit au bail',''),(20,'207','Fonds commercial',''),(21,'208','Autres immobilisations incorporelles',''),(22,'21','IMMOBILISATIONS CORPORELLES',''),(23,'23','IMMOBILISATIONS EN COURS',''),(24,'27','AUTRES IMMOBILISATIONS FINANCIERES',''),(25,'280','Amortissements des immobilisations incorporelles',''),(26,'281','Amortissements des immobilisations corporelles',''),(27,'290','Provisions pour dépréciation des immobilisations incorporelles',''),(28,'291','Provisions pour dépréciation des immobilisations corporelles',''),(29,'297','Provisions pour dépréciation des autres immobilisations financières',''),(30,'3','COMPTES DE STOCKS ET D\'EN-COURS',''),(31,'31','MATIERES PREMIERES',''),(32,'32','AUTRES APPROVISIONNEMENTS',''),(33,'33','EN-COURS DE PRODUCTION DE BIENS',''),(34,'34','EN-COURS DE PRODUCTION DE SERVICES',''),(35,'35','STOCKS DE PRODUITS',''),(36,'37','STOCKS DE MARCHANDISES',''),(37,'391','Provisions pour dépréciation des matières premières',''),(38,'392','Provisions pour dépréciation des autres approvisionnements',''),(39,'393','Provisions pour dépréciation des en-cours de production des biens',''),(40,'394','Provisions pour dépréciation des en-cours de production de services',''),(41,'395','Provisions pour dépréciation des stocks de produits',''),(42,'397','Provisions pour dépréciation des stocks de marchandises',''),(43,'4','COMPTES DE TIERS',''),(44,'400','Fournisseurs et Comptes rattachés',''),(45,'409','Fournisseurs débiteurs',''),(46,'410','Clients et Comptes rattachés',''),(47,'419','Clients débiteurs',''),(48,'421','Personnel - Rémunérations dues',''),(49,'428','Personnel - Charges à payer et produits à recevoir',''),(50,'43','SECURITE SOCIALE ET AUTRES ORGANISMES SOCIAUX',''),(51,'444','Etat - Impôts sur les bénéfices',''),(52,'445','Etat - Taxes sur le chiffre d\'affaires',''),(53,'447','Autres impôts, taxes et versements assimilés',''),(54,'455','Associés - Comptes courants',''),(55,'46','DEBITEURS ET CREDITEURS DIVERS',''),(56,'47','COMPTES TRANSITOIRES OU D\'ATTENTE',''),(57,'481','Charges à répartir sur plusieurs exercices',''),(58,'486','Charges constatées d\'avance',''),(59,'487','Produits constatés d\'avance',''),(60,'491','Provisions pour dépréciation des comptes de clients',''),(61,'496','Provisions pour dépréciation des débiteurs divers',''),(62,'5','COMPTES FINANCIERS',''),(63,'50','VALEURS MOBILIERES DE PLACEMENT',''),(64,'51','BANQUES ETABLISSEMENTS FINANCIERS ET ASSIMILES',''),(65,'53','CAISSE',''),(66,'54','REGIS D\'AVANCES ET ACCREDITIFS',''),(67,'58','VIREMENTS INTERNES',''),(68,'590','Provisions pour dépréciation des valeurs mobilières de placement',''),(69,'6','COMPTES DE CHARGES',''),(70,'60','ACHATS (saufs 603)',''),(71,'603','VARIATION DES STOCKS',''),(72,'61','Services Exterieurs',''),(73,'62','Autres services extérieurs',''),(74,'63','IMPôTS TAXES ET VERSEMENT ASSIMILES',''),(75,'641','Rémunération du personnel',''),(76,'644','Rémunération du travail de l\'exploitant',''),(77,'645','Charges de sécurité sociale et de prévoyance',''),(78,'646','Cotisations sociales personnelles de l\'exploitant',''),(79,'65','AUTRES CHARGES DE GESTIONS COURANTE',''),(80,'66','CHARGES FINANCIERES',''),(81,'67','CHARGES EXCEPTIONNELLES',''),(82,'681','Dotations aux amortissements et aux provisions - Charges d\'exploitation',''),(83,'686','Dotations aux amortissements et aux provisions - Charges financières',''),(84,'687','Dotations aux amortissements et aux provisions - Charges exceptionnelles',''),(85,'691','Participation des salariés aux fruits de l\'expansion',''),(86,'695','Impôts sur les bénéfices',''),(87,'697','Imposition forfaitaire annuelle des sociétés',''),(88,'699','Produits - Reports en arrière des déficits',''),(89,'7','COMPTES DE PRODUITS',''),(90,'701','Ventes de produits finis',''),(91,'706','Prestations de services',''),(92,'707','Ventes de marchandises',''),(93,'708','Produits des activités annexes',''),(94,'709','Rabais, remises et ristournes accordés par l\'entreprise',''),(95,'713','VARIATION DES STOCKS (en-cours de production)',''),(96,'72','PRODUCTION IMMOBILISEE',''),(97,'74','SUBVENTIONS D\'EXPLOITATION',''),(98,'75','AUTRES PRODUITS DE GESTION COURANTE',''),(99,'76','PRODUITS FINANCIERS',''),(100,'77','PRODUITS EXCEPTIONNELS',''),(101,'781','Reprises sur amortissements et provisions (à inscrire dans les produits d\'exploitation)',''),(102,'786','Reprises sur provisions (à inscrire dans les produits fianciers)',''),(103,'787','Reprises sur provisions (à inscrire dans les produits exceptionnels)',''),(104,'79','TRANSFERTS DE CHARGES',''),(105,'8','COMPTES SCPECIAUX',''),(106,'80','ENGAGEMENTS HORS BILAN',''),(107,'801','Engagements donnés par l\'entreprise',''),(108,'802','Engagements reçus par l\'entreprise',''),(109,'809','Contrepartie des engagements',''),(110,'88','RESULTAT EN INSTANCE D\'AFFECTATION',''),(111,'89','BILAN',''); +/*!40000 ALTER TABLE `Pcg` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Period` +-- + +DROP TABLE IF EXISTS `Period`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Period` ( + `per_id` int(11) NOT NULL AUTO_INCREMENT, + `per_begin` date DEFAULT NULL, + `per_end` date DEFAULT NULL, + `per_string` varchar(32) DEFAULT NULL, + `per_repart_charge_end` tinyint(1) DEFAULT '1', + `per_closed` tinyint(1) DEFAULT '0', + `per_approved` tinyint(1) DEFAULT '0', + PRIMARY KEY (`per_id`) +) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Period` +-- + +LOCK TABLES `Period` WRITE; +/*!40000 ALTER TABLE `Period` DISABLE KEYS */; +INSERT INTO `Period` VALUES (1,'2019-01-01','2019-12-31','2019',1,0,0),(5,'2021-01-01','2021-12-01','2021',1,0,0),(4,'2020-01-01','2020-12-31','2020',1,0,0),(6,'2022-01-04','2022-12-31','2022',1,0,0); +/*!40000 ALTER TABLE `Period` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `PosteCharge` +-- + +DROP TABLE IF EXISTS `PosteCharge`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `PosteCharge` ( + `pc_id` int(11) NOT NULL AUTO_INCREMENT, + `pc_sz` int(11) DEFAULT '0', + `pc_name` varchar(64) DEFAULT NULL, + `pc_comment` varchar(256) DEFAULT NULL, + PRIMARY KEY (`pc_id`) +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `PosteCharge` +-- + +LOCK TABLES `PosteCharge` WRITE; +/*!40000 ALTER TABLE `PosteCharge` DISABLE KEYS */; +INSERT INTO `PosteCharge` VALUES (1,0,'PC1','Charges Générales'),(2,0,'PC2','Charges Exceptionnelles'),(3,0,'PC3','Non Utilisé'),(4,0,'PC4','Charges Chauffage'),(5,0,'PC5','Charges Eau'); +/*!40000 ALTER TABLE `PosteCharge` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Recurrent` +-- + +DROP TABLE IF EXISTS `Recurrent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Recurrent` ( + `r_id` int(11) NOT NULL AUTO_INCREMENT, + `r_desc` varchar(64) NOT NULL DEFAULT '""', + `r_amount` decimal(13,2) NOT NULL DEFAULT '0.00', + `r_date` date NOT NULL, + `r_end` date NOT NULL, + `r_next` date NOT NULL, + `r_period` int(11) NOT NULL DEFAULT '1' COMMENT 'unit is month', + PRIMARY KEY (`r_id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='Recurrent operations that can be handled wih cron'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Recurrent` +-- + +LOCK TABLES `Recurrent` WRITE; +/*!40000 ALTER TABLE `Recurrent` DISABLE KEYS */; +INSERT INTO `Recurrent` VALUES (1,'Free Mobile Andre',2.00,'2021-01-20','2022-12-20','2021-08-20',1),(2,'Free Mobile Eloise',2.00,'2021-01-20','2022-12-20','2021-08-20',1),(3,'SFR Mobile Eloise',5.00,'2021-01-10','2022-12-20','2021-08-10',1),(4,'SFR Mobile Andre',5.00,'2021-01-20','2022-12-20','2021-08-20',1),(5,'Bouygues Internet',16.98,'2021-01-20','2022-12-20','2021-06-10',1),(6,'LCL Frais bancaire ass moyen de payement',4.20,'2021-01-20','2022-12-20','2021-08-20',1),(7,'LCL Frais bancaire carte visa',11.90,'2021-01-20','2022-12-20','2021-08-20',1),(8,'LBP Frais bancaire M et Mme',41.10,'2021-01-20','2022-04-20','2021-10-20',3),(9,'Impot Taxe Habitation',161.00,'2021-01-15','2022-12-15','2021-08-15',1),(10,'Impot Taxe Foncière',141.00,'2021-01-15','2022-12-15','2021-08-15',1),(11,'Charges de copropriétés',180.00,'2021-01-15','2022-12-15','2021-08-15',1),(12,'Don église Epis',120.00,'2021-01-15','2022-12-15','2021-08-15',1),(13,'Assurance Gras Savoye',14.06,'2021-06-17','2022-12-15','2021-08-17',1); +/*!40000 ALTER TABLE `Recurrent` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `RecurrentEntry` +-- + +DROP TABLE IF EXISTS `RecurrentEntry`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `RecurrentEntry` ( + `re_id` int(11) NOT NULL AUTO_INCREMENT, + `re_rec_id` int(11) NOT NULL, + `re_entry_type` varchar(2) NOT NULL, + `re_debit_credit` enum('d','c') NOT NULL DEFAULT 'd', + `re_amount` decimal(13,3) NOT NULL DEFAULT '0.000', + `re_acc` varchar(16) NOT NULL, + PRIMARY KEY (`re_id`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `RecurrentEntry` +-- + +LOCK TABLES `RecurrentEntry` WRITE; +/*!40000 ALTER TABLE `RecurrentEntry` DISABLE KEYS */; +INSERT INTO `RecurrentEntry` VALUES (1,1,'HA','c',2.000,'401012'),(2,1,'HA','d',2.000,'626000'),(3,1,'BQ','d',2.000,'401012'),(4,1,'BQ','c',2.000,'512001'),(5,2,'HA','c',2.000,'401012'),(6,2,'HA','d',2.000,'626000'),(7,2,'BQ','d',2.000,'401012'),(8,2,'BQ','c',2.000,'512002'),(9,3,'HA','c',5.000,'401012'),(10,3,'HA','d',5.000,'626000'),(11,3,'BQ','d',5.000,'401012'),(12,3,'BQ','c',5.000,'512002'),(13,4,'HA','c',5.000,'401012'),(14,4,'HA','d',5.000,'626000'),(15,4,'BQ','d',5.000,'401012'),(16,4,'BQ','c',5.000,'512002'),(17,5,'HA','c',5.000,'401009'),(18,5,'HA','d',5.000,'626000'),(19,5,'BQ','d',5.000,'401009'),(20,5,'BQ','c',5.000,'512004'),(21,9,'BQ','d',161.000,'630000'),(22,9,'BQ','c',161.000,'512003'),(23,10,'BQ','d',141.000,'630000'),(24,10,'BQ','c',141.000,'512003'),(25,11,'BQ','d',180.000,'614000'),(26,11,'BQ','c',180.000,'512003'),(27,7,'BQ','c',11.900,'512003'),(28,7,'BQ','d',11.900,'627000'),(29,6,'BQ','c',4.200,'512003'),(30,6,'BQ','d',4.200,'627000'),(31,12,'BQ','d',120.000,'623800'),(32,12,'BQ','c',120.000,'512003'),(33,8,'BQ','c',41.100,'512002'),(34,8,'BQ','d',41.100,'627000'),(35,13,'BQ','c',14.060,'512002'),(36,13,'BQ','d',14.060,'616000'); +/*!40000 ALTER TABLE `RecurrentEntry` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Temporary table structure for view `Suppliers` +-- + +DROP TABLE IF EXISTS `Suppliers`; +/*!50001 DROP VIEW IF EXISTS `Suppliers`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `Suppliers` ( + `ident_id` tinyint NOT NULL, + `ident_name` tinyint NOT NULL, + `ident_firstname` tinyint NOT NULL, + `ident_address` tinyint NOT NULL, + `ident_postalcode` tinyint NOT NULL, + `ident_city` tinyint NOT NULL, + `ident_country` tinyint NOT NULL, + `ident_mobile` tinyint NOT NULL, + `ident_phone` tinyint NOT NULL, + `ident_email1` tinyint NOT NULL, + `ident_email2` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +-- +-- Table structure for table `Tantieme` +-- + +DROP TABLE IF EXISTS `Tantieme`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Tantieme` ( + `tant_id` int(11) NOT NULL AUTO_INCREMENT, + `tant_pc_id` int(11) DEFAULT NULL, + `tant_lot_num` int(11) DEFAULT NULL, + `tant_lot_size` decimal(13,3) DEFAULT NULL, + PRIMARY KEY (`tant_id`) +) ENGINE=MyISAM AUTO_INCREMENT=22 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Tantieme` +-- + +LOCK TABLES `Tantieme` WRITE; +/*!40000 ALTER TABLE `Tantieme` DISABLE KEYS */; +INSERT INTO `Tantieme` VALUES (1,1,1,1000.000),(2,1,2,0.000),(3,1,3,0.000),(4,2,1,359.000),(5,2,2,241.000),(6,2,3,290.000),(7,4,1,240.000),(8,4,2,340.000),(9,4,3,40.000),(10,5,1,333.000),(11,5,2,666.000),(12,5,3,1.000),(13,1,5,0.000),(14,1,4,0.000),(15,2,4,100.000),(16,2,5,10.000),(17,5,4,0.000),(18,5,5,0.000),(19,4,4,380.000),(20,4,5,0.000),(21,1,6,0.000); +/*!40000 ALTER TABLE `Tantieme` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `TransactionEntry` +-- + +DROP TABLE IF EXISTS `TransactionEntry`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `TransactionEntry` ( + `trans_entry_id` int(11) NOT NULL AUTO_INCREMENT, + `trans_id` int(11) DEFAULT NULL, + `entry_date` date DEFAULT NULL, + `entry_type` varchar(2) DEFAULT NULL, + `acc_id` varchar(32) DEFAULT NULL, + `orig_amount` decimal(13,2) DEFAULT NULL, + `amount` decimal(13,3) DEFAULT NULL, + `debit_credit` enum('d','c') DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `voucher_ref` varchar(255) DEFAULT NULL, + `tret_key_id` int(11) DEFAULT '0', + PRIMARY KEY (`trans_entry_id`), + KEY `FK_TransTransEntry` (`trans_id`) +) ENGINE=MyISAM AUTO_INCREMENT=885 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `TransactionEntry` +-- + +LOCK TABLES `TransactionEntry` WRITE; +/*!40000 ALTER TABLE `TransactionEntry` DISABLE KEYS */; +INSERT INTO `TransactionEntry` VALUES (1,1,'2019-06-04','BQ','450001',120.00,120.000,'c','versement test','VIREMENT ',0),(2,1,'2019-06-04','BQ','512001',120.00,120.000,'d','versement test','VIREMENT ',0),(3,2,'2019-06-04','HA','602000',34.00,34.000,'d','facture es juin','gdrcgh',1),(4,2,'2019-06-04','HA','401001',34.00,34.000,'c','facture es juin','gdrcgh',1),(14,6,'2019-06-08','OD','450001',199.80,199.800,'d','Repartion Charges compte 601000 Cle: 5','',0),(13,6,'2019-06-08','OD','601000',300.00,300.000,'c','Repartion Charges compte 601000 Cle: 5','',5),(9,4,'2019-06-08','HA','602000',30.00,30.000,'d','Test Charge Intermédiaire','',1),(10,4,'2019-06-08','HA','401001',30.00,30.000,'c','Test Charge Intermédiaire','',1),(15,6,'2019-06-08','OD','450002',99.90,99.900,'d','Repartion Charges compte 601000 Cle: 5','',0),(11,5,'2019-06-08','HA','601000',300.00,300.000,'d','Facture EAU','',5),(12,5,'2019-06-08','HA','401002',300.00,300.000,'c','Facture EAU','',5),(16,6,'2019-06-08','OD','450003',0.30,0.300,'d','Repartion Charges compte 601000 Cle: 5','',0),(17,7,'2019-06-08','OD','602000',64.00,64.000,'c','Repartion Charges compte 602000 Cle: 1','',1),(18,7,'2019-06-08','OD','450001',22.08,22.080,'d','Repartion Charges compte 602000 Cle: 1','',0),(19,7,'2019-06-08','OD','450002',22.08,22.080,'d','Repartion Charges compte 602000 Cle: 1','',0),(20,7,'2019-06-08','OD','450003',13.57,13.568,'d','Repartion Charges compte 602000 Cle: 1','',0),(21,8,'2019-06-08','HA','602000',34.50,34.500,'d','Last EDF to check','REFAK10_01',1),(22,8,'2019-06-08','HA','401001',34.50,34.500,'c','Last EDF to check','REFAK10_01',1),(23,9,'2019-06-08','OD','602000',34.50,34.500,'c','Répartion 34.50€ du compte 602000 Clé 1','',1),(24,9,'2019-06-08','OD','450001',11.90,11.903,'d','Répartion 34.50€ du compte 602000 Clé 1','',0),(25,9,'2019-06-08','OD','450002',11.90,11.903,'d','Répartion 34.50€ du compte 602000 Clé 1','',0),(26,9,'2019-06-08','OD','450003',7.31,7.314,'d','Répartion 34.50€ du compte 602000 Clé 1','',0),(27,10,'2019-06-10','BQ','450001',150.00,150.000,'c','Virement Mai 2019','VIREMENT',0),(28,10,'2019-06-10','BQ','512001',150.00,150.000,'d','Virement Mai 2019','VIREMENT',0),(29,11,'2019-06-10','BQ','450002',100.00,100.000,'c','Virement Mai 2019','VIREMENT',0),(30,11,'2019-06-10','BQ','512001',100.00,100.000,'d','Virement Mai 2019','VIREMENT',0),(31,12,'2019-06-10','BQ','512001',34.00,34.000,'c','Payer facture','CHEQUE N°xxx',0),(32,12,'2019-06-10','BQ','401001',34.00,34.000,'d','Payer facture','CHEQUE N°xxx',0),(33,13,'2019-06-10','BQ','512001',30.00,30.000,'c','payer es','CHEQUE N°563422',0),(34,13,'2019-06-10','BQ','401001',30.00,30.000,'d','payer es','CHEQUE N°563422',0),(35,14,'2021-01-02','HA','607000',96.97,96.970,'d','Courses pour la semaine','',1),(36,14,'2021-01-02','HA','401004',96.97,96.970,'c','Courses pour la semaine','',1),(37,15,'2021-01-09','HA','607000',92.00,92.000,'d','Course','',1),(38,15,'2021-01-09','HA','401004',92.00,92.000,'c','Course','',1),(39,16,'2021-01-14','HA','607000',44.31,44.310,'d','courses','',1),(40,16,'2021-01-14','HA','401004',44.31,44.310,'c','courses','',1),(41,17,'2021-01-16','HA','607000',9.03,9.030,'d','Luges enfants','',1),(42,17,'2021-01-16','HA','401005',9.03,9.030,'c','Luges enfants','',1),(43,18,'2021-01-05','HA','602000',129.96,129.960,'d','Es jan 2021','',1),(44,18,'2021-01-05','HA','401001',129.96,129.960,'c','Es jan 2021','',1),(45,19,'2021-01-07','HA','626000',16.98,16.980,'d','Internet janv 2021','',1),(46,19,'2021-01-07','HA','401009',16.98,16.980,'c','Internet janv 2021','',1),(47,20,'2021-01-08','HA','626000',11.99,11.990,'d','Domain DNS','',1),(48,20,'2021-01-08','HA','401010',11.99,11.990,'c','Domain DNS','',1),(49,21,'2021-01-10','HA','606101',22.30,22.300,'d','Essence mercedes','',1),(50,21,'2021-01-10','HA','401006',22.30,22.300,'c','Essence mercedes','',1),(51,22,'2021-01-16','HA','616000',162.88,162.880,'d','Assurance Habitation 1 semestre 2021','',1),(52,22,'2021-01-16','HA','401007',162.88,162.880,'c','Assurance Habitation 1 semestre 2021','',1),(53,23,'2021-01-21','HA','607000',133.32,133.320,'d','Course janv 3iem semaine','',1),(54,23,'2021-01-21','HA','401004',133.32,133.320,'c','Course janv 3iem semaine','',1),(55,24,'2021-01-21','HA','607000',5.99,5.990,'d','Masques covid','',1),(56,24,'2021-01-21','HA','401011',5.99,5.990,'c','Masques covid','',1),(57,25,'2021-01-02','AN','512003',12855.16,12855.160,'d',NULL,NULL,0),(59,25,'2021-01-02','AN','512001',8281.73,8281.730,'d',NULL,NULL,0),(65,27,'2021-01-29','FR','627000',11.90,11.900,'d',NULL,NULL,0),(64,26,'2021-01-29','FR','512003',4.20,4.200,'c',NULL,NULL,0),(63,26,'2021-01-29','FR','627000',4.20,4.200,'d',NULL,NULL,0),(66,27,'2021-01-29','FR','512003',11.90,11.900,'c',NULL,NULL,0),(73,25,'2021-01-02','AN','164001',86880.80,86880.800,'c',NULL,NULL,0),(67,28,'2021-01-10','BQ','512003',881.40,881.400,'c',NULL,NULL,0),(71,25,'2021-01-02','AN','512005',22864.37,22864.370,'d',NULL,NULL,0),(69,28,'2021-01-29','BQ','164001',747.46,747.460,'d',NULL,NULL,0),(70,28,'2021-01-29','BQ','660000',133.94,133.940,'d',NULL,NULL,0),(72,25,'2021-01-02','AN','512006',15333.22,15333.220,'d',NULL,NULL,0),(74,29,'2021-01-29','BQ','512004',129.96,129.960,'c','Payer ES via Internet','VISA',0),(75,29,'2021-01-29','BQ','401001',129.96,129.960,'d','Payer ES via Internet','VISA',0),(76,30,'2021-01-17','BQ','512004',9.03,9.030,'c','Payer luges','VISA',0),(77,30,'2021-01-17','BQ','401005',9.03,9.030,'d','Payer luges','VISA',0),(78,31,'2021-01-29','BQ','512004',22.30,22.300,'c','Payer essence M','VISA LCL',0),(79,31,'2021-01-29','BQ','401006',22.30,22.300,'d','Payer essence M','VISA LCL',0),(91,37,'2021-01-29','BQ','630000',161.00,161.000,'d',NULL,NULL,0),(90,37,'2021-01-29','BQ','512003',161.00,161.000,'c',NULL,NULL,0),(82,33,'2021-01-29','BQ','512004',16.98,16.980,'c','Payer Numericable Internet','VISA LCL',0),(83,33,'2021-01-29','BQ','401009',16.98,16.980,'d','Payer Numericable Internet','VISA LCL',0),(84,34,'2021-01-29','BQ','512004',5.99,5.990,'c','Payer masques','VISA LCL',0),(85,34,'2021-01-29','BQ','401011',5.99,5.990,'d','Payer masques','VISA LCL',0),(86,35,'2021-01-29','BQ','512004',366.60,366.600,'c','Payer LIDL 3 premières semaines','VISA LCL ',0),(87,35,'2021-01-29','BQ','401004',366.60,366.600,'d','Payer LIDL 3 premières semaines','VISA LCL ',0),(88,36,'2021-01-29','BQ','512004',11.99,11.990,'c','Payer domain internet','VISA LCL',0),(89,36,'2021-01-29','BQ','401010',11.99,11.990,'d','Payer domain internet','VISA LCL',0),(96,39,'2021-01-29','VT','410001',2884.31,2884.310,'d',NULL,NULL,0),(94,38,'2021-01-29','BQ','512003',141.00,141.000,'c',NULL,NULL,0),(95,38,'2021-01-29','BQ','630000',141.00,141.000,'d',NULL,NULL,0),(97,39,'2021-01-29','VT','701000',2884.31,2884.310,'c',NULL,NULL,0),(98,40,'2021-01-29','BQ','512003',2884.31,2884.310,'d',NULL,NULL,0),(99,40,'2021-01-29','BQ','410001',2884.31,2884.310,'c',NULL,NULL,0),(100,41,'2021-01-29','BQ','512003',26.82,26.820,'c',NULL,NULL,0),(101,41,'2021-01-29','BQ','616000',26.82,26.820,'d',NULL,NULL,0),(102,42,'2021-01-30','HA','607000',137.49,137.490,'d','LIDL COURSE 1 sem fev','Ticket de caisse',1),(103,42,'2021-01-30','HA','401004',137.49,137.490,'c','LIDL COURSE 1 sem fev','Ticket de caisse',1),(104,25,'2021-01-02','AN','271001',2013.06,2013.060,'d',NULL,NULL,0),(105,25,'2021-01-02','AN','271002',929.85,929.850,'d',NULL,NULL,0),(106,43,'2021-02-01','OD','410001',959.80,959.800,'c',NULL,NULL,0),(107,43,'2021-02-01','OD','271002',959.80,959.800,'d',NULL,NULL,0),(108,44,'2021-01-02','HA','626000',2.00,2.000,'d','Abonnement Free','CCP N°1',1),(109,44,'2021-01-02','HA','401012',2.00,2.000,'c','Abonnement Free','CCP N°1',1),(110,45,'2021-01-20','FR','512003',0.32,0.320,'d',NULL,NULL,0),(111,45,'2021-01-20','FR','627000',0.32,0.320,'c',NULL,NULL,0),(112,46,'2021-01-30','BQ','512004',562.85,562.850,'d',NULL,NULL,0),(113,46,'2021-01-30','BQ','512003',562.85,562.850,'c',NULL,NULL,0),(114,47,'2021-02-02','BQ','512004',137.49,137.490,'c','Payer LIDL 1 semaine fév 2021','VISA ',0),(115,47,'2021-02-02','BQ','401004',137.49,137.490,'d','Payer LIDL 1 semaine fév 2021','VISA ',0),(116,48,'2021-01-10','BQ','512001',2.00,2.000,'c','Payer free mobile','PRELEVEMENT',0),(117,48,'2021-01-10','BQ','401012',2.00,2.000,'d','Payer free mobile','PRELEVEMENT',0),(118,49,'2021-01-12','FR','512001',12.00,12.000,'c',NULL,NULL,0),(119,49,'2021-01-12','FR','627000',12.00,12.000,'d',NULL,NULL,0),(120,50,'2021-01-10','FR','512001',18.90,18.900,'c',NULL,NULL,0),(121,50,'2021-01-10','FR','627000',18.90,18.900,'d',NULL,NULL,0),(122,51,'2021-01-20','OD','512001',1388.00,1388.000,'d',NULL,NULL,0),(123,51,'2021-01-20','OD','630000',1388.00,1388.000,'c',NULL,NULL,0),(124,25,'2021-01-02','AN','213101',232000.00,232000.000,'d',NULL,NULL,0),(125,25,'2021-01-02','AN','271003',4516.57,4516.570,'d',NULL,NULL,0),(126,52,'2021-02-06','HA','626000',16.98,16.980,'d','Facture numericable fev 2021','',1),(127,52,'2021-02-06','HA','401009',16.98,16.980,'c','Facture numericable fev 2021','',1),(128,53,'2021-02-06','HA','626000',2.00,2.000,'d','Facture mobile fev 2021','',1),(129,53,'2021-02-06','HA','401012',2.00,2.000,'c','Facture mobile fev 2021','',1),(130,54,'2021-02-06','BQ','512004',162.88,162.880,'c','Payer groupama','Visa',0),(131,54,'2021-02-06','BQ','401007',162.88,162.880,'d','Payer groupama','Visa',0),(132,55,'2021-02-06','HA','606102',14.00,14.000,'d','Achat masque','Carte Visa',1),(133,55,'2021-02-06','HA','401014',14.00,14.000,'c','Achat masque','Carte Visa',1),(134,56,'2021-02-06','HA','607000',108.33,108.330,'d','Course LIDL pour seconde semaine fév','',1),(135,56,'2021-02-06','HA','401004',108.33,108.330,'c','Course LIDL pour seconde semaine fév','',1),(136,57,'2021-02-09','BQ','512003',26.82,26.820,'c',NULL,NULL,0),(137,57,'2021-02-09','BQ','616000',26.82,26.820,'d',NULL,NULL,0),(138,58,'2021-02-09','BQ','512004',108.33,108.330,'c','Payer LIDL','VISA',0),(139,58,'2021-02-09','BQ','401004',108.33,108.330,'d','Payer LIDL','VISA',0),(140,59,'2021-02-09','BQ','512004',14.00,14.000,'c','Paye masques ','VISA',0),(141,59,'2021-02-09','BQ','401014',14.00,14.000,'d','Paye masques ','VISA',0),(142,60,'2021-02-09','BQ','512004',16.98,16.980,'c','payer internet','VISA',0),(143,60,'2021-02-09','BQ','401009',16.98,16.980,'d','payer internet','VISA',0),(144,61,'2021-02-11','BQ','512003',881.40,881.400,'c',NULL,NULL,0),(145,61,'2021-02-11','BQ','660000',132.79,132.790,'d',NULL,NULL,0),(146,61,'2021-02-11','BQ','164001',748.61,748.610,'d',NULL,NULL,0),(147,62,'2021-02-11','HA','606103',74.50,74.500,'d','Sac cadeau eloise','',1),(148,62,'2021-02-11','HA','401013',74.50,74.500,'c','Sac cadeau eloise','',1),(151,64,'2021-02-11','BQ','512004',74.50,74.500,'c','Payer sac saint valentin','VISA',0),(152,64,'2021-02-11','BQ','401013',74.50,74.500,'d','Payer sac saint valentin','VISA',0),(153,65,'2021-02-13','HA','607000',144.31,144.310,'d','Lidl fev 2 sem','Ticket de caissd',1),(154,65,'2021-02-13','HA','401004',144.31,144.310,'c','Lidl fev 2 sem','Ticket de caissd',1),(155,66,'2021-02-13','BQ','512004',144.31,144.310,'c','Payer LIDL','VISA',0),(156,66,'2021-02-13','BQ','401004',144.31,144.310,'d','Payer LIDL','VISA',0),(157,67,'2021-02-13','FR','512003',4.20,4.200,'c',NULL,NULL,0),(158,67,'2021-02-13','FR','627000',4.20,4.200,'d',NULL,NULL,0),(159,68,'2021-02-13','BQ','512003',360.00,360.000,'c',NULL,NULL,0),(160,68,'2021-02-13','BQ','614000',360.00,360.000,'d',NULL,NULL,0),(161,25,'2021-01-02','AN','89',211913.16,247955.050,'c',NULL,NULL,0),(162,69,'2021-02-16','BQ','512003',161.00,161.000,'c',NULL,NULL,0),(163,69,'2021-02-16','BQ','630000',161.00,161.000,'d',NULL,NULL,0),(164,70,'2021-02-16','BQ','512003',141.00,141.000,'c',NULL,NULL,0),(165,70,'2021-02-16','BQ','630000',141.00,141.000,'d',NULL,NULL,0),(166,71,'2021-02-17','BQ','606101',69.09,69.090,'d',NULL,NULL,0),(167,71,'2021-02-17','BQ','512002',69.09,69.090,'c',NULL,NULL,0),(168,72,'2021-01-28','BQ','512002',19.16,19.160,'c',NULL,NULL,0),(169,72,'2021-01-28','BQ','607000',19.16,19.160,'d',NULL,NULL,0),(170,73,'2021-02-20','HA','607000',110.30,110.300,'d','Course LIDL 3 sem','Ticket de caisse',1),(171,73,'2021-02-20','HA','401004',110.30,110.300,'c','Course LIDL 3 sem','Ticket de caisse',1),(172,74,'2021-02-20','BQ','512004',110.30,110.300,'c','Payer lidl 3sem fév','Visa',0),(173,74,'2021-02-20','BQ','401004',110.30,110.300,'d','Payer lidl 3sem fév','Visa',0),(174,75,'2021-02-22','HA','602000',149.18,149.180,'d','ES Février 2021','21170826S',1),(175,75,'2021-02-22','HA','401001',149.18,149.180,'c','ES Février 2021','21170826S',1),(178,77,'2021-02-26','HA','672000',225.16,225.160,'d','Materiel pour mur salon','61195',1),(179,77,'2021-02-26','HA','401015',225.16,225.160,'c','Materiel pour mur salon','61195',1),(180,78,'2021-02-26','HA','605000',23.70,23.700,'d','Outils pour fixation placo','132674',1),(181,78,'2021-02-26','HA','401015',23.70,23.700,'c','Outils pour fixation placo','132674',1),(182,79,'2021-02-26','BQ','410001',3216.83,3216.830,'c',NULL,NULL,0),(183,79,'2021-02-26','BQ','512003',3216.83,3216.830,'d',NULL,NULL,0),(184,80,'2021-02-26','VT','410001',3216.83,3216.830,'d',NULL,NULL,0),(185,80,'2021-02-26','VT','701000',3216.83,3216.830,'c',NULL,NULL,0),(186,81,'2021-02-27','BQ','512004',768.79,768.790,'d',NULL,NULL,0),(187,81,'2021-02-27','BQ','512003',768.79,768.790,'c',NULL,NULL,0),(188,82,'2021-02-27','BQ','512001',2.00,2.000,'c','Payer Free fév','PRELEVEMENT CCP N°2',0),(189,82,'2021-02-27','BQ','401012',2.00,2.000,'d','Payer Free fév','PRELEVEMENT CCP N°2',0),(190,83,'2021-02-23','FR','627000',11.90,11.900,'d',NULL,NULL,0),(191,83,'2021-02-23','FR','512003',11.90,11.900,'c',NULL,NULL,0),(192,84,'2021-02-27','HA','607000',108.47,108.470,'d','LIDL 27 fév','Ticket de caisse',1),(193,84,'2021-02-27','HA','401004',108.47,108.470,'c','LIDL 27 fév','Ticket de caisse',1),(194,85,'2021-02-27','HA','606101',52.30,52.300,'d','Essence plein mercedes','Ticket de caisse',1),(195,85,'2021-02-27','HA','401006',52.30,52.300,'c','Essence plein mercedes','Ticket de caisse',1),(196,86,'2021-02-27','BQ','512004',225.16,225.160,'c','Payer BigMat cloison','VISA',0),(197,86,'2021-02-27','BQ','401015',225.16,225.160,'d','Payer BigMat cloison','VISA',0),(198,87,'2021-02-27','BQ','512004',23.70,23.700,'c','Payer petit matériel Bigmat','VISA',0),(199,87,'2021-02-27','BQ','401015',23.70,23.700,'d','Payer petit matériel Bigmat','VISA',0),(200,88,'2021-02-27','BQ','512004',108.47,108.470,'c','Payer courses 1 semaine mars','VISA',0),(201,88,'2021-02-27','BQ','401004',108.47,108.470,'d','Payer courses 1 semaine mars','VISA',0),(202,89,'2021-02-27','BQ','512004',149.18,149.180,'c','Payer ES fév','VISA',0),(203,89,'2021-02-27','BQ','401001',149.18,149.180,'d','Payer ES fév','VISA',0),(204,90,'2021-02-27','BQ','512004',52.30,52.300,'c','Payer essence','VISA',0),(205,90,'2021-02-27','BQ','401006',52.30,52.300,'d','Payer essence','VISA',0),(206,91,'2021-03-05','HA','626000',16.98,16.980,'d','Internet mars 2021','',1),(207,91,'2021-03-05','HA','401009',16.98,16.980,'c','Internet mars 2021','',1),(208,92,'2021-03-05','HA','626000',10.00,10.000,'d','Commmande carte SIM Red SFR','',1),(209,92,'2021-03-05','HA','401009',10.00,10.000,'c','Commmande carte SIM Red SFR','',1),(210,93,'2021-03-05','BQ','512003',120.00,120.000,'c',NULL,NULL,0),(211,93,'2021-03-05','BQ','623800',120.00,120.000,'d',NULL,NULL,0),(212,94,'2021-03-05','BQ','512003',180.00,180.000,'c',NULL,NULL,0),(213,94,'2021-03-05','BQ','614000',180.00,180.000,'d',NULL,NULL,0),(214,95,'2021-02-25','FR','512003',0.32,0.320,'d',NULL,NULL,0),(215,95,'2021-02-25','FR','627000',0.32,0.320,'c',NULL,NULL,0),(216,96,'2021-03-05','BQ','512004',10.00,10.000,'c','Payer carte SIM','VISA',0),(217,96,'2021-03-05','BQ','401009',10.00,10.000,'d','Payer carte SIM','VISA',0),(218,97,'2021-03-06','HA','607000',106.02,106.020,'d','LIDL course mars 1 semaine','Ticket de caisse',1),(219,97,'2021-03-06','HA','401004',106.02,106.020,'c','LIDL course mars 1 semaine','Ticket de caisse',1),(220,98,'2021-03-06','BQ','512004',106.02,106.020,'c','Payer courses 1er semaine mars','VISA',0),(221,98,'2021-03-06','BQ','401004',106.02,106.020,'d','Payer courses 1er semaine mars','VISA',0),(222,99,'2021-03-06','HA','512004',10.00,10.000,'c',NULL,NULL,0),(223,99,'2021-03-06','HA','606103',10.00,10.000,'d',NULL,NULL,0),(224,100,'2021-02-17','HA','512002',212.34,212.340,'c',NULL,NULL,0),(225,100,'2021-02-17','HA','611000',212.34,212.340,'d',NULL,NULL,0),(226,101,'2021-03-06','HA','512002',234.49,234.490,'c',NULL,NULL,0),(227,101,'2021-03-06','HA','611000',234.49,234.490,'d',NULL,NULL,0),(228,102,'2021-03-06','BQ','512004',16.98,16.980,'c','Payer Internet mars','VISA',0),(229,102,'2021-03-06','BQ','401009',16.98,16.980,'d','Payer Internet mars','VISA',0),(230,103,'2021-03-06','HA','512004',10.95,10.950,'c',NULL,NULL,0),(231,103,'2021-03-06','HA','606101',10.95,10.950,'d',NULL,NULL,0),(232,104,'2021-03-11','HA','512004',36.43,36.430,'c',NULL,NULL,0),(233,104,'2021-03-11','HA','672000',36.43,36.430,'d',NULL,NULL,0),(234,105,'2021-03-11','BQ','512003',26.82,26.820,'c',NULL,NULL,0),(235,105,'2021-03-11','BQ','616000',26.82,26.820,'d',NULL,NULL,0),(236,106,'2021-03-11','BQ','512003',881.40,881.400,'c',NULL,NULL,0),(237,106,'2021-03-11','BQ','660000',131.63,131.630,'d',NULL,NULL,0),(238,106,'2021-03-11','BQ','164001',749.77,749.770,'d',NULL,NULL,0),(239,107,'2021-03-13','HA','607000',111.49,111.490,'d','Achat lidl 2 SEM mars','Ticket de caisse',1),(240,107,'2021-03-13','HA','401004',111.49,111.490,'c','Achat lidl 2 SEM mars','Ticket de caisse',1),(241,108,'2021-03-13','BQ','512004',111.49,111.490,'c','Payer lidl','Visa',0),(242,108,'2021-03-13','BQ','401004',111.49,111.490,'d','Payer lidl','Visa',0),(243,109,'2021-03-19','HA','512004',43.30,43.300,'c',NULL,NULL,0),(244,109,'2021-03-19','HA','672000',43.30,43.300,'d',NULL,NULL,0),(245,110,'2021-03-19','BQ','512003',161.00,161.000,'c',NULL,NULL,0),(246,110,'2021-03-19','BQ','630000',161.00,161.000,'d',NULL,NULL,0),(247,111,'2021-03-19','BQ','512003',141.00,141.000,'c',NULL,NULL,0),(248,111,'2021-03-19','BQ','630000',141.00,141.000,'d',NULL,NULL,0),(249,112,'2021-03-19','FR','512003',4.20,4.200,'c',NULL,NULL,0),(250,112,'2021-03-19','FR','627000',4.20,4.200,'d',NULL,NULL,0),(251,113,'2021-03-27','HA','607000',14.01,14.010,'d','LIDL ','Ticket de caisse',1),(252,113,'2021-03-27','HA','401004',14.01,14.010,'c','LIDL ','Ticket de caisse',1),(253,114,'2021-03-27','HA','607000',91.99,91.990,'d','Achat course mars semaine 3','Ticket de caisse',1),(254,114,'2021-03-27','HA','401004',91.99,91.990,'c','Achat course mars semaine 3','Ticket de caisse',1),(255,115,'2021-03-27','HA','672000',12.13,12.130,'d','Brico depo','Ticket de caisse',1),(256,115,'2021-03-27','HA','401015',12.13,12.130,'c','Brico depo','Ticket de caisse',1),(257,116,'2021-03-27','BQ','512004',14.01,14.010,'c','Payer lidl ','VISA',0),(258,116,'2021-03-27','BQ','401004',14.01,14.010,'d','Payer lidl ','VISA',0),(259,117,'2021-03-27','BQ','512004',91.99,91.990,'c','Payer lidl mars 3ieme sem','VISA',0),(260,117,'2021-03-27','BQ','401004',91.99,91.990,'d','Payer lidl mars 3ieme sem','VISA',0),(261,118,'2021-03-27','BQ','512004',12.13,12.130,'c','Payer brico petite fourniture','VISA',0),(262,118,'2021-03-27','BQ','401015',12.13,12.130,'d','Payer brico petite fourniture','VISA',0),(263,119,'2021-03-10','HA','607000',2.97,2.970,'d','DD reste et cheque cadeau','',1),(264,119,'2021-03-10','HA','401013',2.97,2.970,'c','DD reste et cheque cadeau','',1),(265,120,'2021-03-27','BQ','512004',2.97,2.970,'c','Payer reste DD 2T 2 fois','VISA prélèvement',0),(266,120,'2021-03-27','BQ','401013',2.97,2.970,'d','Payer reste DD 2T 2 fois','VISA prélèvement',0),(267,121,'2021-03-27','FR','512003',11.90,11.900,'c',NULL,NULL,0),(268,121,'2021-03-27','FR','627000',11.90,11.900,'d',NULL,NULL,0),(273,124,'2021-03-29','HA','672000',9.02,9.020,'d','Achat vitre cave','Ticket de caisse',1),(271,123,'2021-03-27','HA','672000',39.70,39.700,'d','Peinture mûr','',1),(272,123,'2021-03-27','HA','401015',39.70,39.700,'c','Peinture mûr','',1),(274,124,'2021-03-29','HA','401015',9.02,9.020,'c','Achat vitre cave','Ticket de caisse',1),(275,125,'2021-03-27','BQ','512004',39.70,39.700,'c','Payer leroy','VISA',0),(276,125,'2021-03-27','BQ','401015',39.70,39.700,'d','Payer leroy','VISA',0),(277,126,'2021-03-29','BQ','512004',9.02,9.020,'c','Payer vitre leroy','VISA',0),(278,126,'2021-03-29','BQ','401015',9.02,9.020,'d','Payer vitre leroy','VISA',0),(281,128,'2021-03-30','HA','607000',108.07,108.070,'d','LIDL 4 sem mars','ticket de caisse',1),(282,128,'2021-03-30','HA','401004',108.07,108.070,'c','LIDL 4 sem mars','ticket de caisse',1),(283,129,'2021-03-30','BQ','512004',108.07,108.070,'c','Payer LIDL sem 4 mars','VISA',0),(284,129,'2021-03-30','BQ','401004',108.07,108.070,'d','Payer LIDL sem 4 mars','VISA',0),(285,130,'2021-03-30','FR','512003',0.32,0.320,'d',NULL,NULL,0),(286,130,'2021-03-30','FR','627000',0.32,0.320,'c',NULL,NULL,0),(287,131,'2021-03-30','VT','410001',2875.27,2875.270,'d',NULL,NULL,0),(288,131,'2021-03-30','VT','701000',2875.27,2875.270,'c',NULL,NULL,0),(289,132,'2021-03-30','BQ','410001',2875.27,2875.270,'c',NULL,NULL,0),(290,132,'2021-03-30','BQ','512003',2875.27,2875.270,'d',NULL,NULL,0),(291,133,'2021-03-30','BQ','512004',1181.87,1181.870,'d',NULL,NULL,0),(292,133,'2021-03-30','BQ','512003',1181.87,1181.870,'c',NULL,NULL,0),(293,134,'2021-03-20','HA','626000',2.00,2.000,'d','Facture free mars','',1),(294,134,'2021-03-20','HA','401012',2.00,2.000,'c','Facture free mars','',1),(295,135,'2021-04-03','HA','606101',50.00,50.000,'d','Le clerc diesel 308','Payer en visa',1),(296,135,'2021-04-03','HA','401006',50.00,50.000,'c','Le clerc diesel 308','Payer en visa',1),(297,136,'2021-04-03','HA','605000',81.91,81.910,'d','Achat Ali pour cnc et multi orise','',1),(298,136,'2021-04-03','HA','401016',81.91,81.910,'c','Achat Ali pour cnc et multi orise','',1),(299,137,'2021-04-03','BQ','512004',81.91,81.910,'c','Payer Ali express cnc','VISA',0),(300,137,'2021-04-03','BQ','401016',81.91,81.910,'d','Payer Ali express cnc','VISA',0),(301,138,'2021-04-03','HA','607000',93.59,93.590,'d','Lidl avril 1 sem','ticket de caisse.',1),(302,138,'2021-04-03','HA','401004',93.59,93.590,'c','Lidl avril 1 sem','ticket de caisse.',1),(303,139,'2021-04-04','HA','672000',22.70,22.700,'d','Achat plinthes leroy','Ticket de caisse',1),(304,139,'2021-04-04','HA','401015',22.70,22.700,'c','Achat plinthes leroy','Ticket de caisse',1),(305,140,'2021-04-10','HA','626000',48.00,48.000,'d','Boygue télé frais de mise en service fibre','',1),(306,140,'2021-04-10','HA','401009',48.00,48.000,'c','Boygue télé frais de mise en service fibre','',1),(307,141,'2021-04-10','HA','630000',25.00,25.000,'d','Frais de douane fedex','',1),(308,141,'2021-04-10','HA','401016',25.00,25.000,'c','Frais de douane fedex','',1),(309,142,'2021-04-10','BQ','512004',93.59,93.590,'c','Payer lidl','VISA',0),(310,142,'2021-04-10','BQ','401004',93.59,93.590,'d','Payer lidl','VISA',0),(311,143,'2021-04-10','HA','607000',117.06,117.060,'d','Lidl 10avril','',1),(312,143,'2021-04-10','HA','401004',117.06,117.060,'c','Lidl 10avril','',1),(313,144,'2021-04-10','BQ','512004',50.00,50.000,'c','Payer essence','Visa',0),(314,144,'2021-04-10','BQ','401006',50.00,50.000,'d','Payer essence','Visa',0),(315,145,'2021-04-10','BQ','512004',22.70,22.700,'c','Payer leroy','Visa',0),(316,145,'2021-04-10','BQ','401015',22.70,22.700,'d','Payer leroy','Visa',0),(317,146,'2021-04-10','HA','626000',16.98,16.980,'d','Facture avril','',1),(318,146,'2021-04-10','HA','401009',16.98,16.980,'c','Facture avril','',1),(319,147,'2021-04-10','BQ','512004',16.98,16.980,'c','Payer numericable avril','Visa',0),(320,147,'2021-04-10','BQ','401009',16.98,16.980,'d','Payer numericable avril','Visa',0),(321,148,'2021-04-10','BQ','512004',48.00,48.000,'c','Payer mise en service boygue','Visa',0),(322,148,'2021-04-10','BQ','401009',48.00,48.000,'d','Payer mise en service boygue','Visa',0),(323,149,'2021-04-10','BQ','512003',120.00,120.000,'c',NULL,NULL,0),(324,149,'2021-04-10','BQ','623800',120.00,120.000,'d',NULL,NULL,0),(325,150,'2021-04-10','BQ','512003',84.10,84.100,'c',NULL,NULL,0),(326,150,'2021-04-10','BQ','616000',84.10,84.100,'d',NULL,NULL,0),(327,151,'2021-04-10','BQ','512003',180.00,180.000,'c',NULL,NULL,0),(328,151,'2021-04-10','BQ','614000',180.00,180.000,'d',NULL,NULL,0),(329,152,'2021-04-17','HA','605000',26.72,26.720,'d','Câble eth prises','',1),(330,152,'2021-04-17','HA','401005',26.72,26.720,'c','Câble eth prises','',1),(331,153,'2021-04-17','BQ','512004',117.06,117.060,'c','Payer lidl','Visa',0),(332,153,'2021-04-17','BQ','401004',117.06,117.060,'d','Payer lidl','Visa',0),(333,154,'2021-04-17','HA','605000',12.80,12.800,'d','Achat leroy','',1),(334,154,'2021-04-17','HA','401015',12.80,12.800,'c','Achat leroy','',1),(335,155,'2021-04-17','BQ','512004',12.80,12.800,'c','payer leroy ','Visa',0),(336,155,'2021-04-17','BQ','401015',12.80,12.800,'d','payer leroy ','Visa',0),(337,156,'2021-04-17','BQ','512004',25.00,25.000,'c','Payer taxe fedex','Visa',0),(338,156,'2021-04-17','BQ','401016',25.00,25.000,'d','Payer taxe fedex','Visa',0),(339,157,'2021-04-20','HA','602000',148.97,148.970,'d','Facture ES Avril','25564790S',1),(340,157,'2021-04-20','HA','401001',148.97,148.970,'c','Facture ES Avril','25564790S',1),(341,158,'2021-04-23','BQ','512003',881.40,881.400,'c',NULL,NULL,0),(342,158,'2021-04-23','BQ','660000',130.48,130.480,'d',NULL,NULL,0),(343,158,'2021-04-23','BQ','164001',750.92,750.920,'d',NULL,NULL,0),(344,159,'2021-04-23','BQ','512003',161.00,161.000,'c',NULL,NULL,0),(345,159,'2021-04-23','BQ','630000',161.00,161.000,'d',NULL,NULL,0),(346,160,'2021-04-23','BQ','512003',141.00,141.000,'c',NULL,NULL,0),(347,160,'2021-04-23','BQ','630000',141.00,141.000,'d',NULL,NULL,0),(348,161,'2021-04-23','HA','607000',159.78,159.780,'d','Achat Lidl avril','Ticket de caisse.',1),(349,161,'2021-04-23','HA','401004',159.78,159.780,'c','Achat Lidl avril','Ticket de caisse.',1),(352,163,'2021-04-23','HA','607000',5.82,5.820,'d','Achat Lidl avril 3S','Ticket de caisse.',1),(353,163,'2021-04-23','HA','401004',5.82,5.820,'c','Achat Lidl avril 3S','Ticket de caisse.',1),(354,164,'2021-04-23','BQ','512004',26.72,26.720,'c','Payer auchan','VISA',0),(355,164,'2021-04-23','BQ','401005',26.72,26.720,'d','Payer auchan','VISA',0),(356,165,'2021-04-23','BQ','512004',159.78,159.780,'c','Payer LIDL 3S','VISA',0),(357,165,'2021-04-23','BQ','401004',159.78,159.780,'d','Payer LIDL 3S','VISA',0),(360,167,'2021-04-23','BQ','512004',5.82,5.820,'c','Payer LIDL ','VISA',0),(361,167,'2021-04-23','BQ','401004',5.82,5.820,'d','Payer LIDL ','VISA',0),(362,168,'2021-04-23','FR','512003',4.20,4.200,'c',NULL,NULL,0),(363,168,'2021-04-23','FR','627000',4.20,4.200,'d',NULL,NULL,0),(364,169,'2021-04-23','BQ','512004',148.97,148.970,'c','Payer ES avril','VISA',0),(365,169,'2021-04-23','BQ','401001',148.97,148.970,'d','Payer ES avril','VISA',0),(366,170,'2021-04-27','HA','626000',18.12,18.120,'d','Bouygues avril mai','En ligne',1),(367,170,'2021-04-27','HA','401009',18.12,18.120,'c','Bouygues avril mai','En ligne',1),(368,171,'2021-04-27','BQ','512004',18.12,18.120,'c','Payer bouygues','VISA',0),(369,171,'2021-04-27','BQ','401009',18.12,18.120,'d','Payer bouygues','VISA',0),(370,172,'2021-04-27','HA','605000',2.80,2.800,'d','Achat ali','Neant',1),(371,172,'2021-04-27','HA','401016',2.80,2.800,'c','Achat ali','Neant',1),(372,173,'2021-04-27','HA','607000',107.79,107.790,'d','Lidl achat','Ticket de caisse',1),(373,173,'2021-04-27','HA','401004',107.79,107.790,'c','Lidl achat','Ticket de caisse',1),(374,174,'2021-04-27','BQ','512004',107.79,107.790,'c','Payer course lidl','VISA',0),(375,174,'2021-04-27','BQ','401004',107.79,107.790,'d','Payer course lidl','VISA',0),(376,175,'2021-04-27','BQ','512004',2.80,2.800,'c','Payer Ali express','PayPal visa',0),(377,175,'2021-04-27','BQ','401016',2.80,2.800,'d','Payer Ali express','PayPal visa',0),(378,176,'2021-04-27','HA','626000',2.00,2.000,'d','Téléphone free avril','Compte lbp',1),(379,176,'2021-04-27','HA','401012',2.00,2.000,'c','Téléphone free avril','Compte lbp',1),(380,177,'2021-04-27','BQ','512003',11.90,11.900,'c',NULL,NULL,0),(381,177,'2021-04-27','BQ','627000',11.90,11.900,'d',NULL,NULL,0),(382,178,'2021-04-29','BQ','512003',2897.79,2897.790,'d',NULL,NULL,0),(383,178,'2021-04-29','BQ','410001',2897.79,2897.790,'c',NULL,NULL,0),(384,179,'2021-04-29','BQ','512003',0.32,0.320,'d',NULL,NULL,0),(385,179,'2021-04-29','BQ','627000',0.32,0.320,'c',NULL,NULL,0),(386,180,'2021-04-30','BQ','512003',938.04,938.040,'c',NULL,NULL,0),(387,180,'2021-04-30','BQ','512004',938.04,938.040,'d',NULL,NULL,0),(388,181,'2021-04-06','FR','512001',18.90,18.900,'c',NULL,NULL,0),(389,181,'2021-04-06','FR','627000',18.90,18.900,'d',NULL,NULL,0),(390,182,'2021-03-22','BQ','512001',2.00,2.000,'c','Payer FREE mobile mars','PRELEVEMENT CCP',0),(391,182,'2021-03-22','BQ','401012',2.00,2.000,'d','Payer FREE mobile mars','PRELEVEMENT CCP',0),(392,183,'2021-04-21','BQ','512001',2.00,2.000,'c','Payer free mobile avril','PRELEVEMENT CCP',0),(393,183,'2021-04-21','BQ','401012',2.00,2.000,'d','Payer free mobile avril','PRELEVEMENT CCP',0),(394,184,'2021-04-29','VT','410001',2897.79,2897.790,'d',NULL,NULL,0),(395,184,'2021-04-29','VT','701000',2897.79,2897.790,'c',NULL,NULL,0),(396,185,'2021-02-22','OD','410001',1186.00,1186.000,'c',NULL,NULL,0),(397,185,'2021-02-22','OD','271001',1186.00,1186.000,'d',NULL,NULL,0),(398,186,'2021-05-02','BQ','512002',230.00,230.000,'c',NULL,NULL,0),(399,186,'2021-05-02','BQ','623800',230.00,230.000,'d',NULL,NULL,0),(400,187,'2021-05-03','HA','607000',88.81,88.810,'d','Lidl mai 1 week','',1),(401,187,'2021-05-03','HA','401004',88.81,88.810,'c','Lidl mai 1 week','',1),(402,188,'2021-05-03','BQ','512004',88.81,88.810,'c','Payer Lidl','VISA',0),(403,188,'2021-05-03','BQ','401004',88.81,88.810,'d','Payer Lidl','VISA',0),(404,189,'2021-05-08','HA','606101',58.30,58.300,'d','Cora essence mercedes','',1),(405,189,'2021-05-08','HA','401006',58.30,58.300,'c','Cora essence mercedes','',1),(406,190,'2021-05-06','BQ','512003',24.24,24.240,'c',NULL,NULL,0),(407,190,'2021-05-06','BQ','616000',24.24,24.240,'d',NULL,NULL,0),(408,191,'2021-05-10','BQ','512003',180.00,180.000,'c',NULL,NULL,0),(409,191,'2021-05-10','BQ','614000',180.00,180.000,'d',NULL,NULL,0),(410,192,'2021-05-10','BQ','512003',90.00,90.000,'c',NULL,NULL,0),(411,192,'2021-05-10','BQ','623800',90.00,90.000,'d',NULL,NULL,0),(412,193,'2021-05-13','HA','607000',11.21,11.210,'d','Cadeau anniversaire Kevin','Ticket de caisse',1),(413,193,'2021-05-13','HA','401005',11.21,11.210,'c','Cadeau anniversaire Kevin','Ticket de caisse',1),(414,194,'2021-05-13','BQ','512004',11.21,11.210,'c','Payer auchan anniv kevin','VISA',0),(415,194,'2021-05-13','BQ','401005',11.21,11.210,'d','Payer auchan anniv kevin','VISA',0),(416,195,'2021-05-10','BQ','512003',881.40,881.400,'c',NULL,NULL,1),(417,195,'2021-05-10','BQ','660000',129.32,129.320,'d',NULL,NULL,1),(418,195,'2021-05-10','BQ','164001',752.08,752.080,'d',NULL,NULL,1),(419,196,'2021-05-13','BQ','512004',58.30,58.300,'c','Payer Essence mercedes cora','VISA',0),(420,196,'2021-05-13','BQ','401006',58.30,58.300,'d','Payer Essence mercedes cora','VISA',0),(421,197,'2021-05-13','HA','607000',120.96,120.960,'d','Achat LIDL mai semaine 2','Ticket de caisse',1),(422,197,'2021-05-13','HA','401004',120.96,120.960,'c','Achat LIDL mai semaine 2','Ticket de caisse',1),(423,198,'2021-05-13','BQ','512004',120.96,120.960,'c','Payer LIDL semaine 2 main','VISA',0),(424,198,'2021-05-13','BQ','401004',120.96,120.960,'d','Payer LIDL semaine 2 main','VISA',0),(425,199,'2021-05-13','FR','512003',4.20,4.200,'c',NULL,NULL,0),(426,199,'2021-05-13','FR','627000',4.20,4.200,'d',NULL,NULL,0),(427,200,'2021-01-29','HA','512002',184.34,184.340,'c',NULL,NULL,0),(428,200,'2021-01-29','HA','611000',184.34,184.340,'d',NULL,NULL,0),(429,201,'2021-04-13','BQ','512002',212.34,212.340,'c',NULL,NULL,0),(430,201,'2021-04-13','BQ','611000',212.34,212.340,'d',NULL,NULL,0),(431,202,'2021-05-09','HA','512002',103.66,103.660,'c',NULL,NULL,0),(432,202,'2021-05-09','HA','611000',103.66,103.660,'d',NULL,NULL,0),(433,203,'2021-05-16','HA','607000',NULL,100.430,'d','LDIL course ','Ticket de caisse',1),(434,203,'2021-05-16','HA','401004',NULL,100.430,'c','LDIL course ','Ticket de caisse',1),(435,204,'2021-05-19','HA','606101',NULL,64.000,'d','Gazole 308','Ticket de caisse',1),(436,204,'2021-05-19','HA','401006',NULL,64.000,'c','Gazole 308','Ticket de caisse',1),(437,205,'2021-05-21','HA','626000',NULL,17.220,'d','Facture Bouygues mai','',1),(438,205,'2021-05-21','HA','401009',NULL,17.220,'c','Facture Bouygues mai','',1),(441,207,'2021-05-22','HA','607000',NULL,112.910,'d','Lidl mai sem 3','Ticket de caisse',1),(442,207,'2021-05-22','HA','401004',NULL,112.910,'c','Lidl mai sem 3','Ticket de caisse',1),(443,208,'2021-05-28','HA','606103',NULL,35.580,'d','course fête des mere','',1),(444,208,'2021-05-28','HA','401005',NULL,35.580,'c','course fête des mere','',1),(445,209,'2021-05-28','HA','606103',NULL,53.980,'d','Maranaud gift eloise fête des meres','',1),(446,209,'2021-05-28','HA','401005',NULL,53.980,'c','Maranaud gift eloise fête des meres','',1),(447,210,'2021-05-29','BQ','512004',NULL,100.430,'c','courses LIDL semaine 2','VISA',0),(448,210,'2021-05-29','BQ','401004',NULL,100.430,'d','courses LIDL semaine 2','VISA',0),(449,211,'2021-05-29','BQ','512004',NULL,112.910,'c','Payer LIDL semaine 3','VISA',0),(450,211,'2021-05-29','BQ','401004',NULL,112.910,'d','Payer LIDL semaine 3','VISA',0),(451,212,'2021-05-29','BQ','512004',NULL,17.220,'c','Payer Bouygues','VISA',0),(452,212,'2021-05-29','BQ','401009',NULL,17.220,'d','Payer Bouygues','VISA',0),(453,213,'2021-05-29','BQ','512004',NULL,64.000,'c','Payer plein peugeot','VISA',0),(454,213,'2021-05-29','BQ','401006',NULL,64.000,'d','Payer plein peugeot','VISA',0),(455,214,'2021-05-15','BQ','630000',NULL,161.000,'d',NULL,NULL,1),(456,214,'2021-05-15','BQ','512003',NULL,161.000,'c',NULL,NULL,1),(457,215,'2021-05-15','BQ','630000',NULL,141.000,'d',NULL,NULL,1),(458,215,'2021-05-15','BQ','512003',NULL,141.000,'c',NULL,NULL,1),(459,216,'2021-03-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(460,216,'2021-03-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(461,216,'2021-03-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(462,216,'2021-03-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(463,217,'2021-04-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(464,217,'2021-04-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(465,217,'2021-04-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(466,217,'2021-04-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(467,218,'2021-05-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(468,218,'2021-05-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(469,218,'2021-05-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(470,218,'2021-05-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(471,219,'2021-03-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(472,219,'2021-03-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(473,219,'2021-03-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(474,219,'2021-03-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(475,220,'2021-04-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(476,220,'2021-04-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(477,220,'2021-04-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(478,220,'2021-04-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(479,221,'2021-05-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(480,221,'2021-05-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(481,221,'2021-05-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(482,221,'2021-05-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(483,222,'2021-05-29','VT','701000',NULL,2911.450,'c',NULL,NULL,0),(484,222,'2021-05-29','VT','410001',NULL,2911.450,'d',NULL,NULL,0),(485,223,'2021-05-29','BQ','512003',NULL,2911.450,'d',NULL,NULL,0),(486,223,'2021-05-29','BQ','410001',NULL,2911.450,'c',NULL,NULL,0),(487,224,'2021-05-29','HA','607000',NULL,96.290,'d','Lidl semaine 4 mai','Ticket de caisse',1),(488,224,'2021-05-29','HA','401004',NULL,96.290,'c','Lidl semaine 4 mai','Ticket de caisse',1),(489,225,'2021-06-01','HA','607000',NULL,104.400,'d','Au cheval noir hoenheim','Ticket de caisse',1),(490,225,'2021-06-01','HA','401017',NULL,104.400,'c','Au cheval noir hoenheim','Ticket de caisse',1),(491,226,'2021-05-31','BQ','512004',NULL,573.840,'d',NULL,NULL,0),(492,226,'2021-05-31','BQ','512003',NULL,573.840,'c',NULL,NULL,0),(493,227,'2021-05-26','FR','512003',NULL,11.900,'c',NULL,NULL,0),(494,227,'2021-05-26','FR','627000',NULL,11.900,'d',NULL,NULL,0),(495,228,'2021-05-28','FR','512003',NULL,0.320,'d',NULL,NULL,0),(496,228,'2021-05-28','FR','627000',NULL,0.320,'c',NULL,NULL,0),(497,229,'2021-06-05','HA','607000',NULL,83.900,'d','Lidl juin sem 1','Ticket de caisse',1),(498,229,'2021-06-05','HA','401004',NULL,83.900,'c','Lidl juin sem 1','Ticket de caisse',1),(499,230,'2021-06-05','BQ','512004',NULL,104.400,'c','Payer cheval noir','VISQ',0),(500,230,'2021-06-05','BQ','401017',NULL,104.400,'d','Payer cheval noir','VISQ',0),(501,231,'2021-06-05','BQ','512004',NULL,89.560,'c','Payer cadeau fête des meres','Visa',0),(502,231,'2021-06-05','BQ','401005',NULL,89.560,'d','Payer cadeau fête des meres','Visa',0),(503,232,'2021-06-05','BQ','512004',NULL,96.290,'c','Payer lidl','Visa',0),(504,232,'2021-06-05','BQ','401004',NULL,96.290,'d','Payer lidl','Visa',0),(505,233,'2021-06-12','HA','607000',NULL,84.600,'d','Course sem2','',1),(506,233,'2021-06-12','HA','401004',NULL,84.600,'c','Course sem2','',1),(507,234,'2021-06-12','HA','606103',NULL,69.000,'d','Décathlon casque sac vélo','',1),(508,234,'2021-06-12','HA','401017',NULL,69.000,'c','Décathlon casque sac vélo','',1),(509,235,'2021-06-13','BQ','512004',NULL,83.900,'c','Payer lidl','CHEQUE N°',0),(510,235,'2021-06-13','BQ','401004',NULL,83.900,'d','Payer lidl','CHEQUE N°',0),(511,236,'2021-06-10','BQ','512003',NULL,881.400,'c',NULL,NULL,1),(512,236,'2021-06-10','BQ','660000',NULL,128.160,'d',NULL,NULL,1),(513,236,'2021-06-10','BQ','164001',NULL,753.240,'d',NULL,NULL,1),(514,237,'2021-06-13','BQ','512003',NULL,24.240,'c',NULL,NULL,0),(515,237,'2021-06-13','BQ','616000',NULL,24.240,'d',NULL,NULL,0),(516,238,'2021-06-16','BQ','512004',NULL,69.000,'c','Payer DECATHLON','VISA',0),(517,238,'2021-06-16','BQ','401017',NULL,69.000,'d','Payer DECATHLON','VISA',0),(518,239,'2021-06-16','BQ','512004',NULL,84.600,'c','Payer LIDL','VISA',0),(519,239,'2021-06-16','BQ','401004',NULL,84.600,'d','Payer LIDL','VISA',0),(520,240,'2021-06-16','HA','606103',NULL,20.500,'d','Restaurant KFC','',1),(521,240,'2021-06-16','HA','401017',NULL,20.500,'c','Restaurant KFC','',1),(524,242,'2021-06-16','BQ','512004',NULL,20.500,'c','Payer KFC','VISA',0),(525,242,'2021-06-16','BQ','401017',NULL,20.500,'d','Payer KFC','VISA',0),(526,243,'2021-06-15','BQ','630000',NULL,161.000,'d',NULL,NULL,1),(527,243,'2021-06-15','BQ','512003',NULL,161.000,'c',NULL,NULL,1),(528,244,'2021-06-15','BQ','630000',NULL,141.000,'d',NULL,NULL,1),(529,244,'2021-06-15','BQ','512003',NULL,141.000,'c',NULL,NULL,1),(552,256,'2021-06-22','BQ','512004',NULL,8.050,'c',NULL,NULL,0),(553,256,'2021-06-22','BQ','626000',NULL,8.050,'d',NULL,NULL,0),(532,246,'2021-06-16','HA','616000',NULL,608.400,'d','Assurance Voitures','n017',1),(533,246,'2021-06-16','HA','401008',NULL,608.400,'c','Assurance Voitures','n017',1),(534,247,'2021-01-27','BQ','512002',NULL,2182.460,'d',NULL,NULL,0),(535,247,'2021-01-27','BQ','701001',NULL,2182.460,'c',NULL,NULL,0),(536,248,'2021-02-24','BQ','512002',NULL,2182.460,'d',NULL,NULL,0),(537,248,'2021-02-24','BQ','701001',NULL,2182.460,'c',NULL,NULL,0),(538,249,'2021-03-29','BQ','512002',NULL,2312.220,'d',NULL,NULL,0),(539,249,'2021-03-29','BQ','701001',NULL,2312.220,'c',NULL,NULL,0),(540,250,'2021-04-28','BQ','512002',NULL,2182.460,'d',NULL,NULL,0),(541,250,'2021-04-28','BQ','701001',NULL,2182.460,'c',NULL,NULL,0),(542,251,'2021-05-27','BQ','512002',NULL,2219.100,'d',NULL,NULL,0),(543,251,'2021-05-27','BQ','701001',NULL,2219.100,'c',NULL,NULL,0),(544,252,'2021-06-08','BQ','512001',NULL,250.000,'c',NULL,NULL,0),(545,252,'2021-06-08','BQ','512002',NULL,250.000,'d',NULL,NULL,0),(546,253,'2021-06-18','BQ','512001',NULL,6150.000,'c',NULL,NULL,0),(547,253,'2021-06-18','BQ','512002',NULL,6150.000,'d',NULL,NULL,0),(548,254,'2021-06-15','BQ','614000',NULL,180.000,'d',NULL,NULL,1),(549,254,'2021-06-15','BQ','512003',NULL,180.000,'c',NULL,NULL,1),(550,255,'2021-06-19','HA','607000',NULL,95.850,'d','Achat semaine 3 juin','Payer via visa',1),(551,255,'2021-06-19','HA','401004',NULL,95.850,'c','Achat semaine 3 juin','Payer via visa',1),(556,258,'2021-06-23','HA','606101',NULL,70.590,'d','Plein 308','',1),(557,258,'2021-06-23','HA','401006',NULL,70.590,'c','Plein 308','',1),(558,259,'2021-06-23','BQ','512002',NULL,70.590,'c','Payer gazole 308','Visa',0),(559,259,'2021-06-23','BQ','401006',NULL,70.590,'d','Payer gazole 308','Visa',0),(560,260,'2021-06-25','HA','606101',NULL,59.700,'d','Plein mercedes','',1),(561,260,'2021-06-25','HA','401006',NULL,59.700,'c','Plein mercedes','',1),(562,261,'2021-06-25','BQ','512004',NULL,59.700,'c','Payer essence','VISA',0),(563,261,'2021-06-25','BQ','401006',NULL,59.700,'d','Payer essence','VISA',0),(564,262,'2021-06-26','HA','607000',NULL,111.750,'d','Course semaine 4 juin','TICKET de caisse',1),(565,262,'2021-06-26','HA','401004',NULL,111.750,'c','Course semaine 4 juin','TICKET de caisse',1),(566,263,'2021-06-26','HA','671000',NULL,2299.330,'d','Changement porte d\'entree','Devis RENOV HABITAT',1),(567,263,'2021-06-26','HA','401015',NULL,2299.330,'c','Changement porte d\'entree','Devis RENOV HABITAT',1),(568,264,'2021-06-26','BQ','512003',NULL,600.000,'c','Acompte RENOV HABITA','VIREMENT',0),(569,264,'2021-06-26','BQ','401015',NULL,600.000,'d','Acompte RENOV HABITA','VIREMENT',0),(570,265,'2021-06-26','HA','602000',NULL,113.160,'d','Facture ES juin 2021','26023801S',1),(571,265,'2021-06-26','HA','401001',NULL,113.160,'c','Facture ES juin 2021','26023801S',1),(572,266,'2021-06-26','BQ','512004',NULL,95.850,'c','Payer LIDL','VIISA',0),(573,266,'2021-06-26','BQ','401004',NULL,95.850,'d','Payer LIDL','VIISA',0),(574,267,'2021-06-20','BQ','512003',NULL,4.200,'c',NULL,NULL,1),(575,267,'2021-06-20','BQ','627000',NULL,4.200,'d',NULL,NULL,1),(576,268,'2021-06-26','BQ','512003',NULL,608.400,'c','Payer assurance vioitures 2Sem','CHEQUE N°',0),(577,268,'2021-06-26','BQ','401008',NULL,608.400,'d','Payer assurance vioitures 2Sem','CHEQUE N°',0),(578,269,'2021-07-02','HA','606103',NULL,29.900,'d','Resto cheval blanc','',1),(579,269,'2021-07-02','HA','401017',NULL,29.900,'c','Resto cheval blanc','',1),(580,270,'2021-06-30','BQ','512004',NULL,113.160,'c','Payer es','Virement',0),(581,270,'2021-06-30','BQ','401001',NULL,113.160,'d','Payer es','Virement',0),(582,271,'2021-06-30','BQ','512004',NULL,111.750,'c','Payer lidl','VISA',0),(583,271,'2021-06-30','BQ','401004',NULL,111.750,'d','Payer lidl','VISA',0),(584,272,'2021-06-30','BQ','512003',NULL,936.760,'c',NULL,NULL,0),(585,272,'2021-06-30','BQ','512004',NULL,936.760,'d',NULL,NULL,0),(586,273,'2021-06-29','BQ','512003',NULL,4389.170,'d',NULL,NULL,0),(587,273,'2021-06-29','BQ','410001',NULL,4389.170,'c',NULL,NULL,0),(588,274,'2021-06-20','BQ','512003',NULL,11.900,'c',NULL,NULL,1),(589,274,'2021-06-20','BQ','627000',NULL,11.900,'d',NULL,NULL,1),(590,275,'2021-06-29','FR','512003',NULL,0.320,'d',NULL,NULL,0),(591,275,'2021-06-29','FR','627000',NULL,0.320,'c',NULL,NULL,0),(592,276,'2021-07-03','HA','607000',NULL,98.910,'d','Course 1sem juillet','Ticket de caisse',1),(593,276,'2021-07-03','HA','401004',NULL,98.910,'c','Course 1sem juillet','Ticket de caisse',1),(594,277,'2021-07-05','HA','616000',NULL,162.870,'d','Assurance Appart residence principale','',1),(595,277,'2021-07-05','HA','401007',NULL,162.870,'c','Assurance Appart residence principale','',1),(596,278,'2021-07-05','BQ','512004',NULL,29.900,'c','Payer assurance','VISA',0),(597,278,'2021-07-05','BQ','401017',NULL,29.900,'d','Payer assurance','VISA',0),(598,279,'2021-06-30','BQ','512002',NULL,90000.000,'d',NULL,NULL,0),(599,279,'2021-06-30','BQ','164002',NULL,90000.000,'c',NULL,NULL,0),(600,280,'2021-06-28','BQ','512002',NULL,47121.800,'c',NULL,NULL,0),(601,280,'2021-06-28','BQ','461000',NULL,47121.800,'d',NULL,NULL,0),(602,281,'2021-06-30','BQ','461000',NULL,90000.000,'d',NULL,NULL,0),(603,281,'2021-06-30','BQ','512002',NULL,90000.000,'c',NULL,NULL,0),(604,282,'2021-07-01','HA','461000',NULL,127500.000,'c',NULL,NULL,0),(605,282,'2021-07-01','HA','213102',NULL,127500.000,'d',NULL,NULL,0),(606,283,'2021-07-01','HA','461000',NULL,9621.800,'c',NULL,NULL,0),(607,283,'2021-07-01','HA','622200',NULL,2653.800,'d',NULL,NULL,0),(608,283,'2021-07-01','HA','630000',NULL,6968.000,'d',NULL,NULL,0),(609,25,'2021-01-02','AN','512002',NULL,41401.250,'d',NULL,NULL,0),(610,284,'2021-06-25','BQ','512002',NULL,184.340,'c',NULL,NULL,0),(611,284,'2021-06-25','BQ','611000',NULL,184.340,'d',NULL,NULL,0),(612,285,'2021-06-28','BQ','512002',NULL,2182.460,'d',NULL,NULL,0),(613,285,'2021-06-28','BQ','701001',NULL,2182.460,'c',NULL,NULL,0),(614,286,'2021-07-05','BQ','512002',NULL,132.080,'d',NULL,NULL,0),(615,286,'2021-07-05','BQ','701001',NULL,132.080,'c',NULL,NULL,0),(616,287,'2021-06-04','BQ','512002',NULL,132.080,'d',NULL,NULL,0),(617,287,'2021-06-04','BQ','701001',NULL,132.080,'c',NULL,NULL,0),(618,288,'2021-06-28','VT','410001',NULL,4389.170,'d',NULL,NULL,0),(619,288,'2021-06-28','VT','701000',NULL,4389.170,'c',NULL,NULL,0),(620,289,'2021-07-05','BQ','512002',NULL,48.620,'c',NULL,NULL,0),(621,289,'2021-07-05','BQ','616000',NULL,48.620,'d',NULL,NULL,0),(622,290,'2021-07-05','BQ','512002',NULL,41.420,'c',NULL,NULL,0),(623,290,'2021-07-05','BQ','616000',NULL,41.420,'d',NULL,NULL,0),(624,291,'2021-06-20','HA','401012',NULL,2.000,'c',NULL,NULL,1),(625,291,'2021-06-20','HA','626000',NULL,2.000,'d',NULL,NULL,1),(626,291,'2021-06-20','BQ','401012',NULL,2.000,'d',NULL,NULL,1),(627,291,'2021-06-20','BQ','512001',NULL,2.000,'c',NULL,NULL,1),(628,292,'2021-07-20','BQ','401012',NULL,2.000,'c',NULL,NULL,1),(629,292,'2021-07-20','BQ','626000',NULL,2.000,'d',NULL,NULL,1),(630,292,'2021-07-20','BQ','401012',NULL,2.000,'d',NULL,NULL,1),(631,292,'2021-07-20','BQ','512001',NULL,2.000,'c',NULL,NULL,1),(632,293,'2021-06-20','HA','401012',NULL,2.000,'c',NULL,NULL,1),(633,293,'2021-06-20','HA','626000',NULL,2.000,'d',NULL,NULL,1),(634,293,'2021-06-20','BQ','401012',NULL,2.000,'d',NULL,NULL,1),(635,293,'2021-06-20','BQ','512002',NULL,2.000,'c',NULL,NULL,1),(636,294,'2021-07-05','BQ','512002',NULL,1481.000,'c',NULL,NULL,0),(637,294,'2021-07-05','BQ','622200',NULL,1481.000,'d',NULL,NULL,0),(638,295,'2021-06-10','BQ','512002',NULL,669.920,'c',NULL,NULL,0),(639,295,'2021-06-10','BQ','164003',NULL,669.920,'d',NULL,NULL,0),(640,296,'2021-07-05','BQ','512002',NULL,104.300,'c',NULL,NULL,0),(641,296,'2021-07-05','BQ','606103',NULL,104.300,'d',NULL,NULL,0),(642,297,'2021-06-29','BQ','512002',NULL,3.800,'c',NULL,NULL,0),(643,297,'2021-06-29','BQ','627000',NULL,3.800,'d',NULL,NULL,0),(644,298,'2021-06-28','BQ','512002',NULL,48.970,'c',NULL,NULL,0),(645,298,'2021-06-28','BQ','606103',NULL,48.970,'d',NULL,NULL,0),(646,299,'2021-06-29','BQ','512002',NULL,25.760,'c',NULL,NULL,0),(647,299,'2021-06-29','BQ','606103',NULL,25.760,'d',NULL,NULL,0),(648,300,'2021-07-06','HA','671000',NULL,72.510,'d','Achat Leroy Disjonteur','Ticket de caisse',1),(649,300,'2021-07-06','HA','401015',NULL,72.510,'c','Achat Leroy Disjonteur','Ticket de caisse',1),(650,301,'2021-07-07','HA','671000',NULL,23.300,'d','Leroy Platine disjoncteur','',1),(651,301,'2021-07-07','HA','401015',NULL,23.300,'c','Leroy Platine disjoncteur','',1),(652,302,'2021-07-06','BQ','512004',NULL,72.510,'c','Payer leroy disjoncteur','VISA',0),(653,302,'2021-07-06','BQ','401015',NULL,72.510,'d','Payer leroy disjoncteur','VISA',0),(654,303,'2021-07-07','BQ','512004',NULL,23.300,'c','Payer leroy platine disjoncteur','VISA',0),(655,303,'2021-07-07','BQ','401015',NULL,23.300,'d','Payer leroy platine disjoncteur','VISA',0),(656,304,'2021-07-08','BQ','512004',NULL,162.870,'c','Payer assurance','VISA',0),(657,304,'2021-07-08','BQ','401007',NULL,162.870,'d','Payer assurance','VISA',0),(658,305,'2021-07-08','BQ','512004',NULL,98.910,'c','Payer LIDL','VISA',0),(659,305,'2021-07-08','BQ','401004',NULL,98.910,'d','Payer LIDL','VISA',0),(660,306,'2021-07-05','HA','607000',NULL,14.670,'d','Achat lidl anniversaire','LIDL CGE3946',1),(661,306,'2021-07-05','HA','401004',NULL,14.670,'c','Achat lidl anniversaire','LIDL CGE3946',1),(662,307,'2021-07-05','HA','607000',NULL,17.910,'d','Course LIDL anniversaire','LIDL CGE 3946',1),(663,307,'2021-07-05','HA','401004',NULL,17.910,'c','Course LIDL anniversaire','LIDL CGE 3946',1),(664,308,'2021-07-05','BQ','512004',NULL,14.670,'c','Payer LIDL anniversaire 1','VISA',0),(665,308,'2021-07-05','BQ','401004',NULL,14.670,'d','Payer LIDL anniversaire 1','VISA',0),(666,309,'2021-07-05','BQ','512004',NULL,17.910,'c','Payer course lidl anniversaire','VISA',0),(667,309,'2021-07-05','BQ','401004',NULL,17.910,'d','Payer course lidl anniversaire','VISA',0),(668,310,'2021-07-05','HA','626000',NULL,15.990,'d','Bouygues prelèvement SEPA ','PRELEVEMENT CCPP',1),(669,310,'2021-07-05','HA','401009',NULL,15.990,'c','Bouygues prelèvement SEPA ','PRELEVEMENT CCPP',1),(670,311,'2021-07-05','BQ','512003',NULL,15.990,'c','Prelevement bouygues juillet','PRELEVEMENT',0),(671,311,'2021-07-05','BQ','401009',NULL,15.990,'d','Prelevement bouygues juillet','PRELEVEMENT',0),(672,312,'2021-07-05','BQ','512003',NULL,24.240,'c',NULL,NULL,0),(673,312,'2021-07-05','BQ','616000',NULL,24.240,'d',NULL,NULL,0),(674,25,'2021-01-02','AN','164003',NULL,5359.360,'c',NULL,NULL,0),(675,313,'2021-05-10','BQ','512002',NULL,669.920,'c',NULL,NULL,0),(676,313,'2021-05-10','BQ','164003',NULL,669.920,'d',NULL,NULL,0),(677,314,'2021-04-12','BQ','512002',NULL,669.920,'c',NULL,NULL,0),(678,314,'2021-04-12','BQ','164003',NULL,669.920,'d',NULL,NULL,0),(679,315,'2021-07-07','BQ','512002',NULL,210.000,'c',NULL,NULL,0),(680,315,'2021-07-07','BQ','623800',NULL,210.000,'d',NULL,NULL,0),(681,316,'2021-06-15','BQ','623800',NULL,120.000,'d',NULL,NULL,1),(682,316,'2021-06-15','BQ','512003',NULL,120.000,'c',NULL,NULL,1),(683,317,'2021-05-05','BQ','512002',NULL,132.080,'d',NULL,NULL,0),(684,317,'2021-05-05','BQ','701001',NULL,132.080,'c',NULL,NULL,0),(685,318,'2021-06-15','BQ','512002',NULL,14.060,'c',NULL,NULL,0),(686,318,'2021-06-15','BQ','616000',NULL,14.060,'d',NULL,NULL,0),(687,319,'2021-05-15','BQ','512002',NULL,14.060,'c',NULL,NULL,0),(688,319,'2021-05-15','BQ','616000',NULL,14.060,'d',NULL,NULL,0),(689,321,'2021-07-11','HA','607000',NULL,80.480,'d','Course LIDL sem 2','',1),(690,321,'2021-07-11','HA','401004',NULL,80.480,'c','Course LIDL sem 2','',1),(691,322,'2021-07-11','BQ','512004',NULL,80.480,'c','Payer lidl sem 2','VISA',0),(692,322,'2021-07-11','BQ','401004',NULL,80.480,'d','Payer lidl sem 2','VISA',0),(693,323,'2021-05-31','BQ','512002',NULL,45.200,'c',NULL,NULL,0),(694,323,'2021-05-31','BQ','606102',NULL,45.200,'d',NULL,NULL,0),(695,324,'2021-05-31','BQ','512002',NULL,22.490,'c',NULL,NULL,0),(696,324,'2021-05-31','BQ','606102',NULL,22.490,'d',NULL,NULL,0),(697,325,'2021-05-25','HA','606103',NULL,104.010,'d','Achat eloise gemo','',1),(698,325,'2021-05-25','HA','401011',NULL,104.010,'c','Achat eloise gemo','',1),(699,326,'2021-05-25','BQ','512002',NULL,104.010,'c','Payer gemo','Visa',0),(700,326,'2021-05-25','BQ','401011',NULL,104.010,'d','Payer gemo','Visa',0),(701,327,'2021-04-27','BQ','512002',NULL,26.120,'c',NULL,NULL,0),(702,327,'2021-04-27','BQ','606102',NULL,26.120,'d',NULL,NULL,0),(703,328,'2021-07-15','HA','623800',NULL,10.000,'d','Piscine','',1),(704,328,'2021-07-15','HA','401017',NULL,10.000,'c','Piscine','',1),(705,329,'2021-07-16','HA','605000',NULL,24.990,'d','Achat Bibliothèque 60x20x180','',1),(706,329,'2021-07-16','HA','401018',NULL,24.990,'c','Achat Bibliothèque 60x20x180','',1),(707,330,'2021-07-16','HA','605000',NULL,99.950,'d','Bureau Blanc pour Eloise','Ticket de caisse',1),(708,330,'2021-07-16','HA','401018',NULL,99.950,'c','Bureau Blanc pour Eloise','Ticket de caisse',1),(709,331,'2021-07-16','BQ','512004',NULL,24.990,'c','Payer Bibliothèque','VISA',0),(710,331,'2021-07-16','BQ','401018',NULL,24.990,'d','Payer Bibliothèque','VISA',0),(711,332,'2021-07-16','BQ','512004',NULL,99.950,'c','Payer Bureau Eloise','VISA',0),(712,332,'2021-07-16','BQ','401018',NULL,99.950,'d','Payer Bureau Eloise','VISA',0),(713,333,'2021-07-16','HA','606101',NULL,64.000,'d','Carburant Mercedes 1,549x41,32l','Ticket de caisse',1),(714,333,'2021-07-16','HA','401006',NULL,64.000,'c','Carburant Mercedes 1,549x41,32l','Ticket de caisse',1),(715,334,'2021-07-16','BQ','512004',NULL,10.000,'c','Payer piscine','VISA',0),(716,334,'2021-07-16','BQ','401017',NULL,10.000,'d','Payer piscine','VISA',0),(717,335,'2021-07-16','BQ','512004',NULL,64.000,'c','Payer essence','VISA',0),(718,335,'2021-07-16','BQ','401006',NULL,64.000,'d','Payer essence','VISA',0),(878,406,'2021-07-20','BQ','627000',NULL,4.200,'d',NULL,NULL,1),(877,406,'2021-07-20','BQ','512003',NULL,4.200,'c',NULL,NULL,1),(721,337,'2021-07-15','BQ','614000',NULL,180.000,'d',NULL,NULL,1),(722,337,'2021-07-15','BQ','512003',NULL,180.000,'c',NULL,NULL,1),(723,338,'2021-07-15','BQ','630000',NULL,141.000,'d',NULL,NULL,1),(724,338,'2021-07-15','BQ','512003',NULL,141.000,'c',NULL,NULL,1),(725,339,'2021-07-15','BQ','630000',NULL,161.000,'d',NULL,NULL,1),(726,339,'2021-07-15','BQ','512003',NULL,161.000,'c',NULL,NULL,1),(727,340,'2021-07-10','BQ','512003',NULL,881.400,'c',NULL,NULL,1),(728,340,'2021-07-10','BQ','660000',NULL,127.000,'d',NULL,NULL,1),(729,340,'2021-07-10','BQ','164001',NULL,754.400,'d',NULL,NULL,1),(730,341,'2021-07-17','HA','606102',NULL,4.360,'d','Doliprantabs','Tichet de caisse',1),(731,341,'2021-07-17','HA','401014',NULL,4.360,'c','Doliprantabs','Tichet de caisse',1),(732,342,'2021-07-17','BQ','530001',NULL,4.360,'c','Payer Dolipranetab','VISA',0),(733,342,'2021-07-17','BQ','401014',NULL,4.360,'d','Payer Dolipranetab','VISA',0),(734,343,'2021-07-17','BQ','530001',NULL,2.300,'c',NULL,NULL,0),(735,343,'2021-07-17','BQ','606102',NULL,2.300,'d',NULL,NULL,0),(736,344,'2021-07-15','HA','607000',NULL,31.340,'d','course Eloise pour enfants','',1),(737,344,'2021-07-15','HA','401005',NULL,31.340,'c','course Eloise pour enfants','',1),(738,345,'2021-07-17','BQ','512002',NULL,31.340,'c','Payer courses auchan enfants','CB',0),(739,345,'2021-07-17','BQ','401005',NULL,31.340,'d','Payer courses auchan enfants','CB',0),(740,346,'2021-07-03','HA','607000',NULL,7.870,'d','Course préparation anniversaire','Ticket de caisse',1),(741,346,'2021-07-03','HA','401005',NULL,7.870,'c','Course préparation anniversaire','Ticket de caisse',1),(742,347,'2021-07-03','BQ','530001',NULL,7.870,'c','Payer auchan casch','CASH',0),(743,347,'2021-07-03','BQ','401005',NULL,7.870,'d','Payer auchan casch','CASH',0),(744,348,'2021-07-17','BQ','512002',NULL,184.340,'c',NULL,NULL,0),(745,348,'2021-07-17','BQ','611000',NULL,184.340,'d',NULL,NULL,0),(746,349,'2021-07-17','BQ','512002',NULL,56.000,'c',NULL,NULL,0),(747,349,'2021-07-17','BQ','611000',NULL,56.000,'d',NULL,NULL,0),(748,350,'2021-07-17','BQ','512002',NULL,875.690,'c',NULL,NULL,0),(749,350,'2021-07-17','BQ','660000',NULL,33.290,'d',NULL,NULL,0),(750,350,'2021-07-17','BQ','622200',NULL,500.000,'d',NULL,NULL,0),(751,350,'2021-07-17','BQ','164002',NULL,342.400,'d',NULL,NULL,0),(752,351,'2021-07-15','BQ','512001',NULL,2000.000,'c',NULL,NULL,0),(753,351,'2021-07-15','BQ','512002',NULL,2000.000,'d',NULL,NULL,0),(754,352,'2021-01-10','BQ','512002',NULL,669.920,'c',NULL,NULL,0),(755,352,'2021-01-10','BQ','164003',NULL,669.920,'d',NULL,NULL,0),(756,353,'2021-02-10','BQ','512002',NULL,669.920,'c',NULL,NULL,0),(757,353,'2021-02-10','BQ','164003',NULL,669.920,'d',NULL,NULL,0),(758,354,'2021-03-10','BQ','512002',NULL,669.920,'c',NULL,NULL,0),(759,354,'2021-03-10','BQ','164003',NULL,669.920,'d',NULL,NULL,0),(760,355,'2021-07-17','BQ','512002',NULL,669.920,'c',NULL,NULL,0),(761,355,'2021-07-17','BQ','164003',NULL,669.920,'d',NULL,NULL,0),(762,356,'2021-07-06','BQ','530001',NULL,3.000,'c',NULL,NULL,0),(763,356,'2021-07-06','BQ','606103',NULL,3.000,'d',NULL,NULL,0),(764,357,'2021-07-18','BQ','530001',NULL,5.800,'c',NULL,NULL,0),(765,357,'2021-07-18','BQ','607000',NULL,5.800,'d',NULL,NULL,0),(766,358,'2021-07-19','BQ','512003',NULL,520.000,'c',NULL,NULL,0),(767,358,'2021-07-19','BQ','622300',NULL,515.000,'d',NULL,NULL,0),(768,358,'2021-07-19','BQ','530001',NULL,5.000,'d',NULL,NULL,0),(769,359,'2021-07-21','HA','602000',NULL,37.980,'d','Frais de mise en service.','26196439S',1),(770,359,'2021-07-21','HA','401019',NULL,37.980,'c','Frais de mise en service.','26196439S',1),(771,360,'2021-07-21','BQ','512004',NULL,37.980,'c','Payer Facture ES','VISA',0),(772,360,'2021-07-21','BQ','401019',NULL,37.980,'d','Payer Facture ES','VISA',0),(773,361,'2021-07-11','BQ','512004',NULL,10.000,'c',NULL,NULL,0),(774,361,'2021-07-11','BQ','606101',NULL,10.000,'d',NULL,NULL,0),(775,362,'2021-07-22','HA','606101',NULL,40.100,'d','Essence auchan pour suisse 1,56x','',1),(776,362,'2021-07-22','HA','401006',NULL,40.100,'c','Essence auchan pour suisse 1,56x','',1),(777,363,'2021-07-23','HA','622300',NULL,281.030,'d','Hôtel malter deux nuit','',1),(778,363,'2021-07-23','HA','401029',NULL,281.030,'c','Hôtel malter deux nuit','',1),(779,364,'2021-07-22','HA','606103',NULL,110.800,'d','Diner Hôtel Malters','Vacances',1),(780,364,'2021-07-22','HA','401029',NULL,110.800,'c','Diner Hôtel Malters','Vacances',1),(781,365,'2021-07-23','HA','606103',NULL,8.830,'d','Suisse Ice cream 6.83 euros','Vacances',1),(782,365,'2021-07-23','HA','401029',NULL,8.830,'c','Suisse Ice cream 6.83 euros','Vacances',1),(783,366,'2021-07-23','HA','606103',NULL,145.710,'d','Suisse Remonte pente','VACANCES',1),(784,366,'2021-07-23','HA','401029',NULL,145.710,'c','Suisse Remonte pente','VACANCES',1),(785,367,'2021-07-22','HA','606103',NULL,16.910,'d','Suisse Train j1','VACANCES',1),(786,367,'2021-07-22','HA','401029',NULL,16.910,'c','Suisse Train j1','VACANCES',1),(787,368,'2021-07-23','HA','606103',NULL,16.420,'d','Suisse train j2','VACANCES',1),(788,368,'2021-07-23','HA','401029',NULL,16.420,'c','Suisse train j2','VACANCES',1),(789,369,'2021-07-21','HA','606103',NULL,40.000,'d','Vignette Suisse 2021','VACANCES',1),(790,369,'2021-07-21','HA','401029',NULL,40.000,'c','Vignette Suisse 2021','VACANCES',1),(791,370,'2021-07-21','BQ','512004',NULL,40.000,'c','Payer vignette suisse','VISA',0),(792,370,'2021-07-21','BQ','401029',NULL,40.000,'d','Payer vignette suisse','VISA',0),(793,371,'2021-07-23','BQ','512004',NULL,16.420,'c','Payer train j2','VISA',0),(794,371,'2021-07-23','BQ','401029',NULL,16.420,'d','Payer train j2','VISA',0),(795,372,'2021-07-22','BQ','512004',NULL,16.910,'c','Payer train j1','VISA',0),(796,372,'2021-07-22','BQ','401029',NULL,16.910,'d','Payer train j1','VISA',0),(797,373,'2021-07-23','BQ','512004',NULL,145.710,'c','Payer remonte pente','VISA',0),(798,373,'2021-07-23','BQ','401029',NULL,145.710,'d','Payer remonte pente','VISA',0),(799,374,'2021-07-23','BQ','512004',NULL,8.830,'c','Payer Glasse Suisse','VISA',0),(800,374,'2021-07-23','BQ','401029',NULL,8.830,'d','Payer Glasse Suisse','VISA',0),(801,375,'2021-07-23','BQ','512004',NULL,110.800,'c','Payer Diner Suisse 109.20','VISA',0),(802,375,'2021-07-23','BQ','401029',NULL,110.800,'d','Payer Diner Suisse 109.20','VISA',0),(803,376,'2021-07-16','BQ','512004',NULL,40.100,'c','Payer essence','VISA',0),(804,376,'2021-07-16','BQ','401006',NULL,40.100,'d','Payer essence','VISA',0),(805,377,'2021-07-21','HA','607000',NULL,25.870,'d','Courses Auchan','',1),(806,377,'2021-07-21','HA','401005',NULL,25.870,'c','Courses Auchan','',1),(807,378,'2021-07-21','BQ','512004',NULL,25.870,'c','Payer courses auchan','VISA',0),(808,378,'2021-07-21','BQ','401005',NULL,25.870,'d','Payer courses auchan','VISA',0),(809,379,'2021-07-24','HA','627000',NULL,1.110,'d','Commission bancaire','',1),(810,379,'2021-07-24','HA','401029',NULL,1.110,'c','Commission bancaire','',1),(811,380,'2021-07-24','HA','606103',NULL,48.050,'d','Suisse COOP chocolat souvenir','VACANCES',1),(812,380,'2021-07-24','HA','401029',NULL,48.050,'c','Suisse COOP chocolat souvenir','VACANCES',1),(813,381,'2021-07-22','HA','606103',NULL,136.030,'d','Suisse souvenir','VACANCES',1),(814,381,'2021-07-22','HA','401029',NULL,136.030,'c','Suisse souvenir','VACANCES',1),(815,382,'2021-07-22','HA','607000',NULL,62.470,'d','Suisse Diner','VACANCES',1),(816,382,'2021-07-22','HA','401029',NULL,62.470,'c','Suisse Diner','VACANCES',1),(817,383,'2021-07-24','BQ','512002',NULL,281.030,'c','Payer Hotel Kreutz suisse','VISA',0),(818,383,'2021-07-24','BQ','401029',NULL,281.030,'d','Payer Hotel Kreutz suisse','VISA',0),(819,384,'2021-07-24','BQ','512002',NULL,1.110,'c','Payer Commission','PRELEVEMENT',0),(820,384,'2021-07-24','BQ','401029',NULL,1.110,'d','Payer Commission','PRELEVEMENT',0),(821,385,'2021-07-24','BQ','512002',NULL,48.050,'c','Payer COOP suissse','VISA',0),(822,385,'2021-07-24','BQ','401029',NULL,48.050,'d','Payer COOP suissse','VISA',0),(823,386,'2021-07-22','BQ','512002',NULL,136.030,'c','Payer souvenir','VISA',0),(824,386,'2021-07-22','BQ','401029',NULL,136.030,'d','Payer souvenir','VISA',0),(825,387,'2021-07-22','BQ','512002',NULL,62.470,'c','Payer Diner','VISA',0),(826,387,'2021-07-22','BQ','401029',NULL,62.470,'d','Payer Diner','VISA',0),(827,388,'2021-06-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(828,388,'2021-06-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(829,388,'2021-06-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(830,388,'2021-06-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(831,389,'2021-06-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(832,389,'2021-06-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(833,389,'2021-06-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(834,389,'2021-06-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(835,390,'2021-07-20','BQ','512002',NULL,41.100,'c',NULL,NULL,1),(836,390,'2021-07-20','BQ','627000',NULL,41.100,'d',NULL,NULL,1),(837,391,'2021-07-20','HA','401012',NULL,5.000,'c',NULL,NULL,1),(838,391,'2021-07-20','HA','626000',NULL,5.000,'d',NULL,NULL,1),(839,391,'2021-07-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(840,391,'2021-07-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(864,399,'2021-07-31','HA','401004',NULL,135.540,'c','Courses sem 4','Ticket de caisse',1),(863,399,'2021-07-31','HA','607000',NULL,135.540,'d','Courses sem 4','Ticket de caisse',1),(845,393,'2021-08-20','BQ','401012',NULL,5.000,'c',NULL,NULL,1),(846,393,'2021-08-20','BQ','626000',NULL,5.000,'d',NULL,NULL,1),(847,393,'2021-08-20','BQ','401012',NULL,5.000,'d',NULL,NULL,1),(848,393,'2021-08-20','BQ','512002',NULL,5.000,'c',NULL,NULL,1),(849,394,'2021-07-20','HA','401012',NULL,2.000,'c',NULL,NULL,1),(850,394,'2021-07-20','HA','626000',NULL,2.000,'d',NULL,NULL,1),(851,394,'2021-07-20','BQ','401012',NULL,2.000,'d',NULL,NULL,1),(852,394,'2021-07-20','BQ','512002',NULL,2.000,'c',NULL,NULL,1),(853,395,'2021-08-20','BQ','401012',NULL,2.000,'c',NULL,NULL,1),(854,395,'2021-08-20','BQ','626000',NULL,2.000,'d',NULL,NULL,1),(855,395,'2021-08-20','BQ','401012',NULL,2.000,'d',NULL,NULL,1),(856,395,'2021-08-20','BQ','512002',NULL,2.000,'c',NULL,NULL,1),(857,396,'2021-07-17','BQ','512002',NULL,14.060,'c',NULL,NULL,1),(858,396,'2021-07-17','BQ','616000',NULL,14.060,'d',NULL,NULL,1),(859,397,'2021-07-10','HA','461000',NULL,249.000,'c',NULL,NULL,0),(860,397,'2021-07-10','HA','622200',NULL,249.000,'d',NULL,NULL,0),(861,398,'2021-07-26','BQ','461000',NULL,249.000,'d',NULL,NULL,0),(862,398,'2021-07-26','BQ','512002',NULL,249.000,'c',NULL,NULL,0),(865,400,'2021-07-31','HA','605000',NULL,111.920,'d','Chaise et bibliotheque','Ticket de caisse',1),(866,400,'2021-07-31','HA','401018',NULL,111.920,'c','Chaise et bibliotheque','Ticket de caisse',1),(867,401,'2021-07-31','HA','401018',NULL,5.980,'d',NULL,NULL,0),(868,401,'2021-07-31','HA','605000',NULL,5.980,'c',NULL,NULL,0),(869,402,'2021-07-29','BQ','512004',NULL,111.920,'c','Payer bibliotheque','Visa',0),(870,402,'2021-07-29','BQ','401018',NULL,111.920,'d','Payer bibliotheque','Visa',0),(871,403,'2021-07-29','VT','410001',NULL,2904.020,'d',NULL,NULL,0),(872,403,'2021-07-29','VT','701000',NULL,2904.020,'c',NULL,NULL,0),(873,404,'2021-07-29','BQ','512003',NULL,2904.020,'d',NULL,NULL,0),(874,404,'2021-07-29','BQ','410001',NULL,2904.020,'c',NULL,NULL,0),(875,405,'2021-07-29','BQ','512004',NULL,1264.030,'d',NULL,NULL,0),(876,405,'2021-07-29','BQ','512003',NULL,1264.030,'c',NULL,NULL,0),(879,407,'2021-07-20','BQ','512003',NULL,11.900,'c',NULL,NULL,1),(880,407,'2021-07-20','BQ','627000',NULL,11.900,'d',NULL,NULL,1),(881,408,'2021-07-29','FR','512003',NULL,0.320,'d',NULL,NULL,0),(882,408,'2021-07-29','FR','627000',NULL,0.320,'c',NULL,NULL,0),(883,409,'2021-09-29','BQ','401018',NULL,5.980,'c',NULL,NULL,0),(884,409,'2021-09-29','BQ','512004',NULL,5.980,'d',NULL,NULL,0); +/*!40000 ALTER TABLE `TransactionEntry` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `TransactionEntryType` +-- + +DROP TABLE IF EXISTS `TransactionEntryType`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `TransactionEntryType` ( + `type_id` int(11) NOT NULL AUTO_INCREMENT, + `type_code` varchar(2) DEFAULT NULL, + `type_desc` varchar(255) DEFAULT NULL, + PRIMARY KEY (`type_id`) +) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `TransactionEntryType` +-- + +LOCK TABLES `TransactionEntryType` WRITE; +/*!40000 ALTER TABLE `TransactionEntryType` DISABLE KEYS */; +INSERT INTO `TransactionEntryType` VALUES (1,'BQ','Banque'),(2,'VT','Ventes'),(3,'HA','Achats et frais'),(4,'OD','Operation divers'),(5,'AF','Appels de fonds'),(6,'RF','Remboursement appels de fonds'),(7,'AN','Report a nouveau'),(8,'CL','Cloture'),(9,'FR','Frais Bancaires'); +/*!40000 ALTER TABLE `TransactionEntryType` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `Transactions` +-- + +DROP TABLE IF EXISTS `Transactions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Transactions` ( + `trans_id` int(11) NOT NULL AUTO_INCREMENT, + `voucher_ref` varchar(255) DEFAULT NULL, + `voucher_date` date DEFAULT NULL, + `act_trans_date` date DEFAULT NULL, + `trans_label` varchar(255) DEFAULT NULL, + `trans_file` varchar(255) DEFAULT NULL, + PRIMARY KEY (`trans_id`) +) ENGINE=MyISAM AUTO_INCREMENT=410 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `Transactions` +-- + +LOCK TABLES `Transactions` WRITE; +/*!40000 ALTER TABLE `Transactions` DISABLE KEYS */; +INSERT INTO `Transactions` VALUES (1,'VIREMENT ','2019-06-04','2019-06-04','versement test',NULL),(2,'gdrcgh','2019-06-04','2019-06-01','facture es juin',NULL),(6,'','2019-06-08','2019-06-08','Repartion Charges compte 601000 Cle: 5',NULL),(4,'','2019-06-08','2019-06-08','Test Charge Intermédiaire',NULL),(5,'','2019-06-08','2019-06-10','Facture EAU',NULL),(7,'','2019-06-08','2019-06-08','Repartion Charges compte 602000 Cle: 1',NULL),(8,'REFAK10_01','2019-06-08','2019-06-09','Last EDF to check',NULL),(9,'','2019-06-08','2019-06-08','Répartion 34.50€ du compte 602000 Clé 1',NULL),(10,'VIREMENT','2019-06-10','2019-06-10','Virement Mai 2019',NULL),(11,'VIREMENT','2019-06-10','2019-06-10','Virement Mai 2019',NULL),(12,'CHEQUE N°xxx','2019-05-10','2019-06-10','Payer facture',NULL),(13,'CHEQUE N°563422','2019-05-17','2019-06-10','payer es',NULL),(14,'','2021-01-02','2021-01-02','Courses pour la semaine',NULL),(15,'','2021-01-09','2021-01-09','Course',NULL),(16,'','2021-01-14','2021-01-14','courses',NULL),(17,'','2021-01-16','2021-01-16','Luges enfants',NULL),(18,'','2021-01-05','2021-01-05','Es jan 2021',NULL),(19,'','2021-01-07','2021-01-07','Internet janv 2021',NULL),(20,'','2021-01-08','2021-01-08','Domain DNS',NULL),(21,'','2021-01-10','2021-01-10','Essence mercedes',NULL),(22,'','2021-01-16','2021-01-16','Assurance Habitation 1 semestre 2021',NULL),(23,'','2021-01-21','2021-01-20','Course janv 3iem semaine',NULL),(24,'','2021-01-21','2021-01-16','Masques covid',NULL),(25,NULL,'2021-01-02','2021-01-02','Initial Values',NULL),(26,NULL,'2021-01-11','2021-01-29','Assurance moyen de paiement',NULL),(27,NULL,'2021-01-26','2021-01-29','COTISATION MENSUELLE CARTE 2485',NULL),(28,NULL,'2021-01-10','2021-01-29','Remboursement pret',NULL),(29,'VISA','2021-01-10','2021-01-29','Payer ES via Internet',NULL),(30,'VISA','2021-01-16','2021-01-17','Payer luges',NULL),(31,'VISA LCL','2021-01-10','2021-01-29','Payer essence M',NULL),(37,NULL,'2021-01-10','2021-01-29','Impot Taxe habitation',NULL),(33,'VISA LCL','2021-01-07','2021-01-29','Payer Numericable Internet',NULL),(34,'VISA LCL','2021-01-21','2021-01-29','Payer masques',NULL),(35,'VISA LCL ','2021-01-21','2021-01-29','Payer LIDL 3 premières semaines',NULL),(36,'VISA LCL','2021-01-07','2021-01-29','Payer domain internet',NULL),(38,NULL,'2021-01-10','2021-01-29','Taxe foncière',NULL),(39,NULL,'2021-01-02','2021-01-29','Travail de Janvier',NULL),(40,NULL,'2021-01-28','2021-01-29','Paye de Janvier',NULL),(41,NULL,'2021-01-10','2021-01-29','Assurance Pret',NULL),(42,'Ticket de caisse','2021-01-30','2021-01-30','LIDL COURSE 1 sem fev',NULL),(43,NULL,'2021-02-01','2021-02-01','Prime interessement',NULL),(44,'CCP N°1','2021-01-02','2021-01-05','Abonnement Free',NULL),(45,NULL,'2021-01-20','2021-01-20','Remise Banque',NULL),(46,NULL,'2021-01-30','2021-01-30','Solde Visa Janvier 2021',NULL),(47,'VISA ','2021-01-30','2021-02-02','Payer LIDL 1 semaine fév 2021',NULL),(48,'PRELEVEMENT','2021-01-05','2021-01-10','Payer free mobile',NULL),(49,NULL,'2021-01-12','2021-01-12','Banque Postale Cotisation VISA',NULL),(50,NULL,'2021-01-10','2021-01-10','Banque Postale Cotisation Trimest',NULL),(51,NULL,'2021-01-20','2021-01-20','Avance Impot Centre des finances',NULL),(52,'','2021-02-06','2021-02-02','Facture numericable fev 2021',NULL),(53,'','2021-02-06','2021-02-02','Facture mobile fev 2021',NULL),(54,'Visa','2021-02-02','2021-02-06','Payer groupama',NULL),(55,'Carte Visa','2021-02-06','2021-02-06','Achat masque',NULL),(56,'','2021-02-06','2021-02-06','Course LIDL pour seconde semaine fév',NULL),(57,NULL,'2021-02-06','2021-02-09','Assurance pret fév',NULL),(58,'VISA','2021-02-08','2021-02-09','Payer LIDL',NULL),(59,'VISA','2021-02-09','2021-02-09','Paye masques ',NULL),(60,'VISA','2021-02-09','2021-02-09','payer internet',NULL),(61,NULL,'2021-02-11','2021-02-11','Remboursement pret',NULL),(62,'','2021-02-11','2021-02-10','Sac cadeau eloise',NULL),(64,'VISA','2021-02-10','2021-02-11','Payer sac saint valentin',NULL),(65,'Ticket de caissd','2021-02-13','2021-02-13','Lidl fev 2 sem',NULL),(66,'VISA','2021-02-13','2021-02-13','Payer LIDL',NULL),(67,NULL,'2021-02-10','2021-02-13','CCP N°2',NULL),(68,NULL,'2021-02-13','2021-02-13','Charges copro janv fév',NULL),(69,NULL,'2021-02-16','2021-02-16','Taxe habitation',NULL),(70,NULL,'2021-02-16','2021-02-16','Taxe foncière',NULL),(71,NULL,'2021-02-16','2021-02-17','Achat Carburant ESSO',NULL),(72,NULL,'2021-01-28','2021-01-28','Achat Auchan supermarche',NULL),(73,'Ticket de caisse','2021-02-20','2021-02-20','Course LIDL 3 sem',NULL),(74,'Visa','2021-02-20','2021-02-20','Payer lidl 3sem fév',NULL),(75,'21170826S','2021-02-22','2021-02-12','ES Février 2021',NULL),(76,'21170826S','2021-02-22','2021-02-12','ES Février 2021',NULL),(77,'61195','2021-02-26','2021-02-26','Materiel pour mur salon',NULL),(78,'132674','2021-02-26','2021-02-26','Outils pour fixation placo',NULL),(79,NULL,'2021-02-26','2021-02-26','Paye fév 2021',NULL),(80,NULL,'2021-02-26','2021-02-26','Service Siemens fév',NULL),(81,NULL,'2021-02-27','2021-02-27','Solde visa février',NULL),(82,'PRELEVEMENT CCP N°2','2021-02-20','2021-02-27','Payer Free fév',NULL),(83,NULL,'2021-02-23','2021-02-23','COTISATION MENSUELLE CARTE 2485',NULL),(84,'Ticket de caisse','2021-02-27','2021-02-27','LIDL 27 fév',NULL),(85,'Ticket de caisse','2021-02-27','2021-02-27','Essence plein mercedes',NULL),(86,'VISA','2021-02-26','2021-02-27','Payer BigMat cloison',NULL),(87,'VISA','2021-02-26','2021-02-27','Payer petit matériel Bigmat',NULL),(88,'VISA','2021-02-27','2021-02-27','Payer courses 1 semaine mars',NULL),(89,'VISA','2021-02-27','2021-02-27','Payer ES fév',NULL),(90,'VISA','2021-02-27','2021-02-27','Payer essence',NULL),(91,'','2021-03-05','2021-03-05','Internet mars 2021',NULL),(92,'','2021-03-05','2021-03-05','Commmande carte SIM Red SFR',NULL),(93,NULL,'2021-03-05','2021-03-05','VIREMENT don épis',NULL),(94,NULL,'2021-03-05','2021-03-05','VIREMENT Charges mars 2021',NULL),(95,'VIREMENT INTERNE','2021-02-25','2021-02-25','Remise Banque février',NULL),(96,'VISA','2021-03-03','2021-03-05','Payer carte SIM',NULL),(97,'Ticket de caisse','2021-03-06','2021-03-06','LIDL course mars 1 semaine',NULL),(98,'VISA','2021-03-06','2021-03-06','Payer courses 1er semaine mars',NULL),(99,NULL,'2021-03-06','2021-03-06','6 Jetons pour laver voiture ',NULL),(100,NULL,'2021-02-17','2021-02-17','UFCV perisco janv',NULL),(101,NULL,'2021-03-06','2021-03-06','UFCV perisco fév',NULL),(102,'VISA','2021-02-06','2021-03-06','Payer Internet mars',NULL),(103,NULL,'2021-03-06','2021-03-06','Filter habitacle voiture peugeot',NULL),(104,NULL,'2021-03-10','2021-03-11','Brico depo pour mûr',NULL),(105,NULL,'2021-03-11','2021-03-11','Assurance prêt mars',NULL),(106,NULL,'2021-03-11','2021-03-11','remboursement pret mars',NULL),(107,'Ticket de caisse','2021-03-13','2021-03-13','Achat lidl 2 SEM mars',NULL),(108,'Visa','2021-03-13','2021-03-13','Payer lidl',NULL),(109,NULL,'2021-03-17','2021-03-19','Achat décot MURS papier peint',NULL),(110,NULL,'2021-03-16','2021-03-19','Taxe habitation',NULL),(111,NULL,'2021-03-16','2021-03-19','taxe foncière',NULL),(112,NULL,'2021-03-10','2021-03-19','assurance moyen de payement',NULL),(113,'Ticket de caisse','2021-03-27','2021-03-19','LIDL ',NULL),(114,'Ticket de caisse','2021-03-27','2021-03-20','Achat course mars semaine 3',NULL),(115,'Ticket de caisse','2021-03-27','2021-03-24','Brico depo',NULL),(116,'VISA','2021-03-19','2021-03-27','Payer lidl ',NULL),(117,'VISA','2021-03-20','2021-03-27','Payer lidl mars 3ieme sem',NULL),(118,'VISA','2021-03-24','2021-03-27','Payer brico petite fourniture',NULL),(119,'','2021-03-10','2021-03-10','DD reste et cheque cadeau',NULL),(120,'VISA prélèvement','2021-03-10','2021-03-27','Payer reste DD 2T 2 fois',NULL),(121,NULL,'2021-03-26','2021-03-27','Cotisation mensuelle carte',NULL),(123,'','2021-03-27','2021-03-27','Peinture mûr',NULL),(124,'Ticket de caisse','2021-03-29','2021-03-29','Achat vitre cave',NULL),(125,'VISA','2021-03-27','2021-03-27','Payer leroy',NULL),(126,'VISA','2021-03-29','2021-03-29','Payer vitre leroy',NULL),(135,'Payer en visa','2021-04-03','2021-04-02','Le clerc diesel 308',NULL),(128,'ticket de caisse','2021-03-30','2021-03-27','LIDL 4 sem mars',NULL),(129,'VISA','2021-03-27','2021-03-30','Payer LIDL sem 4 mars',NULL),(130,NULL,'2021-03-30','2021-03-30','Remise Banque mars',NULL),(131,NULL,'2021-03-30','2021-03-30','Salaire mars',NULL),(132,NULL,'2021-03-30','2021-03-30','Virement siemens sal mars',NULL),(133,NULL,'2021-03-30','2021-03-30','solde visa mars',NULL),(134,'','2021-03-20','2021-03-20','Facture free mars',NULL),(136,'','2021-04-03','2021-04-01','Achat Ali pour cnc et multi orise',NULL),(137,'VISA','2021-04-05','2021-04-03','Payer Ali express cnc',NULL),(138,'ticket de caisse.','2021-04-03','2021-04-03','Lidl avril 1 sem',NULL),(139,'Ticket de caisse','2021-04-04','2021-04-03','Achat plinthes leroy',NULL),(140,'','2021-04-10','2021-05-07','Boygue télé frais de mise en service fibre',NULL),(141,'','2021-04-10','2021-04-09','Frais de douane fedex',NULL),(142,'VISA','2021-04-01','2021-04-10','Payer lidl',NULL),(143,'','2021-04-10','2021-04-10','Lidl 10avril',NULL),(144,'Visa','2021-04-05','2021-04-10','Payer essence',NULL),(145,'Visa','2021-04-04','2021-04-10','Payer leroy',NULL),(146,'','2021-04-10','2021-04-06','Facture avril',NULL),(147,'Visa','2021-04-06','2021-04-10','Payer numericable avril',NULL),(148,'Visa','2021-04-09','2021-04-10','Payer mise en service boygue',NULL),(149,NULL,'2021-04-10','2021-04-10','Don Epis avril',NULL),(150,NULL,'2021-04-10','2021-04-10','Assurance oret',NULL),(151,NULL,'2021-04-10','2021-04-10','Virement charges avril',NULL),(152,'','2021-04-17','2021-04-16','Câble eth prises',NULL),(153,'Visa','2021-04-10','2021-04-17','Payer lidl',NULL),(154,'','2021-04-17','2021-04-12','Achat leroy',NULL),(155,'Visa','2021-04-14','2021-04-17','payer leroy ',NULL),(156,'Visa','2021-04-14','2021-04-17','Payer taxe fedex',NULL),(157,'25564790S','2021-04-20','2021-04-12','Facture ES Avril',NULL),(158,NULL,'2021-04-10','2021-04-23','Remboursement pret avril',NULL),(159,NULL,'2021-04-20','2021-04-23','Taxe habitation avril',NULL),(160,NULL,'2021-04-20','2021-04-23','Taxe foncière avril',NULL),(161,'Ticket de caisse.','2021-04-23','2021-04-17','Achat Lidl avril',NULL),(163,'Ticket de caisse.','2021-04-23','2021-04-17','Achat Lidl avril 3S',NULL),(164,'VISA','2021-04-17','2021-04-23','Payer auchan',NULL),(165,'VISA','2021-04-17','2021-04-23','Payer LIDL 3S',NULL),(167,'VISA','2021-04-17','2021-04-23','Payer LIDL ',NULL),(168,NULL,'2021-04-12','2021-04-23','Frais bancaires avril',NULL),(169,'VISA','2021-04-12','2021-04-23','Payer ES avril',NULL),(170,'En ligne','2021-04-27','2021-04-20','Bouygues avril mai',NULL),(171,'VISA','2021-04-20','2021-04-27','Payer bouygues',NULL),(172,'Neant','2021-04-27','2021-04-21','Achat ali',NULL),(173,'Ticket de caisse','2021-04-27','2021-04-24','Lidl achat',NULL),(174,'VISA','2021-04-24','2021-04-27','Payer course lidl',NULL),(175,'PayPal visa','2021-04-24','2021-04-27','Payer Ali express',NULL),(176,'Compte lbp','2021-04-27','2021-04-20','Téléphone free avril',NULL),(177,NULL,'2021-04-27','2021-04-27','LCL cotisation mensuelle carte ',NULL),(178,NULL,'2021-04-29','2021-04-29','Virement SIEMENS avril',NULL),(179,NULL,'2021-04-29','2021-04-29','LCL remise Carte avril',NULL),(180,NULL,'2021-04-30','2021-04-30','Solde LCL Visa avril',NULL),(181,NULL,'2021-04-06','2021-04-06','LPB cotisation trimestriel',NULL),(182,'PRELEVEMENT CCP','2021-03-22','2021-03-22','Payer FREE mobile mars',NULL),(183,'PRELEVEMENT CCP','2021-04-21','2021-04-21','Payer free mobile avril',NULL),(184,NULL,'2021-04-29','2021-04-29','Service SIEMENS avril',NULL),(185,NULL,'2021-02-22','2021-02-22','SIEMENS PRIME PEE',NULL),(186,NULL,'2021-05-02','2021-05-02','Don épis Eloise mai',NULL),(187,'','2021-05-03','2021-05-03','Lidl mai 1 week',NULL),(188,'VISA','2021-05-03','2021-05-03','Payer Lidl',NULL),(189,'','2021-05-08','2021-05-08','Cora essence mercedes',NULL),(190,NULL,'2021-05-06','2021-05-06','Assurance prêt mai',NULL),(191,NULL,'2021-05-10','2021-05-10','Charges mai',NULL),(192,NULL,'2021-05-10','2021-05-10','Don épis mai',NULL),(193,'Ticket de caisse','2021-05-13','2021-05-12','Cadeau anniversaire Kevin',NULL),(194,'VISA','2021-05-12','2021-05-13','Payer auchan anniv kevin',NULL),(195,NULL,'2021-05-10','2021-05-10','Remboursement pret N°1',NULL),(196,'VISA','2021-05-10','2021-05-13','Payer Essence mercedes cora',NULL),(197,'Ticket de caisse','2021-05-13','2021-05-08','Achat LIDL mai semaine 2',NULL),(198,'VISA','2021-05-13','2021-05-13','Payer LIDL semaine 2 main',NULL),(199,NULL,'2021-05-13','2021-05-13','Frais Assurance carte mai',NULL),(200,NULL,'2021-01-29','2021-01-29','UFCV prériscolaire janvier',NULL),(201,NULL,'2021-04-13','2021-04-13','UFCV prériscolaire avril',NULL),(202,NULL,'2021-05-09','2021-05-09','UFCV prériscolaire mai',NULL),(203,'Ticket de caisse','2021-05-16','2021-05-15','LDIL course ',NULL),(204,'Ticket de caisse','2021-05-19','2021-05-19','Gazole 308',NULL),(205,'','2021-05-21','2021-05-21','Facture Bouygues mai',NULL),(206,'','2021-05-21','2021-05-21','Facture Bouygues mai',NULL),(207,'Ticket de caisse','2021-05-22','2021-05-22','Lidl mai sem 3',NULL),(208,'','2021-05-28','2021-05-28','course fête des mere',NULL),(209,'','2021-05-28','2021-05-28','Maranaud gift eloise fête des meres',NULL),(210,'VISA','2021-05-15','2021-05-29','courses LIDL semaine 2',NULL),(211,'VISA','2021-05-22','2021-05-29','Payer LIDL semaine 3',NULL),(212,'VISA','2021-05-22','2021-05-29','Payer Bouygues',NULL),(213,'VISA','2021-05-22','2021-05-29','Payer plein peugeot',NULL),(214,NULL,'2021-05-15','2021-05-15','Payement Impot Taxe Habitation',NULL),(215,NULL,'2021-05-15','2021-05-15','Payement Impot Taxe Foncière',NULL),(216,NULL,'2021-03-20','2021-03-20','Payement SFR Mobile Eloise',NULL),(217,NULL,'2021-04-20','2021-04-20','Payement SFR Mobile Eloise',NULL),(218,NULL,'2021-05-20','2021-05-20','Payement SFR Mobile Eloise',NULL),(219,NULL,'2021-03-20','2021-03-20','Payement SFR Mobile Andre',NULL),(220,NULL,'2021-04-20','2021-04-20','Payement SFR Mobile Andre',NULL),(221,NULL,'2021-05-20','2021-05-20','Payement SFR Mobile Andre',NULL),(222,NULL,'2021-05-28','2021-05-29','Service SIEMENS Mai',NULL),(223,NULL,'2021-05-29','2021-05-29','Virement SIEMENS mai',NULL),(224,'Ticket de caisse','2021-05-29','2021-05-29','Lidl semaine 4 mai',NULL),(225,'Ticket de caisse','2021-05-01','2021-05-29','Au cheval noir hoenheim',NULL),(226,NULL,'2021-05-31','2021-05-31','Solde visa mai',NULL),(227,NULL,'2021-05-26','2021-05-26','Frais carte visa LCL',NULL),(228,NULL,'2021-05-28','2021-05-28','Remise carte LCL',NULL),(229,'Ticket de caisse','2021-06-05','2021-06-05','Lidl juin sem 1',NULL),(230,'VISQ','2021-05-31','2021-06-05','Payer cheval noir',NULL),(231,'Visa','2021-05-29','2021-06-05','Payer cadeau fête des meres',NULL),(232,'Visa','2021-05-29','2021-06-05','Payer lidl',NULL),(233,'','2021-06-12','2021-06-12','Course sem2',NULL),(234,'','2021-06-12','2021-06-12','Décathlon casque sac vélo',NULL),(235,'CHEQUE N°','2021-06-07','2021-06-13','Payer lidl',NULL),(236,NULL,'2021-06-10','2021-06-10','Remboursement prêt N°1',NULL),(237,NULL,'2021-06-10','2021-06-13','Prime assurance prêt juin',NULL),(238,'VISA','2021-06-12','2021-06-16','Payer DECATHLON',NULL),(239,'VISA','2021-06-12','2021-06-16','Payer LIDL',NULL),(240,'','2021-06-16','2021-06-13','Restaurant KFC',NULL),(242,'VISA','2021-06-13','2021-06-16','Payer KFC',NULL),(243,NULL,'2021-06-15','2021-06-15','Payement Impot Taxe Habitation',NULL),(244,NULL,'2021-06-15','2021-06-15','Payement Impot Taxe Foncière',NULL),(256,NULL,'2021-06-21','2021-06-22','Lettre AR acceptation de prêt',NULL),(246,'n017','2021-06-16','2021-06-10','Assurance Voitures',NULL),(247,NULL,'2021-01-27','2021-01-27','Salaire Eloise janvier',NULL),(248,NULL,'2021-02-24','2021-02-24','Salaire Eloise février',NULL),(249,NULL,'2021-03-29','2021-03-29','Salaire Eloise mars',NULL),(250,NULL,'2021-04-28','2021-04-28','Salaire Eloise avril',NULL),(251,NULL,'2021-05-27','2021-05-27','Salaire Eloise mai',NULL),(252,NULL,'2021-06-08','2021-06-08','Transfert CCP eloise assurance',NULL),(253,NULL,'2021-06-18','2021-06-18','Virement Pour achat appart',NULL),(254,NULL,'2021-06-15','2021-06-15','Payement Charges de copropriétés',NULL),(255,'Payer via visa','2021-06-19','2021-06-19','Achat semaine 3 juin',NULL),(257,NULL,'2021-06-21','2021-06-22','Lettre AR acceptation de prêt',NULL),(258,'','2021-06-23','2021-06-21','Plein 308',NULL),(259,'Visa','2021-06-21','2021-06-23','Payer gazole 308',NULL),(260,'','2021-06-25','2021-06-23','Plein mercedes',NULL),(261,'VISA','2021-06-23','2021-06-25','Payer essence',NULL),(262,'TICKET de caisse','2021-06-26','2021-06-26','Course semaine 4 juin',NULL),(263,'Devis RENOV HABITAT','2021-06-26','2021-06-10','Changement porte d\'entree',NULL),(264,'VIREMENT','2021-06-23','2021-06-26','Acompte RENOV HABITA',NULL),(265,'26023801S','2021-06-26','2021-06-10','Facture ES juin 2021',NULL),(266,'VIISA','2021-06-19','2021-06-26','Payer LIDL',NULL),(267,NULL,'2021-06-20','2021-06-20','Payement LCL Frais bancaire ass moyen de payement',NULL),(268,'CHEQUE N°','2021-06-23','2021-06-26','Payer assurance vioitures 2Sem',NULL),(269,'','2021-07-02','2021-07-01','Resto cheval blanc',NULL),(270,'Virement','2021-06-26','2021-06-30','Payer es',NULL),(271,'VISA','2021-06-26','2021-06-30','Payer lidl',NULL),(272,NULL,'2021-06-30','2021-06-30','Remboursement visa',NULL),(273,NULL,'2021-06-29','2021-06-29','Salaire siemens juin',NULL),(274,NULL,'2021-06-20','2021-06-20','Payement LCL Frais bancaire carte visa',NULL),(275,NULL,'2021-06-29','2021-06-29','Remise carte',NULL),(276,'Ticket de caisse','2021-07-03','2021-07-03','Course 1sem juillet',NULL),(277,'','2021-07-05','2021-06-21','Assurance Appart residence principale',NULL),(278,'VISA','2021-07-05','2021-07-05','Payer resto cheval blanc schiltig',NULL),(279,NULL,'2021-06-30','2021-06-30','pret Bancaire LBP appzrt',NULL),(280,NULL,'2021-06-28','2021-06-28','Virement notaire',NULL),(281,NULL,'2021-06-30','2021-06-30','Virement prêt apart',NULL),(282,NULL,'2021-07-01','2021-07-01','Achat Appatement',NULL),(283,NULL,'2021-07-01','2021-07-01','Frais achat appartement',NULL),(284,NULL,'2021-06-25','2021-06-25','UFCV periscolaire juin',NULL),(285,NULL,'2021-06-28','2021-06-28','Salaire juin Eloise',NULL),(286,NULL,'2021-07-05','2021-07-05','Versement CAF juillet',NULL),(287,NULL,'2021-06-04','2021-06-04','Versement CAF Juin Eloise',NULL),(288,NULL,'2021-06-28','2021-06-28','Service Siemens juin',NULL),(289,NULL,'2021-07-05','2021-07-05','MNCAP Pret Andre',NULL),(290,NULL,'2021-07-05','2021-07-05','MNCAP pret Eloise juillet',NULL),(291,NULL,'2021-06-20','2021-06-20','Payement Free Mobile Andre',NULL),(292,NULL,'2021-06-20','2021-06-20','Payement Free Mobile Andre',NULL),(293,NULL,'2021-06-20','2021-06-20','Payement Free Mobile Eloise',NULL),(294,NULL,'2021-07-05','2021-07-05','Frais de garanti pret',NULL),(295,NULL,'2021-06-10','2021-06-10','Prêt voiture juin',NULL),(296,NULL,'2021-07-05','2021-07-05','Cadeau anniversaire Andre',NULL),(297,NULL,'2021-06-29','2021-06-29','Frais virement bancaire',NULL),(298,NULL,'2021-06-28','2021-06-28','Course MULLER',NULL),(299,NULL,'2021-06-29','2021-06-29','Course KAUFLAND fleurs',NULL),(300,'Ticket de caisse','2021-07-06','2021-07-06','Achat Leroy Disjonteur',NULL),(301,'','2021-07-07','2021-07-07','Leroy Platine disjoncteur',NULL),(302,'VISA','2021-07-06','2021-07-06','Payer leroy disjoncteur',NULL),(303,'VISA','2021-07-07','2021-07-07','Payer leroy platine disjoncteur',NULL),(304,'VISA','2021-07-06','2021-07-08','Payer assurance',NULL),(305,'VISA','2021-07-05','2021-07-08','Payer LIDL',NULL),(306,'LIDL CGE3946','2021-07-05','2021-07-05','Achat lidl anniversaire',NULL),(307,'LIDL CGE 3946','2021-07-05','2021-07-05','Course LIDL anniversaire',NULL),(308,'VISA','2021-07-05','2021-07-05','Payer LIDL anniversaire 1',NULL),(309,'VISA','2021-07-05','2021-07-05','Payer course lidl anniversaire',NULL),(310,'PRELEVEMENT CCPP','2021-07-05','2021-07-05','Bouygues prelèvement SEPA ',NULL),(311,'PRELEVEMENT','2021-07-05','2021-07-05','Prelevement bouygues juillet',NULL),(312,NULL,'2021-07-05','2021-07-05','Assurance prêt juillet',NULL),(313,NULL,'2021-05-10','2021-05-10','Pret voiture mai',NULL),(314,NULL,'2021-04-12','2021-04-12','Pret voiture avril',NULL),(315,NULL,'2021-07-07','2021-07-07','don épis Eloise juillet',NULL),(316,NULL,'2021-07-09','2021-07-09','Payement Don église Epis',NULL),(317,NULL,'2021-05-05','2021-05-05','CAF Mai',NULL),(318,NULL,'2021-06-15','2021-06-15','GRASS SAVOI ',NULL),(319,NULL,'2021-05-15','2021-05-15','GRASS SAVOI mai',NULL),(320,NULL,'2021-05-15','2021-05-15','GRASS SAVOI mai',NULL),(321,'','2021-07-11','2021-07-10','Course LIDL sem 2',NULL),(322,'VISA','2021-07-10','2021-07-11','Payer lidl sem 2',NULL),(323,NULL,'2021-05-31','2021-05-31','Achat pharma 1',NULL),(324,NULL,'2021-05-31','2021-05-31','Achat pharma 2',NULL),(325,'','2021-05-25','2021-05-25','Achat eloise gemo',NULL),(326,'Visa','2021-05-25','2021-05-25','Payer gemo',NULL),(327,NULL,'2021-04-27','2021-04-27','Achat pharma',NULL),(328,'','2021-07-15','2021-07-14','Piscine',NULL),(329,'','2021-07-16','2021-07-13','Achat Bibliothèque 60x20x180',NULL),(330,'Ticket de caisse','2021-07-16','2021-07-15','Bureau Blanc pour Eloise',NULL),(331,'VISA','2021-07-13','2021-07-16','Payer Bibliothèque',NULL),(332,'VISA','2021-07-15','2021-07-16','Payer Bureau Eloise',NULL),(333,'Ticket de caisse','2021-07-16','2021-07-16','Carburant Mercedes 1,549x41,32l',NULL),(334,'VISA','2021-07-15','2021-07-16','Payer piscine',NULL),(335,'VISA','2021-07-16','2021-07-16','Payer essence',NULL),(336,NULL,'2021-07-15','2021-07-15','Payement Don église Epis',NULL),(337,NULL,'2021-07-15','2021-07-15','Payement Charges de copropriétés',NULL),(338,NULL,'2021-07-15','2021-07-15','Payement Impot Taxe Foncière',NULL),(339,NULL,'2021-07-15','2021-07-15','Payement Impot Taxe Habitation',NULL),(340,NULL,'2021-07-10','2021-07-10','Remboursement prêt N°1',NULL),(341,'Tichet de caisse','2021-07-17','2021-07-17','Doliprantabs',NULL),(342,'VISA','2021-07-17','2021-07-17','Payer Dolipranetab',NULL),(343,NULL,'2021-07-17','2021-07-17','Payer Densiste RiveEtoile',NULL),(344,'','2021-07-15','2021-07-15','course Eloise pour enfants',NULL),(345,'CB','2021-07-17','2021-07-17','Payer courses auchan enfants',NULL),(346,'Ticket de caisse','2021-07-03','2021-07-03','Course préparation anniversaire',NULL),(347,'CASH','2021-07-03','2021-07-03','Payer auchan casch',NULL),(348,NULL,'2021-06-17','2021-06-17','Frais scolaire juin',NULL),(349,NULL,'2021-06-17','2021-06-17','Frais scolaire extra covid',NULL),(350,NULL,'2021-07-15','2021-07-17','Remboursement prêt appart Eloise',NULL),(351,NULL,'2021-07-15','2021-07-15','Virement Pour Eloise',NULL),(352,NULL,'2021-01-10','2021-01-10','Prêt voiture janv',NULL),(353,NULL,'2021-02-10','2021-02-10','Pret voiture fev',NULL),(354,NULL,'2021-03-10','2021-03-10','Pret voiture mars',NULL),(355,NULL,'2021-07-12','2021-07-12','Prêt voiture juillet',NULL),(356,NULL,'2021-07-06','2021-07-06','Achat decathlon Kevin lunette piscine',NULL),(357,NULL,'2021-07-18','2021-07-18','Glace sortie',NULL),(358,NULL,'2021-07-19','2021-07-19','Vacances Christine Kevin',NULL),(359,'26196439S','2021-07-21','2021-07-06','Frais de mise en service.',NULL),(360,'VISA','2021-07-06','2021-07-21','Payer Facture ES',NULL),(361,NULL,'2021-07-11','2021-07-11','Payer Lave voiture',NULL),(362,'','2021-07-22','2021-07-22','Essence auchan pour suisse 1,56x',NULL),(363,'','2021-07-23','2021-07-23','Hôtel Malters deux nuits',NULL),(364,'Vacances','2021-07-22','2021-07-22','Diner Hôtel Malters',NULL),(365,'Vacances','2021-07-23','2021-07-23','Suisse Ice cream 6.83 euros',NULL),(366,'VACANCES','2021-07-23','2021-07-23','Suisse Remonte pente',NULL),(367,'VACANCES','2021-07-22','2021-07-22','Suisse Train j1',NULL),(368,'VACANCES','2021-07-23','2021-07-23','Suisse train j2',NULL),(369,'VACANCES','2021-07-21','2021-07-21','Vignette Suisse 2021',NULL),(370,'VISA','2021-07-21','2021-07-21','Payer vignette suisse',NULL),(371,'VISA','2021-07-23','2021-07-23','Payer train j2',NULL),(372,'VISA','2021-07-22','2021-07-22','Payer train j1',NULL),(373,'VISA','2021-07-23','2021-07-23','Payer remonte pente',NULL),(374,'VISA','2021-07-23','2021-07-23','Payer Glasse Suisse',NULL),(375,'VISA','2021-07-23','2021-07-23','Payer Diner Suisse 109.20',NULL),(376,'VISA','2021-04-16','2021-07-16','Payer essence',NULL),(377,'','2021-07-21','2021-04-21','Courses Auchan',NULL),(378,'VISA','2021-07-21','2021-07-21','Payer courses auchan',NULL),(379,'','2021-07-24','2021-07-24','Commission bancaire',NULL),(380,'VACANCES','2021-07-24','2021-07-24','Suisse COOP chocolat souvenir',NULL),(381,'VACANCES','2021-07-22','2021-07-22','Suisse souvenir',NULL),(382,'VACANCES','2021-07-22','2021-07-22','Suisse Diner',NULL),(383,'VISA','2021-07-24','2021-07-24','Payer Hotel Kreutz suisse',NULL),(384,'PRELEVEMENT','2021-07-24','2021-07-24','Payer Commission',NULL),(385,'VISA','2021-07-24','2021-07-24','Payer COOP suissse',NULL),(386,'VISA','2021-07-22','2021-07-22','Payer souvenir',NULL),(387,'VISA','2021-07-22','2021-07-22','Payer Diner',NULL),(388,NULL,'2021-06-20','2021-06-20','Payement SFR Mobile Eloise',NULL),(389,NULL,'2021-06-20','2021-06-20','Payement SFR Mobile Andre',NULL),(390,NULL,'2021-07-20','2021-07-20','Payement LBP Frais bancaire M et Mme',NULL),(391,NULL,'2021-07-20','2021-07-20','Payement SFR Mobile Andre',NULL),(392,NULL,'2021-07-20','2021-07-20','Payement SFR Mobile Eloise',NULL),(393,NULL,'2021-07-21','2021-07-21','Payement SFR Mobile Eloise',NULL),(394,NULL,'2021-07-20','2021-07-20','Payement Free Mobile Eloise bis',NULL),(395,NULL,'2021-07-21','2021-07-21','Payement Free Mobile Eloise',NULL),(396,NULL,'2021-07-17','2021-07-17','Payement Assurance Gras Savoye',NULL),(397,NULL,'2021-07-10','2021-07-10','Honoraire assurance MNCAP',NULL),(398,NULL,'2021-07-26','2021-07-26','Payer Honoraire assurance MNCAP',NULL),(399,'Ticket de caisse','2021-07-31','2021-07-31','Courses sem 4',NULL),(400,'Ticket de caisse','2021-07-31','2021-07-28','Chaise et bibliotheque',NULL),(401,NULL,'2021-07-29','2021-07-31','Retour marchandise',NULL),(402,'Visa','2021-07-28','2021-07-29','Payer bibliotheque',NULL),(403,NULL,'2021-07-29','2021-07-29','Service juillet siemens',NULL),(404,NULL,'2021-07-29','2021-07-29','Virement siemens juillet',NULL),(405,NULL,'2021-07-29','2021-07-29','Visa débit juillet',NULL),(406,NULL,'2021-07-20','2021-07-20','Payement LCL Frais bancaire ass moyen de payement',NULL),(407,NULL,'2021-07-20','2021-07-20','Payement LCL Frais bancaire carte visa',NULL),(408,NULL,'2021-07-29','2021-07-29','Remise LCL juillet',NULL),(409,NULL,'2021-07-29','2021-09-29','Remboursement retour IKEA',NULL); +/*!40000 ALTER TABLE `Transactions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping routines for database 'SYNDIC_26' +-- +/*!50003 DROP FUNCTION IF EXISTS `annuite_mensuelle` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` FUNCTION `annuite_mensuelle`( _loan_id INTEGER) RETURNS double + READS SQL DATA +BEGIN + RETURN (SELECT TRUNCATE(( ln_amount * (ln_rate / 12.0 ) / ( 1.0 - ( 1.0 / POW(1.0 + ln_rate/12.0,ln_duree )) )),2) FROM Loan WHERE ln_id = _loan_id); +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP FUNCTION IF EXISTS `FctTantieme` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` FUNCTION `FctTantieme`( acc_id VARCHAR(32), + charge_key INTEGER) RETURNS double + READS SQL DATA +BEGIN + DECLARE select_var DOUBLE; + SET select_var =(SELECT sum(tant_lot_size) FROM Tantieme as tant + JOIN Lot as l on l.lot_num = tant.tant_lot_num + JOIN LotsOwners as lo on lo.lo_lot_id = l.lot_id + JOIN Account as a on a.acc_id = acc_id + JOIN JoinIdentityAccount as jia on jia.jia_acc = a.acc_id and jia_ident = lo.lo_owner_id + WHERE tant_pc_id =charge_key); + IF (select_var IS NULL) THEN + RETURN 0.0 ; + ELSE + RETURN select_var ; + END IF; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP FUNCTION IF EXISTS `FctTantiemeFrac` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` FUNCTION `FctTantiemeFrac`( acc_id VARCHAR(32), + charge_key INTEGER) RETURNS double + READS SQL DATA +BEGIN + DECLARE select_var DOUBLE; + SET @tantTotal := (SELECT COALESCE(sum(tant_lot_size),1.0) FROM Tantieme WHERE tant_pc_id = charge_key); + SET select_var =(SELECT sum(tant_lot_size) FROM Tantieme as tant + JOIN Lot as l on l.lot_num = tant.tant_lot_num + JOIN LotsOwners as lo on lo.lo_lot_id = l.lot_id + JOIN Account as a on a.acc_id = acc_id + JOIN JoinIdentityAccount as jia on jia.jia_acc = a.acc_id and jia_ident = lo.lo_owner_id + WHERE tant_pc_id =charge_key); + IF (select_var IS NULL) THEN + RETURN 0.0 ; + ELSE + RETURN select_var / @tantTotal; + END IF; +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP FUNCTION IF EXISTS `fPeriod` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` FUNCTION `fPeriod`() RETURNS varchar(32) CHARSET utf8 + NO SQL + DETERMINISTIC +return @fPeriod ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `account_delete` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `account_delete`( IN acc VARCHAR(32) ) +BEGIN +SELECT @myLeft := acc_left, @myRight := acc_right, @myWidth := acc_right - acc_left + 1 +FROM Account WHERE acc_id = acc ; + +DELETE FROM Account WHERE acc_left BETWEEN @myLeft AND @myRight; + +UPDATE Account SET acc_right = acc_right - @myWidth WHERE acc_right > @myRight; +UPDATE Account SET acc_left = acc_left - @myWidth WHERE acc_left > @myRight; + +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `account_get_leafs` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `account_get_leafs`(IN period VARCHAR(32), IN acc VARCHAR(32) ) +BEGIN + SELECT acc_id,acc_name from Account WHERE acc_left + 1 = acc_right and acc_id like acc; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `account_get_sub` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `account_get_sub`(IN cls VARCHAR(32) , IN _depth INTEGER) +BEGIN +SELECT node.acc_id, node.acc_name AS acc_name , (COUNT(parent.acc_name) -1 ) AS _level +FROM Account AS node, + Account AS parent, + Account AS sub_parent, + ( + SELECT node.acc_id , ( COUNT(parent.acc_id) - 1) AS depth + FROM Account AS node, + Account AS parent + WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right + AND node.acc_id = cls + GROUP BY node.acc_id + ORDER BY node.acc_left + ) AS sub_tree +WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right + AND node.acc_left BETWEEN sub_parent.acc_left AND sub_parent.acc_right + AND sub_parent.acc_id = sub_tree.acc_id +GROUP BY node.acc_id +HAVING _level <= _depth +ORDER BY node.acc_left; +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `account_get_tree` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `account_get_tree`( IN cls VARCHAR(32) ) +BEGIN + SELECT node.acc_id,CONCAT( REPEAT( '- ', (COUNT(parent.acc_name) - 1) ), node.acc_name) AS acc_name , (COUNT(parent.acc_name) -1 ) AS level + FROM Account AS node, + Account AS parent + WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right and node.acc_id like CONCAT(cls,"%") + GROUP BY node.acc_id + ORDER BY node.acc_id; +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `account_insert_below` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `account_insert_below`(IN period VARCHAR(32), IN parent_acc VARCHAR(32),IN acc VARCHAR(32) ,IN name VARCHAR(64) ) +BEGIN + + SET @myLeft := (SELECT acc_left FROM Account WHERE acc_id = parent_acc); + + UPDATE Account SET acc_right = acc_right + 2 WHERE acc_right > @myLeft; + UPDATE Account SET acc_left = acc_left + 2 WHERE acc_left > @myLeft; + + INSERT INTO Account(acc_id,acc_info_id,acc_name, acc_left, acc_right) VALUES(acc,CONVERT(acc,UNSIGNED INTEGER ),name, @myLeft + 1, @myLeft + 2); + + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `account_insert_beside` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `account_insert_beside`(IN period VARCHAR(32),IN left_acc VARCHAR(32), IN acc VARCHAR(32) ,IN name VARCHAR(64) ) +BEGIN + + SET @myRight := (SELECT acc_right FROM Account + WHERE acc_id = left_acc); + + UPDATE Account SET acc_right = acc_right + 2 WHERE acc_right > @myRight; + UPDATE Account SET acc_left = acc_left + 2 WHERE acc_left > @myRight; + + INSERT INTO Account(acc_id, acc_info_id,acc_name,acc_left,acc_right) VALUES(acc,CONVERT(acc,UNSIGNED INTEGER),name, @myRight + 1, @myRight + 2); + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `appel_fonds` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `appel_fonds`( + IN ed DATE, + IN copro_aid INTEGER , + IN prod_aid INTEGER, + IN am REAL, + IN des VARCHAR(256)) +BEGIN +INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (ed,ed,"",des); +SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type) VALUES + (@last_id,ed,"",prod_aid,am,'c',des,'AF'); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type) VALUES + (@last_id,ed,"",copro_aid,am,'d',des,'AF'); +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `a_nouveau` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `a_nouveau`(IN dt DATE,in period TEXT) +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE deb DOUBLE; + DECLARE cre DOUBLE; + DECLARE sol DOUBLE; + DECLARE pc INT; + DECLARE cur2 CURSOR FOR SELECT acc_id FROM Account ; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + SET @enabled = TRUE; + -- Create Transation + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (dt,dt,"",CONCAT("Report a nouveau ",period)) + ; + SET @last_id = LAST_INSERT_ID(); + OPEN cur2; + read_loop_rg : LOOP + FETCH cur2 INTO a; + IF done THEN + LEAVE read_loop_rg; + END IF; + CALL solde_compte_out(period,a,deb,cre,sol,pc); + CALL debug_msg(@enabled,CONCAT(" Process account ",a," debit=",deb," cre=",cre," solde=",sol," pc=",pc," done=",done)); + IF sol < -0.01 THEN + CALL debug_msg(@enabled,CONCAT(" Process report débit ",deb)); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"AN",dt,"",a,ABS(sol),'d',CONCAT("Report Solde ",period)); + END IF; + IF sol > 0.01 THEN + CALL debug_msg(@enabled,CONCAT(" Process report positive ",deb)); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"AN",dt,"",a,ABS(sol),'c',CONCAT("Report Solde ",period)); + END IF; + END LOOP read_loop_rg; + CLOSE cur2; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `bilan` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `bilan`(IN `period` VARCHAR(32)) +BEGIN +SELECT m.acc_id As Compte,m.acc_name AS Description, ROUND(m.Debit,2),ROUND(m.Credit,2),ROUND(m.Debit-m.Credit,2) as sold FROM (SELECT c.acc_id, c.acc_name + , SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END) as Debit + , SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END) as Credit + , MONTHNAME(t.act_trans_date) as Month +FROM Account AS c +JOIN Account pc +JOIN Period AS p +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id + AND c.acc_left <= pc.acc_left AND c.acc_right >= pc.acc_right +WHERE p.per_string = period + AND t.act_trans_date BETWEEN p.per_begin AND p.per_end + +GROUP BY c.acc_id +ORDER BY c.acc_left ) AS m; +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `debug_msg` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `debug_msg`(IN enabled INTEGER,IN msg VARCHAR(256)) +BEGIN + IF enabled THEN BEGIN + SELECT CONCAT("**",msg) AS '** DEBUG:'; + END; + END IF; +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `detail_compte_sans_solde` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `detail_compte_sans_solde`(IN period VARCHAR(32), IN acc VARCHAR(32) ) +BEGIN + SELECT t.act_trans_date as Date , + t.voucher_ref as Ref, + t.trans_label , + CASE WHEN debit_credit='d' THEN ROUND(amount,2) ELSE 0 END as Debit, + CASE WHEN debit_credit='c' THEN ROUND(amount,2) ELSE 0 END as Credit + FROM TransactionEntry as te + JOIN Transactions as t ON te.trans_id = t.trans_id + JOIN Period as p on t.act_trans_date BETWEEN p.per_begin and p.per_end and p.per_string =period + WHERE te.acc_id=acc ORDER BY t.act_trans_date ASC; +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `detail_decompte_charge` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `detail_decompte_charge`( + IN user_id INTEGER, + IN poste_charge_id INTEGER, + IN period VARCHAR(32), + IN preci INTEGER) +BEGIN + SET @myAccount := (SELECT acc_id FROM Account + JOIN JoinIdentityAccount as jia on jia.jia_acc = acc_id + WHERE user_id = jia.jia_ident); + SELECT te.`entry_date` as Date, + te.acc_id as Compte, + ac.`acc_name`, + te.description, + amount as MontantTotal, + ROUND( FctTantieme(@myAccount,poste_charge_id) + ,preci) + + as Tan, + ROUND( (amount * FctTantiemeFrac(@myAccount,poste_charge_id) ) + ,preci + ) as Montant, + pc.pc_name as Cle from TransactionEntry as te + JOIN Account as ac on (ac.acc_id = te.acc_id) + JOIN PosteCharge as pc on (te.tret_key_id = pc.pc_id) + JOIN Period AS p on te.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + where te.acc_id like '6%' and te.debit_credit = 'd' and IF (poste_charge_id != 0,te.tret_key_id = poste_charge_id,1) + ORDER BY te.entry_date; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `detail_decompte_solde` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `detail_decompte_solde`( + IN user_id INTEGER, + IN poste_charge_id INTEGER, + IN period VARCHAR(32), + IN preci INTEGER) +BEGIN + + SET @myAccount := (SELECT acc_id FROM Account + JOIN JoinIdentityAccount as jia on jia.jia_acc = acc_id + WHERE user_id = jia.jia_ident); + SELECT + sum(amount) as MontantTotal, + ROUND( sum((amount * (FctTantiemeFrac(@myAccount,pc.pc_id) + ))) ,preci + ) as Montant + from TransactionEntry as te + JOIN Account as ac on (ac.acc_id = te.acc_id) + JOIN PosteCharge as pc on (te.tret_key_id = pc.pc_id) + JOIN Period AS p on te.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + where te.acc_id like '6%' and te.debit_credit = 'd' and IF (poste_charge_id != 0,te.tret_key_id = poste_charge_id,1) + ORDER BY te.entry_date; + +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `fill_loanentry` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `fill_loanentry`(IN _loan INTEGER) +BEGIN + DECLARE counter INT DEFAULT 0; + DECLARE interet DOUBLE DEFAULT 0.0; + SET @ann := (SELECT annuite_mensuelle(_loan)); + SET @duree := (SELECT ln_duree FROM Loan WHERE ln_id = _loan); + SET @_date := (SELECT ln_date FROM Loan WHERE ln_id = _loan); + SET @capital := (SELECT ln_amount FROM Loan WHERE ln_id = _loan); + SET @taux := (SELECT (ln_rate / 12.0) FROM Loan WHERE ln_id = _loan); + SET @counter = 0; + WHILE (@counter < @duree) DO + BEGIN + SET @interet = @capital * @taux; + INSERT INTO LoanEntry(le_loan_id,le_date,le_interest,le_annuite,le_ammorti,le_value) + VALUE(_loan, ADDDATE(@_date, INTERVAL @counter MONTH), + ROUND(@interet,2), + ROUND(@ann,2), + ROUND(@ann - @interet,2), + ROUND(@capital - (@ann - @interet),2)); + SET @capital = ROUND(@capital - (@ann - @interet),2); + SET @counter = @Counter + 1; + END; + END WHILE ; +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `insert_avance` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `insert_avance`( + IN ed DATE, + IN vouch VARCHAR(32), + IN bqaid VARCHAR(32), + IN aid VARCHAR(32), + IN am REAL, + IN des VARCHAR(256)) +BEGIN + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + ( ed,ed,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,entry_type,acc_id,amount,debit_credit,description) VALUES + (@last_id,ed,vouch,"BQ",aid,am,'c',des); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,entry_type,acc_id,amount,debit_credit,description) VALUES + (@last_id,ed,vouch,"BQ",bqaid,am,'d',des); + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `insert_trans_facture` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `insert_trans_facture`(IN er_date DATE, + IN ed DATE, + IN vouch VARCHAR(32), + IN chaci INTEGER , + IN aci INTEGER, + IN am REAL, + IN des VARCHAR(256), + IN key_id INTEGER + ) +BEGIN + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (ed,er_date,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type,tret_key_id) VALUES + (@last_id,ed,vouch,chaci,am,'d',des,'HA',key_id); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type,tret_key_id) VALUES + (@last_id,ed,vouch,aci,am,'c',des,'HA',key_id); + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `insert_trans_paye` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `insert_trans_paye`(IN tid DATE,IN ed DATE,IN vouch VARCHAR(32), + IN bqaci INTEGER , + IN aci INTEGER,IN am REAL,IN des VARCHAR(256)) +BEGIN + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (ed,tid,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type) VALUES + (@last_id,tid,vouch,bqaci,am,'c',des,'BQ'); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type) VALUES + (@last_id,tid,vouch,aci,am,'d',des,'BQ'); + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `journal` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `journal`(IN period VARCHAR(32),IN jrn VARCHAR(2),IN preci INTEGER,IN _offs INTEGER ,IN _limit INTEGER) +BEGIN + set @valPeriod= period; + set @valJrnx = jrn; + SET @valFrom = _offs; + SET @valLimit = _limit; + SET @v_query = CONCAT("SELECT t.act_trans_date AS Date, j.acc_id AS Compte, r.acc_name AS Ref, t.trans_label AS Libelle,", + "ROUND( ( CASE WHEN j.debit_credit = 'd' THEN j.amount ELSE 0 END), ",preci," ) AS Debit,", + "ROUND( ( CASE WHEN j.debit_credit = 'c' THEN j.amount ELSE 0 END), ",preci," ) AS Credit,", + " t.act_trans_date +FROM TransactionEntry AS j +JOIN Transactions AS t ON j.trans_id = t.trans_id +JOIN Account AS r ON j.acc_id = r.acc_id +JOIN Period AS p ON t.act_trans_date +BETWEEN p.per_begin +AND p.per_end +AND p.per_string ='", @valPeriod , +"' WHERE j.entry_type ='",@valJrnx , +"' ORDER BY t.act_trans_date DESC, t.trans_label + LIMIT ", @valFrom, ",",@valLimit,";"); + PREPARE q FROM @v_query; + EXECUTE q; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `journal_solde` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `journal_solde`(IN `period` VARCHAR(32), IN `jrn` VARCHAR(2), IN `preci` INT) +BEGIN + SELECT ROUND(sum(CASE WHEN j.debit_credit ='d' THEN j.amount ELSE 0 END), preci) as Debit , + ROUND(sum(CASE WHEN j.debit_credit ='c' THEN j.amount ELSE 0 END), preci) as Credit, + COUNT(*) as Ro + FROM TransactionEntry as j + JOIN Transactions as t ON j.trans_id = t.trans_id + JOIN Account AS r on j.acc_id = r.acc_id + JOIN Period AS p on t.act_trans_date BETWEEN p.per_begin and p.per_end and p.per_string = period + WHERE j.entry_type = jrn + ; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `rembourse_appel_fonds` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `rembourse_appel_fonds`( + IN ed DATE, + IN period VARCHAR(32), + IN prod_aid INTEGER, + IN des VARCHAR(256)) +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE am DOUBLE; + -- DECLARE cur1 CURSOR FOR SELECT acc_id,FctTantieme(acc_id,cle) FROM Account where acc_id like '450%'; + DECLARE cur1 CURSOR FOR SELECT acc_id,sum(amount) as am FROM TransactionEntry as te + JOIN Period as p on te.entry_date BETWEEN p.per_begin and p.per_end and p.per_string =period + where entry_type = "AF" and acc_id like '450%' GROUP BY acc_id; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (ed,ed,"",des); + SET @last_id = LAST_INSERT_ID(); + + OPEN cur1; + + read_loop: LOOP + FETCH cur1 INTO a, am; + IF done THEN + LEAVE read_loop; + END IF; + IF am > 0 THEN + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"RF",ed,"",prod_aid,am,'d',des); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"RF",ed,"",a,am,'c',des); + END IF; + END LOOP; + + CLOSE cur1; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `rembourse_trans_chauffage` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `rembourse_trans_chauffage`( IN trs_dt DATE , + IN ed DATE, + IN chrg VARCHAR(32), + IN vouch VARCHAR(32), + in am DOUBLE, + in cle INTEGER, + in des VARCHAR(256) + ) +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE tant DOUBLE; + DECLARE cur1 CURSOR FOR SELECT acc_id,FctTantiemeFrac(acc_id,cle) FROM Account where acc_id like '450%'; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + ( ed,trs_dt,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,chrg,am,'d',des); + OPEN cur1; + + read_loop: LOOP + FETCH cur1 INTO a, tant; + IF done THEN + LEAVE read_loop; + END IF; + IF tant > 0 THEN + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,a,am*tant,'c',des); + END IF; + END LOOP; + + CLOSE cur1; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `repartir_charge_global` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `repartir_charge_global`(IN dt DATE,in period TEXT) +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE deb DOUBLE; + DECLARE cre DOUBLE; + DECLARE sol DOUBLE; + DECLARE pc INT; + DECLARE cur2 CURSOR FOR SELECT acc_id FROM Account where acc_id like "6%"; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + SET @enabled = TRUE; + OPEN cur2; + read_loop_rg : LOOP + FETCH cur2 INTO a; + IF done THEN + LEAVE read_loop_rg; + END IF; + CALL solde_compte_out(period,a,deb,cre,sol,pc); + CALL debug_msg(@enabled,CONCAT(" Process account ",a," debit=",deb," cre=",cre," solde=",sol," pc=",pc," done=",done)); + IF sol < -0.01 THEN + CALL debug_msg(@enabled,CONCAT(" Process account repartir ",deb)); + CALL repartir_trans_charge(dt,dt,a,"",ABS(sol),pc,CONCAT("Répartion ",ROUND(ABS(sol),2),"€ du compte ",a," Clé ",pc)); + END IF; + END LOOP read_loop_rg; + CLOSE cur2; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `repartir_trans_charge` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `repartir_trans_charge`(IN trs_dt DATE , + IN ed DATE, + IN chrg VARCHAR(32), + IN vouch VARCHAR(32), + in am DOUBLE, + in cle INTEGER, + in des VARCHAR(256) + ) +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE tant DOUBLE; + DECLARE cur1 CURSOR FOR SELECT acc_id,FctTantiemeFrac(acc_id,cle) FROM Account where acc_id like '450%'; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + ( ed,trs_dt,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description,tret_key_id) VALUES + (@last_id,"OD",ed,vouch,chrg,am,'c',des,cle); + OPEN cur1; + + read_loop: LOOP + FETCH cur1 INTO a, tant; + IF done THEN + LEAVE read_loop; + END IF; + IF tant > 0 THEN + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,a,am*tant,'d',des); + END IF; + END LOOP; + + CLOSE cur1; +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `solde_compte` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `solde_compte`(IN period VARCHAR(32), IN acc VARCHAR(32) ) +BEGIN + + select + ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) as Debit, + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) as Credit, + CASE WHEN + sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) > sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) > 0 + THEN + -1 * ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) + ELSE + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) + END as Solde + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string =period + where acc_id=acc ORDER BY entry_date; + + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `solde_compte_out` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `solde_compte_out`(IN period VARCHAR(32), IN acc VARCHAR(32), OUT Debit_ DOUBLE , INOUT Credit_ DOUBLE , INOUT Solde_ DOUBLE,INOUT Pc_ INT) +BEGIN + +select + ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) as Debit, + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) as Credit, + CASE WHEN + sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) > sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) > 0 + THEN + -1 * ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) + ELSE + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) + END as Solde , t.tret_key_id INTO Debit_, Credit_, Solde_,Pc_ + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string =period + where acc_id=acc ORDER BY entry_date LIMIT 1; + +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `solde_compte_per_month` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `solde_compte_per_month`(IN period VARCHAR(32),IN acc VARCHAR(32)) +BEGIN +SELECT m.Month, m.acc_id As Account, m.Debit,m.Credit,(m.Debit-m.Credit) as sold FROM (SELECT c.acc_id, c.acc_name + , TRUNCATE(SUM(CASE WHEN te.debit_credit ='d' THEN amount ELSE 0 END),2) as Debit + , TRUNCATE(SUM(CASE WHEN te.debit_credit ='c' THEN amount ELSE 0 END),2) as Credit + , MONTH(t.act_trans_date) as Month +FROM Account AS c +JOIN Account pc +JOIN Period AS p +JOIN Transactions AS t +JOIN TransactionEntry AS te ON te.trans_id = t.trans_id AND pc.acc_id = te.acc_id + AND c.acc_left <= pc.acc_left AND c.acc_right >= pc.acc_right +WHERE p.per_string = period + AND t.act_trans_date BETWEEN p.per_begin AND p.per_end + AND c.acc_id = acc +GROUP BY MONTH(t.act_trans_date) +ORDER BY c.acc_left , MONTH(t.act_trans_date) ) AS m; + END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; +/*!50003 DROP PROCEDURE IF EXISTS `solde_compte_where` */; +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = '' */ ; +DELIMITER ;; +CREATE DEFINER=`aeb`@`%` PROCEDURE `solde_compte_where`(IN period VARCHAR(32), IN crit VARCHAR(128)) +BEGIN + SET @Stm = CONCAT(" +select + COALESCE(ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2),0) as Debit, + COALESCE(ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2),0) as Credit, + CASE WHEN + sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) > sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) > 0 + THEN + COALESCE( + -1 * ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2),0) + ELSE + COALESCE( + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) , 0) + END as Solde + + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = '",period,"' + WHERE ", crit," ORDER BY entry_date;"); + PREPARE q FROM @Stm; + EXECUTE q; + DEALLOCATE PREPARE q; + +END ;; +DELIMITER ; +/*!50003 SET sql_mode = @saved_sql_mode */ ; +/*!50003 SET character_set_client = @saved_cs_client */ ; +/*!50003 SET character_set_results = @saved_cs_results */ ; +/*!50003 SET collation_connection = @saved_col_connection */ ; + +-- +-- Final view structure for view `Owners` +-- + +/*!50001 DROP TABLE IF EXISTS `Owners`*/; +/*!50001 DROP VIEW IF EXISTS `Owners`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`aeb`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `Owners` AS select `u`.`ident_id` AS `ident_id`,`u`.`ident_name` AS `ident_name`,`u`.`ident_firstname` AS `ident_firstname`,`u`.`ident_address` AS `ident_address`,`u`.`ident_postalcode` AS `ident_postalcode`,`u`.`ident_city` AS `ident_city`,`u`.`ident_country` AS `ident_country`,`u`.`ident_mobile` AS `ident_mobile`,`u`.`ident_phone` AS `ident_phone`,`u`.`ident_email1` AS `ident_email1`,`u`.`ident_email2` AS `ident_email2`,`ir`.`idr_name` AS `idr_name` from ((`users`.`Users` `u` join `users`.`UserRoles` `ur` on((`ur`.`ur_user_id` = `u`.`ident_id`))) join `users`.`IdentityRole` `ir` on((`ur`.`ur_role_id` = `ir`.`idr_id`))) where ((`ur`.`ur_org_id` = 26) and (`ir`.`idr_name` = 'Coproprietaire')) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + +-- +-- Final view structure for view `Suppliers` +-- + +/*!50001 DROP TABLE IF EXISTS `Suppliers`*/; +/*!50001 DROP VIEW IF EXISTS `Suppliers`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`aeb`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `Suppliers` AS select `i`.`ident_id` AS `ident_id`,`i`.`ident_name` AS `ident_name`,`i`.`ident_firstname` AS `ident_firstname`,`i`.`ident_address` AS `ident_address`,`i`.`ident_postalcode` AS `ident_postalcode`,`i`.`ident_city` AS `ident_city`,`i`.`ident_country` AS `ident_country`,`i`.`ident_mobile` AS `ident_mobile`,`i`.`ident_phone` AS `ident_phone`,`i`.`ident_email1` AS `ident_email1`,`i`.`ident_email2` AS `ident_email2` from (((`users`.`Identity` `i` join `users`.`IdentityType` `it` on((`i`.`ident_type` = `it`.`idtp_id`))) join `users`.`UserRoles` `ur` on((`ur`.`ur_user_id` = `i`.`ident_id`))) join `users`.`IdentityRole` `ir` on((`ir`.`idr_id` = `ur`.`ur_role_id`))) where ((`ur`.`ur_org_id` = 26) and (`ir`.`idr_name` = 'Fournisseur')) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2021-08-01 0:49:42 diff --git a/app/compta/patchs/loan.txt b/app/compta/patchs/loan.txt new file mode 100644 index 0000000..febc8c0 --- /dev/null +++ b/app/compta/patchs/loan.txt @@ -0,0 +1,77 @@ + +DROP TABLE IF EXISTS Loan; + +CREATE TABLE IF NOT EXISTS Loan ( + ln_id INTEGER AUTO_INCREMENT PRIMARY KEY, + ln_date DATE COMMENT 'Date du pret', + ln_amount DOUBLE DEFAULT 0.0 COMMENT 'Montant emprunte', + ln_rate DOUBLE DEFAULT 0.01 COMMENT 'taux du pret par an', + ln_duree INTEGER COMMENT 'Duree du pret en mois', + ln_desc VARCHAR(255) DEFAULT "" +) CHARACTER SET utf8 COLLATE utf8_general_ci; + +DROP TABLE IF EXISTS LoanEntry; + +CREATE TABLE IF NOT EXISTS LoanEntry ( + le_id INTEGER AUTO_INCREMENT PRIMARY KEY, + le_loan_id INTEGER, + le_date DATE COMMENT 'Echéance de remboursement', + le_interest DOUBLE DEFAULT 0.0 COMMENT 'Interet restant du', + le_annuite DOUBLE DEFAULT 0.0 COMMENT 'Annuité mensuelle', + le_ammorti DOUBLE DEFAULT 0.0 COMMENT 'Montant ammorti', + le_booked BOOLEAN DEFAULT FALSE, + le_value DOUBLE DEFAULT 0.0 , + INDEX loan_id ( le_loan_id), + FOREIGN KEY(le_loan_id) + REFERENCES Loan(ln_id) + ON DELETE CASCADE +) CHARACTER SET utf8 COLLATE utf8_general_ci; + + +delimiter // +DROP FUNCTION IF EXISTS annuite_mensuelle // +CREATE FUNCTION annuite_mensuelle( _loan_id INTEGER) + RETURNS DOUBLE + NOT DETERMINISTIC + READS SQL DATA +BEGIN + RETURN (SELECT TRUNCATE(( ln_amount * (ln_rate / 12.0 ) / ( 1.0 - ( 1.0 / POW(1.0 + ln_rate/12.0,ln_duree )) )),2) FROM Loan WHERE ln_id = _loan_id); +END ; // + + +DROP PROCEDURE IF EXISTS fill_loanentry // + +CREATE PROCEDURE fill_loanentry(IN _loan INTEGER) +BEGIN + DECLARE counter INT DEFAULT 0; + DECLARE interet DOUBLE DEFAULT 0.0; + SET @ann := (SELECT annuite_mensuelle(_loan)); + SET @duree := (SELECT ln_duree FROM Loan WHERE ln_id = _loan); + SET @_date := (SELECT ln_date FROM Loan WHERE ln_id = _loan); + SET @capital := (SELECT ln_amount FROM Loan WHERE ln_id = _loan); + SET @taux := (SELECT (ln_rate / 12.0) FROM Loan WHERE ln_id = _loan); + SET @counter = 0; + WHILE (@counter < @duree) DO + BEGIN + SET @interet = @capital * @taux; + INSERT INTO LoanEntry(le_loan_id,le_date,le_interest,le_annuite,le_ammorti,le_value) + VALUE(_loan, ADDDATE(@_date, INTERVAL @counter MONTH), + ROUND(@interet,2), + ROUND(@ann,2), + ROUND(@ann - @interet,2), + ROUND(@capital - (@ann - @interet),2)); + SET @capital = ROUND(@capital - (@ann - @interet),2); + SET @counter = @Counter + 1; + END; + END WHILE ; +END // + +delimiter ; + +INSERT INTO Loan (ln_date,ln_amount,ln_rate,ln_duree) VALUES('2021-02-10',86133.34,0.0185,174 -68); +call fill_loanentry(1); +SELECT * FROM LoanEntry LIMIT 0,10; +select SUM(le_interest),sum(le_annuite) FROM LoanEntry group by (le_booked); +select YEAR(le_date) as Year,SUM(le_interest) as interet ,sum(le_annuite) as ann , sum(le_annuite) - sum(le_interest) as cap FROM LoanEntry group by YEAR(le_date); +SELECT annuite_mensuelle(01) as annuite; + diff --git a/app/compta/patchs/procedures.txt b/app/compta/patchs/procedures.txt new file mode 100644 index 0000000..da7744e --- /dev/null +++ b/app/compta/patchs/procedures.txt @@ -0,0 +1,115 @@ + +This document keeps track of all tables and procedures used +in the accouting software. + +HISTORY +version 0.1.0 + +version 1.0.0 + +version 1.1.0 + depracated procedure +version 1.2.0 + new procedure annuite_mensuelle + new function fPeriod + new procedure fill_loanentry + update procedure bilan + update procedure journal (offset and limit parameter) + + new view + +STORED PROCEDURES +- +PROCEDURE account_get_leafs + in use + +PROCEDURE account_get_tree + in use + +PROCEDURE account_insert_below + in use + +PROCEDURE account_insert_beside + in use + +PROCEDURE appel_fonds + +PROCEDURE appel_fonds_sur_facture + +PROCEDURE a_nouveau + +PROCEDURE bilan + in use + +PROCEDURE debug_msg + +PROCEDURE detail_compte + +PROCEDURE detail_compte_sans_solde + +PROCEDURE detail_decompte_charge + +PROCEDURE detail_decompte_charge_par_lot + +PROCEDURE detail_decompte_solde + +FUNCTION FctTantieme + in use + +FUNCTION FctTantiemeFrac + in use + +PROCEDURE insert_avance + in use + +PROCEDURE insert_facture + deprecated + +PROCEDURE insert_trans_facture + in use + +PROCEDURE insert_trans_paye + in use + +PROCEDURE insert_view_avance + deprecated + +PROCEDURE insert_view_facture + deprecated + +PROCEDURE insert_view_paye + deprecated + +PROCEDURE insert_view_pc1 + used for 2012 and 2013 + deprecated + +PROCEDURE insert_view_pc2 + used for 2012 and 2013 + deprecated + +PROCEDURE insert_view_pc4 + used for 2012 and 2013 + deprecated + +PROCEDURE journal + +PROCEDURE journal_solde + +PROCEDURE rembourse_appel_fonds + +PROCEDURE rembourse_trans_chauffage + +PROCEDURE repartir_charge + +PROCEDURE repartir_charge_global + +PROCEDURE repartir_trans_charge + +PROCEDURE solde_compte + +PROCEDURE solde_compte_out + +PROCEDURE solde_compte_where + +PROCEDURE tantieme diff --git a/app/compta/patchs/recurrent.txt b/app/compta/patchs/recurrent.txt new file mode 100644 index 0000000..2de72dc --- /dev/null +++ b/app/compta/patchs/recurrent.txt @@ -0,0 +1,37 @@ +-- +-- Table structure for table `Recurrent` +-- + +DROP TABLE IF EXISTS `Recurrent`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `Recurrent` ( + `r_id` int(11) NOT NULL AUTO_INCREMENT, + `r_desc` varchar(64) NOT NULL DEFAULT '""', + `r_amount` decimal(13,2) NOT NULL DEFAULT '0.00', + `r_date` date NOT NULL, + `r_end` date NOT NULL, + `r_next` date NOT NULL, + `r_period` int(11) NOT NULL DEFAULT '1' COMMENT 'unit is month', + PRIMARY KEY (`r_id`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='Recurrent operations that can be handled wih cron'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `RecurrentEntry` +-- + +DROP TABLE IF EXISTS `RecurrentEntry`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `RecurrentEntry` ( + `re_id` int(11) NOT NULL AUTO_INCREMENT, + `re_rec_id` int(11) NOT NULL, + `re_entry_type` varchar(2) NOT NULL, + `re_debit_credit` enum('d','c') NOT NULL DEFAULT 'd', + `re_amount` decimal(13,2) NOT NULL DEFAULT '0.00', + `re_acc` varchar(16) NOT NULL, + PRIMARY KEY (`re_id`) +) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + diff --git a/app/compta/patchs/requetes_utils.txt b/app/compta/patchs/requetes_utils.txt new file mode 100644 index 0000000..4450785 --- /dev/null +++ b/app/compta/patchs/requetes_utils.txt @@ -0,0 +1,21 @@ + + +2021-07-31 find transaction that have no transaction_entry. +----------------------------------------------------------- + + +SELECT t.trans_id,t.trans_label FROM Transactions as t +LEFT JOIN TransactionEntry as te on t.trans_id = te.trans_id +WHERE act_trans_date between "2021-01-01" and "2021-12-31" and te.trans_id IS NULL +GROUP BY t.trans_id +ORDER BY t.act_trans_date + + +2021-07-31 Delete transaction without transaction entry +-------------------------------------------------------- + +DELETE FROM Transactions WHERE trans_id IN ( SELECT * FROM (SELECT t.trans_id,t.trans_label FROM Transactions as t +LEFT JOIN TransactionEntry as te on t.trans_id = te.trans_id +WHERE act_trans_date between "2021-01-01" and "2021-12-31" and te.trans_id IS NULL +GROUP BY t.trans_id +ORDER BY t.act_trans_date ) AS X ) diff --git a/app/compta/patchs/solde_compte_per_month_per_year.txt b/app/compta/patchs/solde_compte_per_month_per_year.txt new file mode 100644 index 0000000..de5f52a --- /dev/null +++ b/app/compta/patchs/solde_compte_per_month_per_year.txt @@ -0,0 +1,9 @@ +select dat,Debit,Credit, Debit - Credit As Solde FROM +(select DATE_FORMAT(TransactionEntry.entry_date ,"%m:%Y") as dat, + SUM(CASE WHEN TransactionEntry.debit_credit = 'd' THEN TransactionEntry.amount ELSE 0.0 END) as Debit + ,SUM(case WHEN TransactionEntry.debit_credit ='c' THEN TransactionEntry.amount ELSE 0.0 END) AS + Credit +FROM TransactionEntry +where TransactionEntry.acc_id = "512003" and TransactionEntry.entry_date betWEEN "2021-01-01" and "2021-12-31" + and TransactionEntry.entry_type != "AN" +group by dat WITH ROLLUP) AS son; diff --git a/app/compta/patchs/tantieme_per_lot.sql b/app/compta/patchs/tantieme_per_lot.sql new file mode 100644 index 0000000..03f6f28 --- /dev/null +++ b/app/compta/patchs/tantieme_per_lot.sql @@ -0,0 +1,9 @@ + +CREATE PROCEDURE tantieme_per_lot(IN uid INT) +BEGIN +SELECT l.lot_name as Name ,pc.pc_name,t.tant_lot_size +FROM LotsOwners as lo, PosteCharge as pc, Lot as l +JOIN Tantieme as t on t.tant_lot_num = l.lot_num +WHERE lo.lo_lot_id = l.lot_id and + lo.lo_owner_id = uid and pc.pc_id=t.tant_pc_id order by Name,tant_pc_id; +END diff --git a/app/compta/patchs/update_transation_foreign_key.txt b/app/compta/patchs/update_transation_foreign_key.txt new file mode 100644 index 0000000..1526fb0 --- /dev/null +++ b/app/compta/patchs/update_transation_foreign_key.txt @@ -0,0 +1,6 @@ + +ALTER TABLE TransactionEntry + ADD CONSTRAINT FK_TransTransEntry + FOREIGN KEY ( trans_id ) + REFERENCES Transaction( trans_id ) ON DELETE CASCADE; + diff --git a/app/compta/pcmn.js b/app/compta/pcmn.js new file mode 100644 index 0000000..04b993a --- /dev/null +++ b/app/compta/pcmn.js @@ -0,0 +1,158 @@ +define(["require", "exports", "../../js/xgui/CtrlDialogbox", "./services"], function (require, exports, CtrlDialogbox_1, services_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var PlanComptable; + (function (PlanComptable) { + class DlgPcmn extends CtrlDialogbox_1.Dialogbox { + constructor(_id, jurl) { + console.log("DlgPcmn constructor"); + super(_id); + var req = new AEBW.Json(jurl); + this._pcmn = new services_1.Services.PlanComptable(req); + var myPcmn = new AEBW.control.table('pcmn'); + this.TablePcmn = function () { return myPcmn; }; + this._current_class = '4'; + this.prepare(myPcmn); + } + onDummy(response) { + alert("DlgPcmn::Dummy Error" + response); + } + onDummyFail() { + alert("DlgPcmn::Dummy Error"); + } + addAccount(parent_account) { + var t = new services_1.Services.AddAccountReqParams($('class').value, $('lib').value, parent_account); + console.log('DlgPcmn::addAccount enter'); + try { + var bindFct = this.onAddAccount.bind(this); + this._pcmn.addAccount(t, bindFct, this.onDummyFail); + } + catch (e) { + alert("DlbPcmn.addAccount Failed" + e.message); + } + } + onAddAccount(response) { + this.getAccountList(this._current_class); + } + _actionCell(cell, it, rowNb) { + var obj = this; + var i1 = document.createElement('i'); + i1.setAttribute('class', 'fa fa-arrow-circle-down'); + i1.setAttribute('acc_id', it['acc_id']); + i1.setAttribute('row', rowNb); + i1.style.cssFloat = "left"; + i1.style.display = "inline-block"; + i1.onclick = function (event) { + console.log("DlgPcmn::on " + i1.getAttribute('acc_id') + " " + rowNb); + obj.addAccount(i1.getAttribute('acc_id')); + }; + var i3 = document.createElement('i'); + i3.setAttribute('class', 'fa fa-times'); + i3.setAttribute('acc_id', it['acc_id']); + i3.setAttribute('row', rowNb); + i3.style.cssFloat = "left"; + i3.style.display = "inline-block"; + i3.onclick = function (event) { + console.log("DlgPcmn::on " + i3.getAttribute('acc_id')); + obj.removeAccount(i3.getAttribute('acc_id')); + }; + cell.innerHTML = ""; + cell.appendChild(i1); + cell.appendChild(i3); + } + _typeCell(cell) { + cell.innerHTML = "Détail"; + } + getAccount() { + } + onGetAccount(response) { + alert('Yes ongetAccount'); + } + updateAccountName(acc, nm) { + var _param = new services_1.Services.ReqTwoParams(acc, nm); + var bindFct = this.onUpdateAccountName.bind(this); + this._pcmn.updateAccountName(_param, bindFct, this.onDummyFail); + this._current_class = nm; + } + onUpdateAccountName(res) { + } + getAccountList(nm) { + var _param = new services_1.Services.AccountListReqParams(nm, 1); + var bindFct = this.onGetAccountList.bind(this); + this._pcmn.getAccountList(_param, bindFct, this.onDummyFail); + this._current_class = nm; + } + onGetAccountList(response) { + var tb = this.TablePcmn(); + if (response.error !== 'undefined' && response.errorr != null) { + console.log("onGetAccountList Aiie " + response.error); + } + else { + console.log("onGetAccount List got:" + response.result.length); + } + this.cleanTable(tb, tb._NbRows); + for (var i = 0; i < response.result.length; i++) { + var it = response.result[i]; + var row = tb.addRow(); + this.fillRow(row, it, tb, i); + } + } + fillRow(row, it, tb, rowNb) { + row.cells[0].innerHTML = it['acc_id'] + " "; + row.cells[1].setAttribute("acc", it['acc_id']); + row.cells[1].innerHTML = it['acc_desc']; + row.cells[3].innerHTML = " "; + this._typeCell(row.cells[2]); + this._actionCell(row.cells[3], it, rowNb); + } + insertNew(acc_id, _under, rowNb) { + console.log("insertNew " + acc_id + " under=" + _under + " rowNb=" + rowNb); + } + removeAccount(acc_id) { + console.log("removeAccount " + acc_id + " "); + var t = new services_1.Services.DummyReqParams(acc_id); + try { + var bindFct = this.onAddAccount.bind(this); + this._pcmn.deleteAccount(t, bindFct, this.onDummyFail); + } + catch (e) { + alert("DlbPcmn.removeAccount Failed" + e.message); + } + } + cleanTable(tb, sz) { + for (var i = 0; i < sz; i++) { + tb.delRow(0); + } + } + prepare(t) { + var _obj = this; + AEBW.mixin(t, { + onSelectCell(elem, row, col) { + if (col == 2 && (elem.getAttribute('state') == 'RD')) { + elem.setAttribute('state', 'WR'); + var value = elem.innerHTML; + var inp = document.createElement('input'); + inp.setAttribute('type', 'text'); + inp.setAttribute('value', value); + inp.onkeypress = function (event) { + console.log("DlgPcmn::prepare mixin onSelectCell onkeypress"); + var evt = (event || window.event); + if (evt.keyCode == Prototype.Event.KEY_RETURN) { + var acc = elem.getAttribute('acc'); + var amount = inp.value; + elem.innerHTML = inp.value; + elem.setAttribute('state', 'RD'); + _obj.updateAccountName(acc, amount); + } + }; + elem.innerHTML = ""; + elem.appendChild(inp); + } + } + }); + } + } + PlanComptable.DlgPcmn = DlgPcmn; + PlanComptable.Pcmn = new DlgPcmn('', "/app/compta/index.php"); + })(PlanComptable = exports.PlanComptable || (exports.PlanComptable = {})); +}); diff --git a/app/compta/pcmn.xml b/app/compta/pcmn.xml new file mode 100644 index 0000000..8db16cb --- /dev/null +++ b/app/compta/pcmn.xml @@ -0,0 +1,395 @@ + + + + + + Gestion comptable + + + + +

    Gestion Comptable

    + +
    + + + + Société + + + + + Organisation + + + + + + + Exercice + + + + + + + + Lots + + + + +

    +
    +
    + + Type de compte + + + + +

    +
    +
    + +
    + +

    Information generales

    + +
    + +
    +
    +
    + + + + Plan + + + + + + Type de comptes + + + + + + + + + + + + + + +

    Plan comptable

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Titre du tableau
    classLibelléType
    + + Actif + Passif + Produit + Charge + Banque + + + +
    1Compte de testActif + +
    + +

    +
    +
    +
    +
    + + + Fournisseurs + + + + + Facture + + + + + + + Gestion + + + + + + + + + + + Nouvelle Facture + +
    + + + + + + + + +
    + +
    +
    +
    +
    +
    +
    +
    + + + Coproprietaires + + + + + Facture + + + + + + Gestion + + + + + + + + + + Vide + + + + + + + Eglise + + + + + Membres + + + + + + + Gestion + + + + + + + +

    Status

    +
    +
    +
    +
    + + Bilan + + + + Exercice + + + + + + + + + + + + + +
    Bilan de L'exercice
    CompteLibelleDebitCreditSolde
    10Immoblisation000
    + End Table +
    + +
    +
    + + Syndic + + +

    Information General du syndic

    +
    + + General + +
    + +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + diff --git a/app/compta/pcmnBootstrap.js b/app/compta/pcmnBootstrap.js new file mode 100644 index 0000000..12ebe0a --- /dev/null +++ b/app/compta/pcmnBootstrap.js @@ -0,0 +1,49 @@ +requirejs.config({ + baseUrl: '../..', + urlArgs: "v=" + (new Date()).getTime() , /* For debug*/ + paths: { + "cpt": "/app/compta", + "xgui": "/js/xgui", + "tslib": "/js/tslib", + "" : "" + }, + shim: { + "pcmn": { + deps: ['aebw' + , 'xgui/xgui_dialogbox' + , 'xgui/xgui_json' + , 'cpt/Dialog' + , 'cpt/services' + ,'js/scriptaculus/prototype'], + exports: 'PlanComptable', + init: function (x) { + console.log("shim de requirejs plan comptable not called either"); + } + }, + "Dialog": { + deps: ['xgui/xgui_dialogbox'], + exports: '' + }, + "xgui_dialogbox": { + deps: ['xgui/aebw'], + exports: '' + }, + "xgui_json": { + deps: ['xgui/aebw'], + exports: '' + } + } +}); +requirejs(["require", "exports" + , "tslib" + , "xgui/xgui_json" + , "xgui/xgui_dialogbox" + , "cpt/Dialog" + , "cpt/services" + , "cpt/pcmn"], function (req,exp,ts,xj,xf,dlg,srv,myApp) { + console.log("starting Plan Comptable application..."); + var Pcmn = myApp.PlanComptable.Pcmn; + Pcmn.getAccountList('4'); + // To allow access in web page. + window.Pcmn = Pcmn; +}); diff --git a/app/compta/pcmn_syndic.txt b/app/compta/pcmn_syndic.txt new file mode 100644 index 0000000..2d32be8 --- /dev/null +++ b/app/compta/pcmn_syndic.txt @@ -0,0 +1,120 @@ +Classe 1 Provisions, avances, subventions et emprunts +10 Provisions et avances : +102 Provisions pour travaux décidés +103 Avances +1031 Avances de trésorerie +1032 Avances travaux au titre de l'article 18, 6e alinéa de la loi susvisée +1033 Autres avances +12 Solde en attente sur travaux et opérations exceptionnelles +13 Subventions : +131 Subventions accordées en instance de versement + +Classe 4 - Copropriétaires et tiers +40 Fournisseurs : +401 Factures parvenues +408 Factures non parvenues +409 Fournisseurs débiteurs +42 Personnel : +421 Rémunérations dues +43 Sécurité sociale et autres organismes sociaux : +431 Sécurité sociale +432 Autres organismes sociaux +44 Etat et collectivités territoriales : +441 Etat et autres organismes - subventions à recevoir +442 Etat - impôts et versements assimilés +443 Collectivités territoriales - aides +45 Collectivité des copropriétaires : +450 Copropriétaire individualisé + +Si l'assemblée générale en décide la création, les sous-comptes suivants : + +450-1 Copropriétaire - budget prévisionnel +450-2 Copropriétaire - travaux de l'article 14-2 de la loi susvisée et opérations exceptionnelles +450-3 Copropriétaire - avances +450-4 Copropriétaire - emprunts +459 Copropriétaire - créances douteuses +46 Débiteurs et créditeurs divers : +461 Débiteurs divers +462 Créditeurs divers +47 Compte d'attente : +471 Compte en attente d'imputation débiteur +472 Compte en attente d'imputation créditeur +48 Compte de régularisation : +486 Charges payées d'avance +487 Produits encaissés d'avance +49 Dépréciation des comptes de tiers : +491 Copropriétaires +492 Personnes autres que les copropriétaires + +Classe 5 - Comptes financiers +50 Fonds placés : +501 Compte à terme +502 Autre compte +51 Banques, ou fonds disponibles en banque pour le syndicat : +512 Banques +514 Chèques postaux +53 Caisse. + +Classe 6 - Comptes de charges +60 Achats de matières et fournitures : +601 Eau +602 Electricité +603 Chauffage, énergie et combustibles +604 Achats produits d'entretien et petits équipements +605 Matériel +606 Fournitures +61 Services extérieurs : +611 Nettoyage des locaux +612 Locations immobilières +613 Locations mobilières +614 Contrats de maintenance +615 Entretien et petites réparations +616 Primes d'assurances +62 Frais d'administration et honoraires : +621 Rémunérations du syndic sur gestion copropriété +6211 Rémunération du syndic +6212 Débours +6213 Frais postaux +622 Autres honoraires du syndic +6221 Honoraires travaux +6222 Prestations particulières +6223 Autres honoraires +623 Rémunérations de tiers intervenants +624 Frais du conseil syndical +63 Impôts - taxes et versements assimilés : +632 Taxe de balayage +633 Taxe foncière +634 Autres impôts et taxes +64 Frais de personnel : +641 Salaires +642 Charges sociales et organismes sociaux +643 Taxe sur les salaires +644 Autres (médecine du travail, mutuelles, etc.) +66 Charges financières des emprunts, agios ou autres : +661 Remboursement d'annuités d'emprunt +662 Autres charges financières et agios +67 Charges pour travaux et opérations exceptionnelles : +671 Travaux décidés par l'assemblée générale +672 Travaux urgents +673 Etudes techniques, diagnostic, consultation +677 Pertes sur créances irracouvrables +678 Charges exceptionnelles +68 Dotations aux dépréciations sur créances douteuses. + + +Classe 7 - Comptes de produits +70 Appels de fonds : +701 Provisions sur opérations courantes +702 Provisions sur travaux de l'article 14-2 et opérations exceptionnelles +703 Avances +704 Remboursements d'annuités d'emprunts +71 Autres produits : +711 Subventions +712 Emprunts +713 Indemnités d'assurances +714 Produits divers (dont intérêts légaux dus par les copropriétaires) +716 Produits financiers +718 Produits exceptionnels + +78 Reprises de dépréciations sur créances douteuses. + diff --git a/app/compta/reports/decompte_charge.php b/app/compta/reports/decompte_charge.php new file mode 100644 index 0000000..54e6d0e --- /dev/null +++ b/app/compta/reports/decompte_charge.php @@ -0,0 +1,466 @@ +session = $_session; + $this->auth_conf = $auth_cfg; + $this->_dbname = $db; + parent::__construct($auth_cfg[SQL_SERVER],$auth_cfg[SQL_USER],$auth_cfg[SQL_PASSWD],$db); + } + + + function __destruct() { + parent::__destruct(); + } + + function Header() { + $this->SetFillColor(255); + $this->SetFont('Arial','',10); + $org = $this->session->getOrganization(); + // set default header data + $this->Cell(50,5,$org[0]); + $this->Ln(); + $this->Cell(50,5,$org[1]); + $this->Ln(); + $addr = $org[2]." ".$org[3]; + $this->Cell(50,5,$addr); + $this->Ln(); + //$this->Cell(50,5,"Tel: 06 70 43 73 80"); + + $this->SetFont('Arial','',14); + $this->SetFillColor(200); + $this->RoundedRect(120,10,75,10,5,"1234","DF"); + $this->Text(125,17,"Decompte de Charges"); + + } + private function Titre($libelle) { + $this->SetFont('Arial','',12); + $this->SetFillColor(200,200,255); + $this->Cell(0,6,$libelle,0,1,'L',true); + + $this->Ln(2); + $this->y0 = $this->GetY(); + } + + private function DetailLots($cpt) + { + $i = 0; + $ch =3; + $uid = $this->UserIdFromAccount($cpt); + $w = array(20,12,12,12,12); + $header = array('LOTS','PC1','PC2','PC4','EAU'); + $q = 'select l.lot_name as Name ,pc.pc_name,t.tant_lot_size from LotsOwners as lo, PosteCharge as pc, Lot as l join Tantieme as t on t.tant_lot_num = l.lot_num where lo.lo_lot_id = l.lot_id and'; + $q = $q.' lo.lo_owner_id ='.$uid. ' and pc.pc_id=t.tant_pc_id order by Name,tant_pc_id;'; + + $y = $this->GetY(); + $this->setY(35); + $this->SetFont('Arial','',6); + // header + for($i=0;$iCell($w[$i],$ch,iconv('UTF-8','iso8859-1',$header[$i]),1,0,'C'); + $header[$i] = 0.0; + } + $this->Ln(); + $res = $this->doQueryImpr($q); + // data + if ($res['records'] != "Failed") { + $i = 0; + $cols = count($res['records']); + foreach($res['records'] as $fields) + { + if ($i == 0) + { + $this->Cell($w[$i],$ch,$fields[0],'LR',0,'L'); + $header[$i] = 'Total'; + $i++; + } + $this->Cell($w[$i],$ch,number_format($fields[2],2),'LR',0,'R'); + $header[$i] = $header[$i] + $fields[2]; + $i++; + if ( !($i%5) ) { + $i = 0 ; + $this->Ln(); + } + } + } else { + $this->Cell($w[0],$ch,iconv('UTF-8','iso8859-1','Failed'),'LR',0,'C'); + $this->Ln(); + } + // bottom + for($i=0;$iCell($w[$i],$ch,iconv('UTF-8','iso8859-1',$header[$i]),1,0,'L'); + } else { + $this->Cell($w[$i],$ch,number_format($header[$i],2),1,0,'R'); + } + } + $this->Ln(); + $this->setY($y); + } + // Better table + private function ImprovedTable($header, $data) + { + $i = 0; + $ch = 4; + // Column widths + $w = array(17, 45, 68, 30,30); + // Header + for($i=0;$iCell($w[$i],7,$header[$i],1,0,'C'); + $this->Cell($w[$i],7,iconv('UTF-8','iso8859-1',$header[$i]),1,0,'C'); + $this->Ln(); + // Data + $this->SetFont('Arial','',8); + foreach($data as $row) + { + $this->Cell($w[0],$ch,$row[0],'LR'); + //$this->Cell($w[1],$ch,$row[1],'LR'); + $this->Cell($w[1],$ch,iconv('UTF-8','iso8859-1',$row[1]),'LR'); + + $this->Cell($w[2],$ch,$row[2],'LR',0,'R'); + if ($row[3] == 0.0 ) { + $this->Cell($w[3],$ch,'','LR',0,'R'); + } else + $this->Cell($w[3],$ch,number_format($row[3],2),'LR',0,'R'); + if ($row[4] == 0.0) { + $this->Cell($w[4],$ch,'','LR',0,'R'); + } else + $this->Cell($w[4],$ch,number_format($row[4],2),'LR',0,'R'); + $this->Ln(); + if ($i++ > 50) + { + $i = 0; + $this->AddPage(); + $this->Ln(); + } + } + $this->SetFont('Arial','',10); + // Closing line + $this->Cell(array_sum($w),0,'','T'); + } + // + + private function Solde($period,$compte) { + $w = array(130, 30,30); + $header = array('Solde','Debit','Credit'); + $q = 'CALL solde_compte("'.$period.'","'.$compte.'");'; + $this->Ln(); + // Header + + $res = $this->doQueryImpr($q); + if ($res['records'] != "Failed") { + $fields = $res['records'][0]; + $this->Cell($w[0],6,'Total','LR'); + $this->Cell($w[1],6,$fields[0],'LR',0,'R'); + $this->Cell($w[2],6,$fields[1],'LR',0,'R'); + $this->Ln(); + } else { + $this->Cell($w[0],6,'Total','LR'); + $this->Cell($w[1],6,'0','LR',0,'R'); + $this->Cell($w[2],6,'0','LR',0,'R'); + $this->Ln(); + } + $this->Cell(array_sum($w),0,'','T'); + $this->Ln(); + $this->Ln(); + if ($res['records'][0][2] > 0.0) { + $str = "Votre compte présente un solde créditeur de ".$res['records'][0][2]." euros"; + //$this->Cell(50,5,"Votre compte presente un solde crediteur de ".$res['records'][0][2]." euros"); + $this->Cell(50,5,iconv('UTF-8','iso8859-1',$str)); + } else { + $str = "Votre compte présente un solde débiteur de ".abs($res['records'][0][2])." euros"; + //$this->Cell(50,5,"Votre compte presente un solde debiteur de ".abs($res['records'][0][2])." euros"); + $this->Cell(50,5,iconv('UTF-8','iso8859-1',$str)); + } + + } + /** + * @brief Initial implementation to display owner info based on account name. It's a bad strategy. + * The info's should be based on uid in case the request comes from the syndic. + * The uid shall be the one from the session in the other case + * @deprecated + * + */ + private function Copro($compte) { + $x = 120; + $q = 'select ident_name,ident_firstname,ident_address,ident_postalcode,ident_city from Owners as i '; + $qj= 'JOIN JoinIdentityAccount as j on j.jia_ident = i.ident_id and j.jia_acc ='.$compte.';'; + $res = $this->doQueryImpr($q.$qj); + $ident = $res['records'][0]; + $this->Text($x,40,"".$ident[0]." ".$ident[1] ); + $this->Text($x,46,"".$ident[2]); + $this->Text($x,52,"".$ident[3]." ".$ident[4]); + $this->setY(60); + } + + /** + * @brief retrieve information from owner. Name, adresse, etc + * + */ + private function CoproUser($uid) { + $x = 120; + $q =<<<_EOF +SELECT ident_name,ident_firstname,ident_address,ident_postalcode,ident_city FROM Owners as i +WHERE ident_id = {$uid}; +_EOF; + $res = $this->doQueryImpr($q); + $ident = $res['records'][0]; + $this->Text($x,40,"".$ident[0]." ".$ident[1] ); + $this->Text($x,46,"".$ident[2]); + $this->Text($x,52,"".$ident[3]." ".$ident[4]); + $this->setY(60); + } + + /** + * @brief Initial implementation. Does not work as expected because a owner can + * ownmultiple accounts + * + * @TODO revise so that this entry can handle multiple accounts + */ + public function Decompte($period,$compte) { + $header = array('Date','Référence','Désignation','Débit','Crédit'); + $q = 'CALL detail_compte_sans_solde("'.$period.'","'.$compte.'");'; + + $res = $this->doQueryImpr($q); + + //echo "

    ".$q."

    "; + $this->SetFont('Arial','',10); + $this->AddPage(); + + $this->Ln(); + $this->Ln(); + $this->Copro($compte); + $this->Ln(); + $this->DetailLots($compte); + $this->Ln(); + $this->Titre("Compte ".$compte); + $this->ImprovedTable( $header,$res['records']); + // + $this->Solde($period,$compte); + // For test pupose + $this->Ln(); + try { + $exercice = $this->Exercice($period); + // Exercice Clos + if ($exercice[1] == 0) { + $this->Ln(); + $this->Detail($period,$compte); + } else { + $this->Cell(50,5,"Exercice Clos."); + $this->Ln(); + $this->Detail($period,$compte); + } + } catch (Exception $e) { + $this->Cell(50,5,"Failed :".$e->getMessage()); + } + $this->Output(); + } + function UserIdFromAccount($account) { + $q = "select jia_ident from JoinIdentityAccount WHERE jia_acc = ".$account.";"; + $res = $this->doQueryImpr($q); + return $res['records'][0][0]; + } + /** + * + */ + private function Detail($period,$compte) { + $opt = Array(); + $retrieve = new Retrieve( + $this->session, + $this->auth_conf, + $this->_dbname); + + + $result = $retrieve->getSoldeAccount($period,$compte,$opt); + $dt = $result['detail_charge']; + + $exercice = $this->Exercice($period); + // Exercice Clos + if ($exercice[1] == 0) { + $this->Titre("Detail exercice en cours"); + } else + { + $this->Titre("Detail exercice "); + } + $this->SetFont('Arial','',10); + $this->Ln(); + foreach($dt as $row) { + $this->Cell(50,5,iconv('utf8','iso8859-1',$row[0])); + $this->Cell(40,5,$row[1]." euros",0,1,'R'); + //$this->Ln(); + } + $this->Titre("Total charges ".$result['total_charge']." euros"); + $this->Titre("Total appels de fonds ".$result['total_appel']." euros"); + // Detail postes charges + $this->AddPage(); + $this->Ln(); + $page_height = 286.93; + foreach (array(1,4,5) as $row) + { + $space_left = $page_height - ($this->getY()); + if ( $space_left < 20) + { + $this->AddPage(); + $this->Ln(); + } else { + $this->Ln(); + } + $this->DetailPc($period,$compte,$row); + $this->Ln(05); + } + } + /** + */ + private function DetailPc($period,$cpt,$pcs) { + $uid = $this->UserIdFromAccount($cpt); + $this->Titre("Poste Charge PC".$pcs); + $q = "CALL detail_decompte_charge(".$uid.",".$pcs.",".$period.",2);"; + $res = $this->doQueryImpr($q); + $ch = 4; + $total = 0.0; + $tot_fra = 0.0; + /* + */ + if ($res['records'] != "Failed") { + $header = array('Date','Référence','Total','Tantième','Fraction'); + $data = $res['records']; + $i = 0; + // Column widths + $w = array(20, 70, 35, 30,30); + $wt = array(90, 35, 30,30); + // Header + for($i=0;$iCell($w[$i],7,iconv('UTF-8','iso8859-1',$header[$i]),1,0,'C'); + + $this->Ln(); + // Data + $this->SetFont('Arial','',8); + foreach($data as $row) + { + $this->Cell($w[0],$ch,$row[0],'LR'); + $total = $total + $row[4]; + //$this->Cell($w[1],$ch,$row[3],'LR'); + $this->Cell($w[1],$ch,iconv('UTF-8','iso8859-1',$row[3]),'LR'); + + $this->Cell($w[2],$ch,$row[4],'LR',0,'R'); + if ($row[5] == 0.0 ) { + $this->Cell($w[3],$ch,'','LR',0,'R'); + } else + $this->Cell($w[3],$ch,number_format($row[5],2),'LR',0,'R'); + if ($row[6] == 0.0) { + $this->Cell($w[4],$ch,'','LR',0,'R'); + } else + $this->Cell($w[4],$ch,number_format($row[6],2),'LR',0,'R'); + $tot_fra = $tot_fra + $row[6]; + $this->Ln(); + if ($i++ > 30) + { + $i = 0; + $this->AddPage(); + $this->Ln(); + } + } + $this->SetFont('Arial','',10); + // Closing line + $this->Cell(array_sum($w),0,'','T'); + $this->Ln(); + // Write totals + $this->Cell($wt[0],$ch,"Total",'LR',0,'L'); + $this->Cell($wt[1],$ch,number_format($total,2),'LR',0,'R'); + $this->Cell($wt[2],$ch,"-",'LR',0,'R'); + $this->Cell($wt[3],$ch,number_format($tot_fra,2),'LR',0,'R'); + $this->Ln(); + $this->Cell(array_sum($w),0,'','T'); + $this->Ln(); + + } + } + + /** + * This function returns the information related to the exercice + * Return the state (how the charges are going to be dispatched + * IF the exercice is closed + * If the exercice has been approved. + */ + private function Exercice ($dt) + { + $q = "select per_repart_charge_end,per_closed,per_approved from Period WHERE per_string = ".$dt.";"; + $res = $this->doQueryImpr($q); + return $res['records'][0]; + } + + /** + * What the problem + */ + function Footer() { + $this->SetY(-15); + $this->SetFont('Arial','I',8); + $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}','C'); + $this->SetY(-15); + $this->SetX(90); + $this->Cell(0,10,'https://syndic.ebersold.fr/','C'); + + } + +} + +/** + * + */ +GLOBAL $conf; +$conf_auth = $conf['auth']['mysql']; +$_session = new SessionCompta($conf_auth,$conf_auth['req_file']); + +$_database = ""; +$period = ""; +$_database = $_session->getDb(); + +if (isset($_GET['period'])) { $period = $_GET['period'];} else { $period = Date('Y');}; +if ($_database == "") { + error_log("annexe.php no database in session too bad"); + die(); +} + +if (isset($_SESSION['compta_db'])) { + $ldb = $_SESSION["compta_db"] ; +} else + $ldb = 'test'; +$p = new DecompteCharge($_session, + $conf_auth, + $_database); + +if ($_session->is_logged_in() ) { + $p->AliasNbPages(); + if (isset($_GET['compte']) && isset($_GET['period'])) { + $p->Decompte($_GET['period'],$_GET['compte']); + } else { + $p->Decompte($_session->getCurrentExercice(),"450001"); + } + + +} else { + // redirect to login + header("Location: /app/member/login.php"); + die(); +} + + + +?> + diff --git a/app/compta/reports/recu_taxe.php b/app/compta/reports/recu_taxe.php new file mode 100644 index 0000000..ff8827a --- /dev/null +++ b/app/compta/reports/recu_taxe.php @@ -0,0 +1,195 @@ +SetFillColor(255); + $this->SetFont('Arial','',10); + $this->Cell(50,5,"CERFA N 11580*02 "); + $this->Text(140,14," Numéro d'ordre du reçu : "); + $this->Ln(); + $this->Cell(50,5,"Assiciation TICOS"); + $this->Ln(); + $this->Cell(50,5,"16 rue St Louis ..."); + $this->Ln(); + $this->Cell(50,5,"60100 STRASBOURG"); + $this->Ln(); + $this->Ln(); + $this->Ln(); + + $this->SetFont('Arial','',14); + $this->SetFillColor(220); + $this->RoundedRect(80,20,95,20,5,"1234","DF"); + $this->Text(85,27,"Reçu au titre de dons au oeuvres"); + $this->SetFont('Arial','',10); + $this->Text(85,32,"(Article 200 et 238 bis du Code Général des impôts)"); + + } + + // Better table + function ImprovedTable($header, $data) + { + $i = 0; + // Column widths + $w = array(20, 35, 70, 30,30); + // Header + for($i=0;$iCell($w[$i],7,$header[$i],1,0,'C'); + $this->Ln(); + // Data + foreach($data as $row) + { + $this->Cell($w[0],6,$row[0],'LR'); + $this->Cell($w[1],6,$row[1],'LR'); + $this->Cell($w[2],6,$row[2],'LR',0,'R'); + if ($row[3] == 0.0 ) { + $this->Cell($w[3],6,'','LR',0,'R'); + } else + $this->Cell($w[3],6,number_format($row[3],2),'LR',0,'R'); + if ($row[4] == 0.0) { + $this->Cell($w[4],6,'','LR',0,'R'); + } else + $this->Cell($w[4],6,number_format($row[4],2),'LR',0,'R'); + $this->Ln(); + if ($i++ > 30) + { + $i = 0; + $this->AddPage(); + $this->Ln(); + } + } + // Closing line + $this->Cell(array_sum($w),0,'','T'); + } + // + + function Solde($period,$compte) { + $w = array(125, 30,30); + $header = array('Solde','Debit','Credit'); + $q = 'CALL solde_compte("'.$period.'","'.$compte.'");'; + $this->Ln(); + + $res = $this->doQueryImpr($q); + $this->Cell(array_sum($w),0,'','T'); + $this->Ln(); + $this->Ln(); + $c = new chiffreEnLettre(); + + $v = $res['records'][0][2]; + $this->Cell(10,5,"Le bénéficiaire reconnait avoir reçu au titre des dons et versements ouvrant droit à réduction d'impôt,"); + $this->Ln(); + $this->Cell(10,5,"la somme de :".$res['records'][0][2]." euros"); + $this->Ln(); + $this->Cell(50,5,"Somme en toutes lettres: ".$c->ConvNumberLetter($v,1,0)); + $this->Ln(); + $this->Cell(10,6,"Date du versement :"); + $this->Ln(); + $this->Cell(10,6,"Mode du versement :"); + + } + function Beneficiaire($compte) { + $x = 10; + $this->SetFont('Arial','',12); + $this->Cell(10,6,"Bénéficiaire des dons"); + $this->SetFont('Arial','',10); + $this->Ln(); + $this->Ln(); + $y = $this->getY(); + $q = 'select ident_name,ident_firstname,ident_address,ident_postalcode,ident_city from Identity as i '; + $qj= 'JOIN JoinIdentityAccount as j on j.jia_ident = i.ident_id and j.jia_acc ='.$compte.';'; + $res = $this->doQueryImpr($q.$qj); + $ident = $res['records'][0]; + $this->Text($x,$y ,"Nom : "); + $this->Text($x+25,$y,"".$ident[0]." ".$ident[1] ); + $this->Text($x,$y+6 ,"Adresse : "); + $this->Text($x+25,$y+6,"".$ident[2]); + $this->Text($x,$y +12,"Code Postal : "); + $this->Text($x+25,$y +12,"".$ident[3]." ".$ident[4]); + $this->setY($y+18); + } + + + function Donateur($compte) { + $x = 10; + $this->SetFont('Arial','',12); + $this->Cell(10,6,"Donateur"); + $this->SetFont('Arial','',10); + $this->Ln(); + $this->Ln(); + $y = $this->getY(); + $q = 'select ident_name,ident_firstname,ident_address,ident_postalcode,ident_city from Identity as i '; + $qj= 'JOIN JoinIdentityAccount as j on j.jia_ident = i.ident_id and j.jia_acc ='.$compte.';'; + $res = $this->doQueryImpr($q.$qj); + $ident = $res['records'][0]; + $this->Text($x,$y ,"Nom : "); + $this->Text($x+25,$y,"".$ident[0]." ".$ident[1] ); + $this->Text($x,$y+6 ,"Adresse : "); + $this->Text($x+25,$y+6,"".$ident[2]); + $this->Text($x,$y +12,"Code Postal : "); + $this->Text($x+25,$y +12,"".$ident[3]." ".$ident[4]); + $this->setY($y+18); + } + + + function Copro($compte) { + $x = 120; + $y = 60; + $q = 'select ident_name,ident_firstname,ident_address,ident_postalcode,ident_city from Identity as i '; + $qj= 'JOIN JoinIdentityAccount as j on j.jia_ident = i.ident_id and j.jia_acc ='.$compte.';'; + $res = $this->doQueryImpr($q.$qj); + $ident = $res['records'][0]; + $this->Text($x,$y,"".$ident[0]." ".$ident[1] ); + $this->Text($x,$y+6,"".$ident[2]); + $this->Text($x,$y +12,"".$ident[3]." ".$ident[4]); + $this->setY($y+18); + } + + function Decompte($period,$compte) { + $header = array('Date','Reference','Designation','Debit','Credit'); + $q = 'CALL detail_compte_sans_solde("'.$period.'","'.$compte.'");'; + //$q = 'select * from TransactionEntry;'; + $res = $this->doQueryImpr($q); + + //echo "

    ".$q."

    "; + //print_r($res); + $this->SetFont('Arial','',10); + $this->AddPage(); + //$this->Cell(40,10,$q." Size of records:".sizeof($res['total_matches'])); + $this->Ln(); + $this->Ln(); + $this->Copro($compte); + $this->Ln(); + $this->Beneficiaire($compte); + $this->Donateur($compte); + //$this->ImprovedTable( $header,$res['records']); + //$this->AddPage(); + $this->Solde($period,$compte); + $this->Output(); + } +} + +//$p = new DecompteCharge('localhost','root','admin','test'); +$p = new DecompteCharge($conf['auth']['mysql']['host'],$conf['auth']['mysql']['user'],$conf['auth']['mysql']['password'],'test'); + +if (isset($_GET['compte']) && isset($_GET['period'])) { + $p->Decompte($_GET['period'],$_GET['compte']); +} else { + $p->Decompte("2013","450001"); +} + +?> + diff --git a/app/compta/reports/syndic_annexe1.php b/app/compta/reports/syndic_annexe1.php new file mode 100644 index 0000000..15ffedb --- /dev/null +++ b/app/compta/reports/syndic_annexe1.php @@ -0,0 +1,514 @@ +pdf = new TCPDF('L',PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + $this->pdf = $pdf; + $this->period = $period; + //$this->data = new AnnexeData(null,$auth_cfg,$db); + $this->data = $db; + } + + function __destruct() { + } + + function getAccountList($category) + { + return $this->data->getAccountList($category); + } + + function getAccountListWhere($where) + { + return $this->data->getAccountListWhere($where); + } + + private function fillTresorerie($period,&$res,&$total) + { + $res = array(); + $cpts = array('50','51','53'); + $cpts_title= array('50' => "50 Fonds placés",'51' => "51 Banques ou fonds disponibles en banque" ,'53' => "53 Caisse"); + // Retrieve banque accounts + $result = $this->data->getSoldCompte($cpts,$period,$total); + foreach ($cpts as $k ) + { + $res[$k] = Array('title' => $cpts_title[$k], 'value' => $result[$k] * -1.0); + } + $str = ($result['50'])."

    ".number_format(($result['51']*-1),2)."


    ".$result['53']; + return $str; + // Retrieve Caisse + // + } + + function fillProvision($period ,&$res,&$total) { + $cpts = array('102','103','1031','1032','1033','105','131','12'); + $cpts_title = array('102' => "102 Provisions pour travaux" + ,"103" => "103 Avances" + ,"1031" => "1031 Avances de trésorerie" + ,"1032" => "1032 Avances travaux" + ,"1033" => "1033 Autres avances" + ,"105" => "105 Fonds de travaux" + ,"131" => "131 Subventions et instance d'affectation" + ,"12" => "12 Solde en attente sur travaux ou opérations exceptionnelles"); + $total = 0.0; + $result = $this->data->getSoldCompte($cpts,$period,$total); + $total = ($total * -1) - $result[103]; + foreach ($cpts as $k ) + { + $res[$k] = Array('title' => $cpts_title[$k], 'value' => $result[$k]); + } + $str = $result['102']."
    ".$result['103']."
    ".$result['1031']."
    ".$result['1032']."
    ".$result['1033']."
    "; + $str= $str.$result['131']."
    ".$result[12]; + return $str; + } + /** + * + * + */ + function fillCopro(&$copro,$period,$key) + { + $this->data->fillCopro($copro,$period,$key); + } + + /** + * + * + */ + function fillTier(&$cpts,$period,$key) + { + $this->data->fillTier($cpts,$period,$key); + } + + /** + * + * + */ + private function fillAccounts(&$cpts,$period,$key) + { + return $this->data->FillAccounts($cpts,$period,$key); + } + + /** + * + * + */ + private function row6Title($p1,$p2,$p3,$p4,$p5,$p6) + { + $str=<<<_EOF + + {$p1} + {$p2} + {$p3} + {$p4} + {$p5} + {$p6} + +_EOF; + return $str; + } + + /** + * + * + */ + private function row6Total($p1,$p2,$p3,$p4,$p5,$p6) + { + $str=<<<_EOF + + {$p1} + %.2f   + %.2f + {$p4} + %.2f + %.2f + +_EOF; + return sprintf($str,$p2,$p3,$p5,$p6); + } + + /** + * + * + */ + private function row6($p1,$p2,$p3,$p4,$p5,$p6) + { + $str=<<<_EOF +{$p1}{$p2}{$p3} {$p4}{$p5}{$p6} + +_EOF; + return $str; + } + /** + * + * + */ + private function provision() + { + $tot_tres = 0.0; + $tot_tres_clos = 0.0; + $res_n = null; + $res_nm1 = null; + $prov_total = 0.0; + $prov_total_clos = 0.0; + $prov = $this->fillProvision($this->period,$res_nm1,$prov_total); + $prov_clos = $this->fillProvision($this->period-1,$res_n,$prov_total_clos); + $html =<<<_EOF + +_EOF; + $tplt =<<<_EOF + + + + +_EOF; + foreach ($res_n as $i => $col) + { + $html.= sprintf($tplt,$col['title'],$col['value'],$res_nm1[$i]['value']); + } + $html.="
    %s%.2f  %.2f  
    "; + return $html; + } + + /** + * + * + */ + private function tresorerie() + { + $tot_tres = 0.0; + $tot_tres_clos = 0.0; + $res_n = null; + $res_nm1 = null; + $tres = $this->fillTresorerie($this->period-1,$res_nm1,$tot_tres); + $tres_clos = $this->fillTresorerie($this->period ,$res_n,$tot_tres_clos ); + $html =<<<_EOF + +_EOF; + $tplt =<<<_EOF + + + + +_EOF; + foreach ($res_nm1 as $i => $col) + { + $html.= sprintf($tplt,$col['title'],$col['value'],$res_n[$i]['value']); + } + $html.="
    %s%.2f  %.2f  
    "; + return $html; + } + /** + * + * + */ + function tableau() { + $tiers = array("40" => array('acc_id' => 40), + '42' => array('acc_id' => 42), + '43' => array('acc_id' => 43), + '44' => array('acc_id' => 44), + '46' => array('acc_id' => 46), + '47' => array('acc_id' => 47), + '48' => array('acc_id' => 48), + '49' => array('acc_id' => 49) + ); + $tplt_title = << +   + Exercice précédent approuvé + Exercice Clos +   + Exercice précédent approuvé + Exercice Clos + +EOF; + $pdf = $this->pdf; + $total_tresorerie = 0.0; + $total_tresorerie_clos = 0.0; + $rest = null; + $rest1 = null; + $tresorerie = $this->fillTresorerie($this->period-1,$rest1,$total_tresorerie); + $tresorerie_clos = $this->fillTresorerie($this->period,$rest,$total_tresorerie_clos ); + $prov_rest = null; + $prov_rest1 = null; + $prov_total = 0.0; + $prov_clos_total = 0.0; + $prov = $this->fillProvision($this->period-1,$prov_rest1,$prov_total); + $prov_clos = $this->fillProvision($this->period,$prov_rest,$prov_clos_total); + $copro = $this->getAccountList("45"); + $this->fillCopro($copro,$this->period-1,"solde"); + $this->fillCopro($copro,$this->period,"solde_clos"); + $this->fillTier($tiers,$this->period-1,"solde"); + $this->fillTier($tiers,$this->period,"solde_clos"); + $copro_str = ""; + $copro_creance = ""; + $copro_dette = ""; + $copro_creance_clos = ""; + $copro_dette_clos = ""; + $tiers_creance =""; + $tiers_creance_clos =""; + $tiers_dette =""; + $tiers_dette_clos =""; + $total_creance = 0.0; + $total_creance_clos = 0.0; + $total_dette =0.0; + $total_dette_clos =0.0; + foreach($copro as $item) { + $copro_str = $copro_str.$item['acc_id']." ".$item['acc_desc']."
    "; + if ($item['solde'] > 0 ) { + $copro_creance = $copro_creance."0.0"."
    "; + $copro_dette = $copro_dette.number_format($item['solde'],2)."
    "; + $total_dette += $item['solde']; + } else { + $copro_creance = $copro_creance.number_format($item['solde']*-1,2)."
    "; + $total_creance += $item['solde']*-1; + $copro_dette = $copro_dette."0.0"."
    "; + } + if ($item['solde_clos'] > 0 ) { + $copro_creance_clos = $copro_creance_clos."0.0"."
    "; + $copro_dette_clos = $copro_dette_clos.number_format($item['solde_clos'],2)."
    "; + $total_dette_clos += $item['solde_clos']; + } else { + $copro_creance_clos = $copro_creance_clos.number_format($item['solde_clos']*-1,2)."
    "; + $total_creance_clos += $item['solde_clos']*-1; + $copro_dette_clos = $copro_dette_clos."0.0"."
    "; + } + + } + // Fill Comtpes de tiers + foreach ($tiers as $k => $compte) { + if ($compte['solde'] > 0.0 ) { + $tiers[$k]['solde_str'] = $compte["solde"]; + $total_dette += $compte['solde']; + } else { + $tiers[$k]['solde_str'] = "0.0"; + $total_creance += $compte['solde']*-1; + } + } + foreach ($tiers as $k => $compte) { + if ($compte['solde_clos'] > 0.0 ) { + $tiers[$k]['dette_clos_str'] = $compte["solde_clos"]; + $tiers[$k]['creance_clos_str'] = "0.0"; + $tiers[$k]['creance_clos_str'] = $compte["solde_clos"]; + $total_dette_clos += $compte['solde_clos']; + } else { + $tiers[$k]['dette_clos_str'] = "0.0"; + $tiers[$k]['creance_clos_str'] = $compte["solde_clos"]; + $total_creance_clos += $compte['solde_clos']*-1; + } + } + $total_g_creance = $total_creance + $total_tresorerie; + $total_g_creance_clos = $total_creance_clos + $total_tresorerie_clos; + $tg2p4 = $prov_total + $total_dette; + $tg2p4_str = number_format($tg2p4,2); + $tg2p4_clos = $prov_clos_total + $total_dette_clos; + $tg2p4_clos_str = number_format($tg2p4_clos,2); + $tbl = << + I- SITUATION FINANCIERE ET TRESORERIE +EOF; + $tbl.= $tplt_title; + $tbl.= $this->row6title("Trésorerie"," "," "," Provisions et avances"," "," "); + $tbl.=''.$this->tresorerie(); + $tbl.="".$this->provision().""; + $tbl.= $this->row6Total("Trésorerie disponible Total I",$total_tresorerie,$total_tresorerie_clos,"Total I",$prov_total,$prov_clos_total); + + $tbl .= <<II - CREANCESDETTES +EOF; + $tbl .= $tplt_title; + $tbl .= << + + 45 Coproriétaires - sommes exigibles restant à recevoir
    + {$copro_str} +  
    + Comptes de Tiers
    + 42 Autres créances
    + 43 Autres créances
    + 44 Autres créances
    + 46 Débiteurs divers
    + 47 Comptes d'attente
    + 48 Comptes de régularisation
    +
    + + +  
    + {$copro_creance} +

    + {$tiers[42]["solde_str"]}
    + {$tiers[43]["solde_str"]}
    + {$tiers[44]["solde_str"]}
    + {$tiers[46]["solde_str"]}
    + {$tiers[47]["solde_str"]}
    + {$tiers[48]["solde_str"]}
    +
    + + +  
    + {$copro_creance_clos} +

    + {$tiers[42]["creance_clos_str"]}
    + {$tiers[43]["creance_clos_str"]}
    + {$tiers[44]["creance_clos_str"]}
    + {$tiers[46]["creance_clos_str"]}
    + {$tiers[47]["creance_clos_str"]}
    + {$tiers[48]["creance_clos_str"]}
    +
    + + + + + 45 Copropriétaires - excédents versés
    + {$copro_str} +
    + Comptes de Tiers
    + 40 fournisseurs
    + 42 Autres dettes
    + 43 Autres dettes
    + 44 Autres dettes
    + 46 Créditeurs divers
    + 47 Compte d'attentes
    + 48 Comptes de régularisation
    + 49 Dépréciation des comptes de tiers
    +
    + + +
    + {$copro_dette} +

    + {$tiers[40]["solde_str"]}
    + {$tiers[42]["solde_str"]}
    + {$tiers[43]["solde_str"]}
    + {$tiers[44]["solde_str"]}
    + {$tiers[46]["solde_str"]}
    + {$tiers[47]["solde_str"]}
    + {$tiers[48]["solde_str"]}
    + {$tiers[49]["solde_str"]}
    + +
    + +
    + {$copro_dette_clos} +

    + {$tiers[40]["dette_clos_str"]}
    + {$tiers[42]["dette_clos_str"]}
    + {$tiers[43]["dette_clos_str"]}
    + {$tiers[44]["dette_clos_str"]}
    + {$tiers[46]["dette_clos_str"]}
    + {$tiers[47]["dette_clos_str"]}
    + {$tiers[48]["dette_clos_str"]}
    + {$tiers[49]["dette_clos_str"]}
    +
    + + + + Total II + {$total_creance} + {$total_creance_clos} + Total II + {$total_dette} + {$total_dette_clos} + + Total général (I) + (II) + {$total_g_creance} + {$total_g_creance_clos} + Total général (I) + (II) + {$tg2p4_str} + {$tg2p4_clos_str} +   + + Emprunts: montant restant du + + + +EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $tbl, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + } + + /** + * + */ + function generate() { + $pdf = $this->pdf; + //$pdf->SetCreator(PDF_CREATOR); + //$pdf->SetAuthor('EBERSOLD André'); + //$pdf->SetTitle('ANNEXE N° 1'); + //$pdf->SetSubject('Etat Financier après répartition au'); + //$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + + // set default header data + //$h = "SYNDIC 25 RUE PFEFFINGER \n67100 STRASBOURG (a1)"; + //$pdf->SetHeaderData(/*PDF_HEADER_LOGO*/"", 0, 'SYNDICAT DES COPRORPIETAIRES ANNEXES', $h, array(0,64,255), array(0,64,128)); + //$pdf->setFooterData($tc=array(0,64,0), $lc=array(0,64,128)); + +// set header and footer fonts + //$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); + //$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font + //$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +//set margins + //$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + //$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); + //$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +//set auto page breaks + //$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +//set image scale factor + //$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +//set some language-dependent strings + //$pdf->setLanguageArray($l); + +// --------------------------------------------------------- + +// set default font subsetting mode + $pdf->setFontSubsetting(true); + +// Set font +// dejavusans is a UTF-8 Unicode font, if you only need to +// print standard ASCII chars, you can use core fonts like +// helvetica or times to reduce file size. + $pdf->SetFont('dejavusans', '', 8, '', true); + +// Add a page +// This method has several options, check the source code documentation for more information. + $pdf->AddPage('L','A4'); + $period = $this->data->getPeriod($this->period); +$html = <<Annexe N°1 +

    Etat financier après répartition au {$period['end']}

    +
    +EOD; + $pdf->setHeaderTemplateAutoreset(true); +// Print text using writeHTMLCell() + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + $pdf->SetFont('dejavusans', '', 8, '', true); + $this->tableau() ; + // $pdf->SetHeaderData(/*PDF_HEADER_LOGO*/"", 0, 'SYNDICAT DES COPRORPIETAIRES ANNEXE 2', $h, array(0,64,255), array(0,64,128)); + } + + function Output($fn,$m) { + $this->pdf->Output($fn,$m); + } +} + +/** + vim:et:sw=2:ts=2:fileencoding=utf-8 +*/ +?> diff --git a/app/compta/reports/syndic_annexe2.php b/app/compta/reports/syndic_annexe2.php new file mode 100644 index 0000000..fa970bd --- /dev/null +++ b/app/compta/reports/syndic_annexe2.php @@ -0,0 +1,536 @@ +pdf = new TCPDF('L',PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + $this->pdf = $pdf; + $this->period = $period; + $this->data = $db; + } + + /** + * + * + */ + function __destruct() { + } + + /** + * + * + */ + function getAccountList($category) + { + return $this->data->getAccountList($category); + } + + /** + * + * + */ + private function getAccountListWhere($where) + { + return $this->data->getAccountListWhere($where); + } + + /** + * + * + */ + private function fillAccounts(&$cpts,$period,$key) + { + return $this->data->FillAccounts($cpts,$period,$key); + } + /** + * + * + */ + private function getBudgetListWhere($anne,$where) + { + return $this->data->getBudgetListWhere($anne,$where); + } + /** + * + * + */ + function fillBudget(&$cpts,$period,$key) + { + return $this->data->fillBudget($cpts,$period,$key); + } + + function fillAccountsType(&$cpts,$period,$key,$ot) { + return $this->data->fillAccountsType($cpts,$period,$key,$ot); + } + + /** + * + * + */ + function annexe2() { + $width = 160; + $pdf = $this->pdf; + $charge_str =""; + $charge_exercice_str = ""; + $charge_exercice_clos_str = ""; + + $chgr_str =""; + $prod_str =""; + $prod_exercice_str = ""; + $prod_exercice_clos_str = ""; + $st = array('charge' => 0.0 , 'charge_clos' => 0.0, + 'chrg_exp' => 0.0 , 'chrg_exp_clos' => 0.0 ,'chrg_exp_budget' => 0.0, + 'poc' => 0.0 , 'poc_clos' => 0.0 , 'poc_budget' => 0.0 ,'poc_budget_n1' => 0.0 , 'poc_budget_n2' => 0.0 + ); + $charge = $this->getAccountListWhere("a.acc_id like '60%' or a.acc_id like '61%' or a.acc_id like '62%' or a.acc_id like '63%'" ); + $this->fillAccounts($charge,$this->period-1,"solde"); + $this->fillAccounts($charge,$this->period,"solde_clos"); + // Handler charges + foreach( $charge as $k => $cpt) { + $charge_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,31)."
    "; + $charge_exercice_str .= number_format($cpt["solde_debit"],2)."
    "; + $st['charge'] += $cpt["solde_debit"]; + $charge_exercice_clos_str .= number_format($cpt["solde_clos_debit"],2)."
    "; + $st['charge_clos'] += $cpt["solde_clos_debit"]; + } + // Handle Charge exceptionnel + $chrg_exp = $this->getAccountListWhere("a.acc_id REGEXP '(661.*|671.*|672.*)'"); + $this->fillAccounts($chrg_exp,$this->period-1,"solde"); + $this->fillAccounts($chrg_exp,$this->period,"solde_clos"); + $this->fillBudget($chrg_exp,$this->period,"budget"); + $this->fillBudget($chrg_exp,$this->period+1,"budget_n1"); + $this->fillBudget($chrg_exp,$this->period+2,"budget_n2"); + + $chrg_exp_str =""; + $chrg_exp_exercice_str =""; + $chrg_exp_exercice_clos_str =""; + $chrg_exp_exercice_budget =""; + foreach( $chrg_exp as $k => $cpt) { + $chrg_exp_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,30)."
    "; + $chrg_exp_exercice_str .= number_format($cpt["solde_debit"],2)."
    "; + $chrg_exp_exercice_budget .= number_format($cpt["budget"],2)."
    "; + $st['chrg_exp_budget'] += $cpt["budget"]; + $st['chrg_exp'] += $cpt["solde_debit"]; + $chrg_exp_exercice_clos_str .= number_format($cpt["solde_clos_debit"],2)."
    "; + $st['chrg_exp_clos'] += $cpt["solde_clos_debit"]; + } + + // Handle produit + //$prod = $this->getAccountListWhere("a.acc_id REGEXP '(^701.*|^71.*)'"); + //$this->fillAccounts($prod,$this->period-1,"solde"); + //$this->fillAccounts($prod,$this->period,"solde_clos"); + //foreach( $prod as $k => $cpt) { + // $prod_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,32)."
    "; + // $prod_exercice_str .= number_format($cpt["solde_debit"],2)."
    "; + // $prod_exercice_clos_str .= number_format($cpt["solde_clos_debit"],2)."
    "; + //} + // New Handle produit + $prod = $this->getAccountListWhere("a.acc_id REGEXP '(^701.*|^71.*)'"); + $prod_str =""; + $prod_exercice_str =""; + $prod_exercice_budget =""; + $prod_exercice_budget_n1 =""; + $prod_exercice_budget_n2 =""; + $prod_exercice_clos_str =""; + + $this->fillAccountsType($prod,$this->period-1,"solde","AF"); + $this->fillAccountsType($prod,$this->period,"solde_clos","AF"); + $this->fillBudget($prod,$this->period,"budget"); + $this->fillBudget($prod,$this->period+1,"budget_n1"); + $this->fillBudget($prod,$this->period+2,"budget_n2"); + foreach( $prod as $k => $cpt) { + $prod_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,32)."
    "; + $prod_exercice_str .= number_format($cpt["solde_credit"],2)."
    "; + $st['poc'] += $cpt["solde_credit"]; + $prod_exercice_budget .= number_format($cpt["budget"],2)."
    "; + $st['poc_budget'] += $cpt["budget"]; + $prod_exercice_budget_n1 .= number_format($cpt["budget_n1"],2)."
    "; + $st['poc_budget_n1'] += $cpt["budget_n1"]; + $prod_exercice_budget_n2 .= number_format($cpt["budget_n2"],2)."
    "; + $st['poc_budget_n2'] += $cpt["budget_n2"]; + $prod_exercice_clos_str .= number_format($cpt["solde_clos_credit"],2)."
    "; + $st['poc_clos'] += $cpt["solde_clos_credit"]; + } + + + // New Handle produit exceptionnel + $prod_exp = $this->getAccountListWhere("a.acc_id REGEXP '(^70[2345].*|^71[123468].*|^78.*)'"); + $prod_exp_str = ""; + $prod_exp_exercice_str = ""; + $prod_exp_exercice_clos_str = ""; + $prod_exp_exercice_budget = ""; + $this->fillAccounts($prod_exp,$this->period-1,"solde"); + $this->fillAccounts($prod_exp,$this->period,"solde_clos"); + $this->fillBudget($prod_exp,$this->period,"budget"); + foreach( $prod_exp as $k => $cpt) { + $prod_exp_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,32)."
    "; + $prod_exp_exercice_str .= number_format($cpt["solde_debit"],2)."
    "; + $prod_exp_exercice_budget .= number_format($cpt["budget"],2)."
    "; + $prod_exp_exercice_clos_str .= number_format($cpt["solde_clos_debit"],2)."
    "; + } + // Handler Budget Charge N + $budget_n_str = ""; + $budget_n_amount = ""; + $budget_n_total = 0.0; + $budget_n = $this->getBudgetListWhere($this->period,"a.acc_id REGEXP '(^60[0123456].*|^61.*|^62.*)'"); + foreach ($budget_n as $k => $v) { + $budget_n_str .= $v[0]."
    "; + $budget_n_amount .= number_format($v[2],2)."
    "; + $budget_n_total += $v[2]; + } + $budget_n_total = number_format($budget_n_total,2); + // Handler Budget Charge N 1 + $budget_n1_str = ""; + $budget_n1_amount = ""; + $budget_n1_total = 0.0; + $budget_n1 = $this->getBudgetListWhere($this->period+1,"a.acc_id REGEXP '(^60[0123456].*|^61.*|^62.*)'"); + foreach ($budget_n1 as $k => $v) { + $budget_n1_str .= $v[0]."
    "; + $budget_n1_amount .= number_format($v[2],2)."
    "; + $budget_n1_total += $v[2]; + } + $budget_n1_total = number_format($budget_n1_total,2); + // Handler Budget Charge N 1 + $budget_n2_str = ""; + $budget_n2_amount = ""; + $budget_n2_total = 0.0; + $budget_n2 = $this->getBudgetListWhere($this->period+2,"a.acc_id REGEXP '(^60[0123456].*|^61.*|^62.*)'"); + foreach ($budget_n2 as $k => $v) { + $budget_n2_str .= $v[0]."
    "; + $budget_n2_amount .= number_format($v[2],2)."
    "; + $budget_n2_total += $v[2]; + } + $budget_n2_total = number_format($budget_n2_total,2); + + $period = $this->data->getPeriod($this->period); + $period2 = $this->data->getPeriod($this->period+2); +$html =<<Annexe N°2 +

    Comptes de gestion général de l'exercice clos réalisé (N) du {$period['begin']} au {$period['end']}

    +

    et budget prévisionnel de l'exercice (N+2) du {$period2['begin']} au {$period2['end']}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CHARGES POUR OPERATIONS COURANTESPRODUITS POUR OPERATIONS COURANTES
    Pour Approbation des comptesPour le vote du budget prévisonnelPour Approbation des comptesPour le vote du budget prévisonnel
    Exercice précédent
    approuvé
    N-1
    Exercice clos
    Budge voté
    N
    Exercice Clos réalisé
    à approuver
    N
    Budget prévisionnel
    en cours voté
    N+1
    Budget prévisionnel
    à voter
    N+2
    Exercice
    Precedent
    N-1
    Exercice
    clos budge
    N
    Exercice clos
    réaliser à 
    N
    Budget prévisionnel
    en cours N+1
    Budget prévisionnel
    à  voter
    N+2

    + 60 Achats de matières et fournitures
    + {$charge_str} +
    +

    +
    + {$charge_exercice_str} +

    +
    + {$budget_n_amount} +

    +
    + {$charge_exercice_clos_str} +
    +

    + {$budget_n1_amount} +
    +

    + {$budget_n2_amount} +

    + {$prod_str} +

    + {$prod_exercice_str} +

    + {$prod_exercice_budget} +

    + {$prod_exercice_clos_str} +

    + {$prod_exercice_budget_n1} +

    + {$prod_exercice_budget_n2} +
    Sous-total + + + {$st['charge']} + + {$budget_n_total} + + {$st['charge_clos']} + + {$budget_n1_total} + + {$budget_n2_total} + Sous-total {$st['poc']} {$st['poc_budget']} {$st['poc_clos']} {$st['poc_budget_n1']} {$st['poc_budget_n2']}
    Solde(excédent s opérations courantes affecté au + coprorpiétaires) + + + N/C + N/CN/CSolde(insuffisance s/opérations courantes affectée aux corpropriétaires)N/CN/CN/C
    Total I + + + {$st['charge']} + + {$budget_n_total} + + {$st['charge_clos']} + + {$budget_n1_total} + + {$budget_n2_total} + Total I
    + CHARGES POUR TRAVAUX ET AUTRES OPERATIONS EXCEPTIONNELLES + + + + PRODUITS POUR TRAVAUX ET AUTRES OPERATIONS EXCEPTIONNELLES +

    + {$chrg_exp_str} +
    +

    + {$chrg_exp_exercice_str} +

    + {$chrg_exp_exercice_budget} +

    + {$chrg_exp_exercice_clos_str} +

    + {$prod_exp_str}

    + {$prod_exp_exercice_str} +

    + {$prod_exp_exercice_budget} +

    + {$prod_exp_exercice_clos_str} +
    Solde(excédent) + + + + + Solde(insuffisant)
    Total II + + + {$st['chrg_exp']} + + {$st['chrg_exp_budget']} + + {$st['chrg_exp_clos']} + Total II
    + +EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + } + /** + * + */ + function generate() { + $pdf = $this->pdf; +// Set font +// dejavusans is a UTF-8 Unicode font, if you only need to +// print standard ASCII chars, you can use core fonts like +// helvetica or times to reduce file size. + +// Add a page +// This method has several options, check the source code documentation for more information. + $pdf->AddPage('L','A4'); + $html = <<setHeaderTemplateAutoreset(true); +// Print text using writeHTMLCell() + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + $pdf->SetFont('dejavusans', '', 8, '', true); + $this->annexe2() ; + } + /** + * + */ + function Output($fn,$m) { + $this->pdf->Output($fn,$m); + } +} + +/** + * For test purpose + */ +$ldb =""; +if (isset($_SESSION['compta_db'])) { + $ldb = $_SESSION["compta_db"] ; +} else + $ldb = 'SYNDIC25RUEPFEFFINGER'; + +//GLOBAL $conf; +//$conf_auth = $conf['auth']['mysql']; + +//$t = new annexe2($conf_auth, $ldb); + +//$t->test(); +//$t->Output('annexe2.pdf', 'I'); + +/** + vim:et:sw=2:ts=2:fileencoding=utf-8 +*/ +?> diff --git a/app/compta/reports/syndic_annexe3.php b/app/compta/reports/syndic_annexe3.php new file mode 100644 index 0000000..964b19b --- /dev/null +++ b/app/compta/reports/syndic_annexe3.php @@ -0,0 +1,298 @@ +pdf = $pdf; + $this->data = $data; + $this->period = $period; + } + function __destruct() { + } + + function getPeriod($per) { + $q = "SELECT per_begin,per_end FROM Period where per_string ='".$per."';"; + $r = $this->data->doQueryI($q); + $this->per_begin = $r['records'][0][0]; + $this->per_end = $r['records'][0][1]; + } + + + public function generate() + { + $this->pdf->addPage('P','A4'); + $period = $this->data->getPeriod($this->period); + $period2 = $this->data->getPeriod($this->period+2); + $html =<<Annexe N°3 +

    Comptes de gestion pour opérations courantes de l'exercice clos réalise (N {$this->period}) du {$period['begin']} au {$period['end']}

    +

    et budget previsionnel de l'exercice (N+2) du {$period2['begin']} au {$period2['end']}

    +
    +EOF; + $this->pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + $this->generateNew(); + //$this->pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $tbl, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + } + /** + * + * + */ + private function table() + { + $table_begin=<<<__EOF + +__EOF; + $table_end=<<<__EOF +
    +__EOF; + $table_begin.= $this->table_header(); + $table_begin.= $this->table_row("TRAVAUX de L'ARTICLE 14-2"," "," "," "," "); + $table_begin.= $this->table_row("TOTAL TRAVAUX de L'ARTICLE 14-2"," "," "," "," "); + $table_begin.= $this->table_row("TOTAL OPERATIONS EXCEPTIONNELLES"," "," "," "," "); + $table_begin.= $table_end; + return $table_begin; + } + /** + * + * + */ + private function table_row($p1,$p2,$p3,$p4,$p5) + { + $_row=<<<__EOF + +{$p1} +{$p2} +{$p3} +{$p4} +{$p5} + +__EOF; + return $_row; + } + /** + * + * + */ + private function table_header() + { + $_row=<<<__EOF + +Exercice clos dépenses votées(N) +Exercice clos réalisé à approuver (N) + + +DEPENSES +PROVISIONS APPELEES +SOLDE + +__EOF; + return $_row; + } + + /** + * + */ + function generateNew() { + $digits = 2; + $q = "select pc_id,pc_name from PosteCharge;"; + $pc = $this->data->doQueryI($q); + $st = array('exercice' => 0, 'exercice_nm1' => 0,'budget' => 0 , 'budgetn1' => 0,'budgetn2' => 0); + $entries = ""; + $accounts = array(); + $pdf = $this->pdf; + $this->data->fillAccountsWhere($accounts,$this->period,"a.acc_id REGEXP '(^6.*)'","amount"); + $this->data->fillAccountsWhere($accounts,$this->period-1,"a.acc_id REGEXP '(^6.*)'","am1"); + //$bu = $this->getBudgetListWhere($this->period,"a.acc_id REGEXP '(^6.*)'"); + $this->data->fillBudgetListWhere($accounts,$this->period,"a.acc_id REGEXP '(^6.*)'","bu"); + $this->data->fillBudgetListWhere($accounts,$this->period+1,"a.acc_id REGEXP '(^6.*)'","bu1"); + $this->data->fillBudgetListWhere($accounts,$this->period+2,"a.acc_id REGEXP '(^6.*)'","bu2"); + $bu1 = $this->data->getBudgetListWhere($this->period+1,"a.acc_id REGEXP '(^6.*)'"); + $bu2 = $this->data->getBudgetListWhere($this->period+2,"a.acc_id REGEXP '(^6.*)'"); + + $pm1 = $this->period - 1; + foreach ($pc['records'] as $ch) + { + $entries.=''.$ch[1].''; + // Handler Budget + // First Col 1 + foreach($accounts as $k => $c) + { + if ( ($c[$this->period]['pc'] == $ch[0] ) + ||( $c[$pm1]['pc'] == $ch[0] ) + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + $entries.=""; + $entries.=''; + $entries.="".$k.' - '.$c['name'].""; + } else { + continue; + } + // First Col 2 + $entries.=''; + if ( ($c[$this->period]['pc'] == $ch[0] ) + || ($c[$pm1]['pc'] == $ch[0] ) + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$pm1]['pc'] == $ch[0]) { + $entries.="".number_format($c['am1'],$digits).""; + $st['exercice_nm1'] += $c['am1']; + } else + $entries.="-"; + } + $entries.=""; + // First Col 3 + $entries.=''; + $e = $this->period.$ch[0]."bu"; + if ($c[$this->period]['pc'] == $ch[0] + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$this->period]['bu_pc'] == $ch[0] ) { + $entries.=number_format($c[$e],$digits)."".""; + $st['budget'] += $c[$e]; + } else + $entries.="-"; + } + $entries.=""; + // First Col 4 + $entries.=''; + if ($c[$this->period]['pc'] == $ch[0] + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$this->period]['pc'] == $ch[0]) { + $entries.=number_format($c['amount'],$digits).""; + $st['exercice'] += $c['amount']; + } else + $entries.="-"; + } + $entries.=""; + // First Col 5 + $entries.=''; + $e = ($this->period+1).$ch[0]."bu1"; + if ($c[$this->period]['pc'] == $ch[0] + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$this->period+1]['bu1_pc'] == $ch[0] ) { + $entries.=number_format($c[$e],$digits)."".""; + $st['budgetn1'] += $c[$e]; + } else + $entries.="-"; + } + $entries.=""; + // First Col 6 + $entries.=''; + $e = ($this->period+2).$ch[0]."bu2"; + if ($c[$this->period]['pc'] == $ch[0] + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$this->period+2]['bu2_pc'] == $ch[0] ) { + $entries.=number_format($c[$e],$digits)."".""; + $st['budgetn2'] += $c[$e]; + } else + $entries.="-"; + } + $entries.=""; + $entries.=""; + } + $entries.=''; + $entries.=''; + $entries.=''; + $entries.=''; + $entries.=''; + $entries.=''; + } + $html =<< +.charge { border: 1px solid #000; } +.num { border-top: 0px solid #FFF; border-bottom: 0px solid #FFF; border-left:1px solid #000; border-right:1px solid #000;} +.num-last { border-top: 0px solid #FFF; border-bottom: 1px solid #000; border-left:1px solid #000; border-right:1px solid #000;} +.ligne2 { border-bottom: 0px solid #FFF;} +.ligne3 { border-top: 0px solid #FFF; border-bottom: 0px solid #FFF;} +.ligne4 { border-top: 0px solid #FFF; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + {$entries} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CHARGES POUR OPERATIONS COURANTES
     Pour approbation des comptesPour le vote du budget prévisionnel
     Exercice précédent approuvéExercice clos budget voteExercice clos réalise à approuverBudget prévisionnel en coursBudget prévisionnel à voter
     N-1NNN+1 N+2
    TOTAL CHARGES NETTES{$st['exercice_nm1']}{$st['budget']}{$st['exercice']}{$st['budgetn1']}{$st['budgetn2']}
    Provision coproprietaires
    Solde (excedent ou insuffisance s/opérations courantes affecte aux copropriétaires
    + +EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + } + +} + + +?> diff --git a/app/compta/reports/syndic_annexe4.php b/app/compta/reports/syndic_annexe4.php new file mode 100644 index 0000000..b37c9a8 --- /dev/null +++ b/app/compta/reports/syndic_annexe4.php @@ -0,0 +1,97 @@ +pdf = $pdf; + $this->db = $data; + $this->period = $period; + } + function __destruct() { + } + + public function generate() + { + $this->pdf->addPage('L','A4'); + $html =<<Annexe N°4 +

    Comptes de gestion pour travaux de l'article 14-2 et opérations exceptionnelles + hors budget prévisionnel de l'exercice clos réalisés (N {$this->period}) du {$this->per_begin} au {$this->per_end}

    +
    +EOF; + $this->pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + $tbl = $this->table(); + $this->pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $tbl, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + } + /** + * + * + */ + private function table() + { + $table_begin=<<<__EOF + +__EOF; + $table_end=<<<__EOF +
    +__EOF; + $table_begin.= $this->table_header(); + $table_begin.= $this->table_row("TRAVAUX de L'ARTICLE 14-2"," "," "," "," "); + $table_begin.= $this->table_row("TOTAL TRAVAUX de L'ARTICLE 14-2"," "," "," "," "); + $table_begin.= $this->table_row("TOTAL OPERATIONS EXCEPTIONNELLES"," "," "," "," "); + $table_begin.= $table_end; + return $table_begin; + } + /** + * + * + */ + private function table_row($p1,$p2,$p3,$p4,$p5) + { + $_row=<<<__EOF + +{$p1} +{$p2} +{$p3} +{$p4} +{$p5} + +__EOF; + return $_row; + } + /** + * + * + */ + private function table_header() + { + $_row=<<<__EOF + +Exercice clos dépenses votées(N) +Exercice clos réalisé à approuver (N) + + +DEPENSES +PROVISIONS APPELEES +SOLDE + +__EOF; + return $_row; + } + + +} + + +?> diff --git a/app/compta/reports/syndic_annexe_data.php b/app/compta/reports/syndic_annexe_data.php new file mode 100644 index 0000000..7f10513 --- /dev/null +++ b/app/compta/reports/syndic_annexe_data.php @@ -0,0 +1,267 @@ +session = $_session; + $this->auth_conf = $auth_cfg; + parent::__construct($auth_cfg[SQL_SERVER],$auth_cfg[SQL_USER],$auth_cfg[SQL_PASSWD],$db); + $this->period = date("Y"); + } + + /** + * + */ + function __destruct() { + } + + function getRetrieve() { + return new Retrieve( + $this->session, + $this->auth_conf, + $this->session->getDb()); + + } + /** + * + */ + function getPeriod($per) + { + $q = "SELECT per_begin,per_end FROM Period where per_string ='".$per."';"; + $r = $this->doQueryI($q); + return array('begin' => $r['records'][0][0], 'end' => $r['records']['0']['1']); + } + + /** + * + */ + function getAccountList($category) + { + $q="select a.acc_id ,LEFT(a.acc_name,32) from Account as a "; + $w=" WHERE a.acc_id LIKE '".$category."%' and not a.acc_id='450000';"; + $res = $this->doQueryI($q.$w); + $ident = $res['records']; + $arr = array(); + foreach ($ident as $row) + { + array_push($arr,array('acc_id' => $row[0], 'acc_desc' => $row[1])); + } + return $arr; + } + + /** + * + */ + function getAccountListWhere($where) + { + $q="select a.acc_id ,SUBSTRING(a.acc_name,1,32) from Account as a "; + $w=" WHERE ".$where.";"; + $res = $this->doQueryI($q.$w); + $ident = $res['records']; + $arr = array(); + foreach ($ident as $row) + { + array_push($arr,array('acc_id' => $row[0], 'acc_desc' => $row[1])); + } + return $arr; + } + + /** + * + */ + function getBudgetListWhere($anne,$where) + { + $q=<<doQueryI($q); + + return $res['records']; + } + + function getSoldCompte($cpts,$period,&$total) + { + // Retrieve banque accounts + $result = array(); + foreach($cpts as $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte."%\"');"; + $res = $this->doQueryI($q); + $result[$compte] = $res['records'][0][2]; + $total += ($result[$compte]*-1); + } + return $result; + } + + /** + * + * + */ + function fillAccountsType(&$cpts,$period,$key,$ot) { + foreach($cpts as $k => $compte) { + $q = "call solde_compte_where('".$period."',' t.entry_type = \"".$ot."\" and t.acc_id like \"".$compte['acc_id']."%\"');"; + $res = $this->doQueryI($q); + $cpts[$k][$key] = $res['records'][0][2]; + $cpts[$k][$key."_debit"] = $res['records'][0][0]; + $cpts[$k][$key."_credit"] = $res['records'][0][1]; + } + } + + /** + * + * + */ + function fillCopro(&$copro,$period,$key) { + foreach($copro as $k => $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte['acc_id']."%\"');"; + $res = $this->doQueryI($q); + $copro[$k][$key] = $res['records'][0][2]; + } + } + + /** + * + * + */ + function fillTier(&$cpts,$period,$key) { + foreach($cpts as $k => $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$k."%\"');"; + $res = $this->doQueryI($q); + $cpts[$k][$key] = $res['records'][0][2]; + } + } + /** + * + * + */ + function fillAccounts(&$cpts,$period,$key) + { + foreach($cpts as $k => $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte['acc_id']."%\"');"; + $res = $this->doQueryI($q); + $cpts[$k][$key] = $res['records'][0][2]; + $cpts[$k][$key."_debit"] = $res['records'][0][0]; + $cpts[$k][$key."_credit"] = $res['records'][0][1]; + } + } + /** + * + * + */ + function fillAccountsWhere (&$cpts,$period,$where,$res_key) { + $q =<<doQueryI($q); + foreach ($res['records'] as $line) { + $cpts[$line[0]][$res_key] = $line[2]; + $cpts[$line[0]]['name'] = $line[1]; + $cpts[$line[0]][$period]['name'] = $line[1]; + $cpts[$line[0]][$period]['pc'] = $line[3]; + $cpts[$line[0]][$period.$line[3].$res_key] = $line[2]; + } + } + /** + * + * + */ + function fillBudget(&$cpts,$period,$key) + { + foreach($cpts as $k => $compte) { + $q=<<doQueryI($q); + $cpts[$k][$key] = $res['records'][0][0]; + } + } + + /** + * + * + */ + function fillBudgetListWhere(&$cpts,$period,$where,$key) { + $q=<<doQueryI($q); + + foreach ($res['records'] as $b) { + $acc = $b[0]; + $e = $period.$b[3].$key; + //error_log("annexe::fillBudgetListWhere SET: ".$b[0]." ".$period.$b[3].$key." =".$b[2]); + $cpts[$acc][$e] = $b[2]; + $cpts[$acc][$period][$key.'_pc'] = $b[3]; + } + } + + /** + * + */ + function getUserIdFromAccount($account) { + $q = "select jia_ident from JoinIdentityAccount WHERE jia_acc = ".$account.";"; + $res = $this->doQueryImpr($q); + return $res['records'][0][0]; + } + /** + * + */ + function getAccountsFromUid($uid) { + $q =<<<_EOF +SELECT jia_acc from JoinIdentityAccount +WHERE jia_ident = {$uid}; +_EOF; + $res = $this->doQueryImpr($q); + return $res['records'][0]; + } +} + +?> diff --git a/app/compta/reports/syndic_annexes.php b/app/compta/reports/syndic_annexes.php new file mode 100644 index 0000000..c9ce8eb --- /dev/null +++ b/app/compta/reports/syndic_annexes.php @@ -0,0 +1,1161 @@ +session = $_session; + $this->auth_conf = $auth_cfg; + parent::__construct($auth_cfg[SQL_SERVER],$auth_cfg[SQL_USER],$auth_cfg[SQL_PASSWD],$db); + $this->pdf = new TCPDF('P',PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + $this->period = date("Y"); + } + function __destruct() { + } + + function getPeriod($per) { + $q = "SELECT per_begin,per_end FROM Period where per_string ='".$per."';"; + $r = $this->doQueryI($q.$w); + $this->per_begin = $r['records'][0][0]; + $this->per_end = $r['records'][0][1]; + } + + function getAccountList($category) { + $q="select a.acc_id ,a.acc_name from Account as a "; + $w=" WHERE a.acc_id LIKE '".$category."%' and not a.acc_id='450000';"; + $res = $this->doQueryI($q.$w); + $ident = $res['records']; + $arr = array(); + foreach ($ident as $row) + { + array_push($arr,array('acc_id' => $row[0], 'acc_desc' => $row[1])); + } + return $arr; + } + function getAccountListWhere($where) { + $q="select a.acc_id ,a.acc_name from Account as a "; + $w=" WHERE ".$where.";"; + $res = $this->doQueryI($q.$w); + $ident = $res['records']; + $arr = array(); + foreach ($ident as $row) + { + array_push($arr,array('acc_id' => $row[0], 'acc_desc' => $row[1])); + } + return $arr; + } + function getBudgetListWhere($anne,$where) { + $q=<<doQueryI($q); + + return $res['records']; + } + + function fillTresorerie($period,&$total) + { + $cpts = array('50','51','53'); + // Retrieve banque accounts + $result = array(); + foreach($cpts as $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte."%\"');"; + $res = $this->doQueryI($q); + $result[$compte] = $res['records'][0][2]; + $total += ($result[$compte]*-1); + } + $str = ($result['50'])."

    ".number_format(($result['51']*-1),2)."


    ".$result['53']; + return $str; + // Retrieve Caisse + // + } + function fillProvision($period ,$total) { + $cpts = array('102','103','1031','1032','1033','131','12'); + $result = array(); + foreach($cpts as $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte."%\"');"; + $res = $this->doQueryI($q); + $result[$compte] = $res['records'][0][2]; + $total += $result[$compte]; + } + $str = $result['102']."
    ".$result['103']."
    ".$result['1031']."
    ".$result['1032']."
    ".$result['1033']."
    "; + $str= $str.$result['131']."
    ".$result[12]; + return $str; + + } + function fillCopro(&$copro,$period,$key) { + foreach($copro as $k => $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte['acc_id']."%\"');"; + $res = $this->doQueryI($q); + $copro[$k][$key] = $res['records'][0][2]; + } + } + function fillTier(&$cpts,$period,$key) { + foreach($cpts as $k => $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$k."%\"');"; + $res = $this->doQueryI($q); + $cpts[$k][$key] = $res['records'][0][2]; + } + } + function fillAccounts(&$cpts,$period,$key) { + foreach($cpts as $k => $compte) { + $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte['acc_id']."%\"');"; + $res = $this->doQueryI($q); + $cpts[$k][$key] = $res['records'][0][2]; + $cpts[$k][$key."_debit"] = $res['records'][0][0]; + $cpts[$k][$key."_credit"] = $res['records'][0][1]; + } + } + function fillAccountsType(&$cpts,$period,$key,$ot) { + foreach($cpts as $k => $compte) { + $q = "call solde_compte_where('".$period."',' t.entry_type = \"".$ot."\" and t.acc_id like \"".$compte['acc_id']."%\"');"; + $res = $this->doQueryI($q); + $cpts[$k][$key] = $res['records'][0][2]; + $cpts[$k][$key."_debit"] = $res['records'][0][0]; + $cpts[$k][$key."_credit"] = $res['records'][0][1]; + } + } + function fillAccountsWhere (&$cpts,$period,$where,$res_key) { + $q =<<doQueryI($q); + foreach ($res['records'] as $line) { + $cpts[$line[0]][$res_key] = $line[2]; + $cpts[$line[0]]['name'] = $line[1]; + $cpts[$line[0]][$period]['name'] = $line[1]; + $cpts[$line[0]][$period]['pc'] = $line[3]; + $cpts[$line[0]][$period.$line[3].$res_key] = $line[2]; + } + //WHERE a.acc_id REGEXP '(^6.*)' + } + function fillBudget(&$cpts,$period,$key) { + foreach($cpts as $k => $compte) { + // $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte['acc_id']."%\"');"; + $q=<<doQueryI($q); + $cpts[$k][$key] = $res['records'][0][0]; + } + } + function fillBudgetListWhere(&$cpts,$period,$where,$key) { + $q=<<doQueryI($q); + + foreach ($res['records'] as $b) { + $acc = $b[0]; + $e = $period.$b[3].$key; + error_log("annexe::fillBudgetListWhere SET: ".$b[0]." ".$period.$b[3].$key." =".$b[2]); + $cpts[$acc][$e] = $b[2]; + $cpts[$acc][$period][$key.'_pc'] = $b[3]; + // $cpts["".$b[0]][$period][$b[3]][$key] = $b[2]; + } + + } + + function annexe1() { + $width = 420; + $tiers = array("40" => array('acc_id' => 40), + "42" => array('acc_id' => 42), + "43" => array('acc_id' => 43), + "44" => array('acc_id' => 44), + "46" => array('acc_id' => 46), + "47" => array('acc_id' => 47), + "48" => array('acc_id' => 48), + "49" => array('acc_id' => 49) + ); + + $pdf = $this->pdf; + $total_tresorerie = 0.0; + $total_tresorerie_clos = 0.0; + $tresorerie = $this->fillTresorerie($this->period-1,$total_tresorerie); + $tresorerie_clos = $this->fillTresorerie($this->period,$total_tresorerie_clos ); + $prov_total = 0.0; + $prov_clos_total = 0.0; + $prov = $this->fillProvision($this->period-1,$prov_total); + $prov_clos = $this->fillProvision($this->period,$prov_clos_total); + $prov_total_str = number_format($prov_total,2); + $prov_clos_total_str = number_format($prov_clos_total,2); + $copro = $this->getAccountList("45"); + $this->fillCopro($copro,$this->period-1,"solde"); + $this->fillCopro($copro,$this->period,"solde_clos"); + $this->fillTier($tiers,$this->period-1,"solde"); + $this->fillTier($tiers,$this->period,"solde_clos"); + $copro_str = ""; + $copro_creance = ""; + $copro_dette = ""; + $copro_creance_clos = ""; + $copro_dette_clos = ""; + $tiers_creance =""; + $tiers_creance_clos =""; + $tiers_dette =""; + $tiers_dette_clos =""; + $total_creance = 0.0; + $total_creance_clos = 0.0; + $total_dette =0.0; + $total_dette_clos =0.0; + foreach($copro as $item) { + $copro_str = $copro_str.$item['acc_id']." ".$item['acc_desc']."
    "; + if ($item['solde'] > 0 ) { + $copro_creance = $copro_creance."0.00"."
    "; + $copro_dette = $copro_dette.number_format($item['solde'],2)."
    "; + $total_dette += $item['solde']; + } else { + $copro_creance = $copro_creance.number_format($item['solde']*-1,2)."
    "; + $total_creance += $item['solde']*-1; + $copro_dette = $copro_dette."0.00"."
    "; + } + if ($item['solde_clos'] > 0 ) { + $copro_creance_clos = $copro_creance_clos."0.00"."
    "; + $copro_dette_clos = $copro_dette_clos.number_format($item['solde_clos'],2)."
    "; + $total_dette_clos += $item['solde_clos']; + } else { + $copro_creance_clos = $copro_creance_clos.number_format($item['solde_clos']*-1,2)."
    "; + $total_creance_clos += $item['solde_clos']*-1; + $copro_dette_clos = $copro_dette_clos."0.00"."
    "; + } + + } + // Fill Comtpes de tiers + foreach ($tiers as $k => $compte) { + if ($compte['solde'] > 0.0 ) { + $tiers[$k]['solde_str'] = $compte["solde"]; + $total_dette += $compte['solde']; + } else { + $tiers[$k]['solde_str'] = "0.0"; + $total_creance += $compte['solde']*-1; + } + } + foreach ($tiers as $k => $compte) { + if ($compte['solde_clos'] > 0.0 ) { + $tiers[$k]['dette_clos_str'] = $compte["solde_clos"]; + $tiers[$k]['creance_clos_str'] = "0.0"; + $tiers[$k]['creance_clos_str'] = $compte["solde_clos"]; + $total_dette_clos += $compte['solde_clos']; + } else { + $tiers[$k]['dette_clos_str'] = "0.0"; + $tiers[$k]['creance_clos_str'] = $compte["solde_clos"]; + $total_creance_clos += $compte['solde_clos']*-1; + } + } + // Calcul des totaux + $total_g_creance = $total_creance + $total_tresorerie; + $total_g_creance_clos = $total_creance_clos + $total_tresorerie_clos; + $tg2p4 = $prov_total + $total_dette; + $tg2p4_str = number_format($tg2p4,2); + $tg2p4_clos = $prov_clos + $total_dette_clos; + $tg2p4_clos_str = number_format($tg2p4_clos,2); + $tbl = << + I- SITUATION FINANCIERE ET TRESORERIE +  
    Trésorerie
    + 50 Fonds places
    +
    + 51 Banques ou fonds disponibles en banque
    +
    +
    + 53 Caisse
    +

    + + Exercice précédent approuvé + Exercice Clos + +  
    + $tresorerie +
    +
    +
    +
    + + +  
    + $tresorerie_clos +
    +
    +
    +
    + + + Trésorerie disponible total{$total_tresorerie}{$total_tresorerie_clos} + +  
    Provisions et avances
    + 102 Provisions pour travaux
    + 103 Avances
    + 1031 Avances de trésorerie
    + 1032 Avances travaux
    + 1033 Autres avances
    + 131 Subventions et instance d'affectation
    + 12 Solde en attente sur travaux ou opérations exceptionnel +
    + + Exercice précédent approuvé + Exercice Clos + +   +
    + {$prov}
    +
    + +   +
    + {$prov_clos}
    +
    + + + Total II{$prov_total_str}{$prov_clos_total_str} + II - CREANCES +  
    + +45 Copropriétaires - sommes exigibles restant percevoir
    + $copro_str +
    + Comptes de Tiers
    + 42 Autres créances
    + 43 Autres créances
    + 44 Autres créances
    + 46 Débiteurs divers
    + 47 Comptes d'attente
    + 48 Comptes de régularisation
    +
    + + Exercice précédent approuvé + Exercice Clos + + + + +
    + $copro_creance +

    + {$tiers[42]["solde_str"]}
    + {$tiers[43]["solde_str"]}
    + {$tiers[44]["solde_str"]}
    + {$tiers[46]["solde_str"]}
    + {$tiers[47]["solde_str"]}
    + {$tiers[48]["solde_str"]}
    +
    + + +
    + $copro_creance_clos +

    + {$tiers[42]["creance_clos_str"]}
    + {$tiers[43]["creance_clos_str"]}
    + {$tiers[44]["creance_clos_str"]}
    + {$tiers[46]["creance_clos_str"]}
    + {$tiers[47]["creance_clos_str"]}
    + {$tiers[48]["creance_clos_str"]}
    +
    + + Total III{$total_creance}{$total_creance_clos} + + + + + DETTES + + +  
    + + 45 Copropriétaires - éxcédents versés
    + $copro_str +
    + Comptes de Tiers
    + 40 fournisseurs
    + 42 Autres dettes
    + 43 Autres dettes
    + 44 Autres dettes
    + 46 Créditeurs divers
    + 47 Compte d'attentes
    + 48 Comptes de régularisation
    + 49 Dépréciation des comptes de tiers
    +
    + + Exercice précédent approuvé + Exercice Clos + + + +
    + $copro_dette +

    + {$tiers[40]["solde_str"]}
    + {$tiers[42]["solde_str"]}
    + {$tiers[43]["solde_str"]}
    + {$tiers[44]["solde_str"]}
    + {$tiers[46]["solde_str"]}
    + {$tiers[47]["solde_str"]}
    + {$tiers[48]["solde_str"]}
    + {$tiers[49]["solde_str"]}
    + +
    + +
    + $copro_dette_clos +

    + {$tiers[40]["dette_clos_str"]}
    + {$tiers[42]["dette_clos_str"]}
    + {$tiers[43]["dette_clos_str"]}
    + {$tiers[44]["dette_clos_str"]}
    + {$tiers[46]["dette_clos_str"]}
    + {$tiers[47]["dette_clos_str"]}
    + {$tiers[48]["dette_clos_str"]}
    + {$tiers[49]["dette_clos_str"]}
    +
    + + + Total IV + {$total_dette}{$total_dette_clos} + + Total général (I) + (III) + {$total_g_creance}{$total_g_creance_clos} + Total général (II) + (IV){$tg2p4_str}{$tg2p4_clos_str} + + Emprunt: montant restant du + +EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $tbl, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + } + + function annexe2() { + $sl = 60; + $width = 320; + $pdf = $this->pdf; + $charge_str =""; + $charge_exercice_str = ""; + $charge_exercice_clos_str = ""; + + $chgr_str =""; + $prod_str =""; + $prod_exercice_str = ""; + $prod_exercice_clos_str = ""; + $st = array('charge' => 0.0 , 'charge_clos' => 0.0, + 'chrg_exp' => 0.0 , 'chrg_exp_clos' => 0.0 ,'chrg_exp_budget' => 0.0, + 'poc' => 0.0 , 'poc_clos' => 0.0 , 'poc_budget' => 0.0 ,'poc_budget_n1' => 0.0 , 'poc_budget_n2' => 0.0 + ); + $charge = $this->getAccountListWhere("a.acc_id like '60%' or a.acc_id like '61%' or a.acc_id like '62%' or a.acc_id like '63%'" ); + $this->fillAccounts($charge,$this->period-1,"solde"); + $this->fillAccounts($charge,$this->period,"solde_clos"); + // Handler charges + foreach( $charge as $k => $cpt) { + $charge_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,$sl)."
    "; + $charge_exercice_str .= number_format($cpt["solde_debit"],2)."
    "; + $st['charge'] += $cpt["solde_debit"]; + $charge_exercice_clos_str .= number_format($cpt["solde_clos_debit"],2)."
    "; + $st['charge_clos'] += $cpt["solde_clos_debit"]; + } + // Handle Charge exceptionnel + $chrg_exp = $this->getAccountListWhere("a.acc_id REGEXP '(^661.*|^671.*|^673.*|^672.*|^677.*|^68.*)'"); + $this->fillAccounts($chrg_exp,$this->period-1,"solde"); + $this->fillAccounts($chrg_exp,$this->period,"solde_clos"); + $this->fillBudget($chrg_exp,$this->period,"budget"); + $chrg_exp_str =""; + $chrg_exp_exercice_str =""; + $chrg_exp_exercice_clos_str =""; + $chrg_exp_exercice_budget =""; + foreach( $chrg_exp as $k => $cpt) { + $chrg_exp_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,$sl)."
    "; + $chrg_exp_exercice_str .= number_format($cpt["solde_debit"],2)."
    "; + $chrg_exp_exercice_budget .= number_format($cpt["budget"],2)."
    "; + $st['chrg_exp_budget'] += $cpt["budget"]; + $st['chrg_exp'] += $cpt["solde_debit"]; + $chrg_exp_exercice_clos_str .= number_format($cpt["solde_clos_debit"],2)."
    "; + $st['chrg_exp_clos'] += $cpt["solde_clos_debit"]; + } + + // Handler produit + $prod = $this->getAccountListWhere("a.acc_id REGEXP '(^701.*|^71.*)'"); + $prod_str =""; + $prod_exercice_str =""; + $prod_exercice_budget =""; + $prod_exercice_budget_n1 =""; + $prod_exercice_budget_n2 =""; + $prod_exercice_clos_str =""; + + $this->fillAccountsType($prod,$this->period-1,"solde","AF"); + $this->fillAccountsType($prod,$this->period,"solde_clos","AF"); + $this->fillBudget($prod,$this->period,"budget"); + $this->fillBudget($prod,$this->period+1,"budget_n1"); + $this->fillBudget($prod,$this->period+2,"budget_n2"); + foreach( $prod as $k => $cpt) { + $prod_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,$sl)."
    "; + $prod_exercice_str .= number_format($cpt["solde_credit"],2)."
    "; + $st['poc'] += $cpt["solde_credit"]; + $prod_exercice_budget .= number_format($cpt["budget"],2)."
    "; + $st['poc_budget'] += $cpt["budget"]; + $prod_exercice_budget_n1 .= number_format($cpt["budget_n1"],2)."
    "; + $st['poc_budget_n1'] += $cpt["budget_n1"]; + $prod_exercice_budget_n2 .= number_format($cpt["budget_n2"],2)."
    "; + $st['poc_budget_n2'] += $cpt["budget_n2"]; + $prod_exercice_clos_str .= number_format($cpt["solde_clos_credit"],2)."
    "; + $st['poc_clos'] += $cpt["solde_clos_credit"]; + } + + // Handle produit exceptionnel + $prod_exp = $this->getAccountListWhere("a.acc_id REGEXP '(^70[234].*|^71[123468].*|^78.*)'"); + $prod_exp_str = ""; + $prod_exp_exercice_str = ""; + $prod_exp_exercice_clos_str = ""; + $prod_exp_exercice_budget = ""; + $this->fillAccounts($prod_exp,$this->period-1,"solde"); + $this->fillAccounts($prod_exp,$this->period,"solde_clos"); + $this->fillBudget($prod_exp,$this->period,"budget"); + foreach( $prod_exp as $k => $cpt) { + $prod_exp_str .= $cpt["acc_id"]." ".substr($cpt['acc_desc'],0,$sl)."
    "; + $prod_exp_exercice_str .= number_format($cpt["solde_debit"],2)."
    "; + $prod_exp_exercice_budget .= number_format($cpt["budget"],2)."
    "; + $prod_exp_exercice_clos_str .= number_format($cpt["solde_clos_debit"],2)."
    "; + } + // Handler Budget Charge N + $budget_n_str = ""; + $budget_n_amount = ""; + $budget_n_total = 0.0; + $budget_n = $this->getBudgetListWhere($this->period,"a.acc_id REGEXP '(^60[0123456].*|^61.*|^62.*)'"); + foreach ($budget_n as $k => $v) { + $budget_n_str .= $v[0]."
    "; + $budget_n_amount .= number_format($v[2],2)."
    "; + $budget_n_total += $v[2]; + } + $budget_n_total = number_format($budget_n_total,2); + // Handler Budget Charge N 1 + $budget_n1_str = ""; + $budget_n1_amount = ""; + $budget_n1_total = 0.0; + $budget_n1 = $this->getBudgetListWhere($this->period+1,"a.acc_id REGEXP '(^60[0123456].*|^61.*|^62.*)'"); + foreach ($budget_n1 as $k => $v) { + $budget_n1_str .= $v[0]."
    "; + $budget_n1_amount .= number_format($v[2],2)."
    "; + $budget_n1_total += $v[2]; + } + $budget_n1_total = number_format($budget_n1_total,2); + // Handler Budget Charge N 1 + $budget_n2_str = ""; + $budget_n2_amount = ""; + $budget_n2_total = 0.0; + $budget_n2 = $this->getBudgetListWhere($this->period+2,"a.acc_id REGEXP '(^60[0123456].*|^61.*|^62.*)'"); + foreach ($budget_n2 as $k => $v) { + $budget_n2_str .= $v[0]."
    "; + $budget_n2_amount .= number_format($v[2],2)."
    "; + $budget_n2_total += $v[2]; + } + $budget_n2_total = number_format($budget_n2_total,2); + + + +$html =<<Annexe 2 +

    Comptes de gestion général de l'exercice clos réalisé (N) du {$this->per_begin} au {$this->per_end}

    +

    et budget previsionnel de l'exercice (N+2) du .... au ....

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CHARGES POUR OPERATIONS COURANTES
    Pour Approbation des comptesPour le vote du budget prévisionnel
    Exercice précédent
    approuvé
    N-1
    Exercice clos
    Budge vote
    N
    Exercice Clos réalisé
    approuver
    N
    Budget prévisionnel
    en cours vote
    N+1
    Budget prévisionnel
    voter
    N+2

    + 60 Achats de matières et fournitures
    + {$charge_str} +
    +

    +
    + {$charge_exercice_str} +

    +
    + {$budget_n_amount} +

    +
    + {$charge_exercice_clos_str} +
    +

    + {$budget_n1_amount} +
    +

    + {$budget_n2_amount} +
    Sous-total + + + {$st['charge']} + + {$budget_n_total} + + {$st['charge_clos']} + + {$budget_n1_total} + + {$budget_n2_total} +
    Solde(exécédent s opérations courantes affect au + copropriétaires) + + + N/C + + N/CN/C
    Total I + + + + +
    + CHARGES POUR TRAVAUX ET AUTRES OPERATIONS EXCEPTIONNELLES + + +

    + {$chrg_exp_str} +
    +

    + {$chrg_exp_exercice_str} +

    + {$chrg_exp_exercice_budget} +

    + {$chrg_exp_exercice_clos_str} +
    Solde(excedent) + + + + +
    Total II + + + {$st['chrg_exp']} + + {$st['chrg_exp_budget']} + + {$st['chrg_exp_clos']} +
    PRODUITS POUR OPERATIONS COURANTES
    Pour Approbation des comptesPour le vote du budget prévisionnel
    Exercice
    Précédent
    N-1
    Exercice
    clos budge
    N
    Exercice clos
    réaliser
    N
    Budget
    Prévisionnel en
    N+1
    Budget prévisionnel
    à voter
    N+2

    + {$prod_str} +

    + {$prod_exercice_str} +

    + {$prod_exercice_budget} +

    + {$prod_exercice_clos_str} +

    + {$prod_exercice_budget_n1} +

    + {$prod_exercice_budget_n2} +
    Sous-total + {$st['poc']} + + {$st['poc_budget']} + + {$st['poc_clos']} + + {$st['poc_budget_n1']} + + {$st['poc_budget_n2']} +
    Solde(insuffisance s/oprations courantes affecté aux copropriétaires)N/CN/CN/C
    Total I
    + PRODUITS POUR TRAVAUX ET AUTRES OPERATIONS EXCEPTIONNELLES +

    + {$prod_exp_str}

    + {$prod_exp_exercice_str} +

    + {$prod_exp_exercice_budget} +

    + {$prod_exp_exercice_clos_str} +
    Solde(insuffisant)
    Total II
    +EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + } + + /** + * + */ + function annexe3() { + $digits = 2; + $q = "select pc_id,pc_name from PosteCharge;"; + $pc = $this->doQueryI($q); + $st = array('exercice' => 0, 'exercice_nm1' => 0,'budget' => 0 , 'budgetn1' => 0,'budgetn2' => 0); + $entries = ""; + $accounts = array(); + $pdf = $this->pdf; + $this->fillAccountsWhere($accounts,$this->period,"a.acc_id REGEXP '(^6.*)'","amount"); + $this->fillAccountsWhere($accounts,$this->period-1,"a.acc_id REGEXP '(^6.*)'","am1"); + //$bu = $this->getBudgetListWhere($this->period,"a.acc_id REGEXP '(^6.*)'"); + $this->fillBudgetListWhere($accounts,$this->period,"a.acc_id REGEXP '(^6.*)'","bu"); + $this->fillBudgetListWhere($accounts,$this->period+1,"a.acc_id REGEXP '(^6.*)'","bu1"); + $this->fillBudgetListWhere($accounts,$this->period+2,"a.acc_id REGEXP '(^6.*)'","bu2"); + $bu1 = $this->getBudgetListWhere($this->period+1,"a.acc_id REGEXP '(^6.*)'"); + $bu2 = $this->getBudgetListWhere($this->period+2,"a.acc_id REGEXP '(^6.*)'"); + + $pm1 = $this->period - 1; + foreach ($pc['records'] as $ch) { + $entries.="".$ch[1].""; + $entries.=""; + // Handler Budget + // First Col 1 + $entries.=""; + foreach($accounts as $k => $c) { + if ( ($c[$this->period]['pc'] == $ch[0] ) + ||( $c[$pm1]['pc'] == $ch[0] ) + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) + $entries.="".$k.' - '.$c['name']."
    "; + + } + $entries.=""; + // First Col 2 + $entries.=''; + foreach($accounts as $k => $c) { + if ( ($c[$this->period]['pc'] == $ch[0] ) + || ($c[$pm1]['pc'] == $ch[0] ) + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$pm1]['pc'] == $ch[0]) { + $entries.="".number_format($c['am1'],$digits)."
    "; + $st['exercice_nm1'] += $c['am1']; + } else + $entries.="-
    "; + } + } + $entries.=""; + // First Col 3 + $entries.=''; + foreach($accounts as $k => $c) { + $e = $this->period.$ch[0]."bu"; + if ($c[$this->period]['pc'] == $ch[0] + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$this->period]['bu_pc'] == $ch[0] ) { + $entries.=number_format($c[$e],$digits).""."
    "; + $st['budget'] += $c[$e]; + } else + $entries.="-
    "; + } + } + $entries.=""; + // First Col 4 + $entries.=''; + foreach($accounts as $k => $c) { + if ($c[$this->period]['pc'] == $ch[0] + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$this->period]['pc'] == $ch[0]) { + $entries.=number_format($c['amount'],$digits)."
    "; + $st['exercice'] += $c['amount']; + } else + $entries.="-
    "; + } + } + $entries.=""; + // First Col 5 + $entries.=''; + foreach($accounts as $k => $c) { + $e = ($this->period+1).$ch[0]."bu1"; + if ($c[$this->period]['pc'] == $ch[0] + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$this->period+1]['bu1_pc'] == $ch[0] ) { + $entries.=number_format($c[$e],$digits).""."
    "; + $st['budgetn1'] += $c[$e]; + } else + $entries.="-
    "; + } + } + $entries.=""; + // First Col 6 + $entries.=''; + foreach($accounts as $k => $c) { + $e = ($this->period+2).$ch[0]."bu2"; + if ($c[$this->period]['pc'] == $ch[0] + || $c[$this->period-1]['pc'] == $ch[0] + || $c[$this->period]['bu_pc'] == $ch[0] + || $c[$this->period+1]['bu1_pc'] == $ch[0] + ) { + if ($c[$this->period+2]['bu2_pc'] == $ch[0] ) { + $entries.=number_format($c[$e],$digits).""."
    "; + $st['budgetn2'] += $c[$e]; + } else + $entries.="-
    "; + } + } + $entries.=""; + + $entries.=""; + } + $html =<<Annexe 3 +

    Comptes de gestion pour opérations courantes de l'exercice clos réalise (N {$this->period}) du {$this->per_begin} au {$this->per_end}

    +

    et budget previsionnel de l'exercice (N+2) du .... au ....

    +
    + + + + + + + + + + + + + + + + + + + + + {$entries} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CHARGES POUR OPERATIONS COURANTES
     Pour approbation des comptesPour le vote du budget prévisionnel
    Exercice précédent approuvéExercice clos budget voteExercice clos réalise à approuverBudget prévisionnel en coursBudget prévisionnel à voter
    N-1NNN+1 N+2
    TOTAL CHARGES NETTES{$st['exercice_nm1']}{$st['budget']}{$st['exercice']}{$st['budgetn1']}{$st['budgetn2']}
    Provision coproprietaires
    Solde (excedent ou insuffisance s/opérations courantes affecte aux copropriétaires
    + +EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + } + /** + * + */ + function test( $p) { + $this->period = $p; + $this->getPeriod($p); + $pdf = $this->pdf; + $pdf->SetCreator(PDF_CREATOR); + $pdf->SetAuthor('EBERSOLD Andre'); + $pdf->SetTitle('ANNEXE N'); + $pdf->SetSubject('Etat Financier apres repartition au '); + $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + $org = $this->session->getOrganization(); + // set default header data + $h = $org[0]."\n".$org[1]."\n".$org[2]." ".$org[3]; + $pdf->SetHeaderData(/*PDF_HEADER_LOGO*/"", 0, 'SYNDICAT DES COPROPRIETAIRES ANNEXES' , $h, array(64,64,64), array(0,64,128)); + $pdf->setFooterData($tc=array(0,64,0), $lc=array(0,64,128)); + +// set header and footer fonts + $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); + $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font + $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +//set margins + $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); + $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +//set auto page breaks + $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +//set image scale factor + $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +//set some language-dependent strings + //$pdf->setLanguageArray($l); + +// --------------------------------------------------------- + +// set default font subsetting mode + $pdf->setFontSubsetting(true); + +// Set font +// dejavusans is a UTF-8 Unicode font, if you only need to +// print standard ASCII chars, you can use core fonts like +// helvetica or times to reduce file size. + $pdf->SetFont('dejavusans', '', 8, '', true); + +// Add a page +// This method has several options, check the source code documentation for more information. + $pdf->AddPage(); + $html = <<Annexe 1 +

    Etat financier après répartition du {$this->per_begin} au {$this->per_end} (Exercice {$this->period})

    +EOD; + $pdf->setHeaderTemplateAutoreset(true); +// Print text using writeHTMLCell() + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); + $pdf->SetFont('dejavusans', '', 8, '', true); + $this->annexe1() ; + $pdf->AddPage(); + $this->annexe2() ; + $pdf->AddPage(); + $this->annexe3() ; + } + + function Output($fn,$m) { + $this->pdf->Output($fn,$m); + } +} +/** + * Main entry + * For test purpose + */ +GLOBAL $conf; +$conf_auth = $conf['auth']['mysql']; +$_session = new SessionCompta($conf_auth,$conf_auth['req_file']); + +$_database = ""; +$period = ""; +$_database = $_session->getDb(); + +if (isset($_GET['period'])) { $period = $_GET['period'];} else { $period = Date('Y');}; +if ($_database == "") { + error_log("annexe.php no database in session too bad"); + die(); +} + +$_annexe = new annexe1($_session, + $conf_auth, + $_database); +// Get Period from current exercice +// Simply ignore parameters ... +if ($_session->is_logged_in() ) { + $_annexe->test( $period); + + $_annexe->Output('annexe1.pdf', 'I'); +} else { + // redirect to login + header("Location: /app/member/login.php"); + die(); +} + +/** + vim:et:sw=2:ts=2:fileencoding=utf-8:encoding=utf-8 +*/ +?> diff --git a/app/compta/reports/syndic_builder_annexe.php b/app/compta/reports/syndic_builder_annexe.php new file mode 100644 index 0000000..54aaf05 --- /dev/null +++ b/app/compta/reports/syndic_builder_annexe.php @@ -0,0 +1,135 @@ +session = $_session; + //$this->pdf = new TCPDF('P',PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + $this->pdf = new TCPDF('L',PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + $this->db = new AnnexeData($_session,$auth_cfg,$db); + } + + function __destruct() { + } + + /** + * + * + */ + private function processParams() + { + $this->period = AEB::$REQUEST->getParam("period", $this->session->getCurrentExercice()); + $this->compte = AEB::$REQUEST->getParam("compte", "450002"); + } + + public function generate() + { + $this->setModel(); + if ($this->session->is_logged_in() ) + { + $this->processParams(); + $a1 = new annexe1($this->pdf,$this->db,$this->period); + $a2 = new annexe2($this->pdf,$this->db,$this->period); + $a3 = new annexe3($this->pdf,$this->db,$this->period); + $a4 = new annexe4($this->pdf,$this->db,$this->period); + $a1->generate(); + $a2->generate(); + $a3->generate(); + $a4->generate(); + } + } + + public function Output($fn,$m) { + header("Content-Disposition: attachment; filename=".$fn); + header("Content-Type: application/pdf"); + $this->pdf->Output($fn,$m); + } + + private function setModel() + { + $pdf = $this->pdf; + $pdf->SetCreator(PDF_CREATOR); + $pdf->SetAuthor('EBERSOLD Andre'); + $pdf->SetTitle('ANNEXE N'); + $pdf->SetSubject('Etat Financier apres repartition au '); + $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + $org = $this->session->getOrganization(); + // set default header data + $h = $org[0]."\n".$org[1]."\n".$org[2]." ".$org[3]; + //$h = "Model \n"."25 rue pfeffinger\n"."67100 STRASBOURG"; + $pdf->SetHeaderData(/*PDF_HEADER_LOGO*/"", 0, 'SYNDICAT DES COPROPRIETAIRES ANNEXES' , $h, array(64,64,64), array(0,64,128)); + $pdf->setFooterData($tc=array(0,64,0), $lc=array(0,64,128)); + +// set header and footer fonts + $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); + $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font + $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +//set margins + $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); + $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +//set auto page breaks + $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +//set image scale factor + $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +//set some language-dependent strings + //$pdf->setLanguageArray($l); + +// --------------------------------------------------------- + +// set default font subsetting mode + $pdf->setFontSubsetting(true); + +// Set font +// dejavusans is a UTF-8 Unicode font, if you only need to +// print standard ASCII chars, you can use core fonts like +// helvetica or times to reduce file size. + $pdf->SetFont('dejavusans', '', 8, '', true); + + } +} + +/* Main entry point */ +$ldb =""; +if (isset($_SESSION['compta_db'])) { + $ldb = $_SESSION["compta_db"] ; +} else + $ldb = 'test'; + +GLOBAL $conf; +$conf_auth = $conf['auth']['mysql']; + +$s = new SessionCompta($conf_auth,$conf_auth['req_file']); +$b = new AnnexeBuilder($s,$conf_auth,$ldb); +$b->generate(); +$b->Output("annexe-report","I"); +?> + diff --git a/app/compta/reports/syndic_builder_decompte.php b/app/compta/reports/syndic_builder_decompte.php new file mode 100644 index 0000000..a81bde0 --- /dev/null +++ b/app/compta/reports/syndic_builder_decompte.php @@ -0,0 +1,217 @@ +period = $_p; + } + /** + * + */ + public function Header() + { + $this->SetFillColor(255); + //$this->SetFont('Arial','',10); + $org = $this->session->getOrganization(); + // set default header data + $this->Cell(50,5,$org[0]); + $this->Ln(); + $this->Cell(50,5,$org[1]); + $this->Ln(); + $addr = $org[2]." ".$org[3]; + $this->Cell(50,5,$addr); + $this->Ln(); + //$this->Cell(50,5,"Tel: 06 70 43 73 80"); + + //$this->SetFont('Arial','',14); + $this->SetFillColor(200); + $this->RoundedRect(120,9,75,10,5,"1234","DF"); + $this->Text(130,12,"Decompte de Charges ".$this->period); + $this->SetY(23); + + $this->SetLineStyle(array("cap" => 'butt', "join" => 'miter','dash' => 0, 'color' => array(100,100,200))); + if ($this->rtl) + { + $this->SetX($this->original_rMargin); + } else + { + $this->SetX($this->original_lMargin); + } + $this->Cell(($this->w- $this->original_lMargin - $this->original_rMargin),0,'','T',2,'M'); + } + /** + * + */ + public function Footer() + { + $this->SetY(-15); + //$this->SetFont('Arial','I',8); + $this->Cell(0,10,'Page '.$this->PageNo().'/'.$this->getAliasNbPages(),'C'); + $this->SetY(-15); + $this->SetX(90); + $this->Cell(0,10,'https://gcopro.ebersold.fr/','C'); + + } + +} + +/** + * \brief the aim of this class is to take care + * of the build dependencies of the annexes. + * I'll plan to separate the Database aspect from the + * presentation aspect. + */ +class BuilderDecompte +{ + private $pdf = null; + private $db = null; + private $session = null; + + function __construct($_session,$auth_cfg,$db) + { + $this->session = $_session; + //$this->pdf = new TCPDF('P',PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); + $this->pdf = new DecomptePDF('P',PDF_UNIT, PDF_PAGE_FORMAT, true, 'ISO-8859-1', false); + $this->pdf->session = $this->session; + $this->db = new AnnexeData($_session,$auth_cfg,$db); + } + + function __destruct() { + } + + /** + * + * + */ + private function processParams() + { + $this->period = AEB::$REQUEST->getParam("period", $this->session->getCurrentExercice()); + $this->compte = AEB::$REQUEST->getParam("compte", "450002"); + $this->pdf->setPeriod($this->period); + } + + /** + * + * + */ + public function generate() + { + $this->setModel(); + $a4 = new DecompteComptes($this->session,$this->pdf,$this->db); + $a5 = new DecompteCharges($this->session,$this->pdf,$this->db); + if ($this->session->is_logged_in() ) { + $this->processParams(); + $a4->Decompte($this->period,$this->compte); + $a5->Decompte($this->period,$this->compte); + } + } + + public function Output($fn,$m) { + $mode = AEB::$REQUEST->getParam("mode", $m); + if ($mode == "I" ) + { + header("Content-Disposition: attachment; filename=".$fn); + header("Content-Type: application/pdf"); + $this->pdf->Output($fn,$m); + } elseif ( $this->session->is_logged_in() ) + { + $fulldir = AEB::getDataDir().$this->session->getDb()."/Reports/".$this->period."/"; + error_log("Mode=".$mode." Path=".$fulldir); + if (! file_exists($fulldir)) { + if ( mkdir($fulldir,0777,true) ) + { + error_log("Failed create directory ".$fulldir); + } + } + $filename = "decompte_".$this->period."_".$this->compte.".pdf"; + $fullpath = $fulldir.$filename; + $this->pdf->Output($fullpath,"F"); + } + } + + private function setModel() + { + $pdf = $this->pdf; + $pdf->SetCreator(PDF_CREATOR); + $pdf->SetAuthor('EBERSOLD Andre'); + $pdf->SetTitle('DECOMPTE'); + $pdf->SetSubject('Etat Financier apres repartition au '); + $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + //$org = $this->session->getOrganization(); + // set default header data + //$h = $org[0]."\n".$org[1]."\n".$org[2]." ".$org[3]; + $h = "Model \n"."25 rue pfeffinger\n"."67100 STRASBOURG"; + $pdf->SetHeaderData(/*PDF_HEADER_LOGO*/"", 0, 'SYNDICAT DES COPROPRIETAIRES DECOMPTE DE CHARGES' , $h, array(64,64,64), array(0,64,128)); + $pdf->setFooterData($tc=array(0,64,0), $lc=array(0,64,128)); + +// set header and footer fonts + $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); + $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font + $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +//set margins + $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); + $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +//set auto page breaks + $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +//set image scale factor + $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +//set some language-dependent strings + //$pdf->setLanguageArray($l); + +// --------------------------------------------------------- + +// set default font subsetting mode + $pdf->setFontSubsetting(true); + +// Set font +// dejavusans is a UTF-8 Unicode font, if you only need to +// print standard ASCII chars, you can use core fonts like +// helvetica or times to reduce file size. + $pdf->SetFont('dejavusans', '', 8, '', true); + + } +} + +/* Main entry point */ +$ldb =""; +if (isset($_SESSION['compta_db'])) { + $ldb = $_SESSION["compta_db"] ; +} else + $ldb = 'test'; + +GLOBAL $conf; +$conf_auth = $conf['auth']['mysql']; + +$s = new SessionCompta($conf_auth,$conf_auth['req_file']); +$b = new BuilderDecompte($s,$conf_auth,$ldb); +$b->generate(); +$b->Output("test-report.pdf","I"); +?> diff --git a/app/compta/reports/syndic_charges.php b/app/compta/reports/syndic_charges.php new file mode 100644 index 0000000..15aa45f --- /dev/null +++ b/app/compta/reports/syndic_charges.php @@ -0,0 +1,259 @@ +pdf = $_pdf; + $this->data = $_data; + $this->session = $_session; + } + + + function __destruct() { + } + + + private function Titre($libelle) { + $pdf = $this->pdf; + $html =<<<_EOF +

    {$libelle}

    +_EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y= '', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + + //$this->y0 = $this->GetY(); + } + + // Better table + private function ImprovedTable($header, $data) + { + $i = 0; + $ch = 4; + // Column widths + $w = array(17, 45, 68, 30,30); + // Header + for($i=0;$iCell($w[$i],7,$header[$i],1,0,'C'); + $this->Cell($w[$i],7,iconv('UTF-8','iso8859-1',$header[$i]),1,0,'C'); + $this->Ln(); + // Data + $this->SetFont('Arial','',8); + foreach($data as $row) + { + $this->Cell($w[0],$ch,$row[0],'LR'); + //$this->Cell($w[1],$ch,$row[1],'LR'); + $this->Cell($w[1],$ch,iconv('UTF-8','iso8859-1',$row[1]),'LR'); + + $this->Cell($w[2],$ch,$row[2],'LR',0,'R'); + if ($row[3] == 0.0 ) { + $this->Cell($w[3],$ch,'','LR',0,'R'); + } else + $this->Cell($w[3],$ch,number_format($row[3],2),'LR',0,'R'); + if ($row[4] == 0.0) { + $this->Cell($w[4],$ch,'','LR',0,'R'); + } else + $this->Cell($w[4],$ch,number_format($row[4],2),'LR',0,'R'); + $this->Ln(); + if ($i++ > 50) + { + $i = 0; + $this->AddPage(); + $this->Ln(); + } + } + $this->SetFont('Arial','',10); + // Closing line + $this->Cell(array_sum($w),0,'','T'); + } + // + + private function Solde($period,$compte) { + $w = array(130, 30,30); + $header = array('Solde','Debit','Credit'); + $q = 'CALL solde_compte("'.$period.'","'.$compte.'");'; + $this->Ln(); + // Header + + $res = $this->doQueryImpr($q); + if ($res['records'] != "Failed") { + $fields = $res['records'][0]; + $this->Cell($w[0],6,'Total','LR'); + $this->Cell($w[1],6,$fields[0],'LR',0,'R'); + $this->Cell($w[2],6,$fields[1],'LR',0,'R'); + $this->Ln(); + } else { + $this->Cell($w[0],6,'Total','LR'); + $this->Cell($w[1],6,'0','LR',0,'R'); + $this->Cell($w[2],6,'0','LR',0,'R'); + $this->Ln(); + } + $this->Cell(array_sum($w),0,'','T'); + $this->Ln(); + $this->Ln(); + if ($res['records'][0][2] > 0.0) { + $str = "Votre compte présente un solde créditeur de ".$res['records'][0][2]." euros"; + //$this->Cell(50,5,"Votre compte presente un solde crediteur de ".$res['records'][0][2]." euros"); + $this->Cell(50,5,iconv('UTF-8','iso8859-1',$str)); + } else { + $str = "Votre compte présente un solde débiteur de ".abs($res['records'][0][2])." euros"; + //$this->Cell(50,5,"Votre compte presente un solde debiteur de ".abs($res['records'][0][2])." euros"); + $this->Cell(50,5,iconv('UTF-8','iso8859-1',$str)); + } + + } + /** + * @brief Initial implementation to display owner info based on account name. It's a bad strategy. + * The info's should be based on uid in case the request comes from the syndic. + * The uid shall be the one from the session in the other case + * @deprecated + * + */ + private function Copro($compte) { + $x = 120; + $q = 'select ident_name,ident_firstname,ident_address,ident_postalcode,ident_city from Owners as i '; + $qj= 'JOIN JoinIdentityAccount as j on j.jia_ident = i.ident_id and j.jia_acc ='.$compte.';'; + $res = $this->doQueryImpr($q.$qj); + $ident = $res['records'][0]; + $this->Text($x,40,"".$ident[0]." ".$ident[1] ); + $this->Text($x,46,"".$ident[2]); + $this->Text($x,52,"".$ident[3]." ".$ident[4]); + $this->setY(60); + } + + /** + * @brief retrieve information from owner. Name, adresse, etc + * + */ + private function CoproUser($uid) { + $x = 120; + $q =<<<_EOF +SELECT ident_name,ident_firstname,ident_address,ident_postalcode,ident_city FROM Owners as i +WHERE ident_id = {$uid}; +_EOF; + $res = $this->doQueryImpr($q); + $ident = $res['records'][0]; + $this->Text($x,40,"".$ident[0]." ".$ident[1] ); + $this->Text($x,46,"".$ident[2]); + $this->Text($x,52,"".$ident[3]." ".$ident[4]); + $this->setY(60); + } + + /** + * @brief Initial implementation. Does not work as expected because a owner can + * ownmultiple accounts + * + * @TODO revise so that this entry can handle multiple accounts + */ + public function Decompte($period,$compte) { + + $this->pdf->AddPage(); + + try { + $this->Detail($period,$compte); + } catch (Exception $e) { + $this->Cell(50,5,"Failed :".$e->getMessage()); + } + } + + function UserIdFromAccount($account) { + $q = "select jia_ident from JoinIdentityAccount WHERE jia_acc = ".$account.";"; + $res = $this->data->doQueryI($q); + return $res['records'][0][0]; + } + /** + * + */ + private function Detail($period,$compte) { + $opt = Array(); + + // Exercice Clos + $page_height = 286.93; + foreach (array(1,4,5) as $row) + { + $space_left = $page_height - ($this->pdf->getY()); + if ( $space_left < 20) + { + $this->pdf->AddPage(); + $this->pdf->Ln(); + } else { + //$this->pdf->Ln(); + } + $this->DetailPc($period,$compte,$row); + $this->pdf->Ln(05); + } + } + /** + */ + private function DetailPc($period,$cpt,$pcs) { + $uid = $this->UserIdFromAccount($cpt); + $this->Titre("Poste Charge PC".$pcs); + $q = "CALL detail_decompte_charge(".$uid.",".$pcs.",".$period.",2);"; + $res = $this->data->doQueryI($q); + $ch = 4; + $total = 0.0; + $tot_fra = 0.0; + $st_title= "border: 1px solid #000;"; + $st_data = "border-left: 1px solid #000; border-right: 1px solid #000;"; + $html =<<<_EOF + + + + + + + +_EOF; + $res = $this->data->doQueryI($q); + $data = $res['records']; + foreach($data as $row) + { + $total = $total + $row[4]; + $tot_fra = $tot_fra + $row[6]; + $html.=''; + $html.='<'; + $html.='td class="num">'.number_format($row[4],2).''; + // Handle Tantieme and fraction + for ($i = 5 ; $i <= 6 ; $i++) + { + if ($row[$i] == 0.0 ) + { + $html.=''; + } else + $html.=''; + } + $html.=''; + } + // Handle total + $html.= ''; + $html.= ''; + $html.= '
    DateRéférenceTotalTantièmeFraction
    '.$row[0].''.$row[3].' '.number_format($row[$i],2).'
    Total'.number_format($total,2).' '.number_format($tot_fra,2).'
    '; + $this->pdf->writeHTMLCell($w=0, $h=0, $x='', $y= '', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + } + +} + + + +?> diff --git a/app/compta/reports/syndic_compte.php b/app/compta/reports/syndic_compte.php new file mode 100644 index 0000000..662f655 --- /dev/null +++ b/app/compta/reports/syndic_compte.php @@ -0,0 +1,419 @@ +pdf = $_pdf; + $this->data = $_data; + $this->session = $_session; + } + + + function __destruct() { + } + + private function Header() { + $pdf = $this->pdf; + $pdf->SetFillColor(255); + //$pdf->SetFont('Arial','',10); + $org = $this->session->getOrganization(); + // set default header data + $pdf->Cell(50,5,$org[0]); + $pdf->Ln(); + $pdf->Cell(50,5,$org[1]); + $pdf->Ln(); + $addr = $org[2]." ".$org[3]; + $pdf->Cell(50,5,$addr); + $pdf->Ln(); + //$pdf->Cell(50,5,"Tel: 06 70 43 73 80"); + + //$pdf->SetFont('Arial','',14); + $pdf->SetFillColor(200); + $pdf->RoundedRect(120,10,75,10,5,"1234","DF"); + $pdf->Text(125,17,"Decompte de Charges"); + + } + /** + * + */ + private function Titre($libelle) { + $pdf = $this->pdf; + $html =<<<_EOF +

    {$libelle}

    +_EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y= '', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + + $pdf->Ln(2); + } + /** + * + */ + private function DetailLots($cpt) + { + $pdf = $this->pdf; + $i = 0; + $_y = $pdf->GetY(); + $pdf->setY(35); + $html=<<<_EOF + + + + +%s +
    LOTSPC1PC2 PC4EAU
    +_EOF; + $tplt =<<<_EOF + + %s + %.2f + %.2f + %.2f + %.2f +_EOF; + $uid = $this->UserIdFromAccount($cpt); + $q =<<<_EOF +call tantieme_per_lot({$uid}); +_EOF; + $res = $this->data->doQueryI($q); + $str = ""; + // + // + foreach($res['records'] as $fields) + { + if (isset($fields[0]) && isset($fields[1])) + { + $str .= sprintf($tplt,$fields[0],$fields[1],$fields[2],$fields[4],$fields[5]); + } + } + $str = sprintf($html,$str); + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y= 35, $str, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + $pdf->setY($_y); + } + + private function ImprovedTable($header,$data) + { + $pdf = $this->pdf; + $width = Array(70,170,210,90,90); + $total = []; + $html=''; + // Ok Add header + for($i=0;$i'.$header[$i].""; + } + $html.= ""; + foreach($data as $row) + { + if ( strtoupper(trim($row[2])) != "TOTAL") + { + $html.= ""; + $html.= '"; + $html.= '"; + $html.= '"; + for($i=3;$i<5;$i++) + { + if ($row[$i] == 0.0 ) + { + $html.= ''; + } else + { + $html.='"; + } + } + $html.= ""; + } else { + $total = $row; + } + } + // Now solde + $html.=""; + $html.=''; + $html.=''; + $html.=''; + $html.=""; + $html.="
    '.$row[0]."'.$row[1]."'.$row[2]." '.number_format($row[$i],2)."
    TOTAL'.number_format($total[3],2).''.number_format($total[4],2).'
    "; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y= '', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + } + // + + private function Solde($period,$compte) { + $pdf = $this->pdf; + $w = array(130, 30,30); + $header = array('Solde','Debit','Credit'); + $q = 'CALL solde_compte("'.$period.'","'.$compte.'");'; + // Header + + $res = $this->data->doQueryI($q); + //$pdf->Ln(); + if ($res['records'][0][2] > 0.0) { + $str = "

    Votre compte présente un solde créditeur de ".$res['records'][0][2]." euros

    "; + //$pdf->Cell(0,0,"Votre compte presente un solde crediteur de ".$res['records'][0][2]." euros"); + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y= '', $str, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + //$pdf->Cell(50,5,iconv('UTF-8','iso8859-1',$str)); + } else { + $str = "
    Votre compte présente un solde débiteur de ".abs($res['records'][0][2])." euros"; + //$pdf->Cell(0,0,"Votre compte presente un solde débiteur de ".abs($res['records'][0][2])." euros"); + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y= '', $str, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + //$pdf->Cell(50,5,iconv('UTF-8','iso8859-1',$str)); + } + + } + /** + * @brief Initial implementation to display owner info based on account name. It's a bad strategy. + * The info's should be based on uid in case the request comes from the syndic. + * The uid shall be the one from the session in the other case + * @deprecated + * + */ + private function Copro($compte) { + $pdf = $this->pdf; + $x = 120; + $q = 'select ident_name,ident_firstname,ident_address,ident_postalcode,ident_city from Owners as i '; + $qj= 'JOIN JoinIdentityAccount as j on j.jia_ident = i.ident_id and j.jia_acc ='.$compte.';'; + $res = $this->data->doQueryI($q.$qj); + $ident = $res['records'][0]; + $pdf->Text($x,40,"".$ident[0]." ".$ident[1] ); + $pdf->Text($x,46,"".$ident[2]); + $pdf->Text($x,52,"".$ident[3]." ".$ident[4]); + $pdf->setY(60); + } + + /** + * @brief retrieve information from owner. Name, adresse, etc + * + */ + private function CoproUser($uid) { + $x = 120; + $q =<<<_EOF +SELECT ident_name,ident_firstname,ident_address,ident_postalcode,ident_city FROM Owners as i +WHERE ident_id = {$uid}; +_EOF; + $res = $this->doQueryImpr($q); + $ident = $res['records'][0]; + $this->Text($x,40,"".$ident[0]." ".$ident[1] ); + $this->Text($x,46,"".$ident[2]); + $this->Text($x,52,"".$ident[3]." ".$ident[4]); + $this->setY(60); + } + + public function generate() + { + $pdf = $this->pdf; + } + /** + * @brief Initial implementation. Does not work as expected because a owner can + * ownmultiple accounts + * + * @TODO revise so that this entry can handle multiple accounts + */ + function Decompte($period,$compte) { + $pdf = $this->pdf; + $header = array('Date','Référence','Désignation','Débit','Crédit'); + $q = 'CALL detail_compte("'.$period.'","'.$compte.'");'; + + $res = $this->data->doQueryI($q); + + //echo "

    ".$q."

    "; + //$pdf->SetFont('Arial','',10); + $pdf->AddPage(); + + $pdf->Ln(); + $pdf->Ln(); + $this->Copro($compte); + $pdf->Ln(); + $this->DetailLots($compte); + $pdf->Ln(); + $this->Titre("Compte ".$compte); + $this->ImprovedTable( $header,$res['records']); + // + $this->Solde($period,$compte); + // For test pupose + //$pdf->Ln(); + try { + $exercice = $this->Exercice($period); + // Exercice Clos + if ($exercice[1] == 0) { + $this->Detail($period,$compte); + } else { + $pdf->Cell(50,5,"Exercice Clos."); + $pdf->Ln(); + $this->Detail($period,$compte); + } + } catch (Exception $e) { + $pdf->Cell(50,5,"Failed :".$e->getMessage()); + } + } + /** + * + */ + function UserIdFromAccount($account) { + $q = "select jia_ident from JoinIdentityAccount WHERE jia_acc = ".$account.";"; + $res = $this->data->doQueryI($q); + return $res['records'][0][0]; + } + /** + * + */ + private function Detail($period,$compte) { + $pdf = $this->pdf; + $opt = Array(); + $retrieve = $this->data->getRetrieve(); + + $result = $retrieve->getSoldeAccount($period,$compte,$opt); + $dt = $result['detail_charge']; + + $exercice = $this->Exercice($period); + // Exercice Clos + if ($exercice[1] == 0) + { + $this->Titre("Détail exercice en cours"); + } else + { + $this->Titre("Charges sur l'exercice ".$period); + } + foreach($dt as $row) { + $pdf->Cell(50,5,$row[0]); + $pdf->Cell(40,5,$row[1]." €",0,1,'R'); + } + // Total Charge en gras + $tcharge =<<<_EOF + + +
    Total charges{$result['total_charge']} €
    +
    +_EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y= '', $tcharge, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + + //$this->Titre("Total appels de fonds ".$result['total_appel']." €"); + $this->Titre("Vos avances"); + $avance =<<<_EOF + + + + + + + +
    Avance de trésorerie0.00 €
    Avance de travaux art 14.20.00 €
    Avance fond de travaux0.00 €
    Total avance0.0 €
    +
    +_EOF; + $pdf->writeHTMLCell($w=0, $h=0, $x='', $y= '', $avance, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=false); + } + /** + */ + private function DetailPc($period,$cpt,$pcs) { + $uid = $this->UserIdFromAccount($cpt); + $this->Titre("Poste Charge PC".$pcs); + $q = "CALL detail_decompte_charge(".$uid.",".$pcs.",".$period.",2);"; + $res = $this->doQueryImpr($q); + $ch = 4; + $total = 0.0; + $tot_fra = 0.0; + /* + */ + if ($res['records'] != "Failed") { + $header = array('Date','Référence','Total','Tantième','Fraction'); + $data = $res['records']; + $i = 0; + // Column widths + $w = array(20, 70, 35, 30,30); + $wt = array(90, 35, 30,30); + // Header + for($i=0;$iCell($w[$i],7,iconv('UTF-8','iso8859-1',$header[$i]),1,0,'C'); + + $this->Ln(); + // Data + //$this->SetFont('Arial','',8); + foreach($data as $row) + { + $this->Cell($w[0],$ch,$row[0],'LR'); + $total = $total + $row[4]; + $this->Cell($w[1],$ch,iconv('UTF-8','iso8859-1',$row[3]),'LR'); + + $this->Cell($w[2],$ch,$row[4],'LR',0,'R'); + if ($row[5] == 0.0 ) { + $this->Cell($w[3],$ch,'','LR',0,'R'); + } else + $this->Cell($w[3],$ch,number_format($row[5],2),'LR',0,'R'); + if ($row[6] == 0.0) { + $this->Cell($w[4],$ch,'','LR',0,'R'); + } else + $this->Cell($w[4],$ch,number_format($row[6],2),'LR',0,'R'); + $tot_fra = $tot_fra + $row[6]; + $this->Ln(); + if ($i++ > 30) + { + $i = 0; + $this->AddPage(); + $this->Ln(); + } + } + //$this->SetFont('Arial','',10); + // Closing line + $this->Cell(array_sum($w),0,'','T'); + $this->Ln(); + // Write totals + $this->Cell($wt[0],$ch,"Total",'LR',0,'L'); + $this->Cell($wt[1],$ch,number_format($total,2),'LR',0,'R'); + $this->Cell($wt[2],$ch,"-",'LR',0,'R'); + $this->Cell($wt[3],$ch,number_format($tot_fra,2),'LR',0,'R'); + $this->Ln(); + $this->Cell(array_sum($w),0,'','T'); + $this->Ln(); + + } + } + + /** + * This function returns the information related to the exercice + * Return the state (how the charges are going to be dispatched + * IF the exercice is closed + * If the exercice has been approved. + */ + private function Exercice ($dt) + { + $q = "select per_repart_charge_end,per_closed,per_approved from Period WHERE per_string = ".$dt.";"; + $res = $this->data->doQueryI($q); + return $res['records'][0]; + } + + /** + * What the problem + */ + function Footer() { + $this->SetY(-15); + //$this->SetFont('Arial','I',8); + $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}','C'); + $this->SetY(-15); + $this->SetX(90); + $this->Cell(0,10,'https://syndic.ebersold.fr/','C'); + + } + +} + + + +?> diff --git a/app/compta/schema_mysql.php b/app/compta/schema_mysql.php new file mode 100644 index 0000000..8f3182f --- /dev/null +++ b/app/compta/schema_mysql.php @@ -0,0 +1,988 @@ + + + + + DROP TABLE IF EXISTS Config; + + + CREATE TABLE IF NOT EXISTS Config ( + cfg_id VARCHAR(32) PRIMARY KEY, + cfg_type INTEGER , + cfg_value VARCHAR(255) DEFAULT "", + INDEX USING BTREE(cfg_id) + ) CHARACTER SET utf8 COLLATE utf8_general_ci; + + + + DROP TABLE IF EXISTS Account; + + + CREATE TABLE IF NOT EXISTS Account ( + acc_id VARCHAR(32) PRIMARY KEY, + acc_info_id INTEGER, + acc_name VARCHAR(64) COLLATE utf8_general_ci, + acc_desc VARCHAR(255) DEFAULT "", + acc_balance REAL DEFAULT 0.0, -- Could be computed dynamically + acc_left INTEGER, -- For node set handling left or opening edge + acc_right INTEGER, -- For node set handling right or closing edge + INDEX USING BTREE(acc_id) + ) CHARACTER SET utf8 COLLATE utf8_general_ci; + + + + DROP PROCEDURE IF EXISTS account_get_leafs; + + + CREATE PROCEDURE account_get_leafs(IN period VARCHAR(32), IN acc VARCHAR(32) ) + BEGIN + SELECT acc_id,acc_name from Account WHERE acc_left + 1 = acc_right and acc_id like acc; + END; + + + + + DROP PROCEDURE IF EXISTS account_get_tree; + + + + CREATE PROCEDURE account_get_tree(IN cls VARCHAR(32) ) + BEGIN + SELECT node.acc_id,CONCAT( REPEAT( '- ', (COUNT(parent.acc_name) - 1) ), node.acc_name) AS acc_name , (COUNT(parent.acc_name) -1 ) AS level + FROM Account AS node, + Account AS parent + WHERE node.acc_left BETWEEN parent.acc_left AND parent.acc_right and node.acc_id like CONCAT(cls,"%") + GROUP BY node.acc_id + ORDER BY node.acc_id; + END; + + + + DROP PROCEDURE IF EXISTS account_insert_beside; + + + + CREATE PROCEDURE account_insert_beside(IN period VARCHAR(32),IN left_acc VARCHAR(32), IN acc VARCHAR(32) ,IN name VARCHAR(64) ) + BEGIN + + SET @myRight := (SELECT acc_right FROM Account + WHERE acc_id = left_acc); + + UPDATE Account SET acc_right = acc_right + 2 WHERE acc_right > @myRight; + UPDATE Account SET acc_left = acc_left + 2 WHERE acc_left > @myRight; + + INSERT INTO Account(acc_id, acc_info_id,acc_name,acc_left,acc_right) VALUES(acc,CONVERT(acc,UNSIGNED INTEGER),name, @myRight + 1, @myRight + 2); + END; + + + + + DROP PROCEDURE IF EXISTS account_insert_below; + + + + CREATE PROCEDURE account_insert_below(IN period VARCHAR(32), IN parent_acc VARCHAR(32),IN acc VARCHAR(32) ,IN name VARCHAR(64) ) + BEGIN + + SET @myLeft := (SELECT acc_left FROM Account WHERE acc_id = parent_acc); + + UPDATE Account SET acc_right = acc_right + 2 WHERE acc_right > @myLeft; + UPDATE Account SET acc_left = acc_left + 2 WHERE acc_left > @myLeft; + + INSERT INTO Account(acc_id,acc_info_id,acc_name, acc_left, acc_right) VALUES(acc,CONVERT(acc,UNSIGNED INTEGER ),name, @myLeft + 1, @myLeft + 2); + + END; + + + + + + + DROP TABLE IF EXISTS Budget; + + + CREATE TABLe IF NOT EXISTS Budget ( + bu_id INTEGER AUTO_INCREMENT PRIMARY KEY, + bu_period_id INTEGER, + bu_desc VARCHAR(64) DEFAULT "" + ); + + + DROP TABLE IF EXISTS BudgetEntry; + + + + CREATE TABLE IF NOT EXISTS BudgetEntry ( + buet_id INTEGER AUTO_INCREMENT PRIMARY KEY, + buet_budget_id INTEGER, + buet_acc_id VARCHAR(32), + buet_amount DECIMAL(13,3) DEFAULT 0.0, + buet_debit_credit ENUM('d','c') DEFAULT 'c', + buet_pc_id INTEGER DEFAULT 1 + ); + + + + DROP TABLE IF EXISTS Period; + + + CREATE TABLE IF NOT EXISTS Period ( + per_id INTEGER AUTO_INCREMENT PRIMARY KEY, + per_begin DATE, + per_end DATE, + per_string VARCHAR(32) ,-- Example Q1_2012, + per_repart_charge_end BOOL DEFAULT TRUE, -- Says when charges should be distributed. At the end of the period or after each bill if false + per_closed BOOL DEFAULT FALSE, + per_approved BOOL DEFAULT FALSE + ); + + + + + DROP TABLE IF EXISTS Transactions; + + + CREATE TABLE IF NOT EXISTS Transactions ( + trans_id INTEGER AUTO_INCREMENT PRIMARY KEY, + voucher_ref VARCHAR(255), + voucher_date DATE, + act_trans_date DATE, + trans_label VARCHAR(255), + trans_file VARCHAR(255) + ); + + + + DROP TABLE IF EXISTS TransactionEntry; + + + CREATE TABLE IF NOT EXISTS TransactionEntry ( + trans_entry_id INTEGER AUTO_INCREMENT PRIMARY KEY, + trans_id INTEGER, + entry_date DATE, + entry_type VARCHAR(2), + acc_id VARCHAR(32), + orig_amount REAL, + amount DECIMAL(13,3) DEFAULT 0.0, + debit_credit enum ('d','c'), + description VARCHAR(255), + voucher_ref VARCHAR(255), + tret_key_id INTEGER DEFAULT 0 -- Cle de charge pour le decompte de charge + ); + + + + DROP TABLE IF EXISTS TransactionEntryType; + + + CREATE TABLE IF NOT EXISTS TransactionEntryType ( + type_id INTEGER AUTO_INCREMENT PRIMARY KEY, + type_code VARCHAR(2), -- BQ, VT, OD + type_desc VARCHAR(255) + ); + + + INSERT INTO TransactionEntryType (type_code,type_desc) VALUES ('BQ','Banque'); + + + INSERT INTO TransactionEntryType (type_code,type_desc) VALUES ('VT','Ventes'); + + + INSERT INTO TransactionEntryType (type_code,type_desc) VALUES ('HA','Achats et frais'); + + + INSERT INTO TransactionEntryType (type_code,type_desc) VALUES ('OD','Operation divers'); + + + INSERT INTO TransactionEntryType (type_code,type_desc) VALUES ('AF','Appels de fonds'); + + + INSERT INTO TransactionEntryType (type_code,type_desc) VALUES ('RF','Remboursement appels de fonds'); + + + INSERT INTO TransactionEntryType (type_code,type_desc) VALUES ('AN','Report a nouveau'); + + + DROP TABLE IF EXISTS JoinIdentityAccount; + + + CREATE TABLE IF NOT EXISTS JoinIdentityAccount ( + jia_id INTEGER AUTO_INCREMENT PRIMARY KEY, + jia_ident INTEGER, + jia_acc INTEGER + ); + + + + CREATE OR REPLACE VIEW Owners AS SELECT ident_id,ident_name,ident_firstname, ident_address, ident_postalcode, + ident_city,ident_country,ident_mobile,ident_phone,ident_email1, + ident_email2, ir.idr_name FROM users.Users as u + JOIN users.UserRoles as ur on ur.ur_user_id = u.ident_id + JOIN users.IdentityRole as ir on ur.ur_role_id =ir.idr_id + WHERE ur.ur_org_id = {org_id} and ir.idr_name = "Coproprietaire"; + + + + CREATE OR REPLACE VIEW Suppliers AS select ident_id,ident_name,ident_firstname,ident_address, + ident_postalcode,ident_city,ident_country,ident_mobile,ident_phone, + ident_email1,ident_email2 FROM users.Identity as i + JOIN users.IdentityType as it on (i.ident_type = it.idtp_id) + JOIN users.UserRoles as ur on (ur.ur_user_id = i.ident_id) + JOIN users.IdentityRole as ir on (ir.idr_id = ur.ur_role_id ) + WHERE ur.ur_org_id = {org_id} and ir.idr_name ="Fournisseur"; + + + + + + DROP TABLE IF EXISTS Lot; + + + + CREATE TABLE IF NOT EXISTS Lot ( + lot_id INTEGER AUTO_INCREMENT PRIMARY KEY, + lot_num INTEGER UNIQUE, + lot_floor VARCHAR(32) DEFAULT "RDC", + lot_area INTEGER DEFAULT 0, + lot_room INTEGER DEFAULT 0, + lot_name VARCHAR(32), + lot_type VARCHAR(32), + lot_building VARCHAR(32), + lot_door VARCHAR(32), + lot_description VARCHAR(256) + ); + + + + DROP TABLE IF EXISTS PosteCharge; + + + CREATE TABLE IF NOT EXISTS PosteCharge ( + pc_id INTEGER AUTO_INCREMENT PRIMARY KEY, + pc_sz INTEGER DEFAULT 0, + pc_name VARCHAR(64), + pc_comment VARCHAR(256) + ); + + + + INSERT INTO PosteCharge (pc_name,pc_comment) VALUES ("PC1","Charges Générales"); + INSERT INTO PosteCharge (pc_name,pc_comment) VALUES ("PC2","Charges Exceptionnelles"); + INSERT INTO PosteCharge (pc_name,pc_comment) VALUES ("PC3","Non Utilisé"); + INSERT INTO PosteCharge (pc_name,pc_comment) VALUES ("PC4","Charges Chauffage"); + INSERT INTO PosteCharge (pc_name,pc_comment) VALUES ("PC5","Charges Eau"); + + + + DROP TABLE IF EXISTS Tantieme; + + + CREATE TABLE IF NOT EXISTS Tantieme ( + tant_id INTEGER AUTO_INCREMENT PRIMARY KEY, + tant_pc_id INTEGER, + tant_lot_num INTEGER, + tant_lot_size REAL + ); + + + + + DROP TABLE IF EXISTS LotsOwners; + + + CREATE TABLE LotsOwners ( + lo_id INTEGER AUTO_INCREMENT PRIMARY KEY, + lo_owner_id INTEGER, + lo_lot_id INTEGER + ); + + + + + DROP PROCEDURE IF EXISTS insert_avance; + + + + CREATE PROCEDURE insert_avance( + IN ed DATE, + IN vouch VARCHAR(32), + IN bqaid VARCHAR(32), + IN aid VARCHAR(32), + IN am REAL, + IN des VARCHAR(256)) + BEGIN + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + ( ed,ed,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,entry_type,acc_id,amount,debit_credit,description) VALUES + (@last_id,ed,vouch,"BQ",aid,am,'c',des); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,entry_type,acc_id,amount,debit_credit,description) VALUES + (@last_id,ed,vouch,"BQ",bqaid,am,'d',des); + END; + + + + + DROP PROCEDURE IF EXISTS insert_trans_facture; + + + + CREATE PROCEDURE insert_trans_facture(IN er_date DATE, + IN ed DATE, + IN vouch VARCHAR(32), + IN chaci INTEGER , + IN aci INTEGER, + IN am REAL, + IN des VARCHAR(256), + IN key_id INTEGER + ) + BEGIN + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (ed,er_date,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type,tret_key_id) VALUES + (@last_id,ed,vouch,chaci,am,'d',des,'HA',key_id); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type,tret_key_id) VALUES + (@last_id,ed,vouch,aci,am,'c',des,'HA',key_id); + END; + + + + DROP PROCEDURE IF EXISTS insert_trans_paye; + + + CREATE PROCEDURE insert_trans_paye(IN tid DATE,IN ed DATE,IN vouch VARCHAR(32), + IN bqaci INTEGER , + IN aci INTEGER,IN am REAL,IN des VARCHAR(256)) + BEGIN + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (ed,tid,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type) VALUES + (@last_id,tid,vouch,bqaci,am,'c',des,'BQ'); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type) VALUES + (@last_id,tid,vouch,aci,am,'d',des,'BQ'); + END; + + + + + DROP PROCEDURE IF EXISTS appel_fonds; + + +CREATE PROCEDURE appel_fonds( + IN ed DATE, + IN copro_aid INTEGER , + IN prod_aid INTEGER, + IN am REAL, + IN des VARCHAR(256)) +BEGIN +INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (ed,ed,"",des); +SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type) VALUES + (@last_id,ed,"",prod_aid,am,'c',des,'AF'); + INSERT INTO TransactionEntry (trans_id,entry_date,voucher_ref,acc_id,amount,debit_credit,description,entry_type) VALUES + (@last_id,ed,"",copro_aid,am,'d',des,'AF'); +END; + + + + + + DROP PROCEDURE IF EXISTS rembourse_appel_fonds; + + + CREATE PROCEDURE rembourse_appel_fonds( + IN ed DATE, + IN period VARCHAR(32), + IN prod_aid INTEGER, + IN des VARCHAR(256)) + BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE am DOUBLE; + DECLARE cur1 CURSOR FOR SELECT acc_id,sum(amount) as am FROM TransactionEntry as te + JOIN Period as p on te.entry_date BETWEEN p.per_begin and p.per_end and p.per_string =period + where entry_type = "AF" and acc_id like '450%' GROUP BY acc_id; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (ed,ed,"",des); + SET @last_id = LAST_INSERT_ID(); + + OPEN cur1; + + read_loop: LOOP + FETCH cur1 INTO a, am; + IF done THEN + LEAVE read_loop; + END IF; + IF am > 0 THEN + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"RF",ed,"",prod_aid,am,'d',des); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"RF",ed,"",a,am,'c',des); + END IF; + END LOOP; + + CLOSE cur1; + END; + + + + DROP PROCEDURE IF EXISTS detail_compte_sans_solde; + + + CREATE PROCEDURE detail_compte_sans_solde(IN period VARCHAR(32), IN acc VARCHAR(32) ) + BEGIN + -- select "Compte" ; + select entry_date as Date , + voucher_ref as Ref, + description , + CASE WHEN debit_credit='d' THEN ROUND(amount,2) ELSE 0 END as Debit, + CASE WHEN debit_credit='c' THEN ROUND(amount,2) ELSE 0 END as Credit + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string =period + where acc_id=acc ORDER BY entry_date ASC; + END; + + + + DROP PROCEDURE IF EXISTS solde_compte; + + + CREATE PROCEDURE solde_compte(IN period VARCHAR(32), IN acc VARCHAR(32) ) + BEGIN + + select + ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) as Debit, + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) as Credit, + CASE WHEN + sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) > sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) > 0 + THEN + -1 * ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) + ELSE + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) + END as Solde + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string =period + where acc_id=acc ORDER BY entry_date; + + END; + + + + + DROP PROCEDURE IF EXISTS bilan; + + + CREATE PROCEDURE bilan(IN period VARCHAR(32) ) + BEGIN + select j.acc_id as Compte ,j.acc_name as Description + ,ROUND(sum(CASE WHEN r.debit_credit ='d' THEN r.amount ELSE 0 END),2) as Debit , + ROUND(sum(CASE WHEN r.debit_credit ='c' THEN r.amount ELSE 0 END),2) as Credit , + CASE + WHEN sum(CASE WHEN r.debit_credit ='d' THEN r.amount ELSE 0 END) - sum(CASE WHEN r.debit_credit ='c' THEN r.amount ELSE 0 END) > 0 THEN + ROUND( sum(CASE WHEN r.debit_credit ='d' THEN r.amount ELSE 0 END) - sum(CASE WHEN r.debit_credit ='c' THEN r.amount ELSE 0 END),2) + ELSE + ROUND( sum(CASE WHEN r.debit_credit ='c' THEN r.amount ELSE 0 END) - sum(CASE WHEN r.debit_credit ='d' THEN r.amount ELSE 0 END),2) + END + as Solde + from Account as j + JOIN TransactionEntry AS r on j.acc_id = r.acc_id + JOIN Period AS p on r.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + GROUP BY j.acc_id ; + END; + + + + DROP PROCEDURE IF EXISTS journal; + + + CREATE PROCEDURE journal(IN period VARCHAR(32),IN jrn VARCHAR(2),IN preci INTEGER ) + BEGIN + select j.entry_date as Date, j.acc_id as Compte , j.voucher_ref as Ref ,j.description as Libelle + ,ROUND((CASE WHEN j.debit_credit ='d' THEN j.amount ELSE 0 END), preci) as Debit , + ROUND((CASE WHEN j.debit_credit ='c' THEN j.amount ELSE 0 END), preci) as Credit + from TransactionEntry as j + JOIN Account AS r on j.acc_id = r.acc_id + JOIN Period AS p on j.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + WHERE j.entry_type = jrn ORDER BY j.entry_date + ; + END; + + + + DROP PROCEDURE IF EXISTS journal_solde; + + + CREATE PROCEDURE journal_solde(IN period VARCHAR(32),IN jrn VARCHAR(2),IN preci INTEGER ) + BEGIN + select ROUND(sum(CASE WHEN j.debit_credit ='d' THEN j.amount ELSE 0 END), preci) as Debit , + ROUND(sum(CASE WHEN j.debit_credit ='c' THEN j.amount ELSE 0 END), preci) as Credit + from TransactionEntry as j + JOIN Account AS r on j.acc_id = r.acc_id + JOIN Period AS p on j.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + WHERE j.entry_type = jrn + ; + END; + + + + + DROP FUNCTION IF EXISTS FctTantieme; + + + + CREATE FUNCTION FctTantieme( acc_id VARCHAR(32), + charge_key INTEGER) + RETURNS DOUBLE + NOT DETERMINISTIC + READS SQL DATA + BEGIN + DECLARE select_var DOUBLE; + SET select_var =(SELECT sum(tant_lot_size) FROM Tantieme as tant + JOIN Lot as l on l.lot_num = tant.tant_lot_num + JOIN LotsOwners as lo on lo.lo_lot_id = l.lot_id + JOIN Account as a on a.acc_id = acc_id + JOIN JoinIdentityAccount as jia on jia.jia_acc = a.acc_id and jia_ident = lo.lo_owner_id + WHERE tant_pc_id =charge_key); + IF (select_var IS NULL) THEN + RETURN 0.0 ; + ELSE + RETURN select_var ; + END IF; + END; + + + + + + DROP PROCEDURE IF EXISTS repartir_charge_global; + + + + CREATE PROCEDURE repartir_charge_global(IN dt DATE,in period TEXT) + BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE deb DOUBLE; + DECLARE cre DOUBLE; + DECLARE sol DOUBLE; + DECLARE pc INT; + DECLARE cur2 CURSOR FOR SELECT acc_id FROM Account where acc_id like "6%"; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + SET @enabled = TRUE; + OPEN cur2; + read_loop_rg : LOOP + FETCH cur2 INTO a; + IF done THEN + LEAVE read_loop_rg; + END IF; + CALL solde_compte_out(period,a,deb,cre,sol,pc); + CALL debug_msg(@enabled,CONCAT(" Process account ",a," debit=",deb," cre=",cre," solde=",sol," pc=",pc," done=",done)); + IF sol < -0.01 THEN + CALL debug_msg(@enabled,CONCAT(" Process account repartir ",deb)); + CALL repartir_trans_charge(dt,dt,a,"",deb,pc,CONCAT("Repartion Charges compte ",a," Cle: ",pc)); + END IF; + END LOOP read_loop_rg; + CLOSE cur2; + END; + + + + + + DROP PROCEDURE IF EXISTS a_nouveau; + + + CREATE PROCEDURE a_nouveau(IN dt DATE,in period TEXT) + BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE deb DOUBLE; + DECLARE cre DOUBLE; + DECLARE sol DOUBLE; + DECLARE pc INT; + DECLARE cur2 CURSOR FOR SELECT acc_id FROM Account ; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + SET @enabled = TRUE; + -- Create Transation + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + (dt,dt,"",CONCAT("Report a nouveau ",period)) + ; + SET @last_id = LAST_INSERT_ID(); + OPEN cur2; + read_loop_rg : LOOP + FETCH cur2 INTO a; + IF done THEN + LEAVE read_loop_rg; + END IF; + CALL solde_compte_out(period,a,deb,cre,sol,pc); + CALL debug_msg(@enabled,CONCAT(" Process account ",a," debit=",deb," cre=",cre," solde=",sol," pc=",pc," done=",done)); + IF sol < -0.01 THEN + CALL debug_msg(@enabled,CONCAT(" Process report débit ",deb)); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"AN",dt,"",a,ABS(sol),'d',CONCAT("Report Solde ",period)); + END IF; + IF sol > 0.01 THEN + CALL debug_msg(@enabled,CONCAT(" Process report positive ",deb)); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"AN",dt,"",a,ABS(sol),'c',CONCAT("Report Solde ",period)); + END IF; + END LOOP read_loop_rg; + CLOSE cur2; + END; + + + + DROP PROCEDURE IF EXISTS rembourse_trans_chauffage; + + + CREATE PROCEDURE rembourse_trans_chauffage( IN trs_dt DATE , + IN ed DATE, + IN chrg VARCHAR(32), + IN vouch VARCHAR(32), + in am DOUBLE, + in cle INTEGER, + in des VARCHAR(256) + ) + + BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE tant DOUBLE; + DECLARE cur1 CURSOR FOR SELECT acc_id,FctTantiemeFrac(acc_id,cle) FROM Account where acc_id like '450%'; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + ( ed,trs_dt,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,chrg,am,'d',des); + OPEN cur1; + + read_loop: LOOP + FETCH cur1 INTO a, tant; + IF done THEN + LEAVE read_loop; + END IF; + IF tant > 0 THEN + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,a,am*tant,'c',des); + END IF; + END LOOP; + + CLOSE cur1; + END; + + + + DROP PROCEDURE IF EXISTS detail_decompte_charge; + + + + CREATE PROCEDURE detail_decompte_charge( + IN user_id INTEGER, + IN poste_charge_id INTEGER, + IN period VARCHAR(32), + IN preci INTEGER) + BEGIN + SET @myAccount := (SELECT acc_id FROM Account + JOIN JoinIdentityAccount as jia on jia.jia_acc = acc_id + WHERE user_id = jia.jia_ident); + SELECT te.`entry_date` as Date, + te.acc_id as Compte, + ac.`acc_name`, + te.description, + amount as MontantTotal, + ROUND( FctTantieme(@myAccount,poste_charge_id) + ,preci) + + as Tan, + ROUND( (amount * FctTantiemeFrac(@myAccount,poste_charge_id) ) + ,preci + ) as Montant, + pc.pc_name as Cle from TransactionEntry as te + JOIN Account as ac on (ac.acc_id = te.acc_id) + JOIN PosteCharge as pc on (te.tret_key_id = pc.pc_id) + JOIN Period AS p on te.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + where te.acc_id like '6%' and te.debit_credit = 'd' and IF (poste_charge_id != 0,te.tret_key_id = poste_charge_id,1) + ORDER BY te.entry_date; + END; + + + + +DROP PROCEDURE IF EXISTS solde_compte_out; + + +CREATE PROCEDURE solde_compte_out(IN period VARCHAR(32), IN acc VARCHAR(32), OUT Debit_ DOUBLE , INOUT Credit_ DOUBLE , INOUT Solde_ DOUBLE,INOUT Pc_ INT) +BEGIN + +select + ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) as Debit, + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) as Credit, + CASE WHEN + sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) > sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) > 0 + THEN + -1 * ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2) + ELSE + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) + END as Solde , t.tret_key_id INTO Debit_, Credit_, Solde_,Pc_ + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string =period + where acc_id=acc ORDER BY entry_date LIMIT 1; + +END; + + + + + + +DROP PROCEDURE IF EXISTS solde_compte_where; + + +CREATE PROCEDURE solde_compte_where(IN period VARCHAR(32), IN crit VARCHAR(128)) +BEGIN + SET @Stm = CONCAT(" +select + COALESCE(ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2),0) as Debit, + COALESCE(ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2),0) as Credit, + CASE WHEN + sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) > sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) > 0 + THEN + COALESCE( + -1 * ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2),0) + ELSE + COALESCE( + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) , 0) + END as Solde + + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = '",period,"' + WHERE ", crit," ORDER BY entry_date;"); + PREPARE q FROM @Stm; + EXECUTE q; + DEALLOCATE PREPARE q; + +END; + + + + +DROP PROCEDURE IF EXISTS pc_per_lot; + + + CREATE PROCEDURE pc_per_lot( ) + BEGIN + SELECT + GROUP_CONCAT(DISTINCT + CONCAT('coalesce(sum(case when pc_name ="',pc_name,'" then tant_lot_size end),0) as "',pc_name,'"') + ) + INTO @sql + FROM PosteCharge; + + SET @sql = CONCAT('select tant_lot_num, ',@sql, ' + FROM Tantieme as t + JOIN PosteCharge as pc on t.tant_pc_id = pc.pc_id + GROUP BY tant_lot_num' + ); + + PREPARE Qstmt FROM @sql; + EXECUTE Qstmt; + DEALLOCATE PREPARE Qstmt; + + END; + + + +DROP PROCEDURE IF EXISTS account_delete; + + + CREATE PROCEDURE account_delete( IN acc VARCHAR(32) ) + BEGIN + +SELECT @myLeft := acc_left, @myRight := acc_right, @myWidth := acc_right - acc_left + 1 +FROM Account +WHERE acc_id = acc; + +DELETE FROM Account WHERE acc_left BETWEEN @myLeft AND @myRight; + +UPDATE Account SET acc_right = acc_right - @myWidth WHERE acc_right > @myRight; +UPDATE Account SET acc_left = acc_left - @myWidth WHERE acc_left > @myRight; + + END; + + + +DROP PROCEDURE IF EXISTS detail_decompte_solde; + + +CREATE PROCEDURE detail_decompte_solde( + IN user_id INTEGER, + IN poste_charge_id INTEGER, + IN period VARCHAR(32), + IN preci INTEGER) +BEGIN + + SET @myAccount := (SELECT acc_id FROM Account + JOIN JoinIdentityAccount as jia on jia.jia_acc = acc_id + WHERE user_id = jia.jia_ident); + SELECT + sum(amount) as MontantTotal, + ROUND( sum((amount * (FctTantiemeFrac(@myAccount,pc.pc_id) + ))) ,preci + ) as Montant + from TransactionEntry as te + JOIN Account as ac on (ac.acc_id = te.acc_id) + JOIN PosteCharge as pc on (te.tret_key_id = pc.pc_id) + JOIN Period AS p on te.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = period + where te.acc_id like '6%' and te.debit_credit = 'd' and IF (poste_charge_id != 0,te.tret_key_id = poste_charge_id,1) + ORDER BY te.entry_date; + +END; + + + + +DROP PROCEDURE IF EXISTS solde_compte_where; + + +CREATE PROCEDURE solde_compte_where(IN period VARCHAR(32), IN crit VARCHAR(128)) +BEGIN + SET @Stm = CONCAT(" +select + COALESCE(ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2),0) as Debit, + COALESCE(ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2),0) as Credit, + CASE WHEN + sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) > sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) > 0 + THEN + COALESCE( + -1 * ROUND(sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END),2),0) + ELSE + COALESCE( + ROUND(sum(CASE WHEN debit_credit='c' THEN amount ELSE 0 END) - sum(CASE WHEN debit_credit='d' THEN amount ELSE 0 END),2) , 0) + END as Solde + + from TransactionEntry as t + join Period as p on t.entry_date BETWEEN p.per_begin and p.per_end and p.per_string = '",period,"' + WHERE ", crit," ORDER BY entry_date;"); + PREPARE q FROM @Stm; + EXECUTE q; + DEALLOCATE PREPARE q; + +END; + + + + +DROP FUNCTION IF EXISTS FctTantiemeFrac; + + + +CREATE FUNCTION FctTantiemeFrac( acc_id VARCHAR(32), + charge_key INTEGER) + RETURNS DOUBLE + NOT DETERMINISTIC + READS SQL DATA +BEGIN + DECLARE select_var DOUBLE; + SET @tantTotal := (SELECT COALESCE(sum(tant_lot_size),1.0) FROM Tantieme WHERE tant_pc_id = charge_key; + SET select_var =(SELECT sum(tant_lot_size) FROM Tantieme as tant + JOIN Lot as l on l.lot_num = tant.tant_lot_num + JOIN LotsOwners as lo on lo.lo_lot_id = l.lot_id + JOIN Account as a on a.acc_id = acc_id + JOIN JoinIdentityAccount as jia on jia.jia_acc = a.acc_id and jia_ident = lo.lo_owner_id + WHERE tant_pc_id =charge_key); + IF (select_var IS NULL) THEN + RETURN 0.0 ; + ELSE + RETURN select_var / @tantTotal; + END IF; +END; + + + +DROP PROCEDURE IF EXISTS repartir_trans_charge; + + + +CREATE PROCEDURE repartir_trans_charge(IN trs_dt DATE , + IN ed DATE, + IN chrg VARCHAR(32), + IN vouch VARCHAR(32), + in am DOUBLE, + in cle INTEGER, + in des VARCHAR(256) + ) + +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE a CHAR(16); + DECLARE tant DOUBLE; + DECLARE cur1 CURSOR FOR SELECT acc_id,FctTantiemeFrac(acc_id,cle) FROM Account where acc_id like '450%'; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + INSERT INTO Transactions (voucher_date,act_trans_date,voucher_ref,trans_label) VALUES + ( ed,trs_dt,vouch,des); + SET @last_id = LAST_INSERT_ID(); + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,chrg,am,'c',des); + OPEN cur1; + + read_loop: LOOP + FETCH cur1 INTO a, tant; + IF done THEN + LEAVE read_loop; + END IF; + IF tant > 0 THEN + INSERT INTO TransactionEntry (trans_id,entry_type,entry_date,voucher_ref,acc_id,amount,debit_credit,description) VALUES + (@last_id,"OD",ed,vouch,a,am*tant,'d',des); + END IF; + END LOOP; + + CLOSE cur1; +END; + + + + +XML; + +?> diff --git a/app/compta/schema_pcmn_abrege_mysql.php b/app/compta/schema_pcmn_abrege_mysql.php new file mode 100644 index 0000000..06b0b3c --- /dev/null +++ b/app/compta/schema_pcmn_abrege_mysql.php @@ -0,0 +1,241 @@ + + + + +INSERT INTO Account (acc_id,acc_info_id,acc_balance,acc_name,acc_desc,acc_left,acc_right) VALUES ("100000",100000, 0.0,"COMPTES DE CAPITAUX","",1,2); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1","COMPTES DE CAPITAUX",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("101","Capital",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("105","Ecarts de réévaluation",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1061","Réserve légale",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1062","Réserves indisponible",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1063","Réserves statutaires ou contractuelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1064","Réserves réglementées",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("1068","Autres réserves",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("11","REPORT A NOUVEAU",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("12","RESULTAT NET DE L EXERCICE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("145","Amortissements dérogatories",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("146","Provision spéciale de réévaluation",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("147","Plus-values réinvesties",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("148","Autres provisions réglementées",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("15","PROVISIONS POUR RISQUES ET CHARGES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("16","EMPRUNTS ET DETTES ASSIMILEES",""); + + +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("2","COMPTES D'IMMOBILISATIONS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("201","Frais d'établissement",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("206","Droit au bail",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("207","Fonds commercial",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("208","Autres immobilisations incorporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("21","IMMOBILISATIONS CORPORELLES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("23","IMMOBILISATIONS EN COURS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("27","AUTRES IMMOBILISATIONS FINANCIERES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("280","Amortissements des immobilisations incorporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("281","Amortissements des immobilisations corporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("290","Provisions pour dépréciation des immobilisations incorporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("291","Provisions pour dépréciation des immobilisations corporelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("297","Provisions pour dépréciation des autres immobilisations financières",""); + +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("3","COMPTES DE STOCKS ET D'EN-COURS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("31","MATIERES PREMIERES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("32","AUTRES APPROVISIONNEMENTS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("33","EN-COURS DE PRODUCTION DE BIENS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("34","EN-COURS DE PRODUCTION DE SERVICES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("35","STOCKS DE PRODUITS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("37","STOCKS DE MARCHANDISES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("391","Provisions pour dépréciation des matières premières",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("392","Provisions pour dépréciation des autres approvisionnements",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("393","Provisions pour dépréciation des en-cours de production des biens",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("394","Provisions pour dépréciation des en-cours de production de services",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("395","Provisions pour dépréciation des stocks de produits",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("397","Provisions pour dépréciation des stocks de marchandises",""); + + +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("4","COMPTES DE TIERS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("400","Fournisseurs et Comptes rattachés",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("409","Fournisseurs débiteurs",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("410","Clients et Comptes rattachés",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("419","Clients débiteurs",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("421","Personnel - Rémunérations dues",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("428","Personnel - Charges à payer et produits à recevoir",""); + +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("43","SECURITE SOCIALE ET AUTRES ORGANISMES SOCIAUX",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("444","Etat - Impôts sur les bénéfices",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("445","Etat - Taxes sur le chiffre d'affaires",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("447","Autres impôts, taxes et versements assimilés",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("455","Associés - Comptes courants",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("46","DEBITEURS ET CREDITEURS DIVERS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("47","COMPTES TRANSITOIRES OU D'ATTENTE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("481","Charges à répartir sur plusieurs exercices",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("486","Charges constatées d'avance",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("487","Produits constatés d'avance",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("491","Provisions pour dépréciation des comptes de clients",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("496","Provisions pour dépréciation des débiteurs divers",""); +CALL account_insert_beside("","100000","400000","COMPTES DE TIERS"); + + +CALL account_insert_beside("","400000","500000","COMPTES FINANCIERS"); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("5","COMPTES FINANCIERS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("50","VALEURS MOBILIERES DE PLACEMENT",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("51","BANQUES ETABLISSEMENTS FINANCIERS ET ASSIMILES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("53","CAISSE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("54","REGIS D'AVANCES ET ACCREDITIFS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("58","VIREMENTS INTERNES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("590","Provisions pour dépréciation des valeurs mobilières de placement",""); + + +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("6","COMPTES DE CHARGES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("60","ACHATS (saufs 603)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("603","VARIATION DES STOCKS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("61","Services Exterieurs",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("62","Autres services extérieurs",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("63","IMPôTS TAXES ET VERSEMENT ASSIMILES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("641","Rémunération du personnel",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("644","Rémunération du travail de l'exploitant",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("645","Charges de sécurité sociale et de prévoyance",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("646","Cotisations sociales personnelles de l'exploitant",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("65","AUTRES CHARGES DE GESTIONS COURANTE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("66","CHARGES FINANCIERES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("67","CHARGES EXCEPTIONNELLES",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("681","Dotations aux amortissements et aux provisions - Charges d'exploitation",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("686","Dotations aux amortissements et aux provisions - Charges financières",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("687","Dotations aux amortissements et aux provisions - Charges exceptionnelles",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("691","Participation des salariés aux fruits de l'expansion",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("695","Impôts sur les bénéfices",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("697","Imposition forfaitaire annuelle des sociétés",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("699","Produits - Reports en arrière des déficits",""); +CALL account_insert_beside("","500000","600000","COMPTES DE CHARGES"); + + +CALL account_insert_beside("","600000","70","COMPTES DE PROVISION"); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("7","COMPTES DE PRODUITS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("701","Ventes de produits finis",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("706","Prestations de services",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("707","Ventes de marchandises",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("708","Produits des activités annexes",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("709","Rabais, remises et ristournes accordés par l'entreprise",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("713","VARIATION DES STOCKS (en-cours de production)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("72","PRODUCTION IMMOBILISEE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("74","SUBVENTIONS D'EXPLOITATION",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("75","AUTRES PRODUITS DE GESTION COURANTE",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("76","PRODUITS FINANCIERS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("77","PRODUITS EXCEPTIONNELS",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("781","Reprises sur amortissements et provisions (à inscrire dans les produits d'exploitation)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("786","Reprises sur provisions (à inscrire dans les produits fianciers)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("787","Reprises sur provisions (à inscrire dans les produits exceptionnels)",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("79","TRANSFERTS DE CHARGES",""); + + +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("8","COMPTES SCPECIAUX",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("80","ENGAGEMENTS HORS BILAN",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("801","Engagements donnés par l'entreprise",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("802","Engagements reçus par l'entreprise",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("809","Contrepartie des engagements",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("88","RESULTAT EN INSTANCE D'AFFECTATION",""); +INSERT INTO Pcg (pcg_acc,pcg_acc_name,pcg_acc_type) VALUES ("89","BILAN",""); + + + +CALL account_insert_below("","400000","401000","Fournisseurs"); + + + +CALL account_insert_below("","100000","103000","Avances"); + + +CALL account_insert_below("","103000","103100","Avances de tresorerie"); + + + +CALL account_insert_beside("","401000","450000","Collectivite des Coproprietaires"); + + +CALL account_insert_beside("","450000","460000","DEBITEURS ET CREDITEURS DIVERS"); + + + +CALL account_insert_below("","460000","461000","Debiteur Divers"); + + +CALL account_insert_beside("","461000","462000","Credit Divers"); + + + +CALL account_insert_below("","500000","512000","BANQUES"); + + +CALL account_insert_below("","600000","601000","Eau"); + + +CALL account_insert_beside("","601000","602000","Electricite"); + + +CALL account_insert_beside("","602000","603000","Chauffage, energie et combustible"); + + +CALL account_insert_beside("","603000","604000","Achat produits d'entretien"); + + +CALL account_insert_beside("","604000","605000","Materiel"); + + +CALL account_insert_beside("","605000","606000","Fourniture"); + + +CALL account_insert_beside("","606000","611000","Nettoyage des locaux"); + + +CALL account_insert_beside("","611000","614000","Control de maintenance"); + + +CALL account_insert_beside("","614000","615000","Entretien et petites reparations"); + + +CALL account_insert_beside("","615000","616000","Prime d'assurance"); + + +CALL account_insert_beside("","616000","620000","Frais d'administration"); + + +CALL account_insert_beside("","620000","621300","Frais postaux"); + + +CALL account_insert_beside("","621300","622200","Prestation particulière"); + + +CALL account_insert_beside("","622200","622300","Autres honoraires"); + + +CALL account_insert_beside("","622300","671000","Travaux decides par assemblee generale"); + + +CALL account_insert_beside("","671000","672000","Travaux urgents"); + + +CALL account_insert_below("","70","700000","Appels de fonds"); + + + +CALL account_insert_beside("","700000","701000","Provision sur operations courantes"); + + +CALL account_insert_beside("","701000","702000","Provision sur travaux de l'article 14.2"); + + +CALL account_insert_beside("","702000","703000","Avances"); + + +CALL account_insert_beside("","703000","714000","Produits divers"); + + +XML; +?> diff --git a/app/compta/schema_pcmn_syndic_mysql.php b/app/compta/schema_pcmn_syndic_mysql.php new file mode 100644 index 0000000..900021e --- /dev/null +++ b/app/compta/schema_pcmn_syndic_mysql.php @@ -0,0 +1,124 @@ + + + + + INSERT INTO Account (acc_id,acc_info_id,acc_balance,acc_name,acc_desc,acc_left,acc_right) VALUES ("100000",100000, 0.0,"COMPTES DE CAPITAUX","",1,2); + + +CALL account_insert_beside("","100000","400000","COMPTES DE TIERS"); + + +CALL account_insert_beside("","400000","500000","COMPTES FINANCIERS"); + + +CALL account_insert_beside("","500000","600000","COMPTES DE CHARGES"); + + +CALL account_insert_beside("","600000","70","COMPTES DE PROVISION"); + + + +CALL account_insert_below("","400000","401000","Fournisseurs"); + + + +CALL account_insert_below("","100000","103000","Avances"); + + +CALL account_insert_below("","103000","103100","Avances de tresorerie"); + + + +CALL account_insert_beside("","401000","450000","Collectivite des Coproprietaires"); + + +CALL account_insert_beside("","450000","460000","DEBITEURS ET CREDITEURS DIVERS"); + + + +CALL account_insert_below("","460000","461000","Debiteur Divers"); + + +CALL account_insert_beside("","461000","462000","Credit Divers"); + + + +CALL account_insert_below("","500000","512000","BANQUES"); + + +CALL account_insert_below("","600000","601000","Eau"); + + +CALL account_insert_beside("","601000","602000","Electricite"); + + +CALL account_insert_beside("","602000","603000","Chauffage, energie et combustible"); + + +CALL account_insert_beside("","603000","604000","Achat produits d'entretien"); + + +CALL account_insert_beside("","604000","605000","Materiel"); + + +CALL account_insert_beside("","605000","606000","Fourniture"); + + +CALL account_insert_beside("","606000","611000","Nettoyage des locaux"); + + +CALL account_insert_beside("","611000","614000","Control de maintenance"); + + +CALL account_insert_beside("","614000","615000","Entretien et petites reparations"); + + +CALL account_insert_beside("","615000","616000","Prime d'assurance"); + + +CALL account_insert_beside("","616000","620000","Frais d'administration"); + + +CALL account_insert_beside("","620000","621300","Frais postaux"); + + +CALL account_insert_beside("","621300","622200","Prestation particulière"); + + +CALL account_insert_beside("","622200","622300","Autres honoraires"); + + +CALL account_insert_beside("","622300","671000","Travaux decides par assemblee generale"); + + +CALL account_insert_beside("","671000","672000","Travaux urgents"); + + +CALL account_insert_below("","70","700000","Appels de fonds"); + + + +CALL account_insert_beside("","700000","701000","Provision sur operations courantes"); + + +CALL account_insert_beside("","701000","702000","Provision sur travaux de l'article 14.2"); + + +CALL account_insert_beside("","702000","703000","Avances"); + + +CALL account_insert_beside("","703000","714000","Produits divers"); + + +XML; +?> diff --git a/app/compta/services.js b/app/compta/services.js new file mode 100644 index 0000000..d19132a --- /dev/null +++ b/app/compta/services.js @@ -0,0 +1,524 @@ +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Services; + (function (Services) { + class ReqOptions { + constructor() { + this.limit = 15; + this.offset = 0; + } + } + class EmptyReqParams { + constructor() { + this.json = () => { return {}; }; + } + } + Services.EmptyReqParams = EmptyReqParams; + class DummyReqParams { + constructor(_p = "") { + this._dummy = _p; + console.log('DummyReqParams : ' + this._dummy); + this.json = () => { + var res = { "dummy": "" }; + console.log('DummyReqParam.json : '); + return res; + }; + } + get dummy() { return this._dummy; } + set dummy(_v) { this._dummy = _v; } + } + Services.DummyReqParams = DummyReqParams; + class ReqTwoParams { + constructor(p1 = "", p2 = "") { + this._p1 = p1; + this._p2 = p2; + console.log('ReqTwoParams : p1=' + p1 + " p2=" + p2); + this.json = () => { + console.log('ReqTwoParam.json : '); + return {}; + }; + } + get p1() { return this._p1; } + set p1(_v) { this._p1 = _v; } + get p2() { return this._p2; } + set p2(_v) { this._p2 = _v; } + } + Services.ReqTwoParams = ReqTwoParams; + class ReqThreeParams extends ReqTwoParams { + constructor(p1 = "", p2 = "", p3 = "") { + super(p1, p2); + this._p3 = p3; + console.log('ReqThreeParams :' + " p3=" + p3); + } + get p3() { return this._p3; } + set p3(_v) { this._p3 = _v; } + } + Services.ReqThreeParams = ReqThreeParams; + class ReqFourParams extends ReqThreeParams { + constructor(p1 = "", p2 = "", p3 = "", p4 = "") { + super(p1, p2, p3); + this._p4 = p4; + console.log('ReqFourParams :' + " p4=" + p4); + } + get p4() { return this._p4; } + set p4(_v) { this._p4 = _v; } + } + Services.ReqFourParams = ReqFourParams; + class ReqFiveParams extends ReqFourParams { + constructor(p1 = "", p2 = "", p3 = "", p4 = "", p5 = "") { + super(p1, p2, p3, p4); + this._p5 = p5; + console.log('ReqFiveParams : p3=' + p3 + ' p4=' + p4 + " p5=" + p5); + } + get p5() { return this._p5; } + set p5(_v) { this._p5 = _v; } + } + Services.ReqFiveParams = ReqFiveParams; + class ReqSixParams extends ReqFiveParams { + constructor(p1 = "", p2 = "", p3 = "", p4 = "", p5 = "", p6 = "") { + super(p1, p2, p3, p4, p5); + this._p6 = p6; + console.log('ReqThreeParams :' + " p6=" + p6); + } + get p6() { return this._p6; } + set p6(_v) { this._p6 = _v; } + } + Services.ReqSixParams = ReqSixParams; + class ReqSevenParams extends ReqSixParams { + constructor(p1 = "", p2 = "", p3 = "", p4 = "", p5 = "", p6 = "", p7 = "") { + super(p1, p2, p3, p4, p5, p6); + this._p7 = p7; + console.log('ReqSevenParams :' + " p7=" + p7); + } + get p7() { return this._p7; } + set p7(_v) { this._p7 = _v; } + } + Services.ReqSevenParams = ReqSevenParams; + class ReqHeightParams extends ReqSevenParams { + constructor(p1 = "", p2 = "", p3 = "", p4 = "", p5 = "", p6 = "", p7 = "", p8 = "") { + super(p1, p2, p3, p4, p5, p6, p7); + this._p8 = p8; + console.log('ReqSevenParams :' + " p8=" + p8); + } + get p8() { return this._p8; } + set p8(_v) { this._p8 = _v; } + } + Services.ReqHeightParams = ReqHeightParams; + class TransactionsReqParams { + constructor(_type, _amount, _offset) { + this._type = _type; + this._amount = _amount; + this._offset = _offset; + console.log('TransactionsReqParams : ' + _type + " " + _amount + " " + _offset); + this.json = () => { + var res = { "_type": _type, "_amount": _amount, "_offset": _offset }; + return res; + }; + } + } + Services.TransactionsReqParams = TransactionsReqParams; + class UserRoleReqParams { + constructor(_id, _user, _role) { + this._id = _id; + this._user = _user; + this._role = _role; + console.log('UserRoleReqParams : ' + _id + " " + _user + " " + _role); + this.json = () => { + var res = { "dummy": "" }; + return res; + }; + } + get id() { return this._id; } + set id(_v) { this._id = _v; } + get user() { return this._user; } + set user(_v) { this._user = _v; } + get role() { return this._role; } + set role(_v) { this._role = _v; } + } + Services.UserRoleReqParams = UserRoleReqParams; + class AccountListReqParams { + constructor(_cat, _tree = 0) { + var obj = this; + console.log('AcountListReqParams : ' + _cat + " tree=" + _tree); + obj._categorie = _cat; + obj._tree = _tree; + } + get categorie() { + return this._categorie; + } + get tree() { + return this._tree; + } + } + Services.AccountListReqParams = AccountListReqParams; + class AddAccountReqParams { + constructor(_acc, _lib, _par) { + this._acc = _acc; + this._lib = _lib; + this._par = _par; + console.log('AddAccountReqParams : ' + _acc + " " + _lib); + this.json = () => { + var res = { "dummy": "" }; + return res; + }; + } + get acc() { return this._acc; } + set acc(_v) { this._acc = _v; } + get lib() { return this._lib; } + set lib(_v) { this._lib = _v; } + } + Services.AddAccountReqParams = AddAccountReqParams; + class EntriesReqParams { + constructor(_period, _acc) { + this._period = _period; + this._acc_id = _acc; + this.options = new ReqOptions(); + this.options.limit = 15; + this.options.offset = 0; + var obj = this; + this.json = () => { + var res = { "period": obj._period, + "acc_id": obj._acc_id, + "opt": obj.options + }; + console.log('EntrieReqParam.json : ' + obj.acc_id + "%o", obj.options); + return res; + }; + } + get period() { return this._period; } + set period(_v) { this._period = _v; } + get acc_id() { return this._acc_id; } + set acc_id(_v) { this._acc_id = _v; } + } + Services.EntriesReqParams = EntriesReqParams; + class ExCreateReqParams extends EmptyReqParams { + constructor(_desc, _debut, _fin) { + super(); + this._desc = _desc; + this._debut = _debut; + this._fin = _fin; + } + get desc() { return this._desc; } + set desc(_v) { this._desc = _v; } + } + Services.ExCreateReqParams = ExCreateReqParams; + class SetTantiemeReqParams { + constructor(_id, _chrg_id, _lot, _tant) { + this._id = _id; + this._charge_id = _chrg_id; + this._lot = _lot; + this._tant = _tant; + console.log('SetTantiemeReqParams : ' + _id + " " + _tant); + this.json = () => { + var res = { "dummy": "" }; + return res; + }; + } + get id() { return this._id; } + set id(_v) { this._id = _v; } + get charge_id() { return this._charge_id; } + set charge_id(_v) { this._charge_id = _v; } + get lot() { return this._lot; } + set lot(_v) { this._lot = _v; } + get tant() { return this._tant; } + set tant(_v) { this._tant = _v; } + } + Services.SetTantiemeReqParams = SetTantiemeReqParams; + class Organisation { + constructor(_title, _adress, _cp, _ville) { + this.title = _title; + this.cp = _cp; + this.ville = _ville; + this.adress = _adress; + } + isValid() { + return !(this.title == "" + || this.adress == "" + || this.cp == "" + || this.ville == ""); + } + } + Services.Organisation = Organisation; + ; + class CreateOrgReqParams { + constructor(_org) { + this._ident = _org; + } + get org() { return this._ident; } + set org(_v) { this._ident = _v; } + } + Services.CreateOrgReqParams = CreateOrgReqParams; + class structUser { + constructor(_name, _firstname, _address, _code, _ville, _email1) { + this.name = _name; + this.firstname = _firstname; + this.code = _code; + this.ville = _ville; + this.address = _address; + this.email1 = _email1; + } + } + Services.structUser = structUser; + ; + class UserReqParams { + constructor(_org, _ident, _update = false) { + this._org = _org; + this._ident = _ident; + this._update = _update; + } + get user() { return this._ident; } + set user(_v) { this._ident = _v; } + get update() { return this._update; } + set update(_v) { this._update = _v; } + get org() { return this._org; } + set org(_v) { this._org = _v; } + } + Services.UserReqParams = UserReqParams; + class PlanComptable { + constructor(_req) { + this._requester = _req; + this._service = "pcmn"; + } + getAccountList(_param, _onSuccess, _onFailure) { + console.log(this._service + ":getAccountList :" + _param.categorie, _param.tree); + this._requester.handlefct(this._service, 'getAccountList', _param, _onSuccess, _onFailure); + } + getFournisseur(_param, _onSuccess, _onFailure) { + console.log("PlanComptable:getFournisseur"); + this._requester.handlefct(this._service, 'getFournisseur', _param, _onSuccess, _onFailure); + } + getBilan(_param, _onSuccess, _onFailure) { + console.log("PlanComptable:getBilan " + _param.dummy); + this._requester.handlefct(this._service, 'getBilan', _param, _onSuccess, _onFailure); + } + getAccountInfo(_param, _onSuccess, _onFailure) { + console.log("PlanComptable:getAccountInfo " + _param.dummy); + this._requester.handlefct(this._service, 'getAccountInfo', _param, _onSuccess, _onFailure); + } + addAccount(_param, _onSuccess, _onFailure) { + console.log("PlanComptable:addAccount " + _param.acc); + this._requester.handlefct(this._service, 'addAccount', _param, _onSuccess, _onFailure); + } + updateAccountName(_param, _onSuccess, _onFailure) { + console.log("PlanComptable:updateAccountName " + _param.p1 + " " + _param.p2); + this._requester.handlefct(this._service, 'updateAccountName', _param, _onSuccess, _onFailure); + } + deleteAccount(_param, _onSuccess, _onFailure) { + console.log("PlanComptable:deleteAccount " + _param.dummy); + this._requester.handlefct(this._service, 'deleteAccount', _param, _onSuccess, _onFailure); + } + } + Services.PlanComptable = PlanComptable; + class Booking { + constructor(_req) { + this._requester = _req; + this._service = "booking"; + } + postTransaction(_param, _onSuccess, _onFailure) { + console.log("Booking:postTransaction:"); + this._requester.handlefct(this._service, 'postTransaction', _param, _onSuccess, _onFailure); + } + AppelFonds(_param, _onSuccess, _onFailure) { + console.log("Booking:AppelFonds: "); + this._requester.handlefct(this._service, 'appelFonds', _param, _onSuccess, _onFailure); + } + newBill(_param, _onSuccess, _onFailure) { + console.log("Booking:payeBill: " + _param.transi.amount); + this._requester.handlefct(this._service, 'newBill', _param, _onSuccess, _onFailure); + } + payBill(_param, _onSuccess, _onFailure) { + console.log("Booking:payBill: " + _param.transi.amount); + this._requester.handlefct(this._service, 'payBill', _param, _onSuccess, _onFailure); + } + Versement(_param, _onSuccess, _onFailure) { + console.log("VBooking:Versement: " + _param.transi.amount); + this._requester.handlefct(this._service, 'Versement', _param, _onSuccess, _onFailure); + } + } + Services.Booking = Booking; + class Retrieve { + constructor(_req) { + this._requester = _req; + this._service = "retrieve"; + } + getTransaction(_param, _onSuccess, _onFailure) { + console.log("Retrieve:getTransaction:"); + this._requester.handlefct(this._service, 'getTransaction', _param, _onSuccess, _onFailure); + } + getTransactionByType(_param, _onSuccess, _onFailure) { + console.log("Retrieve:getTransactionByType .. :" + " " + _param.json()); + this._requester.handlefct(this._service, 'getTransactionByType', _param, _onSuccess, _onFailure); + } + getTransactionByDate(_param, _onSuccess, _onFailure) { + console.log("Retrieve:getTransactionByDate:" + _param); + this._requester.handlefct(this._service, 'getTransactionByDate', _param, _onSuccess, _onFailure); + } + getEntriesByAccount(_param, _onSuccess, _onFailure) { + console.log("Retrieve:getEntriesByAccount:" + _param.period + " " + _param.acc_id); + this._requester.handlefct(this._service, 'getEntriesByAccount', _param, _onSuccess, _onFailure); + } + getSoldeAccount(_param, _onSuccess, _onFailure) { + console.log("Retrieve:getSoldeAccount:" + _param.period + " " + _param.acc_id); + this._requester.handlefct(this._service, 'getSoldeAccount', _param, _onSuccess, _onFailure); + } + getEntryTypes(_param, _onSuccess, _onFailure) { + console.log("Retrieve:getEntryTypes: empty parameter"); + this._requester.handlefct(this._service, 'getEntryTypes', _param, _onSuccess, _onFailure); + } + getEntriesByType(_param, _onSuccess, _onFailure) { + console.log("Retrieve:getEntriesByType:" + _param.period + " " + _param.acc_id + " limit:" + _param.options.limit); + this._requester.handlefct(this._service, 'getEntriesByType', _param, _onSuccess, _onFailure); + } + } + Services.Retrieve = Retrieve; + class Users { + constructor(_req) { + this._requester = _req; + this._service = "ident"; + } + getCoproprietaires(_param, _onSuccess, _onFailure) { + console.log("USers:getCoproprietaire:" + _param); + this._requester.handlefct('syndic', 'getCoproprietaires', _param, _onSuccess, _onFailure); + } + associateAccount(_param, _onSuccess, _onFailure) { + console.log("Users:associateAccount : uid=" + _param.p1 + " acc=" + _param.p2 + " assoc=" + _param.p3); + this._requester.handlefct('syndic', 'associateUserAccount', _param, _onSuccess, _onFailure); + } + addInOrg(_param, _onSuccess, _onFailure) { + console.log("Users:addInOrg:" + _param.user.name); + this._requester.handlefct(this._service, 'addUserInOrg', _param, _onSuccess, _onFailure); + } + getByRole(_param, _onSuccess, _onFailure) { + console.log("Users:getByRole:" + _param.dummy); + this._requester.handlefct(this._service, 'getUsersRole', _param, _onSuccess, _onFailure); + } + setRole(_param, _onSuccess, _onFailure) { + console.log("Users:setRole:"); + this._requester.handlefct(this._service, 'setUserRole', _param, _onSuccess, _onFailure); + } + resetRole(_param, _onSuccess, _onFailure) { + console.log("Users:setRole:"); + this._requester.handlefct(this._service, 'resetUserRole', _param, _onSuccess, _onFailure); + } + Organisations(_param, _onSuccess, _onFailure) { + console.log("Users:Organisations:"); + this._requester.handlefct(this._service, 'getApplicationDbs', _param, _onSuccess, _onFailure); + } + switchOrg(_param, _onSuccess, _onFailure) { + console.log("Users:switchOrg:" + _param.dummy); + this._requester.handlefct(this._service, 'switchOrg', _param, _onSuccess, _onFailure); + } + currentOrg(_param, _onSuccess, _onFailure) { + console.log("Users:currentOrg:" + _param.dummy); + this._requester.handlefct(this._service, 'currentOrg', _param, _onSuccess, _onFailure); + } + createOrg(_param, _onSuccess, _onFailure) { + console.log("Users:createOrg:"); + this._requester.handlefct(this._service, 'createOrg', _param, _onSuccess, _onFailure); + } + } + Services.Users = Users; + class Exercice { + constructor(_req) { + this._requester = _req; + this._service = "exercice"; + } + create(_param, _onSuccess, _onFailure) { + console.log("Exercice::create " + _param.desc); + this._requester.handlefct(this._service, 'create', _param, _onSuccess, _onFailure); + } + remove(_param, _onSuccess, _onFailure) { + console.log("Exercice:remove:" + _param); + this._requester.handlefct(this._service, 'remove', _param, _onSuccess, _onFailure); + } + list(_param, _onSuccess, _onFailure) { + console.log("Exercice::list " + _param.dummy); + this._requester.handlefct(this._service, 'getAll', _param, _onSuccess, _onFailure); + } + details(_param, _onSuccess, _onFailure) { + console.log("Exercice::details " + _param.dummy); + this._requester.handlefct(this._service, 'getDetails', _param, _onSuccess, _onFailure); + } + closing(_param, _onSuccess, _onFailure) { + console.log("Exercice:closing:" + _param.dummy); + this._requester.handlefct(this._service, 'closing', _param, _onSuccess, _onFailure); + } + setCurrent(_param, _onSuccess, _onFailure) { + console.log("Exercice:setCurrent:" + _param.dummy); + this._requester.handlefct(this._service, 'setCurrent', _param, _onSuccess, _onFailure); + } + repartirCharge(_param, _onSuccess, _onFailure) { + console.log("Exercice::repartirCharges"); + this._requester.handlefct(this._service, 'repartirCharges', _param, _onSuccess, _onFailure); + } + } + Services.Exercice = Exercice; + class Lots { + constructor(_req) { + this._requester = _req; + this._service = "syndic"; + } + list(_param, _onSuccess, _onFailure) { + console.log("Lots::list " + _param.dummy); + this._requester.handlefct(this._service, 'getLots', _param, _onSuccess, _onFailure); + } + add(_param, _onSuccess, _onFailure) { + console.log("Lots::add " + _param.p1 + " " + _param.p2); + this._requester.handlefct(this._service, 'addLot', _param, _onSuccess, _onFailure); + } + remove(_param, _onSuccess, _onFailure) { + console.log("Lots::remove" + _param.dummy); + this._requester.handlefct(this._service, 'removeLot', _param, _onSuccess, _onFailure); + } + fromUser(_param, _onSuccess, _onFailure) { + console.log("Lots:fromUser:" + _param.dummy); + this._requester.handlefct(this._service, 'getLotsUser', _param, _onSuccess, _onFailure); + } + assignToUser(_param, _onSuccess, _onFailure) { + console.log("Lots:assignToUser:" + _param); + this._requester.handlefct(this._service, 'assignLotToUser', _param, _onSuccess, _onFailure); + } + getKeysCharge(_param, _onSuccess, _onFailure) { + console.log("Lots:details:" + _param.dummy); + this._requester.handlefct(this._service, 'getKeysCharge', _param, _onSuccess, _onFailure); + } + getTantieme(_param, _onSuccess, _onFailure) { + console.log("Lots:getTantieme:" + _param.dummy); + this._requester.handlefct(this._service, 'getTantieme', _param, _onSuccess, _onFailure); + } + setTantieme(_param, _onSuccess, _onFailure) { + console.log("Lots:setTantieme:" + _param.tant); + this._requester.handlefct(this._service, 'setTantieme', _param, _onSuccess, _onFailure); + } + } + Services.Lots = Lots; + class Budget { + constructor(_req) { + this._requester = _req; + this._service = "budget"; + } + list(_param, _onSuccess, _onFailure) { + console.log("Budget:list "); + this._requester.handlefct(this._service, 'getBudgets', _param, _onSuccess, _onFailure); + } + remove(_param, _onSuccess, _onFailure) { + console.log("Budget:remove "); + this._requester.handlefct(this._service, 'removeBudget', _param, _onSuccess, _onFailure); + } + add(_param, _onSuccess, _onFailure) { + console.log("Budget:remove "); + this._requester.handlefct(this._service, 'addBudget', _param, _onSuccess, _onFailure); + } + getEntries(_param, _onSuccess, _onFailure) { + console.log("Budget:getEntries p1=" + _param.p1 + " p2=" + _param.p2); + this._requester.handlefct(this._service, 'getBudgetEntries', _param, _onSuccess, _onFailure); + } + addEntry(_param, _onSuccess, _onFailure) { + console.log("Budget:addEntry p1=" + _param.p1 + " p2=" + _param.p2); + this._requester.handlefct(this._service, 'addBudgetEntry', _param, _onSuccess, _onFailure); + } + } + Services.Budget = Budget; + })(Services = exports.Services || (exports.Services = {})); +}); diff --git a/app/compta/services.php b/app/compta/services.php new file mode 100644 index 0000000..1e33372 --- /dev/null +++ b/app/compta/services.php @@ -0,0 +1,117 @@ +get('/',"compta#index")->setRoot($ctrl_dir); +$r->get('/index',"compta#index")->setRoot($ctrl_dir); + +/* Organisation */ +$r->get('/org',"org#index")->setRoot($ctrl_dir); +$r->get('/org/index',"org#index")->setRoot($ctrl_dir); +$r->get('/org/add',"org#add")->setRoot($ctrl_dir); +$r->get('/org/users',"org#users")->setRoot($ctrl_dir); +$r->post('/org/addPost',"org#addPost" ) ->setRoot($ctrl_dir); +$r->post('/org/addCsv',"org#addCsv" ) ->setRoot($ctrl_dir); + +/* Lots and postes charge */ +$r->get('/lot',"lot#index")->setRoot($ctrl_dir); +$r->get('/lot/add',"lot#add")->setRoot($ctrl_dir); +$r->post('/lot/addPost',"lot#addPost")->setRoot($ctrl_dir); +$r->get('/lot/remove/?:id',"lot#remove")->setRoot($ctrl_dir); +$r->get('/lot/attribuer/',"lot#attribuer")->setRoot($ctrl_dir); +$r->get('/lot/associate/?:id/?:owner',"lot#index")->setRoot($ctrl_dir); +$r->get('/lot/dissociate/?:id/?:owner',"lot#index")->setRoot($ctrl_dir); +$r->get('/lot/update/?:id',"lot#update")->setRoot($ctrl_dir); +$r->post('/lot/updatePost',"lot#updatePost")->setRoot($ctrl_dir); + +/* Bank services*/ +$r->get('/bank',"bank#index")->setRoot($ctrl_dir); +$r->get('/bank/index',"bank#index")->setRoot($ctrl_dir); +$r->get('/bank/add',"bank#add")->setRoot($ctrl_dir); +$r->get('/bank/retour',"bank#index") ->setRoot($ctrl_dir); +$r->get('/bank/upload',"bank#upload") ->setRoot($ctrl_dir); +$r->post('/bank/uploadOFX',"bank#uploadOFX" ) ->setRoot($ctrl_dir); + + +/* chart of Account services*/ +$r->get('/chart',"chart#index")->setRoot($ctrl_dir); +$r->get('/chart/detail/?:id',"chart#detail")->setRoot($ctrl_dir); +$r->get('/chart/classes/?:id',"chart#classes")->setRoot($ctrl_dir); +$r->get('/chart/acount/?:id',"chart#account")->setRoot($ctrl_dir); + +/* Account services*/ +$r->get('/account',"account#index")->setRoot($ctrl_dir); +$r->get('/account/detail/?:id',"account#detail")->setRoot($ctrl_dir); + +/* exercice */ +$r->get('/exercice',"exercice#index")->setRoot($ctrl_dir); +$r->get('/exercice/',"exercice#index")->setRoot($ctrl_dir); +$r->get('/exercice/select/?:id',"exercice#select")->setRoot($ctrl_dir); +$r->get('/exercice/cloture/?:id',"exercice#cloture")->setRoot($ctrl_dir); +$r->get('/exercice/add',"exercice#add")->setRoot($ctrl_dir); +$r->post('/exercice/addPost',"exercice#Post")->setRoot($ctrl_dir); +$r->get('/exercice/detail/?:id',"exercice#detail")->setRoot($ctrl_dir); + + +/* Pret services*/ +$r->get('/loan',"loan#index")->setRoot($ctrl_dir); +$r->get('/loan/index',"loan#index")->setRoot($ctrl_dir); +$r->get('/loan/payer/?:id',"loan#payer")->setRoot($ctrl_dir); +$r->post('/loan/payerPost',"loan#payerPost")->setRoot($ctrl_dir); +$r->get('/loan/detail/?:id',"loan#detail")->setRoot($ctrl_dir); +$r->get('/loan/nouveau',"loan#nouveau")->setRoot($ctrl_dir); + +/* Recurrent services*/ +$r->get('/recurrent',"recurrent#index")->setRoot($ctrl_dir); +$r->get('/recurrent/index',"recurrent#index")->setRoot($ctrl_dir); +$r->get('/recurrent/detail/?:id',"recurrent#detail")->setRoot($ctrl_dir); +$r->get('/recurrent/update/?:id',"recurrent#update")->setRoot($ctrl_dir); +$r->post('/recurrent/updatePost',"recurrent#updatePost" ) ->setRoot($ctrl_dir); +$r->get('/recurrent/payer/?:id',"recurrent#payer")->setRoot($ctrl_dir); +$r->get('/recurrent/nouveau',"recurrent#nouveau")->setRoot($ctrl_dir); +$r->post('/recurrent/nouveauPost',"recurrent#nouveauPost" ) ->setRoot($ctrl_dir); + +/* journal */ +$r->get('/jrnx',"jrnx#index")->setRoot($ctrl_dir); +$r->get('/jrnx/',"jrnx#index")->setRoot($ctrl_dir); +$r->get('/jrnx/list',"jrnx#list")->setRoot($ctrl_dir); +$r->get('/jrnx/detail/?:id',"jrnx#detail")->setRoot($ctrl_dir); +$r->get('/jrnx/detailMonth/?:id',"jrnx#detailMonth")->setRoot($ctrl_dir); + +/* transaction */ +$r->get('/transaction',"transaction#index")->setRoot($ctrl_dir); +$r->get('/transaction/',"transaction#index")->setRoot($ctrl_dir); +$r->get('/transaction/nouveau',"transaction#nouveau")->setRoot($ctrl_dir); +$r->get('/transaction/detail',"transaction#detail")->setRoot($ctrl_dir); +$r->get('/transaction/update/?:id',"transaction#update")->setRoot($ctrl_dir); +$r->post('/transaction/updatePost',"transaction#updatePost")->setRoot($ctrl_dir); + +/* Bilan services*/ +$r->get('/bilan',"bilan#index")->setRoot($ctrl_dir); +$r->get('/bilan/index',"bilan#index")->setRoot($ctrl_dir); +$r->get('/bilan/synthese',"bilan#synthese")->setRoot($ctrl_dir); + +/* Budget services*/ +$r->get('/budget',"budget#index")->setRoot($ctrl_dir); +$r->get('/budget/index',"budget#index")->setRoot($ctrl_dir); +$r->get('/budget/detail/?:id',"budget#detail")->setRoot($ctrl_dir); +$r->get('/budget/nouveau',"budget#nouveau")->setRoot($ctrl_dir); +$r->get('/budget/update',"budget#update")->setRoot($ctrl_dir); +$r->post('/budget/updatePost',"budget#updatePost")->setRoot($ctrl_dir); + +/* Admin services*/ +$r->get('/admin',"admin#index")->setRoot($ctrl_dir); +$r->get('/admin/index',"admin#index")->setRoot($ctrl_dir); + +/** + * Run router + */ + $r->run()->render(); +?> diff --git a/app/compta/session.php b/app/compta/session.php new file mode 100644 index 0000000..447d5f8 --- /dev/null +++ b/app/compta/session.php @@ -0,0 +1,137 @@ +conf_auth = $cfg; + $this->dbSession = new DbSessions($this->conf_auth,$req_file); + parent::__construct($this->dbSession); + if ($this->is_logged_in()) { + $this->setCompta(); + } + } + + /** + * @brief return the appropriate service level + * At least figure out if the user is authenticated or not. + * Is he part of an accounting. What's his role in that accounting system. + * + */ + function getServiceLevel() { + return SL_SYNDIC; + } + + /** + * @brief set default compta parameters if not set + */ + function setCompta() { + global $_SESSION; + if (! isset ($_SESSION['compta_db'])) { + $y = date('Y'); + require_once(dirname(__FILE__)."/../member/class.json_db_user.php"); + $u = new JsonUser($this, $this->conf_auth); + $dbs = $u->getApplicationDbs(); + $this->compta_db = $_SESSION["compta_db"] = $dbs[0][2]; + $this->compta_name = $_SESSION["compta_name"] = $dbs[0][1]; + $this->compta_id = $_SESSION["compta_org"] = $dbs[0][0]; + //error_log("SessionCompta:setCompta Org id :".$dbs[0][0]." Name=".$dbs[0][1]." Db Name=".$dbs[0][2]); + $this->roles = $u->getUserRolesInOrg( $this->id(),$_SESSION['compta_org']); + try { + $this->org = $u->getOrg($this->compta_id)[0]; + } catch (Exception $e) { + $this->org = null; + } + // Update Session Db + $this->setCurrentExercice($y); + $this->setOrganizationId($dbs[0][0]); + } else { + /* Ok, refresh in case the user updated the configuration */ + $cc = $this->dbSession->getOrganization($this->user_token); + if ( $cc[0] != 0) { + require_once(dirname(__FILE__)."/../member/class.json_db_user.php"); + $u = new JsonUser($this, $this->conf_auth); + $o = $u->getOrg($cc[0]); + //error_log("SessionCompta:setCompta Org id :".$cc[0]." update" ); + try { + $this->org = $o[0]; + $this->compta_db = $o[0][5]; + $this->compta_name = $o[0][0]; + $_SESSION["compta_db"] = $o[0][5]; + $_SESSION["compta_name"] = $o[0][0]; + } catch (Exception $e) { + error_log("Session failed retrieve Org"); + $this->org = null; + $this->compta_db = ""; + $this->compta_name = ""; + } + $this->compta_id = $cc[0]; + $this->compta_exer = $cc[1]; + $_SESSION["compta_org"] = $cc[0]; + } + } + } + + /** + * @brief return database name + */ + function getDb() { return $this->compta_db ; } + + /** + * @brief return Organization Id + */ + function getOrganizationId() { return $this->compta_id ; } + + /** + * @brief return Organization Id + */ + function getOrganization() { return $this->org ; } + /** + * @brief Set Organization Id + */ + function setOrganizationId($id) { + $this->dbSession->updateSession($this->user_token,"organization",$id); + $this->compta_id =$id; + } + + /** + * @brief return Organization Id + */ + function getCurrentExercice() { return $this->compta_exer ; } + + /** + * @brief Update Exercice Id in session object + */ + function setCurrentExercice( $n_exer) { + $this->dbSession->updateSession($this->user_token,"exercice",$n_exer); + $this->compta_exer = $n_exer; + } + function in_groupe($name) { + return in_array($name,$_SESSION['user_groupe_name']); + } +} + + +?> diff --git a/app/compta/supplier.js b/app/compta/supplier.js new file mode 100644 index 0000000..490176e --- /dev/null +++ b/app/compta/supplier.js @@ -0,0 +1,479 @@ +define(["require", "exports", "./Dialog", "./transaction", "./services"], function (require, exports, Dialog_1, transaction_1, services_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Supplier; + (function (Supplier_1) { + class TransactionBill extends transaction_1.Ledger.Transaction { + constructor(_tp) { + super(_tp, "suppl"); + } + getInfo(pref) { + var info = new transaction_1.Ledger.TransactionInfoBill(pref); + console.log("TransactionBill::getInfo"); + return info; + } + } + class TransactionPaye extends transaction_1.Ledger.Transaction { + constructor(_tp) { + super(_tp, "suppl"); + } + getInfo(pref) { + var info = new transaction_1.Ledger.TransactionInfoPaye(pref); + console.log("TransactionPaye::getInfo"); + return info; + } + } + class DlgSupplier extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._booking = new services_1.Services.Booking(req); + this._pcmn = new services_1.Services.PlanComptable(req); + } + onDummy(response) { + alert("DlgSupplier::Dummy Error" + response); + } + onDummyFail() { + alert("DlgSupplier::Dummy Error"); + } + getFournisseur() { + let bindFct = this.onFournisseur.bind(this); + super.getFournisseur(bindFct, this.onDummy); + } + onFournisseur(response) { + try { + console.log("DlgSupplier::onFournissuer"); + this.fillSupplier(response.result); + } + catch (e) { + alert("Failed onFournisseur " + e.message); + } + } + fillSupplier(entries) { + var _obj = this; + var cl = 'supplier-list'; + var c1 = $(cl + '-c1'); + var c2 = $(cl + '-c2'); + var ng = $(cl + ''); + c1.innerHTML = ""; + c2.innerHTML = ""; + for (var i = 0; i < entries.length; i++) { + var it = entries[i]; + if (i < entries.length / 2) { + this.fillUser2c(c1, it); + } + else { + this.fillUser2c(c2, it); + } + } + if (gState.Mode == 'S') { + } + $$("a[id='supplier-modifier']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("Modifier Supplier : " + uid); + }); + }); + $$("a[id='supplier-bill']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + var compte = elt.getAttribute('compte'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("DlgSupplier:: a paye user : " + uid); + Supplier_1.SupplierBill.show(); + }); + }); + $$("a[id='supplier-paye']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + var compte = elt.getAttribute('compte'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("DlgSupplier:: a paye user : " + uid); + Supplier_1.SupplierPayer.show(); + }); + }); + $$("a[id='supplier-decompte']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + var compte = elt.getAttribute('compte'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("DlgSupplier: a decompte user : " + uid); + Supplier_1.SupplierAccount.show(); + }); + }); + $$("a[id='supplier-dissocier']").each(function (elt) { + elt.on("click", function (e) { + var uid = elt.getAttribute('uid'); + e.stopImmediatePropagation(); + e.preventDefault(); + console.log("DlgSupplier:: dissocier user : " + uid); + }); + }); + } + fillUser2c(row, it) { + var d = "

    "; + d += "" + it['acc_id'] + " " + it["acc_desc"]; + d += " Solde " + it['solde'] + "

    "; + d += ""; + if (it['acc_id'] != 0) { + d += ""; + d += " Facture"; + d += ""; + d += " Payer"; + d += ""; + d += " Décompte"; + } + d += ""; + d += "
    "; + row.innerHTML += d; + } + onShow() { + $("supplier-add").addClassName("hidden"); + this.getFournisseur(); + } + onLoaded(html) { + console.log("DlgSupplier::onLoaded Fournisseur"); + this.show(); + } + } + Supplier_1.DlgSupplier = DlgSupplier; + class DlgBill extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + this.onGetKeysCharge = function (resp) { + alert("onGetKeysCharge"); + }; + var req = new AEBW.Json(jurl); + this._booking = new services_1.Services.Booking(req); + this._pcmn = new services_1.Services.PlanComptable(req); + } + onDummy(response) { + alert("DlgBill::Dummy Error" + response); + } + onDummyFail() { + alert("DlgBill::Dummy Error"); + } + getKeysCharge() { + super.getKeysCharge(this.ongetKeysCharge, this.onDummy); + } + ongetKeysCharge(response) { + try { + var cb = $('suppl_charge_key'); + var i = 0; + cb.options.length = 0; + for (i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item[1] + "-" + item[2], item[0]); + } + } + catch (e) { + alert("ongetKeysCharge " + e.message); + } + } + getFournisseur() { + super.getFournisseur(this.onFournisseur, this.onDummy); + } + onFournisseur(response) { + try { + var cb = $('suppl_id'); + cb.options.length = 0; + var i = 0; + for (i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item['acc_id'] + "-" + item['acc_desc'], item['acc_id']); + } + } + catch (e) { + alert("Failed onFournisseur " + e.message); + } + } + getCharge() { + super.getCharge(this.onCharge, this.onDummyFail); + } + onCharge(response) { + try { + var cb = $('suppl_charge'); + cb.options.length = 0; + var i = 0; + for (i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item['acc_id'] + "-" + item['acc_desc'], item['acc_id']); + } + } + catch (e) { + alert("Failed onCharge " + e.message); + } + } + onLoaded(html) { + console.log("DlgBill Fourniseur onLoaded ..."); + } + doRecord(tp) { + var t = new TransactionBill(tp); + console.log('DlgBill:doRecord enter'); + try { + var bindOnRecord = this.onRecord.bind(this); + this._booking.newBill(t, bindOnRecord, this.onDummyFail); + console.log('DlgBill::doRecord done : '); + } + catch (e) { + alert("doRecord toJson failed" + e.message); + } + } + onRecord(tp) { + console.log("DlgBill::onRecord to be coded"); + $('supplier_result').innerHTML = "

    Enregistrement Effectue

    La facture a été enregistré

    "; + Supplier_1.Supplier.show(); + } + show() { + super.show(); + } + onShow() { + var obj = this; + this.getKeysCharge(); + var d = new Date(); + var m = d.getMonth() + 1; + var day = d.getDate(); + try { + $('suppl_date').value = d.getFullYear() + '-' + ('0' + m).slice(-2) + '-' + ('0' + day).slice(-2); + } + catch (e) { + alert("onShow: " + e.message); + } + this.getFournisseur(); + this.getCharge(); + Prototype.Event.observe($("btFFCancel"), "click", function () { + Supplier_1.Supplier.show(); + }); + Prototype.Event.observe($('btFFRecord'), "click", function () { + if (!AEBW.isDate($('suppl_date').value)) { + alert('Validation mauvais format de date'); + $('suppl_date').style.border = '1px solid red'; + return; + } + else { + $('suppl_date').style.border = '1px solid green'; + } + if (!AEBW.isDate($('suppl_voucher_date').value)) { + alert('Validation mauvais format de la date de facturation'); + $('suppl_voucher_date').style.border = '1px solid red'; + $('suppl_voucher_date').value = 'AAAA-MM-DD'; + return; + } + else { + $('suppl_voucher_date').style.border = '1px solid green'; + } + if (!AEBW.isNumber($('suppl_amount').value)) { + alert('Validation mauvais format du montant. Peut-etre un probleme de point ou de virgule'); + $('suppl_amount').style.border = '1px solid red'; + return; + } + else { + $('suppl_amount').style.border = '1px solid green'; + } + obj.doRecord("HA"); + }); + } + } + Supplier_1.DlgBill = DlgBill; + class DlgPay extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._booking = new services_1.Services.Booking(req); + } + onDummy(response) { + alert("DlgPay::Dummy Error" + response); + } + onDummyFail() { + alert("DlgPay::Dummy Error"); + } + doRecord(tp) { + var t = new TransactionPaye(tp); + console.log('Start doRecord'); + try { + var bindOnRecord = this.onRecord.bind(this); + this._booking.payBill(t, bindOnRecord, this.onDummyFail); + } + catch (e) { + alert("doRecord toJson failed" + e.message); + } + } + onRecord(response) { + $('supplier_result').innerHTML = "

    Enregistrement Effectue

    Le payement a été enregistré.

    "; + Supplier_1.Supplier.show(); + } + getFournisseur() { + var bindFct = this.onFournisseur.bind(this); + super.getFournisseur(bindFct, this.onDummy); + } + onFournisseur(response) { + var cb = $('suppl_id'); + super.fillCombo(cb, response.result); + } + onGetBanks(response) { + var cb = $('suppl_banque'); + console.log("DlgPaye::onGetBanks "); + if (Array.isArray(response.result)) { + super.fillCombo(cb, response.result); + } + else if (AEBW.isNumber(response.result)) { + cb.options.length = 0; + console.log("DlgPay::onGetBanks...int " + response.result); + } + else { + console.log("DlgPay::onGetBanks... un handled " + response.result); + } + } + onShow() { + var obj = this; + var d = new Date(); + var m = d.getMonth() + 1; + var day = d.getDate(); + var bindFct = this.onGetBanks.bind(this); + super.getBanks(bindFct, this.onDummyFail); + this.getFournisseur(); + $('suppl_voucher_date').placeholder = 'AAAA-MM-DD'; + $('suppl_date').value = d.getFullYear() + '-' + ('0' + m).slice(-2) + '-' + ('0' + day).slice(-2); + Prototype.Event.observe($("btFPCancel"), "click", function () { + Supplier_1.Supplier.show(); + }); + Prototype.Event.observe($('btFPRecord'), "click", function () { + if (!AEBW.isDate($('suppl_date').value)) { + alert('Validation mauvais format de date'); + $('suppl_date').style.border = '1px solid red'; + return; + } + else { + $('suppl_date').style.border = '1px solid green'; + } + if (!AEBW.isDate($('suppl_voucher_date').value)) { + alert('Validation mauvais format de la date de facturation'); + $('suppl_voucher_date').style.border = '1px solid red'; + $('suppl_voucher_date').value = 'AAAA-MM-DD'; + return; + } + else { + $('suppl_voucher_date').style.border = '1px solid green'; + } + if (!AEBW.isNumber($('suppl_amount').value)) { + alert('Validation mauvais format du montant. Peut-etre un probleme de point ou de virgule'); + $('suppl_amount').style.border = '1px solid red'; + return; + } + else { + $('suppl_amount').style.border = '1px solid green'; + } + obj.doRecord('BQ'); + }); + } + onLoaded(html) { + console.log("DlgPay::onLoaded Fournisseur"); + } + } + class DlgAccount extends Dialog_1.ComptaDialog { + constructor(_id, uipath, jurl) { + super(_id, uipath, jurl); + var req = new AEBW.Json(jurl); + this._retrieve = new services_1.Services.Retrieve(req); + } + onDummy(response) { + alert("DlgAccount::Dummy Error" + response); + } + onDummyFail() { + alert("DlgAccount::DummyFail Error"); + } + ongetExercices(response) { + } + getFournisseur() { + super.getFournisseur(this.onGetFournisseur, this.onDummy); + } + onGetFournisseur(response) { + var cb = $('cbSupplierAccount'); + cb.options.length = 0; + for (var i = 0; i < response.result.length; i++) { + var item = response.result[i]; + cb.options[cb.options.length] = new Option(item['acc_id'] + "-" + item['acc_desc'], item['acc_id']); + } + } + getAccount() { + var _params = new services_1.Services.EntriesReqParams(gState.Exercice, $('cbSupplierAccount').value); + var bindFct = this.onGetAccount.bind(this); + this._retrieve.getEntriesByAccount(_params, bindFct, this.onDummyFail); + } + onGetAccount(response) { + var tb = new AEBW.control.table('supplier_table_account'); + super.cleanTable(tb, tb._NbRows); + var entries = response.result.entries; + for (var i = 0; i < entries.length; i++) { + var it = entries[i]; + var row = tb.addRow(); + tb.getCell(tb._NbRows - 1, 0).innerHTML = it[0]; + tb.getCell(tb._NbRows - 1, 1).innerHTML = it[1]; + tb.getCell(tb._NbRows - 1, 2).innerHTML = it[2]; + row.cells[2].style.textAlign = "right"; + if (it[3] != 0.0) { + tb.getCell(tb._NbRows - 1, 3).innerHTML = it[3]; + row.cells[3].style.textAlign = "right"; + } + if (it[4] != 0.0) { + tb.getCell(tb._NbRows - 1, 4).innerHTML = it[4]; + row.cells[4].style.textAlign = "right"; + } + if (it[2] > it[3]) { + row.cells[4].style.color = "red"; + } + } + var solde = response.result.solde; + $('supplierSoldeDebit').innerHTML = solde[0]; + $('supplierSoldeCredit').innerHTML = solde[1]; + $('supplierSoldeCompte').innerHTML = 'Solde : ' + solde[2]; + } + onShow() { + this.getFournisseur(); + var obj = this; + try { + Prototype.Event.observe($('btSupplierVoir'), "click", function () { + obj.getAccount(); + }); + } + catch (e) { + console.log("DlgAccount::onShow btSupplierVoir not available"); + } + Prototype.Event.observe($('cbSupplierAccount'), "change", function () { + obj.getAccount(); + }); + obj.getAccount(); + setTimeout(function () { + }, 500); + $("iExercice").innerHTML = gState.Exercice; + } + onLoaded(html) { + console.log("DlgAcount::onLoaded "); + } + } + Supplier_1.Supplier = new DlgSupplier("supplier", "./forms.php?panel=supplier_add", "/app/compta/index.php"); + Supplier_1.SupplierBill = new DlgBill("supplier", "./forms.php?panel=supplier_bill", "/app/compta/index.php"); + Supplier_1.SupplierPayer = new DlgPay("supplier", "./forms.php?panel=supplier_pay", "/app/compta/index.php"); + Supplier_1.SupplierAccount = new DlgAccount("supplier", "./forms.php?panel=supplier_account", "/app/compta/index.php"); + Prototype.Event.observe($("btFFNew"), "click", function () { + Supplier_1.SupplierBill.show(); + }); + Prototype.Event.observe($("btFFPayer"), "click", function () { + Supplier_1.SupplierPayer.show(); + }); + Prototype.Event.observe($("btFGCompte"), "click", function () { + Supplier_1.SupplierAccount.show(); + }); + Prototype.Event.observe($("btFGNew"), "click", function () { + Supplier_1.Supplier.show(); + }); + })(Supplier || (Supplier = {})); +}); diff --git a/app/compta/supplierBootstrap.js b/app/compta/supplierBootstrap.js new file mode 100644 index 0000000..462282b --- /dev/null +++ b/app/compta/supplierBootstrap.js @@ -0,0 +1,35 @@ +requirejs.config({ + baseUrl: '../..', + paths: { + "supplier": "/app/compta", + "cpt": "/app/compta", + "tslib": "/js/tslib", + "prototype": "/js/scriptaculus/prototype", + "aebw": "/js/xgui/aebw", + "xgui": "/js/xgui", + }, + shim: { + "supplier-ng": { + deps: ['xgui/CtrlDialogbox', 'prototype', 'cpt/Dialog'], + exports: 'Dialogbox', + init: function (x) { + return this.Dialogbox(); + } + }, + "CtrlDialogbox": { + deps: ['prototype'], + exports: '' + }, + "Dialog": { + deps: ['CtrlDialog', 'prototype', 'xgui_json'], + exports: 'Proto' + }, + "xgui_json": { + deps: ['aebw'], + exports: '' + } + } +}); +requirejs(["require", "exports", "tslib", "xgui/xgui_json", "xgui/CtrlDialogbox", "cpt/transaction", "cpt/Dialog", "cpt/supplier"], function (myApp) { + console.log("starting Supplier application..."); +}); diff --git a/app/compta/supplier_account.xml b/app/compta/supplier_account.xml new file mode 100644 index 0000000..fe9cf2c --- /dev/null +++ b/app/compta/supplier_account.xml @@ -0,0 +1,104 @@ + + + + + + User Managment + + + + +

    Compte fournisseur Exercice

    +

    + + + + + Information Generales + +
    + + + + + +
    +
    + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Compte
    DateRéfDésignationDébitCrédit
    02/01/201312435Facture fioul100
    06/01/2013d1Virement211
    Solde:0.00.0
    +
    + +
    +
    +
    diff --git a/app/compta/supplier_add.xml b/app/compta/supplier_add.xml new file mode 100644 index 0000000..ef3e369 --- /dev/null +++ b/app/compta/supplier_add.xml @@ -0,0 +1,109 @@ + + + + + + User Managment + + + +

    Ajouter un fournisseur

    + + + + + Idendité + +
    +
    +
    + +
    + +
    + +
    +
    + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +
    NomPrénomAdresseC.P.TélEmail
    +
    +
    + + + + + + +
    +
    diff --git a/app/compta/supplier_bill.xml b/app/compta/supplier_bill.xml new file mode 100644 index 0000000..3d4972a --- /dev/null +++ b/app/compta/supplier_bill.xml @@ -0,0 +1,119 @@ + + + + + + User Managment + + + + + + + +Nouvelle Facture + +
    +
    + + + + + + + +
    + + + + + +
    + +
    + + + + + + + + +
    + + + + + +
    +
    + +
    + + + +
    +
    diff --git a/app/compta/supplier_pay.xml b/app/compta/supplier_pay.xml new file mode 100644 index 0000000..de67387 --- /dev/null +++ b/app/compta/supplier_pay.xml @@ -0,0 +1,109 @@ + + + + + + User Managment + + + + + + + +Payer Facture + +
    +
    + + + + + + + +
    + + + +
    + + +
    + + + + + +
    +
    + +
    + + + +
    +
    diff --git a/app/compta/supplier_remove.xml b/app/compta/supplier_remove.xml new file mode 100644 index 0000000..284419e --- /dev/null +++ b/app/compta/supplier_remove.xml @@ -0,0 +1,240 @@ + + + + + + User Managment + + + + +

    Administration des utilisateurs

    +

    +

    + +
    + + + + + Utilisateur + +
    + Her +
    + + + Plan Comptable + + 1 Comptes de capitaux + + + 2 Comptes d immobilisation + + + 3 Stock et Command + + + 4 Comptes Tiers + + + 5 Comptes Financiers + + + 6 Comptes Charges + + + 7 Comptes Produits + + + 8 Hors Comptabilite + + + 9 Comptes Analytiques + + +
    +
    +

    Test What happens here

    + + System + + + +

    + + + Groupes + + simpe test + + + + Frogs + + Ok, + + Info Gen + + Une info: + + + + + + +
    +
    +
    +
    + + + + + Groupes + + Strange + + authentication + +

    Test Content

    + +
    +
    + + alias + + display boxes : enable + + + + ssl + + display boxes: + enable + disable + + + + + +
    +
    + + + Eglise + + Page de debug pour web_server. + + Yes + Vide + + + + + + T table + + Test Table Stuff + + + + + + + + + + + +
    Titre du tableau
    r1r2
    Un test pour voird1
    Un bouton +
    Un test pour voird1
    Un bouton +
    + End Table + +
    +
    + + Calendar + + Test12 +
    + +
    +
    +
    + +
    +
    diff --git a/app/compta/transaction.js b/app/compta/transaction.js new file mode 100644 index 0000000..06c5617 --- /dev/null +++ b/app/compta/transaction.js @@ -0,0 +1,189 @@ +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var Ledger; + (function (Ledger) { + class TransactionEntry { + constructor(_dc, _tp) { + var obj = this; + this.dc = _dc; + this.entry_type = _tp; + this.entry_id = -1; + this.json = function () { + if (obj.entry_id == -1) { + return { "amount": obj.amount, + "acc_id": obj.acc_id, + "dc": obj.dc, + "entry_type": obj.entry_type, + "key_charge": obj.key_charge }; + } + else { + return { "amount": obj.amount, + "acc_id": obj.acc_id, + "dc": obj.dc, + "entry_type": obj.entry_type, + "entry_id": obj.entry_id, + "key_charge": obj.key_charge }; + } + }; + } + fillFromForm(_pref) { + try { + this.acc_id = $(_pref + '_id').value; + this.amount = $(_pref + '_amount').value; + } + catch (e) { + this.acc_id = ""; + this.amount = 0.0; + } + try { + this.key_charge = $(_pref + '_charge_key').value; + } + catch (e) { + this.key_charge = "0"; + } + } + setDebitCredit(amount, _dc) { + this.amount = amount; + this.dc = _dc; + } + setAccount(acc) { + this.acc_id = acc; + } + setCharge(cle) { + this.key_charge = cle; + } + } + Ledger.TransactionEntry = TransactionEntry; + class TransactionInfo { + constructor(pref) { + var obj = this; + this.fillFromForm(pref); + this.json = function () { + return { "amount": obj.amount, + "act_trans_date": obj.act_trans_date, + "trans_label": obj.trans_label, + "voucher_date": obj.voucher_date, + "voucher_ref": obj.voucher_ref + }; + }; + } + fillFromForm(pref) { + try { + this.voucher_date = new Date($(pref + '_voucher_date').value); + this.act_trans_date = new Date($(pref + '_date').value); + this.trans_label = $(pref + '_desc').value; + this.voucher_ref = $(pref + '_voucher_ref').value; + } + catch (e) { + console.log(e.message); + } + try { + this.amount = $(pref + '_amount').value; + } + catch (e) { + console.log("fillFromForm amount " + e.message); + } + var transp = $(pref + '_trans_id'); + if (transp != null) { + console.log("fillFromForm got trans_id"); + var id = transp.getAttribute('trans_id'); + if (id != null || id != "") { + console.log("fillFromForm got trans_id got" + id); + this.trans_id = id; + } + } + } + } + Ledger.TransactionInfo = TransactionInfo; + class TransactionInfoBill extends TransactionInfo { + constructor(pref) { + super(pref); + var obj = this; + this.acc_charge = $(pref + '_charge').value; + this.acc_supplier = $(pref + '_id').value; + this.key_charge = $(pref + '_charge_key').value; + this.json = function () { + return { "amount": obj.amount, + "voucher_date": obj.voucher_date, + "act_trans_date": obj.act_trans_date, + "trans_label": obj.trans_label, + "acc_charge": obj.acc_charge, + "acc_supplier": obj.acc_supplier, + "voucher_ref": obj.voucher_ref, + "key_charge": obj.key_charge + }; + }; + } + } + Ledger.TransactionInfoBill = TransactionInfoBill; + class TransactionInfoPaye extends TransactionInfo { + constructor(pref) { + super(pref); + var obj = this; + this.acc_id = $(pref + '_id').value; + this.acc_banque = $(pref + '_banque').value; + this.acc_supplier = $(pref + '_id').value; + this.json = function () { + return { "amount": obj.amount, + "voucher_date": obj.voucher_date, + "act_trans_date": obj.act_trans_date, + "trans_label": obj.trans_label, + "acc_supplier": obj.acc_supplier, + "acc_banque": obj.acc_banque, + "acc_id": obj.acc_id, + "voucher_ref": obj.voucher_ref + }; + }; + } + } + Ledger.TransactionInfoPaye = TransactionInfoPaye; + class TransactionInfoVersement extends TransactionInfo { + constructor(pref) { + super(pref); + var obj = this; + this.acc_id = $(pref + '_id').value; + this.acc_banque = $(pref + '_banque').value; + this.json = function () { + return { "amount": obj.amount, + "voucher_date": obj.voucher_date, + "act_trans_date": obj.act_trans_date, + "trans_label": obj.trans_label, + "acc_banque": obj.acc_banque, + "acc_id": obj.acc_id, + "voucher_ref": obj.voucher_ref + }; + }; + } + } + Ledger.TransactionInfoVersement = TransactionInfoVersement; + class Transaction { + constructor(_tp, pref) { + var obj = this; + this.transi = this.getInfo(pref); + this.entries = []; + this.json = function () { + var _str = "["; + obj.entries.forEach(function (elt, i) { + if (i != 0) + _str += " , "; + _str += AEBW.toJson(elt); + }); + _str += "]"; + return { "transi": obj.transi, "entries": _str }; + }; + } + getEntry(_pref, account, _dc, trans_type) { + var entry = new TransactionEntry(_dc, trans_type); + entry.acc_id = account; + return entry; + } + getInfo(pref) { + var info = new TransactionInfo(pref); + console.log("Transaction::getInfo"); + return info; + } + } + Ledger.Transaction = Transaction; + })(Ledger = exports.Ledger || (exports.Ledger = {})); +}); diff --git a/app/compta/upload.php b/app/compta/upload.php new file mode 100644 index 0000000..49fed12 --- /dev/null +++ b/app/compta/upload.php @@ -0,0 +1,30 @@ + diff --git a/app/compta/users.xml b/app/compta/users.xml new file mode 100644 index 0000000..284419e --- /dev/null +++ b/app/compta/users.xml @@ -0,0 +1,240 @@ + + + + + + User Managment + + + + +

    Administration des utilisateurs

    +

    +

    + +
    + + + + + Utilisateur + +
    + Her +
    + + + Plan Comptable + + 1 Comptes de capitaux + + + 2 Comptes d immobilisation + + + 3 Stock et Command + + + 4 Comptes Tiers + + + 5 Comptes Financiers + + + 6 Comptes Charges + + + 7 Comptes Produits + + + 8 Hors Comptabilite + + + 9 Comptes Analytiques + + +
    +
    +

    Test What happens here

    + + System + + + +

    + + + Groupes + + simpe test + + + + Frogs + + Ok, + + Info Gen + + Une info: + + + + + + +
    +
    +
    +
    + + + + + Groupes + + Strange + + authentication + +

    Test Content

    + +
    +
    + + alias + + display boxes : enable + + + + ssl + + display boxes: + enable + disable + + + + + +
    +
    + + + Eglise + + Page de debug pour web_server. + + Yes + Vide + + + + + + T table + + Test Table Stuff + + + + + + + + + + + +
    Titre du tableau
    r1r2
    Un test pour voird1
    Un bouton +
    Un test pour voird1
    Un bouton +
    + End Table + +
    +
    + + Calendar + + Test12 +
    + +
    +
    +
    + +
    +
    diff --git a/app/compta/views/account_detail.php b/app/compta/views/account_detail.php new file mode 100644 index 0000000..eea239b --- /dev/null +++ b/app/compta/views/account_detail.php @@ -0,0 +1,150 @@ + + + + + +Gestion comptable + + + + + + + + + +
    + +
    +
    +XML; +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Detail extends \PageCompta + implements \IActionResult +{ + function __construct($model) + { + $this->_model = $model; + parent::__construct(XmlAccount,true); + } + + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) + { + $tbody = $xml->getElementsByTagName('tbody'); + $f = $tbody->item(0); + $nel = $xml->createDocumentFragment(); + $nel->appendXML($this->fillTable()); + $f->appendChild($nel); + /* Update title from xml template */ + $title = $this->getElementById($xml,"title"); + $el = $xml->createTextNode("compte ".$this->_model->_id); + $title->appendChild($el); + // Update return link + $retour = $this->getElementById($xml,"btRetour"); + $retour->removeAttribute('link'); + $retour->setAttribute('link',"/app/compta/services.php/".\AEB::$REQUEST['b']); + // Ok Handle solde + $solde = $this->getElementById($xml,"accSoldeCompte"); + $el = $xml->createTextNode("compte ".$this->_model->_solde[2]); + $solde->appendChild($el); + } + + /** + * @brief Fill bilan table + */ + private function fillTable() + { + $template=<<<_EOF +%s%s +%s +%.2f +%.2f +_EOF; + $frag = ""; + $count = 0; + $lst = $this->_model->_mouvements; + foreach( $lst as $row) + { + $frag.=sprintf($template + ,++$count % 2?"odd":"even" ,$row[0],$row[1] ,$row[2] + ,$row[3] + ,$row[2] > $row[3] ? "red" : "black" + ,$row[4]); + } + return $frag; + } + +} + +?> diff --git a/app/compta/views/admin_index.php b/app/compta/views/admin_index.php new file mode 100644 index 0000000..e41cb45 --- /dev/null +++ b/app/compta/views/admin_index.php @@ -0,0 +1,100 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Chargement ...

    +
    + + + +
    +
    +XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + + function __construct($b=true) + { + global $xmlAdminDocument; + parent::__construct($XmlAdminDocument,$b); + } + + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + public function render() + { + $this->show(); + } + private function documents() + { + $_cfg = $this->_auth_cfg; + $syndic = new \Syndic( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $accounting = $syndic->baseType(); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $accounting = $syndic->baseVersion(); + echo ""; + $accounting = $syndic->baseCounter(); + echo ""; + echo "
    DescriptionValeur
    Type de compatbilite".$accounting."
    Version".$accounting."
    Compteur".$accounting."
    "; + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() { + $this->script(); + echo '
    '; + echo "

    Aperçu de la configuration

    "; + $this->documents(); + echo '
    '; + } +} + + +?> diff --git a/app/compta/views/bank_index.php b/app/compta/views/bank_index.php new file mode 100644 index 0000000..2754565 --- /dev/null +++ b/app/compta/views/bank_index.php @@ -0,0 +1,138 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Banque

    + + + + + + + + + + + + + + +
    CompteLibellésolde
    + + +

    Caisse

    + +
    +
    + + +
    +
    +XML; + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + private $_model = null; + + function __construct($model, $b = true) + { + $this->_model = $model; + global $xmlBankIndex; + parent::__construct($xmlBankIndex,$b); + } + + public function render() + { + $this->show(); + } + + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) + { + $tbody = $xml->getElementsByTagName('tbody'); + $f = $tbody->item(0); + $nel = $xml->createDocumentFragment(); + $nel->appendXML($this->fillTable()); + $f->appendChild($nel); + } + /** + * @brief Fill bilan table + */ + private function fillTable() + { + $template=<<<_EOF + +%s + %s +%.2f +_EOF; +$frag = ""; + $_cfg = $this->_auth_cfg; + $pcmn = new \Bank( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lst = $pcmn->getSolde(); + $count = 0; + foreach( $lst as $row) + { + $frag.=sprintf($template + ,++$count % 2?"odd":"even" + ,$row[0] + ,$row[0],$row[1] + ,$row[2] > $row[3] ? "red" : "black" + ,$row[4]); + } + return $frag; + } + +} + +?> diff --git a/app/compta/views/bank_upload.php b/app/compta/views/bank_upload.php new file mode 100644 index 0000000..f1274a4 --- /dev/null +++ b/app/compta/views/bank_upload.php @@ -0,0 +1,136 @@ + + + + + +Gestion comptable + + + + + + + + + + + +

    Banque upload OFX

    + + + Nouveau + +
    + + + +
    + + +
    + + + + + + + + + + + + +XML; + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Upload extends \PageCompta + implements \IActionResult +{ + + function __construct($b = true) + { + global $xmlBankUpload; + parent::__construct($xmlBankUpload,$b); + } + + public function render() + { + $this->show(); + } + + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } +} + +?> diff --git a/app/compta/views/bilan_index.php b/app/compta/views/bilan_index.php new file mode 100644 index 0000000..ce215c4 --- /dev/null +++ b/app/compta/views/bilan_index.php @@ -0,0 +1,153 @@ + + + + + +Gestion comptable + + + + + + + + + + + + Exercice + + + + + + + + + + + + + + + + + + + + + + +
    Bilan de L'exercice
    CompteLibelleDebitCreditSolde
    +
    +
    + +
    +
    +XML; +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class PageBilan extends PageCompta { + + function __construct($s,$b) + { + parent::__construct($s,$b); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) + { + $tbody = $xml->getElementsByTagName('tbody'); + $f = $tbody->item(0); + $nel = $xml->createDocumentFragment(); + $nel->appendXML($this->fillTable()); + $f->appendChild($nel); + } + /** + * @brief Fill bilan table + */ + private function fillTable() + { + $template=<<<_EOF +%s%s +%.2f +%.2f +%.2f +_EOF; +$frag = ""; + $_cfg = $this->_auth_cfg; + $pcmn = new Pcmn( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lst = $pcmn->getBilan( + $this->getSession()->getCurrentExercice() + ); + $count = 0; + foreach( $lst as $row) + { + $frag.=sprintf($template,++$count % 2?"odd":"even",$row[0],$row[1] + ,$row[2] + ,$row[3] + ,$row[2] > $row[3] ? "red" : "black" + ,$row[4]); + } + return $frag; + } + +} +/* Main entry */ +$page = new PageBilan($XmlComptaBudget,true); + +/** + * Should I make the checks here ? I wonder + * if this is required + */ +$page->show(); + +?> diff --git a/app/compta/views/budget_detail.php b/app/compta/views/budget_detail.php new file mode 100644 index 0000000..de92529 --- /dev/null +++ b/app/compta/views/budget_detail.php @@ -0,0 +1,127 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + Nouveau + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    AnnéeLibellé
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +XML; + + +$_default_file = "ledger_syndic.xml"; +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Detail extends \PageCompta + implements \IActionResult +{ + + function __construct($b = true) + { + global $XmlComptaBudget; + parent::__construct($XmlComptaBudget,$b); + } + + public function render() + { + $this->show(); + } + +} + +/** + * Should I make the checks here ? I wonder + * if this is required + */ + +?> diff --git a/app/compta/views/budget_index.php b/app/compta/views/budget_index.php new file mode 100644 index 0000000..e48a559 --- /dev/null +++ b/app/compta/views/budget_index.php @@ -0,0 +1,120 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AnnéeLibellé
    + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    +XML; + + +$_default_file = "ledger_syndic.xml"; +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + + function __construct($b = true) + { + global $XmlComptaBudget; + parent::__construct($XmlComptaBudget,$b); + } + + public function render() + { + $this->show(); + } + +} + +/** + * Should I make the checks here ? I wonder + * if this is required + */ + +?> diff --git a/app/compta/views/budget_nouveau.php b/app/compta/views/budget_nouveau.php new file mode 100644 index 0000000..80bb354 --- /dev/null +++ b/app/compta/views/budget_nouveau.php @@ -0,0 +1,172 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + +

    Créer un nouveau budget

    + + Nouveau + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    AnnéeLibellé
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +XML; + + +$_default_file = "ledger_syndic.xml"; +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Nouveau extends \PageCompta + implements \IActionResult +{ + + function __construct($b = true) + { + global $XmlComptaBudget; + parent::__construct($XmlComptaBudget,$b); + } + + public function render() + { + $this->show(); + } + +} + +/** + * Should I make the checks here ? I wonder + * if this is required + */ + +?> diff --git a/app/compta/views/chart_index.php b/app/compta/views/chart_index.php new file mode 100644 index 0000000..9510b08 --- /dev/null +++ b/app/compta/views/chart_index.php @@ -0,0 +1,144 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + + +

    Plan comptable

    + + + + + + + + + + + + + + + + + + + + + + + + +
    Titre du tableau
    classLibelléType
    + + +
    1Compte de testActif + +
    +

    + +
    + +
    +
    +XML; + + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + + function __construct($b=true) + { + global $XmlChartIndex; + parent::__construct($XmlChartIndex,$b); + } + + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + public function render() + { + $this->show(); + } +} + + + +?> diff --git a/app/compta/views/compta_index.php b/app/compta/views/compta_index.php new file mode 100644 index 0000000..1886e96 --- /dev/null +++ b/app/compta/views/compta_index.php @@ -0,0 +1,289 @@ +conf_auth = $conf['auth']['mysql']; + $this->_retrieve = new \Retrieve( $this->session + , $this->conf_auth + , $this->session->getDb()); + } + + public function render() + { + $this->show(); + } + + private function article($title,$img="iu-copro.jpg",$_content="") { + $_scheme = $this->request->getScheme(); + $root= $_scheme."".$this->request->getServerHost()."/".$this->alias."/images/accounting"; + $lnk = $_scheme."".$this->request->getServerHost()."/".$this->link($title); + echo '
    '; + echo '
    '; + echo "".$title."\n"; + echo '
    '; + echo '
    '; + echo ""; + $c=<< + et encore da tatrtre ertr rete
    + Il reste a comprendre la position de l'image
    +EOF; + if ($_content !="") { + echo $_content; + } else + echo $c; + echo '
    '; + echo '
    '; + } + /** + * @brief Display most important information before + * showing the services. + * If syndic : Bank state and those owner that are negatif + */ + private function synthese() + { + if ( $this->session->in_groupe(COMPTA_SYNDIC) ) + { + $retrieve = $this->_retrieve; + $res = $retrieve->getSoldeBank(); + $solde = $res[0][2] * -1.0; + $_text =<<<_EOF +

    Sur l'exerice {$this->session->getCurrentExercice()}, vous disposez en banque de {$solde} €

    +_EOF; + echo $_text; + } else { + echo "

    Vous disposez en banque de xxxx.€

    "; + } + } + + /** + * + */ + private function plan_comptable() { + $_content =<< +Selectionner le plan comptable
    +Associer les comptes au plan
    +EOF; + + $this->article(_("Plan Comptable"),"iu-plan-comptable.jpg",$_content); + } + /** + * + */ + private function exercice() { + $_content =<<session->getCurrentExercice()}
    +Gérer la création, l'ouverture
    +les clotures des exercices
    +EOF; + + $this->article(_("Exercices"),"iu-exercice.jpg",$_content); + } + /** + * + */ + private function fournisseurs() { + $_content =<< +les factures,
    +les règlements.
    +EOF; + $this->article(_("Fournisseurs"),"iu-fournisseur.jpg",$_content); + + } + /** + * + */ + private function prets() { + $_content =<<prêts, opération recurrentes
    +création,détails
    +les règlements.
    +EOF; + $this->article(_("Prêts"),"iu-coproprietaire.jpg",$_content); + + } + /** + * + */ + private function journaux() { + $_content =<< +Saisir des transactions
    +
    +EOF; + $this->article(_("Journaux"),"iu-journaux.jpg",$_content); + + } + /** + * + */ + private function budget() { + $_content =<< +Créer un budget
    +
    +EOF; + $this->article(_("Budget"),"iu-budget.jpg",$_content); + + } + /** + * + */ + private function copropriete() { + $_content = ""; + $o = $this->session->getOrganization(); + if ($o != null) { + $_content =<< +{$o[1]}
    +{$o[2]} {$o[3]} +EOF; + } else { + $_content =<< +Créer votre organisation..
    +Joindre une organisation existante ?
    +EOF; + } + + $this->article(_("Copropriété"),"iu-bilan.jpg",$_content); + } + /** + * @brief Fill bilan with usefull info that will + * prevent me from opening the box. + * A link to the report ... + * A ling to General assembly report + */ + function bilan() { + $ex = new \Exercice( $this->session + , $this->conf_auth + , $this->session->getDb()); + $last_closed = $ex->getClosed(true); + $_content = ""; + if ( ! is_array($last_closed)) { + $_content =<<<__EOF +Pas d'exerice clos pour l'instant
    +Procès verbal de la dernière AG +__EOF; + } else if (!is_array($last_closed[0] )) + { + $_content =<<<__EOF +Pas d'exerice clos pour l'instant
    +Procès verbal de la dernière AG +__EOF; + } else{ + $_content =<<<__EOF +Bilan ({$last_closed[0][3]}), dernier exercice clos
    +Procès verbal de la dernière AG +__EOF; + } + $this->article(_("Bilan"),"iu-bilan.jpg",$_content); + + } + + private function decompte($title) + { + $retrieve = $this->_retrieve; + $res = $retrieve->getSoldeCharge(); + $compte = $retrieve->getAccount($this->session->id()); + $_content =<<<_EOF +Les charges latentes: {$res[1]} €
    +Le solde du compte :
    +Télécharger +_EOF; + $this->article($title,"iu-coproprietaire.jpg",$_content); + } + + private function administration() + { + $_content=<<<_EOF +Aperçu de la version
    +Le parametrage de la base
    +Utile pour controler l'évolution de l'application
    +_EOF; + $this->article(_("Administration"),"iu-coproprietaire.jpg",$_content); + } + + private function main_syndic() + { + $this->synthese(); + /** + * filter out available services depending on + */ + if (! $this->session->in_groupe(COMPTA_SYNDIC) ) { + // Regular users services + $this->copropriete(); + $this->decompte(_("Décompte Charge")); + $this->bilan(); + } else { + // Syndic services + $this->copropriete(); + $this->plan_comptable(); + $this->exercice(); + $this->fournisseurs(); + $this->decompte(_("Copropriétaires")); + $this->journaux(); + $this->bilan(); + $this->budget(); + } + } + private function main_tpe() + { + $this->synthese(); + /** + * filter out available services depending on + */ + // Syndic services + $this->copropriete(); + $this->plan_comptable(); + $this->exercice(); + $this->fournisseurs(); + $this->prets(); + $this->journaux(); + $this->bilan(); + $this->budget(); + $this->administration(); + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() + { + $compta = $this->_retrieve->baseType(); + echo '
    '; + if ($compta == "tpe") + { + $this->main_tpe(); + } + else + { // Default is always syndic + $this->main_syndic(); + } + echo '
    '; + } +} + + +/* + * vim:et:sw=2:list: + */ +?> diff --git a/app/compta/views/exercice_index.php b/app/compta/views/exercice_index.php new file mode 100644 index 0000000..bfd814c --- /dev/null +++ b/app/compta/views/exercice_index.php @@ -0,0 +1,127 @@ + + + + + +Gestion comptable + + + + + + + + + + + + +

    Gestion Des Exercices :

    + + + + Nouvel Exercice + +
    +
    +
    +
    +
    + +
    + + + + + +

    Les exerices

    + + + + + + + + + + + + + + +
    StatusExerciceDate de DébutDate de FinAction
    +
    + +

    Cloture de compte

    +
    + + + + + + + + +XML; + + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + /** + * + */ + function __construct($b=true) + { + global $XmlComptaExercice; + parent::__construct($XmlComptaExercice,$b); + } + + /** + * + */ + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + + /** + * + */ + public function render() + { + $this->show(); + } +} + + + +?> diff --git a/app/compta/views/jrnx_index.php b/app/compta/views/jrnx_index.php new file mode 100644 index 0000000..6a54050 --- /dev/null +++ b/app/compta/views/jrnx_index.php @@ -0,0 +1,128 @@ + + + + + + Gestion comptable + + + + + + + + + + + + + + + + + + + + + + + + + Sélection du journal + +
    + + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    DateN° CompteRéfLibelléDébitCrédit
    Solde:0.00.0
    +
    +
    +
    + + +
    +
    +XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + /** + * + */ + function __construct($b=true) + { + global $XmlJrnxIndex; + parent::__construct($XmlJrnxIndex,$b); + $this->setTitle("Journal"); + } + + /** + * + */ + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + + /** + * + */ + public function render() + { + $this->show(); + } +} + + + + +?> diff --git a/app/compta/views/loan_detail.php b/app/compta/views/loan_detail.php new file mode 100644 index 0000000..927741d --- /dev/null +++ b/app/compta/views/loan_detail.php @@ -0,0 +1,159 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Chargement ...

    +
    + + + +
    +
    +XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Detail extends \PageCompta + implements \IActionResult +{ + private $_model = null; + + function __construct($m) + { + parent::__construct("",true); + $this->_model = $m; + } + + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief main page that will list all loans + * + */ + private function documentLoanDetails($id) + { + $lst = $this->_model->getSummary($id); + echo "

    Détail ".$lst[4]."

    "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
    Date de début : ".$lst[0]."
    Prochaine échéance:".$lst[8]."
    Durée restante : ".$lst[7]." mois
    Taux : ".$lst[2]." %
    Capital restant du : ".$lst[9]." €
    Intérets restant du :".$lst[6]." €
    "; + echo "

    Prochaine échéance

    "; + $lp = $this->_model->getNextPayement($id); + echo ""; + $date_apayer = new \DateTime($lp[6]); + //$date_today = new DateTime("2021-05-09"); + $date_today = new \DateTime("now"); + $p = ""; + if ($date_apayer > $date_today) { + $p.= "en attente"; + } else { + $p.=<< + + + + +EOF; + } + + $res =<<<_EOF + + + + + + + + + + + + +_EOF; + echo $res; + echo "
    Dateannuiteinteretammorti 
    {$lp[6]}{$lp[7]} €{$lp[8]} €{$lp[9]} €{$p} +
    "; + + } + + /** + * + * + */ + private function documents() + { + $this->documentLoanDetails($this->_model->id); + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() { + $this->script(); + echo '
    '; + $this->documents(); + echo '
    '; + } +} + +?> diff --git a/app/compta/views/loan_index.php b/app/compta/views/loan_index.php new file mode 100644 index 0000000..9e76879 --- /dev/null +++ b/app/compta/views/loan_index.php @@ -0,0 +1,278 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Chargement ...

    +
    + + + +
    +
    +XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + + function __construct($s = "",$b = true) + { + parent::__construct($s,$b); + } + + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief main page that will list all loans + * + */ + private function documentLoanDetails($id) + { + $_cfg = $this->_auth_cfg; + $loan = new \Loan( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lst = $loan->getSummary($id); + echo "

    Détail ".$lst[4]."

    "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
    Date de début : ".$lst[0]."
    Prochaine échéance:".$lst[8]."
    Durée restante : ".$lst[7]." mois
    Taux : ".$lst[2]." %
    Capital restant du : ".$lst[9]." €
    Intérets restant du :".$lst[6]." €
    "; + echo "

    Prochaine échéance

    "; + $lp = $loan->getNextPayement($id); + echo ""; + $date_apayer = new \DateTime($lp[6]); + //$date_today = new DateTime("2021-05-09"); + $date_today = new \DateTime("now"); + $p = ""; + if ($date_apayer > $date_today) { + $p.= "en attente"; + } else { + $p.=<< + + + + +EOF; + } + + $res =<<<_EOF + + + + + + + + + + + + +_EOF; + echo $res; + echo "
    Dateannuiteinteretammorti 
    {$lp[6]}{$lp[7]} €{$lp[8]} €{$lp[9]} €{$p} +
    "; + + } + + /** + * @brief pay the loan for this month + * @return Array('trans_id') in case of success or empty Array() in case of failure + */ + private function payLoan($id,$lp) + { + $_cfg = $this->_auth_cfg; + $book = new \Booking( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $trans = Array("trans_label" => "Remboursement prêt N°".$id + ,"voucher_date" => $lp[6] + ,"act_trans_date" => $lp[6] + ); + $entries = Array( + "0" => Array("acc_id" => $lp[2] , "entry_type"=> "BQ" ,"amount" => $lp[7], "dc" => "c", "key_charge" => "1") + ,"1" => Array("acc_id" => $lp[3] , "entry_type"=> "BQ" ,"amount" => $lp[8], "dc" => "d", "key_charge" => "1") + ,"2" => Array("acc_id" => $lp[4] , "entry_type"=> "BQ" ,"amount" => $lp[9], "dc" => "d", "key_charge" => "1") + ); + try { + return $book->postTransaction($trans,$entries); + } catch (Exception $e) + { + return Array(); + } + + } + /** + * @brief main page that will list all loans + * + */ + private function documentLoanPayer($id,$lei) + { + $_cfg = $this->_auth_cfg; + $loan = new \Loan( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lp = $loan->getNextPayement($id); + $result = $this->payLoan($id,$lp); + if (isset($result['trans_id'])) + { // Success book the entry + $loan->markBooked($lei); + } + echo "

    Règlement échéance terminé

    "; + echo ""; + $res =<<<_EOF + + + + + + + + + + + + +_EOF; + echo $res; + echo "
    Dateannuiteinteretammorti 
    {$lp[6]}{$lp[7]} €{$lp[8]} €{$lp[9]} € + Retour +
    "; + } + /** + * @brief main page that will list all loans + * + */ + private function documentLoans() + { + $_cfg = $this->_auth_cfg; + $loan = new \Loan( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lst = $loan->getList(); + echo ""; + echo ""; + echo ""; + echo ""; + foreach ($lst as $l) + { + $res=""; + $res.=<<{$l[5]} +EOF; + $res.=""; // Montant + $res.=""; // Taux + $res.=""; // Durée + $res.=""; + echo $res; + } + // New entry .... + $res=<< + + + + +EOF; + echo $res; + echo "
    DateDescriptionMontantTauxDurée
    ".$l[1]."".$l[2]."".$l[3]."".$l[4]." mois
    --.--.--Nouveau prêt------
    "; + } + /** + * + * + */ + private function documents() + { + if (isset($_GET['id']) ) + { + $this->documentLoanDetails($_GET['id']); + } + else if (isset($_POST) && isset($_POST["submit"]) ) + { + $this->documentLoanPayer($_POST['li'],$_POST['lei']); + } + else + { + echo "

    Mes Prêts

    "; + $this->documentLoans(); + } + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() { + $this->script(); + echo '
    '; + $this->documents(); + echo '
    '; + } +} + +?> diff --git a/app/compta/views/loan_nouveau.php b/app/compta/views/loan_nouveau.php new file mode 100644 index 0000000..68bd8b4 --- /dev/null +++ b/app/compta/views/loan_nouveau.php @@ -0,0 +1,131 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Chargement ...

    +
    + + + +
    +
    +XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Nouveau extends \PageCompta + implements \IActionResult +{ + private $_model = null; + + function __construct($m) + { + parent::__construct("",true); + $this->_model = $m; + } + + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief main page that will list all loans + * + */ + private function documentLoanNew() + { + $res=<<<_OEF +
    +

    Nouveau

    + + + + + + + + + + + +
    Date de début :  
    Prochaine échéance:-
    Durée : mois
    Taux : %
    Capital emprunté: €
    +
    +_OEF; + echo $res; + } + + /** + * + * + */ + private function documents() + { + $this->documentLoanNew(); + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() { + $this->script(); + echo '
    '; + $this->documents(); + echo '
    '; + } +} + + +?> diff --git a/app/compta/views/loan_payer.php b/app/compta/views/loan_payer.php new file mode 100644 index 0000000..d1c557f --- /dev/null +++ b/app/compta/views/loan_payer.php @@ -0,0 +1,139 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Chargement ...

    +
    + + + +
    +
    +XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Payer extends \PageCompta + implements \IActionResult +{ + private $_model = null; + function __construct($m) + { + parent::__construct("",true); + $this->_model = $m; + } + + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script() + { + $s=<<<_EOF + +_EOF; + echo $s; + } + + /** + * @brief main page that will list all loans + * + */ + private function documentLoanPayer() + { + $lp = $this->_model->lp; + echo "

    Règlement échéance terminé

    "; + echo ""; + $res =<<<_EOF + + + + + + + + + + + + +_EOF; + echo $res; + echo "
    Dateannuiteinteretammorti 
    {$lp[6]}{$lp[7]} €{$lp[8]} €{$lp[9]} € + Retour +
    "; + } + /** + * + * + */ + private function documents() + { + $this->documentLoanPayer(); + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() { + $this->script(); + echo '
    '; + $this->documents(); + echo '
    '; + } +} + + + +?> + diff --git a/app/compta/views/lot_attribuer.php b/app/compta/views/lot_attribuer.php new file mode 100644 index 0000000..873d82f --- /dev/null +++ b/app/compta/views/lot_attribuer.php @@ -0,0 +1,254 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + +

    Gestion Des lots de copropriété :

    + + + + + Selection Copropriétaire + +
    + + + +
    +
    +
    + + + + + + + + + + + + + + + + + +
    NuméroNom du lotSel
    +
    + +
    +
    + + + + + +
    +
    +XML; + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Attribuer extends \PageCompta + implements \IActionResult +{ + function __construct() + { + global $XmlComptaBudget; + parent::__construct($XmlComptaBudget,true); + } + + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) + { + $gc = $this->getElementById($xml,"gestion-compta"); + $nel = $xml->createTextNode($_SESSION["compta_name"]); + $gc->appendChild($nel); + } + + public function render() + { + $this->show(); + } + +} + +?> diff --git a/app/compta/views/lot_index.php b/app/compta/views/lot_index.php new file mode 100644 index 0000000..d54aedd --- /dev/null +++ b/app/compta/views/lot_index.php @@ -0,0 +1,274 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + +

    Gestion Des lots de copropriété :

    + + + + + + + + + + + + + + + + + + + + + +
    N°NameBatEtgPorteTypeSurf.
    +
    + + +
    +
    + + + + + +
    +
    +XML; + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + function __construct() + { + global $XmlComptaBudget; + parent::__construct($XmlComptaBudget,true); + } + + /** + * @brief allow sub classes to modify xml file + */ + private function fillLots() + { + } + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) + { + $gc = $this->getElementById($xml,"gestion-compta"); + $nel = $xml->createTextNode($_SESSION["compta_name"]); + $gc->appendChild($nel); + } + + public function render() + { + $this->show(); + } + +} + +?> diff --git a/app/compta/views/lot_nouveau.php b/app/compta/views/lot_nouveau.php new file mode 100644 index 0000000..540ae62 --- /dev/null +++ b/app/compta/views/lot_nouveau.php @@ -0,0 +1,268 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + +

    Gestion Des lots de copropriété :

    + + + + + Nouveau Lot + +
    +
    + + + + + + +
    + +
    + +
    + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +
    N°NameBatEtgPorteTypeSurf.
    +
    + + +
    +
    + + + + + +
    +
    +XML; + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Nouveau extends \PageCompta + implements \IActionResult +{ + function __construct() + { + global $XmlComptaBudget; + parent::__construct($XmlComptaBudget,true); + } + + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) + { + $gc = $this->getElementById($xml,"gestion-compta"); + $nel = $xml->createTextNode($_SESSION["compta_name"]); + $gc->appendChild($nel); + } + + public function render() + { + $this->show(); + } + +} + +?> diff --git a/app/compta/views/lot_update.php b/app/compta/views/lot_update.php new file mode 100644 index 0000000..a331338 --- /dev/null +++ b/app/compta/views/lot_update.php @@ -0,0 +1,268 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + +

    Gestion Des lots de copropriété :

    + + + + + Nouveau Lot + +
    +
    + + + + + + +
    + +
    + +
    + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +
    N°NameBatEtgPorteTypeSurf.
    +
    + + +
    +
    + + + + + +
    +
    +XML; + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Update extends \PageCompta + implements \IActionResult +{ + function __construct() + { + global $XmlComptaBudget; + parent::__construct($XmlComptaBudget,true); + } + + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) + { + $gc = $this->getElementById($xml,"gestion-compta"); + $nel = $xml->createTextNode($_SESSION["compta_name"]); + $gc->appendChild($nel); + } + + public function render() + { + $this->show(); + } + +} + +?> diff --git a/app/compta/views/org_index.php b/app/compta/views/org_index.php new file mode 100644 index 0000000..c132312 --- /dev/null +++ b/app/compta/views/org_index.php @@ -0,0 +1,255 @@ + + + + + +Gestion comptable + + + + + + + + + + + + + + + + + + + + + + + +

    Gestion Comptable :

    + + + + +

    Vos organisations

    +
    +
    +
    +
    + + + + + + +
    +
    +XML; + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + function __construct() + { + global $XmlComptaBudget; + parent::__construct($XmlComptaBudget,true); + } + + /** + * @brief allow sub classes to modify xml file + */ + private function fillOrgs() + { + } + /** + * @brief allow sub classes to modify xml file + */ + protected function _updateXML(&$xml) + { + $gc = $this->getElementById($xml,"parameters-list"); + //$nel = $xml->createTextNode($_SESSION["compta_name"]); + //$gc->appendChild($nel); + } + + public function render() + { + $this->show(); + } + +} + + +?> diff --git a/app/compta/views/recurrent_detail.php b/app/compta/views/recurrent_detail.php new file mode 100644 index 0000000..8d98a3b --- /dev/null +++ b/app/compta/views/recurrent_detail.php @@ -0,0 +1,113 @@ +_model = $model; + parent::__construct("",true); + } + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script($loc = "/app/compta/services.php/") + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief main page that will list all loans + * + */ + private function document() + { + $tpl =<<<_EOF +%s + %s € + %s € + + +_EOF; + $des = $this->_model->des; + $lst = $this->_model->lst; + echo "

    Détail ".$des[3]."

    "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
    Date de début : ".$des[1]."
    Prochaine échéance:".$des[4]."
    Montant : ".$des[2]."€
    "; + echo "

    Ecritures

    "; + /* acc | debit | credit */ + echo ""; + $res =<<<_EOF + + + + + + +_EOF; + echo $res; + foreach( $lst as $k => $acc) + { + if ($acc[4] == 'd') + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],$acc[3],"0.0"); + } else + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],"0.0",$acc[3]); + } + } + echo "
    AccountDébitCrédit
    "; + $res=<< +Retour +Modifier +
    +EOF; + echo $res; + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() + { + $this->script("/app/compta/services.php/"); + echo '
    '; + $this->document(); + echo '
    '; + } +} + +?> diff --git a/app/compta/views/recurrent_index.php b/app/compta/views/recurrent_index.php new file mode 100644 index 0000000..5c01365 --- /dev/null +++ b/app/compta/views/recurrent_index.php @@ -0,0 +1,310 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Chargement ...

    +
    + + + +
    +
    +XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Index extends \PageCompta + implements \IActionResult +{ + + function __construct($s = "" ,$b = true) + { + parent::__construct($s,$b); + } + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script($loc = "/app/compta/services.php/") + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief main page that will list all loans + * + */ + private function docRecurrentDetails($id) + { + $tpl =<<<_EOF +%s + %s € + %s € + + +_EOF; + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $des = $rec->get($id); + $lst = $rec->getSummary($id); + echo "

    Détail ".$des[3]."

    "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
    Date de début : ".$des[1]."
    Prochaine échéance:".$des[4]."
    Montant : ".$des[2]."€
    "; + echo "

    Ecritures

    "; + /* acc | debit | credit */ + echo ""; + $res =<<<_EOF + + + + + + +_EOF; + echo $res; + foreach( $lst as $k => $acc) + { + if ($acc[4] == 'd') + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],$acc[3],"0.0"); + } else + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],"0.0",$acc[3]); + } + } + echo "
    AccountDébitCrédit
    "; + /* + echo "

    Prochaine échéance

    "; + $lp = $rec->getNextPayement($id); + $date_apayer = new DateTime($lp[6]); + $date_today = new DateTime("now"); + $p = ""; + if ($date_apayer > $date_today) { + $p.= "en attente"; + } else { + $p.=<< + + + + +EOF; + } + + $res =<<<_EOF +Date + annuite + interet + ammorti +   + +{$lp[6]} + {$lp[7]} € + {$lp[8]} € + {$lp[9]} € + {$p} + + +_EOF; + echo $res; + */ + } + + /** + * @brief pay the loan for this month + * @return Array('trans_id') in case of success or empty Array() in case of failure + */ + private function pay($id,$lp) + { + $_cfg = $this->_auth_cfg; + $entries = array(); + $book = new Booking( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $trans = Array("trans_label" => "Payement ".$lp[0][2] + ,"voucher_date" => $lp[0][1] + ,"act_trans_date" => $lp[0][1]); + foreach($lp as $e ) + { + $entries[] = Array("acc_id" => $e[5] , "entry_type"=> $e[3] ,"amount" => $e[6], "dc" => $e[4], "key_charge" => "1"); + } + try { + return $book->postTransaction($trans,$entries); + } catch (Exception $e) + { + error_log("Failed pay:".$e->message()); + return Array(); + } + + } + /** + * @brief main page that will list all loans + * + */ + private function docRecurrentPayer($id) + { + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lp = $rec->getNextPayement($id); + $result = $this->pay($id,$lp); + if (isset($result['trans_id'])) + { // Success book the entry + $rec->markBooked($id); + } + echo "

    Règlement échéance terminé

    "; + echo ""; + $res =<<<_EOF + + + + + + + + + + + + +_EOF; + echo $res; + echo "
    Dateannuiteinteretammorti 
    {$lp[6]}{$lp[7]} €{$lp[8]} €{$lp[9]} € + Retour +
    "; + } + /** + * @brief main page that will list all loans + * + */ + private function docRecurrents() + { + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lst = $rec->getList(); + echo ""; + echo ""; + echo ""; + echo ""; + $date_today = new \DateTime("now"); + foreach ($lst as $l) + { + $res=""; + $prochaine_echeance = ""; + $date_apayer = new \DateTime($l[4]); + if ($date_apayer < $date_today) + { + $prochaine_echeance .= " ".$l[4]." a régler"; + } else + { + $prochaine_echeance .= $l[4]." en attente"; + } + $res.=<<{$l[3]} +EOF; + $res.=""; // Description + $res.=""; // Find + $res.=""; // Prochaine Echéance + $res.=""; + echo $res; + } + // Alright, add the last row that will allow you to add a recurrent entry + $res=""; + $res.=""; // Description + $res.=""; // Find + $res.=""; // Find + $res.=""; // Find + $res.=""; + echo $res; + echo "
    DateDescriptionMontantFinProchaine échéance
    ".$l[1]."".$l[2]."".$l[5]."".$prochaine_echeance."
    --.--.-- Ajouter une opération récurrente------
    "; + } + /** + * + * + */ + private function documents() + { + if (isset($_GET['id']) ) + { + $this->docRecurrentDetails($_GET['id']); + } + else if (isset($_GET['regler']) ) + { + $this->docRecurrentPayer($_GET['regler']); + } + else + { + echo "

    Les opération récurrentes

    "; + $this->docRecurrents(); + } + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() + { + if ( (isset($_POST) && isset($_POST['submit']) ) + || isset($_GET['regler']) + || isset($_GET['id'])) + { + error_log("to ledger_recurrent"); + $this->script("/app/compta/services.php/"); + } else + { + error_log("to pag_ledger"); + $this->script(); + } + echo '
    '; + $this->documents(); + echo '
    '; + } +} + +?> diff --git a/app/compta/views/recurrent_nouveau.php b/app/compta/views/recurrent_nouveau.php new file mode 100644 index 0000000..7816d02 --- /dev/null +++ b/app/compta/views/recurrent_nouveau.php @@ -0,0 +1,310 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Chargement ...

    +
    + + + +
    +
    +XML; + + +/** + * @brief Update GUI with the list of + * documents available. All decomptes + */ +class Nouveau extends \PageCompta + implements \IActionResult +{ + + function __construct($s = "" ,$b = true) + { + parent::__construct($s,$b); + } + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script($loc = "/app/compta/services.php/") + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief main page that will list all loans + * + */ + private function docRecurrentDetails($id) + { + $tpl =<<<_EOF +%s + %s € + %s € + + +_EOF; + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $des = $rec->get($id); + $lst = $rec->getSummary($id); + echo "

    Détail ".$des[3]."

    "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
    Date de début : ".$des[1]."
    Prochaine échéance:".$des[4]."
    Montant : ".$des[2]."€
    "; + echo "

    Ecritures

    "; + /* acc | debit | credit */ + echo ""; + $res =<<<_EOF + + + + + + +_EOF; + echo $res; + foreach( $lst as $k => $acc) + { + if ($acc[4] == 'd') + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],$acc[3],"0.0"); + } else + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],"0.0",$acc[3]); + } + } + echo "
    AccountDébitCrédit
    "; + /* + echo "

    Prochaine échéance

    "; + $lp = $rec->getNextPayement($id); + $date_apayer = new DateTime($lp[6]); + $date_today = new DateTime("now"); + $p = ""; + if ($date_apayer > $date_today) { + $p.= "en attente"; + } else { + $p.=<< + + + + +EOF; + } + + $res =<<<_EOF +Date + annuite + interet + ammorti +   + +{$lp[6]} + {$lp[7]} € + {$lp[8]} € + {$lp[9]} € + {$p} + + +_EOF; + echo $res; + */ + } + + /** + * @brief pay the loan for this month + * @return Array('trans_id') in case of success or empty Array() in case of failure + */ + private function pay($id,$lp) + { + $_cfg = $this->_auth_cfg; + $entries = array(); + $book = new Booking( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $trans = Array("trans_label" => "Payement ".$lp[0][2] + ,"voucher_date" => $lp[0][1] + ,"act_trans_date" => $lp[0][1]); + foreach($lp as $e ) + { + $entries[] = Array("acc_id" => $e[5] , "entry_type"=> $e[3] ,"amount" => $e[6], "dc" => $e[4], "key_charge" => "1"); + } + try { + return $book->postTransaction($trans,$entries); + } catch (Exception $e) + { + error_log("Failed pay:".$e->message()); + return Array(); + } + + } + /** + * @brief main page that will list all loans + * + */ + private function docRecurrentPayer($id) + { + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lp = $rec->getNextPayement($id); + $result = $this->pay($id,$lp); + if (isset($result['trans_id'])) + { // Success book the entry + $rec->markBooked($id); + } + echo "

    Règlement échéance terminé

    "; + echo ""; + $res =<<<_EOF + + + + + + + + + + + + +_EOF; + echo $res; + echo "
    Dateannuiteinteretammorti 
    {$lp[6]}{$lp[7]} €{$lp[8]} €{$lp[9]} € + Retour +
    "; + } + /** + * @brief main page that will list all loans + * + */ + private function docRecurrents() + { + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $lst = $rec->getList(); + echo ""; + echo ""; + echo ""; + echo ""; + $date_today = new \DateTime("now"); + foreach ($lst as $l) + { + $res=""; + $prochaine_echeance = ""; + $date_apayer = new \DateTime($l[4]); + if ($date_apayer < $date_today) + { + $prochaine_echeance .= " ".$l[4]." a régler"; + } else + { + $prochaine_echeance .= $l[4]." en attente"; + } + $res.=<<{$l[3]} +EOF; + $res.=""; // Description + $res.=""; // Find + $res.=""; // Prochaine Echéance + $res.=""; + echo $res; + } + // Alright, add the last row that will allow you to add a recurrent entry + $res=""; + $res.=""; // Description + $res.=""; // Find + $res.=""; // Find + $res.=""; // Find + $res.=""; + echo $res; + echo "
    DateDescriptionMontantFinProchaine échéance
    ".$l[1]."".$l[2]."".$l[5]."".$prochaine_echeance."
    --.--.-- Ajouter une opération récurrente------
    "; + } + /** + * + * + */ + private function documents() + { + if (isset($_GET['id']) ) + { + $this->docRecurrentDetails($_GET['id']); + } + else if (isset($_GET['regler']) ) + { + $this->docRecurrentPayer($_GET['regler']); + } + else + { + echo "

    Les opération récurrentes

    "; + $this->docRecurrents(); + } + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() + { + if ( (isset($_POST) && isset($_POST['submit']) ) + || isset($_GET['regler']) + || isset($_GET['id'])) + { + error_log("to ledger_recurrent"); + $this->script("/app/compta/services.php/"); + } else + { + error_log("to pag_ledger"); + $this->script(); + } + echo '
    '; + $this->documents(); + echo '
    '; + } +} + +?> diff --git a/app/compta/views/recurrent_payer.php b/app/compta/views/recurrent_payer.php new file mode 100644 index 0000000..9bd54ea --- /dev/null +++ b/app/compta/views/recurrent_payer.php @@ -0,0 +1,203 @@ + + + + + +Gestion comptable + + + + + + + + + +

    Chargement ...

    +
    + + + +
    +
    +XML; + + +/** + * @brief GUI result when a recurrent entry + * is payed. We would like to see the next + * payement date, the amount, the possibility + * to update this recurrent entry, go back to the list + * of recurrent entries, go back to the main page. + */ +class Payer extends \PageCompta + implements \IActionResult +{ + private $_model; + + function __construct($_model ,$b = true) + { + parent::__construct("",$b); + $this->_model = $_model; + } + + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script($loc = "/app/compta/services.php/") + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief main page that will list all loans + * + */ + private function docRecurrentDetails($id) + { + $tpl =<<<_EOF +%s + %s € + %s € + + +_EOF; + $_cfg = $this->_auth_cfg; + $rec = new \Recurrent( $this->getSession() + , $_cfg + , $this->getSession()->getDb()); + $des = $rec->get($id); + $lst = $rec->getSummary($id); + echo "

    Détail ".$des[3]."

    "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
    Date de début : ".$des[1]."
    Prochaine échéance:".$des[4]."
    Montant : ".$des[2]."€
    "; + echo "

    Ecritures

    "; + /* acc | debit | credit */ + echo ""; + $res =<<<_EOF + + + + + + +_EOF; + echo $res; + foreach( $lst as $k => $acc) + { + if ($acc[4] == 'd') + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],$acc[3],"0.0"); + } else + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],"0.0",$acc[3]); + } + } + echo "
    AccountDébitCrédit
    "; + } + + /** + * @brief main page that will list all loans + * + */ + private function docRecurrentPayer() + { + $tpl =<<<_EOF +%s + %s + %s € + %s € + + +_EOF; + $lp = $this->_model->lp; + $res =<<L'opération {$lp[0][2]} en date du {$lp[0][1]} est enregistrée avec succès. +EOF; + + $res.=""; + $res.=<<<_EOF + + + + + +_EOF; + foreach($lp as $e ) + { + $res.=sprintf($tpl,$e[5] , $e[3] ,($e[4] == 'd') ? $e[6] : "0.0", ( $e[4] == 'c' ) ? $e[6] : "0.0"); + } + echo $res; + echo "
    AccountJournalDébitCrédit
    "; + echo 'Retour'; + } + /** + * + * + */ + private function documents() + { + if ($this->_model->isPayed() ) + { + $this->docRecurrentPayer(); + } + else + { + echo "

    Les opération récurrentes

    "; + $this->docRecurrents(); + } + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() + { + if ( (isset($_POST) && isset($_POST['submit']) ) + || isset($_GET['regler']) + || isset($_GET['id'])) + { + error_log("to ledger_recurrent"); + $this->script("/app/compta/services.php/"); + } else + { + error_log("to pag_ledger"); + $this->script(); + } + echo '
    '; + $this->documents(); + echo '
    '; + } +} + +?> diff --git a/app/compta/views/recurrent_update.php b/app/compta/views/recurrent_update.php new file mode 100644 index 0000000..f40f476 --- /dev/null +++ b/app/compta/views/recurrent_update.php @@ -0,0 +1,119 @@ +_model = $model; + parent::__construct("",true); + } + public function render() + { + $this->show(); + } + + /** + * @brief insert a script in the page to update menu link + * + */ + private function script($loc = "/app/compta/services.php/") + { + $s=<<<_EOF + +_EOF; + echo $s; + } + /** + * @brief main page that will list all loans + * + */ + private function document() + { + $tpl =<<<_EOF +%s + %s € + %s € + + +_EOF; + $des = $this->_model->des; + $lst = $this->_model->lst; + $res=<<<_EOF +

    Détail {$des[3]}

    +
    + + + + + +
    Montant : €
    +

    Ecritures

    + + +_EOF; + + $res.=<<<_EOF + + + + + + +_EOF; + echo $res; + foreach( $lst as $k => $acc) + { + if ($acc[4] == 'd') + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],$acc[3],"0.0"); + } else + { + echo sprintf($tpl,$acc[2]." - ".$acc[5],"0.0",$acc[3]); + } + } + echo "
    AccountDébitCrédit
    "; + $res=<< + +EOF; + echo $res; + } + + /** + * @brief Display The articles in flex mode + * Also revise menu + */ + function main() + { + $this->script("/app/compta/services.php/"); + echo '
    '; + $this->document(); + echo '
    '; + } +} + +?> diff --git a/app/config/analystictracking_andre.php b/app/config/analystictracking_andre.php new file mode 100644 index 0000000..381f5ec --- /dev/null +++ b/app/config/analystictracking_andre.php @@ -0,0 +1,13 @@ + diff --git a/app/config/analystictracking_syndic.php b/app/config/analystictracking_syndic.php new file mode 100644 index 0000000..1f0ac0c --- /dev/null +++ b/app/config/analystictracking_syndic.php @@ -0,0 +1,13 @@ + diff --git a/app/config/andre.php b/app/config/andre.php new file mode 100644 index 0000000..766d57d --- /dev/null +++ b/app/config/andre.php @@ -0,0 +1,543 @@ +_input = $inp; + } + function show() { + echo "

    "; + $this->_input->show(); + echo "

    \n"; + } +} +/** + * This function could be at phplib. I used this code at several placed. + */ +class inputCode { + var $_input; + var $alias = ""; + function __construct($inp,$alias="/andre") { + $this->_input = $inp; + $this->alias = $alias; + } + function show() { + echo "

    "; + echo "Security"; + $this->_input->show(); + echo "

    \n"; + } +} +/** + * + */ +class loginLayoutTrinity { + function __construct () { + } + + function show() { + global $conf; + $f = new Form("member/login.php"); + $f->id="generic_login_form"; + $s = 19; + //echo "

    "; + //echo ""; + $w= new FormInputText("email","email",_("user :")); + $w->setSize($s,1); + $ir = new inputRow($w); + $f->addInput($ir); + $w = new FormInputPassword("passwd","",_("password : ")); + $w->setSize($s,1); + $ir = new inputRow($w); + $f->addInput($ir); + $w= new FormInput("action","LOGIN_REQUEST",""); + $f->addInput($w); + $w= new FormInputText("security_code","",""); + $w->setSize("5",1); + $ir = new inputCode($w,$conf['alias']); + $f->addInput($ir); + $w= new FormInputSubmit("submit","Login",""); + $w->onClick = "doLoginRequest(); return false;"; + $ir = new inputRow($w); + $f->addInput($ir); + $w= new FormInputSubmit("button","Cancel",""); + $w->onClick = "hideLogin(); return false;"; + $ir = new inputRow($w); + $f->addInput($ir); + //echo "
    "; + echo "

    "; + } +} +/** + * \brief + * + */ +class AppPage extends Page { + protected $_auth_cfg; + var $alias = "/andre/"; + var $topic; + var $session = null; + var $vmenu; + var $directory; + var $lang = "en_US.UTF-8"; + var $is_logged = false; + var $with_prototype = true; + var $with_scriptacoulus = true; + var $with_mymenu = true; + var $with_aebw = true; + var $with_xgui = true; + var $with_login = true; + var $with_mydate = false; + var $with_tinymce = false; + var $with_styleswitcher = false; + var $with_syntax = true; + //var $lang = "fr_FR.UTF-8"; + function useAuthDB() + { + global $conf; + $_cfg = $conf['auth']['mysql']; + $this->authDB = new Db($_cfg[SQL_SERVER],$_cfg[SQL_USER],$_cfg[SQL_PASSWD],$_cfg[SQL_DB]); + } + /** + * @brief links in head section + * + */ + function generate_links() { + $css = $this->alias.THEME_CSS; + echo " \n"; + if ($this->with_xgui) { + echo " alias."/css/xgui/default.css\"/>\n"; + echo " alias.THEME_CSS_XGUI."\"/>\n"; + + echo " alias."/css/jscook/theme.css\"/>\n"; + } + if ($this->with_syntax) { + echo " alias."/css/SyntaxHighlighter.css\"/>\n"; + } + echo "\n"; + echo " alias."/css/fontawesomefont-5.7.2.min.css\"/>\n"; + echo << + + + + + +FIN; + if ($this->with_prototype) { + echo "\n"; + } + if ($this->with_scriptacoulus) { + echo "\n"; + echo "\n"; + } + if ($this->with_xgui) { + echo "\n"; + echo "\n"; + } + echo "\n"; + echo "\n"; + if ($this->with_login) { + echo "\n"; + echo "\n"; + } + echo "\n"; + if ($this->with_syntax) { + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "\n"; + if ($this->with_tinymce) { + $fn = $this->alias."/index.php?topic=".$this->topic."&lang=".$this->lang."&tp=style"; + echo "\n"; + echo << + function fileBrowserCallback(field_name,url,type,win) { + var con= "../../filemanager/browser.html?Connector=connectors/php/connector.php"; + var enableAutoTypeSelection = true; + var cType = field_name; + tinyfck = win; + tinyfck_field = field_name; + switch (type) { + case "image" : cType = "Image"; break; + case "flash" : cType = "Flash"; break; + case "file" : cType = "File"; break; + } + con +="&Type="+cType; + window.open(con,"tinyfck","modal,width=750,height=400"); + } + + tinyMCE.init({ + mode: "textareas", + theme: "advanced", + plugins: "save,inlinepopups,advimage,advlink,table", + entities: "38,amp,160,nbsp,60,lt,62,gt", + theme_advanced_buttons1 : "save,cancel,|,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,|,bullist,numlist,|,indent,outdent,blockquote,|,undo,redo,image,link,unlink,xhtmlxtras,code", + theme_advanced_buttons2 : "table", + theme_advanced_buttons3 : "", + theme_advanced_buttons1_add : "save", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "button", + theme_advanced_path : false, + invalid_elements : "", + save_enablewhendirty: true, + save_onsavecallback : "editSave", + save_oncancelcallback : "editCancel", + extended_valid_elements : "a[href|class|name|target|title],strong,h1[class],h2[class],h3[class],span[class|align|style|id],img[id|height|style|width|alt|title|hspace|vspace|class|src],div[class|id|style],table[id|class],tr[id,class],td[colspan],tbody,pre[name|class],content,new,author,date,title[langue],form[id|action|method],input[id|name|value|type|size],label[for],textarea[id|value|name],script[type]", + content_css: "{$css},{$fn}", + file_browser_callback : "fileBrowserCallback", + height:"530", + width:"830", + apply_source_formatting: true, + editor_selector: "edit-content", + convert_urls : false, + style_formats : [ + {title: 'MyParagraph' , inline: 'span',classes: 'p'}, + {title: 'My title' , inline: 'span',classes: 'my_title'} , + {title: 'Content Middle' , inline: 'div',classes: 'content_middle'} , + {title: 'Image Midle' , block: 'div',styles: {display:'block','width':'100%' ,'vertical-align' : 'middle' ,'text-align':'center' } } + ] + }); + + tinyMCE.init({ + mode: "textareas", + theme: "simple", + editor_selector: 'comment-text' + }); + +END; + } + echo "\n"; + // Stop using google analystic + //if ($_SERVER['SERVER_NAME'] == "www.ebersold.fr") { + // include_once(dirname(__FILE__)."/analystictracking_andre.php"); + //} else + // include_once(dirname(__FILE__)."/analystictracking_syndic.php"); + echo "\n"; + } + + /** + * @brief default constructor + * All pages will know if we are logged in or not. They just have to check + * the is_logged variable; + * + */ + function __construct () { + GLOBAL $_GET,$conf; + + $this->_auth_conf = $conf['auth']['mysql']; + parent::__construct(); + $this->session = new Session(); + $this->directory = dirname(__FILE__)."/../../locale/"; + if (isset($_GET['lang']) ) { + $this->lang= $_GET['lang']; + } else if ($_SERVER['SERVER_NAME'] == SYNDIC_DOMAIN) + $this->lang = "fr_FR.UTF-8"; + $domaine = 'andre'; + if (isset($conf['alias'])) + { + $this->alias = $conf['alias']; + } else + $this->alias = ""; + setlocale(LC_ALL,$this->lang); + bindtextdomain($domaine,$this->directory); + bind_textdomain_codeset($domaine,"UTF-8"); + textdomain($domaine); + putenv("LANG=".$this->lang); + //echo "--".getenv("LANG")." - ".getenv("LANGUAGE"); + if (isset($_SESSION['login'])) { + $this->is_logged=true; + $this->with_tinymce = true; + } + if ($this->lang == "en_US.UTF-8") { + if (strlen($this->keywords) !=0) + $this->keywords="Andre EBERSOLD,C++,Engineer,ASN1,XSL,XML,SOAP "; + } else { + if (strlen($this->keywords) !=0) + $this->keywords="Andre EBERSOLD,C++,Ingenieur,ajax, Gestion de Syndic, comptabilite,informatique,ASN1 "; + } + } + + function __destruct() { + if (isset($this->authDB) ){ + echo "Call AppPage destructor\n"; + } + //parent::__destruct(); + } + + function show_profile() { + echo ""; + } + /** + * @brief The top view of the web page + * + * + */ + function top () { + global $conf; + echo "
    "; + echo ""; + echo "
    "; + echo ""; + if (count($conf['langues']) > 1 ) { + echo "
      "; + if ($_SERVER['QUERY_STRING']) { + $qs = ""; + $pairs = explode("&",$_SERVER['QUERY_STRING']); + foreach ($pairs as $pair) { + list($n,$v) = explode("=",$pair,2); + if ($n != "lang") { + $qs = $qs."&".$n."=".$v; + } + } + echo "
    • "; + echo "
    • "; + } else { + echo "
    • topic."'>
    • "; + echo "
    • topic."'>
    • "; + } + echo "
    "; + } else { + echo "
    "; + } + + echo "
    \n"; + } + + /** + * @brief check access authorisation. + * if not allowed, redirect to login page. + * + * + */ + function check_access() { + $s = new Session(); + if ( ! $s->is_logged_in() ) { + $_scheme = $this->siteScheme(); + error_log("andre.php::check_access not Logged in: ".$_scheme.$this->alias."/app/member/login.php"); + header("HTTP/1.1 401 Unauthorized"); + header("Location: ".$_scheme.$_SERVER["SERVER_NAME"]."/".$this->alias."/app/member/login.php"); + die(); + } + } + /** + * + * + */ + function _login () { + $l = new loginLayoutTrinity(); + $l->show(); + } + + /** + * @brief bottom_link + * + * + */ + function bottom_link($name) { + return ""._($name).""; + } + /** + * @brief bottom + * + * + */ + function bottom() { + $sep=""; + echo "'; + echo _("Send comments or suggestion to :"); + echo "
    "; + } + /** + * @brief The horizontal menu + * + * + */ + function hMenuHome () { + $m = new Menu("mh","",'horizontal'); + $m->addMenuItem(_("Home"),$this->link(_("Home"))); + $m->addMenuItem(_("Activity"),$this->link(_("Activity"))); + $m->addMenuItem(_("Cv"),$this->link(_("CV"))); + $m->addMenuItem(_("Hobbies"),$this->link(_("Hobbies"))); + $m->addMenuItem(_("Contact"),$this->link(_("Contact"))); + $m->show(); + echo ""; + } + /** + * Ok, menu items will be loaded from xml file. + */ + function hMenuXml() { + $fn = dirname(__FILE__).'/../../menu.xml'; + $this->xml = simplexml_load_file(dirname(__FILE__).'/../../menu.xml'); + $lang = substr($this->lang,0,2); + $items = $this->xml->xpath("//menus/menuh[@langue='".$lang."']/menu/item"); + $m = new Menu("mh","",'horizontal'); + foreach ($items as $item) { + $title = iconv( "UTF-8", "UTF-8//TRANSLIT", $item['title'] ); + $m->addMenuItem($title,$item['link']); + } + $m->show(); + echo ""; + + } + function hMenu () { + $m = new Menu("mh","",'horizontal'); + $m->addMenuItem(_("Home"),$this->link(_("Home"))); + $m->addMenuItem(_("Products"),$this->link(_("Products"))); + $m->addMenuItem(_("Services"),$this->link(_("Services"))); + $m->addMenuItem(_("Links"),$this->link(_("Links"))); + $m->addMenuItem(_("Contact"),$this->link(_("Contact"))); + $m->show(); + echo ""; + } + /** + * @brief The vertical menu + * + */ + function vMenu () { + global $_SESSION; +/* + $shares = new Menu("Menu4"); + $shares->addMenuItem(_("His shares"),$this->link(_("Shares"))); + $this->vmenu->addMenuItem(_("Welcome"),$this->link(_("Home"))); + $this->vmenu->addMenuItem(_("Who we are"),$this->link(_("Who we are"))); + $this->vmenu->addMenuItem(_("What we believe"),$this->link(_("What we believe"))); + $this->vmenu->addSubMenu(_("Meet our Pastor"),$this->link(_("Meet our Pastor")),$shares); + $this->vmenu->addMenuItem(_("What to expect"),$this->link(_("What to expect"))); + $this->vmenu->addMenuItem(_("LifeGroups"),$this->link(_("LifeGroups"))); + $this->vmenu->addMenuItem(_("Calendar"),$this->link(_("Calendar"))); + $this->vmenu->addMenuItem(_("Podcast"),$this->link(_("Podcast"))); + $this->vmenu->addMenuItem(_("Contact us"),$this->link(_("Contact us"))); + $this->vmenu->addMenuItem(_("Maps & Directions"),$this->link(_("Maps"))); + $this->vmenu->addMenuItem(_("Links"),$this->link(_("Links"))); + */ + /* + $this->vmenuService = new Menu("Menu3"); + $this->vmenuService->title = _("Your")."
    "._("Spiritual")."
    "._("Journey"); + $this->vmenuService->addMenuItem (_("Who is Jesus ?"),$this->link(_("Home"))); + $this->vmenuService->addMenuItem (_("Is God the Center ?"),$this->link(_("Home"))); + $this->vmenuService->addMenuItem (_("Daily devotionals"),$this->link(_("Home"))); + $this->vmenuService->addMenuItem (_("You're not alone"),$this->link(_("Home"))); + + $question = new Menu("Menu2"); + $question->addMenuItem(_("Most important"),$this->link(_("Most important"))); + $question->addMenuItem(_("About God"),$this->link(_("Home"))); + $question->addMenuItem(_("Christian Faith"),$this->link(_("Home"))); + $question->addMenuItem(_("Baptism"),$this->link(_("Baptism"))); + $this->vmenuService->addSubMenu(_("Questions"),"#",$question); + */ + } + /** + * @brief + * + */ + function link($name) { + $alias = ""; + if ((strlen($this->alias) > 0) && ($this->alias[0] == '/')) { + $alias = substr($this->alias,1); + } else { + $alias = $this->alias; + } + $lang = substr($this->lang,0,2); + $lnk = array(_('Profile') => $alias.'/app/member/profile.php', + _('Home') => '/'.$alias.$lang.'/accounting/accueil.html', + _('Shares') => $alias.'/index.php?topic=pastorshares&lang='.$this->lang, + _('Contact us') => $alias.'/index.php?topic=contact&lang='.$this->lang, + _('Contact') => '/'.$alias.$lang.'/accounting/contact.html', + _('Activity') => $alias.$lang.'/activite.html', + _('CV') => $alias.'/index.php?topic=cv&lang='.$this->lang, + _('Hobbies') => $alias.'/index.php?topic=loisirs&lang='.$this->lang, + _('Calendar') => $alias.'/index.php?topic=calendar&lang='.$this->lang, + _('Links') => '/'.$alias.$lang.'/accounting/liens_syndic.html', + _('Services') => '/'.$alias.$lang.'/accounting/services.html', + _('Products') => '/'.$alias.$lang.'/accounting/products.html', + _('Federation') => '' + ); + return $lnk[$name]; + } + + /** + * + */ + function news() { + echo "
    "; + } + function _content() { + $this->main(); + } + /** + * + * + */ + function image($name,$width=0,$height=0) { + $str_height=""; + $str_width=""; + $lnk = array('Vigne' => $this->alias.'/images/trinity/Picture1.jpg', + 'People' => $this->alias.'/images/trinity/peoplewalking.jpg', + 'Network' => $this->alias.'/images/icons/16x16/network.png' + ); + if ($height) $str_height=" height='".$height."' "; + if ($width) $str_width=" width='".$width."' "; + return "".$name.""; + } + function show() { + parent::show(); + } + +} +/* + vim:et:syntax on:sw=4:ts=4: + */ +?> diff --git a/app/config/config.php.example b/app/config/config.php.example new file mode 100644 index 0000000..167ccbb --- /dev/null +++ b/app/config/config.php.example @@ -0,0 +1,191 @@ +authDB = new Db($AppDb['host'],$AppDb['user'],$AppDb['password'],$AppDb['name']); + } + /** + * @brief links in head section + * + */ + function generate_links() { + + echo "alias."/css/feeb/default.css\" media=\"screen\" title=\"feebf\"/>\n"; + echo << + + + +FIN; + + #echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + # + # Was necessary for IE !!! + # + echo "\n"; + } + + /** + * @brief default constructor + * + */ + function AppPage () { + $this->alias = "/administratif"; + } + + function __destruct() { + if (isset($this->authDB) ){ + echo "Call AppPage destructor\n"; + } + //parent::__destruct(); + } + /** + * @brief The top view of the web page + * + */ + function top () { + global $_SESSION; + if (isset($_SESSION['login'])) { + echo "
    User:".$_SESSION['user_nom']." ".$_SESSION["user_prenom"]."link('Logout')."\"> logout
    \n"; + } + echo "\n"; + #echo "
    Initializing...
    \n"; + } + + /** + * @brief display a link + * + */ + function bottom_link($name) { + return ""._($name).""; + } + /** + * @brief display bottom text + * + */ + function bottom() { + $sep=""; + echo "
    Envoyez vos commentaires :
    "; + echo ""; + } + /** + * @brief The horizontal menu + * + * + */ + function hMenu () { + echo "
    \n"; + #echo ""; + } + /** + * @brief The vertical menu + * + */ + function vMenu () { + global $_SESSION; + if (!defined($this->vmenu)) { + $this->vmenu = new Menu("Menu1"); + $this->vmenu->title='Home'; + $this->vmenu->addMenuItem("Accueil",$this->alias."/index.php"); + $this->vmenu->addMenuItem("Register",$this->alias."/app/registration/register.php"); + if (isset($_SESSION['login'])) { + $this->vmenu->addMenuItem("Logout",$this->link("Logout")); + if ($_SESSION['login'] == "andre.ebersold@free.fr") { + $this->vmenu->addMenuItem("System",$this->alias."/app/index.php?form=system"); + } + } else { + $this->vmenu->addMenuItem("Login",$this->alias."/app/member/login.php?action=LOGIN_FORM"); + } + } + if (isset($_SESSION['login'])) { + $this->vmenuService = new Menu("Menu2"); + $this->vmenuService->title = "Services"; + $this->vmenuService->addMenuItem ("Profile",$this->alias."/app/member/profile.php"); + $this->vmenuService->addMenuItem ("Statistics",$this->link("Statistics")); + $ann= new Menu("Annuaire"); + $ann->addMenuItem ("Pasteur",$this->link("Annuaire pasteur")); + $ann->addMenuItem ("Eglise",$this->link("Annuaire église")); + $this->vmenuService->addSubMenu ("Annuaire",$this->link("Annuaire"),$ann); + + } + $this->vmenu->show(); + if (isset($this->vmenuService)) { + $this->vmenuService->show(); + } + } + + function link($name) { + $lnk = array('Profile' => $this->alias.'/app/member/profile.php', + 'Eglise' => $this->alias.'/app/member/eglise.php', + 'Home' => $this->alias.'/app/index.php', + 'Logout' => $this->alias.'/app/member/login.php?action=LOGOUT', + 'Statistics' => $this->alias.'/app/registration/counting.php', + 'Annuaire' => $this->alias.'/app/member/annuaire.php', + 'Annuaire église' => $this->alias.'/app/member/annuaire.php?annuaire=eglise', + 'Annuaire pasteur' => $this->alias.'/app/member/annuaire.php?annuaire=pasteur', + 'Calendrier' => $this->alias.'/app/member/annuaire.php', + 'Accueil' => $this->alias.'/index.php', + 'Nous contacter' => $this->alias.'/app/member/comments.php', + 'Jeunesse' => 'http://www.feebf.org/jeunesse/index.php', + 'Developpement' => 'http://www.feebf.org/evangelisation/index.ph', + 'Mission' => 'http://www.mission-feebf.com/', + 'Eglise' => 'http://www.feebf.org/eglises/annuaire.php', + 'Federation' => 'http://www.feebf.org/la_federation/index.html' + ); + return $lnk[$name]; + } + + function image($name) { + $lnk = array('Edit' => $this->alias.'/images/edit.png', + 'Remove' => $this->alias.'/images/icons/16x16/drop4.jpg', + 'Network' => $this->alias.'/images/icons/16x16/network.png' + ); + //echo "M"; + return "".$name.""; + } + + +} +/** + vim:et:sw=4:ts=4:enc=utf-8 + */ +?> diff --git a/app/config/feebf.php b/app/config/feebf.php new file mode 100644 index 0000000..c6885e1 --- /dev/null +++ b/app/config/feebf.php @@ -0,0 +1,161 @@ +authDB = new Db($AppDb['host'],$AppDb['user'],$AppDb['password'],$AppDb['name']); + } + /** + * @brief links in head section + * + */ + function generate_links() { + + echo "alias."/css/feeb/default.css\" media=\"screen\" title=\"feebf\"/>\n"; + echo << + + + +FIN; + + #echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + # + # Was necessary for IE !!! + # + echo "\n"; + } + + /** + * @brief default constructor + * + */ + function AppPage () { + $this->alias = "/administratif"; + } + + function __destruct() { + if (isset($this->authDB) ){ + echo "Call AppPage destructor\n"; + } + //parent::__destruct(); + } + /** + * @brief The top view of the web page + * + */ + function top () { + global $_SESSION; + if (isset($_SESSION['login'])) { + echo "
    User:".$_SESSION['user_nom']." ".$_SESSION["user_prenom"]."link('Logout')."\"> logout
    \n"; + } + echo "\n"; + #echo "
    Initializing...
    \n"; + } + + /** + * @brief The horizontal menu + * + * + */ + function hMenu () { + echo "
    \n"; + #echo ""; + } + /** + * @brief The vertical menu + * + */ + function vMenu () { + global $_SESSION; + if (!defined($this->vmenu)) { + $this->vmenu = new Menu("Menu1"); + $this->vmenu->addMenuItem("accueil",$this->alias."/index.php"); + $this->vmenu->addMenuItem("register",$this->alias."/app/registration/register.php"); + if (isset($_SESSION['login'])) { + $this->vmenu->addMenuItem("logout",$this->link("Logout")); + if ($_SESSION['login'] == "andre.ebersold@free.fr") { + $this->vmenu->addMenuItem("System",$this->alias."/app/index.php?form=system"); + } + } else { + $this->vmenu->addMenuItem("login",$this->alias."/app/member/login.php?action=LOGIN_FORM"); + } + } + if (isset($_SESSION['login'])) { + $this->vmenuService = new Menu("Menu2"); + $this->vmenuService->title = "Services"; + $this->vmenuService->addMenuItem ("Profile",$this->alias."/app/member/profile.php"); + $this->vmenuService->addMenuItem ("Statistics",$this->link("Statistics")); + $this->vmenuService->addMenuItem ("Annuaire",$this->link("Annuaire")); + + } + $this->vmenu->show(); + if (isset($this->vmenuService)) { + $this->vmenuService->show(); + } + } + + function link($name) { + $lnk = array('Profile' => $this->alias.'/app/member/profile.php', + 'Home' => $this->alias.'/app/index.php', + 'Logout' => $this->alias.'/app/member/login.php?action=LOGOUT', + 'Statistics' => $this->alias.'/app/registration/counting.php', + 'Annuaire' => $this->alias.'/app/member/annuaire.php', + 'Jeunesse' => 'http://www.feebf.org/jeunesse/index.php', + 'Developpement' => 'http://www.feebf.org/evangelisation/index.ph', + 'Mission' => 'http://www.mission-feebf.com/', + 'Eglise' => 'http://www.feebf.org/eglises/annuaire.php', + 'Federation' => 'http://www.feebf.org/la_federation/index.html' + ); + return $lnk[$name]; + } + + function image($name) { + $lnk = array('Edit' => $this->alias.'/images/edit.png', + 'Remove' => $this->alias.'/images/icons/16x16/drop4.jpg', + 'Network' => $this->alias.'/images/icons/16x16/network.png' + ); + //echo "M"; + return "".$name.""; + } + + +} + +?> diff --git a/app/config/mysql.conf.php.example b/app/config/mysql.conf.php.example new file mode 100644 index 0000000..aaff1cb --- /dev/null +++ b/app/config/mysql.conf.php.example @@ -0,0 +1,83 @@ + diff --git a/app/config/mysql.conf.php.home b/app/config/mysql.conf.php.home new file mode 100644 index 0000000..ee8e6bf --- /dev/null +++ b/app/config/mysql.conf.php.home @@ -0,0 +1,86 @@ + diff --git a/app/config/syndic.php b/app/config/syndic.php new file mode 100644 index 0000000..7450e74 --- /dev/null +++ b/app/config/syndic.php @@ -0,0 +1,510 @@ +_input = $inp; + } + function show() { + echo "

    "; + $this->_input->show(); + echo "

    \n"; + } +} + +/** + * @brief Remove completely in the long run. + * I don't want built in pop up for login + */ +class loginLayoutTrinity { + function __construct () { + } + + function show() { + global $conf; + $f = new Form("member/login.php"); + $f->id="generic_login_form"; + $s = 19; + $w = new FormInputPassword("passwd","",_("password : ")); + $w->setSize($s,1); + $ir = new inputRow($w); + $f->addInput($ir); + $w= new FormInput("action","LOGIN_REQUEST",""); + $f->addInput($w); + $w= new FormInputSubmit("submit","Login",""); + $w->onClick = "doLoginRequest(); return false;"; + $ir = new inputRow($w); + $f->addInput($ir); + $w= new FormInputSubmit("button","Cancel",""); + $w->onClick = "hideLogin(); return false;"; + $ir = new inputRow($w); + $f->addInput($ir); + //echo "
    "; + echo ""; + } +} +/** + * @brief + * + */ +class AppPage extends Page { + protected $_auth_cfg; + protected $request = null; + private $reload_css = "?res=14"; // set to ?res=1 in order to + var $alias = "/andre/"; + var $topic; + var $session = null; + var $vmenu; + var $directory; + var $lang = "fr_FR.UTF-8"; + var $is_logged = false; + var $with_prototype = true; + var $with_scriptacoulus = true; + var $with_mymenu = true; + var $with_aebw = true; + var $with_xgui = true; + var $with_login = true; + var $with_mydate = false; + var $with_tinymce = false; + var $with_styleswitcher = false; + var $with_syntax = true; + + function getSession() { + return $this->session; + } + + function useAuthDB() + { + $_cfg = $this->_auth_cfg; + $this->authDB = new Db($_cfg[SQL_SERVER],$_cfg[SQL_USER],$_cfg[SQl_PASSWD],$_cfg[SQL_DB]); + } + /** + * @brief links in head section + * + */ + function generate_links() { + $css = $this->alias.THEME_CSS.$this->reload_css; + //echo " alias."/css/bootstrap-3.3.6.min.css\"/>\n"; + echo " alias."/css/layout.css\"/>\n"; + echo " \n"; + if ($this->with_xgui) { + echo " alias."/css/xgui/default.css".$this->reload_css."\"/>\n"; + echo " alias.THEME_CSS_XGUI.$this->reload_css."\"/>\n"; + + echo " alias."/css/jscook/theme.css\"/>\n"; + } + if ($this->with_syntax) { + echo " alias."/css/SyntaxHighlighter.css\"/>\n"; + } + echo " alias."/css/fontawesomefont-5.7.2.min.css\"/>\n"; + echo << + + + + + +FIN; + if ($this->with_prototype) { + echo "\n"; + } + if ($this->with_scriptacoulus) { + echo "\n"; + echo "\n"; + } + if ($this->with_xgui) { + echo "\n"; + echo "\n"; + } + echo "\n"; + echo "\n"; + //echo "\n"; + //echo "\n"; + if ($this->with_login) { + echo "\n"; + echo "\n"; + } + echo "\n"; + if ($this->with_syntax) { + echo "\n"; + echo "\n"; + echo "\n"; + } + + if ($this->with_tinymce) { + $fn = $this->alias."/index.php?topic=".$this->topic."&lang=".$this->lang."&tp=style"; + echo "\n"; + echo << + function fileBrowserCallback(field_name,url,type,win) { + var con= "../../filemanager/browser.html?Connector=connectors/php/connector.php"; + var enableAutoTypeSelection = true; + var cType = field_name; + tinyfck = win; + tinyfck_field = field_name; + switch (type) { + case "image" : cType = "Image"; break; + case "flash" : cType = "Flash"; break; + case "file" : cType = "File"; break; + } + con +="&Type="+cType; + window.open(con,"tinyfck","modal,width=750,height=400"); + } + + tinyMCE.init({ + mode: "textareas", + theme: "advanced", + plugins: "save,inlinepopups,advimage,advlink,table", + entities: "38,amp,160,nbsp,60,lt,62,gt", + theme_advanced_buttons1 : "save,cancel,|,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,|,bullist,numlist,|,indent,outdent,blockquote,|,undo,redo,image,link,unlink,xhtmlxtras,code", + theme_advanced_buttons2 : "table", + theme_advanced_buttons3 : "", + theme_advanced_buttons1_add : "save", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "button", + theme_advanced_path : false, + invalid_elements : "", + save_enablewhendirty: true, + save_onsavecallback : "editSave", + save_oncancelcallback : "editCancel", + extended_valid_elements : "a[href|class|name|target|title],strong,h1[class],h2[class],h3[class],span[class|align|style|id],img[id|height|style|width|alt|title|hspace|vspace|class|src],div[class|id|style],table[id|class],tr[id,class],td[colspan],tbody,pre[name|class],content,new,author,date,title[langue],form[id|action|method],input[id|name|value|type|size],label[for],textarea[id|value|name],script[type]", + content_css: "{$css},{$fn}", + file_browser_callback : "fileBrowserCallback", + height:"530", + width:"830", + apply_source_formatting: true, + editor_selector: "edit-content", + convert_urls : false, + style_formats : [ + {title: 'MyParagraph' , inline: 'span',classes: 'p'}, + {title: 'My title' , inline: 'span',classes: 'my_title'} , + {title: 'Content Middle' , inline: 'div',classes: 'content_middle'} , + {title: 'Image Midle' , block: 'div',styles: {display:'block','width':'100%' ,'vertical-align' : 'middle' ,'text-align':'center' } } + ] + }); + + tinyMCE.init({ + mode: "textareas", + theme: "simple", + editor_selector: 'comment-text' + }); + +END; + } + /* Alright, keep google analystics */ + include_once(dirname(__FILE__)."/analystictracking_syndic.php"); + echo "\n"; + } + + /** + * @brief default constructor + * All pages will know if we are logged in or not. They just have to check + * the is_logged variable; + * + */ + function __construct ($_session = null) { + GLOBAL $_GET,$conf; + $this->request = AEB::$REQUEST; + parent::__construct(); + //$this->_layout_class = "col-md-offset-2 col-md-8 col-sm-10 col-sm-ofset-1"; + //$this->_layout_class = "offset-md-1 col-md-10 col-sm-10 offset-sm-1"; + $this->_layout_class = "col-11"; + //$this->_width_class = "col-md-8 col-sm-10 "; + $this->_auth_cfg = $conf['auth']['mysql']; + // Setup Session. If it already exists, don't create a new one + if ($_session != null) { + $this->session = $_session; + } else + $this->session = new Session(); + $this->directory = dirname(__FILE__)."/../../locale/"; + $this->lang = "fr_FR.UTF-8"; + $domaine = 'syndic'; + if (isset($conf['alias'])) + { + $this->alias = $conf['alias']; + } else + $this->alias = ""; + setlocale(LC_ALL,$this->lang); + bindtextdomain($domaine,$this->directory); + bind_textdomain_codeset($domaine,"UTF-8"); + textdomain($domaine); + putenv("LANG=".$this->lang); + // echo "--".getenv("LANG")." - ".getenv("LANGUAGE"); + if (isset($_SESSION['login'])) { + $this->is_logged=true; + //$this->with_tinymce = true; + } + if ($this->lang == "en_US.UTF-8") { + if (strlen($this->keywords) !=0) + $this->keywords="Andre EBERSOLD,C++,Engineer,ASN1,XSL,XML,SOAP "; + } else { + if (strlen($this->keywords) !=0) + $this->keywords="Andre EBERSOLD,C++,Ingenieur,ajax, Gestion de Syndic, comptabilite,informatique,ASN1 "; + } + } + + function __destruct() { + if (isset($this->authDB) ){ + error_log("AppPage::__destruct Call AppPage destructor"); + } + } + + /** + * @brief check access authorisation. + * if not allowed, redirect to login page. + * + * + */ + function check_access() { + $s =$this->session; + if ( ! $s->is_logged_in() ) { + $_scheme = $this->siteScheme(); + //error_log("syndic.php::check_access not Logged in: ".$_scheme.$this->alias."/app/member/login.php"); + header("HTTP/1.1 401 Unauthorized"); + header("Location: ".$_scheme."".$this->request->getServerHost()."/".$this->alias."/app/member/login.php"); + $this->session->set_uri($_SERVER["REQUEST_URI"]); + die(); + } + } + + function show_profile() { + echo ""; + } + /** + * @brief The top view of the web page + * + * + */ + function top () { + global $conf; + echo "
    "; + echo ""; + echo "
    "; + echo ""; + echo "
    \n"; + } + /** + * + * + */ + function _login () { + //$l = new loginLayoutTrinity(); + //$l->show(); + } + + /** + * @brief bottom_link + * + * + */ + function bottom_link($name) { + return ""._($name).""; + } + /** + * @brief bottom + * + * + */ + function bottom() { + $sep=""; + echo "'; + echo _("Send comments or suggestion to :"); + echo "
    "; + } + /** + * @brief The horizontal menu + * + * + */ + function hMenuHome () { + $m = new Menu("mh","",'horizontal'); + $m->addMenuItem(_("Home"),$this->link(_("Home"))); + $m->addMenuItem(_("Activity"),$this->link(_("Activity"))); + $m->addMenuItem(_("Cv"),$this->link(_("CV"))); + $m->addMenuItem(_("Hobbies"),$this->link(_("Hobbies"))); + $m->addMenuItem(_("Contact"),$this->link(_("Contact"))); + $m->show(); + $_script=<< var my_menubar = new AEBW.control.menubar("menuh","horizontal"); + + +EOF; + echo $_script; + } + /** + * Ok, menu items will be loaded from xml file. + */ + function hMenuXml() { + $fn = dirname(__FILE__).'/../../menu.xml'; + $this->xml = simplexml_load_file(dirname(__FILE__).'/../../menu.xml'); + $lang = substr($this->lang,0,2); + $items = $this->xml->xpath("//menus/menuh[@langue='".$lang."']/menu/item"); + $m = new Menu("mh","",'horizontal'); + foreach ($items as $item) { + $title = iconv( "UTF-8", "UTF-8//TRANSLIT", $item['title'] ); + $m->addMenuItem($title,$item['link']); + } + $m->show(); + echo ""; + + } + function hMenu () { + $m = new Menu("mh","",'horizontal'); + $m->addMenuItem(_("Home"),$this->link(_("Home"))); + $m->addMenuItem(_("Products"),$this->link(_("Products"))); + $m->addMenuItem(_("Services"),$this->link(_("Services"))); + $m->addMenuItem(_("Links"),$this->link(_("Links"))); + $m->addMenuItem(_("Contact"),$this->link(_("Contact"))); + $m->show(); + echo ""; + } + /** + * @brief The vertical menu + * + */ + function vMenu () { + } + /** + * @brief + * + */ + function link($name) { + $alias = ""; + if ((strlen($this->alias) > 0) && ($this->alias[0] == '/')) { + $alias = substr($this->alias,1); + } else { + $alias = $this->alias; + } + $lang = substr($this->lang,0,2); + $lnk = array(_('Profile') => $alias.'/app/member/profile.php', + _('Administration') => '/'.$alias.$lang.'/app/compta/services.php/admin', + _('Home') => '/'.$alias.$lang.'/accounting/accueil.html', + _('Shares') => $alias.'/index.php?topic=pastorshares&lang='.$this->lang, + _('Contact us') => $alias.'/index.php?topic=contact&lang='.$this->lang, + _('Contact') => '/'.$alias.$lang.'/accounting/contact.html', + _('Activity') => $alias.$lang.'/activite.html', + _('CV') => $alias.'/index.php?topic=cv&lang='.$this->lang, + _('Hobbies') => $alias.'/index.php?topic=loisirs&lang='.$this->lang, + _('Calendar') => $alias.'/index.php?topic=calendar&lang='.$this->lang, + _('Links') => '/'.$alias.$lang.'/accounting/liens_syndic.html', + _('Services') => '/'.$alias.$lang.'/accounting/services.html', + _('Products') => '/'.$alias.$lang.'/accounting/products.html', + /* Traduction a revoir */ + _('Copropriété') => '/'.$alias.$lang.'/app/compta/services.php/org', + _('Plan Comptable') => '/'.$alias.$lang.'/app/compta/services.php/chart', + _('Exercices') => '/'.$alias.$lang.'/app/compta/services.php/exercice', + _('Fournisseurs') => '/'.$alias.$lang.'/app/compta/page_ledger_fournisseur.php', + _('Copropriétaires') => '/'.$alias.$lang.'/app/compta/page_ledger_coproprietaire.php', + _('Décompte Charge') => '/'.$alias.$lang.'/app/compta/page_ledger_mes_documents.php', + _('Journaux') => '/'.$alias.$lang.'/app/compta/services.php/jrnx', + _('Bilan') => '/'.$alias.$lang.'/app/compta/services.php/bilan', + _('Budget') => '/'.$alias.$lang.'/app/compta/services.php/budget', + _('Entretien') => '/'.$alias.$lang.'/app/compta/page_ledger_entretien.php', + _('Travaux') => '/'.$alias.$lang.'/app/compta/page_ledger_work.php', + _('Prêts') => '/'.$alias.$lang.'/app/compta/services.php/loan', + _('Federation') => '' + ); + return $lnk[$name]; + } + + /** + * + */ + function news() { + echo "
    "; + } + function _content() { + $this->main(); + } + /** + * + * + */ + function image($name,$width=0,$height=0) { + $str_height=""; + $str_width=""; + $lnk = array('Vigne' => $this->alias.'/images/trinity/Picture1.jpg', + 'People' => $this->alias.'/images/trinity/peoplewalking.jpg', + 'Network' => $this->alias.'/images/icons/16x16/network.png' + ); + if ($height) $str_height=" height='".$height."' "; + if ($width) $str_width=" width='".$width."' "; + return "".$name.""; + } + function show() { + parent::show(); + } + +} + +?> diff --git a/app/index.php b/app/index.php new file mode 100644 index 0000000..f80fcfb --- /dev/null +++ b/app/index.php @@ -0,0 +1,137 @@ +Page(); + $this->alias="/andre/"; + } + + function initXSL() { + $namespace= ""; + $this->xp = new XsltProcessor(); + $xsl = new DomDocument(); + $xsl->load('site/page.xsl'); + $this->xp->importStylesheet($xsl); + //$params['site']= "_xgui"; + $params['site']= "andre"; + $params["lang"] = "fr"; + $params["mode"] = 'standalone'; + $params["alias"] = $this->alias; + $this->xp->setParameter($namespace,$params); + } + function showXML ($file) { + $this->initXSL(); + $xml = new DomDocument(); + $xml->load($file); + if ($html = $this->xp->transformToXML($xml) ) { + echo $html; + } else { + echo "Failed Transform XML\n"; + } + } + + function showHTMLUser() { + } + + function showHTML() { + global $login; + echo "

    Administration F.E.E.B.F

    "; + echo <<Introduction + Bienvenue sur le nouveau site d administration de la fédération. + +
    + +END; + if ($login != "" ) { + if ($this->form != "") { + echo "\n"; + } else { + /* Two colmuns with the services*/ + $items = array(); + $items[0]['image'] = $this->alias.'/images/alcatel_lucent/q2_launch_50x50px.jpg'; + $items[0]['title'] = "Déclaration annuelle"; + $items[0]['link'] = $this->alias."/app/registration/counting.php"; + + $items[1]['image'] = $this->alias.'/images/alcatel_lucent/wishes_2008_50x50.jpg'; + $items[1]['title'] = "Impression des déclarations des dons pour le centre des imports"; + $items[1]['link'] = $this->alias."/app/registration/counting.php"; + + $items[2]['image'] = $this->alias.'/images/alcatel_lucent/EAAmap_50x50.jpg'; + $items[2]['title'] = "Lettre de prière"; + $items[2]['link'] = $this->alias."/app/registration/counting.php"; + + $items[3]['image'] = $this->alias.'/images/alcatel_lucent/day1_50x50.jpg'; + $items[3]['title'] = "Lettre Mensuelle"; + $items[3]['link'] = $this->alias."/app/registration/counting.php"; + + $items[4]['image'] = $this->alias.'/images/feebf/blue_hills.jpg'; + $items[4]['title'] = "Inscription au congrès"; + $items[4]['link'] = $this->alias."/app/registration/counting.php"; + + $items[5]['image'] = $this->alias.'/images/alcatel_lucent/newspapereader_50x50.jpg'; + $items[5]['title'] = "Annuaire"; + $items[5]['link'] = $this->alias."/app/member/annuaire.php"; + + echo << + +END; + for ($i = 0 ; $i < 6 ; $i++) { + $item = $items[$i]; + if (($i % 2) == 0) { echo ""; } + echo ""; + if (($i % 2) == 1) { echo ""; } + } + echo << +END; + } + } else { + echo <<Pour acceder aux services veuillez vous enregistrer ou sinon, créer votre espace au près

    +END; + + } + } + + function main() { + $this->showHTML(); + } + +} + +if (!isset($page) ) { + if (isset($_GET['form_view'])) { + $page = new intro($_GET['form_view']); + }else + $page = new intro(); +} + +if (isset($page) ) { + if (isset($_GET['form'])) { + $form = $_GET['form']; + if ( $form == 'profile') { + $page->showXML('users.xml'); + } else if ($form == 'index' ) { + $page->showXML('index.xml'); + } else if ($form == 'system' ) { + $page->showXML('users.xml'); + } else { + $page->showXML('index.xml'); + } + } else { + $page->show(); + } +} else { + echo "

    Page not set !!!!

    "; +} +?> diff --git a/app/index.xml b/app/index.xml new file mode 100644 index 0000000..1729ed3 --- /dev/null +++ b/app/index.xml @@ -0,0 +1,360 @@ + + + + + Corba Server Page + + + + + +

    Corba Server Page administration page

    +

    +

    + +

    There are 3 services you can have access

    + +

    A notebook example

    + + + + Services + +
    +
    + Un simple teste de contenu. + + Critical + Emerg + Error + Warning + Notice + Info + Debug + + + + nsd + + + csp + + +
    +
    +
    "; + echo "".$item['title'].""; + echo "
    + + + + + + + + + + +
    NameStatus
    web_bojectrunning
    + + Services + + + + + + +
    +
    + +
    +
    +
    + + + + + Plugins + + Strange + + authentication + + Test Content + + + + + alias + + display boxes enable + + + + ssl + + display boxes + + enable + disable + + + + + + + + + + WebObject + + + Example + + + Name + Root Path + Web Path + . + + + file_handler + c:\windevs32 + + + + + + + + + + + + + Debug + + Page de debug pour web_server. + + Yes + + + Debug + + + + +
    +
    + + +
    +
    +
    +
    + + T table + + Test Table Stuff + + + + + + + + + + + +
    Titre du tableau
    r1r2
    Un test pour voird1
    Un bouton +
    Un test pour voird1
    Un bouton +
    + End Table + +
    +
    + + + Un espace + + + Tab 1 + + Test12 +
    + +
    +
    + + Tab 2 + + ca fait quoi +
    + + + tric + + + + + Page 2 + + Un commentaire de plus qui montre que ce n'est pas encore bon + pour la gestion des tab + + + +
    + Test12 +
    +
    +
    + +
    +
    diff --git a/app/member b/app/member new file mode 160000 index 0000000..b67b519 --- /dev/null +++ b/app/member @@ -0,0 +1 @@ +Subproject commit b67b5198cc311b89d1edf365d035a521719b8890 diff --git a/app/registration/class.db_stats.php b/app/registration/class.db_stats.php new file mode 100644 index 0000000..0d453b9 --- /dev/null +++ b/app/registration/class.db_stats.php @@ -0,0 +1,24 @@ +table = 'eglises_stats'; + parent::__construct($cfg['host'],$cfg['user'],$cfg['password'],$cfg['name']); + } + + function total($year) + { + } + + function register($Form) + { + $form = $this->escape($Form); + $sql = sprintf('insert into %s(eglise_id,enregistrement,declarer_id,membres,recettes) values(%d,DATE("%s"),%d,%d,%f)',$this->table,$form['eglise_id'],date('Y-m-d'),$form['member_id'],$form['membres'],$form['recettes']); + $result = mysql_query($sql,$this->conn); + if (!$result) { + echo "Query Failed ".$sql." .... ".mysql_error(); + } + } +} +?> diff --git a/app/registration/counting.php b/app/registration/counting.php new file mode 100644 index 0000000..849ae35 --- /dev/null +++ b/app/registration/counting.php @@ -0,0 +1,134 @@ +login_id = $lid; + $this->eglise_id = $eid; + $this->groupe_id = $gid; + } + + function showCode() { + echo "Security"; + } + + function show() { + echo "
    "; + $action = new FormInput("member_id",$this->login_id); + $action->show(); + $action = new FormInput("eglise_id",$this->eglise_id); + $action->show(); + $action = new FormInput("groupe_id",$this->groupe_id); + $action->show(); + $email = new FormInputText("membres","",_("Membres:")); + $email->setSize(8,3); + $email->show(); + echo "
    "; + $email = new FormInputText("recettes","",_("Cotisation:")); + $email->setSize(8,7); + $email->show(); + echo "
    "; + $this->showCode(); + echo ""; + $code = new FormInputText("security_code",""); + $code->setSize(7,6); + $code->show(); + echo "
    "; + $submit = new FormInputSubmit("","Enregistrer"); + $submit->show(); + + } +} + +class Counting extends AppPage { + var $OK; + var $login_id; + var $eglise_id; + var $groupe_id; + function Register($login_id = "",$eglise_id = 0,$groupe_id = 0) { + $this->OK = 0; + $this->login_id = $login_id; + $this->eglise_id = $eglise_id; + $this->groupe_id = $groupe_id; + if ($login_id != "") { + $this->OK = 2; + } + } + + function registerOk($status) { + GLOBAL $_POST; + $db = new DbStats($this->_auth_cgf); + $db->register($_POST); + $this->OK = $status; + } + function showOk() { + echo 'Merci pour l`enregistrement des statistiques de cette annéee\n'; + unset($_SESSION['security_code']); + } + + function showFailed() { + + } + function showRegister() { + $this->showTitle("Registration"); + echo <<Déjà enregistre. + Bonjour, vous êtes actuellement enregistré sous l'indifiant $this->login. + Vous pouvez modifier votre profile +FINE; + + } + + function showForm() { + $this->showTitle("Statistics"); + echo "Enregistrement pour l'année ".date('Y')."

    "; + if ($this->OK == -1) { + echo "Failed register retry\n"; + } + $f = new Form($_SERVER['PHP_SELF']); + $l =new CountingLayout($this->login_id,$this->eglise_id,$this->groupe_id); + $l->alias = $this->alias; + $f->addInput($l); + $f->setClass("login"); + $f->show(); + echo "

    "; + } + + function main () { + if ($this->OK == 0) { + $this->showForm(); + } else if ($this->OK == 1) { + $this->showOk(); + } else if ($this->OK == 2) { + $this->showRegister(); + } else if ($this->OK == -1 ) { + $this->showFailed(); + $this->showForm(); + } + } +} + +$register = new Counting($_SESSION['user_id'],isset($_SESSION['eglise_id'])?$_SESSION['eglise_id']:0,isset($_SESSION['groupe_id'])?$_SESSION['groupe_id']:-1); + +if( isset($_POST['submit'])) { + if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { + // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. + $register->registerOk(1); + } else { + // Insert your code for showing an error message here + $register->registerOk(-1); + } + $register->show(); +} else { + $register->show(); + } +?> diff --git a/app/registration/register.php b/app/registration/register.php new file mode 100644 index 0000000..b7e3e28 --- /dev/null +++ b/app/registration/register.php @@ -0,0 +1,160 @@ +OK = 0; + if ($login != "") { + $this->OK = 2; + $this->login = $login; + } + } + + function registerOk($status) { + $this->OK = $status; + } + function showOk() { + if ($this->message != '') { + echo $this->message; + } else { + echo 'Thank you registering' ; + } + unset($_SESSION['security_code']); + } + /** + * Avoid to add login form twice in the same page. + */ + function _login() { + } + + function showFailed() { + + } + function showRegister() { + $this->showTitle("Registration"); + echo <<Déjà enregistre. + Bonjour, vous êtes actuellement enregistré sous l'indifiant $this->login. + Vous pouvez modifier votre profile"; + } + + function showForm() { + $this->showTitle("Registration"); + if ($this->OK == -1) { + echo "Failed register retry\n"; + } +echo << +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    + +
    + +
    +
    +FIN; + + } + + function main () { + if ($this->OK == 0) { + $this->showForm(); + } else if ($this->OK == 1) { + $this->showOk(); + } else if ($this->OK == 2) { + $this->showRegister(); + } else if ($this->OK == -1 ) { + $this->showFailed(); + $this->showForm(); + } + } +} + +if (isset($login)) { + $register = new Register($login); +} else + $register = new Register(); + +if( isset($_POST['submit'])) { + if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { + global $conf; + // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. + error_log("register.php "); + $register->registerOk(1); + $user = new DbUser($conf['auth']['mysql']); + $ident = $user->fromEmail($_POST['email']); + if (isset($ident['email'])) { + /* user already registered */ + $register->message="L'utilisateur ".$_POST["email"]." est déjà enregistré."; + } else + if (check_email_address($_POST["email"])) { + /* names are allays in upercase ... */ + $user->add($_POST); + } else { + } + } else { + // Insert your code for showing an error message here + $register->registerOk(-1); + } + $register->show(); +} else { + $register->show(); +} +/** + vim:et:sw=4:ts=4:encoding=utf8 + */ +?> diff --git a/app/users.xml b/app/users.xml new file mode 100644 index 0000000..284419e --- /dev/null +++ b/app/users.xml @@ -0,0 +1,240 @@ + + + + + + User Managment + + + + +

    Administration des utilisateurs

    +

    +

    + +
    + + + + + Utilisateur + +
    + Her +
    + + + Plan Comptable + + 1 Comptes de capitaux + + + 2 Comptes d immobilisation + + + 3 Stock et Command + + + 4 Comptes Tiers + + + 5 Comptes Financiers + + + 6 Comptes Charges + + + 7 Comptes Produits + + + 8 Hors Comptabilite + + + 9 Comptes Analytiques + + +
    +
    +

    Test What happens here

    + + System + + + +

    + + + Groupes + + simpe test + + + + Frogs + + Ok, + + Info Gen + + Une info: + + + + + + +
    +
    +
    +
    + + + + + Groupes + + Strange + + authentication + +

    Test Content

    + +
    +
    + + alias + + display boxes : enable + + + + ssl + + display boxes: + enable + disable + + + + + +
    +
    + + + Eglise + + Page de debug pour web_server. + + Yes + Vide + + + + + + T table + + Test Table Stuff + + + + + + + + + + + +
    Titre du tableau
    r1r2
    Un test pour voird1
    Un bouton +
    Un test pour voird1
    Un bouton +
    + End Table + +
    +
    + + Calendar + + Test12 +
    + +
    +
    +
    + +
    +
    diff --git a/app/xsl b/app/xsl new file mode 160000 index 0000000..01e86fd --- /dev/null +++ b/app/xsl @@ -0,0 +1 @@ +Subproject commit 01e86fd0b4968b1e2cf37e183f77ff8a7a650837 diff --git a/calendar.en_US.UTF-8.xml b/calendar.en_US.UTF-8.xml new file mode 100644 index 0000000..24520a1 --- /dev/null +++ b/calendar.en_US.UTF-8.xml @@ -0,0 +1,26 @@ + + + + + Calendrier + Calendar + Willkommen + + Informatique, Calendrier, Calendar, Javascript, CSS, Web2.0, Ingénieur, engineer + $Date: 2010/08/25 14:32:59 $ + $Id: calendar.en_US.UTF-8.xml,v 1.1 2010/08/25 14:32:59 aebersol Exp $ + +

    Calendar

    +

    A view on my public calendar.

    +
    + + + + + + +
    +
    + diff --git a/calendar.fr_FR.UTF-8.xml b/calendar.fr_FR.UTF-8.xml new file mode 100644 index 0000000..ae79e20 --- /dev/null +++ b/calendar.fr_FR.UTF-8.xml @@ -0,0 +1,27 @@ + + + + + Calendrier + Calendar + Willkommen + + Informatique, Calendrier, Calendar, Javascript, CSS, Web2.0, Ingénieur, engineer + $Date: 2010/08/25 14:33:02 $ + $Id: calendar.fr_FR.UTF-8.xml,v 1.1 2010/08/25 14:33:02 aebersol Exp $ + + +

    Calendrier

    +

    Une vue sur mon calendrier public google.

    +
    + + + + + + +
    +
    + diff --git a/calendar.xml b/calendar.xml new file mode 100644 index 0000000..62c139d --- /dev/null +++ b/calendar.xml @@ -0,0 +1,33 @@ + + + + + Calendrier + Calendar + Willkommen + + Informatique, Calendrier, Calendar, Javascript, CSS, Web2.0, Ingénieur, engineer + $Date: 2010/08/25 15:10:02 $ + $Id: calendar.xml,v 1.8 2010/08/25 15:10:02 aebersol Exp $ + + Calendrier + Calendar +

    Introduction

    +

    Introduction

    +

    Pour l'instant, c'est un composant Javascript qui affiche la date du jour. Il permet de naviguer à travers les différents mois de l'année.

    +

    This was my first development in Javascript. The feature is interesting and starts to work fine.

    +

    Futur

    +

    Plans

    +

    + Il y a encore un peu de travail pour exploiter pleinement les services de ce composant. Tout + d'abord, la possibilité d'ajouter des liens sur des dates données. Enfin, rendre le calendrier dynamique. + C'est à dire visible et invisible.

    +
    + + + +
    +
    + diff --git a/calendar_doc.xml b/calendar_doc.xml new file mode 100644 index 0000000..8e855e0 --- /dev/null +++ b/calendar_doc.xml @@ -0,0 +1,44 @@ + + + + + + 16 Feb 2010 + Amélioration du rendu + Unification of the design + + -Integration d'un méchanism de login type + MD5. + + + - Utilisation des lib prototype, scriptaculous, leightway. + L'objectif étant d'avoir une album photo et de permettre l'edition + en ligne. + + + EBERSOLD André + + + Calendrier + Calendar + Willkommen + Informatique, Calendrier, Calendar, Javascript, CSS, Web2.0, Ingénieur, engineer + $Date: 2008/03/06 18:11:27 $ + $Id: calendar_doc.xml,v 1.3 2008/03/06 18:11:27 aebersol Exp $ + +

    Description ofthe API of the calandar

    + + +

    Documentation Calendrier

    +

    Calendrier

    + En cours de réalisation. +
    + +

    Calendar

    + In progess. +
    +
    +
    + diff --git a/config.xml b/config.xml new file mode 100644 index 0000000..8d782b6 --- /dev/null +++ b/config.xml @@ -0,0 +1,46 @@ + + + + home + free + menu.xml +
    header.xml
    + header.xml + + fr + en + de + +
    + + free + free + menu.xml +
    header.xml
    + header.xml + + fr + en + de + +
    + + andre + andre + menu_andre.xml +
    header_php.xml
    +
    header_php.xml
    + header_php.xml + + + fr + en + +
    + + + +
    + diff --git a/contact.en_US.UTF-8.xml b/contact.en_US.UTF-8.xml new file mode 100644 index 0000000..dbcae01 --- /dev/null +++ b/contact.en_US.UTF-8.xml @@ -0,0 +1,34 @@ + + + + + Contact + Contact + Willkommen + $Date: 2009/04/27 06:38:44 $ + $Id: contact.xml,v 1.6 2009/04/27 06:38:44 aeb Exp $ + +

    Contact

    +

    Feel free to leave a message or comments.

    +
    +
    Comments:
    +
    Security
    + +
    +
    + + +
    +
    + diff --git a/contact.fr_FR.UTF-8.xml b/contact.fr_FR.UTF-8.xml new file mode 100644 index 0000000..7389478 --- /dev/null +++ b/contact.fr_FR.UTF-8.xml @@ -0,0 +1,23 @@ + + + + + Contact + Contact + $Date: 2009/04/27 06:38:44 $ + $Id: contact.xml,v 1.6 2009/04/27 06:38:44 aeb Exp $ + +

    Contact

    +

    Sentez-vous libre de me contacter pour toutes informations ou remarques sur ce sute.

    +
    +
    Comments:
    +
    '); + wnd.document.close(); + } + }, + + // Copies the original source code in to the clipboard. Uses either IE only method or Flash object if ClipboardSwf is set + CopyToClipboard: { + label: 'copy to clipboard', + check: function() { return window.clipboardData != null || dp.sh.ClipboardSwf != null; }, + func: function(sender, highlighter) + { + var code = dp.sh.Utils.FixForBlogger(highlighter.originalCode) + .replace(/</g,'<') + .replace(/>/g,'>') + .replace(/&/g,'&') + ; + + if(window.clipboardData) + { + window.clipboardData.setData('text', code); + } + else if(dp.sh.ClipboardSwf != null) + { + var flashcopier = highlighter.flashCopier; + + if(flashcopier === null) + { + flashcopier = document.createElement('div'); + highlighter.flashCopier = flashcopier; + highlighter.div.appendChild(flashcopier); + } + + flashcopier.innerHTML = ''; + } + + alert('The code is in your clipboard now'); + } + }, + + // creates an invisible iframe, puts the original source code inside and prints it + PrintSource: { + label: 'print', + func: function(sender, highlighter) + { + var iframe = document.createElement('IFRAME'); + var doc = null; + + // this hides the iframe + iframe.style.cssText = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;'; + + document.body.appendChild(iframe); + doc = iframe.contentWindow.document; + + dp.sh.Utils.CopyStyles(doc, window.document); + doc.write('
    ' + highlighter.div.innerHTML + '
    '); + doc.close(); + + iframe.contentWindow.focus(); + iframe.contentWindow.print(); + + alert('Printing...'); + + document.body.removeChild(iframe); + } + }, + + About: { + label: '?', + func: function(highlighter) + { + var wnd = window.open('', '_blank', 'dialog,width=300,height=150,scrollbars=0'); + var doc = wnd.document; + + dp.sh.Utils.CopyStyles(doc, window.document); + + doc.write(dp.sh.Strings.AboutDialog.replace('{V}', dp.sh.Version)); + doc.close(); + wnd.focus(); + } + } +}; + +// creates a
    with all toolbar links +dp.sh.Toolbar.Create = function(highlighter) +{ + var div = document.createElement('DIV'); + + div.className = 'tools'; + + for(var name in dp.sh.Toolbar.Commands) + { + var cmd = dp.sh.Toolbar.Commands[name]; + + if(cmd.check != null && !cmd.check(highlighter)) + continue; + + div.innerHTML += '' + cmd.label + ''; + } + + return div; +} + +// executes toolbar command by name +dp.sh.Toolbar.Command = function(name, sender) +{ + var n = sender; + + while(n != null && n.className.indexOf('dp-highlighter') == -1) + n = n.parentNode; + + if(n != null) + dp.sh.Toolbar.Commands[name].func(sender, n.highlighter); +} + +// copies all from 'target' window to 'dest' +dp.sh.Utils.CopyStyles = function(destDoc, sourceDoc) +{ + var links = sourceDoc.getElementsByTagName('link'); + + for(var i = 0; i < links.length; i++) + if(links[i].rel.toLowerCase() == 'stylesheet') + destDoc.write(''); +} + +dp.sh.Utils.FixForBlogger = function(str) +{ + return (dp.sh.isBloggerMode == true) ? str.replace(/|<br\s*\/?>/gi, '\n') : str; +} + +// +// Common reusable regular expressions +// +dp.sh.RegexLib = { + MultiLineCComments : new RegExp('/\\*[\\s\\S]*?\\*/', 'gm'), + SingleLineCComments : new RegExp('//.*$', 'gm'), + SingleLinePerlComments : new RegExp('#.*$', 'gm'), + DoubleQuotedString : new RegExp('"(?:\\.|(\\\\\\")|[^\\""\\n])*"','g'), + SingleQuotedString : new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'", 'g') +}; + +// +// Match object +// +dp.sh.Match = function(value, index, css) +{ + this.value = value; + this.index = index; + this.length = value.length; + this.css = css; +} + +// +// Highlighter object +// +dp.sh.Highlighter = function() +{ + this.noGutter = false; + this.addControls = true; + this.collapse = false; + this.tabsToSpaces = true; + this.wrapColumn = 80; + this.showColumns = true; +} + +// static callback for the match sorting +dp.sh.Highlighter.SortCallback = function(m1, m2) +{ + // sort matches by index first + if(m1.index < m2.index) + return -1; + else if(m1.index > m2.index) + return 1; + else + { + // if index is the same, sort by length + if(m1.length < m2.length) + return -1; + else if(m1.length > m2.length) + return 1; + } + return 0; +} + +dp.sh.Highlighter.prototype.CreateElement = function(name) +{ + var result = document.createElement(name); + result.highlighter = this; + return result; +} + +// gets a list of all matches for a given regular expression +dp.sh.Highlighter.prototype.GetMatches = function(regex, css) +{ + var index = 0; + var match = null; + + while((match = regex.exec(this.code)) != null) + this.matches[this.matches.length] = new dp.sh.Match(match[0], match.index, css); +} + +dp.sh.Highlighter.prototype.AddBit = function(str, css) +{ + if(str === null || str.length === 0) + return; + + var span = this.CreateElement('SPAN'); + +// str = str.replace(/&/g, '&'); + str = str.replace(/ /g, ' '); + str = str.replace(//g, '>'); + str = str.replace(/\n/gm, ' 
    '); + + // when adding a piece of code, check to see if it has line breaks in it + // and if it does, wrap individual line breaks with span tags + if(css != null) + { + if((/br/gi).test(str)) + { + var lines = str.split(' 
    '); + + for(var i = 0; i < lines.length; i++) + { + span = this.CreateElement('SPAN'); + span.className = css; + span.innerHTML = lines[i]; + + this.div.appendChild(span); + + // don't add a
    for the last line + if(i + 1 < lines.length) + this.div.appendChild(this.CreateElement('BR')); + } + } + else + { + span.className = css; + span.innerHTML = str; + this.div.appendChild(span); + } + } + else + { + span.innerHTML = str; + this.div.appendChild(span); + } +} + +// checks if one match is inside any other match +dp.sh.Highlighter.prototype.IsInside = function(match) +{ + if(match === null || match.length === 0) + return false; + + for(var i = 0; i < this.matches.length; i++) + { + var c = this.matches[i]; + + if(c === null) + continue; + + if((match.index > c.index) && (match.index < c.index + c.length)) + return true; + } + + return false; +} + +dp.sh.Highlighter.prototype.ProcessRegexList = function() +{ + for(var i = 0; i < this.regexList.length; i++) + this.GetMatches(this.regexList[i].regex, this.regexList[i].css); +} + +dp.sh.Highlighter.prototype.ProcessSmartTabs = function(code) +{ + var lines = code.split('\n'); + var result = ''; + var tabSize = 4; + var tab = '\t'; + + // This function inserts specified amount of spaces in the string + // where a tab is while removing that given tab. + function InsertSpaces(line, pos, count) + { + var left = line.substr(0, pos); + var right = line.substr(pos + 1, line.length); // pos + 1 will get rid of the tab + var spaces = ''; + + for(var i = 0; i < count; i++) + spaces += ' '; + + return left + spaces + right; + } + + // This function process one line for 'smart tabs' + function ProcessLine(line, tabSize) + { + if(line.indexOf(tab) == -1) + return line; + + var pos = 0; + + while((pos = line.indexOf(tab)) != -1) + { + // This is pretty much all there is to the 'smart tabs' logic. + // Based on the position within the line and size of a tab, + // calculate the amount of spaces we need to insert. + var spaces = tabSize - pos % tabSize; + + line = InsertSpaces(line, pos, spaces); + } + + return line; + } + + // Go through all the lines and do the 'smart tabs' magic. + for(var i = 0; i < lines.length; i++) + result += ProcessLine(lines[i], tabSize) + '\n'; + + return result; +} + +dp.sh.Highlighter.prototype.SwitchToList = function() +{ + // thanks to Lachlan Donald from SitePoint.com for this
    tag fix. + var html = this.div.innerHTML.replace(/<(br)\/?>/gi, '\n'); + var lines = html.split('\n'); + + if(this.addControls == true) + this.bar.appendChild(dp.sh.Toolbar.Create(this)); + + // add columns ruler + if(this.showColumns) + { + var div = this.CreateElement('div'); + var columns = this.CreateElement('div'); + var showEvery = 10; + var i = 1; + + while(i <= 150) + { + if(i % showEvery === 0) + { + div.innerHTML += i; + i += (i + '').length; + } + else + { + div.innerHTML += '·'; + i++; + } + } + + columns.className = 'cumns'; + columns.appendChild(div); + this.bar.appendChild(columns); + } + + for(var i = 0; i < lines.length - 1; i++) + { + var li = this.CreateElement('LI'); + var span = this.CreateElement('SPAN'); + + // uses .line1 and .line2 css styles for alternating lines + li.className = (i % 2 === 0) ? 'alt' : ''; + span.innerHTML = lines[i] + ' '; + + li.appendChild(span); + this.ol.appendChild(li); + } + + this.div.innerHTML = ''; +} + +dp.sh.Highlighter.prototype.Highlight = function(code) +{ + function Trim(str) + { + return str.replace(/^\s*(.*?)[\s\n]*$/g, '$1'); + } + + function Chop(str) + { + return str.replace(/\n*$/, '').replace(/^\n*/, ''); + } + + function Unindent(str) + { + var lines = dp.sh.Utils.FixForBlogger(str).split('\n'); + var indents = new Array(); + var regex = new RegExp('^\\s*', 'g'); + var min = 1000; + + // go through every line and check for common number of indents + for(var i = 0; i < lines.length && min > 0; i++) + { + if(Trim(lines[i]).length === 0) + continue; + + var matches = regex.exec(lines[i]); + + if(matches != null && matches.length > 0) + min = Math.min(matches[0].length, min); + } + + // trim minimum common number of white space from the begining of every line + if(min > 0) + for(var i = 0; i < lines.length; i++) + lines[i] = lines[i].substr(min); + + return lines.join('\n'); + } + + // This function returns a portions of the string from pos1 to pos2 inclusive + function Copy(string, pos1, pos2) + { + return string.substr(pos1, pos2 - pos1); + } + + var pos = 0; + + if(code === null) + code = ''; + + this.originalCode = code; + this.code = Chop(Unindent(code)); + this.div = this.CreateElement('DIV'); + this.bar = this.CreateElement('DIV'); + this.ol = this.CreateElement('OL'); + this.matches = new Array(); + + this.div.className = 'dp-highlighter'; + this.div.highlighter = this; + + this.bar.className = 'bar'; + + // set the first line + if (this.firstLine != null) + this.ol.start = this.firstLine; + + if(this.CssClass != null) + this.ol.className = this.CssClass; + + if(this.collapse) + this.div.className += ' collapsed'; + + if(this.noGutter) + this.div.className += ' nogutter'; + + // replace tabs with spaces + if(this.tabsToSpaces == true) + this.code = this.ProcessSmartTabs(this.code); + + this.ProcessRegexList(); + + // if no matches found, add entire code as plain text + if(this.matches.length === 0) + { + this.AddBit(this.code, null); + this.SwitchToList(); + this.div.appendChild(this.bar); + this.div.appendChild(this.ol); + return; + } + + // sort the matches + this.matches = this.matches.sort(dp.sh.Highlighter.SortCallback); + + // The following loop checks to see if any of the matches are inside + // of other matches. This process would get rid of highligted strings + // inside comments, keywords inside strings and so on. + for(var i = 0; i < this.matches.length; i++) + if(this.IsInside(this.matches[i])) + this.matches[i] = null; + + // Finally, go through the final list of matches and pull the all + // together adding everything in between that isn't a match. + for(var i = 0; i < this.matches.length; i++) + { + var match = this.matches[i]; + + if(match === null || match.length === 0) + continue; + + this.AddBit(Copy(this.code, pos, match.index), null); + this.AddBit(match.value, match.css); + + pos = match.index + match.length; + } + + this.AddBit(this.code.substr(pos), null); + + this.SwitchToList(); + this.div.appendChild(this.bar); + this.div.appendChild(this.ol); +} + +dp.sh.Highlighter.prototype.GetKeywords = function(str) +{ + return '\\b' + str.replace(/ /g, '\\b|\\b') + '\\b'; +} + +dp.sh.BloggerMode = function() +{ + dp.sh.isBloggerMode = true; +} + +// highlightes all elements identified by name and gets source code from specified property +dp.sh.HighlightAll = function(name, showGutter /* optional */, showControls /* optional */, collapseAll /* optional */, firstLine /* optional */, showColumns /* optional */) +{ + function FindValue() + { + var a = arguments; + + for(var i = 0; i < a.length; i++) + { + if(a[i] === null) + continue; + + if(typeof(a[i]) == 'string' && a[i] != '') + return a[i] + ''; + + if(typeof(a[i]) == 'object' && a[i].value != '') + return a[i].value + ''; + } + + return null; + } + + function IsOptionSet(value, list) + { + for(var i = 0; i < list.length; i++) + if(list[i] == value) + return true; + + return false; + } + + function GetOptionValue(name, list, defaultValue) + { + var regex = new RegExp('^' + name + '\\[(\\w+)\\]$', 'gi'); + var matches = null; + + for(var i = 0; i < list.length; i++) + if((matches = regex.exec(list[i])) != null) + return matches[1]; + + return defaultValue; + } + + function FindTagsByName(list, name, tagName) + { + var tags = document.getElementsByTagName(tagName); + + for(var i = 0; i < tags.length; i++) + if(tags[i].getAttribute('name') == name) + list.push(tags[i]); + } + + var elements = []; + var highlighter = null; + var registered = {}; + var propertyName = 'innerHTML'; + + // for some reason IE doesn't find
     by name, however it does see them just fine by tag name... 
    +	FindTagsByName(elements, name, 'pre');
    +	FindTagsByName(elements, name, 'textarea');
    +
    +	if(elements.length === 0)
    +		return;
    +
    +	// register all brushes
    +	for(var brush in dp.sh.Brushes)
    +	{
    +		var aliases = dp.sh.Brushes[brush].Aliases;
    +
    +		if(aliases === null)
    +			continue;
    +		
    +		for(var i = 0; i < aliases.length; i++)
    +			registered[aliases[i]] = brush;
    +	}
    +
    +	for(var i = 0; i < elements.length; i++)
    +	{
    +		var element = elements[i];
    +		var options = FindValue(
    +				element.attributes['class'], element.className, 
    +				element.attributes['language'], element.language
    +				);
    +		var language = '';
    +
    +		if(options === null)
    +			continue;
    +		
    +		options = options.split(':');
    +		
    +		language = options[0].toLowerCase();
    +
    +		if(registered[language] === null)
    +			continue;
    +		
    +		// instantiate a brush
    +		highlighter = new dp.sh.Brushes[registered[language]]();
    +		
    +		// hide the original element
    +		element.style.display = 'none';
    +
    +        if (typeof(showGutter) === 'undefined') {
    +            highlighter.noGutter = IsOptionSet('nogutter', options);
    +        } else {
    +            highlighter.noGutter = !showGutter;
    +        }
    +
    +        if (typeof(showControls) === 'undefined') {
    +            highlighter.addControls = !IsOptionSet('nocontrols', options);
    +        } else {
    +            highlighter.addControls = showControls;
    +        }
    +
    +        if (typeof(collapseAll) === 'undefined') {
    +            highlighter.collapse = IsOptionSet('collapse', options);
    +        } else {
    +            highlighter.collapse = collapseAll;
    +        }
    +
    +        if (typeof(showColumns) === 'undefined') {
    +            highlighter.showColumns = IsOptionSet('showcolumns', options);
    +        } else {
    +            highlighter.showColumns = showColumns;
    +        }
    +
    +		// write out custom brush style
    +		var headNode = document.getElementsByTagName('head')[0];
    +		if(highlighter.Style && headNode)
    +		{
    +			var styleNode = document.createElement('style');
    +			styleNode.setAttribute('type', 'text/css');
    +
    +			if(styleNode.styleSheet) // for IE
    +			{
    +				styleNode.styleSheet.cssText = highlighter.Style;
    +			}
    +			else // for everyone else
    +			{
    +				var textNode = document.createTextNode(highlighter.Style);
    +				styleNode.appendChild(textNode);
    +			}
    +
    +			headNode.appendChild(styleNode);
    +		}
    +		
    +		// first line idea comes from Andrew Collington, thanks!
    +		highlighter.firstLine = (firstLine === null) ? parseInt(GetOptionValue('firstline', options, 1)) : firstLine;
    +
    +		highlighter.Highlight(element[propertyName]);
    +		
    +		highlighter.source = element;
    +
    +		element.parentNode.insertBefore(highlighter.div, element);
    +	}	
    +}
    diff --git a/js/tslib.js b/js/tslib.js
    new file mode 100644
    index 0000000..b0b1ff3
    --- /dev/null
    +++ b/js/tslib.js
    @@ -0,0 +1,243 @@
    +/*! *****************************************************************************
    +Copyright (c) Microsoft Corporation. All rights reserved.
    +Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    +this file except in compliance with the License. You may obtain a copy of the
    +License at http://www.apache.org/licenses/LICENSE-2.0
    +
    +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    +MERCHANTABLITY OR NON-INFRINGEMENT.
    +
    +See the Apache Version 2.0 License for specific language governing permissions
    +and limitations under the License.
    +***************************************************************************** */
    +/* global global, define, System, Reflect, Promise */
    +var __extends;
    +var __assign;
    +var __rest;
    +var __decorate;
    +var __param;
    +var __metadata;
    +var __awaiter;
    +var __generator;
    +var __exportStar;
    +var __values;
    +var __read;
    +var __spread;
    +var __await;
    +var __asyncGenerator;
    +var __asyncDelegator;
    +var __asyncValues;
    +var __makeTemplateObject;
    +var __importStar;
    +var __importDefault;
    +(function (factory) {
    +    var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
    +    if (typeof define === "function" && define.amd) {
    +        define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
    +    }
    +    else if (typeof module === "object" && typeof module.exports === "object") {
    +        factory(createExporter(root, createExporter(module.exports)));
    +    }
    +    else {
    +        factory(createExporter(root));
    +    }
    +    function createExporter(exports, previous) {
    +        if (exports !== root) {
    +            if (typeof Object.create === "function") {
    +                Object.defineProperty(exports, "__esModule", { value: true });
    +            }
    +            else {
    +                exports.__esModule = true;
    +            }
    +        }
    +        return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
    +    }
    +})
    +(function (exporter) {
    +    var extendStatics = Object.setPrototypeOf ||
    +        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
    +        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    +
    +    __extends = function (d, b) {
    +        extendStatics(d, b);
    +        function __() { this.constructor = d; }
    +        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    +    };
    +
    +    __assign = Object.assign || function (t) {
    +        for (var s, i = 1, n = arguments.length; i < n; i++) {
    +            s = arguments[i];
    +            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
    +        }
    +        return t;
    +    };
    +
    +    __rest = function (s, e) {
    +        var t = {};
    +        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
    +            t[p] = s[p];
    +        if (s != null && typeof Object.getOwnPropertySymbols === "function")
    +            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
    +                t[p[i]] = s[p[i]];
    +        return t;
    +    };
    +
    +    __decorate = function (decorators, target, key, desc) {
    +        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    +        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    +        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    +        return c > 3 && r && Object.defineProperty(target, key, r), r;
    +    };
    +
    +    __param = function (paramIndex, decorator) {
    +        return function (target, key) { decorator(target, key, paramIndex); }
    +    };
    +
    +    __metadata = function (metadataKey, metadataValue) {
    +        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
    +    };
    +
    +    __awaiter = function (thisArg, _arguments, P, generator) {
    +        return new (P || (P = Promise))(function (resolve, reject) {
    +            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
    +            function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
    +            function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
    +            step((generator = generator.apply(thisArg, _arguments || [])).next());
    +        });
    +    };
    +
    +    __generator = function (thisArg, body) {
    +        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    +        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    +        function verb(n) { return function (v) { return step([n, v]); }; }
    +        function step(op) {
    +            if (f) throw new TypeError("Generator is already executing.");
    +            while (_) try {
    +                if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
    +                if (y = 0, t) op = [op[0] & 2, t.value];
    +                switch (op[0]) {
    +                    case 0: case 1: t = op; break;
    +                    case 4: _.label++; return { value: op[1], done: false };
    +                    case 5: _.label++; y = op[1]; op = [0]; continue;
    +                    case 7: op = _.ops.pop(); _.trys.pop(); continue;
    +                    default:
    +                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
    +                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
    +                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
    +                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
    +                        if (t[2]) _.ops.pop();
    +                        _.trys.pop(); continue;
    +                }
    +                op = body.call(thisArg, _);
    +            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
    +            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    +        }
    +    };
    +
    +    __exportStar = function (m, exports) {
    +        for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
    +    };
    +
    +    __values = function (o) {
    +        var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
    +        if (m) return m.call(o);
    +        return {
    +            next: function () {
    +                if (o && i >= o.length) o = void 0;
    +                return { value: o && o[i++], done: !o };
    +            }
    +        };
    +    };
    +
    +    __read = function (o, n) {
    +        var m = typeof Symbol === "function" && o[Symbol.iterator];
    +        if (!m) return o;
    +        var i = m.call(o), r, ar = [], e;
    +        try {
    +            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    +        }
    +        catch (error) { e = { error: error }; }
    +        finally {
    +            try {
    +                if (r && !r.done && (m = i["return"])) m.call(i);
    +            }
    +            finally { if (e) throw e.error; }
    +        }
    +        return ar;
    +    };
    +
    +    __spread = function () {
    +        for (var ar = [], i = 0; i < arguments.length; i++)
    +            ar = ar.concat(__read(arguments[i]));
    +        return ar;
    +    };
    +
    +    __await = function (v) {
    +        return this instanceof __await ? (this.v = v, this) : new __await(v);
    +    };
    +
    +    __asyncGenerator = function (thisArg, _arguments, generator) {
    +        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    +        var g = generator.apply(thisArg, _arguments || []), i, q = [];
    +        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
    +        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
    +        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
    +        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);  }
    +        function fulfill(value) { resume("next", value); }
    +        function reject(value) { resume("throw", value); }
    +        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
    +    };
    +
    +    __asyncDelegator = function (o) {
    +        var i, p;
    +        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
    +        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
    +    };
    +
    +    __asyncValues = function (o) {
    +        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    +        var m = o[Symbol.asyncIterator], i;
    +        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
    +        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
    +        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
    +    };
    +
    +    __makeTemplateObject = function (cooked, raw) {
    +        if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    +        return cooked;
    +    };
    +
    +    __importStar = function (mod) {
    +        if (mod && mod.__esModule) return mod;
    +        var result = {};
    +        if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    +        result["default"] = mod;
    +        return result;
    +    };
    +
    +    __importDefault = function (mod) {
    +        return (mod && mod.__esModule) ? mod : { "default": mod };
    +    };
    +
    +    exporter("__extends", __extends);
    +    exporter("__assign", __assign);
    +    exporter("__rest", __rest);
    +    exporter("__decorate", __decorate);
    +    exporter("__param", __param);
    +    exporter("__metadata", __metadata);
    +    exporter("__awaiter", __awaiter);
    +    exporter("__generator", __generator);
    +    exporter("__exportStar", __exportStar);
    +    exporter("__values", __values);
    +    exporter("__read", __read);
    +    exporter("__spread", __spread);
    +    exporter("__await", __await);
    +    exporter("__asyncGenerator", __asyncGenerator);
    +    exporter("__asyncDelegator", __asyncDelegator);
    +    exporter("__asyncValues", __asyncValues);
    +    exporter("__makeTemplateObject", __makeTemplateObject);
    +    exporter("__importStar", __importStar);
    +    exporter("__importDefault", __importDefault);
    +});
    diff --git a/js/urlparams.js b/js/urlparams.js
    new file mode 100644
    index 0000000..43d82cf
    --- /dev/null
    +++ b/js/urlparams.js
    @@ -0,0 +1,20 @@
    +/*  © Clientside Tech and NMG Consulting, LLC  (www.clientsidetech.com)  */
    +function getURLParams(){
    +  var x = document.location.href.split("?");
    +  var argStr = "";
    +  var args = NA();
    +  var pairs = NA();
    +  var argVals = NA();
    +  if(x.length > 1){
    +    argStr = x[1];
    +    argVals = argStr.split("&");
    +  }
    +  if(argVals.length > 0){
    +    for(var i=0;i\x20\t\r\n\f]+)/i.exec(r)||
    +["",""])[1].toLowerCase()];if(B)for(var K=0;K"+r+"";y.body.innerHTML=r;for(a.a(y);this.content.firstChild;)k.call(this.content,this.content.firstChild);r=y.body;if(B)for(K=0;K"+this.innerHTML+""},set:function(r){if(this.parentNode){y.body.innerHTML=r;for(r=this.ownerDocument.createDocumentFragment();y.body.firstChild;)l.call(r,
    +y.body.firstChild);m.call(this.parentNode,r,this)}else throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");},configurable:!0})};n(a.prototype);J(a.prototype);a.a=function(p){p=b(p,"template");for(var r=0,B=p.length,K;r]/g,hb=function(p){switch(p){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}};w=function(p){for(var r={},B=0;B";break a;case Node.TEXT_NODE:z=z.data;z=R&&ib[R.localName]?
    +z:z.replace(hc,hb);break a;case Node.COMMENT_NODE:z="\x3c!--"+z.data+"--\x3e";break a;default:throw window.console.error(z),Error("not implemented");}}B+=z}return B}}if(c||M){a.b=function(p,r){var B=f.call(p,!1);this.U&&this.U(B);r&&(l.call(B.content,f.call(p.content,!0)),I(B.content,p.content));return B};var I=function(p,r){if(r.querySelectorAll&&(r=b(r,"template"),0!==r.length)){p=b(p,"template");for(var B=0,K=p.length,aa,la;B]/g;function Yc(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}}function Zc(a){for(var b={},c=0;c";break a;case Node.TEXT_NODE:h=h.data;h=k&&ad[k.localName]?h:h.replace(Xc,Yc);break a;case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h),
    +Error("not implemented");}}c+=h}return c};var cd=N.B,dd={querySelector:function(a){return this.__shady_native_querySelector(a)},querySelectorAll:function(a){return this.__shady_native_querySelectorAll(a)}},ed={};function fd(a){ed[a]=function(b){return b["__shady_native_"+a]}}function gd(a,b){P(a,b,"__shady_native_");for(var c in b)fd(c)}function S(a,b){b=void 0===b?[]:b;for(var c=0;ce.assignedNodes.length&&(e.ra=!0)}e.ra&&(e.ra=!1,sf(this,c))}c=this.a;b=[];for(e=0;eb.indexOf(d))||b.push(d);for(c=0;c "+h}))}return{value:a,Qa:b,stop:f}}function ci(a,b){a=a.split(/(\[.+?\])/);for(var c=[],d=0;d+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,fi=/[[.:#*]/,Yh=/^(::slotted)/,ei=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,di=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,ai=/(.*):dir\((?:(ltr|rtl))\)(.*)/,Wh=/:(?:matches|any|-(?:webkit|moz)-any)/,Lh=new Ih;function hi(a,b,c,d,e){this.H=a||null;this.b=b||null;this.ta=c||[];this.F=null;this.cssBuild=e||"";this.ca=d||"";this.a=this.G=this.L=null}function ii(a){return a?a.__styleInfo:null}function ji(a,b){return a.__styleInfo=b}hi.prototype.c=function(){return this.H};hi.prototype._getStyleRules=hi.prototype.c;function ki(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var li=/:host\s*>\s*/,mi=navigator.userAgent.match("Trident");function ni(){}function oi(a){var b={},c=[],d=0;sh(a,function(f){pi(f);f.index=d++;f=f.v.cssText;for(var g;g=mh.exec(f);){var h=g[1];":"!==g[2]&&(b[h]=!0)}},function(f){c.push(f)});a.b=c;a=[];for(var e in b)a.push(e);return a}
    +function pi(a){if(!a.v){var b={},c={};qi(a,c)&&(b.K=c,a.rules=null);b.cssText=a.parsedCssText.replace(ph,"").replace(kh,"");a.v=b}}function qi(a,b){var c=a.v;if(c){if(c.K)return Object.assign(b,c.K),!0}else{c=a.parsedCssText;for(var d;a=kh.exec(c);){d=(a[2]||a[3]).trim();if("inherit"!==d||"unset"!==d)b[a[1].trim()]=d;d=!0}return d}}
    +function ri(a,b,c){b&&(b=0<=b.indexOf(";")?si(a,b,c):Bh(b,function(d,e,f,g){if(!e)return d+g;(e=ri(a,c[e],c))&&"initial"!==e?"apply-shim-inherit"===e&&(e="inherit"):e=ri(a,c[f]||f,c)||f;return d+(e||"")+g}));return b&&b.trim()||""}
    +function si(a,b,c){b=b.split(";");for(var d=0,e,f;d *."+e||-1!==f.indexOf("html"),h=!g&&0===f.indexOf(e));if(g||h)c=e,h&&(b.w||(b.w=Sh(Lh,b,Lh.b,a?"."+a:"",e)),c=b.w||e),g&&"html"===e&&(c=b.w||b.J),d({wa:c,Xa:h,mb:g})}}
    +function vi(a,b,c){var d={},e={};sh(b,function(f){ui(a,f,c,function(g){ki.call(a._element||a,g.wa)&&(g.Xa?qi(f,d):qi(f,e))})},null,!0);return{cb:e,Va:d}}
    +function wi(a,b,c,d){var e=Eh(b),f=Rh(e.is,e.ca),g=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),h=ii(b);e=h.H;h=h.cssBuild;var k=xi(e,d);return Ph(b,e,function(l){var m="";l.v||pi(l);l.v.cssText&&(m=si(a,l.v.cssText,c));l.cssText=m;if(!V&&!uh(l)&&l.cssText){var q=m=l.cssText;null==l.Da&&(l.Da=nh.test(m));if(l.Da)if(null==l.ka){l.ka=[];for(var H in k)q=k[H],q=q(m),m!==q&&(m=q,l.ka.push(H))}else{for(H=0;H=l._useCount&&l.parentNode&&l.parentNode.removeChild(l));V?k.a?(k.a.textContent=h,g=k.a):h&&(g=vh(h,f,a.shadowRoot,k.b)):g?g.parentNode||(mi&&-1F&&-1==[34,35,60,62,63,96].indexOf(F)?t:encodeURIComponent(t)}function d(t){var F=t.charCodeAt(0);return 32F&&-1==[34,35,60,62,96].indexOf(F)?t:encodeURIComponent(t)}function e(t,F,E){function M(ka){va.push(ka)}var y=F||"scheme start",W=0,w="",wa=!1,fa=!1,va=[];a:for(;(void 0!=t[W-1]||0==W)&&!this.h;){var n=t[W];switch(y){case "scheme start":if(n&&q.test(n))w+=
    +n.toLowerCase(),y="scheme";else if(F){M("Invalid scheme.");break a}else{w="";y="no scheme";continue}break;case "scheme":if(n&&H.test(n))w+=n.toLowerCase();else if(":"==n){this.g=w;w="";if(F)break a;void 0!==l[this.g]&&(this.A=!0);y="file"==this.g?"relative":this.A&&E&&E.g==this.g?"relative or authority":this.A?"authority first slash":"scheme data"}else if(F){void 0!=n&&M("Code point not allowed in scheme: "+n);break a}else{w="";W=0;y="no scheme";continue}break;case "scheme data":"?"==n?(this.o="?",
    +y="query"):"#"==n?(this.u="#",y="fragment"):void 0!=n&&"\t"!=n&&"\n"!=n&&"\r"!=n&&(this.pa+=c(n));break;case "no scheme":if(E&&void 0!==l[E.g]){y="relative";continue}else M("Missing scheme."),f.call(this),this.h=!0;break;case "relative or authority":if("/"==n&&"/"==t[W+1])y="authority ignore slashes";else{M("Expected /, got: "+n);y="relative";continue}break;case "relative":this.A=!0;"file"!=this.g&&(this.g=E.g);if(void 0==n){this.i=E.i;this.m=E.m;this.j=E.j.slice();this.o=E.o;this.s=E.s;this.f=E.f;
    +break a}else if("/"==n||"\\"==n)"\\"==n&&M("\\ is an invalid code point."),y="relative slash";else if("?"==n)this.i=E.i,this.m=E.m,this.j=E.j.slice(),this.o="?",this.s=E.s,this.f=E.f,y="query";else if("#"==n)this.i=E.i,this.m=E.m,this.j=E.j.slice(),this.o=E.o,this.u="#",this.s=E.s,this.f=E.f,y="fragment";else{y=t[W+1];var J=t[W+2];if("file"!=this.g||!q.test(n)||":"!=y&&"|"!=y||void 0!=J&&"/"!=J&&"\\"!=J&&"?"!=J&&"#"!=J)this.i=E.i,this.m=E.m,this.s=E.s,this.f=E.f,this.j=E.j.slice(),this.j.pop();y=
    +"relative path";continue}break;case "relative slash":if("/"==n||"\\"==n)"\\"==n&&M("\\ is an invalid code point."),y="file"==this.g?"file host":"authority ignore slashes";else{"file"!=this.g&&(this.i=E.i,this.m=E.m,this.s=E.s,this.f=E.f);y="relative path";continue}break;case "authority first slash":if("/"==n)y="authority second slash";else{M("Expected '/', got: "+n);y="authority ignore slashes";continue}break;case "authority second slash":y="authority ignore slashes";if("/"!=n){M("Expected '/', got: "+
    +n);continue}break;case "authority ignore slashes":if("/"!=n&&"\\"!=n){y="authority";continue}else M("Expected authority, got: "+n);break;case "authority":if("@"==n){wa&&(M("@ already seen."),w+="%40");wa=!0;for(n=0;n elements before custom elements
    +    if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {
    +      HTMLTemplateElement.bootstrap(window.document);
    +    }
    +    polyfillsLoaded = true;
    +    runWhenLoadedFns().then(fireEvent);
    +  }
    +
    +  function runWhenLoadedFns() {
    +    allowUpgrades = false;
    +    var fnsMap = whenLoadedFns.map(function(fn) {
    +      return fn instanceof Function ? fn() : fn;
    +    });
    +    whenLoadedFns = [];
    +    return Promise.all(fnsMap).then(function() {
    +      allowUpgrades = true;
    +      flushFn && flushFn();
    +    }).catch(function(err) {
    +      console.error(err);
    +    });
    +  }
    +
    +  window.WebComponents = window.WebComponents || {};
    +  window.WebComponents.ready = window.WebComponents.ready || false;
    +  window.WebComponents.waitFor = window.WebComponents.waitFor || function(waitFn) {
    +    if (!waitFn) {
    +      return;
    +    }
    +    whenLoadedFns.push(waitFn);
    +    if (polyfillsLoaded) {
    +      runWhenLoadedFns();
    +    }
    +  };
    +  window.WebComponents._batchCustomElements = batchCustomElements;
    +
    +  var name = 'webcomponents-loader.js';
    +  // Feature detect which polyfill needs to be imported.
    +  var polyfills = [];
    +  if (!('attachShadow' in Element.prototype && 'getRootNode' in Element.prototype) ||
    +    (window.ShadyDOM && window.ShadyDOM.force)) {
    +    polyfills.push('sd');
    +  }
    +  if (!window.customElements || window.customElements.forcePolyfill) {
    +    polyfills.push('ce');
    +  }
    +
    +  var needsTemplate = (function() {
    +    // no real