rewrite unit test for scenario
This commit is contained in:
parent
9e5489a98c
commit
53a7cfb86c
64 changed files with 229 additions and 548 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
//@description:ACH Appel menu Achat
|
||||
//@description:ACH new purchase
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/MENUACH/ACH',
|
||||
|
|
@ -6,7 +6,7 @@ $_GET=array (
|
|||
);
|
||||
$_POST=array (
|
||||
'gDossier' => '42',
|
||||
'e_client' => 'IMMOB',
|
||||
'e_client' => 'FOURNI1',
|
||||
'nb_item' => '1',
|
||||
'p_jrn' => '3',
|
||||
'e_comm' => 'Loyer',
|
||||
|
|
@ -15,7 +15,7 @@ $_POST=array (
|
|||
'jrn_type' => 'ACH',
|
||||
'e_pj' => 'ACH1',
|
||||
'e_pj_suggest' => 'ACH1',
|
||||
'mt' => '1415995238.7737',
|
||||
'mt' => '141599523a8.7737',
|
||||
'e_mp' => '0',
|
||||
'e_march0' => 'LOYER',
|
||||
'e_march0_price' => '2560',
|
||||
|
|
@ -28,8 +28,12 @@ $_POST=array (
|
|||
'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';
|
||||
|
|
@ -10,13 +10,13 @@ $_POST=array (
|
|||
'gDossier' => '42',
|
||||
'nb_item' => '10',
|
||||
'p_jrn' => '3',
|
||||
'e_date' => '01.02.2016',
|
||||
'e_date' => '01.02.2017',
|
||||
'e_ech' => '',
|
||||
'e_client' => 'DIV',
|
||||
'e_client' => 'FOURNI1',
|
||||
'e_pj' => 'ACH2',
|
||||
'e_pj_suggest' => 'ACH2',
|
||||
'e_comm' => 'Paiement loyer',
|
||||
'e_march0' => 'FID15',
|
||||
'e_march0' => 'LOYER',
|
||||
'e_march0_label' => 'TEST',
|
||||
'e_march0_price' => '2560.0000',
|
||||
'e_quant0' => '1.0000',
|
||||
|
|
@ -102,6 +102,8 @@ $_POST=array (
|
|||
'sa' => 'p',
|
||||
'e_mp' => '0',
|
||||
'view_invoice' => 'Enregistrer',
|
||||
'p_currency_rate'=>1 ,
|
||||
'p_currency_code'=>'0'
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
|
|
@ -12,7 +12,7 @@ $_POST=array (
|
|||
'p_jrn' => '3',
|
||||
'e_date' => '01.01.2017',
|
||||
'e_ech' => '',
|
||||
'e_client' => 'IMMOB',
|
||||
'e_client' => 'FOURNI1',
|
||||
'e_pj' => 'ACH2',
|
||||
'e_pj_suggest' => 'ACH2',
|
||||
'e_comm' => 'Paiement loyer',
|
||||
|
|
@ -99,6 +99,8 @@ $_POST=array (
|
|||
'jrn_type' => 'ACH',
|
||||
'e_mp' => '0',
|
||||
'view_invoice' => 'Enregistrer',
|
||||
'p_currency_rate'=>1 ,
|
||||
'p_currency_code'=>'0'
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
|
|
@ -11,4 +11,5 @@ $_POST=array (
|
|||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
html_page_start();
|
||||
include 'compta_ach.inc.php';
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
//@description:ACHISTO
|
||||
//@description:ACHISTO History Purchase
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/MENUACH/ACHISTO',
|
||||
|
|
@ -9,4 +9,5 @@ $_POST=array (
|
|||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
html_page_start();
|
||||
include 'history_operation.inc.php';
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
//@description:ODHISTO
|
||||
//@description:ODHISTO : history Misc. Operation
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/MENUODS/ODHISTO',
|
||||
|
|
@ -10,4 +10,5 @@ $_POST=array (
|
|||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
html_page_start();
|
||||
include 'history_operation.inc.php';
|
||||
|
|
@ -18,11 +18,16 @@
|
|||
* 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
|
||||
|
|
@ -30,9 +35,14 @@ $_REQUEST=array_merge($_GET,$_POST);
|
|||
*/
|
||||
$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);
|
||||
|
||||
?>
|
||||
|
|
@ -13,10 +13,10 @@ $_POST=array (
|
|||
'first_sold' => '0',
|
||||
'e_pj' => 'FIN1',
|
||||
'e_pj_suggest' => 'FIN1',
|
||||
'e_date' => '02.01.2014',
|
||||
'e_date' => '02.01.2017',
|
||||
'mt' => '1415995351.0398',
|
||||
'sa' => 'n',
|
||||
'e_other0' => 'IMMOB ',
|
||||
'e_other0' => 'FOURNI ',
|
||||
'e_other0_comment' => '',
|
||||
'e_other0_amount' => '2560',
|
||||
'e_concerned0' => '2',
|
||||
|
|
@ -10,17 +10,17 @@ $_POST=array (
|
|||
'gDossier' => '42',
|
||||
'nb_item' => '5',
|
||||
'chdate' => '1',
|
||||
'e_date' => '02.01.2014',
|
||||
'e_date' => '02.01.2017',
|
||||
'p_jrn' => '1',
|
||||
'e_pj' => 'FIN1',
|
||||
'e_pj_suggest' => 'FIN1',
|
||||
'first_sold' => '0',
|
||||
'last_sold' => '',
|
||||
'dateop0' => '',
|
||||
'e_other0' => 'IMMOB ',
|
||||
'e_other_name0' => 'Immo Bureau',
|
||||
'e_other0' => 'FOURNI',
|
||||
'e_other_name0' => '',
|
||||
'e_other0_comment' => '',
|
||||
'e_other0_amount' => '2560',
|
||||
'e_other0_amount' => '2560.12',
|
||||
'e_concerned0' => '2',
|
||||
'dateop1' => '',
|
||||
'e_other1' => '',
|
||||
|
|
@ -27,27 +27,6 @@
|
|||
* @brief Test the HtmlInput object it means the Inum, IText , ...
|
||||
*/
|
||||
|
||||
require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/iaction.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/ibutton.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/icard.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/icheckbox.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/iconcerned.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/idate.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/ifile.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/ihidden.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/inum.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/iperiod.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/iposte.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/iradio.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/irelated_action.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/iselect.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/ispan.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/itext.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/itextarea.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/itva_popup.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/input_switch.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/input_checkbox.class.php';
|
||||
|
||||
$http=new HttpInput();
|
||||
?>
|
||||
|
|
@ -26,8 +26,7 @@ if (!defined('ALLOWED'))
|
|||
* @file
|
||||
* @brief Test of Html_Tab and Output_Html_Tab
|
||||
*/
|
||||
require_once NOALYSS_INCLUDE.'/lib/html_tab.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/output_html_tab.class.php';
|
||||
|
||||
|
||||
$tab = new Html_Tab('tab1',_("Titre 1"));
|
||||
$tab->set_mode('link');
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 Dany De Bontridder <dany@alchimerys.be>
|
||||
|
|
@ -36,14 +36,17 @@
|
|||
|
||||
<h1> smoke prompt</h1>
|
||||
<pre>
|
||||
function func_callback_prompt(ev)
|
||||
|
||||
function func_callback_prompt(ev)
|
||||
{
|
||||
if (ev) { alert ("accepted "+ev);}
|
||||
console.debug(ev);
|
||||
return true;
|
||||
}
|
||||
|
||||
smoke.prompt('Confirmez-vous',func_callback_prompt,{title:"Titre"});
|
||||
function smoke_prompt()
|
||||
{
|
||||
smoke.prompt('Donnez un élement',func_callback_prompt,{title:"Titre"});
|
||||
}
|
||||
</pre>
|
||||
|
||||
<script>
|
||||
|
|
@ -60,3 +63,16 @@ smoke.prompt('Confirmez-vous',func_callback_prompt,{title:"Titre"});
|
|||
|
||||
</script>
|
||||
<button onclick="smoke_prompt()">smoke_prompt</button>
|
||||
<h1> smoke signal </h1>
|
||||
<button onclick="signal()">Signal de 0.5 sec </button>
|
||||
|
||||
<script>
|
||||
function signal() { smoke.signal('Sauvé',function(e){},{duration:500}); }
|
||||
|
||||
</script>
|
||||
<pre>
|
||||
|
||||
function signal() { smoke.signal('Sauvé',function(e){},{duration:500}); }
|
||||
|
||||
|
||||
</pre>
|
||||
34
scenario/XML/ajax-add-card-category.php
Normal file
34
scenario/XML/ajax-add-card-category.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
//@description:st montre choix des catégories de fiches
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ctl' => 'select_card_div',
|
||||
'op' => 'card',
|
||||
'op2'=>'st',
|
||||
'fil' => '-1',
|
||||
'ledger' => '2',
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
define ('TEST_UNIT',1);
|
||||
ob_start();
|
||||
include NOALYSS_HOME.'/ajax_misc.php';
|
||||
$output=ob_get_clean();
|
||||
echo '<HR>';
|
||||
$xml=simplexml_load_string($output);
|
||||
print "ctl {$xml->ctl}";
|
||||
echo '<hr>';
|
||||
print "code ";
|
||||
print '<div style="width:60%;margin-left:20%">';
|
||||
print_r($xml->code);
|
||||
echo '</div>';
|
||||
echo '<code>';
|
||||
echo htmlentities($xml->code);
|
||||
echo '</code>';
|
||||
|
||||
echo '<hr>';
|
||||
print "fiche_cat ";
|
||||
print_r($xml->fiche_cat);
|
||||
echo '<hr>';
|
||||
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
$_GET=array (
|
||||
'op' => 'ledger',
|
||||
'act' => 'de',
|
||||
'jr_id' => '2856',
|
||||
'jr_id' => '137',
|
||||
'div' => 'det2',
|
||||
);
|
||||
$_POST=array (
|
||||
|
|
@ -11,4 +11,10 @@ $_POST=array (
|
|||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
define ('TEST_UNIT',1);
|
||||
ob_start();
|
||||
include 'ajax_misc.php';
|
||||
$output=ob_get_contents();
|
||||
ob_clean();
|
||||
echo unescape_xml($output);
|
||||
echo htmlentities($output);
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
//@description:de Detail operation
|
||||
//@description:FIN Detail operation
|
||||
$_GET=array (
|
||||
'op' => 'ledger',
|
||||
'act' => 'de',
|
||||
'jr_id' => '2870',
|
||||
'jr_id' => '147',
|
||||
'div' => 'det2',
|
||||
);
|
||||
$_POST=array (
|
||||
|
|
@ -11,4 +11,10 @@ $_POST=array (
|
|||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
define ('TEST_UNIT',1);
|
||||
ob_start();
|
||||
include 'ajax_misc.php';
|
||||
$output=ob_get_contents();
|
||||
ob_clean();
|
||||
echo unescape_xml($output);
|
||||
echo htmlentities($output);
|
||||
|
|
@ -3,12 +3,17 @@
|
|||
$_GET=array (
|
||||
'op' => 'ledger',
|
||||
'act' => 'de',
|
||||
'jr_id' => '3532',
|
||||
'jr_id' => '213',
|
||||
'div' => 'det2',
|
||||
);
|
||||
$_POST=array (
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
define ('TEST_UNIT',1);
|
||||
ob_start();
|
||||
include 'ajax_misc.php';
|
||||
$output=ob_get_contents();
|
||||
ob_clean();
|
||||
echo unescape_xml($output);
|
||||
echo htmlentities($output);
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
$_GET=array (
|
||||
'op'=>"ledger",
|
||||
'act' => 'de',
|
||||
'jr_id' => '2826',
|
||||
'jr_id' => '316',
|
||||
'div' => 'det2',
|
||||
);
|
||||
$_POST=array (
|
||||
|
|
@ -11,4 +11,10 @@ $_POST=array (
|
|||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
define ('TEST_UNIT',1);
|
||||
ob_start();
|
||||
include 'ajax_misc.php';
|
||||
$output=ob_get_contents();
|
||||
ob_clean();
|
||||
echo unescape_xml($output);
|
||||
echo htmlentities($output);
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
//@description:ACH Encodage d'une vente
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/MENUACH/ACH',
|
||||
);
|
||||
$_POST=array (
|
||||
'gDossier' => '42',
|
||||
'nb_item' => '1',
|
||||
'p_jrn' => '3',
|
||||
'e_date' => '01.03.2016',
|
||||
'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';
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
//@description:st montre choix des catégories de fiches
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ctl' => 'select_card_div',
|
||||
'op' => 'card',
|
||||
'op2'=>'st',
|
||||
'fil' => '-1',
|
||||
'ledger' => '2',
|
||||
);
|
||||
$_POST=array (
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
include NOALYSS_HOME.'/ajax_misc.php';
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
//@description:save
|
||||
$_GET=array (
|
||||
);
|
||||
$_POST=array (
|
||||
'whatdiv' => 'det2',
|
||||
'jr_id' => '2856',
|
||||
'gDossier' => '27',
|
||||
'p_date' => '05.12.2013',
|
||||
'p_ech' => '',
|
||||
'p_date_paid' => '',
|
||||
'npj' => 'ACH607',
|
||||
'lib' => 'Consommable, ptit matériel',
|
||||
'jrn_note' => '',
|
||||
'j_id' =>
|
||||
array (
|
||||
0 => '7629',
|
||||
1 => '7630',
|
||||
),
|
||||
'BON_COMMANDE' => '',
|
||||
'OTHER' => '',
|
||||
'raptdet2' => '',
|
||||
'related' => '327,231,330',
|
||||
'Fermer' => 'Fermer',
|
||||
'save' => 'Sauver',
|
||||
'Effacer' => 'Effacer',
|
||||
'bextdet2' => 'Extourner',
|
||||
'rapt' => '',
|
||||
'div' => 'det2',
|
||||
'act' => 'save',
|
||||
'op'=>'ledger',
|
||||
'jr_optype'=>'NOR'
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
include 'ajax_misc.php';
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<?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');
|
||||
if ( ! defined ("AJAX_TEST")) {
|
||||
echo "Can not be called directly but via ajax_test.php";
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* @file
|
||||
* @brief Test the ajax call from test_manage_table_sql.php
|
||||
*/
|
||||
$http=new HttpInput();
|
||||
try {
|
||||
$table=$http->request('table');
|
||||
$action=$http->request('action');
|
||||
$p_id=$http->request('p_id', "number");
|
||||
$ctl_id=$http->request('ctl');
|
||||
} catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
|
||||
require_once NOALYSS_INCLUDE."/class/acc_plan_mtable.class.php";
|
||||
|
||||
$obj=new Acc_Plan_SQL($cn);
|
||||
$obj->set_limit_fiche_qcode(5);
|
||||
$obj->set_pk_value($p_id);
|
||||
$obj->load();
|
||||
$manage_table=new Acc_Plan_MTable($obj);
|
||||
$manage_table->add_json_param("TestAjaxFile",
|
||||
NOALYSS_HOME."/../scenario/ajax_acc_plan_mtable.php");
|
||||
$manage_table->set_object_name($ctl_id);
|
||||
$manage_table->set_callback("ajax_test.php");
|
||||
if ($action=="input")
|
||||
{
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
echo $manage_table->ajax_input()->saveXML();
|
||||
return;
|
||||
}
|
||||
elseif ($action == "save")
|
||||
{
|
||||
$xml=$manage_table->ajax_save();
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
echo $xml->saveXML();
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
<?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');
|
||||
if ( ! defined ("AJAX_TEST")) {
|
||||
echo "Can not be called directly but via AJAX";
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* @file
|
||||
* @brief Test the ajax call from test_manage_table_sql.php
|
||||
*/
|
||||
$http=new HttpInput();
|
||||
try {
|
||||
$table=$http->request('table');
|
||||
$action=$http->request('action');
|
||||
$p_id=$http->request('p_id', "number");
|
||||
$ctl_id=$http->request('ctl');
|
||||
} catch(Exception $e) {
|
||||
|
||||
echo $e->getMessage();
|
||||
}
|
||||
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
|
||||
require_once NOALYSS_INCLUDE."/database/acc_plan_sql.class.php";
|
||||
|
||||
|
||||
|
||||
if ($action=="input")
|
||||
{
|
||||
$obj=new Acc_Plan_SQL($cn);
|
||||
$obj->set_limit_fiche_qcode(5);
|
||||
$obj->set_pk_value($p_id);
|
||||
$obj->load();
|
||||
$manage_table=new Manage_Table_SQL($obj);
|
||||
$manage_table->add_json_param("TestAjaxFile",
|
||||
NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php");
|
||||
|
||||
$manage_table->set_object_name($ctl_id);
|
||||
$manage_table->set_col_label('pcm_val', "Poste");
|
||||
$manage_table->set_col_label('parent_accounting', "Dépend");
|
||||
$manage_table->set_col_label('pcm_lib', "Libellé");
|
||||
$manage_table->set_col_label('pcm_type',
|
||||
"Type de menu".Icon_Action::infobulle(33));
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
echo $manage_table->ajax_input()->saveXML();
|
||||
return;
|
||||
} elseif ($action=="save")
|
||||
{
|
||||
$obj=new Acc_Plan_SQL($cn);
|
||||
$obj->set_limit_fiche_qcode(5);
|
||||
$obj->set_pk_value($p_id);
|
||||
$obj->load();
|
||||
$manage_table=new Manage_Table_SQL($obj);
|
||||
$manage_table->set_object_name($ctl_id);
|
||||
$manage_table->add_json_param("TestAjaxFile",
|
||||
NOALYSS_HOME."/../scenario/ajax_manage_table_sql.php");
|
||||
header('Content-type: text/xml; charset=UTF-8');
|
||||
echo $manage_table->ajax_save()->saveXML();
|
||||
return;
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?php
|
||||
//@description:C0PCMN Ajout d'un poste comptable
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'PARAM/C0PCMN',
|
||||
);
|
||||
$_POST=array (
|
||||
'p_action' => 'pcmn',
|
||||
'gDossier' => '42',
|
||||
'p_val' => '4519',
|
||||
'p_lib' => 'Compte TVA',
|
||||
'p_parent' => '451',
|
||||
'p_type' => 'ACT',
|
||||
'Ajout' => 'Ajout',
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
include 'param_pcmn.inc.php';
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<?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
|
||||
*/
|
||||
|
||||
// Copyright Author Dany De Bontridder dany@alchimerys.be
|
||||
//@description: Developpement for ANC
|
||||
|
||||
require_once NOALYSS_INCLUDE . "/class/anc_operation.class.php";
|
||||
|
||||
$anc = new Anc_Operation($cn);
|
||||
|
||||
$a_jrnxId = $cn->get_array(
|
||||
"select j_id from jrnx join jrn on (jr_grpt_id=j_grpt)
|
||||
where
|
||||
jr_id=$1
|
||||
", array(48));
|
||||
$nb = count($a_jrnxId);
|
||||
|
||||
for ($i = 0; $i<$nb; $i++) {
|
||||
// First row
|
||||
$a = $anc->get_by_jid($a_jrnxId[$i]['j_id']);
|
||||
if (! empty($a) ) {
|
||||
$complete=$anc->to_request($a, 1);
|
||||
var_dump($complete);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
//@description:ODS Confirmation OD
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/MENUODS/ODS',
|
||||
);
|
||||
$_POST=array (
|
||||
'ac' => 'COMPTA/MENUODS/ODS',
|
||||
'e_date' => '14.11.2014',
|
||||
'desc' => 'TVA',
|
||||
'period' => '102',
|
||||
'e_pj' => 'ODS1',
|
||||
'e_pj_suggest' => 'ODS1',
|
||||
'mt' => '1415996970.8822',
|
||||
'e_comm' => 'TVA',
|
||||
'jrn_type' => 'ODS',
|
||||
'p_jrn' => '4',
|
||||
'nb_item' => '5',
|
||||
'jrn_concerned' => '',
|
||||
'gDossier' => '42',
|
||||
'poste0' => '4519',
|
||||
'ld0' => 'Compte TVA',
|
||||
'amount0' => '250',
|
||||
'poste1' => '6700',
|
||||
'ld1' => 'Paiement TVA',
|
||||
'amount1' => '250',
|
||||
'ck1' => '',
|
||||
'opd_name' => 'Paiement TVA',
|
||||
'od_description' => '',
|
||||
'save' => 'Confirmer',
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
include 'compta_ods.inc.php';
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
<?php
|
||||
//@description:ODS Enregistrement
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/MENUODS/ODS',
|
||||
);
|
||||
$_POST=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/MENUODS/ODS',
|
||||
'p_jrn' => '4',
|
||||
'e_date' => '14.11.2016',
|
||||
'e_pj' => 'ODS1',
|
||||
'e_pj_suggest' => 'ODS1',
|
||||
'desc' => 'TVA',
|
||||
'nb_item' => '5',
|
||||
'jrn_type' => 'ODS',
|
||||
'qc_0' => '',
|
||||
'poste0' => '4519',
|
||||
'ld0' => 'Compte TVA',
|
||||
'amount0' => '250',
|
||||
'qc_1' => '',
|
||||
'poste1' => '6700',
|
||||
'ld1' => 'Paiement TVA',
|
||||
'amount1' => '250',
|
||||
'ck1' => '',
|
||||
'qc_2' => '',
|
||||
'poste2' => '',
|
||||
'ld2' => '',
|
||||
'amount2' => '',
|
||||
'qc_3' => '',
|
||||
'poste3' => '',
|
||||
'ld3' => '',
|
||||
'amount3' => '',
|
||||
'qc_4' => '',
|
||||
'poste4' => '',
|
||||
'ld4' => '',
|
||||
'amount4' => '',
|
||||
'jrn_concerned' => '',
|
||||
'summary' => 'Sauvez',
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
include 'compta_ods.inc.php';
|
||||
|
|
@ -37,7 +37,16 @@ L'objectif étant de pouvoir tester et de rejouer facilement les actions que vou
|
|||
|
||||
Il est aussi possible de faire vos tests unitaire ici , autrement qu'avec PHPUNIT (voir répertiore php-unit)
|
||||
|
||||
Vous pouver l'utiliser pour les sorties ajax, mises au point de librarie, scénario , cela permet de tester les
|
||||
fichiers à include (.inc.php) , les exports , les réponses ajax et appeler les fonctions test_me dans les classes
|
||||
(static function test_me() ).
|
||||
|
||||
Dans votre code, vous pouvez ajouter des portions de code ainsi
|
||||
|
||||
if (defined ('TEST_UNIT')) {
|
||||
// exécuté uniquement si appelé pour les tests unitaires
|
||||
|
||||
}
|
||||
-----------------------
|
||||
ENGLISH
|
||||
-----------------------
|
||||
|
|
@ -55,5 +64,11 @@ You point you browser noalyss/html/test.php an you click on the link with the
|
|||
|
||||
and you can rerun the file , it works also for ajax.
|
||||
|
||||
It is useful to test ajax answer , unit test or testing a class
|
||||
It is useful to test ajax answer , unit test or testing a class (with static function test_me() )
|
||||
|
||||
In your code, you can do
|
||||
|
||||
if (defined ('TEST_UNIT')) {
|
||||
// executed only if calling script is test.php,
|
||||
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
<?php
|
||||
//@description:VEN Encodage d'une vente
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/VENMENU/VEN',
|
||||
);
|
||||
$_POST=array (
|
||||
'ledger_type' => 'VEN',
|
||||
'ac' => 'COMPTA/VENMENU/VEN',
|
||||
'sa' => 'p',
|
||||
'gDossier' => '42',
|
||||
'nb_item' => '2',
|
||||
'p_jrn' => '2',
|
||||
'e_date' => '14.11.2016',
|
||||
'e_ech' => '',
|
||||
'e_client' => 'CLIENT1 ',
|
||||
'e_pj' => 'VEN1',
|
||||
'e_pj_suggest' => 'VEN1',
|
||||
'e_comm' => 'Première vente',
|
||||
'e_march0' => 'DEPLAC',
|
||||
'e_march0_price' => '120',
|
||||
'e_quant0' => '1',
|
||||
'htva_march0' => '120',
|
||||
'e_march0_tva_id' => '1',
|
||||
'e_march0_tva_amount' => '25.2',
|
||||
'tva_march0' => '25.2',
|
||||
'tvac_march0' => '145.2',
|
||||
'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',
|
||||
'jrn_type' => 'VEN',
|
||||
'e_mp' => '0',
|
||||
'view_invoice' => 'Enregistrer',
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
include 'compta_ven.inc.php';
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<?php
|
||||
//@description:VEN Enregistrement de la vente
|
||||
$_GET=array (
|
||||
'gDossier' => '42',
|
||||
'ac' => 'COMPTA/VENMENU/VEN',
|
||||
);
|
||||
$_POST=array (
|
||||
'gDossier' => '42',
|
||||
'bon_comm' => '',
|
||||
'other_info' => '',
|
||||
'e_client' => 'CLIENT1 ',
|
||||
'nb_item' => '2',
|
||||
'p_jrn' => '2',
|
||||
'mt' => '1415995185.7619',
|
||||
'e_comm' => 'Première vente',
|
||||
'e_date' => '14.11.2016',
|
||||
'e_ech' => '',
|
||||
'e_pj' => 'VEN1',
|
||||
'e_pj_suggest' => 'VEN1',
|
||||
'e_mp' => '0',
|
||||
'jrn_type' => 'VEN',
|
||||
'e_march0' => 'DEPLAC',
|
||||
'e_march0_price' => '120',
|
||||
'e_march0_tva_id' => '1',
|
||||
'e_march0_tva_amount' => '25.2',
|
||||
'e_quant0' => '1',
|
||||
'e_march1' => '',
|
||||
'e_march1_price' => '',
|
||||
'e_march1_tva_id' => '',
|
||||
'e_march1_tva_amount' => '',
|
||||
'e_quant1' => '1',
|
||||
'ac' => 'COMPTA/VENMENU/VEN',
|
||||
'opd_name' => '',
|
||||
'od_description' => '',
|
||||
'record' => 'Enregistrement',
|
||||
);
|
||||
$_POST['gDossier']=$gDossierLogInput;
|
||||
$_GET['gDossier']=$gDossierLogInput;
|
||||
$_REQUEST=array_merge($_GET,$_POST);
|
||||
include 'compta_ven.inc.php';
|
||||
Loading…
Add table
Add a link
Reference in a new issue