Merge branch 'master' of ssh://ns3/srv/git/noalyss

This commit is contained in:
Dany De Bontridder 2018-08-03 15:39:16 +02:00
commit c37949ee37
71 changed files with 3066 additions and 950 deletions

Binary file not shown.

Binary file not shown.

View file

@ -263,7 +263,7 @@ if (isset($_REQUEST['ac']))
}
$_REQUEST['ac']= trim(strtoupper($_REQUEST['ac']));
$AC=$_REQUEST['ac'];
$AC=$http->request('ac');
$user_profile=$g_user->get_profile();

View file

@ -48,13 +48,14 @@ $g_user=new User($cn);
$g_user->check();
$g_user->check_dossier(dossier::id());
set_language();
$fLabel=(isset($_REQUEST['l']))?$_REQUEST['l']:'none';
$fTva_id=(isset($_REQUEST['t']))?$_REQUEST['t']:'none';
$fPrice_sale=(isset($_REQUEST['p']))?$_REQUEST['p']:'none';
$fPrice_purchase=(isset($_REQUEST['b']))?$_REQUEST['b']:'none';
$hi=new HttpInput();
$fLabel=$hi->request("l","string","none");
$fTva_id=$hi->request("t","string","none");
$fPrice_sale=$hi->request("p","string","none");
$fPrice_purchase=$hi->request("b","string","none");
if ( isset($_SESSION['isValid']) && $_SESSION['isValid'] == 1)
{
$jrn=$hi->get('j', "number",'-1');

View file

@ -167,7 +167,11 @@ if (file_exists("install.php")&& ! DEBUG ) {
/*
* This file shouldn't exist
*/
echo _("Le fichier ".__DIR__."/install.php est encore présent, vous devez l'effacer avant d'utiliser NOALYSS");
echo "<h1>";
printf ( _("Le fichier %s/install.php est encore présent, après l'avoir exécuté pour vous mettre à jour, vous devez l'effacer."),__DIR__);
echo "<br>";
echo _("Tant que ce n'est pas vous fait vous ne pouvez pas utiliser NOALYSS");
echo "</h1>";
return;
}
}
@ -183,7 +187,7 @@ if (defined("RECOVER") && isset ($_REQUEST['recover']) )
// reconnect , create a variable to reconnect properly in login.php
$goto="";
if (isset ($_REQUEST['reconnect']) && isset ($_REQUEST['backurl'])) {
$goto='<input type="hidden" value="'.$_REQUEST['backurl'].'" name="backurl">';
$goto='<input type="hidden" value="'.strip_tags($_REQUEST['backurl']).'" name="backurl">';
}
echo '
<span style="background-color:#879ed4;color:white;padding-left:4px;padding-right:4px;">

View file

