├── pics
└── logo.jpg
├── locales
├── cs_CZ.mo
├── en_GB.mo
├── fi_FI.mo
├── fr_FR.mo
├── pl_PL.mo
├── pt_BR.mo
├── ro_RO.mo
├── ru_RU.mo
├── tr_TR.mo
├── glpi.pot
├── en_GB.po
├── fr_FR.po
├── tr_TR.po
├── pt_BR.po
├── fi_FI.po
├── pl_PL.po
├── es_EC.po
├── cs_CZ.po
├── ro_RO.po
└── ru_RU.po
├── financialreports.png
├── sql
├── update-1.5.sql
├── update-1.6.0.sql
├── empty-1.4.sql
├── empty-1.5.sql
├── empty-1.6.0.sql
├── empty-2.3.0.sql
├── empty-2.5.0.sql
├── empty-3.0.0.sql
├── update-1.7.0.sql
├── empty-2.1.0.sql
└── empty-1.7.0.sql
├── composer.json
├── tools
├── extract_template.sh
├── update_mo.pl
└── update_po.pl
├── ISSUE_TEMPLATE.md
├── .github
└── workflows
│ ├── updatepot.yml
│ ├── generatemo.yml
│ └── release.yml
├── inc
├── index.php
├── parameter.class.php
├── config.class.php
├── profile.class.php
├── pdf.class.php
└── financialreport.class.php
├── front
├── index.php
├── report.dynamic.php
├── config.form.php
└── financialreport.php
├── index.php
├── README.md
├── setup.php
├── financialreports.xml
├── hook.php
└── LICENSE
/pics/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/pics/logo.jpg
--------------------------------------------------------------------------------
/locales/cs_CZ.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/cs_CZ.mo
--------------------------------------------------------------------------------
/locales/en_GB.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/en_GB.mo
--------------------------------------------------------------------------------
/locales/fi_FI.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/fi_FI.mo
--------------------------------------------------------------------------------
/locales/fr_FR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/fr_FR.mo
--------------------------------------------------------------------------------
/locales/pl_PL.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/pl_PL.mo
--------------------------------------------------------------------------------
/locales/pt_BR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/pt_BR.mo
--------------------------------------------------------------------------------
/locales/ro_RO.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/ro_RO.mo
--------------------------------------------------------------------------------
/locales/ru_RU.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/ru_RU.mo
--------------------------------------------------------------------------------
/locales/tr_TR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/locales/tr_TR.mo
--------------------------------------------------------------------------------
/financialreports.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/financialreports.png
--------------------------------------------------------------------------------
/sql/update-1.5.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `glpi_plugin_state_parameters`
2 | ADD `monitor` VARCHAR(50)
3 | AFTER `server`;
4 | ALTER TABLE `glpi_plugin_state_parameters`
5 | ADD `phone` VARCHAR(50)
6 | AFTER `networking`;
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "minimum-stability": "dev",
3 | "prefer-stable": true,
4 | "require-dev": {
5 | "glpi-project/tools": "^0.4"
6 | },
7 | "require": {
8 | "tecnickcom/tcpdf": "^6.4.4"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tools/extract_template.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed)
4 |
5 | xgettext *.php */*.php --copyright-holder='Financialreports Development Team' --package-name='GLPI - Financialreports plugin' --package-version='2.0.0' -o locales/glpi.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \
6 | --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t \
7 | --keyword=_ex:1c,2,3t --keyword=_nx:1c,2,3,5t --keyword=_sx:1c,2,3t
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/sql/update-1.6.0.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `glpi_plugin_state_profiles`
2 | DROP COLUMN `interface`,
3 | DROP COLUMN `is_default`;
4 |
5 | DROP TABLE IF EXISTS `glpi_plugin_state_repelled`;
6 | CREATE TABLE `glpi_plugin_state_repelled` (
7 | `ID` INT(11) NOT NULL AUTO_INCREMENT,
8 | `FK_device` INT(11) NOT NULL DEFAULT '0',
9 | `device_type` INT(11) NOT NULL DEFAULT '0',
10 | `date_repelled` DATE NULL DEFAULT NULL,
11 | PRIMARY KEY (`ID`),
12 | KEY `FK_device` (`FK_device`, `device_type`)
13 | )
14 | ENGINE = MyISAM
15 | DEFAULT CHARSET = utf8
16 | COLLATE = utf8_unicode_ci;
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Dear GLPi user.
2 |
3 | BEFORE SUBMITTING YOUR ISSUE, please make sure to read and follow these steps :
4 |
5 | * Verify that your question has not already been asked
6 | * Please use the below template.
7 | * Delete this text before submiting your issue.
8 |
9 | The Plugin team.
10 |
11 | ------------
12 | * Version of the plugin :
13 |
14 |
15 | * Version of your GLPI :
16 |
17 |
18 | * Steps to reproduce (which actions have you made) :
19 |
20 |
21 | * Expected result :
22 |
23 |
24 | * Actual result :
25 |
26 |
27 | * URL of the page :
28 |
29 |
30 | * Screenshot of the problem (if pertinent) :
31 |
32 |
--------------------------------------------------------------------------------
/tools/update_mo.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | #!/usr/bin/perl -w
3 |
4 | if (@ARGV!=0){
5 | print "USAGE update_mo.pl\n\n";
6 |
7 | exit();
8 | }
9 |
10 |
11 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n";
12 | foreach (readdir(DIRHANDLE)){
13 | if ($_ ne '..' && $_ ne '.'){
14 |
15 | if(!(-l "$dir/$_")){
16 | if (index($_,".po",0)==length($_)-3) {
17 | $lang=$_;
18 | $lang=~s/\.po//;
19 |
20 | `msgfmt locales/$_ -o locales/$lang.mo`;
21 | }
22 | }
23 |
24 | }
25 | }
26 | closedir DIRHANDLE;
27 |
28 | #
29 | #
30 |
--------------------------------------------------------------------------------
/.github/workflows/updatepot.yml:
--------------------------------------------------------------------------------
1 | name: Update POT
2 | on:
3 | push:
4 | branches: [ master ]
5 | paths-ignore:
6 | - 'locales/**'
7 |
8 | env:
9 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 | jobs:
11 | run:
12 |
13 | name: Update POT
14 |
15 | runs-on: ubuntu-latest
16 | steps:
17 | - name: Checkout repo
18 | uses: actions/checkout@v2
19 |
20 | - name: install xgettext
21 |
22 | run: sudo apt-get install gettext;
23 | - name: Update POT
24 | run: sh tools/extract_template.sh;
25 |
26 |
27 | - name: Commit changes
28 | uses: EndBug/add-and-commit@v5.1.0
29 | with:
30 | message: "Update POT"
31 | - name: Push changes
32 |
33 | uses: actions-go/push@v1
34 |
35 |
--------------------------------------------------------------------------------
/tools/update_po.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | #!/usr/bin/perl -w
3 |
4 | if (@ARGV!=2){
5 | print "USAGE update_po.pl transifex_login transifex_password\n\n";
6 |
7 | exit();
8 | }
9 | $user = $ARGV[0];
10 | $password = $ARGV[1];
11 |
12 | opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n";
13 | foreach (readdir(DIRHANDLE)){
14 | if ($_ ne '..' && $_ ne '.'){
15 |
16 | if(!(-l "$dir/$_")){
17 | if (index($_,".po",0)==length($_)-3) {
18 | $lang=$_;
19 | $lang=~s/\.po//;
20 |
21 | `wget --user=$user --password=$password --output-document=locales/$_ http://www.transifex.com/api/2/project/GLPI_financialreports/resource/glpi/translation/$lang/?file=$_`;
22 | }
23 | }
24 |
25 | }
26 | }
27 | closedir DIRHANDLE;
28 |
29 | #
30 | #
31 |
--------------------------------------------------------------------------------
/.github/workflows/generatemo.yml:
--------------------------------------------------------------------------------
1 | name: Generate MO
2 | on:
3 | push:
4 | branches: [ master ]
5 | paths:
6 | - '**.po'
7 | env:
8 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 | jobs:
10 | run:
11 |
12 | name: Generate mo
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Checkout repo
16 | uses: actions/checkout@v2
17 |
18 | - name: Setup Perl environment
19 | # You may pin to the exact commit or the version.
20 | # uses: shogo82148/actions-setup-perl@8d2e3d59a9516b785ed32169d48a4888eaa9b514
21 | uses: shogo82148/actions-setup-perl@v1.7.2
22 | - name: msgfmt
23 | # You may pin to the exact commit or the version.
24 | # uses: whtsky/msgfmt-action@6b2181f051b002182d01a1e1f1aff216230c5a4d
25 | uses: whtsky/msgfmt-action@20190305
26 | - name: Generate mo
27 | run: perl tools/update_mo.pl;
28 |
29 | - name: Commit changes
30 | uses: EndBug/add-and-commit@v5.1.0
31 | with:
32 |
33 | message: "Generate mo"
34 | - name: Push changes
35 |
36 | uses: actions-go/push@v1
37 |
38 |
--------------------------------------------------------------------------------
/inc/index.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
--------------------------------------------------------------------------------
/front/index.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # financialreports
2 | Plugin financialreports pour GLPI
3 |
4 | Ce plugin est sur Transifex - Aidez-nous à le traduire :
5 | https://www.transifex.com/infotelGLPI/GLPI_financialreports/
6 |
7 | This plugin is on Transifex - Help us to translate :
8 | https://www.transifex.com/infotelGLPI/GLPI_financialreports/
9 |
10 | Ce plugin vous permet de générer un arrété du parc à une date donnée.
11 | > * Dans la configuration, renseignez l'identifiant pour chaque type de matériel de l'inventaire correspondant au numéro d'inventaire. (exemple : Vos pcs portables ont un numéro d'inventaire commençant par PO renseignez donc le plugin avec PO, Serveurs : SE, PC Fixes : PC etc).
12 | > * Sélectionnez le statut correspondant au rebut et pour le matériel concerné, définissez leur date de rebut.
13 | > * Générez le rapport.
14 | > * Export Csv, Pdf
15 |
16 | This plugin allows you to generate a financial report (asset situation) for a given date.
17 | > * in plugin setup, add identifier for each type of equipment inventory related to the inventory number (example : your notebooks have un inventory number beginnning with 'PO' so fill the setup plugin with PO, Servers : SE, Computers : PC etc).
18 | > * Select the corresponding status discarded and to the equipment in question, set the date of disposal.
19 | > * Generate the report.
20 | > * Export Csv, Pdf.
21 |
--------------------------------------------------------------------------------
/sql/empty-1.4.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_state_profiles`;
2 | CREATE TABLE `glpi_plugin_state_profiles` (
3 | `ID` INT(11) NOT NULL AUTO_INCREMENT,
4 | `name` VARCHAR(255) DEFAULT NULL,
5 | `interface` VARCHAR(50) NOT NULL DEFAULT 'state',
6 | `is_default` ENUM ('0', '1') NOT NULL DEFAULT '0',
7 | `state` CHAR(1) DEFAULT NULL,
8 | PRIMARY KEY (`ID`),
9 | KEY `interface` (`interface`)
10 | ) ENGINE = MyISAM;
11 |
12 | DROP TABLE IF EXISTS `glpi_plugin_state_config`;
13 | CREATE TABLE `glpi_plugin_state_config` (
14 | `ID` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
15 | `state` INT(11) NOT NULL
16 | )
17 | ENGINE = MyISAM
18 | DEFAULT CHARSET = utf8
19 | COLLATE = utf8_unicode_ci;
20 |
21 | DROP TABLE IF EXISTS `glpi_plugin_state_parameters`;
22 | CREATE TABLE `glpi_plugin_state_parameters` (
23 | `ID` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
24 | `computer` VARCHAR(50),
25 | `notebook` VARCHAR(50),
26 | `server` VARCHAR(50),
27 | `printer` VARCHAR(50),
28 | `peripheral` VARCHAR(50),
29 | `networking` VARCHAR(50)
30 | )
31 | ENGINE = MyISAM
32 | DEFAULT CHARSET = utf8
33 | COLLATE = utf8_unicode_ci;
34 |
35 | INSERT INTO `glpi_plugin_state_parameters` (`computer`, `notebook`, `server`, `printer`, `peripheral`, `networking`)
36 | VALUES (NULL, NULL, NULL, NULL, NULL, NULL);
--------------------------------------------------------------------------------
/sql/empty-1.5.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_state_profiles`;
2 | CREATE TABLE `glpi_plugin_state_profiles` (
3 | `ID` INT(11) NOT NULL AUTO_INCREMENT,
4 | `name` VARCHAR(255) DEFAULT NULL,
5 | `interface` VARCHAR(50) NOT NULL DEFAULT 'state',
6 | `is_default` ENUM ('0', '1') NOT NULL DEFAULT '0',
7 | `state` CHAR(1) DEFAULT NULL,
8 | PRIMARY KEY (`ID`),
9 | KEY `interface` (`interface`)
10 | ) ENGINE = MyISAM;
11 |
12 | DROP TABLE IF EXISTS `glpi_plugin_state_config`;
13 | CREATE TABLE `glpi_plugin_state_config` (
14 | `ID` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
15 | `state` INT(11) NOT NULL
16 | )
17 | ENGINE = MyISAM
18 | DEFAULT CHARSET = utf8
19 | COLLATE = utf8_unicode_ci;
20 |
21 | DROP TABLE IF EXISTS `glpi_plugin_state_parameters`;
22 | CREATE TABLE `glpi_plugin_state_parameters` (
23 | `ID` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
24 | `computer` VARCHAR(50),
25 | `notebook` VARCHAR(50),
26 | `server` VARCHAR(50),
27 | `monitor` VARCHAR(50),
28 | `printer` VARCHAR(50),
29 | `peripheral` VARCHAR(50),
30 | `networking` VARCHAR(50),
31 | `phone` VARCHAR(50)
32 | )
33 | ENGINE = MyISAM
34 | DEFAULT CHARSET = utf8
35 | COLLATE = utf8_unicode_ci;
36 |
37 | INSERT INTO `glpi_plugin_state_parameters` (`computer`, `notebook`, `server`, `monitor`, `printer`, `peripheral`, `networking`, `phone`)
38 | VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
--------------------------------------------------------------------------------
/sql/empty-1.6.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_state_profiles`;
2 | CREATE TABLE `glpi_plugin_state_profiles` (
3 | `ID` INT(11) NOT NULL AUTO_INCREMENT,
4 | `name` VARCHAR(255) DEFAULT NULL,
5 | `state` CHAR(1) DEFAULT NULL,
6 | PRIMARY KEY (`ID`),
7 | KEY `name` (`name`)
8 | ) ENGINE = MyISAM;
9 |
10 | DROP TABLE IF EXISTS `glpi_plugin_state_config`;
11 | CREATE TABLE `glpi_plugin_state_config` (
12 | `ID` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
13 | `state` INT(11) NOT NULL
14 | )
15 | ENGINE = MyISAM
16 | DEFAULT CHARSET = utf8
17 | COLLATE = utf8_unicode_ci;
18 |
19 | DROP TABLE IF EXISTS `glpi_plugin_state_parameters`;
20 | CREATE TABLE `glpi_plugin_state_parameters` (
21 | `ID` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
22 | `computer` VARCHAR(50),
23 | `notebook` VARCHAR(50),
24 | `server` VARCHAR(50),
25 | `monitor` VARCHAR(50),
26 | `printer` VARCHAR(50),
27 | `peripheral` VARCHAR(50),
28 | `networking` VARCHAR(50),
29 | `phone` VARCHAR(50)
30 | )
31 | ENGINE = MyISAM
32 | DEFAULT CHARSET = utf8
33 | COLLATE = utf8_unicode_ci;
34 |
35 | INSERT INTO `glpi_plugin_state_parameters` (`computer`, `notebook`, `server`, `monitor`, `printer`, `peripheral`, `networking`, `phone`)
36 | VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
37 |
38 | DROP TABLE IF EXISTS `glpi_plugin_state_repelled`;
39 | CREATE TABLE `glpi_plugin_state_repelled` (
40 | `ID` INT(11) NOT NULL AUTO_INCREMENT,
41 | `FK_device` INT(11) NOT NULL DEFAULT '0',
42 | `device_type` INT(11) NOT NULL DEFAULT '0',
43 | `date_repelled` DATE NULL DEFAULT NULL,
44 | PRIMARY KEY (`ID`),
45 | KEY `FK_device` (`FK_device`, `device_type`)
46 | )
47 | ENGINE = MyISAM
48 | DEFAULT CHARSET = utf8
49 | COLLATE = utf8_unicode_ci;
--------------------------------------------------------------------------------
/sql/empty-2.3.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_configs`;
2 | CREATE TABLE `glpi_plugin_financialreports_configs` (
3 | `id` INT(11) NOT NULL AUTO_INCREMENT,
4 | `states_id` INT(11) NOT NULL DEFAULT '0'
5 | COMMENT 'RELATION to glpi_states (id)',
6 | PRIMARY KEY (`id`)
7 | )
8 | ENGINE = MyISAM
9 | DEFAULT CHARSET = utf8
10 | COLLATE = utf8_unicode_ci;
11 |
12 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_parameters`;
13 | CREATE TABLE `glpi_plugin_financialreports_parameters` (
14 | `id` INT(11) NOT NULL AUTO_INCREMENT,
15 | `computers_otherserial` VARCHAR(255)
16 | COLLATE utf8_unicode_ci DEFAULT NULL,
17 | `notebooks_otherserial` VARCHAR(255)
18 | COLLATE utf8_unicode_ci DEFAULT NULL,
19 | `servers_otherserial` VARCHAR(255)
20 | COLLATE utf8_unicode_ci DEFAULT NULL,
21 | `monitors_otherserial` VARCHAR(255)
22 | COLLATE utf8_unicode_ci DEFAULT NULL,
23 | `printers_otherserial` VARCHAR(255)
24 | COLLATE utf8_unicode_ci DEFAULT NULL,
25 | `peripherals_otherserial` VARCHAR(255)
26 | COLLATE utf8_unicode_ci DEFAULT NULL,
27 | `networkequipments_otherserial` VARCHAR(255)
28 | COLLATE utf8_unicode_ci DEFAULT NULL,
29 | `phones_otherserial` VARCHAR(255)
30 | COLLATE utf8_unicode_ci DEFAULT NULL,
31 | PRIMARY KEY (`id`)
32 | )
33 | ENGINE = MyISAM
34 | DEFAULT CHARSET = utf8
35 | COLLATE = utf8_unicode_ci;
36 |
37 | INSERT INTO `glpi_plugin_financialreports_parameters` (`computers_otherserial`, `notebooks_otherserial`, `servers_otherserial`, `monitors_otherserial`, `printers_otherserial`, `peripherals_otherserial`, `networkequipments_otherserial`, `phones_otherserial`)
38 | VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
--------------------------------------------------------------------------------
/sql/empty-2.5.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_configs`;
2 | CREATE TABLE `glpi_plugin_financialreports_configs` (
3 | `id` INT(11) NOT NULL AUTO_INCREMENT,
4 | `states_id` INT(11) NOT NULL DEFAULT '0'
5 | COMMENT 'RELATION to glpi_states (id)',
6 | PRIMARY KEY (`id`)
7 | )
8 | ENGINE = InnoDB
9 | DEFAULT CHARSET = utf8
10 | COLLATE = utf8_unicode_ci;
11 |
12 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_parameters`;
13 | CREATE TABLE `glpi_plugin_financialreports_parameters` (
14 | `id` INT(11) NOT NULL AUTO_INCREMENT,
15 | `computers_otherserial` VARCHAR(255)
16 | COLLATE utf8_unicode_ci DEFAULT NULL,
17 | `notebooks_otherserial` VARCHAR(255)
18 | COLLATE utf8_unicode_ci DEFAULT NULL,
19 | `servers_otherserial` VARCHAR(255)
20 | COLLATE utf8_unicode_ci DEFAULT NULL,
21 | `monitors_otherserial` VARCHAR(255)
22 | COLLATE utf8_unicode_ci DEFAULT NULL,
23 | `printers_otherserial` VARCHAR(255)
24 | COLLATE utf8_unicode_ci DEFAULT NULL,
25 | `peripherals_otherserial` VARCHAR(255)
26 | COLLATE utf8_unicode_ci DEFAULT NULL,
27 | `networkequipments_otherserial` VARCHAR(255)
28 | COLLATE utf8_unicode_ci DEFAULT NULL,
29 | `phones_otherserial` VARCHAR(255)
30 | COLLATE utf8_unicode_ci DEFAULT NULL,
31 | PRIMARY KEY (`id`)
32 | )
33 | ENGINE = InnoDB
34 | DEFAULT CHARSET = utf8
35 | COLLATE = utf8_unicode_ci;
36 |
37 | INSERT INTO `glpi_plugin_financialreports_parameters` (`computers_otherserial`, `notebooks_otherserial`, `servers_otherserial`, `monitors_otherserial`, `printers_otherserial`, `peripherals_otherserial`, `networkequipments_otherserial`, `phones_otherserial`)
38 | VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
--------------------------------------------------------------------------------
/sql/empty-3.0.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_configs`;
2 | CREATE TABLE `glpi_plugin_financialreports_configs` (
3 | `id` int unsigned NOT NULL AUTO_INCREMENT,
4 | `states_id` int unsigned NOT NULL DEFAULT '0'
5 | COMMENT 'RELATION to glpi_states (id)',
6 | PRIMARY KEY (`id`)
7 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
8 |
9 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_parameters`;
10 | CREATE TABLE `glpi_plugin_financialreports_parameters` (
11 | `id` int unsigned NOT NULL AUTO_INCREMENT,
12 | `computers_otherserial` VARCHAR(255)
13 | COLLATE utf8mb4_unicode_ci DEFAULT NULL,
14 | `notebooks_otherserial` VARCHAR(255)
15 | COLLATE utf8mb4_unicode_ci DEFAULT NULL,
16 | `servers_otherserial` VARCHAR(255)
17 | COLLATE utf8mb4_unicode_ci DEFAULT NULL,
18 | `monitors_otherserial` VARCHAR(255)
19 | COLLATE utf8mb4_unicode_ci DEFAULT NULL,
20 | `printers_otherserial` VARCHAR(255)
21 | COLLATE utf8mb4_unicode_ci DEFAULT NULL,
22 | `peripherals_otherserial` VARCHAR(255)
23 | COLLATE utf8mb4_unicode_ci DEFAULT NULL,
24 | `networkequipments_otherserial` VARCHAR(255)
25 | COLLATE utf8mb4_unicode_ci DEFAULT NULL,
26 | `phones_otherserial` VARCHAR(255)
27 | COLLATE utf8mb4_unicode_ci DEFAULT NULL,
28 | PRIMARY KEY (`id`)
29 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
30 |
31 | INSERT INTO `glpi_plugin_financialreports_parameters` (`computers_otherserial`, `notebooks_otherserial`, `servers_otherserial`, `monitors_otherserial`, `printers_otherserial`, `peripherals_otherserial`, `networkequipments_otherserial`, `phones_otherserial`)
32 | VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
33 |
--------------------------------------------------------------------------------
/front/report.dynamic.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 |
31 | include('../../../inc/includes.php');
32 |
33 | Session::checkCentralAccess();
34 |
35 | if (!isset($_POST["start"])) $_POST["start"] = 0;
36 | if (!isset($_POST["is_deleted"])) $_POST["is_deleted"] = "0";
37 | if (isset($_POST["display_type"])) {
38 |
39 | if ($_POST["display_type"] < 0) {
40 | $_POST["display_type"] = -$_POST["display_type"];
41 | $_POST["export_all"] = 1;
42 | }
43 |
44 | $display = ['displaypc' => $_SESSION["displaypc"],
45 | 'displaynotebook' => $_SESSION["displaynotebook"],
46 | 'displayserver' => $_SESSION["displayserver"],
47 | 'displaymonitor' => $_SESSION["displaymonitor"],
48 | 'displayprinter' => $_SESSION["displayprinter"],
49 | 'displaynetworking' => $_SESSION["displaynetworking"],
50 | 'displayperipheral' => $_SESSION["displayperipheral"],
51 | 'displayphone' => $_SESSION["displayphone"],
52 | 'displaydisposal' => $_SESSION["displaydisposal"]];
53 |
54 | $report = new PluginFinancialreportsFinancialreport();
55 | $report->displayReport($_POST, $display);
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/sql/update-1.7.0.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE `glpi_plugin_state_profiles`
2 | RENAME `glpi_plugin_financialreports_profiles`;
3 | ALTER TABLE `glpi_plugin_state_config`
4 | RENAME `glpi_plugin_financialreports_configs`;
5 | ALTER TABLE `glpi_plugin_state_parameters`
6 | RENAME `glpi_plugin_financialreports_parameters`;
7 | ALTER TABLE `glpi_plugin_state_repelled`
8 | RENAME `glpi_plugin_financialreports_disposalitems`;
9 |
10 | ALTER TABLE `glpi_plugin_financialreports_profiles`
11 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT,
12 | ADD `profiles_id` INT(11) NOT NULL DEFAULT '0'
13 | COMMENT 'RELATION to glpi_profiles (id)',
14 | CHANGE `state` `financialreports` CHAR(1)
15 | COLLATE utf8_unicode_ci DEFAULT NULL,
16 | ADD INDEX (`profiles_id`);
17 |
18 | ALTER TABLE `glpi_plugin_financialreports_configs`
19 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT,
20 | CHANGE `state` `states_id` INT(11) NOT NULL DEFAULT '0'
21 | COMMENT 'RELATION to glpi_states (id)';
22 |
23 | ALTER TABLE `glpi_plugin_financialreports_parameters`
24 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT,
25 | CHANGE `computer` `computers_otherserial` VARCHAR(255)
26 | COLLATE utf8_unicode_ci DEFAULT NULL,
27 | CHANGE `notebook` `notebooks_otherserial` VARCHAR(255)
28 | COLLATE utf8_unicode_ci DEFAULT NULL,
29 | CHANGE `server` `servers_otherserial` VARCHAR(255)
30 | COLLATE utf8_unicode_ci DEFAULT NULL,
31 | CHANGE `monitor` `monitors_otherserial` VARCHAR(255)
32 | COLLATE utf8_unicode_ci DEFAULT NULL,
33 | CHANGE `printer` `printers_otherserial` VARCHAR(255)
34 | COLLATE utf8_unicode_ci DEFAULT NULL,
35 | CHANGE `peripheral` `peripherals_otherserial` VARCHAR(255)
36 | COLLATE utf8_unicode_ci DEFAULT NULL,
37 | CHANGE `networking` `networkequipments_otherserial` VARCHAR(255)
38 | COLLATE utf8_unicode_ci DEFAULT NULL,
39 | CHANGE `phone` `phones_otherserial` VARCHAR(255)
40 | COLLATE utf8_unicode_ci DEFAULT NULL;
41 |
42 | ALTER TABLE `glpi_plugin_financialreports_disposalitems`
43 | CHANGE `ID` `id` INT(11) NOT NULL AUTO_INCREMENT,
44 | CHANGE `FK_device` `items_id` INT(11) NOT NULL DEFAULT '0'
45 | COMMENT 'RELATION to various tables, according to itemtype (id)',
46 | CHANGE `device_type` `itemtype` VARCHAR(100)
47 | COLLATE utf8_unicode_ci NOT NULL
48 | COMMENT 'see .class.php file',
49 | CHANGE `date_repelled` `date_disposal` DATE DEFAULT NULL,
50 | DROP INDEX `FK_device`,
51 | ADD UNIQUE `unicity` (`items_id`, `itemtype`);
--------------------------------------------------------------------------------
/front/config.form.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 |
31 | include('../../../inc/includes.php');
32 |
33 | if (Plugin::isPluginActive("financialreports")) {
34 |
35 | Session::checkRight("config", UPDATE);
36 |
37 | $param = new PluginFinancialreportsParameter();
38 | $config = new PluginFinancialreportsConfig();
39 |
40 | if (isset($_POST["add_state"])) {
41 |
42 | $config->add($_POST);
43 | Html::back();
44 |
45 | } else if (isset($_POST["delete_state"])) {
46 |
47 | foreach ($_POST["item"] as $ID => $value) {
48 | $config->delete(["id" => $ID], 1);
49 | }
50 |
51 | Html::back();
52 |
53 | } else if (isset($_POST["update_parameters"])) {
54 |
55 | $param->update($_POST);
56 | Html::back();
57 |
58 | } else {
59 |
60 | Html::header(__('Setup'), '', "config", "plugins");
61 | $param->showParameterForm();
62 | $config->showConfigForm();
63 |
64 | }
65 |
66 | } else {
67 | Html::header(__('Setup'), '', "config", "plugins");
68 | echo "
";
69 | echo "" . __('Please activate the plugin', 'financialreports') . "
";
70 | }
71 |
72 | Html::footer();
73 |
--------------------------------------------------------------------------------
/sql/empty-2.1.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_configs`;
2 | CREATE TABLE `glpi_plugin_financialreports_configs` (
3 | `id` INT(11) NOT NULL AUTO_INCREMENT,
4 | `states_id` INT(11) NOT NULL DEFAULT '0'
5 | COMMENT 'RELATION to glpi_states (id)',
6 | PRIMARY KEY (`id`)
7 | )
8 | ENGINE = MyISAM
9 | DEFAULT CHARSET = utf8
10 | COLLATE = utf8_unicode_ci;
11 |
12 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_parameters`;
13 | CREATE TABLE `glpi_plugin_financialreports_parameters` (
14 | `id` INT(11) NOT NULL AUTO_INCREMENT,
15 | `computers_otherserial` VARCHAR(255)
16 | COLLATE utf8_unicode_ci DEFAULT NULL,
17 | `notebooks_otherserial` VARCHAR(255)
18 | COLLATE utf8_unicode_ci DEFAULT NULL,
19 | `servers_otherserial` VARCHAR(255)
20 | COLLATE utf8_unicode_ci DEFAULT NULL,
21 | `monitors_otherserial` VARCHAR(255)
22 | COLLATE utf8_unicode_ci DEFAULT NULL,
23 | `printers_otherserial` VARCHAR(255)
24 | COLLATE utf8_unicode_ci DEFAULT NULL,
25 | `peripherals_otherserial` VARCHAR(255)
26 | COLLATE utf8_unicode_ci DEFAULT NULL,
27 | `networkequipments_otherserial` VARCHAR(255)
28 | COLLATE utf8_unicode_ci DEFAULT NULL,
29 | `phones_otherserial` VARCHAR(255)
30 | COLLATE utf8_unicode_ci DEFAULT NULL,
31 | PRIMARY KEY (`id`)
32 | )
33 | ENGINE = MyISAM
34 | DEFAULT CHARSET = utf8
35 | COLLATE = utf8_unicode_ci;
36 |
37 | INSERT INTO `glpi_plugin_financialreports_parameters` (`computers_otherserial`, `notebooks_otherserial`, `servers_otherserial`, `monitors_otherserial`, `printers_otherserial`, `peripherals_otherserial`, `networkequipments_otherserial`, `phones_otherserial`)
38 | VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
39 |
40 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_disposalitems`;
41 | CREATE TABLE `glpi_plugin_financialreports_disposalitems` (
42 | `id` INT(11) NOT NULL AUTO_INCREMENT,
43 | `items_id` INT(11) NOT NULL DEFAULT '0'
44 | COMMENT 'RELATION to various tables, according to itemtype (id)',
45 | `itemtype` VARCHAR(100)
46 | COLLATE utf8_unicode_ci NOT NULL
47 | COMMENT 'see .class.php file',
48 | `date_disposal` DATE DEFAULT NULL,
49 | PRIMARY KEY (`id`),
50 | UNIQUE KEY `unicity` (`items_id`, `itemtype`)
51 | )
52 | ENGINE = MyISAM
53 | DEFAULT CHARSET = utf8
54 | COLLATE = utf8_unicode_ci;
--------------------------------------------------------------------------------
/locales/glpi.pot:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | #, fuzzy
7 | msgid ""
8 | msgstr ""
9 | "Project-Id-Version: GLPI - Financialreports plugin 2.0.0\n"
10 | "Report-Msgid-Bugs-To: \n"
11 | "POT-Creation-Date: 2022-07-26 13:55+0000\n"
12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 | "Last-Translator: FULL NAME \n"
14 | "Language-Team: LANGUAGE \n"
15 | "Language: \n"
16 | "MIME-Version: 1.0\n"
17 | "Content-Type: text/plain; charset=CHARSET\n"
18 | "Content-Transfer-Encoding: 8bit\n"
19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20 |
21 | #: setup.php:76 inc/financialreport.class.php:49 inc/profile.class.php:152
22 | msgid "Financial report"
23 | msgid_plural "Financial reports"
24 | msgstr[0] ""
25 | msgstr[1] ""
26 |
27 | #: front/config.form.php:69
28 | msgid "Please activate the plugin"
29 | msgstr ""
30 |
31 | #: front/financialreport.php:158
32 | msgid "Report date"
33 | msgstr ""
34 |
35 | #: inc/config.class.php:90 inc/config.class.php:109
36 | msgid "Disposal status"
37 | msgstr ""
38 |
39 | #: inc/financialreport.class.php:435 inc/pdf.class.php:210
40 | msgid "Financial report ended on"
41 | msgstr ""
42 |
43 | #: inc/financialreport.class.php:470 inc/financialreport.class.php:472
44 | #: inc/parameter.class.php:55
45 | msgid "Notebook"
46 | msgid_plural "Notebooks"
47 | msgstr[0] ""
48 | msgstr[1] ""
49 |
50 | #: inc/financialreport.class.php:480 inc/financialreport.class.php:482
51 | #: inc/parameter.class.php:60
52 | msgid "Server"
53 | msgid_plural "Servers"
54 | msgstr[0] ""
55 | msgstr[1] ""
56 |
57 | #: inc/financialreport.class.php:567 inc/financialreport.class.php:569
58 | msgid "Element out"
59 | msgid_plural "Elements out"
60 | msgstr[0] ""
61 | msgstr[1] ""
62 |
63 | #: inc/financialreport.class.php:591 inc/pdf.class.php:321
64 | msgid "General Total"
65 | msgstr ""
66 |
67 | #: inc/financialreport.class.php:592 inc/financialreport.class.php:642
68 | #: inc/financialreport.class.php:668 inc/financialreport.class.php:692
69 | msgid "Euro"
70 | msgid_plural "Euros"
71 | msgstr[0] ""
72 | msgstr[1] ""
73 |
74 | #: inc/financialreport.class.php:654
75 | msgid "Hide"
76 | msgstr ""
77 |
78 | #: inc/financialreport.class.php:656
79 | msgid "Display"
80 | msgstr ""
81 |
82 | #: inc/financialreport.class.php:682 inc/pdf.class.php:252
83 | msgid "User / Group"
84 | msgstr ""
85 |
86 | #: inc/financialreport.class.php:692
87 | msgid "Purchase Price HT in"
88 | msgstr ""
89 |
90 | #: inc/financialreport.class.php:724
91 | msgid "In stock / available"
92 | msgstr ""
93 |
94 | #: inc/parameter.class.php:46
95 | msgid "Identification parameters of inventory number"
96 | msgstr ""
97 |
98 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
99 | msgid "HT"
100 | msgstr ""
101 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 |
2 | on:
3 | push:
4 | # Sequence of patterns matched against refs/tags
5 | tags:
6 | - '*.*.*' # Push events to matching ex:20.15.10
7 |
8 | name: Create release with tag
9 | env:
10 | TAG_VALUE: ${GITHUB_REF/refs\/tags\//}
11 | jobs:
12 | build:
13 | name: Upload Release Asset
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Checkout code
17 | uses: actions/checkout@v2
18 | - name: Setup PHP
19 | uses: shivammathur/setup-php@v2
20 | with:
21 | php-version: 7.4
22 | - name: Build project # This would actually build your project, using zip for an example artifact
23 | id: build_
24 | env:
25 | GITHUB_NAME: ${{ github.event.repository.name }}
26 |
27 |
28 | run: php -v ;sudo apt-get install libxml-xpath-perl; sudo apt-get install composer;echo $(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml);echo ::set-output name=version_glpi::$(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml); [[ -f composer.json ]] && composer install --no-dev; rm -rf $GITHUB_NAME.xml tools wiki screenshots test .git .github ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png;cd ..; tar -jcvf glpi-$GITHUB_NAME-${GITHUB_REF/refs\/tags\//}.tar.bz2 $GITHUB_NAME;ls -al;echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//};echo ${{ steps.getxml.outputs.info }};
29 | # run: rm -rf $GITHUB_NAME.xml tools wiki screenshots test ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png; tar -zcvf glpi-$GITHUB_NAME-$GITHUB_TAG.tar.bz2 $GITHUB_NAME
30 | - name: Create Release
31 | id: create_release
32 | uses: actions/create-release@v1
33 | env:
34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 | with:
36 | tag_name: ${{ github.ref }}
37 | release_name: |
38 | GLPI ${{ steps.build_.outputs.version_glpi }} : Version ${{ github.ref }} disponible / available
39 | body : Version ${{ steps.build_.outputs.tag }} released for GLPI ${{ steps.build_.outputs.version_glpi }}
40 | draft: false
41 | prerelease: true
42 | - name: Upload Release Asset
43 | id: upload-release-asset
44 | uses: actions/upload-release-asset@v1
45 | env:
46 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 | GITHUB_NAME: ${{ github.event.repository.name }}
48 | with:
49 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
50 | asset_path: /home/runner/work/${{ github.event.repository.name }}/glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2
51 | asset_name: glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2
52 | asset_content_type: application/zip
53 |
54 |
--------------------------------------------------------------------------------
/sql/empty-1.7.0.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_profiles`;
2 | CREATE TABLE `glpi_plugin_financialreports_profiles` (
3 | `id` INT(11) NOT NULL AUTO_INCREMENT,
4 | `profiles_id` INT(11) NOT NULL DEFAULT '0'
5 | COMMENT 'RELATION to glpi_profiles (id)',
6 | `financialreports` CHAR(1)
7 | COLLATE utf8_unicode_ci DEFAULT NULL,
8 | PRIMARY KEY (`id`),
9 | KEY `profiles_id` (`profiles_id`)
10 | )
11 | ENGINE = MyISAM
12 | DEFAULT CHARSET = utf8
13 | COLLATE = utf8_unicode_ci;
14 |
15 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_configs`;
16 | CREATE TABLE `glpi_plugin_financialreports_configs` (
17 | `id` INT(11) NOT NULL AUTO_INCREMENT,
18 | `states_id` INT(11) NOT NULL DEFAULT '0'
19 | COMMENT 'RELATION to glpi_states (id)',
20 | PRIMARY KEY (`id`)
21 | )
22 | ENGINE = MyISAM
23 | DEFAULT CHARSET = utf8
24 | COLLATE = utf8_unicode_ci;
25 |
26 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_parameters`;
27 | CREATE TABLE `glpi_plugin_financialreports_parameters` (
28 | `id` INT(11) NOT NULL AUTO_INCREMENT,
29 | `computers_otherserial` VARCHAR(255)
30 | COLLATE utf8_unicode_ci DEFAULT NULL,
31 | `notebooks_otherserial` VARCHAR(255)
32 | COLLATE utf8_unicode_ci DEFAULT NULL,
33 | `servers_otherserial` VARCHAR(255)
34 | COLLATE utf8_unicode_ci DEFAULT NULL,
35 | `monitors_otherserial` VARCHAR(255)
36 | COLLATE utf8_unicode_ci DEFAULT NULL,
37 | `printers_otherserial` VARCHAR(255)
38 | COLLATE utf8_unicode_ci DEFAULT NULL,
39 | `peripherals_otherserial` VARCHAR(255)
40 | COLLATE utf8_unicode_ci DEFAULT NULL,
41 | `networkequipments_otherserial` VARCHAR(255)
42 | COLLATE utf8_unicode_ci DEFAULT NULL,
43 | `phones_otherserial` VARCHAR(255)
44 | COLLATE utf8_unicode_ci DEFAULT NULL,
45 | PRIMARY KEY (`id`)
46 | )
47 | ENGINE = MyISAM
48 | DEFAULT CHARSET = utf8
49 | COLLATE = utf8_unicode_ci;
50 |
51 | INSERT INTO `glpi_plugin_financialreports_parameters` (`computers_otherserial`, `notebooks_otherserial`, `servers_otherserial`, `monitors_otherserial`, `printers_otherserial`, `peripherals_otherserial`, `networkequipments_otherserial`, `phones_otherserial`)
52 | VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
53 |
54 | DROP TABLE IF EXISTS `glpi_plugin_financialreports_disposalitems`;
55 | CREATE TABLE `glpi_plugin_financialreports_disposalitems` (
56 | `id` INT(11) NOT NULL AUTO_INCREMENT,
57 | `items_id` INT(11) NOT NULL DEFAULT '0'
58 | COMMENT 'RELATION to various tables, according to itemtype (id)',
59 | `itemtype` VARCHAR(100)
60 | COLLATE utf8_unicode_ci NOT NULL
61 | COMMENT 'see .class.php file',
62 | `date_disposal` DATE DEFAULT NULL,
63 | PRIMARY KEY (`id`),
64 | UNIQUE KEY `unicity` (`items_id`, `itemtype`)
65 | )
66 | ENGINE = MyISAM
67 | DEFAULT CHARSET = utf8
68 | COLLATE = utf8_unicode_ci;
--------------------------------------------------------------------------------
/locales/en_GB.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | #
5 | # Translators:
6 | msgid ""
7 | msgstr ""
8 | "Project-Id-Version: GLPI Project - financialreports plugin\n"
9 | "Report-Msgid-Bugs-To: \n"
10 | "POT-Creation-Date: 2019-01-23 17:10+0100\n"
11 | "PO-Revision-Date: 2019-01-23 16:11+0000\n"
12 | "Last-Translator: Kevin HAINRY \n"
13 | "Language-Team: English (United Kingdom) (http://www.transifex.com/tsmr/GLPI_financialreports/language/en_GB/)\n"
14 | "MIME-Version: 1.0\n"
15 | "Content-Type: text/plain; charset=UTF-8\n"
16 | "Content-Transfer-Encoding: 8bit\n"
17 | "Language: en_GB\n"
18 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19 |
20 | #: setup.php:67 inc/financialreport.class.php:49 inc/profile.class.php:152
21 | msgid "Financial report"
22 | msgid_plural "Financial reports"
23 | msgstr[0] "Financial report"
24 | msgstr[1] "Financial reports"
25 |
26 | #: front/config.form.php:71
27 | msgid "Please activate the plugin"
28 | msgstr "Please activate the plugin"
29 |
30 | #: front/financialreport.php:158
31 | msgid "Report date"
32 | msgstr "Report date"
33 |
34 | #: inc/config.class.php:90 inc/config.class.php:107
35 | msgid "Disposal status"
36 | msgstr "Disposal status"
37 |
38 | #: inc/financialreport.class.php:419
39 | msgid "Financial report ended on"
40 | msgstr "Financial report ended on"
41 |
42 | #: inc/financialreport.class.php:454 inc/financialreport.class.php:456
43 | #: inc/parameter.class.php:54
44 | msgid "Notebook"
45 | msgid_plural "Notebooks"
46 | msgstr[0] "Notebook"
47 | msgstr[1] "Notebooks"
48 |
49 | #: inc/financialreport.class.php:464 inc/financialreport.class.php:466
50 | #: inc/parameter.class.php:58
51 | msgid "Server"
52 | msgid_plural "Servers"
53 | msgstr[0] "Server"
54 | msgstr[1] "Servers"
55 |
56 | #: inc/financialreport.class.php:551 inc/financialreport.class.php:553
57 | msgid "Element out"
58 | msgid_plural "Elements out"
59 | msgstr[0] "Element out"
60 | msgstr[1] "Elements out"
61 |
62 | #: inc/financialreport.class.php:575 inc/pdf.class.php:321
63 | msgid "General Total"
64 | msgstr "General Total"
65 |
66 | #: inc/financialreport.class.php:576 inc/financialreport.class.php:626
67 | #: inc/financialreport.class.php:652 inc/financialreport.class.php:676
68 | msgid "Euro"
69 | msgid_plural "Euros"
70 | msgstr[0] "Euro"
71 | msgstr[1] "Euros"
72 |
73 | #: inc/financialreport.class.php:638
74 | msgid "Hide"
75 | msgstr "Hide"
76 |
77 | #: inc/financialreport.class.php:640
78 | msgid "Display"
79 | msgstr "Display"
80 |
81 | #: inc/financialreport.class.php:666 inc/pdf.class.php:252
82 | msgid "User / Group"
83 | msgstr "User / Group"
84 |
85 | #: inc/financialreport.class.php:676
86 | msgid "Purchase Price HT in"
87 | msgstr "Purchase Price HT in"
88 |
89 | #: inc/financialreport.class.php:708
90 | msgid "In stock / available"
91 | msgstr "In stock / available"
92 |
93 | #: inc/parameter.class.php:46
94 | msgid "Identification parameters of inventory number"
95 | msgstr "Identification parameters of inventory number"
96 |
97 | #: inc/pdf.class.php:210
98 | msgid "Asset situation ended on"
99 | msgstr "Asset situation ended on"
100 |
101 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
102 | msgid "HT"
103 | msgstr "HT"
104 |
--------------------------------------------------------------------------------
/locales/fr_FR.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Xavier CAILLAUD , 2020
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - Financialreports plugin 2.0.0\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2019-02-24 15:03+0100\n"
15 | "PO-Revision-Date: 2020-11-02 16:05+0000\n"
16 | "Last-Translator: Xavier CAILLAUD , 2020\n"
17 | "Language-Team: French (France) (https://www.transifex.com/infotelGLPI/teams/12361/fr_FR/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: fr_FR\n"
22 | "Plural-Forms: nplurals=2; plural=(n > 1);\n"
23 |
24 | #: setup.php:67 inc/financialreport.class.php:49 inc/profile.class.php:152
25 | msgid "Financial report"
26 | msgid_plural "Financial reports"
27 | msgstr[0] "Arrêté du parc"
28 | msgstr[1] "Arrêtés du parc"
29 |
30 | #: front/config.form.php:71
31 | msgid "Please activate the plugin"
32 | msgstr "Merci d'activer ce plugin"
33 |
34 | #: front/financialreport.php:158
35 | msgid "Report date"
36 | msgstr "Date rapport"
37 |
38 | #: inc/config.class.php:90 inc/config.class.php:107
39 | msgid "Disposal status"
40 | msgstr "Statut de désimmobilisation"
41 |
42 | #: inc/financialreport.class.php:419 inc/pdf.class.php:210
43 | msgid "Financial report ended on"
44 | msgstr "Etat du parc arrêté au"
45 |
46 | #: inc/financialreport.class.php:454 inc/financialreport.class.php:456
47 | #: inc/parameter.class.php:54
48 | msgid "Notebook"
49 | msgid_plural "Notebooks"
50 | msgstr[0] "Portable"
51 | msgstr[1] "Portables"
52 |
53 | #: inc/financialreport.class.php:464 inc/financialreport.class.php:466
54 | #: inc/parameter.class.php:58
55 | msgid "Server"
56 | msgid_plural "Servers"
57 | msgstr[0] "Serveur"
58 | msgstr[1] "Serveurs"
59 |
60 | #: inc/financialreport.class.php:551 inc/financialreport.class.php:553
61 | msgid "Element out"
62 | msgid_plural "Elements out"
63 | msgstr[0] "Elément sorti"
64 | msgstr[1] "Eléments sortis"
65 |
66 | #: inc/financialreport.class.php:575 inc/pdf.class.php:321
67 | msgid "General Total"
68 | msgstr "Total général"
69 |
70 | #: inc/financialreport.class.php:576 inc/financialreport.class.php:626
71 | #: inc/financialreport.class.php:652 inc/financialreport.class.php:676
72 | msgid "Euro"
73 | msgid_plural "Euros"
74 | msgstr[0] "Euro"
75 | msgstr[1] "Euros"
76 |
77 | #: inc/financialreport.class.php:638
78 | msgid "Hide"
79 | msgstr "Cacher"
80 |
81 | #: inc/financialreport.class.php:640
82 | msgid "Display"
83 | msgstr "Afficher"
84 |
85 | #: inc/financialreport.class.php:666 inc/pdf.class.php:252
86 | msgid "User / Group"
87 | msgstr "Utilisateur / Groupe"
88 |
89 | #: inc/financialreport.class.php:676
90 | msgid "Purchase Price HT in"
91 | msgstr "Prix d'achat HT en"
92 |
93 | #: inc/financialreport.class.php:708
94 | msgid "In stock / available"
95 | msgstr "En stock / disponible"
96 |
97 | #: inc/parameter.class.php:46
98 | msgid "Identification parameters of inventory number"
99 | msgstr "Paramètres d'identification du n° d'inventaire"
100 |
101 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
102 | msgid "HT"
103 | msgstr "HT"
104 |
--------------------------------------------------------------------------------
/locales/tr_TR.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Xavier CAILLAUD , 2020
8 | # Kaya Zeren , 2025
9 | #
10 | #, fuzzy
11 | msgid ""
12 | msgstr ""
13 | "Project-Id-Version: GLPI - Financialreports plugin 2.0.0\n"
14 | "Report-Msgid-Bugs-To: \n"
15 | "POT-Creation-Date: 2022-07-26 13:55+0000\n"
16 | "PO-Revision-Date: 2020-11-02 16:05+0000\n"
17 | "Last-Translator: Kaya Zeren , 2025\n"
18 | "Language-Team: Turkish (Turkey) (https://app.transifex.com/infotelGLPI/teams/12361/tr_TR/)\n"
19 | "MIME-Version: 1.0\n"
20 | "Content-Type: text/plain; charset=UTF-8\n"
21 | "Content-Transfer-Encoding: 8bit\n"
22 | "Language: tr_TR\n"
23 | "Plural-Forms: nplurals=2; plural=(n > 1);\n"
24 |
25 | #: setup.php:76 inc/financialreport.class.php:49 inc/profile.class.php:152
26 | msgid "Financial report"
27 | msgid_plural "Financial reports"
28 | msgstr[0] "Mali rapor"
29 | msgstr[1] "Mali raporlar"
30 |
31 | #: front/config.form.php:69
32 | msgid "Please activate the plugin"
33 | msgstr "Lütfen eklentiyi etkinleştirin"
34 |
35 | #: front/financialreport.php:158
36 | msgid "Report date"
37 | msgstr "Rapor tarihi"
38 |
39 | #: inc/config.class.php:90 inc/config.class.php:109
40 | msgid "Disposal status"
41 | msgstr "Düşme durumu"
42 |
43 | #: inc/financialreport.class.php:435 inc/pdf.class.php:210
44 | msgid "Financial report ended on"
45 | msgstr "Mali rapor bitiş tarihi"
46 |
47 | #: inc/financialreport.class.php:470 inc/financialreport.class.php:472
48 | #: inc/parameter.class.php:55
49 | msgid "Notebook"
50 | msgid_plural "Notebooks"
51 | msgstr[0] "Not defteri"
52 | msgstr[1] "Not defterleri"
53 |
54 | #: inc/financialreport.class.php:480 inc/financialreport.class.php:482
55 | #: inc/parameter.class.php:60
56 | msgid "Server"
57 | msgid_plural "Servers"
58 | msgstr[0] "Sunucu"
59 | msgstr[1] "Sunucular"
60 |
61 | #: inc/financialreport.class.php:567 inc/financialreport.class.php:569
62 | msgid "Element out"
63 | msgid_plural "Elements out"
64 | msgstr[0] "Bileşen düşüldü"
65 | msgstr[1] "Bileşen düşüldü"
66 |
67 | #: inc/financialreport.class.php:591 inc/pdf.class.php:321
68 | msgid "General Total"
69 | msgstr "Genel toplam"
70 |
71 | #: inc/financialreport.class.php:592 inc/financialreport.class.php:642
72 | #: inc/financialreport.class.php:668 inc/financialreport.class.php:692
73 | msgid "Euro"
74 | msgid_plural "Euros"
75 | msgstr[0] "EUR"
76 | msgstr[1] "EUR"
77 |
78 | #: inc/financialreport.class.php:654
79 | msgid "Hide"
80 | msgstr "Gizle"
81 |
82 | #: inc/financialreport.class.php:656
83 | msgid "Display"
84 | msgstr "Görüntüle"
85 |
86 | #: inc/financialreport.class.php:682 inc/pdf.class.php:252
87 | msgid "User / Group"
88 | msgstr "Kullanıcı / grup"
89 |
90 | #: inc/financialreport.class.php:692
91 | msgid "Purchase Price HT in"
92 | msgstr "Satın alma fiyatı HT "
93 |
94 | #: inc/financialreport.class.php:724
95 | msgid "In stock / available"
96 | msgstr "Stokta / kullanılabilir"
97 |
98 | #: inc/parameter.class.php:46
99 | msgid "Identification parameters of inventory number"
100 | msgstr "Stok numarasının açılımı"
101 |
102 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
103 | msgid "HT"
104 | msgstr "HT"
105 |
--------------------------------------------------------------------------------
/locales/pt_BR.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Xavier CAILLAUD , 2020
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - Financialreports plugin 2.0.0\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2019-02-24 15:03+0100\n"
15 | "PO-Revision-Date: 2020-11-02 16:05+0000\n"
16 | "Last-Translator: Xavier CAILLAUD , 2020\n"
17 | "Language-Team: Portuguese (Brazil) (https://www.transifex.com/infotelGLPI/teams/12361/pt_BR/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: pt_BR\n"
22 | "Plural-Forms: nplurals=2; plural=(n > 1);\n"
23 |
24 | #: setup.php:67 inc/financialreport.class.php:49 inc/profile.class.php:152
25 | msgid "Financial report"
26 | msgid_plural "Financial reports"
27 | msgstr[0] "Situação do ativo"
28 | msgstr[1] "Situação dos ativos"
29 |
30 | #: front/config.form.php:71
31 | msgid "Please activate the plugin"
32 | msgstr "Por favor, ative o plugin"
33 |
34 | #: front/financialreport.php:158
35 | msgid "Report date"
36 | msgstr "Data do relatório"
37 |
38 | #: inc/config.class.php:90 inc/config.class.php:107
39 | msgid "Disposal status"
40 | msgstr "Status de descarte"
41 |
42 | #: inc/financialreport.class.php:419 inc/pdf.class.php:210
43 | msgid "Financial report ended on"
44 | msgstr "Situação do ativo terminou em"
45 |
46 | #: inc/financialreport.class.php:454 inc/financialreport.class.php:456
47 | #: inc/parameter.class.php:54
48 | msgid "Notebook"
49 | msgid_plural "Notebooks"
50 | msgstr[0] "Notebook"
51 | msgstr[1] "Notebooks"
52 |
53 | #: inc/financialreport.class.php:464 inc/financialreport.class.php:466
54 | #: inc/parameter.class.php:58
55 | msgid "Server"
56 | msgid_plural "Servers"
57 | msgstr[0] "Servidor"
58 | msgstr[1] "Servidores"
59 |
60 | #: inc/financialreport.class.php:551 inc/financialreport.class.php:553
61 | msgid "Element out"
62 | msgid_plural "Elements out"
63 | msgstr[0] "Elemento fora"
64 | msgstr[1] "Elementos fora"
65 |
66 | #: inc/financialreport.class.php:575 inc/pdf.class.php:321
67 | msgid "General Total"
68 | msgstr "Total geral"
69 |
70 | #: inc/financialreport.class.php:576 inc/financialreport.class.php:626
71 | #: inc/financialreport.class.php:652 inc/financialreport.class.php:676
72 | msgid "Euro"
73 | msgid_plural "Euros"
74 | msgstr[0] "Euro"
75 | msgstr[1] "Euros"
76 |
77 | #: inc/financialreport.class.php:638
78 | msgid "Hide"
79 | msgstr "Esconder"
80 |
81 | #: inc/financialreport.class.php:640
82 | msgid "Display"
83 | msgstr "Exibir"
84 |
85 | #: inc/financialreport.class.php:666 inc/pdf.class.php:252
86 | msgid "User / Group"
87 | msgstr "Usuário / Grupo"
88 |
89 | #: inc/financialreport.class.php:676
90 | msgid "Purchase Price HT in"
91 | msgstr "Preço de compra HT em"
92 |
93 | #: inc/financialreport.class.php:708
94 | msgid "In stock / available"
95 | msgstr "em estoque / disponível"
96 |
97 | #: inc/parameter.class.php:46
98 | msgid "Identification parameters of inventory number"
99 | msgstr "Parâmetros de identificação do número do inventário"
100 |
101 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
102 | msgid "HT"
103 | msgstr "HT"
104 |
--------------------------------------------------------------------------------
/locales/fi_FI.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Xavier CAILLAUD , 2020
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - Financialreports plugin 2.0.0\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2019-02-24 15:03+0100\n"
15 | "PO-Revision-Date: 2020-11-02 16:05+0000\n"
16 | "Last-Translator: Xavier CAILLAUD , 2020\n"
17 | "Language-Team: Finnish (Finland) (https://www.transifex.com/infotelGLPI/teams/12361/fi_FI/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: fi_FI\n"
22 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
23 |
24 | #: setup.php:67 inc/financialreport.class.php:49 inc/profile.class.php:152
25 | msgid "Financial report"
26 | msgid_plural "Financial reports"
27 | msgstr[0] "Omaisuuden tilanne"
28 | msgstr[1] "Omaisuuden tilanteet"
29 |
30 | #: front/config.form.php:71
31 | msgid "Please activate the plugin"
32 | msgstr "Ole hyvä ja aktivoi liitännäinen"
33 |
34 | #: front/financialreport.php:158
35 | msgid "Report date"
36 | msgstr "Raportin päivämäärä"
37 |
38 | #: inc/config.class.php:90 inc/config.class.php:107
39 | msgid "Disposal status"
40 | msgstr "Hävityksen tila"
41 |
42 | #: inc/financialreport.class.php:419 inc/pdf.class.php:210
43 | msgid "Financial report ended on"
44 | msgstr "Hallintasuhde päättyi"
45 |
46 | #: inc/financialreport.class.php:454 inc/financialreport.class.php:456
47 | #: inc/parameter.class.php:54
48 | msgid "Notebook"
49 | msgid_plural "Notebooks"
50 | msgstr[0] "Kannettava tietokone"
51 | msgstr[1] "Kannettavat tietokoneet"
52 |
53 | #: inc/financialreport.class.php:464 inc/financialreport.class.php:466
54 | #: inc/parameter.class.php:58
55 | msgid "Server"
56 | msgid_plural "Servers"
57 | msgstr[0] "Palvelin"
58 | msgstr[1] "Palvelimet"
59 |
60 | #: inc/financialreport.class.php:551 inc/financialreport.class.php:553
61 | msgid "Element out"
62 | msgid_plural "Elements out"
63 | msgstr[0] "Liittyvä laite"
64 | msgstr[1] "Liittyvät laitteet"
65 |
66 | #: inc/financialreport.class.php:575 inc/pdf.class.php:321
67 | msgid "General Total"
68 | msgstr "Yhteensä"
69 |
70 | #: inc/financialreport.class.php:576 inc/financialreport.class.php:626
71 | #: inc/financialreport.class.php:652 inc/financialreport.class.php:676
72 | msgid "Euro"
73 | msgid_plural "Euros"
74 | msgstr[0] "Euro"
75 | msgstr[1] "Euroa"
76 |
77 | #: inc/financialreport.class.php:638
78 | msgid "Hide"
79 | msgstr "Piilota"
80 |
81 | #: inc/financialreport.class.php:640
82 | msgid "Display"
83 | msgstr "Näytä"
84 |
85 | #: inc/financialreport.class.php:666 inc/pdf.class.php:252
86 | msgid "User / Group"
87 | msgstr "Käyttäjä / Ryhmä"
88 |
89 | #: inc/financialreport.class.php:676
90 | msgid "Purchase Price HT in"
91 | msgstr "Verollinen ostohinta"
92 |
93 | #: inc/financialreport.class.php:708
94 | msgid "In stock / available"
95 | msgstr "Varastossa / saatavilla"
96 |
97 | #: inc/parameter.class.php:46
98 | msgid "Identification parameters of inventory number"
99 | msgstr "Inventointinumeron tunnistus parametrit"
100 |
101 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
102 | msgid "HT"
103 | msgstr "Veroton hinta"
104 |
--------------------------------------------------------------------------------
/locales/pl_PL.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | #
5 | # Translators:
6 | # Pawel , 2016
7 | msgid ""
8 | msgstr ""
9 | "Project-Id-Version: GLPI Project - financialreports plugin\n"
10 | "Report-Msgid-Bugs-To: \n"
11 | "POT-Creation-Date: 2019-01-23 17:10+0100\n"
12 | "PO-Revision-Date: 2019-01-23 16:11+0000\n"
13 | "Last-Translator: Kevin HAINRY \n"
14 | "Language-Team: Polish (Poland) (http://www.transifex.com/tsmr/GLPI_financialreports/language/pl_PL/)\n"
15 | "MIME-Version: 1.0\n"
16 | "Content-Type: text/plain; charset=UTF-8\n"
17 | "Content-Transfer-Encoding: 8bit\n"
18 | "Language: pl_PL\n"
19 | "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
20 |
21 | #: setup.php:67 inc/financialreport.class.php:49 inc/profile.class.php:152
22 | msgid "Financial report"
23 | msgid_plural "Financial reports"
24 | msgstr[0] ""
25 | msgstr[1] ""
26 | msgstr[2] ""
27 | msgstr[3] ""
28 |
29 | #: front/config.form.php:71
30 | msgid "Please activate the plugin"
31 | msgstr "Proszę, aktywuj plugin"
32 |
33 | #: front/financialreport.php:158
34 | msgid "Report date"
35 | msgstr "Data raportu"
36 |
37 | #: inc/config.class.php:90 inc/config.class.php:107
38 | msgid "Disposal status"
39 | msgstr ""
40 |
41 | #: inc/financialreport.class.php:419
42 | msgid "Financial report ended on"
43 | msgstr ""
44 |
45 | #: inc/financialreport.class.php:454 inc/financialreport.class.php:456
46 | #: inc/parameter.class.php:54
47 | msgid "Notebook"
48 | msgid_plural "Notebooks"
49 | msgstr[0] "Notebook"
50 | msgstr[1] "Notebooki"
51 | msgstr[2] "Notebooki"
52 | msgstr[3] "Notebooki"
53 |
54 | #: inc/financialreport.class.php:464 inc/financialreport.class.php:466
55 | #: inc/parameter.class.php:58
56 | msgid "Server"
57 | msgid_plural "Servers"
58 | msgstr[0] "Serwer"
59 | msgstr[1] "Serwery"
60 | msgstr[2] "Serwery"
61 | msgstr[3] "Serwery"
62 |
63 | #: inc/financialreport.class.php:551 inc/financialreport.class.php:553
64 | msgid "Element out"
65 | msgid_plural "Elements out"
66 | msgstr[0] ""
67 | msgstr[1] ""
68 | msgstr[2] ""
69 | msgstr[3] ""
70 |
71 | #: inc/financialreport.class.php:575 inc/pdf.class.php:321
72 | msgid "General Total"
73 | msgstr ""
74 |
75 | #: inc/financialreport.class.php:576 inc/financialreport.class.php:626
76 | #: inc/financialreport.class.php:652 inc/financialreport.class.php:676
77 | msgid "Euro"
78 | msgid_plural "Euros"
79 | msgstr[0] ""
80 | msgstr[1] ""
81 | msgstr[2] ""
82 | msgstr[3] ""
83 |
84 | #: inc/financialreport.class.php:638
85 | msgid "Hide"
86 | msgstr "Ukryj"
87 |
88 | #: inc/financialreport.class.php:640
89 | msgid "Display"
90 | msgstr ""
91 |
92 | #: inc/financialreport.class.php:666 inc/pdf.class.php:252
93 | msgid "User / Group"
94 | msgstr "Użytkownik / Grupa"
95 |
96 | #: inc/financialreport.class.php:676
97 | msgid "Purchase Price HT in"
98 | msgstr ""
99 |
100 | #: inc/financialreport.class.php:708
101 | msgid "In stock / available"
102 | msgstr "Na stanie / dostępny"
103 |
104 | #: inc/parameter.class.php:46
105 | msgid "Identification parameters of inventory number"
106 | msgstr ""
107 |
108 | #: inc/pdf.class.php:210
109 | msgid "Asset situation ended on"
110 | msgstr ""
111 |
112 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
113 | msgid "HT"
114 | msgstr ""
115 |
--------------------------------------------------------------------------------
/locales/es_EC.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Soporte Infraestructura Standby, 2023
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - Financialreports plugin 2.0.0\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2022-07-26 13:55+0000\n"
15 | "PO-Revision-Date: 2020-11-02 16:05+0000\n"
16 | "Last-Translator: Soporte Infraestructura Standby, 2023\n"
17 | "Language-Team: Spanish (Ecuador) (https://app.transifex.com/infotelGLPI/teams/12361/es_EC/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: es_EC\n"
22 | "Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
23 |
24 | #: setup.php:76 inc/financialreport.class.php:49 inc/profile.class.php:152
25 | msgid "Financial report"
26 | msgid_plural "Financial reports"
27 | msgstr[0] "Informes financieros"
28 | msgstr[1] "Informes financieros"
29 | msgstr[2] "Informes financieros"
30 |
31 | #: front/config.form.php:69
32 | msgid "Please activate the plugin"
33 | msgstr "Por favor, active el plugin"
34 |
35 | #: front/financialreport.php:158
36 | msgid "Report date"
37 | msgstr "Fecha del informe"
38 |
39 | #: inc/config.class.php:90 inc/config.class.php:109
40 | msgid "Disposal status"
41 | msgstr "Estado de eliminación"
42 |
43 | #: inc/financialreport.class.php:435 inc/pdf.class.php:210
44 | msgid "Financial report ended on"
45 | msgstr "El informe financiero finalizó el"
46 |
47 | #: inc/financialreport.class.php:470 inc/financialreport.class.php:472
48 | #: inc/parameter.class.php:55
49 | msgid "Notebook"
50 | msgid_plural "Notebooks"
51 | msgstr[0] "Portátiles"
52 | msgstr[1] "Portátiles"
53 | msgstr[2] "Portátiles"
54 |
55 | #: inc/financialreport.class.php:480 inc/financialreport.class.php:482
56 | #: inc/parameter.class.php:60
57 | msgid "Server"
58 | msgid_plural "Servers"
59 | msgstr[0] "Servidores"
60 | msgstr[1] "Servidores"
61 | msgstr[2] "Servidores"
62 |
63 | #: inc/financialreport.class.php:567 inc/financialreport.class.php:569
64 | msgid "Element out"
65 | msgid_plural "Elements out"
66 | msgstr[0] "Elementos de salida"
67 | msgstr[1] "Elementos de salida"
68 | msgstr[2] "Elementos de salida"
69 |
70 | #: inc/financialreport.class.php:591 inc/pdf.class.php:321
71 | msgid "General Total"
72 | msgstr "Total general"
73 |
74 | #: inc/financialreport.class.php:592 inc/financialreport.class.php:642
75 | #: inc/financialreport.class.php:668 inc/financialreport.class.php:692
76 | msgid "Euro"
77 | msgid_plural "Euros"
78 | msgstr[0] "euros"
79 | msgstr[1] "euros"
80 | msgstr[2] "euros"
81 |
82 | #: inc/financialreport.class.php:654
83 | msgid "Hide"
84 | msgstr "Ocultar"
85 |
86 | #: inc/financialreport.class.php:656
87 | msgid "Display"
88 | msgstr "Mostrar"
89 |
90 | #: inc/financialreport.class.php:682 inc/pdf.class.php:252
91 | msgid "User / Group"
92 | msgstr "Usuario / Grupo"
93 |
94 | #: inc/financialreport.class.php:692
95 | msgid "Purchase Price HT in"
96 | msgstr "Precio de compra HT en"
97 |
98 | #: inc/financialreport.class.php:724
99 | msgid "In stock / available"
100 | msgstr "En stock / disponible"
101 |
102 | #: inc/parameter.class.php:46
103 | msgid "Identification parameters of inventory number"
104 | msgstr "Parámetros de identificación del número de inventario"
105 |
106 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
107 | msgid "HT"
108 | msgstr "HT"
109 |
--------------------------------------------------------------------------------
/locales/cs_CZ.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | # FIRST AUTHOR , YEAR.
5 | #
6 | # Translators:
7 | # Xavier CAILLAUD , 2020
8 | #
9 | #, fuzzy
10 | msgid ""
11 | msgstr ""
12 | "Project-Id-Version: GLPI - Financialreports plugin 2.0.0\n"
13 | "Report-Msgid-Bugs-To: \n"
14 | "POT-Creation-Date: 2019-02-24 15:03+0100\n"
15 | "PO-Revision-Date: 2020-11-02 16:05+0000\n"
16 | "Last-Translator: Xavier CAILLAUD , 2020\n"
17 | "Language-Team: Czech (Czech Republic) (https://www.transifex.com/infotelGLPI/teams/12361/cs_CZ/)\n"
18 | "MIME-Version: 1.0\n"
19 | "Content-Type: text/plain; charset=UTF-8\n"
20 | "Content-Transfer-Encoding: 8bit\n"
21 | "Language: cs_CZ\n"
22 | "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
23 |
24 | #: setup.php:67 inc/financialreport.class.php:49 inc/profile.class.php:152
25 | msgid "Financial report"
26 | msgid_plural "Financial reports"
27 | msgstr[0] "Stav majetku"
28 | msgstr[1] "Stavy majetku"
29 | msgstr[2] "Stavů majetku"
30 | msgstr[3] "Stavy majetku"
31 |
32 | #: front/config.form.php:71
33 | msgid "Please activate the plugin"
34 | msgstr "Zapněte zásuvný modul"
35 |
36 | #: front/financialreport.php:158
37 | msgid "Report date"
38 | msgstr "Datum hlášení"
39 |
40 | #: inc/config.class.php:90 inc/config.class.php:107
41 | msgid "Disposal status"
42 | msgstr "Stav vyřazení"
43 |
44 | #: inc/financialreport.class.php:419 inc/pdf.class.php:210
45 | msgid "Financial report ended on"
46 | msgstr "Kdy byl stav majetku ukončen"
47 |
48 | #: inc/financialreport.class.php:454 inc/financialreport.class.php:456
49 | #: inc/parameter.class.php:54
50 | msgid "Notebook"
51 | msgid_plural "Notebooks"
52 | msgstr[0] "Notebook"
53 | msgstr[1] "Notebooky"
54 | msgstr[2] "Notebooků"
55 | msgstr[3] "Notebooky"
56 |
57 | #: inc/financialreport.class.php:464 inc/financialreport.class.php:466
58 | #: inc/parameter.class.php:58
59 | msgid "Server"
60 | msgid_plural "Servers"
61 | msgstr[0] "Server"
62 | msgstr[1] "Servery"
63 | msgstr[2] "Serverů"
64 | msgstr[3] "Servery"
65 |
66 | #: inc/financialreport.class.php:551 inc/financialreport.class.php:553
67 | msgid "Element out"
68 | msgid_plural "Elements out"
69 | msgstr[0] "Prvek ukončen"
70 | msgstr[1] "Prvky ukončeny"
71 | msgstr[2] "Prvků ukončeno"
72 | msgstr[3] "Prvky ukončeny"
73 |
74 | #: inc/financialreport.class.php:575 inc/pdf.class.php:321
75 | msgid "General Total"
76 | msgstr "Celkový počet"
77 |
78 | #: inc/financialreport.class.php:576 inc/financialreport.class.php:626
79 | #: inc/financialreport.class.php:652 inc/financialreport.class.php:676
80 | msgid "Euro"
81 | msgid_plural "Euros"
82 | msgstr[0] "Kč"
83 | msgstr[1] "Kč"
84 | msgstr[2] "Kč"
85 | msgstr[3] "Kč"
86 |
87 | #: inc/financialreport.class.php:638
88 | msgid "Hide"
89 | msgstr "Skrýt"
90 |
91 | #: inc/financialreport.class.php:640
92 | msgid "Display"
93 | msgstr "Zobrazit"
94 |
95 | #: inc/financialreport.class.php:666 inc/pdf.class.php:252
96 | msgid "User / Group"
97 | msgstr "Uživatel/skupina"
98 |
99 | #: inc/financialreport.class.php:676
100 | msgid "Purchase Price HT in"
101 | msgstr "Kupní cena s daní"
102 |
103 | #: inc/financialreport.class.php:708
104 | msgid "In stock / available"
105 | msgstr "Skladem / k dispozici"
106 |
107 | #: inc/parameter.class.php:46
108 | msgid "Identification parameters of inventory number"
109 | msgstr "Identifikační parametry inventárního čísla"
110 |
111 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
112 | msgid "HT"
113 | msgstr "Bez daně"
114 |
--------------------------------------------------------------------------------
/locales/ro_RO.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | #
5 | # Translators:
6 | # Doru DEACONU , 2013
7 | # Doru DEACONU , 2012
8 | # Kevin HAINRY , 2019
9 | msgid ""
10 | msgstr ""
11 | "Project-Id-Version: GLPI Project - financialreports plugin\n"
12 | "Report-Msgid-Bugs-To: \n"
13 | "POT-Creation-Date: 2019-01-23 17:10+0100\n"
14 | "PO-Revision-Date: 2019-01-23 16:14+0000\n"
15 | "Last-Translator: Kevin HAINRY \n"
16 | "Language-Team: Romanian (Romania) (http://www.transifex.com/tsmr/GLPI_financialreports/language/ro_RO/)\n"
17 | "MIME-Version: 1.0\n"
18 | "Content-Type: text/plain; charset=UTF-8\n"
19 | "Content-Transfer-Encoding: 8bit\n"
20 | "Language: ro_RO\n"
21 | "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
22 |
23 | #: setup.php:67 inc/financialreport.class.php:49 inc/profile.class.php:152
24 | msgid "Financial report"
25 | msgid_plural "Financial reports"
26 | msgstr[0] "Situaţia activului"
27 | msgstr[1] "Situaţia activelor"
28 | msgstr[2] "Situaţia activelor"
29 |
30 | #: front/config.form.php:71
31 | msgid "Please activate the plugin"
32 | msgstr "Activaţi vă rog pluginul"
33 |
34 | #: front/financialreport.php:158
35 | msgid "Report date"
36 | msgstr "Dată raport"
37 |
38 | #: inc/config.class.php:90 inc/config.class.php:107
39 | msgid "Disposal status"
40 | msgstr "Statut dezimobilizări"
41 |
42 | #: inc/financialreport.class.php:419
43 | msgid "Financial report ended on"
44 | msgstr "Situaţia activelor la data"
45 |
46 | #: inc/financialreport.class.php:454 inc/financialreport.class.php:456
47 | #: inc/parameter.class.php:54
48 | msgid "Notebook"
49 | msgid_plural "Notebooks"
50 | msgstr[0] "Laptop"
51 | msgstr[1] "Laptop - uri"
52 | msgstr[2] "Laptop - uri"
53 |
54 | #: inc/financialreport.class.php:464 inc/financialreport.class.php:466
55 | #: inc/parameter.class.php:58
56 | msgid "Server"
57 | msgid_plural "Servers"
58 | msgstr[0] "Server"
59 | msgstr[1] "Server"
60 | msgstr[2] "Servere"
61 |
62 | #: inc/financialreport.class.php:551 inc/financialreport.class.php:553
63 | msgid "Element out"
64 | msgid_plural "Elements out"
65 | msgstr[0] "Element ieşit"
66 | msgstr[1] "Elemente ieşite"
67 | msgstr[2] "Elemente ieşite"
68 |
69 | #: inc/financialreport.class.php:575 inc/pdf.class.php:321
70 | msgid "General Total"
71 | msgstr "Total general"
72 |
73 | #: inc/financialreport.class.php:576 inc/financialreport.class.php:626
74 | #: inc/financialreport.class.php:652 inc/financialreport.class.php:676
75 | msgid "Euro"
76 | msgid_plural "Euros"
77 | msgstr[0] "Euro"
78 | msgstr[1] "Euro"
79 | msgstr[2] "Euro"
80 |
81 | #: inc/financialreport.class.php:638
82 | msgid "Hide"
83 | msgstr "Ascunde"
84 |
85 | #: inc/financialreport.class.php:640
86 | msgid "Display"
87 | msgstr " Afişează"
88 |
89 | #: inc/financialreport.class.php:666 inc/pdf.class.php:252
90 | msgid "User / Group"
91 | msgstr "Utilizator / Grup"
92 |
93 | #: inc/financialreport.class.php:676
94 | msgid "Purchase Price HT in"
95 | msgstr "Preţ cumpărare FT în "
96 |
97 | #: inc/financialreport.class.php:708
98 | msgid "In stock / available"
99 | msgstr "În stoc / disponibil"
100 |
101 | #: inc/parameter.class.php:46
102 | msgid "Identification parameters of inventory number"
103 | msgstr "Parametri identificare a numărului de inventar"
104 |
105 | #: inc/pdf.class.php:210
106 | msgid "Asset situation ended on"
107 | msgstr "Situaţia activelor la data"
108 |
109 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
110 | msgid "HT"
111 | msgstr "FT"
112 |
--------------------------------------------------------------------------------
/setup.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | define('PLUGIN_FINANCIALREPORTS_VERSION', '3.0.0');
31 |
32 | if (!defined("PLUGIN_FINANCIALREPORTS_DIR")) {
33 | define("PLUGIN_FINANCIALREPORTS_DIR", Plugin::getPhpDir("financialreports"));
34 | define("PLUGIN_FINANCIALREPORTS_NOTFULL_DIR", Plugin::getPhpDir("financialreports",false));
35 | define("PLUGIN_FINANCIALREPORTS_WEBDIR", Plugin::getWebDir("financialreports"));
36 | }
37 |
38 | include_once PLUGIN_FINANCIALREPORTS_DIR . "/vendor/autoload.php";
39 |
40 | // Init the hooks of the plugins -Needed
41 | function plugin_init_financialreports() {
42 | global $PLUGIN_HOOKS;
43 |
44 | $PLUGIN_HOOKS['csrf_compliant']['financialreports'] = true;
45 | $PLUGIN_HOOKS['change_profile']['financialreports'] =
46 | ['PluginFinancialreportsProfile', 'initProfile'];
47 |
48 | if (Session::getLoginUserID()) {
49 |
50 | Plugin::registerClass('PluginFinancialreportsProfile',
51 | ['addtabon' => 'Profile']);
52 |
53 | if (Session::haveRight("plugin_financialreports", READ)) {
54 |
55 | $PLUGIN_HOOKS['reports']['financialreports'] =
56 | ['front/financialreport.php' => __('Report')];
57 | $PLUGIN_HOOKS['use_massive_action']['financialreports'] = 1;
58 |
59 | }
60 |
61 | if (Session::haveRight("plugin_financialreports", READ)
62 | || Session::haveRight("config", UPDATE)) {
63 | $PLUGIN_HOOKS['config_page']['financialreports'] = 'front/config.form.php';
64 | }
65 | }
66 |
67 | }
68 |
69 | // Get the name and the version of the plugin - Needed
70 | /**
71 | * @return array
72 | */
73 | function plugin_version_financialreports() {
74 |
75 | return [
76 | 'name' => _n('Financial report','Financial reports',2, 'financialreports'),
77 | 'version' => PLUGIN_FINANCIALREPORTS_VERSION,
78 | 'oldname' => 'state',
79 | 'license' => 'GPLv2+',
80 | 'author' => "Infotel",
81 | 'homepage' => 'https://github.com/InfotelGLPI/financialreports',
82 | 'requirements' => [
83 | 'glpi' => [
84 | 'min' => '10.0',
85 | 'max' => '11.0',
86 | 'dev' => false
87 | ]
88 | ]
89 | ];
90 | }
91 |
92 | function plugin_financialreports_check_prerequisites() {
93 |
94 | if (!is_readable(__DIR__ . '/vendor/autoload.php') || !is_file(__DIR__ . '/vendor/autoload.php')) {
95 | echo "Run composer install --no-dev in the plugin directory
";
96 | return false;
97 | }
98 |
99 | return true;
100 | }
101 |
--------------------------------------------------------------------------------
/locales/ru_RU.po:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR Financialreports Development Team
3 | # This file is distributed under the same license as the GLPI - Financialreports plugin package.
4 | #
5 | # Translators:
6 | # Alexey Petukhov , 2014
7 | # Alexey Petukhov , 2014,2017
8 | # Kevin HAINRY , 2019
9 | msgid ""
10 | msgstr ""
11 | "Project-Id-Version: GLPI Project - financialreports plugin\n"
12 | "Report-Msgid-Bugs-To: \n"
13 | "POT-Creation-Date: 2019-01-23 17:10+0100\n"
14 | "PO-Revision-Date: 2019-01-23 16:15+0000\n"
15 | "Last-Translator: Kevin HAINRY \n"
16 | "Language-Team: Russian (Russia) (http://www.transifex.com/tsmr/GLPI_financialreports/language/ru_RU/)\n"
17 | "MIME-Version: 1.0\n"
18 | "Content-Type: text/plain; charset=UTF-8\n"
19 | "Content-Transfer-Encoding: 8bit\n"
20 | "Language: ru_RU\n"
21 | "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
22 |
23 | #: setup.php:67 inc/financialreport.class.php:49 inc/profile.class.php:152
24 | msgid "Financial report"
25 | msgid_plural "Financial reports"
26 | msgstr[0] "Состояние оборудования"
27 | msgstr[1] "Состояния оборудования"
28 | msgstr[2] "Состояния оборудования"
29 | msgstr[3] "Состояния оборудования"
30 |
31 | #: front/config.form.php:71
32 | msgid "Please activate the plugin"
33 | msgstr "Пожалуйста включите это дополнение"
34 |
35 | #: front/financialreport.php:158
36 | msgid "Report date"
37 | msgstr "Дата отчета"
38 |
39 | #: inc/config.class.php:90 inc/config.class.php:107
40 | msgid "Disposal status"
41 | msgstr "Статус утилизации"
42 |
43 | #: inc/financialreport.class.php:419
44 | msgid "Financial report ended on"
45 | msgstr "Размещение оборудования закочилось"
46 |
47 | #: inc/financialreport.class.php:454 inc/financialreport.class.php:456
48 | #: inc/parameter.class.php:54
49 | msgid "Notebook"
50 | msgid_plural "Notebooks"
51 | msgstr[0] "Ноутбук"
52 | msgstr[1] "Ноутбуки"
53 | msgstr[2] "Ноутбуки"
54 | msgstr[3] "Ноутбуки"
55 |
56 | #: inc/financialreport.class.php:464 inc/financialreport.class.php:466
57 | #: inc/parameter.class.php:58
58 | msgid "Server"
59 | msgid_plural "Servers"
60 | msgstr[0] "Сервер"
61 | msgstr[1] "Серверы"
62 | msgstr[2] "Серверы"
63 | msgstr[3] "Серверы"
64 |
65 | #: inc/financialreport.class.php:551 inc/financialreport.class.php:553
66 | msgid "Element out"
67 | msgid_plural "Elements out"
68 | msgstr[0] "Элемент закончился"
69 | msgstr[1] "Элементы закончились"
70 | msgstr[2] "Элементы закончились"
71 | msgstr[3] "Элементы закончились"
72 |
73 | #: inc/financialreport.class.php:575 inc/pdf.class.php:321
74 | msgid "General Total"
75 | msgstr "Итого"
76 |
77 | #: inc/financialreport.class.php:576 inc/financialreport.class.php:626
78 | #: inc/financialreport.class.php:652 inc/financialreport.class.php:676
79 | msgid "Euro"
80 | msgid_plural "Euros"
81 | msgstr[0] "Евро"
82 | msgstr[1] "Евро"
83 | msgstr[2] "Евро"
84 | msgstr[3] "Евро"
85 |
86 | #: inc/financialreport.class.php:638
87 | msgid "Hide"
88 | msgstr "Скрыть"
89 |
90 | #: inc/financialreport.class.php:640
91 | msgid "Display"
92 | msgstr "Отобразить"
93 |
94 | #: inc/financialreport.class.php:666 inc/pdf.class.php:252
95 | msgid "User / Group"
96 | msgstr "Пользователь / Группа"
97 |
98 | #: inc/financialreport.class.php:676
99 | msgid "Purchase Price HT in"
100 | msgstr "С НДС"
101 |
102 | #: inc/financialreport.class.php:708
103 | msgid "In stock / available"
104 | msgstr "В наличии / доступно"
105 |
106 | #: inc/parameter.class.php:46
107 | msgid "Identification parameters of inventory number"
108 | msgstr "Параметр, определяющий номер оборудования"
109 |
110 | #: inc/pdf.class.php:210
111 | msgid "Asset situation ended on"
112 | msgstr "Размещение оборудования закочилось"
113 |
114 | #: inc/pdf.class.php:259 inc/pdf.class.php:263
115 | msgid "HT"
116 | msgstr "НДС"
117 |
--------------------------------------------------------------------------------
/inc/parameter.class.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | if (!defined('GLPI_ROOT')) {
31 | die("Sorry. You can't access directly to this file");
32 | }
33 |
34 | /**
35 | * Class PluginFinancialreportsParameter
36 | */
37 | class PluginFinancialreportsParameter extends CommonDBTM {
38 |
39 | function showParameterForm() {
40 |
41 | $this->getFromDB('1');
42 | echo "";
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/inc/config.class.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | /**
36 | * Class PluginFinancialreportsConfig
37 | */
38 | class PluginFinancialreportsConfig extends CommonDBTM {
39 |
40 | public static $rightname = 'plugin_financialreports';
41 |
42 | static function canPurge() {
43 | return Session::haveRight(self::$rightname, READ);
44 | }
45 |
46 | function showConfigForm() {
47 | global $DB;
48 |
49 | $query = "SELECT * FROM
50 | `" . $this->getTable() . "`
51 | ORDER BY `states_id` ASC";
52 |
53 | $used = [];
54 |
55 | if ($result = $DB->query($query)) {
56 | $number = $DB->numrows($result);
57 | if ($number != 0) {
58 |
59 | $rand = mt_rand();
60 | echo "";
61 | Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
62 | $massiveactionparams = ['item' => __CLASS__,
63 | 'specific_actions' => ['purge' => _x('button', 'Delete permanently')],
64 | 'container' => 'mass' . __CLASS__ . $rand];
65 | Html::showMassiveActions($massiveactionparams);
66 |
67 | echo "
";
68 | echo "";
69 | echo "| " . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand) . " | ";
70 | echo "" . __('Status') . " | ";
71 | echo "
";
72 | while ($ligne = $DB->fetchArray($result)) {
73 | $used[$ligne["states_id"]] = $ligne["states_id"];
74 |
75 | echo "";
76 | echo "| ";
77 | echo Html::showMassiveActionCheckBox(__CLASS__, $ligne["id"]);
78 | echo " | ";
79 | echo "" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . " | ";
80 | echo "
";
81 | }
82 | echo "
";
83 |
84 | $massiveactionparams['ontop'] = false;
85 | Html::showMassiveActions($massiveactionparams);
86 | Html::closeForm();
87 |
88 | echo "";
105 |
106 | } else {
107 | echo "";
120 | }
121 | }
122 | }
123 |
124 | }
125 |
--------------------------------------------------------------------------------
/financialreports.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Financial Reports
4 | financialreports
5 | stable
6 | https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/financialreports.png
7 |
8 |
9 | - Export Csv, Pdf]]>
10 | - Export Csv, Pdf]]>
11 |
12 |
13 | - Dans la configuration, renseignez l'identifiant pour chaque type de matériel de l'inventaire correspondant au numéro d'inventaire. (exemple : Vos pcs portables ont un numéro d'inventaire commençant par PO renseignez donc le plugin avec PO, Serveurs : SE, PC Fixes : PC etc).
- Générez le rapport.
- Export Csv, Pdf]]>
14 | - In plugin setup, add identifier for each type of equipment inventory related to the inventory number (example : your notebooks have un inventory number beginnning with 'PO' so fill the setup plugin with PO, Servers : SE, Computers : PC etc).
- Generate the report.
- Export Csv, Pdf.]]>
15 |
16 |
17 | https://github.com/InfotelGLPI/financialreports
18 | https://github.com/InfotelGLPI/financialreports/releases
19 | https://github.com/InfotelGLPI/financialreports/issues
20 | https://raw.githubusercontent.com/InfotelGLPI/financialreports/master/README.md
21 |
22 | Xavier Caillaud
23 | Infotel
24 |
25 |
26 |
27 | 3.0.0
28 | ~10.0
29 | https://github.com/InfotelGLPI/financialreports/releases/download/3.0.0/glpi-financialreports-3.0.0.tar.bz2
30 |
31 |
32 | 3.0.0-rc2
33 | ~10.0
34 | https://github.com/InfotelGLPI/financialreports/releases/download/3.0.0-rc2/glpi-financialreports-3.0.0-rc2.tar.bz2
35 |
36 |
37 | 3.0.0-rc1
38 | ~10.0
39 | https://github.com/InfotelGLPI/financialreports/releases/download/3.0.0-rc1/glpi-financialreports-3.0.0-rc1.tar.bz2
40 |
41 |
42 | 2.6.0
43 | 9.4
44 |
45 |
46 | 2.5.0
47 | 9.3
48 |
49 |
50 | 2.4.1
51 | 9.2
52 |
53 |
54 | 2.4.0
55 | 9.2
56 |
57 |
58 | 2.3.0
59 | 9.1
60 |
61 |
62 | 2.2.1
63 | 0.90
64 |
65 |
66 | 2.2.0
67 | 0.90
68 |
69 |
70 | 2.1.0
71 | 0.85
72 |
73 |
74 | 2.0.0
75 | 0.84
76 |
77 |
78 | 1.9.1
79 | 0.83.3
80 |
81 |
82 | 1.9.0
83 | 0.83
84 |
85 |
86 | 1.8.0
87 | 0.80
88 |
89 |
90 | 1.7.0
91 | 0.78
92 |
93 |
94 | 1.6.1
95 | 0.72
96 |
97 |
98 | 1.6.0
99 | 0.72
100 |
101 |
102 | 1.5
103 | 0.71
104 |
105 |
106 | 1.4
107 | 0.70
108 |
109 |
110 |
111 | cs_CZ
112 | en_GB
113 | fi_FI
114 | fr_FR
115 | pl_PL
116 | pt_BR
117 | ro_RO
118 | ru_RU
119 | tr_TR
120 |
121 |
122 |
123 |
124 | Rapports
125 | Financier
126 |
127 |
128 | Reports
129 | Financial
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/hook.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | /**
31 | * @return bool
32 | */
33 | function plugin_financialreports_install() {
34 | global $DB;
35 |
36 | include_once(PLUGIN_FINANCIALREPORTS_DIR . "/inc/profile.class.php");
37 |
38 | $update = false;
39 | if (!$DB->tableExists("glpi_plugin_state_profiles")
40 | && !$DB->tableExists("glpi_plugin_financialreports_configs")) {
41 |
42 | $DB->runFile(PLUGIN_FINANCIALREPORTS_DIR . "/sql/empty-3.0.0.sql");
43 |
44 | } else if ($DB->tableExists("glpi_plugin_state_parameters")
45 | && !$DB->fieldExists("glpi_plugin_state_parameters", "monitor")) {
46 |
47 | $update = true;
48 | $DB->runFile(PLUGIN_FINANCIALREPORTS_DIR . "/sql/update-1.5.sql");
49 | $DB->runFile(PLUGIN_FINANCIALREPORTS_DIR . "/sql/update-1.6.0.sql");
50 | $DB->runFile(PLUGIN_FINANCIALREPORTS_DIR . "/sql/update-1.7.0.sql");
51 |
52 | } else if ($DB->tableExists("glpi_plugin_state_profiles")
53 | && $DB->fieldExists("glpi_plugin_state_profiles", "interface")) {
54 |
55 | $update = true;
56 | $DB->runFile(PLUGIN_FINANCIALREPORTS_DIR . "/sql/update-1.6.0.sql");
57 | $DB->runFile(PLUGIN_FINANCIALREPORTS_DIR . "/sql/update-1.7.0.sql");
58 |
59 | } else if (!$DB->tableExists("glpi_plugin_financialreports_configs")) {
60 |
61 | $update = true;
62 | $DB->runFile(PLUGIN_FINANCIALREPORTS_DIR . "/sql/update-1.7.0.sql");
63 |
64 | }
65 |
66 | if ($update) {
67 |
68 | //Do One time on 0.78
69 | $query_ = "SELECT *
70 | FROM `glpi_plugin_financialreports_profiles` ";
71 | $result_ = $DB->query($query_);
72 | if ($DB->numrows($result_) > 0) {
73 |
74 | while ($data = $DB->fetchArray($result_)) {
75 | $query = "UPDATE `glpi_plugin_financialreports_profiles`
76 | SET `profiles_id` = '" . $data["id"] . "'
77 | WHERE `id` = '" . $data["id"] . "';";
78 | $DB->query($query);
79 |
80 | }
81 | }
82 |
83 | $query = "ALTER TABLE `glpi_plugin_financialreports_profiles`
84 | DROP `name` ;";
85 | $DB->query($query);
86 |
87 | Plugin::migrateItemType(
88 | [3450 => 'PluginFinancialreportsDisposalItem'],
89 | ["glpi_savedsearches", "glpi_savedsearches_users", "glpi_displaypreferences",
90 | "glpi_documents_items", "glpi_infocoms", "glpi_logs", "glpi_tickets"],
91 | ["glpi_plugin_financialreports_disposalitems"]);
92 | }
93 |
94 | //Migrate profiles to the new system
95 | PluginFinancialreportsProfile::initProfile();
96 | PluginFinancialreportsProfile::createFirstAccess($_SESSION['glpiactiveprofile']['id']);
97 |
98 | $migration = new Migration("2.3.0");
99 | $migration->dropTable('glpi_plugin_financialreports_profiles');
100 |
101 | //2.3.0
102 | if ($DB->tableExists("glpi_plugin_financialreports_disposalitems")) {
103 | $query_ = "SELECT *
104 | FROM `glpi_plugin_financialreports_disposalitems` ";
105 | $result_ = $DB->query($query_);
106 | if ($DB->numrows($result_) > 0) {
107 |
108 | while ($data = $DB->fetchArray($result_)) {
109 | $query = "UPDATE `glpi_infocoms`
110 | SET `decommission_date` = '" . $data["date_disposal"] . "'
111 | WHERE `items_id` = '" . $data["items_id"] . "'
112 | AND `itemtype` = '" . $data["itemtype"] . "';";
113 | $DB->query($query);
114 |
115 | }
116 | }
117 | }
118 | $migration->dropTable('glpi_plugin_financialreports_disposalitems');
119 | return true;
120 | }
121 |
122 | /**
123 | * @return bool
124 | */
125 | function plugin_financialreports_uninstall() {
126 | global $DB;
127 |
128 | $tables = ["glpi_plugin_financialreports_configs",
129 | "glpi_plugin_financialreports_parameters"];
130 |
131 | foreach ($tables as $table)
132 | $DB->query("DROP TABLE IF EXISTS `$table`;");
133 |
134 | //old versions
135 | $tables = ["glpi_plugin_financialreports_profiles",
136 | "glpi_plugin_state_profiles",
137 | "glpi_plugin_state_config",
138 | "glpi_plugin_state_parameters",
139 | "glpi_plugin_state_repelled"];
140 |
141 | foreach ($tables as $table)
142 | $DB->query("DROP TABLE IF EXISTS `$table`;");
143 |
144 | //Delete rights associated with the plugin
145 | $profileRight = new ProfileRight();
146 | foreach (PluginFinancialreportsProfile::getAllRights() as $right) {
147 | $profileRight->deleteByCriteria(['name' => $right['field']]);
148 | }
149 |
150 | PluginFinancialreportsProfile::removeRightsFromSession();
151 |
152 | return true;
153 | }
154 |
155 |
156 | // Define database relations
157 | /**
158 | * @return array
159 | */
160 | function plugin_financialreports_getDatabaseRelations() {
161 |
162 | if (Plugin::isPluginActive("financialreports"))
163 | return [
164 | "glpi_states" => ["glpi_plugin_financialreports_configs" => "states_id"]
165 | ];
166 | else
167 | return [];
168 | }
169 |
--------------------------------------------------------------------------------
/front/financialreport.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | include('../../../inc/includes.php');
31 |
32 | Html::header(PluginFinancialreportsFinancialreport::getTypeName(), '', "utils", "report");
33 |
34 | Session::checkCentralAccess();
35 |
36 | //First time this screen is displayed : set the pc mode to 'all'
37 | if (!isset($_SESSION["displaypc"])) {
38 | $_SESSION["displaypc"] = false;
39 | }
40 | //Changing the pc mode
41 | if (isset($_GET["displaypc"])) {
42 | if ($_GET["displaypc"] == "false") {
43 | $_SESSION["displaypc"] = false;
44 | } else {
45 | $_SESSION["displaypc"] = true;
46 | }
47 | }
48 | //First time this screen is displayed : set the notebook mode to 'all'
49 | if (!isset($_SESSION["displaynotebook"])) {
50 | $_SESSION["displaynotebook"] = false;
51 | }
52 | //Changing the notebook mode
53 | if (isset($_GET["displaynotebook"])) {
54 | if ($_GET["displaynotebook"] == "false") {
55 | $_SESSION["displaynotebook"] = false;
56 | } else {
57 | $_SESSION["displaynotebook"] = true;
58 | }
59 | }
60 | //First time this screen is displayed : set the server mode to 'all'
61 | if (!isset($_SESSION["displayserver"])) {
62 | $_SESSION["displayserver"] = false;
63 | }
64 | //Changing the server mode
65 | if (isset($_GET["displayserver"])) {
66 | if ($_GET["displayserver"] == "false") {
67 | $_SESSION["displayserver"] = false;
68 | } else {
69 | $_SESSION["displayserver"] = true;
70 | }
71 | }
72 | //First time this screen is displayed : set the monitor mode to 'all'
73 | if (!isset($_SESSION["displaymonitor"])) {
74 | $_SESSION["displaymonitor"] = false;
75 | }
76 | //Changing the monitor mode
77 | if (isset($_GET["displaymonitor"])) {
78 | if ($_GET["displaymonitor"] == "false") {
79 | $_SESSION["displaymonitor"] = false;
80 | } else {
81 | $_SESSION["displaymonitor"] = true;
82 | }
83 | }
84 | //First time this screen is displayed : set the printer mode to 'all'
85 | if (!isset($_SESSION["displayprinter"])) {
86 | $_SESSION["displayprinter"] = false;
87 | }
88 | //Changing the printer mode
89 | if (isset($_GET["displayprinter"])) {
90 | if ($_GET["displayprinter"] == "false") {
91 | $_SESSION["displayprinter"] = false;
92 | } else {
93 | $_SESSION["displayprinter"] = true;
94 | }
95 | }
96 | //First time this screen is displayed : set the networking mode to 'all'
97 | if (!isset($_SESSION["displaynetworking"])) {
98 | $_SESSION["displaynetworking"] = false;
99 | }
100 | //Changing the networking mode
101 | if (isset($_GET["displaynetworking"])) {
102 | if ($_GET["displaynetworking"] == "false") {
103 | $_SESSION["displaynetworking"] = false;
104 | } else {
105 | $_SESSION["displaynetworking"] = true;
106 | }
107 | }
108 | //First time this screen is displayed : set the peripheral mode to 'all'
109 | if (!isset($_SESSION["displayperipheral"])) {
110 | $_SESSION["displayperipheral"] = false;
111 | }
112 | //Changing the peripheral mode
113 | if (isset($_GET["displayperipheral"])) {
114 | if ($_GET["displayperipheral"] == "false") {
115 | $_SESSION["displayperipheral"] = false;
116 | } else {
117 | $_SESSION["displayperipheral"] = true;
118 | }
119 | }
120 | //First time this screen is displayed : set the phone mode to 'all'
121 | if (!isset($_SESSION["displayphone"])) {
122 | $_SESSION["displayphone"] = false;
123 | }
124 | //Changing the phone mode
125 | if (isset($_GET["displayphone"])) {
126 | if ($_GET["displayphone"] == "false") {
127 | $_SESSION["displayphone"] = false;
128 | } else {
129 | $_SESSION["displayphone"] = true;
130 | }
131 | }
132 | //First time this screen is displayed : set the rebus mode to 'all'
133 | if (!isset($_SESSION["displaydisposal"])) {
134 | $_SESSION["displaydisposal"] = false;
135 | }
136 | //Changing the rebus mode
137 | if (isset($_GET["displaydisposal"])) {
138 | if ($_GET["displaydisposal"] == "false") {
139 | $_SESSION["displaydisposal"] = false;
140 | } else {
141 | $_SESSION["displaydisposal"] = true;
142 | }
143 | }
144 |
145 | $report = new PluginFinancialreportsFinancialreport();
146 |
147 | if ($report->canView() || Session::haveRight("config", UPDATE)) {
148 |
149 | Report::title();
150 |
151 | if (empty($_GET["date"])) $_GET["date"] = date("Y-m-d");
152 | if (empty($_GET["locations_id"])) $_GET["locations_id"] = 0;
153 | if (!isset($_POST["date"])) $_POST["date"] = $_GET["date"];
154 | if (!isset($_POST["locations_id"])) $_POST["locations_id"] = $_GET["locations_id"];
155 |
156 | echo "";
173 | echo "";
174 | $display = ['displaypc' => $_SESSION["displaypc"],
175 | 'displaynotebook' => $_SESSION["displaynotebook"],
176 | 'displayserver' => $_SESSION["displayserver"],
177 | 'displaymonitor' => $_SESSION["displaymonitor"],
178 | 'displayprinter' => $_SESSION["displayprinter"],
179 | 'displaynetworking' => $_SESSION["displaynetworking"],
180 | 'displayperipheral' => $_SESSION["displayperipheral"],
181 | 'displayphone' => $_SESSION["displayphone"],
182 | 'displaydisposal' => $_SESSION["displaydisposal"]];
183 |
184 | $report->displayReport($_POST, $display);
185 | echo "
";
186 |
187 | } else {
188 | Html::displayRightError();
189 | }
190 |
191 | Html::footer();
192 |
--------------------------------------------------------------------------------
/inc/profile.class.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | if (!defined('GLPI_ROOT')) {
31 | die("Sorry. You can't access directly to this file");
32 | }
33 |
34 | /**
35 | * Class PluginFinancialreportsProfile
36 | */
37 | class PluginFinancialreportsProfile extends CommonDBTM {
38 |
39 | static $rightname = "profile";
40 |
41 | /**
42 | * @param CommonGLPI $item
43 | * @param int $withtemplate
44 | *
45 | * @return string|translated
46 | */
47 | function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
48 |
49 | if ($item->getType() == 'Profile' && $item->getField('interface') != 'helpdesk') {
50 | return PluginFinancialreportsFinancialreport::getTypeName();
51 | }
52 | return '';
53 | }
54 |
55 |
56 | /**
57 | * @param CommonGLPI $item
58 | * @param int $tabnum
59 | * @param int $withtemplate
60 | *
61 | * @return bool
62 | */
63 | static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) {
64 |
65 | if ($item->getType() == 'Profile') {
66 | $ID = $item->getID();
67 | $prof = new self();
68 |
69 | self::addDefaultProfileInfos($ID,
70 | ['plugin_financialreports' => 0]);
71 | $prof->showForm($ID);
72 | }
73 | return true;
74 | }
75 |
76 | /**
77 | * @param $profiles_id
78 | * @param $rights
79 | * @param bool $drop_existing
80 | *
81 | * @internal param $profile
82 | */
83 | static function addDefaultProfileInfos($profiles_id, $rights, $drop_existing = false) {
84 | $dbu = new DbUtils();
85 | $profileRight = new ProfileRight();
86 | foreach ($rights as $right => $value) {
87 | if ($dbu->countElementsInTable('glpi_profilerights',
88 | ["profiles_id" => $profiles_id, "name" => $right]) && $drop_existing) {
89 | $profileRight->deleteByCriteria(['profiles_id' => $profiles_id, 'name' => $right]);
90 | }
91 | if (!$dbu->countElementsInTable('glpi_profilerights',
92 | ["profiles_id" => $profiles_id, "name" => $right])) {
93 | $myright['profiles_id'] = $profiles_id;
94 | $myright['name'] = $right;
95 | $myright['rights'] = $value;
96 | $profileRight->add($myright);
97 |
98 | //Add right to the current session
99 | $_SESSION['glpiactiveprofile'][$right] = $value;
100 | }
101 | }
102 | }
103 |
104 | /**
105 | * Show profile form
106 | *
107 | * @param int $profiles_id
108 | * @param bool $openform
109 | * @param bool $closeform
110 | *
111 | * @return nothing
112 | * @internal param int $items_id id of the profile
113 | * @internal param value $target url of target
114 | */
115 | function showForm($profiles_id = 0, $openform = TRUE, $closeform = TRUE) {
116 |
117 | echo "";
118 | if (($canedit = Session::haveRightsOr(self::$rightname, [CREATE, UPDATE, PURGE]))
119 | && $openform) {
120 | $profile = new Profile();
121 | echo "
";
142 | }
143 |
144 | /**
145 | * @param bool $all
146 | *
147 | * @return array
148 | */
149 | static function getAllRights($all = false) {
150 | $rights = [
151 | ['rights' => [READ => __('Read')],
152 | 'label' => _n('Financial report', 'Financial reports', 1, 'financialreports'),
153 | 'field' => 'plugin_financialreports'
154 | ],
155 | ];
156 |
157 | return $rights;
158 | }
159 |
160 | /**
161 | * Init profiles
162 | *
163 | * @param $old_right
164 | *
165 | * @return int
166 | */
167 |
168 | static function translateARight($old_right) {
169 | switch ($old_right) {
170 | case '':
171 | return 0;
172 | case 'r' :
173 | return READ;
174 | case 'w':
175 | return ALLSTANDARDRIGHT;
176 | case '0':
177 | case '1':
178 | return $old_right;
179 |
180 | default :
181 | return 0;
182 | }
183 | }
184 |
185 | /**
186 | * @since 0.85
187 | * Migration rights from old system to the new one for one profile
188 | *
189 | * @param $profiles_id the profile ID
190 | *
191 | * @return bool
192 | */
193 | static function migrateOneProfile($profiles_id) {
194 | global $DB;
195 | //Cannot launch migration if there's nothing to migrate...
196 | if (!$DB->tableExists('glpi_plugin_financialreports_profiles')) {
197 | return true;
198 | }
199 |
200 | foreach ($DB->request('glpi_plugin_financialreports_profiles',
201 | "`profiles_id`='$profiles_id'") as $profile_data) {
202 |
203 | $matching = ['financialreports' => 'plugin_financialreports'];
204 | $current_rights = ProfileRight::getProfileRights($profiles_id, array_values($matching));
205 | foreach ($matching as $old => $new) {
206 | if (!isset($current_rights[$old])) {
207 | $query = "UPDATE `glpi_profilerights`
208 | SET `rights`='" . self::translateARight($profile_data[$old]) . "'
209 | WHERE `name`='$new' AND `profiles_id`='$profiles_id'";
210 | $DB->query($query);
211 | }
212 | }
213 | }
214 | }
215 |
216 | /**
217 | * Initialize profiles, and migrate it necessary
218 | */
219 | static function initProfile() {
220 | global $DB;
221 | $profile = new self();
222 | $dbu = new DbUtils();
223 | //Add new rights in glpi_profilerights table
224 | foreach ($profile->getAllRights(true) as $data) {
225 | if ($dbu->countElementsInTable("glpi_profilerights",
226 | ["name" => $data['field']]) == 0) {
227 | ProfileRight::addProfileRights([$data['field']]);
228 | }
229 | }
230 |
231 | //Migration old rights in new ones
232 | foreach ($DB->request("SELECT `id` FROM `glpi_profiles`") as $prof) {
233 | self::migrateOneProfile($prof['id']);
234 | }
235 | foreach ($DB->request("SELECT *
236 | FROM `glpi_profilerights`
237 | WHERE `profiles_id`='" . $_SESSION['glpiactiveprofile']['id'] . "'
238 | AND `name` LIKE '%plugin_financialreports%'") as $prof) {
239 | $_SESSION['glpiactiveprofile'][$prof['name']] = $prof['rights'];
240 | }
241 | }
242 |
243 | /**
244 | * @param $profiles_id
245 | */
246 | static function createFirstAccess($profiles_id) {
247 | self::addDefaultProfileInfos($profiles_id,
248 | ['plugin_financialreports' => READ], true);
249 |
250 | }
251 |
252 | static function removeRightsFromSession() {
253 | foreach (self::getAllRights(true) as $right) {
254 | if (isset($_SESSION['glpiactiveprofile'][$right['field']])) {
255 | unset($_SESSION['glpiactiveprofile'][$right['field']]);
256 | }
257 | }
258 | }
259 |
260 | }
261 |
--------------------------------------------------------------------------------
/inc/pdf.class.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 | if (!defined('GLPI_ROOT')) {
31 | die("Sorry. You can't access directly to this file");
32 | }
33 |
34 | /**
35 | * Class PluginFinancialreportsPdf
36 | */
37 | class PluginFinancialreportsPdf extends TCPDF {
38 |
39 | /* Attributes of a report sent by the user before generation. */
40 |
41 | var $date = ""; // Date of arrears
42 |
43 | /* Constantes pour paramétrer certaines données. */
44 | var $line_height = 5; // Height of a single line.
45 | var $pol_def = 'helvetica'; // Default font;
46 | var $tail_pol_def = 9; // Default font size.
47 | var $tail_titre = 22; // Size of the title.
48 | var $top_margin = 5; // Top margin.
49 | var $left_right_margin = 15; // Left and right margin.
50 | var $large_cell_width = 280; // The width of a cell that takes up the entire page.
51 | var $tail_bas_page = 20; // Height of the foot of the page.
52 | var $number_line_char = 90; // For details of the work;
53 |
54 |
55 | /* ************************************* */
56 | /* Generic formatting methods. */
57 | /* ************************************* */
58 |
59 | /** Position the color of the white text. */
60 | function SetTextRed() {
61 | $this->SetTextColor(255, 0, 0);
62 | }
63 |
64 | /** Position the color of the black text. */
65 | function SetTextBlack() {
66 | $this->SetTextColor(0, 0, 0);
67 | }
68 |
69 | /** Position the color of the text in blue. */
70 | function SetTextBlue() {
71 | $this->SetTextColor(100, 100, 255);
72 | }
73 |
74 | /** Position the white background color. */
75 | function SetFondWhite() {
76 | $this->SetFillColor(255, 255, 255);
77 | }
78 |
79 | /** Position the light gray background color. */
80 | function SetLightBackground() {
81 | $this->SetFillColor(205, 205, 205);
82 | }
83 |
84 | /** Position the light gray background color. */
85 | function SetVeryLightBackgroung() {
86 | $this->SetFillColor(245, 245, 245);
87 | }
88 |
89 | /** Position the light gray background color. */
90 | function SetBackgroundGreyLight() {
91 | $this->SetFillColor(230, 230, 230);
92 | }
93 |
94 | /** Sets the background color to dark gray. */
95 | function SetBackgroundDark() {
96 | $this->SetFillColor(85, 85, 85);
97 | }
98 |
99 | /**
100 | * Position the font for a label.
101 | *
102 | * @param $italic True if it's in italics, false otherwise.
103 | */
104 | function SetFontLabel($italic) {
105 | if ($italic) {
106 | $this->SetFont($this->pol_def, 'BI', $this->tail_pol_def);
107 | } else {
108 | $this->SetFont($this->pol_def, 'B', $this->tail_pol_def);
109 | }
110 | }
111 |
112 | /**
113 | * Redefines a normal font.
114 | *
115 | * @param bool|True $souligne True if the text will be underlined, false otherwise being the default.
116 | */
117 | function SetFontNormal($souligne = false) {
118 | if ($souligne) {
119 | $this->SetFont($this->pol_def, 'U', $this->tail_pol_def);
120 | } else {
121 | $this->SetFont($this->pol_def, '', $this->tail_pol_def);
122 | }
123 | }
124 |
125 | /**
126 | * Allows you to draw a cell defining a label of a cell or several cell values.
127 | *
128 | * @param $italic True if the label is italic, false otherwise.
129 | * @param $w Width of the cell containing the label.
130 | * @param $label Value of the label.
131 | * @param int|Multiplicateur $multH Multiplier of the height of the cell, default is equal to 1, thus increased.
132 | * @param D|string $align Determine the alignment of the text in the cell.
133 | * @param D|int $bordure Determines which borders to position, by default, all.
134 | */
135 | function CellLabel($italic, $w, $label, $multH = 1, $align = '', $bordure = 1) {
136 | $this->SetLightBackground();
137 | $this->SetFontLabel($italic);
138 | $this->Cell($w, $this->line_height * $multH, $label, $bordure, 0, $align, 1);
139 | }
140 |
141 | /**
142 | * Allows you to draw a cell defining a table header.
143 | *
144 | * @param $italic True if the label is italic, false otherwise.
145 | * @param $w The width of the cell containing the label.
146 | * @param $label Value of the label.
147 | * @param int|Multiplicateur $multH Multiplier of the height of the cell, default is equal to 1, thus increased.
148 | * @param D|string $align Determine the alignment of the text in the cell.
149 | * @param D|int $bordure Determines which borders to position, by default, all.
150 | */
151 | function CellHeadTable($italic, $w, $label, $multH = 1, $align = '', $bordure = 1) {
152 | $this->SetBackgroundGreyLight();
153 | $this->SetFontLabel($italic);
154 | $this->Cell($w, $this->line_height * $multH, $label, $bordure, 0, $align, 1);
155 | }
156 |
157 | /**
158 | * Allows you to draw a cell defining a table row.
159 | *
160 | * @param $italic True if the label is italic, false otherwise.
161 | * @param $w The width of the cell containing the label.
162 | * @param $label Value of the label.
163 | * @param int|Multiplicateur $multH Multiplier of the height of the cell, default is equal to 1, thus increased.
164 | * @param D|string $align Determine the alignment of the text in the cell.
165 | * @param D|int $bordure Determines which borders to position, by default, all.
166 | */
167 | function CellLineTable($italic, $w, $label, $multH = 1, $align = '', $bordure = 1) {
168 | $this->SetFontLabel($italic);
169 | $this->SetFont($this->pol_def, '', $this->tail_pol_def - 2);
170 | $this->Cell($w, $this->line_height * $multH, $label, $bordure, 0, $align, 1);
171 | }
172 |
173 | /**
174 | * Allows to draw a cell called normal.
175 | *
176 | * @param $w The width of the cell containing the label.
177 | * @param $value Value to displayr.
178 | * @param D|string $align Determines the alignment of the cell.
179 | * @param int|Multiplicateur $multH Multiplier of the height of the cell, default is equal to 1, thus increased.
180 | * @param D|int $bordure Determines which borders to position, by default, all.
181 | * @param bool|D $souligne Determines whether the contents of the cell are underlined.
182 | */
183 | function CellValue($w, $value, $align = '', $multH = 1, $bordure = 1, $souligne = false) {
184 | $this->SetFontNormal($souligne);
185 | $this->Cell($w, $this->line_height * $multH, $value, $bordure, 0, $align);
186 | }
187 |
188 | /* **************************************** */
189 | /* Methods generating report content. */
190 | /* **************************************** */
191 |
192 | /**
193 | * Function to draw the report header.
194 | */
195 | function Header() {
196 |
197 | /* Constants for the cell widths of the header (must be = $ large_cell_width). */
198 | $logo_width = 40;
199 | $title_width = 200;
200 | $date_width = 40;
201 | /* margins. */
202 | $this->SetX($this->left_right_margin);
203 | $this->SetY($this->top_margin);
204 |
205 | /* Logo. */
206 | $this->Image('../pics/logo.jpg', 15, 10, 30, 9); // x, y, w, h
207 | $this->Cell($logo_width, $this->line_height * 4, '', 1, 0, 'C');
208 | /* Title. */
209 | $this->SetFont($this->pol_def, 'B', $this->tail_titre);
210 | $this->Cell($title_width, $this->line_height * 2, __('Financial report ended on', 'financialreports'),
211 | 'LTR', 0, 'C');
212 | $this->SetY($this->GetY() + $this->line_height * 2);
213 | $this->SetX($logo_width + 10);
214 | $this->Cell($title_width, $this->line_height * 2, Html::convDate($this->date), 'LRB', 0, 'C');
215 | $this->SetY($this->GetY() - $this->line_height * 2);
216 | $this->SetX($title_width + $logo_width + 10);
217 | /* Date & hour. */
218 | $this->CellValue($date_width, "", 'C', 1, 'LTR', true); // Label for the date.
219 | $this->SetY($this->GetY() + $this->line_height);
220 | $this->SetX($title_width + $logo_width + 10);
221 | $this->CellValue($date_width, "", 'C', 1, 'LR');
222 | $this->SetY($this->GetY() + $this->line_height);
223 | $this->SetX($title_width + $logo_width + 10);
224 | $this->CellValue($date_width, "", 'C', 1, 'LR', true); // Label for the hour.
225 | $this->SetY($this->GetY() + $this->line_height);
226 | $this->SetX($title_width + $logo_width + 10);
227 | $this->CellValue($date_width, "", 'C', 1, 'LRB'); // Hour.
228 |
229 | $this->SetMargins(PDF_MARGIN_LEFT, $this->GetY() + $this->line_height * 2, PDF_MARGIN_RIGHT);
230 | }
231 |
232 | /**
233 | * Function to draw the table of general information.
234 | *
235 | * @param $total
236 | * @param $items
237 | * @param $deviceType
238 | * @param int $disposal
239 | */
240 | function display_table($total, $items, $deviceType, $disposal = 0) {
241 |
242 | // if ($total != 0) {
243 | /* en-tete */
244 | $this->CellLabel(false, $this->large_cell_width, $deviceType);
245 | $this->SetY($this->GetY() + $this->line_height);
246 |
247 | /* En tete tableau. */
248 | $this->CellHeadTable(false, 45, __('Name'), 1, 'C', 1);
249 | $this->CellHeadTable(false, 35, __('Inventory number'), 1, 'C', 1);
250 | $this->CellHeadTable(false, 20, __('Date of purchase'), 1, 'C', 1);
251 | if ($disposal != 1) {
252 | $this->CellHeadTable(false, 40, __('User / Group', 'financialreports'), 1, 'C', 1);
253 | $this->CellHeadTable(false, 40, __('Location'), 1, 'C', 1);
254 | }
255 | $this->CellHeadTable(false, 40, __('Model'), 1, 'C', 1);
256 | $this->CellHeadTable(false, 40, __('Supplier'), 1, 'C', 1);
257 |
258 | if ($disposal == 1) {
259 | $this->CellHeadTable(false, 20, __('HT', 'financialreports'), 1, 'C', 1);
260 | $this->CellHeadTable(false, 25, __('Decommission date'), 1, 'C', 1);
261 | $this->CellHeadTable(false, 55, __('Comments'), 1, 'C', 1);
262 | } else {
263 | $this->CellHeadTable(false, 20, __('HT', 'financialreports'), 1, 'C', 1);
264 | }
265 | $this->SetY($this->GetY() + $this->line_height);
266 | /* ligne. */
267 | $i = 1;
268 |
269 | $dbu = new DbUtils();
270 |
271 | foreach ($items as $data) {
272 | $i++;
273 | $this->SetFondWhite();
274 | if ($i % 2) $this->SetVeryLightBackgroung();
275 | $this->CellLineTable(false, 45, $data["ITEM_0"]);
276 | $this->CellLineTable(false, 35, $data["ITEM_2"]);
277 | $this->CellLineTable(false, 20, Html::convDate($data["ITEM_3"]), 1, 'C', 1);
278 | $this->SetTextBlue();
279 | $this->CellLineTable(false, 40,$dbu->formatUserName($data["ITEM_4_3"], $data["ITEM_4"], $data["ITEM_4_2"], $data["ITEM_4_4"], 0));
280 | $this->SetTextBlack();
281 | if ($disposal != 1) {
282 | $this->CellLineTable(false, 40, $data["ITEM_9"]);
283 | $this->CellLineTable(false, 40, $data["ITEM_6"]);
284 | }
285 |
286 | $this->CellLineTable(false, 40, $data["ITEM_7"]);
287 |
288 | if ($disposal == 1) {
289 | $this->SetTextRed();
290 | $this->CellLineTable(false, 20, Glpi\RichText\RichText::getTextFromHtml(Html::formatNumber($data["ITEM_8"])), 1, 'R', 1);
291 | $this->SetTextBlack();
292 | $this->CellLineTable(false, 25, Html::convDate($data["ITEM_10"]), 1, 'C', 1);
293 | $this->CellLineTable(false, 55, $data["ITEM_9"]);
294 | } else {
295 | $this->SetTextRed();
296 | $this->CellLineTable(false, 20, Glpi\RichText\RichText::getTextFromHtml(Html::formatNumber($data["ITEM_8"])), 1, 'R', 1);
297 | $this->SetTextBlack();
298 | }
299 | $this->SetY($this->GetY() + $this->line_height);
300 | }
301 | /* pied */
302 | if ($total != -1) {
303 | $this->CellHeadTable(true, $this->large_cell_width - 20, __('Total'), 1, 'R', 1);
304 | $this->SetTextRed();
305 | $this->CellHeadTable(false, 20, Glpi\RichText\RichText::getTextFromHtml(Html::formatNumber($total)), 1, 'R', 1);
306 | $this->SetTextBlack();
307 | $this->SetY($this->GetY() + $this->line_height);
308 | }
309 | // }
310 | }
311 |
312 | /**
313 | * Function to draw the total table.
314 | *
315 | * @param $total
316 | */
317 | function display_table_fin($total) {
318 |
319 | $this->SetY($this->GetY() + $this->line_height);
320 | /* en-tete */
321 | $this->CellLabel(false, $this->large_cell_width, __('General Total', 'financialreports'));
322 | $this->SetY($this->GetY() + $this->line_height);
323 |
324 | $this->CellHeadTable(true, $this->large_cell_width - 25, __('Total'), 1, 'R', 1);
325 | $this->SetTextRed();
326 | $this->CellHeadTable(false, 25, Glpi\RichText\RichText::getTextFromHtml(Html::formatNumber($total)), 1, 'R', 1);
327 | $this->SetTextBlack();
328 | $this->SetY($this->GetY() + $this->line_height);
329 | }
330 |
331 | /**
332 | * Function to draw the footer of the report.
333 | */
334 | function Footer() {
335 |
336 | // Positioning relative to the bottom of the page.
337 | $this->SetY(-$this->tail_bas_page);
338 | /* Page number. */
339 | $this->SetFont($this->pol_def, '', 9);
340 | $this->Cell(
341 | 0, $this->tail_bas_page / 2, Toolbox::decodeFromUtf8("") . ' ' . $this->PageNo() . ' ' . Toolbox::decodeFromUtf8("") . ' ', 0, 0, 'C');
342 | $this->Ln(10);
343 | /* Infos . */
344 | $this->SetFont($this->pol_def, 'I', 9);
345 | $this->Cell(0, $this->tail_bas_page / 4, Toolbox::decodeFromUtf8(""), 0, 0, 'C');
346 | $this->Ln(5);
347 | $this->Cell(0, $this->tail_bas_page / 4, Toolbox::decodeFromUtf8(""), 0, 0, 'C');
348 | }
349 |
350 |
351 |
352 | /* ********************* */
353 | /* Getteurs et setteurs. */
354 | /* ********************* */
355 |
356 | /**
357 | * @param $date
358 | */
359 | function setDate($date) {
360 | $this->date = $date;
361 | }
362 | }
363 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
341 |
--------------------------------------------------------------------------------
/inc/financialreport.class.php:
--------------------------------------------------------------------------------
1 | .
27 | --------------------------------------------------------------------------
28 | */
29 |
30 |
31 | if (!defined('GLPI_ROOT')) {
32 | die("Sorry. You can't access directly to this file");
33 | }
34 |
35 | /**
36 | * Class PluginFinancialreportsFinancialreport
37 | */
38 | class PluginFinancialreportsFinancialreport extends CommonDBTM {
39 |
40 | static $rightname = "plugin_financialreports";
41 |
42 | /**
43 | * @param int $nb
44 | *
45 | * @return translated
46 | */
47 | static function getTypeName($nb = 0) {
48 |
49 | return _n('Financial report', 'Financial reports', $nb, 'financialreports');
50 | }
51 |
52 |
53 | /**
54 | * @param $itemtype
55 | * @param $PluginFinancialreportsParameter
56 | * @param $type
57 | * @param $date
58 | * @param $total
59 | * @param $items
60 | * @param $locations_id
61 | *
62 | * @return int
63 | */
64 | function getItemsTotal($itemtype, $PluginFinancialreportsParameter, $type, $date, $total, $items, $locations_id) {
65 | $total += $this->QueryItemsTotalValue($itemtype, $PluginFinancialreportsParameter, $type, $date, $locations_id);
66 |
67 | return $total;
68 | }
69 |
70 | /**
71 | * @param $itemtype
72 | * @param $PluginFinancialreportsParameter
73 | * @param $type
74 | * @param $date
75 | * @param $total
76 | * @param $items
77 | * @param $locations_id
78 | *
79 | * @return array|string
80 | */
81 | function getItems($itemtype, $PluginFinancialreportsParameter, $type, $date, $total, $items, $locations_id) {
82 | if ($items == "") {
83 | $items = $this->queryItems($itemtype, $PluginFinancialreportsParameter, $type, $date, $locations_id);
84 | } else {
85 | $items = array_merge($items, $this->queryItems($itemtype, $PluginFinancialreportsParameter, $type, $date, $locations_id));
86 | }
87 | return $items;
88 | }
89 |
90 | /**
91 | * @param $itemtype
92 | * @param $PluginFinancialreportsParameter
93 | * @param $type
94 | * @param $date
95 | * @param $locations_id
96 | *
97 | * @return array|string
98 | */
99 | function queryItems($itemtype, $PluginFinancialreportsParameter, $type, $date, $locations_id) {
100 | global $DB;
101 |
102 | $dbu = new DbUtils();
103 |
104 | $itemtable = $dbu->getTableForItemType($itemtype);
105 | $modeltable = $dbu->getTableForItemType($itemtype . "Model");
106 | $modelfield = $dbu->getForeignKeyFieldForTable($dbu->getTableForItemType($itemtype . "Model"));
107 | $typetable = $dbu->getTableForItemType($itemtype . "Type");
108 | $typefield = $dbu->getForeignKeyFieldForTable($dbu->getTableForItemType($itemtype . "Type"));
109 | $deleted = 0;
110 | $first = true;
111 | $items = [];
112 |
113 | $query = "SELECT `$itemtable`.`name` AS ITEM_0, `glpi_locations`.`completename` AS ITEM_1, `$itemtable`.`otherserial` AS ITEM_2,
114 | `glpi_infocoms`.`buy_date` AS ITEM_3, `glpi_users`.`name` AS ITEM_4, `glpi_users`.`realname` AS ITEM_4_2,
115 | `glpi_users`.`id` AS ITEM_4_3, `glpi_users`.`firstname` AS ITEM_4_4,`glpi_groups`.`name` AS ITEM_5,`glpi_groups`.`id` AS ITEM_5_1,
116 | `$modeltable`.`name` AS ITEM_6 ";
117 | $query .= ", `glpi_manufacturers`.`name` AS ITEM_7, `glpi_infocoms`.`value` AS ITEM_8, `$itemtable`.`id` AS id,
118 | `glpi_locations`.`completename` AS ITEM_9,'$itemtype' AS TYPE
119 | FROM `$itemtable`
120 | LEFT JOIN `glpi_locations` ON (`$itemtable`.`locations_id` = `glpi_locations`.`id`)
121 | LEFT JOIN `glpi_infocoms` ON (`$itemtable`.`id` = `glpi_infocoms`.`items_id` AND `glpi_infocoms`.`itemtype` = '" . $itemtype . "')
122 | LEFT JOIN `glpi_users` ON (`$itemtable`.`users_id` = `glpi_users`.`id`)
123 | LEFT JOIN `glpi_groups` ON (`$itemtable`.`groups_id` = `glpi_groups`.`id`) ";
124 |
125 | $query .= "LEFT JOIN `$modeltable` ON (`" . $itemtable . "`.`$modelfield` = `$modeltable`.`id`) ";
126 | $query .= "LEFT JOIN `glpi_manufacturers` ON (`$itemtable`.`manufacturers_id` = `glpi_manufacturers`.`id`)
127 | LEFT JOIN `$typetable` ON (`$itemtable`.`$typefield` = `$typetable`.`id`)
128 | LEFT JOIN `glpi_states` ON (`$itemtable`.`states_id` = `glpi_states`.`id`)";
129 | $query .= " WHERE ";
130 |
131 | $item = new $itemtype();
132 | // Add deleted if item have it
133 | if ($item->maybeDeleted()) {
134 | $LINK = " ";
135 | if ($first) {
136 | $LINK = " ";
137 | $first = false;
138 | }
139 | $query .= $LINK . "`" . $itemtable . "`.`is_deleted` = '$deleted' ";
140 | }
141 | // Remove template items
142 | if ($item->maybeTemplate()) {
143 | $LINK = " AND ";
144 | if ($first) {
145 | $LINK = " ";
146 | $first = false;
147 | }
148 | $query .= $LINK . "`" . $itemtable . "`.`is_template` = '0' ";
149 | }
150 |
151 | // Add Restrict to current entities
152 | if ($item->isEntityAssign()) {
153 | $LINK = " AND ";
154 | if ($first) {
155 | $LINK = " ";
156 | $first = false;
157 | }
158 |
159 | $query .= $dbu->getEntitiesRestrictRequest($LINK, $itemtable);
160 | }
161 | $query_state = "SELECT `states_id`
162 | FROM `glpi_plugin_financialreports_configs`";
163 | $result_state = $DB->query($query_state);
164 | if ($DB->numrows($result_state) > 0) {
165 | $query .= "AND (`$itemtable`.`states_id` = 999999 ";
166 | while ($data_state = $DB->fetchArray($result_state)) {
167 | $type_where = "OR `$itemtable`.`states_id` != '" . $data_state["states_id"] . "' ";
168 | $query .= " $type_where ";
169 | }
170 | $query .= ") ";
171 | }
172 | if (!empty($PluginFinancialreportsParameter->fields[$type]))
173 | $query .= " AND (`$itemtable`.`otherserial` LIKE '%" . $PluginFinancialreportsParameter->fields[$type] . "%%') ";
174 |
175 | $query .= " AND (`glpi_infocoms`.`buy_date` < '" . $date . "' || `glpi_infocoms`.`buy_date` IS NULL) ";
176 |
177 | if ($locations_id > 0) {
178 | $query .= " AND " . self::getRealQueryForTreeItem('glpi_locations', $locations_id, "`$itemtable`.`locations_id`");
179 | }
180 |
181 | $query .= "ORDER BY ITEM_3,ITEM_0 ASC";
182 |
183 | $result = $DB->query($query);
184 |
185 | while ($data = $DB->fetchArray($result)) {
186 | $items[] = $data;
187 | }
188 |
189 | return $items;
190 | }
191 |
192 | /**
193 | * @param $itemtype
194 | * @param $PluginFinancialreportsParameter
195 | * @param $type
196 | * @param $date
197 | * @param $locations_id
198 | *
199 | * @return int
200 | */
201 | function QueryItemsTotalValue($itemtype, $PluginFinancialreportsParameter, $type, $date, $locations_id) {
202 | global $DB;
203 |
204 | $dbu = new DbUtils();
205 | $deleted = 0;
206 | $first = true;
207 | $itemtable = $dbu->getTableForItemType($itemtype);
208 | $item = new $itemtype();
209 | $somme = 0;
210 | $query_value = "SELECT SUM(`glpi_infocoms`.`value`) AS Total_value
211 | FROM `glpi_infocoms`,`$itemtable`
212 | LEFT JOIN `glpi_states` ON (`$itemtable`.`states_id` = `glpi_states`.`id`) ";
213 | $query_value .= " WHERE `glpi_infocoms`.`items_id` = `$itemtable`.`id`
214 | AND `glpi_infocoms`.`itemtype` = '" . $itemtype . "'";
215 | // Add deleted if item have it
216 | if ($item->maybeDeleted()) {
217 | $LINK = " AND ";
218 | $query_value .= $LINK . "`" . $itemtable . "`.`is_deleted` = '0' ";
219 | if ($first) {
220 | $LINK = " ";
221 | $first = false;
222 | }
223 | }
224 | // Remove template items
225 | if ($item->maybeTemplate()) {
226 | $LINK = " AND ";
227 | if ($first) {
228 | $LINK = " ";
229 | $first = false;
230 | }
231 | $query_value .= $LINK . "`" . $itemtable . "`.`is_template` = '0' ";
232 | }
233 | // Add Restrict to current entities
234 | if ($item->isEntityAssign()) {
235 | $LINK = " AND ";
236 | if ($first) {
237 | $LINK = " ";
238 | $first = false;
239 | }
240 |
241 | $query_value .= $dbu->getEntitiesRestrictRequest($LINK, $itemtable);
242 | }
243 |
244 | $query_state = "SELECT `states_id`
245 | FROM `glpi_plugin_financialreports_configs`";
246 | $result_state = $DB->query($query_state);
247 | if ($DB->numrows($result_state) > 0) {
248 | $query_value .= "AND (`$itemtable`.`states_id` = 999999 ";
249 | while ($data_state = $DB->fetchArray($result_state)) {
250 | $type_where = "OR `$itemtable`.`states_id` != '" . $data_state["states_id"] . "' ";
251 | $query_value .= " $type_where ";
252 | }
253 | $query_value .= ") ";
254 | }
255 | if (!empty($type) && !empty($PluginFinancialreportsParameter->fields[$type]))
256 | $query_value .= " AND (`$itemtable`.`otherserial` LIKE '%" . $PluginFinancialreportsParameter->fields[$type] . "%%') ";
257 |
258 | $query_value .= " AND (`glpi_infocoms`.`buy_date` < '" . $date . "' || `glpi_infocoms`.`buy_date` IS NULL) ";
259 |
260 | if (!empty($locations_id)) {
261 | $query_value .= " AND " . self::getRealQueryForTreeItem('glpi_locations', $locations_id, "`$itemtable`.`locations_id`");
262 | }
263 |
264 | $result_value = $DB->query($query_value);
265 | if ($data_value = $DB->fetchArray($result_value)) {
266 | $somme = $data_value["Total_value"];
267 | }
268 | return $somme;
269 | }
270 |
271 | static public function getRealQueryForTreeItem($table, $IDf, $reallink = "") {
272 |
273 | if (empty($IDf)) {
274 | return "";
275 | }
276 |
277 | if (empty($reallink)) {
278 | $reallink = "`".$table."`.`id`";
279 | }
280 | $dbu = new DbUtils();
281 | $id_found = $dbu->getSonsOf($table, $IDf);
282 |
283 | // Construct the final request
284 | return $reallink." IN ('".implode("','", $id_found)."')";
285 | }
286 |
287 | /**
288 | * @param $locations_id
289 | *
290 | * @return array
291 | */
292 | function selectItemsForDisposalQuery($locations_id) {
293 | global $DB;
294 |
295 | $items = [];
296 | $type1 = 'Computer';
297 | $type2 = 'Printer';
298 | $type3 = 'NetworkEquipment';
299 | $type4 = 'Peripheral';
300 | $type5 = 'Monitor';
301 | $type6 = 'Phone';
302 |
303 | $query = $this->queryDisposalItems($type1, $locations_id);
304 | $query .= " UNION " . $this->queryDisposalItems($type2, $locations_id);
305 | $query .= " UNION " . $this->queryDisposalItems($type3, $locations_id);
306 | $query .= " UNION " . $this->queryDisposalItems($type4, $locations_id);
307 | $query .= " UNION " . $this->queryDisposalItems($type5, $locations_id);
308 | $query .= " UNION " . $this->queryDisposalItems($type6, $locations_id);
309 |
310 | $query .= " ORDER BY ITEM_10,ITEM_2 ASC";
311 |
312 | $result = $DB->query($query);
313 |
314 | while ($data = $DB->fetchArray($result)) {
315 | $items[] = $data;
316 | }
317 | return $items;
318 | }
319 |
320 | /**
321 | * @param $type
322 | * @param $locations_id
323 | *
324 | * @return string
325 | */
326 | function queryDisposalItems($type, $locations_id) {
327 | global $DB;
328 |
329 | $dbu = new DbUtils();
330 | $first = true;
331 | $deleted = 0;
332 | $modeltable = $dbu->getTableForItemType($type . "Model");
333 | $modelfield = $dbu->getForeignKeyFieldForTable($dbu->getTableForItemType($type . "Model"));
334 | $itemtable = $dbu->getTableForItemType($type);
335 |
336 | $query = "SELECT `" . $itemtable . "`.`name` AS ITEM_0, `glpi_locations`.`completename` AS ITEM_1,
337 | `" . $itemtable . "`.`otherserial` AS ITEM_2, `glpi_infocoms`.`buy_date` AS ITEM_3, `glpi_users`.`name` AS ITEM_4,
338 | `glpi_users`.`realname` AS ITEM_4_2, `glpi_users`.`id` AS ITEM_4_3, `glpi_users`.`firstname` AS ITEM_4_4,
339 | `glpi_groups`.`name` AS ITEM_5,`glpi_groups`.`id` AS ITEM_5_1,`$modeltable`.`name` AS ITEM_6 ";
340 | $query .= ", `glpi_manufacturers`.`name` AS ITEM_7, `glpi_infocoms`.`value` AS ITEM_8, `" . $itemtable . "`.`id` AS id,
341 | `" . $itemtable . "`.`comment` AS ITEM_9, `glpi_infocoms`.`decommission_date` AS ITEM_10,'$type' AS TYPE
342 | FROM `" . $itemtable . "`
343 | LEFT JOIN `glpi_locations` ON (`" . $itemtable . "`.`locations_id` = `glpi_locations`.`id`)
344 | LEFT JOIN `glpi_infocoms` ON (`" . $itemtable . "`.`id` = `glpi_infocoms`.`items_id` AND `glpi_infocoms`.`itemtype` = '" . $type . "')
345 | LEFT JOIN `glpi_users` ON (`" . $itemtable . "`.`users_id` = `glpi_users`.`id`)
346 | LEFT JOIN `glpi_groups` ON (`" . $itemtable . "`.`groups_id` = `glpi_groups`.`id`) ";
347 | $query .= "LEFT JOIN `$modeltable` ON (`" . $itemtable . "`.`$modelfield` = `$modeltable`.`id`) ";
348 | $query .= "LEFT JOIN `glpi_states` ON (`" . $itemtable . "`.`states_id` = `glpi_states`.`id`)
349 | LEFT JOIN `glpi_manufacturers` ON (`" . $itemtable . "`.`manufacturers_id` = `glpi_manufacturers`.`id`)";
350 | $query .= "WHERE ";
351 |
352 | $item = new $type();
353 | // Add deleted if item have it
354 | if ($item->maybeDeleted()) {
355 | $LINK = " ";
356 | if ($first) {
357 | $LINK = " ";
358 | $first = false;
359 | }
360 | $query .= $LINK . "`" . $itemtable . "`.`is_deleted` = '$deleted' ";
361 | }
362 | // Remove template items
363 | if ($item->maybeTemplate()) {
364 | $LINK = " AND ";
365 | if ($first) {
366 | $LINK = " ";
367 | $first = false;
368 | }
369 | $query .= $LINK . "`" . $itemtable . "`.`is_template` = '0' ";
370 | }
371 | // Add Restrict to current entities
372 | if ($item->isEntityAssign()) {
373 | $LINK = " AND ";
374 | if ($first) {
375 | $LINK = " ";
376 | $first = false;
377 | }
378 |
379 | $query .= $dbu->getEntitiesRestrictRequest($LINK, $itemtable);
380 | }
381 | $query_state = "SELECT `states_id`
382 | FROM `glpi_plugin_financialreports_configs`";
383 | $result_state = $DB->query($query_state);
384 | if ($DB->numrows($result_state) > 0) {
385 | $query .= "AND (`" . $itemtable . "`.`states_id` IS NULL ";
386 | while ($data_state = $DB->fetchArray($result_state)) {
387 | $type_where = "OR `" . $itemtable . "`.`states_id` = '" . $data_state["states_id"] . "' ";
388 | $query .= " $type_where ";
389 | }
390 | $query .= ") ";
391 | }
392 | if ($locations_id > 0) {
393 | $query .= " AND " . self::getRealQueryForTreeItem('glpi_locations', $locations_id, "`$itemtable`.`locations_id`");
394 | }
395 |
396 | return $query;
397 | }
398 |
399 | /**
400 | * @param $values
401 | * @param $display
402 | */
403 | function displayReport($values, $display) {
404 |
405 | $default_values["date"] = date("Y-m-d");
406 | $default_values["locations_id"] = 0;
407 | $default_values["start"] = 0;
408 | $default_values["id"] = 0;
409 | $default_values["export"] = false;
410 |
411 | foreach ($default_values as $key => $val) {
412 | if (isset($values[$key])) {
413 | $$key = $values[$key];
414 | }
415 | }
416 |
417 | $dbu = new DbUtils();
418 |
419 | $output_type = Search::HTML_OUTPUT;
420 |
421 | if (isset($values["display_type"]))
422 | $output_type = $values["display_type"];
423 |
424 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
425 | $PDF = new PluginFinancialreportsPdf('L', 'mm', 'A4');
426 | $PDF->setDate($date);
427 | $PDF->AddPage();
428 | }
429 | $param = new PluginFinancialreportsParameter();
430 | $param->getFromDB('1');
431 |
432 | $first = false;
433 | $deleted = 0;
434 | $master_total = 0;
435 | $title_report = __('Financial report ended on', 'financialreports') . " " . Html::convDate($date);
436 | $start = 0;
437 | $numrows = 0;
438 | $end_display = $start + $_SESSION["glpilist_limit"];
439 | $nbcols = 7;
440 | $parameters = "date=" . $date . "&locations_id=" . $locations_id;
441 |
442 | foreach ($display as $key => $val) {
443 | $$key = $key;
444 | }
445 |
446 | if ($output_type == Search::HTML_OUTPUT) { // HTML display
447 | echo "" . $title_report . "
";
448 | self::printPager($start, 0, '', $parameters, 1);
449 | }
450 |
451 | echo Search::showHeader($output_type, $end_display - $start + 1, $nbcols, 1); //table + div
452 |
453 | if (!empty($param->fields["computers_otherserial"]) || !empty($param->fields["notebooks_otherserial"]) || !empty($param->fields["servers_otherserial"])) {
454 | $itemtable = $dbu->getTableForItemType('Computer');
455 | //////////////////////COMPUTERS///////////////
456 | $total = $this->getItemsTotal('Computer', $param, "computers_otherserial", $date, 0, "", $locations_id);
457 | $items = $this->getItems('Computer', $param, "computers_otherserial", $date, 0, "", $locations_id);
458 | $master_total += $total;
459 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
460 | $PDF->display_table($total, $items, _n('Computer', 'Computers', 2));
461 | } else {
462 | $this->displayTable($date, $displaypc, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Computer', 'Computers', 2), $total, $items, $locations_id);
463 | }
464 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
465 | //////////////////////PORTABLES///////////////
466 | $total = $this->getItemsTotal('Computer', $param, "notebooks_otherserial", $date, 0, "", $locations_id);
467 | $items = $this->getItems('Computer', $param, "notebooks_otherserial", $date, 0, "", $locations_id);
468 | $master_total += $total;
469 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
470 | $PDF->display_table($total, $items, _n('Notebook', 'Notebooks', 2, 'financialreports'));
471 | } else {
472 | $this->displayTable($date, $displaynotebook, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Notebook', 'Notebooks', 2, 'financialreports'), $total, $items, $locations_id);
473 | }
474 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
475 | //////////////////////SERVERS///////////////
476 | $total = $this->getItemsTotal('Computer', $param, "servers_otherserial", $date, 0, "", $locations_id);
477 | $items = $this->getItems('Computer', $param, "servers_otherserial", $date, 0, "", $locations_id);
478 | $master_total += $total;
479 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
480 | $PDF->display_table($total, $items, _n('Server', 'Servers', 2, 'financialreports'));
481 | } else {
482 | $this->displayTable($date, $displayserver, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Server', 'Servers', 2, 'financialreports'), $total, $items, $locations_id);
483 | }
484 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
485 | //No config
486 | } else {
487 | $itemtable = $dbu->getTableForItemType('Computer');
488 | //////////////////////ALL COMPUTERS///////////////
489 | $total = $this->getItemsTotal('Computer', $param, "no_value", $date, 0, "", $locations_id);
490 | $items = $this->getItems('Computer', $param, "no_value", $date, 0, "", $locations_id);
491 | $master_total += $total;
492 | // if ($total > 0) {
493 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
494 | $PDF->display_table($total, $items, _n('Computer', 'Computers', 2));
495 | } else {
496 | $this->displayTable($date, $displaypc, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Computer', 'Computers', 2), $total, $items, $locations_id);
497 | }
498 | // }
499 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
500 | }
501 |
502 | //////////////////////MONITORS///////////////
503 | $itemtable = $dbu->getTableForItemType('Monitor');
504 | $total = $this->getItemsTotal('Monitor', $param, "monitors_otherserial", $date, 0, "", $locations_id);
505 | $items = $this->getItems('Monitor', $param, "monitors_otherserial", $date, 0, "", $locations_id);
506 | $master_total += $total;
507 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
508 | $PDF->display_table($total, $items, _n('Monitor', 'Monitors', 2));
509 | } else {
510 | $this->displayTable($date, $displaymonitor, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Monitor', 'Monitors', 2), $total, $items, $locations_id);
511 | }
512 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
513 |
514 | //////////////////////PRINTERS///////////////
515 | $itemtable = $dbu->getTableForItemType('Printer');
516 | $total = $this->getItemsTotal('Printer', $param, "printers_otherserial", $date, 0, "", $locations_id);
517 | $items = $this->getItems('Printer', $param, "printers_otherserial", $date, 0, "", $locations_id);
518 | $master_total += $total;
519 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
520 | $PDF->display_table($total, $items, _n('Printer', 'Printers', 2));
521 | } else {
522 | $this->displayTable($date, $displayprinter, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Printer', 'Printers', 2), $total, $items, $locations_id);
523 | }
524 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
525 |
526 | //////////////////////NETWORK///////////////
527 | $itemtable = $dbu->getTableForItemType('NetworkEquipment');
528 | $total = $this->getItemsTotal('NetworkEquipment', $param, "networkequipments_otherserial", $date, 0, "", $locations_id);
529 | $items = $this->getItems('NetworkEquipment', $param, "networkequipments_otherserial", $date, 0, "", $locations_id);
530 | $master_total += $total;
531 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
532 | $PDF->display_table($total, $items, _n('Network device', 'Network devices', 2));
533 | } else {
534 | $this->displayTable($date, $displaynetworking, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Network device', 'Network devices', 2), $total, $items, $locations_id);
535 | }
536 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
537 |
538 | //////////////////////PERIPHERIQUES///////////////
539 | $itemtable = $dbu->getTableForItemType('Peripheral');
540 | $total = $this->getItemsTotal('Peripheral', $param, "peripherals_otherserial", $date, 0, "", $locations_id);
541 | $items = $this->getItems('Peripheral', $param, "peripherals_otherserial", $date, 0, "", $locations_id);
542 | $master_total += $total;
543 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
544 | $PDF->display_table($total, $items, _n('Device', 'Devices', 2));
545 | } else {
546 | $this->displayTable($date, $displayperipheral, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Device', 'Devices', 2), $total, $items, $locations_id);
547 | }
548 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
549 |
550 | //////////////////////PHONES///////////////
551 | $itemtable = $dbu->getTableForItemType('Phone');
552 | $total = $this->getItemsTotal('Phone', $param, "phones_otherserial", $date, 0, "", $locations_id);
553 | $items = $this->getItems('Phone', $param, "phones_otherserial", $date, 0, "", $locations_id);
554 | $master_total += $total;
555 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
556 | $PDF->display_table($total, $items, _n('Phone', 'Phones', 2));
557 | } else {
558 | $this->displayTable($date, $displayphone, $output_type, $itemtable, $end_display, $start, $nbcols, _n('Phone', 'Phones', 2), $total, $items, $locations_id);
559 | }
560 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
561 | //////////////////////SORTIS///////////////
562 | $total = -1;
563 | $items = "";
564 | $items = $this->selectItemsForDisposalQuery($locations_id);
565 |
566 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
567 | $PDF->display_table($total, $items, _n('Element out', 'Elements out', 2, 'financialreports'), 1);
568 | } else {
569 | $this->displayTable($date, $displaydisposal, $output_type, "disposal", $end_display, $start, $nbcols, _n('Element out', 'Elements out', 2, 'financialreports'), $total, $items, $locations_id);
570 | }
571 | if ($total != 0 && $output_type == Search::PDF_OUTPUT_LANDSCAPE) $PDF->AddPage();
572 |
573 | //////////END////////////////
574 |
575 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
576 | //////////Total general////////////////
577 | $PDF->display_table_fin($master_total);
578 | //////////END////////////////
579 | $PDF->Output();
580 | }
581 | if ($output_type == Search::HTML_OUTPUT) {
582 | echo "
";
583 | echo Search::showHeader($output_type, 1, 1, 1);
584 | } else {
585 | echo Search::showNewLine($output_type);
586 | echo Search::showEndLine($output_type);
587 | }
588 | $row_num = 6000;
589 | $item_num = 1;
590 | echo Search::showNewLine($output_type, $row_num % 2);
591 | echo Search::showItem($output_type, __('General Total', 'financialreports'), $item_num, $row_num);
592 | echo Search::showItem($output_type, Html::formatNumber($master_total) . " " . _n('Euro', 'Euros', 2, 'financialreports'), $item_num, $row_num);
593 | echo Search::showEndLine($output_type);
594 |
595 | $title = "";
596 | // Create title
597 | if ($output_type == Search::PDF_OUTPUT_LANDSCAPE) {
598 | $title .= $title_report;
599 | }
600 | // Display footer
601 | if ($output_type == Search::HTML_OUTPUT) {
602 | echo "";
603 | }
604 | }
605 |
606 | /**
607 | * @param $date
608 | * @param $display
609 | * @param $output_type
610 | * @param $itemtable
611 | * @param $end_display
612 | * @param $start
613 | * @param $nbcols
614 | * @param $titre
615 | * @param $total
616 | * @param $items
617 | * @param $locations_id
618 | *
619 | * @return int
620 | */
621 | function displayTable($date, $display, $output_type, $itemtable, $end_display, $start, $nbcols, $titre, $total, $items, $locations_id) {
622 | global $CFG_GLPI;
623 |
624 | $first = true;
625 | $deleted = 0;
626 | $master_total = 0;
627 |
628 | $master_total += $total;
629 | // if ($total != 0) {
630 | if ($output_type == Search::HTML_OUTPUT) {
631 | echo "
";
632 | echo Search::showHeader($output_type, $end_display - $start + 1, $nbcols, 1);
633 | } else {
634 | echo Search::showNewLine($output_type);
635 | echo Search::showEndLine($output_type);
636 | }
637 | echo Search::showNewLine($output_type); //tr
638 |
639 | if ($output_type == Search::HTML_OUTPUT) {
640 | if ($total != -1) {
641 | echo "" . $titre . " | "
642 | . Html::formatNumber($total) . " " . _n('Euro', 'Euros', 2, 'financialreports') . " | ";
643 | } else {
644 | echo " | " . $titre . " | | ";
645 | }
646 | if ($_SESSION[$display])
647 | $status = "false";
648 | else
649 | $status = "true";
650 |
651 | echo "";
653 | if ($_SESSION[$display])
654 | echo __('Hide', 'financialreports');
655 | else
656 | echo __('Display', 'financialreports');
657 | echo "";
658 |
659 | if ($itemtable != 'disposal') {
660 | echo " | | ";
661 | } else {
662 | echo " | | ";
663 | }
664 | } else {
665 | echo Search::showHeaderItem($output_type, $titre, $header_num);//th
666 | echo Search::showHeaderItem($output_type, __('Total'), $header_num);
667 | if ($total != -1) {
668 | echo Search::showHeaderItem($output_type, Html::formatNumber($total) . " " . _n('Euro', 'Euros', 2, 'financialreports'), $header_num);
669 | }
670 | }
671 |
672 | echo Search::showEndLine($output_type);//tr
673 |
674 | echo Search::showNewLine($output_type);
675 | $header_num = 1;
676 |
677 | echo Search::showHeaderItem($output_type, __('Name'), $header_num);
678 | echo Search::showHeaderItem($output_type, __('Inventory number'), $header_num);
679 | echo Search::showHeaderItem($output_type, __('Date of purchase'), $header_num);
680 |
681 | if ($itemtable != 'disposal') {
682 | echo Search::showHeaderItem($output_type, __('User / Group', 'financialreports'), $header_num);
683 | echo Search::showHeaderItem($output_type, __('Location'), $header_num);
684 | }
685 | echo Search::showHeaderItem($output_type, __('Model'), $header_num);
686 | echo Search::showHeaderItem($output_type, __('Supplier'), $header_num);
687 |
688 | if ($itemtable == 'disposal') {
689 | echo Search::showHeaderItem($output_type, __('Decommission date'), $header_num);
690 | echo Search::showHeaderItem($output_type, __('Comments'), $header_num);
691 | } else {
692 | echo Search::showHeaderItem($output_type, __('Purchase Price HT in', 'financialreports') . " " . _n('Euro', 'Euros', 2, 'financialreports'), $header_num);
693 | }
694 | // End Line for column headers
695 | echo Search::showEndLine($output_type);
696 |
697 | $row_num = 1;
698 | if ($_SESSION[$display]) {
699 |
700 | foreach ($items as $data) {
701 | $row_num++;
702 | $item_num = 1;
703 |
704 | echo Search::showNewLine($output_type, $row_num % 2);
705 | //name
706 | $link = Toolbox::getItemTypeFormURL($data["TYPE"]);
707 | $output_iddev = "" . $data["ITEM_0"] . ($_SESSION["glpiis_ids_visible"] ? " (" . $data["id"] . ")" : "") . "";
708 | echo Search::showItem($output_type, $output_iddev, $item_num, $row_num);
709 | //otherserial
710 | echo Search::showItem($output_type, $data["ITEM_2"], $item_num, $row_num);
711 | //buy_date
712 | echo Search::showItem($output_type, Html::convDate($data["ITEM_3"]), $item_num, $row_num);
713 |
714 | if ($itemtable != 'disposal') {
715 | $dbu = new DbUtils();
716 | //user
717 | $username_computer = $dbu->formatUserName($data["ITEM_4_3"], $data["ITEM_4"], $data["ITEM_4_2"], $data["ITEM_4_4"]);
718 | $output_iduser = "" . $username_computer . "";
719 | if ($data["ITEM_4_3"] && $data["ITEM_5"]) {
720 | $output_iduser .= " / " . $data["ITEM_5"] . ($_SESSION["glpiis_ids_visible"] ? " (" . $data["ITEM_5_1"] . ")" : "") . "";
721 | } else if (!isset($data["ITEM_4_3"]) && $data["ITEM_5"]) {
722 | $output_iduser = "" . $data["ITEM_5"] . ($_SESSION["glpiis_ids_visible"] ? " (" . $data["ITEM_5_1"] . ")" : "") . "";
723 | } else if (!isset($data["ITEM_4_3"]) && !isset($data["ITEM_5"])) {
724 | $output_iduser = __('In stock / available', 'financialreports');
725 | }
726 |
727 | echo Search::showItem($output_type, $output_iduser, $item_num, $row_num);
728 | //location
729 | echo Search::showItem($output_type, $data["ITEM_9"], $item_num, $row_num);
730 | }
731 | //model
732 | echo Search::showItem($output_type, $data["ITEM_6"], $item_num, $row_num);
733 | //manufacturer
734 | echo Search::showItem($output_type, $data["ITEM_7"], $item_num, $row_num);
735 |
736 | if ($itemtable == 'disposal') {
737 | //comments
738 | echo Search::showItem($output_type, Html::convDate($data["ITEM_10"]), $item_num, $row_num);
739 | echo Search::showItem($output_type, nl2br($data["ITEM_9"]), $item_num, $row_num);
740 | } else {
741 | //value
742 | if ($output_type == Search::HTML_OUTPUT) {
743 | $ouput_value = "" . Html::formatNumber($data["ITEM_8"]) . "";
744 | } else {
745 | $ouput_value = Html::formatNumber($data["ITEM_8"]);
746 | }
747 | echo Search::showItem($output_type, $ouput_value, $item_num, $row_num);
748 | }
749 | echo Search::showEndLine($output_type);
750 | }
751 | }
752 | echo Search::showFooter($output_type);
753 | // }
754 |
755 | return $master_total;
756 | }
757 |
758 | /**
759 | * @param $start
760 | * @param $numrows
761 | * @param $target
762 | * @param $parameters
763 | * @param int $item_type_output
764 | * @param int $item_type_output_param
765 | */
766 | static function printPager($start, $numrows, $target, $parameters, $item_type_output = 0, $item_type_output_param = 0) {
767 | global $CFG_GLPI;
768 |
769 | $list_limit = $_SESSION['glpilist_limit'];
770 | // Forward is the next step forward
771 | $forward = $start + $list_limit;
772 |
773 | // This is the end, my friend
774 | $end = $numrows - $list_limit;
775 |
776 | // Human readable count starts here
777 | $current_start = $start + 1;
778 |
779 | // And the human is viewing from start to end
780 | $current_end = $current_start + $list_limit - 1;
781 | if ($current_end > $numrows) {
782 | $current_end = $numrows;
783 | }
784 |
785 | // Backward browsing
786 | if ($current_start - $list_limit <= 0) {
787 | $back = 0;
788 | } else {
789 | $back = $start - $list_limit;
790 | }
791 |
792 | // Print it
793 |
794 | echo " |