From 9e5489a98cfa44ebfd3591e975ce284a2549716c Mon Sep 17 00:00:00 2001 From: Dany wm Date: Fri, 18 Oct 2024 21:39:11 +0200 Subject: [PATCH] review scenario : acc_ledger_history --- include/class/acc_ledger_history.class.php | 2 +- .../acc_ledger_history_generic.class.php | 2 +- .../acc_ledger_history_purchase.class.php | 2 - .../class/acc_ledger_history_sale.class.php | 3 +- scenario/acc_ledger_AccountTest.php | 47 ------------------ scenario/acc_ledger_historyTest.php | 48 ++++++++++++------- scenario/ach-call-menu.php | 4 ++ 7 files changed, 38 insertions(+), 70 deletions(-) delete mode 100644 scenario/acc_ledger_AccountTest.php diff --git a/include/class/acc_ledger_history.class.php b/include/class/acc_ledger_history.class.php index 38b2b8847..d244cb9f0 100644 --- a/include/class/acc_ledger_history.class.php +++ b/include/class/acc_ledger_history.class.php @@ -38,7 +38,7 @@ abstract class Acc_Ledger_History public $db; //!< database connx protected $ledger_type; //! type of ledger VEN , ACH , ODS, FIN protected $filter_operation; //!< to filter paid, unpaid or all operation - + protected $data; // Contains data see acc_ledger_history_financial->get_row /** * * @param Database $cn diff --git a/include/class/acc_ledger_history_generic.class.php b/include/class/acc_ledger_history_generic.class.php index 6bbabe3b1..53f5bcf2d 100644 --- a/include/class/acc_ledger_history_generic.class.php +++ b/include/class/acc_ledger_history_generic.class.php @@ -33,7 +33,7 @@ class Acc_Ledger_History_Generic extends Acc_Ledger_History { - private $data; //!< array of rows + /** * Constructor diff --git a/include/class/acc_ledger_history_purchase.class.php b/include/class/acc_ledger_history_purchase.class.php index 0dca3160f..3e03c08c0 100644 --- a/include/class/acc_ledger_history_purchase.class.php +++ b/include/class/acc_ledger_history_purchase.class.php @@ -32,8 +32,6 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History { - private $data;//!< Contains rows from SQL - /** * @param mixed $data */ diff --git a/include/class/acc_ledger_history_sale.class.php b/include/class/acc_ledger_history_sale.class.php index 0240db9b1..0b3b80208 100644 --- a/include/class/acc_ledger_history_sale.class.php +++ b/include/class/acc_ledger_history_sale.class.php @@ -31,8 +31,7 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History { - private $data; //!< Contains rows from SQL - + public function __construct(\Database $cn, $pa_ledger, $p_from, $p_to, $p_mode) diff --git a/scenario/acc_ledger_AccountTest.php b/scenario/acc_ledger_AccountTest.php deleted file mode 100644 index 0114e8bd7..000000000 --- a/scenario/acc_ledger_AccountTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - -/** - * @file - * @brief - * @param type $name Descriptionara - */ -require_once NOALYSS_INCLUDE."/class/acc_account_ledger.class.php"; - - $_GET=array ( -); -$_POST=array ( -); -$_POST['gDossier']=$gDossierLogInput; -$_GET['gDossier']=$gDossierLogInput; -$_REQUEST=array_merge($_GET,$_POST); -$acc_count=$cn->get_array("select count(*),j_poste". - " from jrnx ". - "group by j_poste order by count(*) desc"); - -$a=new Acc_Account_Ledger($cn,$acc_count[0]['j_poste']); -echo h1("Acc_Account_Ledger->get_row"); -$result=$a->get_row($min,$max); -var_dump($result); -echo h1("Acc_Account_Ledger->get_row_date"); -$result=$a->get_row_date('01.01.200','01.01.2099'); -var_dump($result); - diff --git a/scenario/acc_ledger_historyTest.php b/scenario/acc_ledger_historyTest.php index 2800d542d..76b001e9a 100644 --- a/scenario/acc_ledger_historyTest.php +++ b/scenario/acc_ledger_historyTest.php @@ -19,14 +19,14 @@ */ // Copyright (2018) Author Dany De Bontridder - +//@description:History : show different history : detail, list, ... /** * @file - * @brief Test of ledger_history + * @brief Test of ledger_history show html */ require_once NOALYSS_INCLUDE."/class/acc_ledger_history.class.php"; - +html_page_start(); $ledger=[1,2,3,4]; echo Dossier::hidden(); global $cn, $g_user, $g_succeed, $g_failed; @@ -35,13 +35,18 @@ $cn=Dossier::connect(); $ledger_history=Acc_Ledger_History::factory($cn, $ledger, $min, $max, "E","all"); echo h1("Detailled Accounting"); echo h2(_("export detail html all ledgers result = Detailled Accounting from Acc_Ledger_History_Generic")); +echo 'Detailled Accounting'; $ledger_history->export_detail_html(); -echo h2(_("Set mode to D etailled all_ledgers result = Detailled Accounting from Acc_Ledger_History_Generic" )); +echo h2(_("Set mode to D etailled all_ledgers result = Detailled Accounting from Acc_Ledger_History_Generic" ) + ,'id="n1"'); +echo 'Sale Listing'; + $ledger_history->set_m_mode("D"); $ledger_history->export_html(); -echo h1(_("Only VEN from Acc_Ledger_History_Sale")); +echo h1(_("Only VEN from Acc_Ledger_History_Sale"),' id="n2"'); +echo 'Sale Detailed'; $ledger_history=Acc_Ledger_History::factory($cn, [2], $min , $max , "L","all"); $ledger_history->export_detail_html(); @@ -49,46 +54,55 @@ echo h2(_("Only VEN one line")); $ledger_history->set_a_ledger([2]); $ledger_history->set_m_mode("L"); $ledger_history->export_html(); - -echo h2(_("Only VEN Detailled")); +echo h2(_("Only VEN Detailled"),'id="n3"'); +echo 'Sale Extended'; $ledger_history->set_a_ledger([2]); $ledger_history->set_m_mode("D"); $ledger_history->export_html(); -echo h2(_("Only VEN Extended")); +echo h2(_("Only VEN Extended"),'id="n4"'); +echo 'Sale + Purchase'; $ledger_history->set_a_ledger([2]); $ledger_history->set_m_mode("E"); $ledger_history->export_html(); -echo h2("VEN + ACH"); +echo h2("VEN + ACH",'id="n5"'); +echo 'Purchase Detailed'; $ledger_history=Acc_Ledger_History::factory($cn, [3,2], $min, $max , "L","all"); $ledger_history->export_oneline_html(); echo h1("ACH from Acc_Ledger_History_Purchase"); -echo h2("Detailled accouting"); +echo h2("Detailled accouting",'id="n6"'); +echo 'Purchase listing'; $ledger_history=new Acc_Ledger_History_Purchase($cn,[3],$max,$min,"A","all"); $ledger_history->export_html(); -echo h2("Ach one line"); +echo h2("Ach one line",'id="n7"'); +echo 'Purchase Detailed'; $ledger_history->set_m_mode("L"); $ledger_history->export_html(); -echo h2("Ach Detail"); +echo h2("Ach Detail" ,'id="n8"'); +echo 'Purchase Extended'; $ledger_history->set_m_mode("D"); $ledger_history->export_html(); -echo h2("Ach Extended"); +echo h2("Ach Extended" ,'id="n9"'); +echo 'Financial'; $ledger_history->set_m_mode("E"); $ledger_history->export_html(); echo h1("FIN from Acc_Ledger_History_Financial"); -echo h2("Detailled accouting"); +echo h2("Detailled accouting",'id="n10"'); +echo 'Financial one line'; $ledger_history=new Acc_Ledger_History_Financial($cn,[11,16],$min,$max,"A","all"); $ledger_history->export_html(); -echo h2("FIN one line"); +echo h2("FIN one line" ,'id="n11"'); +echo 'Financial Detailed'; $ledger_history->set_m_mode("L"); $ledger_history->export_html(); -echo h2(">FIN Detail"); +echo h2(">FIN Detail", 'id="n12"'); +echo 'Financial extended'; $ledger_history->set_m_mode("D"); $ledger_history->export_html(); -echo h2("FIN Extended"); +echo h2("FIN Extended", 'id="n13"'); $ledger_history->set_m_mode("E"); $ledger_history->export_html(); diff --git a/scenario/ach-call-menu.php b/scenario/ach-call-menu.php index dc3340c2b..ffe08ceff 100644 --- a/scenario/ach-call-menu.php +++ b/scenario/ach-call-menu.php @@ -9,4 +9,8 @@ $_POST=array ( $_POST['gDossier']=$gDossierLogInput; $_GET['gDossier']=$gDossierLogInput; $_REQUEST=array_merge($_GET,$_POST); + +html_page_start(); + + include 'compta_ach.inc.php';