noalyss Version-9
status_operation_event.class.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19// Copyright Author Dany De Bontridder danydb@aevalys.eu 14/04/23
20
21/*!
22 * \file
23 * \brief concern the detail in the dashboard, the status of the operations of sales or purchase or event
24 */
25
27{
28 private $cn;
30
31 public function __construct(Database $cn)
32 {
33 $this->cn=$cn;
34 $this->dialog_box_id="situation_detail_div";
35 }
36
37 public function __toString(): string
38 {
39 return "status_operation";
40 }
41
42
43 function display_event($p_title,$p_array,$p_what)
44 {
45 require_once NOALYSS_TEMPLATE."/status_operation_event-display_event.php";
46 }
47 /**
48 * @brief Display a box with the contains
49 * @param array $p_array Data to display
50 * @param string $p_title Title of the box
51 * @param div_name $p_div id of the box
52 */
53 function display_operation($p_title,$p_array,$p_what)
54 {
55 require_once NOALYSS_TEMPLATE."/status_operation_event-display_operation.php";
56 }
57
58 /**
59 * @brief display what it is asked
60 * @param string $p_what
61 */
62 function display($p_what) {
63 $Ledger=new Acc_Ledger($this->cn,0);
64 $last_ledger=array();
65 $last_ledger=$Ledger->get_last(20);
66
67 switch ($p_what) {
68 case 'supplier_now':
69 $this->display_operation(_("Fournisseurs à payer aujourd'hui"),$Ledger->get_supplier_now(),$p_what);
70 break;
71 case 'supplier_late':
72 $this->display_operation(_("Fournisseurs en retard"),$Ledger->get_supplier_late(),$p_what);
73 break;
74 case 'customer_now':
75 $this->display_operation(_("Client à payer aujourd'hui"),$Ledger->get_customer_now(),$p_what);
76 break;
77 case 'customer_late':
78 $this->display_operation(_("Client en retard"),$Ledger->get_customer_late(), $p_what);
79 break;
80 case 'action_now':
81 $Operation=new Follow_Up($this->cn);
82 $this->display_event(_("Action aujourd'hui"),$Operation->get_today(),$p_what);
83 case 'action_late':
84 $Operation=new Follow_Up($this->cn);
85 $this->display_event(_("Action en retard"),$Operation->get_late(),$p_what);
86 break;
87 default:
88 throw new \Exception("Unknown operation [$p_what]",EXC_PARAM_VALUE);
89 }
90 }
91 static function main_display(Database $cn)
92 {
93
94 require_once NOALYSS_TEMPLATE."/status_operation_event-main_display.php";
95 }
96}
foreach(array( 'l', 'gDossier') as $a) if(is_numeric($l)==false) $Ledger
$input_from cn
Definition: balance.inc.php:66
contains the class for connecting to Noalyss
display_event($p_title, $p_array, $p_what)
display($p_what)
display what it is asked
display_operation($p_title, $p_array, $p_what)
Display a box with the contains.
const EXC_PARAM_VALUE
Definition: constant.php:343