@ -33,7 +33,7 @@ function boxsearch_card(p_dossier)
{
waiting_box();
removeDiv('boxsearch_card_div');
var queryString="gDossier="+p_dossier+"&op=cardsearch"+"&card="+$(card_search).value;
var queryString="gDossier="+p_dossier+"&op=cardsearch"+"&card="+encodeURI($(card_search).value);
var action = new Ajax.Request(
"ajax_misc.php" ,
{

View file

@ -771,7 +771,7 @@ function show_box(obj)
add_div(obj);
if (!obj.fixed)
{
g(obj.id).style.top = calc(40) + "px";
g(obj.id).style.top = calcy(40) + "px";
show(obj.id);
}
else

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -83,14 +83,15 @@ if ( basename($_GET['op']) == 'history' )
$to_periode='to_periode='.format_date($limit[1]->p_end);
if (isset($_GET['ex']))
{
if ( $exercice > $_GET['ex'])
$ex=$http->get("ex","number");
if ( $exercice > $ex)
{
$limit_periode=$periode->get_limit($_GET['ex']);
$limit_periode=$periode->get_limit($ex);
$from_periode='from_periode='.format_date($limit_periode[0]->p_start);
}
else
{
$limit_periode=$periode->get_limit($_GET['ex']);
$limit_periode=$periode->get_limit($ex);
$to_periode='to_periode='.format_date($limit_periode[1]->p_end);
}
@ -98,13 +99,15 @@ if ( basename($_GET['op']) == 'history' )
if (isset($_GET['pcm_val']) )
{
$href_csv="export.php?".$href.'&poste_id='.$_GET['pcm_val'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:postedetail";
$href_pdf="export.php?".$href.'&poste_id='.$_GET['pcm_val'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:postedetail";;
$pcm_val=$http->get("pcm_val");
$href_csv="export.php?".$href.'&poste_id='.$pcm_val.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:postedetail";
$href_pdf="export.php?".$href.'&poste_id='.$pcm_val.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:postedetail";;
}
else
{
$href_csv="export.php?".$href.'&f_id='.$_GET['f_id'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:fichedetail";
$href_pdf="export.php?".$href.'&f_id='.$_GET['f_id'].'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:fichedetail";
$f_id=$http->get("f_id","number");
$href_csv="export.php?".$href.'&f_id='.$f_id.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=CSV:fichedetail";
$href_pdf="export.php?".$href.'&f_id='.$f_id.'&ople=0&type=poste&'.$from_periode.'&'.$to_periode."&act=PDF:fichedetail";
}
echo HtmlInput::print_window();
echo '<a class="smallbutton" href="'.$href_csv.'">'._("Export CSV").'</a>';
@ -118,8 +121,9 @@ echo HtmlInput::hidden('inpopup',1);
load_all_script();
$str=$_SERVER['QUERY_STRING']."&div=popup";
$ajax=$http->get("ajax");
$script="
var obj={id:'popup',fixed:1,cssclass:'content',style:'width:auto',html:loading(),qs:'$str',js_success:'success_box',js_error:null,callback:'".$_GET['ajax']."'};
var obj={id:'popup',fixed:1,cssclass:'content',style:'width:auto',html:loading(),qs:'$str',js_success:'success_box',js_error:null,callback:'".$ajax."'};
show_box(obj);
";
echo create_script($script);

View file

@ -27,11 +27,13 @@ include_once NOALYSS_INCLUDE.'/lib/ac_common.php';
require_once NOALYSS_INCLUDE.'/class/acc_ledger.class.php';
require_once NOALYSS_INCLUDE.'/class/acc_ledger_search.class.php';
require_once NOALYSS_INCLUDE.'/lib/icon_action.class.php';
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
html_page_start($_SESSION['g_theme']);
load_all_script();
$http=new HttpInput();
$gDossier=dossier::id();
@ -95,8 +97,9 @@ if ( isset ($_GET['viewsearch']))
// Navigation bar
$step=$_SESSION['g_pagesize'];
$page=(isset($_GET['offset']))?$_GET['page']:1;
$offset=(isset($_GET['offset']))?$_GET['offset']:0;
$page=$http->get("page","number",1);
$offset=$http->get("offset","number",0);
if (count ($_GET) == 0)
$array=null;
else

View file

@ -1759,6 +1759,7 @@ ul.tabs a {
color:inherit;
display:inline;
white-space: nowrap;
cursor:pointer;
}
ul.tabs a:hover {

View file

@ -1627,7 +1627,7 @@ ul.tabs a {
white-space: nowrap;
width: 100%;
height: 100%;
cursor :pointer;
}
ul.tabs a:hover {
text-decoration: none;

View file

@ -1713,7 +1713,7 @@ ul.tabs a {
color:inherit;
display:inline;
white-space: nowrap;
cursor: pointer;
}
ul.tabs a:hover {
text-decoration: none;

View file

@ -186,7 +186,7 @@ if ($sub_action == "update")
$act->qcode_dest = $_REQUEST['qcode_dest'];
echo $act->Display('NEW', false, $base, $retour);
echo '<input type="hidden" name="ac" value="' . $_REQUEST['ac'] . '">';
echo '<input type="hidden" name="ac" value="' . $http->request('ac') . '">';
echo '<input type="hidden" name="sa" value="save_action_st2">';
echo '<input type="submit" class="button" name="save_action_st2" value="' . _('Enregistrer') . '">';
echo '<input type="submit" class="button" name="generate" value="' . _('Génère le document') . '"></p>';
@ -243,9 +243,9 @@ if ($sub_action == 'delete')
// confirmed
$cn->start();
$act = new Follow_Up($cn);
$act->ag_id = $_REQUEST['ag_id'];
$act->ag_id =$http->request("ag_id","number") ;
$act->get();
if ($g_user->can_write_action($_REQUEST['ag_id'])==true) $act->remove();
if ($g_user->can_write_action($act->ag_id)==true) $act->remove();
$sub_action = "list";
$cn->commit();
Follow_Up::show_action_list($cn, $base);
@ -314,12 +314,12 @@ if ($sub_action == "add_action")
echo dossier::hidden();
$act->ag_comment = (isset($_POST['ag_comment'])) ? Decode($_POST['ag_comment']) : "";
$act->ag_comment =Decode($http->post("ag_comment","string",""));
if (isset($_REQUEST['qcode']))
$act->qcode_dest = $_REQUEST['qcode'];
echo $act->Display('NEW', false, $base, $retour);
echo '<input type="hidden" name="ac" value="' . $_REQUEST["ac"] . '">';
echo '<input type="hidden" name="ac" value="' . $http->request("ac") . '">';
echo '<input type="hidden" name="sa" value="save_action_st2">';
echo '<input type="hidden" name="save_action_st2" value="save_action_st2">';
echo '<input type="submit" class="button" name="save_action_st2" value="' . _('Enregistrer') . '">';

View file

@ -42,7 +42,7 @@ $User->Check();
if ($User->admin != 1)
{
$theme=(isset($User->theme))?$User->theme:"";
html_page_start($User->theme);
html_page_start($theme);
echo "<h2 class=\"warning\">";
echo _("Vous n'êtes pas administateur");
echo "</h2>";

View file

@ -79,7 +79,7 @@ for ($i=0;$i< $nb_row;$i++) {
echo td($detail_row['po_name']);
}
$amount=$detail_row['oa_amount'];
if ( $detail_row['oa_positive']=="N") {$amount=bcmult($amount,-1);}
if ( $detail_row['oa_positive']=="N") {$amount=bcmul($amount,-1);}
echo td($amount,'style="text-align:right"');
$debit=($detail_row['oa_debit'] == 'f')?"C":"D";
echo td($debit);

View file

@ -32,7 +32,7 @@ require_once NOALYSS_INCLUDE.'/class/periode.class.php';
require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
require_once NOALYSS_INCLUDE.'/class/acc_account.class.php';
require_once NOALYSS_INCLUDE.'/class/exercice.class.php';
$div=$_REQUEST['div'];
$div=$http->request('div');
mb_internal_encoding("UTF-8");
$http=new HttpInput();
/**
@ -86,7 +86,7 @@ if ( isset($_GET['f_id']))
$dossier=dossier::id();
if ( $div != 'popup')
{
$obj="{op:'history',div:'$div',f_id:'".$_GET['f_id']."',gDossier:'$dossier',select:this,exercice:{$year}}";
$obj="{op:'history',div:'$div',f_id:'".$f_id."',gDossier:'$dossier',select:this,exercice:{$year}}";
$is=$exercice->select('p_exercice',$default,' onchange="update_history_card('.$obj.');"');
$old=_("Autre exercice")." ".$is->input();
}
@ -137,7 +137,8 @@ if ( isset($_GET['f_id']))
///////////////////////////////////////////////////////////////////////////
if ( isset($_REQUEST['pcm_val']))
{
$poste=new Acc_Account_Ledger($cn,$_REQUEST['pcm_val']);
$pcm_val=$http->request("pcm_val");
$poste=new Acc_Account_Ledger($cn,$pcm_val);
$poste->load();
$year=$http->get("exercice","string","");
if ( $year == "") $year=$g_user->get_exercice();
@ -172,7 +173,7 @@ if ( isset($_REQUEST['pcm_val']))
$dossier=dossier::id();
if ( $div != 'popup')
{
$obj="{op:'history',div:'$div',pcm_val:'".$_GET['pcm_val']."',gDossier:'$dossier',select:this,exercice:{$year}}";
$obj="{op:'history',div:'$div',pcm_val:'".$pcm_val."',gDossier:'$dossier',select:this,exercice:{$year}}";
$is=$exercice->select('p_exercice',$default,' onchange="update_history_account('.$obj.');"');
$old=_("Autre exercice")." ".$is->input();
}

View file

@ -56,7 +56,8 @@ if (isset($_REQUEST['show']))
{
$cn=Dossier::connect();
$todo=new Todo_list($cn);
$todo->set_parameter('id',$_REQUEST['id']);
$id=$http->request("id");
$todo->set_parameter('id',$id);
$todo->load();
$content=$todo->display();
header('Content-type: text/xml; charset=UTF-8');
@ -79,9 +80,10 @@ if (isset($_REQUEST['show']))
////////////////////////////////////////////////////////////////////////////////
if (isset($_REQUEST['del']))
{
$id=$http->request("id");
$cn=Dossier::connect();
$todo=new Todo_list($cn);
$todo->set_parameter('id',$_REQUEST['id']);
$todo->set_parameter('id',$id);
$todo->delete();
exit();
}

View file

@ -55,10 +55,10 @@ echo '
<table clsas="mtitle">
<tr>
<td class="mtitle" >
<A class="mtitle" HREF="?ac='.$_REQUEST['ac'].'&new&'.$str_dossier.'"> '._('Nouveau').' </A>
<A class="mtitle" HREF="?ac='.$http->request("ac").'&new&'.$str_dossier.'"> '._('Nouveau').' </A>
</td>
<td class="mtitle" >
<A class="mtitle" HREF="?ac='.$_REQUEST['ac'].'&see&'.$str_dossier.'">'._('Liste opérations').' </A
<A class="mtitle" HREF="?ac='.$http->request("ac").'&see&'.$str_dossier.'">'._('Liste opérations').' </A>
</td>
</tr>
</table>
@ -87,7 +87,7 @@ if ( isset($_GET['see']))
$hid=new IHidden();
$hid->name="ac";
$hid->value=$_REQUEST['ac'];
$hid->value=$http->request("ac");
echo $hid->input();
$hid->name="see";

View file

@ -33,7 +33,9 @@ require_once NOALYSS_INCLUDE.'/class/contact.class.php';
global $http;
$str_dossier=Dossier::get();
$root='?ac='.$_REQUEST['ac']."&sb=detail&f_id=".$_REQUEST["f_id"].'&'.$str_dossier;
$root="?".http_build_query(["ac"=>$http->request("ac"),"sb"=>"detail","f_id"=>$http->request("f_id","number")]);
$root.="&".$str_dossier;
$ss_action=$http->request("sc", "string", "dc");

View file

@ -61,8 +61,9 @@ if ( $action_frm == 'update')
$show_menu=1;
} catch (Exception $e)
{
record_log($e->getMessage());
record_log($e->getTraceAsString());
alert($e->getMessage());
alert($e->getMessage());
}
}
@ -71,7 +72,7 @@ if ( $action_frm == 'update')
//////////////////////////////////////////////////////////////////////////
if ($action_frm == 'delete' )
{
$ledger->id=$http->post('p_jrn',"number");;
$ledger->id=$http->post('p_jrn',"number");
$ledger->load();
$name=$ledger->get_name();
try {
@ -86,8 +87,9 @@ if ($action_frm == 'delete' )
}
catch (Exception $e)
{
record_log($e->getMessage());
record_log($e->getTraceAsString());
alert ($e->getMessage());
alert ($e->getMessage());
}
}
@ -108,8 +110,9 @@ if (isset($_POST['add']))
}
catch (Exception $e)
{
record_log($e->getMessage());
record_log($e->getTraceAsString());
alert($e->getMessage());
alert($e->getMessage());
}
}
@ -134,7 +137,7 @@ switch ($sa)
echo '<INPUT TYPE="SUBMIT" class="smallbutton" VALUE="'._("Sauve").'" name="update" onClick="$(\'action_frm\').value=\'update\';return confirm_box(\'cfg_ledger_frm\',\'Valider ?\')">
<INPUT TYPE="RESET" class="smallbutton" VALUE="Reset">
<INPUT TYPE="submit" class="smallbutton" name="efface" value="'._("Efface").'" onClick="$(\'action_frm\').value=\'delete\';return confirm_box(\'cfg_ledger_frm\',\'Vous effacez ce journal ?\')">';
$href=http_build_query(array('ac'=>$_REQUEST['ac'],'gDossier'=>$_REQUEST['gDossier']));
$href=http_build_query(array('ac'=>$http->request('ac'),'gDossier'=>$http->request('gDossier',"number")));
echo '<a style="display:inline" class="smallbutton" href="do.php?'.$href.'">'._('Retour').'</a>';
echo '</FORM>';
echo "</div>";
@ -142,8 +145,9 @@ switch ($sa)
}
catch (Exception $e)
{
record_log($e->getMessage());
record_log($e->getTraceAsString());
alert($e->getMessage());
alert($e->getMessage());
}
break;
case 'add': /* Add a new ledger */
@ -161,11 +165,13 @@ switch ($sa)
// Display list of ledgers
//////////////////////////////////////////////////////////////////////////
if ( $show_menu == 1 ) {
echo '<span style="float:right;margin-top:10px">';
echo HtmlInput::anchor_action(_("Tout"), 'show_all_row(\'cfgledger_table_id\')','ledger_all_bt','smallbutton ');
echo HtmlInput::anchor_action(_("Financier"), 'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'FIN\')','ledger_fin_bt','smallbutton ');
echo HtmlInput::anchor_action(_("Achat"), 'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'ACH\')','ledger_ach_bt','smallbutton ');
echo HtmlInput::anchor_action(_("Opérations Diverses"), 'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'ODS\')','ledger_ods_bt','smallbutton ');
echo HtmlInput::anchor_action(_("Vente"), 'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'VEN\')','ledger_ven_bt','smallbutton ');
echo '</span>';
echo '<div class="content">';
echo $ledger->listing();
echo '</div>';

View file

@ -53,6 +53,7 @@ class Acc_Account
$this->db=$p_cn;
$id=-1;
if ( trim($pcm_val) != "" ) {
$pcm_val=mb_strtoupper($pcm_val);
$pcm_val=$this->db->get_value("select format_account($1)",
array($pcm_val));
$id=$p_cn->get_value("select id from tmp_pcmn where pcm_val=$1",[$pcm_val]);
@ -128,7 +129,7 @@ class Acc_Account
function verify() {
// check for Duplicate key, parent ... see Acc_Plan_MTable
$count=$this->data_sql->count(" where pcm_val =$1 and id <> $2",
[$this->data_sql->pcm_val,$this->data_sql->id]);
[mb_strtoupper($this->data_sql->pcm_val),$this->data_sql->id]);
if ( $count > 0)
throw new Exception (_("Poste en double"),EXC_DUPLICATE);

View file

@ -454,9 +454,14 @@ class Acc_Bilan
/* allow numeric cel in ODT for the formatting and formula */
if ( is_numeric($a) )
{
/* -- for libreOffice < 5 or openoffice -- */
$searched='office:value-type="string"><text:p>'.$f2_str;
$replaced='office:value-type="float" office:value="'.$a.'"><text:p>'.$f2_str;
$line_rtf=str_replace($searched, $replaced, $line_rtf);
/* -- for libreOffice > 5 -- */
$searched='office:value-type="string" calcext:value-type="string"><text:p>'.$f2_str;
$replaced='office:value-type="float" office:value="'.$a.'" calcext:value-type="float"><text:p>'.$f2_str;
$line_rtf=str_replace($searched, $replaced, $line_rtf);
}

View file

@ -47,6 +47,7 @@ require_once NOALYSS_INCLUDE.'/class/acc_payment.class.php';
require_once NOALYSS_INCLUDE.'/class/acc_ledger_history.class.php';
//require_once NOALYSS_INCLUDE.'/class/print_ledger.class.php';
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
require_once NOALYSS_INCLUDE.'/class/pre_op_ods.class.php';
/** \file
* @brief Class for jrn, class acc_ledger for manipulating the ledger

View file

@ -125,7 +125,12 @@ abstract class Acc_Ledger_History
/**
* Build the right object
* @return \Acc_Ledger_History_Generic|\Acc_Ledger_History_Sale|\Acc_Ledger_History_Financial|\Acc_Ledger_History_Purchase
* @param Database $cn database conx
* @param array $pa_ledger ledger of array
* @param integer $p_from periode id
* @param integer $p_to periode id
* @param char $p_mode L (list operation) E (extended detail) A (accouting writing) D (Detailled VAT)
* @return Acc_Ledger_History_Generic Acc_Ledger_History_Sale Acc_Ledger_History_Financial Acc_Ledger_History_Purchase
*/
static function factory(Database $cn, $pa_ledger, $p_from, $p_to, $p_mode)
{

View file

@ -119,8 +119,8 @@ class Acc_Ledger_History_Financial extends Acc_Ledger_History
tiers.qcode as tiers_qcode,
jr_id,
jr_pj_number,
jr_date,
jr_date_paid,
to_char(jr_date,'DD.MM.YYYY') as str_date,
to_char(jr_date_paid,'DD.MM.YYYY') as str_date_paid,
jr_internal,
jrn.jr_comment,
jr_pj_name,
@ -133,7 +133,8 @@ class Acc_Ledger_History_Financial extends Acc_Ledger_History
where
jr_def_id in ({$ledger_list})
and {$periode}
{$cond_limite}";
{$cond_limite}
order by jr_date, substring(jr_pj_number,'[0-9]+$')::numeric ";
$this->data=$this->db->get_array($sql);
}
/**

View file

@ -139,8 +139,8 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
qcode,
jr_id,
jr_pj_number,
jr_date,
jr_date_paid,
to_char(jr_date,'DD.MM.YYYY') as str_date,
to_char(jr_date_paid,'DD.MM.YYYY') as str_date_paid,
jr_internal,
qp_supplier,
jrn.jr_comment,
@ -161,7 +161,8 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
where
jr_def_id in ({$ledger_list})
and {$periode}
{$cond_limite}";
{$cond_limite}
order by jrn.jr_date, substring(jr_pj_number,'[0-9]+$')::numeric ";
$this->data=$this->db->get_array($sql);
}
@ -272,8 +273,8 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
foreach ($this->data as $line)
{
$export->add($line['jr_date']);
$export->add($line['jr_date_paid']);
$export->add($line['str_date']);
$export->add($line['str_date_paid']);
$export->add($line['jr_id']);
$export->add($line['jr_pj_number']);
$export->add($line['name']." ".

View file

@ -133,8 +133,8 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
qcode,
jr_id,
jr_pj_number,
jr_date,
jr_date_paid,
to_char(jr_date,'DD.MM.YYYY') as str_date,
to_char(jr_date_paid,'DD.MM.YYYY') as str_date_paid,
jr_internal,
qs_client,
jrn.jr_comment,
@ -150,7 +150,8 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
where
jr_def_id in ({$ledger_list})
and {$periode}
{$cond_limite}";
{$cond_limite}
order by jr_date, substring(jr_pj_number,'[0-9]+$')::numeric ";
$this->data=$this->db->get_array($sql);
}
@ -264,8 +265,8 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
foreach ($this->data as $line)
{
$export->add($line['jr_date']);
$export->add($line['jr_date_paid']);
$export->add($line['str_date']);
$export->add($line['str_date_paid']);
$export->add($line['jr_id']);
$export->add($line['jr_pj_number']);
$export->add($line['name']." ".

View file

@ -189,8 +189,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$a_poste=explode(',',$tva_rate->tva_poste);
if (
$this->db->get_value('select count(*) from tmp_pcmn where pcm_val=$1',array($a_poste[0])) == 0 ||
$this->db->get_value('select count(*) from tmp_pcmn where pcm_val=$1',array($a_poste[1])) == 0 )
$this->db->get_value('select count(*) from tmp_pcmn where pcm_val=$1',array($a_poste[0])) == 0 )
throw new Exception(_(" La TVA ".$tva_rate->tva_label." utilise des postes comptables inexistants"));
}
@ -756,10 +755,14 @@ class Acc_Ledger_Purchase extends Acc_Ledger
if ( $value > 0 ) $tot_debit=bcadd($tot_debit,abs($value));
$acc_operation->insert_jrnx();
// if TVA is on both side, we deduce it immediately
if ( $oTva->get_parameter("both_side")==1)
if ( $oTva->get_parameter("both_side")==1 )
{
$poste_vat=$oTva->get_side('c');
if ( $poste_vat == '#')
{
$poste_vat=$oTva->get_side('d');
}
$acc_operation=new Acc_Operation($this->db);
$acc_operation->date=$e_date;
$acc_operation->poste=$poste_vat;
@ -769,7 +772,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$acc_operation->type='c';
$acc_operation->periode=$tperiode;
$acc_operation->insert_jrnx();
if ( $value < 0 ) $tot_debit=bcadd($tot_debit,abs($value));
if ( $value < 0 ) $tot_debit=bcadd($tot_debit,abs($value));
}
}

View file

@ -98,6 +98,7 @@ class Acc_Ledger_Search
function search_form()
{
global $g_user;
$http=new HttpInput();
$r="";
$bledger_param=json_encode(array(
'dossier'=>Dossier::id(),
@ -138,49 +139,35 @@ class Acc_Ledger_Search
$date_end_hidden=HtmlInput::hidden("{$this->div}date_end_hidden", $date_end);
/* widget for date_start */
$f_date_start=new IDate('date_start', '', $this->div."date_start");
/* all periode or only the selected one */
if (isset($_REQUEST['date_start']))
{
$f_date_start->value=$_REQUEST['date_start'];
}
else
{
$f_date_start->value=$date_start;
}
/* all periode or only the selected one */
$f_date_start->value=$http->request("date_start","string",$date_start);
/* widget for date_end */
$f_date_end=new IDate('date_end', '', $this->div."date_end");
/* all date or only the selected one */
if (isset($_REQUEST['date_end']))
{
$f_date_end->value=$_REQUEST['date_end'];
}
else
{
$f_date_end->value=$date_end;
}
$f_date_end->value=$http->request("date_end","string",$date_end);
/* widget for date term */
$f_date_paid_start=new IDate('date_paid_start', '',
$this->div."date_paid_start");
$f_date_paid_end=new IDate('date_paid_end', '',
$this->div."date_paid_end");
$f_date_paid_start->value=(isset($_REQUEST['date_paid_start']))?$_REQUEST['date_paid_start']:'';
$f_date_paid_end->value=(isset($_REQUEST['date_paid_end']))?$_REQUEST['date_paid_end']:'';
$f_date_paid_start->value=$http->request("date_paid_start","string","");
$f_date_paid_end->value=$http->request("date_paid_end","string","");
/* widget for desc */
$f_descript=new IText('desc', "", $this->div."desc");
$f_descript->size=40;
if (isset($_REQUEST['desc']))
{
$f_descript->value=$_REQUEST['desc'];
}
$f_descript->value=$http->request('desc',"string","");
/* widget for amount */
$f_amount_min=new INum('amount_min', '0', $this->div."amount_min");
$f_amount_min->value=(isset($_REQUEST['amount_min']))?abs($_REQUEST['amount_min']):0;
$f_amount_min->value=$http->request("amount_min","string",0);
$f_amount_max=new INum('amount_max', '0', $this->div."amount_max");
$f_amount_max->value=(isset($_REQUEST['amount_max']))?abs($_REQUEST['amount_max']):0;
$f_amount_max->value=$http->request("amount_max","string",0);
/* input quick code */
$f_qcode=new ICard($this->div.'qcode');
@ -196,7 +183,7 @@ class Acc_Ledger_Search
$f_qcode->set_function('fill_data');
$f_qcode->javascript=sprintf(' onchange="fill_data_onchange(%s);" ',
$f_qcode->name);
$f_qcode->value=(isset($_REQUEST[$this->div.'qcode']))?$_REQUEST[$this->div.'qcode']:'';
$f_qcode->value=$http->request($this->div.'qcode',"string","");
/* $f_txt_qcode=new IText('qcode');
$f_txt_qcode->value=(isset($_REQUEST['qcode']))?$_REQUEST['qcode']:'';
@ -204,7 +191,7 @@ class Acc_Ledger_Search
/* input poste comptable */
$f_accounting=new IPoste('accounting', "", $this->div."accounting");
$f_accounting->value=(isset($_REQUEST['accounting']))?$_REQUEST['accounting']:'';
$f_accounting->value=$http->request('accounting',"string","");
/*
* utile ??? Filtre les postes comptables en fonction du journal
* if ($this->id==-1)
@ -506,6 +493,7 @@ class Acc_Ledger_Search
" or upper(jr_internal) like upper('%".$desc."%')
or jr_grpt_id in (select j_grpt from jrnx where j_text ~* '".$desc."')
or jr_id in (select jr_id from jrn_info where ji_value is not null and ji_value ~* '$desc')
or jr_id in (select jr_id from jrn_note where upper(n_text) ~* '$desc' )
)";
$and=" and ";
}
@ -672,24 +660,30 @@ class Acc_Ledger_Search
$Max=Database::num_row($Res);
if ($Max==0)
{
return array(0, _("Aucun enregistrement trouvé"));
}
$r.='<table class="result">';
$r.="<tr >";
$r.="<th>"._("n° interne")."</th>";
if ($this->type=='ALL')
{
$r.=th('Journal');
}
$r.='<th>'.$table->get_header(0).'</th>';
if ($p_paid!=0)
{
$r.='<th>'.$table->get_header(1).'</td>';
}
if ($p_paid!=0)
{
$r.='<th>'.$table->get_header(2).'</th>';
}
$r.='<th>'.$table->get_header(3).'</th>';
$r.='<th>'.$table->get_header(4).'</th>';
$r.=th('Journal');
if ( $this->type != "ODS")
{
$r.='<th>'.$table->get_header(4).'</th>';
}
$r.="<th>"._("n° interne")."</th>";
$r.='<th>'.$table->get_header(6).'</th>';
$r.=th('Notes', ' style="width:15%"');
$r.='<th>'.$table->get_header(5).'</th>';
@ -711,24 +705,18 @@ class Acc_Ledger_Search
$row=Database::fetch_array($Res, $i);
if ($i%2==0)
{
$tr='<TR class="odd">';
}
else
{
$tr='<TR class="even">';
}
$r.=$tr;
//internal code
// button modify
$r.="<TD>";
// If url contains
//
$href=basename($_SERVER['PHP_SELF']);
$r.=sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>',
$row['jr_id'], $gDossier, $row['jr_internal']);
$r.="</TD>";
if ($this->type=='ALL')
$r.=td($row['jrn_def_name']);
// date
$r.="<TD>";
$r.=$row['str_jr_date'];
@ -748,10 +736,24 @@ class Acc_Ledger_Search
$r.="<TD>";
$r.=$row['jr_pj_number'];
$r.="</TD>";
// Ledger
$r.=td($row['jrn_def_name']);
// Tiers
$other=($row['quick_code']!='')?HtmlInput::card_detail($row['quick_code'],h($row['name'].' '.$row['first_name'])):'';
$r.=td($other);
if ($this->type != 'ODS')
{
// Tiers
$other=($row['quick_code']!='')?HtmlInput::card_detail($row['quick_code'],h($row['name'].' '.$row['first_name'])):'';
$r.=td($other);
}
// Internal number
$r.="<TD>";
$r.=sprintf('<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>',
$row['jr_id'], $gDossier, $row['jr_internal']);
$r.="</TD>";
// comment
$r.="<TD>";
$tmp_jr_comment=h($row['jr_comment']);
@ -769,7 +771,9 @@ class Acc_Ledger_Search
$positive=$this->cn->get_value("select qf_amount from quant_fin where jr_id=$1",
array($row['jr_id']));
if ($this->cn->count()!=0)
{
$positive=($positive<0)?1:0;
}
}
$r.="<TD align=\"right\">";
$t_amount=$row['jr_montant'];
@ -800,9 +804,13 @@ class Acc_Ledger_Search
$h->name="set_jr_id".$row['jr_id'];
$r.='<TD>'.$w->input().$h->input().'</TD>';
if ($row['jr_rapt']=='paid')
{
$amount_paid=bcadd($amount_paid, $t_amount);
}
else
{
$amount_unpaid=bcadd($amount_unpaid, $t_amount);
}
}
// Rapprochement

View file

@ -185,7 +185,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$a_poste = explode(',', $tva_rate->tva_poste);
if (
$this->db->get_value('select count(*) from tmp_pcmn where pcm_val=$1', array($a_poste[0])) == 0 ||
$this->db->get_value('select count(*) from tmp_pcmn where pcm_val=$1', array($a_poste[1])) == 0)
throw new Exception(_(" La TVA " . $tva_rate->tva_label . " utilise des postes comptables inexistants"));
}

View file

@ -278,7 +278,7 @@ class Acc_Operation
if ( $diff != 0 )
{
printf (_("Erreur : balance incorrecte :diff = %d"),$diff);
printf (_("Erreur : balance incorrecte :diff = %s"),$diff);
return false;
}

View file

@ -319,6 +319,13 @@ order by
$r.= '</form>';
return $r;
}
/**
* Display the result of accountancy and analytic ,
* Axis / Card
* Card / Axis
* Accounting / Axis
* Axis / Accounting
*/
function display_html()
{
bcscale(2);
@ -377,7 +384,7 @@ order by
echo '</tr>';
echo '</table>';
echo '<h2>'._("Résultat global").nbm($tot_glob).'</h2>';
echo '<h2>'._("Résultat global")." ".nbm($tot_glob).'</h2>';
}
//---------------------------------------------------------------------------
// Accountancy - Analytic
@ -430,7 +437,7 @@ order by
echo '</tr>';
echo '</table>';
echo td(nbm($tot_card),' class="num"');
echo '<h2>'._("Résultat global")." ".nbm($tot_glob).'</h2>';
}
//---------------------------------------------------------------------------
// Acc after card
@ -482,7 +489,7 @@ order by
echo '</tr>';
echo '</table>';
echo td(nbm($tot_card),' class="num"');
echo '<h2>'._("Résultat global")." ".nbm($tot_glob).'</h2>';
}
//---------------------------------------------------------------------------
// Analytic - Accountancy
@ -536,7 +543,7 @@ order by
echo '</tr>';
echo '</table>';
echo '<h2> Résultat global '.nbm($tot_glob).'</h2>';
echo '<h2>'._("Résultat global")." ".nbm($tot_glob).'</h2>';
}
}

View file

@ -173,19 +173,20 @@ class Anc_Operation
$cond="$where (oa_date >= to_date('$p_from','DD.MM.YYYY') or oa_date >= to_date('$p_from','DD.MM.YYYY') )";
$where=" and ";
}
if ( $p_to!="" )
if ( $p_to!="" ) {
$cond.="$where (oa_date <=to_date('$p_to','DD.MM.YYYY') or oa_date <=to_date('$p_to','DD.MM.YYYY')) ";
$where=" and ";
}
$cond .= $where." j_id is null ";
$sql="
select distinct oa_group,
to_char(oa_date,'DD.MM.YYYY') as str_date ,
oa_date,
oa_description,
jr_pj_number,
jr_id
oa_description
from
operation_analytique as oa
left join (select jr_id,jr_pj_number,j_id from jrn join jrnx on (jr_grpt_id=j_grpt) ) as m on (m.j_id=oa.j_id)
$cond
order by oa_date ";
return $this->db->get_array($sql);
@ -294,7 +295,6 @@ class Anc_Operation
$ret.= "<table id=\"anc_operation_list_tb\"class=\"result\">";
$ret.=th(_("Date"));
$ret.=th(_("Libellé"));
$ret.=th(_("Num Pièce"));
$ret.=th("");
$ret.=th("");
$i=0;
@ -311,16 +311,10 @@ class Anc_Operation
$ret.="<tr $row_id $class>";
$ret.=td($row['str_date']);
$ret.=td(h($row['oa_description']));
$ret.=td(h($row['jr_pj_number']));
$js="anc_remove_operation(".$gDossier.",".$oldgroup.")";
$ret.="<td>".HtmlInput::image_click("trash-24.gif", $js, _("Effacer"))."</td>";
if ( $row['jr_id'] != "") {
$js="viewOperation({$row['jr_id']},{$gDossier})";
} else {
$js="anc_detail_op({$row['oa_group']},{$gDossier})";
}
$js="anc_detail_op({$row['oa_group']},{$gDossier})";
$ret .= "<td>". HtmlInput::image_click("crayon-mod-b24.png", $js, _("Modifier"))."</td>";
$ret.="</tr>";
}

View file

@ -272,9 +272,14 @@ class Document
*/
if ( is_numeric($value) && $p_type=='OOo')
{
$searched='/office:value-type="string"><text:p>'.$pattern.'/';
// For libreOffice <=4
$searched='/office:value-type="string"><text:p>'.$pattern.'/i';
$replaced='office:value-type="float" office:value="'.$value.'"><text:p>'.$pattern;
$buffer=preg_replace($searched, $replaced, $buffer,1);
// For libreOffice >=4
$searched='/office:value-type="string" calcext:value-type="string"><text:p>'.$pattern.'/i';
$replaced='office:value-type="float" office:value="'.$value.'" calcext:value-type="float"><text:p>'.$pattern;
$buffer=preg_replace($searched, $replaced, $buffer,1);
}
// replace into the $buffer
// take the position in the buffer

View file

@ -805,7 +805,7 @@ class Fiche
// account
if ($id==ATTR_DEF_ACCOUNT)
{
$v=sql_string($value);
$v=mb_strtoupper(sql_string($value));
try
{
@ -973,7 +973,7 @@ class Fiche
// account
if ($id==ATTR_DEF_ACCOUNT)
{
$v=sql_string($value);
$v=mb_strtoupper(sql_string($value));
if (trim($v)!='')
{
if (strpos($v, ',')!=0)

View file

@ -42,9 +42,17 @@ class Package_Repository
*/
function __construct()
{
$content=file_get_contents(NOALYSS_PACKAGE_REPOSITORY."/web.xml");
// Check we can resolve the name
$host=parse_url(NOALYSS_PACKAGE_REPOSITORY,PHP_URL_HOST);
if (gethostbyname($host) != $host)
{
$content=file_get_contents(NOALYSS_PACKAGE_REPOSITORY."/web.xml");
$this->content=simplexml_load_string($content);
} else {
$this->content=NULL;
}
$this->content=simplexml_load_string($content);
}
public function getContent()
@ -72,6 +80,9 @@ class Package_Repository
function display_noalyss_info()
{
global $g_user;
if ( $this->content == NULL ) {
throw new Exception(_("Problème réseau"),10);
}
switch ($g_user->lang)
{
case 'fr_FR.utf8':
@ -94,6 +105,9 @@ class Package_Repository
*/
function find_plugin($p_code)
{
if ( $this->content == NULL ) {
throw new Exception(_("Problème réseau"),10);
}
$a_plugin=$this->content->xpath('//plugins/plugin');
$nb_plugin=count($a_plugin);
for ($i=0; $i<$nb_plugin; $i++)
@ -114,6 +128,9 @@ class Package_Repository
*/
function find_template($p_code)
{
if ( $this->content == NULL ) {
throw new Exception(_("Problème réseau"),10);
}
$a_template=$this->content->xpath('//database_template/dbtemplate');
$nb_template=count($a_template);
for ($i=0; $i<$nb_template; $i++)
@ -128,6 +145,9 @@ class Package_Repository
function make_object($p_type, $p_id)
{
if ( $this->content == NULL ) {
throw new Exception(_("Problème réseau"),10);
}
switch ($p_type)
{
case "core":

View file

@ -83,8 +83,14 @@ class Print_Ledger {
return $pdf;
}
}
else
elseif ($jrn_type=='FIN')
{
$pdf=new Print_Ledger_Financial($cn, $p_ledger);
return $pdf;
} else
{
return new Print_Ledger_Detail($cn, $p_ledger);
}
break;
case 'L':
@ -141,7 +147,7 @@ class Print_Ledger {
$jrn_type=$p_ledger->get_type();
if ($jrn_type=='FIN')
{
$pdf=new Print_Ledger_Financial($cn, $p_ledger);
$pdf=new Print_Ledger_Detail($cn, $p_ledger);
return $pdf;
;
}
@ -199,10 +205,10 @@ class Print_Ledger {
where
uj_login=$1
and uj_priv in ('R','W')
order by jrn_def_name
and ( jrn_enable=1
or
exists (select 1 from jrn where jr_tech_per in (select p_id from parm_periode where p_exercice=$2))
exists (select 1 from jrn where jr_def_id=jrn_def_id and jr_tech_per in (select p_id from parm_periode where p_exercice=$2)))
order by jrn_def_name
";
$a_jrn=$cn->get_array($sql, array($g_user->login, $exercice));
}
@ -211,7 +217,7 @@ class Print_Ledger {
$a_jrn=$cn->get_array("select jrn_def_id
from jrn_def join jrn_type on jrn_def_type=jrn_type_id
where
jrn_enable=1 or exists(select 1 from jrn where jr_tech_per in (select p_id from parm_periode where p_exercice=$1))
jrn_enable=1 or exists(select 1 from jrn where jr_def_id=jrn_def_id and jr_tech_per in (select p_id from parm_periode where p_exercice=$1))
order by jrn_def_name
", [$exercice]);
}

View file

@ -40,12 +40,12 @@ class Print_Ledger_Misc extends PDF
//Line break
$this->Ln(20);
$this->SetFont('DejaVu', 'B', 7);
$this->Cell(30,6,'Piece');
$this->Cell(10,6,'Date');
$this->Cell(20,6,'Interne');
$this->Cell(25,6,'Tiers');
$this->Cell(80,6,'Commentaire');
$this->Cell(15,6,'Montant');
$this->Cell(10,6,_('Date'));
$this->Cell(30,6,_('Piece'));
$this->Cell(20,6,_('Interne'));
$this->Cell(25,6,_('Tiers'));
$this->Cell(80,6,_('Commentaire'));
$this->Cell(15,6,_('Montant'));
$this->Ln(6);
}
@ -78,8 +78,8 @@ class Print_Ledger_Misc extends PDF
{
$row=$a_jrn[$i];
$this->LongLine(30,5,$row['jr_pj_number']);
$this->write_cell(10,5, smaller_date($row['date']));
$this->LongLine(30,5,$row['jr_pj_number']);
$this->write_cell(20,5,$row['jr_internal']);
$type=$this->cn->get_value("select jrn_def_type from jrn_def where jrn_def_id=$1",array($a_jrn[$i]['jr_def_id']));
$other=mb_substr($this->ledger->get_tiers($type,$a_jrn[$i]['jr_id']),0,25);

View file

@ -353,8 +353,10 @@ class Todo_List
}
static function to_object ($p_cn,$p_array)
{
$end=count($p_array);
$ret=array();
if ( $p_array == FALSE ) return $ret;
$end=count($p_array);
for ($i=0;$i < $end;$i++)
{
$t=new Todo_List($p_cn);

View file

@ -110,7 +110,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
if ( ! defined ("SYSINFO_DISPLAY")) {
define ("SYSINFO_DISPLAY",TRUE);
}
define ("DBVERSION",128);
define ("DBVERSION",129);
define ("MONO_DATABASE",25);
define ("DBVERSIONREPO",18);
define ('NOTFOUND','--not found--');

View file

@ -121,7 +121,7 @@ $menu[]=_('Liste Suivi'); $desc[]=_('Document de suivi sous forme de liste');$d
$menu[]=_('Moyen de paiement'); $desc[]=_('Config. des méthodes de paiement');$desc_long[]=_('Configuration des moyens de paiements que vous voulez utiliser dans les journaux de type VEN ou ACH, les moyens de paiement permettent de générer l\'opération de trésorerie en même temps que l\'achat, la note de frais ou la vente');
$menu[]=_('Administration'); $desc[]=_('Suivi administration, banque');$desc_long[]=_('Suivi des administrations : courrrier, déclarations.');
$menu[]=_('Prévision'); $desc[]=_('Prévision');$desc_long[]=_('Prévision de vos achats, revenus, permet de suivre l\'évolution de votre société. Vos prévisions sont des formules sur les postes comptables et vous permettent aussi vos marges brutes.');
$menu[]=_('Export opérations rapprochées'); $desc[]=_('Export opérations rapprochées en CSV');$desc_long[]=_('');
$menu[]=_('Export opérations rapprochées'); $desc[]=_('Export opérations rapprochées en CSV');$desc_long[]=_(' ');
$menu[]=_('Administrateur'); $desc[]=_('Suivi des gérants, administrateurs et salariés');$desc_long[]=_('Suivi de vos salariés, managers ainsi que des administrateurs, pour les documents et les opérations comptables');
$menu[]=_('Menu par défaut'); $desc[]=_('Configuration des menus par défaut');$desc_long[]=_('Configuration des menus par défaut, ces menus sont appelés par des actions dans d\'autres menus');
$menu[]=_('Agenda'); $desc[]=_('Agenda');$desc_long[]=_('Agenda, présentation du suivi sous forme d\'agenda ');

View file

@ -186,14 +186,14 @@ else
$prog = bcsub($prog, $row['j_montant']);
}
$export->add(abs($prog),"number");
$export->add($fic->get_amount_side($prog),"number");
$export->add($fic->get_amount_side($prog));
if ($row['letter'] != -1)
{
$export->add(strtoupper(base_convert($row['letter'],10,36)));
$export->add($row['letter_diff'],"number");
}
else
$export->add("");
$export->add("");
$export->write();
}
if ($prog < 0 )

View file

@ -106,7 +106,7 @@ if ( $get_option=="E")
{
if ($jrn_type=='FIN')
{
$get_option='L';
$get_option='A';
}
elseif ($jrn_type=='ODS'||$Jrn->id==0)
{
@ -178,6 +178,91 @@ if ($get_option=='A')
$acc_ledger_history->export_csv();
exit;
}
/**
* Mode list for ODS , FIN and GL
*/
if ($get_option=="L" && ($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL') )
{
if ( $get_jrn==0) {
$Row=$Jrn->get_rowSimple($get_from_periode, $get_to_periode, $a_jrn);
}else {
$Row=$Jrn->get_rowSimple($get_from_periode, $get_to_periode);
}
$cn->prepare('reconcile_date_csv',
'select *
from
jrn
where
jr_id in
(select
jra_concerned
from
jrn_rapt
where jr_id = $1
union all
select
jr_id
from jrn_rapt
where jra_concerned=$1)');
$title=array();
$title[]=_("operation");
$title[]=_("Date");
$title[]=_("N° Pièce");
$title[]=_("QuickCode");
$title[]=_("Tiers");
$title[]=_("commentaire");
$title[]=_("internal");
$title[]=_("montant");
$export->write_header($title);
foreach ($Row as $line)
{
$tiers_id=$Jrn->get_tiers_id($line['jrn_def_type'], $line['jr_id']);
$fiche_tiers=new Fiche($cn, $tiers_id);
$tiers=$fiche_tiers->strAttribut(ATTR_DEF_NAME, 0)." ".$fiche_tiers->strAttribut(ATTR_DEF_FIRST_NAME,
0);
$export->add($line['num']);
$export->add($line['date']);
$export->add($line['jr_pj_number']);
$export->add($fiche_tiers->get_quick_code());
$export->add($tiers);
$export->add($line['comment']);
$export->add($line['jr_internal']);
// echo "<TD>".$line['pj'].";";
// If the ledger is financial :
// the credit must be negative and written in red
// Get the jrn type
if ($line['jrn_def_type']=='FIN')
{
$positive=$cn->get_value("select qf_amount from quant_fin ".
" where jr_id=$1", array($line['jr_id']));
$export->add($positive, "number");
$export->add("");
}
else
{
$export->add($line['montant'], "number");
}
//------ Add reconcilied operation ---------------
$ret_reconcile=$cn->execute('reconcile_date_csv',
array($line['jr_id']));
$max=Database::num_row($ret_reconcile);
if ($max>0)
{
for ($e=0; $e<$max; $e++)
{
$row=Database::fetch_array($ret_reconcile, $e);
$export->add($row['jr_date']);
$export->add($row['jr_internal']);
$export->add($row['jr_pj_number']);
}
}
$export->write();
}
return;
}
//-----------------------------------------------------------------------------
// Detail printing for ACH or VEN : 1 row resume the situation with VAT, DNA
// for Misc the amount
@ -187,87 +272,20 @@ if ($get_option=="L" || $get_option == 'D')
{
//-----------------------------------------------------
if ($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL')
if ($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL')
{
if ( $get_jrn==0) {
$Row=$Jrn->get_rowSimple($get_from_periode, $get_to_periode, $a_jrn);
}else {
$Row=$Jrn->get_rowSimple($get_from_periode, $get_to_periode);
}
$cn->prepare('reconcile_date_csv',
'select *
from
jrn
where
jr_id in
(select
jra_concerned
from
jrn_rapt
where jr_id = $1
union all
select
jr_id
from jrn_rapt
where jra_concerned=$1)');
$title=array();
$title[]=_("operation");
$title[]=_("Date");
$title[]=_("N° Pièce");
$title[]=_("QuickCode");
$title[]=_("Tiers");
$title[]=_("commentaire");
$title[]=_("internal");
$title[]=_("montant");
$export->write_header($title);
foreach ($Row as $line)
if ($get_jrn == 0 )
{
$tiers_id=$Jrn->get_tiers_id($line['jrn_def_type'], $line['jr_id']);
$fiche_tiers=new Fiche($cn, $tiers_id);
$tiers=$fiche_tiers->strAttribut(ATTR_DEF_NAME, 0)." ".$fiche_tiers->strAttribut(ATTR_DEF_FIRST_NAME,
0);
$acc_ledger_history=new Acc_Ledger_History_Generic($cn, $a_jrn,
$get_from_periode, $get_to_periode, 'D');
} else {
$acc_ledger_history=new Acc_Ledger_History_Generic($cn, array($a_jrn),
$get_from_periode, $get_to_periode, 'D');
$export->add($line['num']);
$export->add($line['date']);
$export->add($line['jr_pj_number']);
$export->add($fiche_tiers->get_quick_code());
$export->add($tiers);
$export->add($line['comment']);
$export->add($line['jr_internal']);
// echo "<TD>".$line['pj'].";";
// If the ledger is financial :
// the credit must be negative and written in red
// Get the jrn type
if ($line['jrn_def_type']=='FIN')
{
$positive=$cn->get_value("select qf_amount from quant_fin ".
" where jr_id=$1", array($line['jr_id']));
$export->add($positive, "number");
$export->add("");
}
else
{
$export->add($line['montant'], "number");
}
//------ Add reconcilied operation ---------------
$ret_reconcile=$cn->execute('reconcile_date_csv',
array($line['jr_id']));
$max=Database::num_row($ret_reconcile);
if ($max>0)
{
for ($e=0; $e<$max; $e++)
{
$row=Database::fetch_array($ret_reconcile, $e);
$export->add($row['jr_date']);
$export->add($row['jr_internal']);
$export->add($row['jr_pj_number']);
}
}
$export->write();
}
$acc_ledger_history->export_csv();
return;
}
//------------------------------------------------------------------------------
// One line summary with tiers, amount VAT, DNA, tva code ....
//

View file

@ -65,7 +65,7 @@ $g_user->Check();
$g_user->check_dossier($gDossier);
// Security
if ($g_user->check_jrn($jrn_id) == 'X') {
if ($jrn_id != 0 && $g_user->check_jrn($jrn_id) == 'X') {
/* Cannot Access */
NoAccess();
}

View file

@ -42,6 +42,7 @@ switch($ledger_type)
{
case 'ACH':
$ask_pay=1;
$p_array['ledger_type']='ACH';
break;
case 'ODS':
$ask_pay=0;
@ -53,9 +54,11 @@ switch($ledger_type)
break;
case 'VEN':
$ask_pay=1;
$p_array['ledger_type']='VEN';
break;
case 'FIN':
$ask_pay=0;
$p_array['ledger_type']='FIN';
break;
}
@ -95,7 +98,9 @@ if (!isset($p_array['date_start']))
}
else
{
$msg='<h2 class="info2">'._("Période ").$_GET['date_start']._(" au ").$_GET['date_end'].'</h2>';
$date_start=$http->get("date_start","string","");
$date_end=$http->get("date_end","string","");
$msg='<h2 class="info2">'.sprintf(_("Période %s au %s "),$date_start,$date_end) .'</h2>';
}
/* compute the sql stmt */
@ -118,7 +123,22 @@ echo dossier::hidden();
list($count, $html) = $Ledger->list_operation($sql, $offset, $ask_pay);
echo $html;
echo $bar;
$r = HtmlInput::get_to_hidden(array('l', 'date_start', 'date_end', 'desc', 'amount_min', 'amount_max', 'qcode', 'accounting', 'unpaid', 'gDossier', 'ledger_type', 'p_action'));
$r = HtmlInput::get_to_hidden(array('search_opnb_jrn',
'search_opqcode',
'l',
'date_start',
'date_end',
'date_paid_start',
'date_paid_end',
'desc',
'amount_min',
'amount_max',
'qcode',
'accounting',
'unpaid',
'gDossier',
'ledger_type',
'p_action'));
if (isset($_GET['r_jrn']))
{
foreach ($_GET['r_jrn'] as $k => $v)
@ -145,7 +165,8 @@ echo '<form action="export.php" method="get">';
echo $r;
echo HtmlInput::hidden('act', 'CSV:histo');
echo HtmlInput::submit('viewsearch', _('Export vers CSV'));
$qcode=$http->get("search_opqcode","string","");
echo HtmlInput::hidden('qcode',trim($qcode));
echo '</form>';
echo '</div>';

View file

@ -50,10 +50,10 @@ if ($g_user->Admin() == 0 && $g_user->is_local_admin() == 0 && $g_user->get_sta
where
uj_login=$1
and uj_priv in ('R','W')
order by jrn_def_name
and ( jrn_enable=1
or
exists (select 1 from jrn where jr_tech_per in (select p_id from parm_periode where p_exercice=$2))
exists (select 1 from jrn where jr_tech_per in (select p_id from parm_periode where p_exercice=$2)))
order by jrn_def_name
";
$ret = $cn->make_array($sql,0,array($g_user->login,$exercice));
}

View file

@ -270,9 +270,11 @@ function html_page_start($p_theme="", $p_script="", $p_script2="")
if ($p_theme != "")
{
$Res = $cn->exec_sql("select the_filestyle from theme
where the_name='" . $p_theme . "'");
where the_name=$1" ,[$p_theme]);
if (Database::num_row($Res) == 0)
$style = "style-classic.css";
{
$style = "style-classic7.css";
}
else
{
$s = Database::fetch_array($Res, 0);
@ -281,7 +283,7 @@ function html_page_start($p_theme="", $p_script="", $p_script2="")
}
else
{
$style = "style-classic.css";
$style = "style-classic7.css";
} // end if
$title="NOALYSS";

View file

@ -221,7 +221,7 @@ class HtmlInput
{
if ($p_id=="")
$p_id=$p_name;
return '<INPUT TYPE="hidden" id="'.$p_id.'" NAME="'.$p_name.'" VALUE="'.$p_value.'">';
return '<INPUT TYPE="hidden" id="'.strip_tags($p_id).'" NAME="'.$p_name.'" VALUE="'.strip_tags($p_value).'">';
}
static function extension()
@ -826,6 +826,7 @@ class HtmlInput
static function title_box($p_name, $p_div, $p_mod="close", $p_js="",
$p_draggable="n")
{
$p_div=strip_tags($p_div);
$r='<div class="bxbutton">';
// If draggable : display a icon to unpin and move the dialog box

View file

@ -0,0 +1,105 @@
<?php
/*
* Copyright (C) 2018 Dany De Bontridder <dany@alchimerys.be>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* @file
* @brief Tab element
*
*/
/**
* Tab Element
* @see Output_Html_Tab
*/
class Html_Tab
{
private $id; //<! DOM ID of the tabs (used for the tab and the DIV)
private $title; //!< Title of the tab
private $content ; //!< static content of the tab
private $mode ; //!< possible values are static if the content is static, ajax for calling an ajax, link for a html link, default static
private $link; //!< the javascript or an html link, depending of the $mode
/**
*@example html_tab.test.php
*/
function __construct($p_id,$p_title)
{
$this->id=$p_id;
$this->title=$p_title;
$this->mode='static';
}
public function get_id()
{
return $this->id;
}
public function get_title()
{
return $this->title;
}
public function get_content()
{
return $this->content;
}
public function set_id($id)
{
$this->id=$id;
return $this;
}
public function set_title($title)
{
$this->title=$title;
return $this;
}
public function set_content($content)
{
$this->content=$content;
return $this;
}
public function get_link()
{
return $this->link;
}
public function set_link($link)
{
$this->link=$link;
return $this;
}
public function get_mode()
{
return $this->mode;
}
public function set_mode($mode)
{
if ( $mode != 'static' && $mode != 'ajax' && $mode != 'link') {
throw new Exception(_("Mode invalide"));
}
$this->mode=$mode;
return $this;
}
}

View file

@ -108,7 +108,8 @@ class HttpInput
if (array_key_exists($p_name,$this->array) )
{
$this->check_type($p_name, $p_type);
return $this->array[$p_name];
if ( is_string($this->array[$p_name]) ) return strip_tags($this->array[$p_name]);
return $this->array[$p_name];
}
else
{
@ -121,7 +122,8 @@ class HttpInput
EXC_PARAM_VALUE);
}
$this->check_type($p_name, $p_type);
return $this->array[$p_name];
if ( is_string($this->array[$p_name]) ) return strip_tags($this->array[$p_name]);
return $this->array[$p_name];
}
catch (Exception $e)
{

View file

@ -193,4 +193,40 @@ class Icon_Action
$r='<span id="'.$p_id.'" onclick="'.$p_javascript.'" class="icon">&#xe80f;</span>';
return $r;
}
/**
* Display the icon to modify a idem
* @param type $p_id
* @param type $p_javascript
* @return string
*/
static function modify($p_id,$p_javascript)
{
$r='<span id="'.$p_id.'" onclick="'.$p_javascript.'" class="smallicon icon" style="margin-left:5px">&#xe80d;</span>';
return $r;
}
/**
* Display the icon to modify a idem
* @param type $p_id
* @param type $p_javascript
* @return string
*/
static function validate($p_id,$p_javascript)
{
$r='<span id="'.$p_id.'" onclick="'.$p_javascript.'" class="smallicon icon" style="margin-left:5px">&#x2713;</span>';
return $r;
}
/**
* Display the icon to modify a idem
* @param type $p_id
* @param type $p_javascript
* @return string
*/
static function cancel($p_id,$p_javascript)
{
$r='<span id="'.$p_id.'" onclick="'.$p_javascript.'" class="smallicon icon" style="margin-left:5px">&#xe802;</span>';
return $r;
}
}

View file

@ -170,7 +170,11 @@ class Noalyss_Csv
{
$p_number=trim($p_number);
if ($p_number=="") {return $p_number;}
$r=number_format($p_number, 4, $this->sep_dec,'');
if ( isNumber($p_number) == 1 ) {
$r=number_format($p_number, 4, $this->sep_dec,'');
} else {
$r=$p_number;
}
return $r;
}
private function encode($str)

View file

@ -0,0 +1,135 @@
<?php
/*
* Copyright (C) 2018 Dany De Bontridder <dany@alchimerys.be>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once NOALYSS_INCLUDE.'/lib/html_tab.class.php';
/**
* @file
* @brief Display the tabs
*
*/
/**
* @brief Display the tabs
* @see Html_Tab
*
*/
class Output_Html_Tab
{
private $a_tabs; //!< array of html tabs
/**
*@example html_tab.test.php
*/
function __construct()
{
$this->a_tabs=[];
}
/**
* Add Html_Tab
* @param Html_Tab $p_html_tab
*/
function add(Html_Tab $p_html_tab)
{
$this->a_tabs[]=clone $p_html_tab;
}
/**
* Build the javascript to change the class name of the selected tab, hide other div and show the selected one
* @param string $p_not_hidden id of the showed tab
* @return javascript string
*/
function build_js ($p_not_hidden)
{
$r="";
$nb=count($this->a_tabs);
for ($i =0 ; $i < $nb;$i++)
{
if ( $this->a_tabs[$i]->get_id() != $p_not_hidden) {
$r .= sprintf("$('div%s').hide();",$this->a_tabs[$i]->get_id() );
$r .= sprintf("$('tab%s').className='tabs';",$this->a_tabs[$i]->get_id() );
} else {
$r .= sprintf("$('div%s').show();",$p_not_hidden );
$r .= sprintf("$('tab%s').className='tabs_selected';",$p_not_hidden );
}
}
return $r;
}
/**
* print the html + javascript code of the tabs and the div
*
*/
function output()
{
$nb=count($this->a_tabs);
if ($nb==0)
{
return;
}
echo '<ul class="tabs">';
for ($i=0; $i<$nb; $i++)
{
printf ('<li id="tab%s" class="tabs">',
$this->a_tabs[$i]->get_id());
switch ($this->a_tabs[$i]->get_mode())
{
case 'link':
printf ('<a id="%s" href="%s">',
$this->a_tabs[$i]->get_id(),
$this->a_tabs[$i]->get_link());
echo $this->a_tabs[$i]->get_title();
echo '</a>';
break;
case 'ajax':
printf('<a id="%s" onclick="%s">',
$this->a_tabs[$i]->get_id(),
$this->a_tabs[$i]->get_link());
echo $this->a_tabs[$i]->get_title();
echo '</a>';
break;
case 'static':
// show one , hide other
$script=$this->build_js($this->a_tabs[$i]->get_id());
printf('<a onclick="%s">', $script);
echo $this->a_tabs[$i]->get_title();
echo '</a>';
break;
default:
break;
}
echo '</li>';
}
echo '</ul>';
for ($i=0;$i<$nb;$i++)
{
printf('<div id="div%s" style="display:none;clear:both">',$this->a_tabs[$i]->get_id());
echo $this->a_tabs[$i]->get_content();
echo '</div>';
}
}
}

View file

@ -17,6 +17,15 @@
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* @file
* @brief display a kind of select
*/
/**
* Display a kind of select
* @include select-box-test.php
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu
class Select_Box
@ -31,8 +40,7 @@ class Select_Box
* Default constructor
* @param type $p_id javascript DOMid
* @param type $value Label to display
*
* @example test-iselect-button.php
* @example select-box-test.php
*/
function __construct($p_id, $value)
{

View file

@ -0,0 +1,59 @@
begin;
CREATE OR REPLACE FUNCTION comptaproc.insert_quant_purchase(p_internal text, p_j_id numeric, p_fiche character varying, p_quant numeric, p_price numeric, p_vat numeric, p_vat_code integer, p_nd_amount numeric, p_nd_tva numeric, p_nd_tva_recup numeric, p_dep_priv numeric, p_client character varying, p_tva_sided numeric, p_price_unit numeric)
RETURNS void
AS $function$
declare
fid_client integer;
fid_good integer;
account_priv account_type;
fid_good_account account_type;
n_dep_priv numeric;
begin
n_dep_priv := p_dep_priv;
select p_value into account_priv from parm_code where p_code='DEP_PRIV';
select f_id into fid_client from
fiche_detail where ad_id=23 and ad_value=upper(trim(p_client));
select f_id into fid_good from
fiche_detail where ad_id=23 and ad_value=upper(trim(p_fiche));
select ad_value into fid_good_account from fiche_detail where ad_id=5 and f_id=fid_good;
if strpos( fid_good_account , account_priv ) = 1 then
n_dep_priv=p_price;
end if;
insert into quant_purchase
(qp_internal,
j_id,
qp_fiche,
qp_quantite,
qp_price,
qp_vat,
qp_vat_code,
qp_nd_amount,
qp_nd_tva,
qp_nd_tva_recup,
qp_supplier,
qp_dep_priv,
qp_vat_sided,
qp_unit)
values
(p_internal,
p_j_id,
fid_good,
p_quant,
p_price,
p_vat,
p_vat_code,
p_nd_amount,
p_nd_tva,
p_nd_tva_recup,
fid_client,
n_dep_priv,
p_tva_sided,
p_price_unit);
return;
end;
$function$
LANGUAGE plpgsql;
insert into version (val,v_description) values (129,'Fix bug in QUANT_PURCHASE');
commit;

View file

@ -28,7 +28,9 @@ if (!defined('ALLOWED'))
?>
<table class="result">
<tr>
<th><?= _('Date') ?></th>
<th><?= _('Banque') ?></th>
<th><?=_('Pièce')?></th>
<th><?= _("Tiers") ?></th>
<th><?= _("Libellé") ?></th>
<th><?= _("Montant") ?></th>
@ -41,9 +43,15 @@ if (!defined('ALLOWED'))
$class=($i%2==0)?' class="even" ':' class="odd" ';
?>
<tr <?= $class ?> >
<td>
<?=$this->data[$i]['str_date']?>
</td>
<td>
<?= $this->data[$i]['bk_qcode']; ?>
</td>
<td>
<?= $this->data[$i]['jr_pj_number']; ?>
</td>
<td>
<?php
echo HtmlInput::history_card($this->data[$i]['tiers_f_id'],

View file

@ -79,8 +79,8 @@ foreach ($this->data as $line) {
echo "<TD>" . h($line['jr_pj_number']) . "</TD>";
// Date
echo "<TD>" . smaller_date($line['jr_date']) . "</TD>";
echo "<TD>" . smaller_date($line['jr_date_paid']) . "</TD>";
echo "<TD>" . smaller_date($line['str_date']) . "</TD>";
echo "<TD>" . smaller_date($line['str_date_paid']) . "</TD>";
// Internal with detail
echo "<TD>" . HtmlInput::detail_op($line['jr_id'], $line['jr_internal']) . "</TD>";

View file

@ -69,10 +69,10 @@ for ($i=0;$i<$nb_data;$i++):
?>
<tr <?=$odd?> >
<td>
<?=$this->data[$i]['jr_date']?>
<?=$this->data[$i]['str_date']?>
</td>
<td>
<?=$this->data[$i]['jr_date_paid']?>
<?=$this->data[$i]['str_date_paid']?>
</td>
<td>
<?=$this->data[$i]['jr_pj_number']?>

View file

@ -84,10 +84,10 @@ for ($i=0;$i<$nb_data;$i++):
?>
<tr <?=$odd?> >
<td>
<?=$this->data[$i]['jr_date']?>
<?=$this->data[$i]['str_date']?>
</td>
<td>
<?=$this->data[$i]['jr_date_paid']?>
<?=$this->data[$i]['str_date_paid']?>
</td>
<td>
<?=$this->data[$i]['jr_pj_number']?>

View file

@ -77,8 +77,8 @@ foreach ($this->data as $line) {
echo "<TD>" . h($line['jr_pj_number']) . "</TD>";
// Date
echo "<TD>" . smaller_date($line['jr_date']) . "</TD>";
echo "<TD>" . smaller_date($line['jr_date_paid']) . "</TD>";
echo "<TD>" . smaller_date($line['str_date']) . "</TD>";
echo "<TD>" . smaller_date($line['str_date_paid']) . "</TD>";
// Internal with detail
echo "<TD>" . HtmlInput::detail_op($line['jr_id'], $line['jr_internal']) . "</TD>";

View file

@ -69,10 +69,10 @@ for ($i=0;$i<$nb_data;$i++):
?>
<tr <?=$odd?> >
<td>
<?=$this->data[$i]['jr_date']?>
<?=$this->data[$i]['str_date']?>
</td>
<td>
<?=$this->data[$i]['jr_date_paid']?>
<?=$this->data[$i]['str_date_paid']?>
</td>
<td>
<?=$this->data[$i]['jr_pj_number']?>

View file

@ -70,10 +70,10 @@ for ($i=0;$i<$nb_data;$i++):
?>
<tr <?=$odd?> >
<td>
<?=$this->data[$i]['jr_date']?>
<?=$this->data[$i]['str_date']?>
</td>
<td>
<?=$this->data[$i]['jr_date_paid']?>
<?=$this->data[$i]['str_date_paid']?>
</td>
<td>
<?=$this->data[$i]['jr_pj_number']?>

View file

@ -58,14 +58,14 @@ echo $str_add_button;
?>
</td>
<td class="notice">
<?php echo _("Obligatoire pour les journaux FIN : donner ici la fiche de la banque utilisée")?>
<?php echo _("Obligatoire pour les journaux FIN : donner ici la fiche du compte en banque utilisée")?>
</td>
<?php
}
?>
</TR>
<tr>
<td>Minimum de lignes à afficher</td>
<td><?php echo _("Minimum de lignes à afficher")?></td>
<td><?php echo $min_row->input()?></td>
</tr>
<tr>

View file

@ -32,6 +32,18 @@ printf (_(" La version de votre installation est %s "),$version_noalyss);
$core=new Package_Repository();
$xml=$core->getContent();
/*
* If xml is null , it means it was not possible to get the file , could be
* a network problem or a misconfiguration
*/
if ( $xml == NULL) {
echo '<h2 class="error">';
printf (_("Désolé , impossible de se connecter au serveur %s"),
NOALYSS_PACKAGE_REPOSITORY);
echo '</h2>';
return;
}
printf(h1(_("Version %s du %s")),$xml->core->version,$xml->core->date);
echo '<p>';
echo $xml->core->description;

View file

@ -35,6 +35,18 @@ require_once NOALYSS_INCLUDE.'/class/extension.class.php';
*/
$package_repository=new Package_Repository();
$xml=$package_repository->getContent();
/*
* If xml is null , it means it was not possible to get the file , could be
* a network problem or a misconfiguration
*/
if ( $xml == NULL) {
echo '<h2 class="error">';
printf (_("Désolé , impossible de se connecter au serveur %s"),
NOALYSS_PACKAGE_REPOSITORY);
echo '</h2>';
return;
}
$a_plugin=$xml->xpath('//plugins/plugin');
$nb_plugin=count($a_plugin);

View file

@ -30,6 +30,18 @@ require_once NOALYSS_INCLUDE.'/class/extension.class.php';
$package_repository=new Package_Repository();
$xml=$package_repository->getContent();
/*
* If xml is null , it means it was not possible to get the file , could be
* a network problem or a misconfiguration
*/
if ( $xml == NULL) {
echo '<h2 class="error">';
printf (_("Désolé , impossible de se connecter au serveur %s"),
NOALYSS_PACKAGE_REPOSITORY);
echo '</h2>';
return;
}
$a_template=$xml->xpath('//database_template/dbtemplate');

View file

@ -0,0 +1,75 @@
<?php
//@description:Test of Html_Tab and Output_Html_Tab
/*
* 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 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');
$tab->set_link(http_build_query([ "a"=>1,"b"=>2]));
$tab2 = new Html_Tab('tab2',_("Titre 2"));
$tab2->set_content(""
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2"
. "<br> Très longue chaine HTML pour 2");
$tab3 = new Html_Tab('tab3',_("Titre 3"));
$tab3->set_content('<p >'
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
. "<br> Très longue chaine HTML pour 3"
.'</p>'
);
$output = new Output_Html_Tab;
$output->add($tab);
$output->add($tab2);
$output->add($tab3);
$output->output();

View file

@ -1,9 +1,55 @@
create view v_tva_rate as select
tva_id,
tva_rate,
tva_label,
tva_comment,
split_part(tva_poste,',',1) as tva_purchase,
split_part(tva_poste,',',2) as tva_sale,
tva_both_side
from tva_rate;
CREATE OR REPLACE FUNCTION comptaproc.insert_quant_purchase(p_internal text, p_j_id numeric, p_fiche character varying, p_quant numeric, p_price numeric, p_vat numeric, p_vat_code integer, p_nd_amount numeric, p_nd_tva numeric, p_nd_tva_recup numeric, p_dep_priv numeric, p_client character varying, p_tva_sided numeric, p_price_unit numeric)
RETURNS void
LANGUAGE plpgsql
AS $function$
declare
fid_client integer;
fid_good integer;
account_priv account_type;
fid_good_account account_type;
n_dep_priv numeric;
begin
n_dep_priv := p_dep_priv;
select p_value into account_priv from parm_code where p_code='DEP_PRIV';
select f_id into fid_client from
fiche_detail where ad_id=23 and ad_value=upper(trim(p_client));
select f_id into fid_good from
fiche_detail where ad_id=23 and ad_value=upper(trim(p_fiche));
select ad_value into fid_good_account from fiche_detail where ad_id=5 and f_id=fid_good;
if strpos( fid_good_account , account_priv ) = 1 then
n_dep_priv=p_price;
end if;
insert into quant_purchase
(qp_internal,
j_id,
qp_fiche,
qp_quantite,
qp_price,
qp_vat,
qp_vat_code,
qp_nd_amount,
qp_nd_tva,
qp_nd_tva_recup,
qp_supplier,
qp_dep_priv,
qp_vat_sided,
qp_unit)
values
(p_internal,
p_j_id,
fid_good,
p_quant,
p_price,
p_vat,
p_vat_code,
p_nd_amount,
p_nd_tva,
p_nd_tva_recup,
fid_client,
n_dep_priv,
p_tva_sided,
p_price_unit);
return;
end;
$function$