rewrite unit test for scenario

This commit is contained in:
Dany wm 2024-10-21 15:51:56 +02:00 committed by sparkyx
parent 9e5489a98c
commit 53a7cfb86c
64 changed files with 229 additions and 548 deletions

View file

@ -0,0 +1,34 @@
<?php
//@description: Call the function testme of the class Fiche for dev purpose
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* @file
* @brief Test , experiment the class Fiche
* @see Fiche
*/
$_GET=array (
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
Fiche::test_me();

View file

@ -0,0 +1,67 @@
<?php
//@description: Test the class Acc_Ledger_Account
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2016) Author Dany De Bontridder <dany@alchimerys.be>
/**
* @file
* @brief Test , experiment the class Fiche
* @see Fiche
*/
$_GET=array (
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
require_once NOALYSS_INCLUDE."/class/fiche.class.php";
$_GET=array (
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
$card_count=$cn->get_array("select count(*),f_id ".
" from jrnx ".
" where ".
" f_id is not null ".
"group by f_id order by count(*) desc");
$fiche=new Fiche($cn,$card_count[0]['f_id']);
$result=$fiche->get_row($min,$max);
$result_date=$fiche->get_row_date('01.01.2010','01.01.2090');
if ( count($result_date) != count($result)) {
echo "Erreur";
}
echo h1("Fiche->get_row");
var_dump($result);
echo h1("Fiche->get_row_date");
var_dump($result_date);
echo h1("to_array");
var_dump($fiche->to_array());

View file

@ -0,0 +1,108 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
//@description:History : show different history : detail, list, ...
/**
* @file
* @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;
$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 '<a href="#n1">Detailled Accounting</a>';
$ledger_history->export_detail_html();
echo h2(_("Set mode to D etailled all_ledgers result = Detailled Accounting from Acc_Ledger_History_Generic" )
,'id="n1"');
echo '<a href="#n2">Sale Listing</a>';
$ledger_history->set_m_mode("D");
$ledger_history->export_html();
echo h1(_("Only VEN from Acc_Ledger_History_Sale"),' id="n2"');
echo '<a href="#n3">Sale Detailed</a>';
$ledger_history=Acc_Ledger_History::factory($cn, [2], $min , $max , "L","all");
$ledger_history->export_detail_html();
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"),'id="n3"');
echo '<a href="#n4">Sale Extended</a>';
$ledger_history->set_a_ledger([2]);
$ledger_history->set_m_mode("D");
$ledger_history->export_html();
echo h2(_("Only VEN Extended"),'id="n4"');
echo '<a href="#n5">Sale + Purchase</a>';
$ledger_history->set_a_ledger([2]);
$ledger_history->set_m_mode("E");
$ledger_history->export_html();
echo h2("VEN + ACH",'id="n5"');
echo '<a href="#n6">Purchase Detailed</a>';
$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",'id="n6"');
echo '<a href="#n7">Purchase listing</a>';
$ledger_history=new Acc_Ledger_History_Purchase($cn,[3],$max,$min,"A","all");
$ledger_history->export_html();
echo h2("Ach one line",'id="n7"');
echo '<a href="#n8">Purchase Detailed</a>';
$ledger_history->set_m_mode("L");
$ledger_history->export_html();
echo h2("Ach Detail" ,'id="n8"');
echo '<a href="#n9">Purchase Extended</a>';
$ledger_history->set_m_mode("D");
$ledger_history->export_html();
echo h2("Ach Extended" ,'id="n9"');
echo '<a href="#n10">Financial</a>';
$ledger_history->set_m_mode("E");
$ledger_history->export_html();
echo h1("FIN from Acc_Ledger_History_Financial");
echo h2("Detailled accouting",'id="n10"');
echo '<a href="#n11">Financial one line</a>';
$ledger_history=new Acc_Ledger_History_Financial($cn,[11,16],$min,$max,"A","all");
$ledger_history->export_html();
echo h2("FIN one line" ,'id="n11"');
echo '<a href="#n12">Financial Detailed</a>';
$ledger_history->set_m_mode("L");
$ledger_history->export_html();
echo h2(">FIN Detail", 'id="n12"');
echo '<a href="#n13">Financial extended</a>';
$ledger_history->set_m_mode("D");
$ledger_history->export_html();
echo h2("FIN Extended", 'id="n13"');
$ledger_history->set_m_mode("E");
$ledger_history->export_html();

View file

@ -0,0 +1,16 @@
<?php
//@description:ACH new purchase
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUACH/ACH',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
html_page_start();
include 'compta_ach.inc.php';

View file

@ -0,0 +1,39 @@
<?php
//@description:ACH Confirmation Achat
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUACH/ACH',
);
$_POST=array (
'gDossier' => '42',
'e_client' => 'FOURNI1',
'nb_item' => '1',
'p_jrn' => '3',
'e_comm' => 'Loyer',
'e_date' => '01.01.2017',
'e_ech' => '',
'jrn_type' => 'ACH',
'e_pj' => 'ACH1',
'e_pj_suggest' => 'ACH1',
'mt' => '141599523a8.7737',
'e_mp' => '0',
'e_march0' => 'LOYER',
'e_march0_price' => '2560',
'e_march0_tva_id' => '4',
'e_march0_tva_amount' => '0',
'e_quant0' => '1',
'bon_comm' => '',
'other_info' => '',
'ac' => 'COMPTA/MENUACH/ACH',
'opd_name' => 'Paiement loyer',
'od_description' => 'Paiement du loyer',
'record' => 'Enregistrement',
'p_currency_rate'=>1 ,
'p_currency_code'=>'0'
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
html_page_start();
include 'compta_ach.inc.php';

View file

@ -0,0 +1,111 @@
<?php
//@description:ACH Confirmation avec opération prédéfinie
$_GET=array (
'p_jrn_predef' => '3',
'ac' => 'COMPTA/MENUACH/ACH',
'gDossier' => '42',
'pre_def' => '1',
);
$_POST=array (
'gDossier' => '42',
'nb_item' => '10',
'p_jrn' => '3',
'e_date' => '01.02.2017',
'e_ech' => '',
'e_client' => 'FOURNI1',
'e_pj' => 'ACH2',
'e_pj_suggest' => 'ACH2',
'e_comm' => 'Paiement loyer',
'e_march0' => 'LOYER',
'e_march0_label' => 'TEST',
'e_march0_price' => '2560.0000',
'e_quant0' => '1.0000',
'htva_march0' => '2560',
'e_march0_tva_id' => '4',
'e_march0_tva_amount' => '0',
'tva_march0' => '0',
'tvac_march0' => '2560',
'e_march1' => '',
'e_march1_price' => '',
'e_quant1' => '1',
'htva_march1' => '0',
'e_march1_tva_id' => '',
'e_march1_tva_amount' => '',
'tva_march1' => '0',
'tvac_march1' => '0',
'e_march2' => '',
'e_march2_price' => '',
'e_quant2' => '1',
'htva_march2' => '0',
'e_march2_tva_id' => '',
'e_march2_tva_amount' => '',
'tva_march2' => '0',
'tvac_march2' => '0',
'e_march3' => '',
'e_march3_price' => '',
'e_quant3' => '1',
'htva_march3' => '0',
'e_march3_tva_id' => '',
'e_march3_tva_amount' => '',
'tva_march3' => '0',
'tvac_march3' => '0',
'e_march4' => '',
'e_march4_price' => '',
'e_quant4' => '1',
'htva_march4' => '0',
'e_march4_tva_id' => '',
'e_march4_tva_amount' => '',
'tva_march4' => '0',
'tvac_march4' => '0',
'e_march5' => '',
'e_march5_price' => '',
'e_quant5' => '1',
'htva_march5' => '0',
'e_march5_tva_id' => '',
'e_march5_tva_amount' => '',
'tva_march5' => '0',
'tvac_march5' => '0',
'e_march6' => '',
'e_march6_price' => '',
'e_quant6' => '1',
'htva_march6' => '0',
'e_march6_tva_id' => '',
'e_march6_tva_amount' => '',
'tva_march6' => '0',
'tvac_march6' => '0',
'e_march7' => '',
'e_march7_price' => '',
'e_quant7' => '1',
'htva_march7' => '0',
'e_march7_tva_id' => '',
'e_march7_tva_amount' => '',
'tva_march7' => '0',
'tvac_march7' => '0',
'e_march8' => '',
'e_march8_price' => '',
'e_quant8' => '1',
'htva_march8' => '0',
'e_march8_tva_id' => '',
'e_march8_tva_amount' => '',
'tva_march8' => '0',
'tvac_march8' => '0',
'e_march9' => '',
'e_march9_price' => '',
'e_quant9' => '1',
'htva_march9' => '0',
'e_march9_tva_id' => '',
'e_march9_tva_amount' => '',
'tva_march9' => '0',
'tvac_march9' => '0',
'jrn_type' => 'ACH',
'p_action' => 'ach',
'sa' => 'p',
'e_mp' => '0',
'view_invoice' => 'Enregistrer',
'p_currency_rate'=>1 ,
'p_currency_code'=>'0'
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_ach.inc.php';

View file

@ -0,0 +1,108 @@
<?php
//@description:ACH Enregistrer Opération achat avec op. prédéfinie
$_GET=array (
'p_jrn_predef' => '3',
'ac' => 'COMPTA/MENUACH/ACH',
'gDossier' => '42',
'pre_def' => '1',
);
$_POST=array (
'gDossier' => '42',
'nb_item' => '10',
'p_jrn' => '3',
'e_date' => '01.01.2017',
'e_ech' => '',
'e_client' => 'FOURNI1',
'e_pj' => 'ACH2',
'e_pj_suggest' => 'ACH2',
'e_comm' => 'Paiement loyer',
'e_march0' => 'LOYER',
'e_march0_price' => '2560.0000',
'e_quant0' => '1.0000',
'htva_march0' => '2560',
'e_march0_tva_id' => '4',
'e_march0_tva_amount' => '0',
'tva_march0' => '0',
'tvac_march0' => '2560',
'e_march1' => '',
'e_march1_price' => '',
'e_quant1' => '1',
'htva_march1' => '0',
'e_march1_tva_id' => '',
'e_march1_tva_amount' => '',
'tva_march1' => '0',
'tvac_march1' => '0',
'e_march2' => '',
'e_march2_price' => '',
'e_quant2' => '1',
'htva_march2' => '0',
'e_march2_tva_id' => '',
'e_march2_tva_amount' => '',
'tva_march2' => '0',
'tvac_march2' => '0',
'e_march3' => '',
'e_march3_price' => '',
'e_quant3' => '1',
'htva_march3' => '0',
'e_march3_tva_id' => '',
'e_march3_tva_amount' => '',
'tva_march3' => '0',
'tvac_march3' => '0',
'e_march4' => '',
'e_march4_price' => '',
'e_quant4' => '1',
'htva_march4' => '0',
'e_march4_tva_id' => '',
'e_march4_tva_amount' => '',
'tva_march4' => '0',
'tvac_march4' => '0',
'e_march5' => '',
'e_march5_price' => '',
'e_quant5' => '1',
'htva_march5' => '0',
'e_march5_tva_id' => '',
'e_march5_tva_amount' => '',
'tva_march5' => '0',
'tvac_march5' => '0',
'e_march6' => '',
'e_march6_price' => '',
'e_quant6' => '1',
'htva_march6' => '0',
'e_march6_tva_id' => '',
'e_march6_tva_amount' => '',
'tva_march6' => '0',
'tvac_march6' => '0',
'e_march7' => '',
'e_march7_price' => '',
'e_quant7' => '1',
'htva_march7' => '0',
'e_march7_tva_id' => '',
'e_march7_tva_amount' => '',
'tva_march7' => '0',
'tvac_march7' => '0',
'e_march8' => '',
'e_march8_price' => '',
'e_quant8' => '1',
'htva_march8' => '0',
'e_march8_tva_id' => '',
'e_march8_tva_amount' => '',
'tva_march8' => '0',
'tvac_march8' => '0',
'e_march9' => '',
'e_march9_price' => '',
'e_quant9' => '1',
'htva_march9' => '0',
'e_march9_tva_id' => '',
'e_march9_tva_amount' => '',
'tva_march9' => '0',
'tvac_march9' => '0',
'jrn_type' => 'ACH',
'e_mp' => '0',
'view_invoice' => 'Enregistrer',
'p_currency_rate'=>1 ,
'p_currency_code'=>'0'
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_ach.inc.php';

View file

@ -0,0 +1,15 @@
<?php
//@description:ACH Utilisation opération prédéfinie
$_GET=array (
'p_jrn_predef' => '3',
'ac' => 'COMPTA/MENUACH/ACH',
'gDossier' => '42',
'pre_def' => '1',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
html_page_start();
include 'compta_ach.inc.php';

13
scenario/HTML/achisto.php Normal file
View file

@ -0,0 +1,13 @@
<?php
//@description:ACHISTO History Purchase
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUACH/ACHISTO',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
html_page_start();
include 'history_operation.inc.php';

14
scenario/HTML/adhisto.php Normal file
View file

@ -0,0 +1,14 @@
<?php
//@description:ODHISTO : history Misc. Operation
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUODS/ODHISTO',
'go' => 'aller',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
html_page_start();
include 'history_operation.inc.php';

View file

@ -0,0 +1,17 @@
<?php
//@description:CARD Liste des banques
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/CARD',
'cat' => '3',
'histo' => '-1',
'start' => '01.01.2014',
'end' => '31.12.2014',
'cat_display' => 'Recherche',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'fiche.inc.php';

View file

@ -0,0 +1,17 @@
<?php
//@description:CARD Liste des clients
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/CARD',
'cat' => '2',
'histo' => '-1',
'start' => '01.01.2014',
'end' => '31.12.2014',
'cat_display' => 'Recherche',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'fiche.inc.php';

12
scenario/HTML/cfgpcmn.php Normal file
View file

@ -0,0 +1,12 @@
<?php
//@description:C0PCMN Plan comptable
$_GET=array (
'gDossier' => '42',
'ac' => 'PARAM/C0PCMN',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'param_pcmn.inc.php';

12
scenario/HTML/company.php Normal file
View file

@ -0,0 +1,12 @@
<?php
//@description:COMPANY
$_GET=array (
'gDossier' => '42',
'ac' => 'PARAM/COMPANY',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'company.inc.php';

View file

@ -0,0 +1,48 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
//@description:create a database (domaine).dossier1 , check the SQL for creating MOD1 and MOD2
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
?>
<h1 class="">create a database </h1>
Create dossier1 with sql/mod1/schema.sql , data.sql and constraint.sql
<?php
/**
* @file
* @brief
* @param type $name Descriptionara
*/
$cn=new Database();
$cn->exec_sql("create database ".domaine."dossier1 encoding='utf8'");
$cn=new Database(1, 'dos');
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/schema.sql');
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/data.sql');
$cn->execute_script(NOALYSS_INCLUDE.'/sql/mod1/constraint.sql');
echo Dossier::name(1);
?>

View file

@ -0,0 +1,50 @@
<?php
//@description:FIN Confirmation paiement
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUFIN/FIN',
);
$_POST=array (
'ac' => 'COMPTA/MENUFIN/FIN',
'gDossier' => '42',
'p_jrn' => '1',
'nb_item' => '5',
'last_sold' => '',
'first_sold' => '0',
'e_pj' => 'FIN1',
'e_pj_suggest' => 'FIN1',
'e_date' => '02.01.2017',
'mt' => '1415995351.0398',
'sa' => 'n',
'e_other0' => 'FOURNI ',
'e_other0_comment' => '',
'e_other0_amount' => '2560',
'e_concerned0' => '2',
'dateop0' => '',
'chdate' => '1',
'e_other1' => '',
'e_other1_comment' => '',
'e_other1_amount' => '0',
'e_concerned1' => '',
'dateop1' => '',
'e_other2' => '',
'e_other2_comment' => '',
'e_other2_amount' => '0',
'e_concerned2' => '',
'dateop2' => '',
'e_other3' => '',
'e_other3_comment' => '',
'e_other3_amount' => '0',
'e_concerned3' => '',
'dateop3' => '',
'e_other4' => '',
'e_other4_comment' => '',
'e_other4_amount' => '0',
'e_concerned4' => '',
'dateop4' => '',
'confirm' => 'Confirmer',
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_fin.inc.php';

View file

@ -0,0 +1,12 @@
<?php
//@description:FIN Paiement
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUFIN/FIN',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_fin.inc.php';

View file

@ -0,0 +1,54 @@
<?php
//@description:FIN Confirmation paiement
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUFIN/FIN',
);
$_POST=array (
'ledger_type' => 'fin',
'ac' => 'COMPTA/MENUFIN/FIN',
'gDossier' => '42',
'nb_item' => '5',
'chdate' => '1',
'e_date' => '02.01.2017',
'p_jrn' => '1',
'e_pj' => 'FIN1',
'e_pj_suggest' => 'FIN1',
'first_sold' => '0',
'last_sold' => '',
'dateop0' => '',
'e_other0' => 'FOURNI',
'e_other_name0' => '',
'e_other0_comment' => '',
'e_other0_amount' => '2560.12',
'e_concerned0' => '2',
'dateop1' => '',
'e_other1' => '',
'e_other_name1' => '',
'e_other1_comment' => '',
'e_other1_amount' => '0',
'e_concerned1' => '',
'dateop2' => '',
'e_other2' => '',
'e_other_name2' => '',
'e_other2_comment' => '',
'e_other2_amount' => '0',
'e_concerned2' => '',
'dateop3' => '',
'e_other3' => '',
'e_other_name3' => '',
'e_other3_comment' => '',
'e_other3_amount' => '0',
'e_concerned3' => '',
'dateop4' => '',
'e_other4' => '',
'e_other_name4' => '',
'e_other4_comment' => '',
'e_other4_amount' => '0',
'e_concerned4' => '',
'save' => 'Sauve',
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_fin.inc.php';

12
scenario/HTML/fisto.php Normal file
View file

@ -0,0 +1,12 @@
<?php
//@description:FIHISTO
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUFIN/FIHISTO',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'history_operation.inc.php';

12
scenario/HTML/fsaldo.php Normal file
View file

@ -0,0 +1,12 @@
<?php
//@description:FSALDO
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUFIN/FSALDO',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_fin_saldo.inc.php';

View file

@ -0,0 +1,19 @@
<?php
//@description:history
$_GET=array (
'gDossier' => '10104',
'act' => 'de',
'f_id' => '11',
'div' => 'det2',
'l' => '2',
'op' => 'history',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
put_global([["key"=>'f_id',"value"=>get_card_with_activity()]]);
include 'ajax_misc.php';

View file

@ -0,0 +1,24 @@
<?php
/*
* This file is part of NOALYSS.
*
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//@description: Test the class IVATNumber
require_once NOALYSS_INCLUDE."/lib/itext.class.php";
require_once NOALYSS_INCLUDE."/lib/ivatnumber.class.php";
IVATNumber::testme();

View file

@ -0,0 +1,33 @@
<?php
//@description:C0JRN
$_GET=array (
'gDossier' => '42',
'ac' => 'PARAM/C0JRN',
'sa' => 'detail',
'p_jrn' => '1',
);
$_POST=array (
'p_jrn' => '1',
'sa' => 'detail',
'gDossier' => '42',
'p_jrn_deb_max_line' => '10',
'p_ech_lib' => 'echeance',
'p_jrn_type' => 'FIN',
'p_jrn_name' => 'Financier',
'bank' => 'BQ',
'min_row' => '5',
'jrn_def_pj_pref' => 'FIN',
'jrn_def_pj_seq' => '0',
'p_description' => 'Concerne tous les mouvements financiers (comptes en banque, caisses, visa...)',
'FICHEDEB' =>
array (
0 => '3',
1 => '2',
2 => '4',
),
'update' => 'Sauve',
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'cfgledger.inc.php';

View file

@ -0,0 +1,13 @@
<?php
//@description:C0PCMN
$_GET=array (
'ac' => 'PARAM/C0PCMN',
'p_start' => '4',
'gDossier' => '42',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'param_pcmn.inc.php';

View file

@ -0,0 +1,34 @@
<?php
//@description:ACH
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUACH/ACH',
);
$_POST=array (
'gDossier' => '42',
'nb_item' => '1',
'p_jrn' => '3',
'e_date' => '01.01.2017',
'e_ech' => '',
'e_client' => 'IMMOB',
'e_pj' => 'ACH1',
'e_pj_suggest' => 'ACH1',
'e_comm' => 'Loyer',
'e_march0' => 'LOYER',
'e_march0_price' => '2560',
'e_quant0' => '1',
'htva_march0' => '2560',
'e_march0_tva_id' => '4',
'e_march0_tva_amount' => '0',
'tva_march0' => '0',
'tvac_march0' => '2560',
'jrn_type' => 'ACH',
'p_action' => 'ach',
'sa' => 'p',
'e_mp' => '0',
'view_invoice' => 'Enregistrer',
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_ach.inc.php';

11
scenario/HTML/menufin.php Normal file
View file

@ -0,0 +1,11 @@
<?php
//@description:MENUFIN
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUFIN',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);

12
scenario/HTML/ods-new.php Normal file
View file

@ -0,0 +1,12 @@
<?php
//@description:ODS Appel menu ODS
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/MENUODS/ODS',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_ods.inc.php';

View file

@ -0,0 +1,103 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2018) Author Dany De Bontridder <danydb@noalyss.eu>
//@description:Test class Package_Repository
$_GET=array ();
$_POST=array ();
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
require_once NOALYSS_INCLUDE.'/class/package_repository.class.php';
$package_repository=new Package_Repository();
$package_repository->display_noalyss_info();
echo $package_repository->can_download();
$xml=$package_repository->getContent();
$a_plugin=$xml->xpath('//plugins/plugin');
$nb_plugin=count($a_plugin);
$a_coprop="";
echo "<ol>";
for ( $i=0;$i < $nb_plugin;$i++)
{
echo "<li>";
echo $a_plugin[$i]->name;
echo "- - - - - - ";
echo $a_plugin[$i]->path;
echo "- - - - - - ";
echo $a_plugin[$i]->author;
echo "- - - - - - ";
echo $a_plugin[$i]->code;
echo "</li>";
if (trim($a_plugin[$i]->code)=="AMORTIS")
{
$a_coprop=$a_plugin[$i];
var_dump($a_coprop);
}
}
echo "</ol>";
// find a specific plugin
$spec_plugin=$xml->xpath("//plugins/plugin[code='AMORTIS']");
var_dump($spec_plugin);
$a_noalyss=$xml->xpath("//core");
echo "description core ".$a_noalyss[0]->description;
// Download fake core
echo h1(_("Download core"));
$core=$package_repository->make_object("core", "");
$core->download();
//download fake plugin
echo h1("Plugin : download and install ");
$plugin=$package_repository->make_object("plugin","COPRO");
$plugin->download();
echo h2("Install in noalyss/include/ext/copro-fake");
$plugin->install();
echo h1("Available template");
$a_template=$xml->xpath('//database_template/dbtemplate');
$nb_template=count($a_template);
echo "<ol>";
for ( $i=0;$i < $nb_template;$i++)
{
echo "<li>";
echo $a_template[$i]->name;
echo "- - - - - - ";
echo $a_template[$i]->description;
echo "- - - - - - ";
echo $a_template[$i]->path;
echo "</li>";
}
echo "</ol>";
echo h1("Create new database");
$template=$package_repository->make_object("template", "mod1");
$template->download();
$template->install();
echo h2( $template->get_name()." est installé");

View file

@ -0,0 +1,36 @@
<?php
/*
* This file is part of NOALYSS.
*
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//@description: Test the class PDF_OPERATION
require_once NOALYSS_INCLUDE."/class/pdf_operation.class.php";
$a_operation_id=$cn->get_array("select jr_id from jrn limit 10");
$pdf=new PDF_Operation ($cn,$a_operation_id[0]['jr_id']);
//$pdf=new PDF_Operation ($cn,47);
//$pdf=new PDF_Operation ($cn,4638);
$pdf->export_pdf(array("anc","acc"));
$a=$pdf->get_pdf();
$a->Output("/tmp/t.pdf","S");
echo $pdf->get_pdf_filename();
echo "File download to /tmp";

View file

@ -0,0 +1,50 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2016) Author Dany De Bontridder <dany@alchimerys.be>
if (!defined('ALLOWED'))
die('Appel direct ne sont pas permis');
//@description:Test the class Acc_Plan_mtable , ajax and javascript
$_GET=array (
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
require_once NOALYSS_INCLUDE."/class/acc_plan_mtable.class.php";
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
/**
* @file
* @brief Test the Acc_Plan_MTable
*/
$obj=new Acc_Plan_SQL($cn);
/**
* Test $obj
*/
echo Dossier::hidden();
$mtable=new Acc_Plan_MTable($obj);
$obj->set_limit_fiche_qcode(5);
$mtable->set_callback("ajax_test.php");
$mtable->add_json_param("TestAjaxFile",NOALYSS_HOME."/../scenario/ajax_acc_plan_mtable.php");
$mtable->create_js_script();
echo $mtable->display_table(" where pcm_val::text like '4%' order by pcm_val::text limit 30");

View file

@ -0,0 +1,90 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
if (!defined('ALLOWED'))
die('Appel direct ne sont pas permis');
/**
* @file
* @brief
* @param type $name Descriptionara
*/
//@description:Test the class Currency_MTable , ajax and javascript
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET, $_POST);
require_once NOALYSS_INCLUDE."/class/currency_mtable.class.php";
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
require_once NOALYSS_INCLUDE.'/database/v_currency_last_value_sql.class.php';
$is_ajax=$http->request("TestAjaxFile", "string", "-");
$currency=new V_Currency_Last_Value_SQL($cn);
if ($is_ajax!="-")
{
$p_id=$http->request('p_id', "number");
$currency->set_pk_value($p_id);
$currency->load();
}
$currency_table=new Currency_MTable($currency);
$currency_table->set_callback("ajax_test.php");
$currency_table->add_json_param("TestAjaxFile", __FILE__);
if ($is_ajax!="-")
{
$table=$http->request('table');
$action=$http->request('action');
$p_id=$http->request('p_id', "number");
$ctl_id=$http->request('ctl');
/*
* we're in ajax part
*/
if ($action=="input")
{
$currency_table->set_object_name($ctl_id);
header('Content-type: text/xml; charset=UTF-8');
echo $currency_table->ajax_input()->saveXML();
return;
}
elseif ($action=="save")
{
$currency_table->set_object_name($ctl_id);
header('Content-type: text/xml; charset=UTF-8');
echo $currency_table->ajax_save()->saveXML();
return;
}
elseif ($action=="delete")
{
$currency_table->set_object_name($ctl_id);
header('Content-type: text/xml; charset=UTF-8');
echo $currency_table->ajax_delete()->saveXML();
}
return;
}
$currency_table->create_js_script();
$currency_table->display_table();

View file

@ -0,0 +1,31 @@
<?php
//@description: test pour PostgreSQL JSON & ARRAY
$cnx=$cn->get_db();
$ret = pg_query($cnx,"select * from jrn_def ");
$result=pg_fetch_all($ret);
echo "retrieve ",count($result);
$ret=pg_query($cnx,"drop table if exists public.test_array_int");
$ret = pg_query ($cnx,
"CREATE TABLE public.test_array_int(
ac_id serial4 NOT NULL PRIMARY KEY ,
ac_label text NOT NULL,
ac_rate numeric(5, 2) NOT NULL,
ajrn_def_id _int4 NULL); "
);
if ( ! $ret ){
die ("cannot create public.test_array_int");
}
$ret=pg_query($cnx,
"insert into public.test_array_int(ac_label,ac_rate,ajrn_def_id) values ('ligne 1',1.2,'{1,2}')");
$ret=pg_query_params($cnx,
"insert into public.test_array_int(ac_label,ac_rate,ajrn_def_id) values ($1,$2,$3)",
array('ligne 1',1.2,'{1,2}'));
$ret=pg_query($cnx,"drop table if exists public.test_array_int");

View file

@ -0,0 +1,80 @@
<?php
/*
* This file is part of NOALYSS.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
/**
* @file
* @brief Test the tva parameters file
*/
//@description:Scenario file for VAT parameters
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET, $_POST);
require_once NOALYSS_INCLUDE."/class/tva_rate_mtable.class.php";
$is_ajax=$http->request("TestAjaxFile", "string", "-");
$tva_rate=new V_Tva_Rate_SQL($cn);
if ($is_ajax!="-")
{
$p_id=$http->request('p_id', "number");
$tva_rate->set_pk_value($p_id);
$tva_rate->load();
}
$manage_table=new Tva_Rate_MTable($tva_rate);
$manage_table->set_callback("ajax_test.php");
$manage_table->add_json_param("TestAjaxFile", __FILE__);
if ($is_ajax!="-")
{
$table=$http->request('table');
$action=$http->request('action');
$p_id=$http->request('p_id', "number");
$ctl_id=$http->request('ctl');
/*
* we're in ajax part
*/
if ($action=="input")
{
$manage_table->set_object_name($ctl_id);
header('Content-type: text/xml; charset=UTF-8');
echo $manage_table->ajax_input()->saveXML();
return;
}
elseif ($action=="save")
{
$manage_table->set_object_name($ctl_id);
header('Content-type: text/xml; charset=UTF-8');
echo $manage_table->ajax_save()->saveXML();
return;
}
elseif ($action=="delete")
{
$manage_table->set_object_name($ctl_id);
header('Content-type: text/xml; charset=UTF-8');
echo $manage_table->ajax_delete()->saveXML();
}
return;
}
$manage_table->create_js_script();
$manage_table->display_table();

13
scenario/HTML/vehisto Normal file
View file

@ -0,0 +1,13 @@
<?php
//@description:VEHISTO
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/VENMENU/VEHISTO',
'go' => 'aller',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'history_operation.inc.php';

View file

@ -0,0 +1,12 @@
<?php
//@description:VEN Appel menu vente
$_GET=array (
'gDossier' => '42',
'ac' => 'COMPTA/VENMENU/VEN',
);
$_POST=array (
);
$_POST['gDossier']=$gDossierLogInput;
$_GET['gDossier']=$gDossierLogInput;
$_REQUEST=array_merge($_GET,$_POST);
include 'compta_ven.inc.php';