Merge branch 'dev7109' into entreprise
This commit is contained in:
commit
f33ff144e5
70 changed files with 2833 additions and 797 deletions
|
|
@ -86,7 +86,7 @@ set_language();
|
|||
*echo a warning if disconnected
|
||||
*/
|
||||
ajax_disconnected($_REQUEST['ctl']);
|
||||
|
||||
$http=new HttpInput();
|
||||
$cn=Dossier::connect();
|
||||
global $g_user;
|
||||
$g_user=new User($cn);
|
||||
|
|
@ -532,22 +532,40 @@ case 'scc':
|
|||
*
|
||||
*----------------------------------------------------------------------*/
|
||||
$html='';
|
||||
$invalid=0;
|
||||
if ( $g_user->check_action(FICCAT) == 1 )
|
||||
{
|
||||
$script=create_script("removeDiv('$ctl')");
|
||||
$html.=$script;
|
||||
if ( strlen(trim($_GET['nom_mod'])) != 0 )
|
||||
|
||||
$html="";
|
||||
$nom_mod=$http->get("nom_mod");
|
||||
$class_base=$http->get("class_base");
|
||||
$fd_description=$http->get("nom_mod");
|
||||
if ( strlen(trim($nom_mod)) != 0 )
|
||||
{
|
||||
$array=array("FICHE_REF"=>$cat,
|
||||
"nom_mod"=>$_GET['nom_mod'],
|
||||
"class_base"=>$_GET['class_base'],
|
||||
"fd_description"=>$_GET['fd_description']);
|
||||
"nom_mod"=>$nom_mod,
|
||||
"class_base"=>$class_base,
|
||||
"fd_description"=>$fd_description);
|
||||
|
||||
if ( isset ($_POST['create'])) $array['create']=1;
|
||||
|
||||
$catcard=new Fiche_Def($cn);
|
||||
if ( $catcard->Add($array) == -1)
|
||||
|
||||
ob_start();
|
||||
$result=$catcard->Add($array);
|
||||
|
||||
$html.=ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
if ( $result == 1)
|
||||
{
|
||||
$script="alert_box('"._('Catégorie existe déjà')."')";
|
||||
else
|
||||
$script="alert_box('"._('Catégorie sauvée')."')";
|
||||
$invalid=1;
|
||||
}
|
||||
else{
|
||||
$script="alert_box('"._('Catégorie sauvée')."');removeDiv('$ctl')";
|
||||
}
|
||||
|
||||
$html.=create_script($script);
|
||||
}
|
||||
else
|
||||
|
|
@ -561,6 +579,10 @@ case 'scc':
|
|||
else
|
||||
{
|
||||
$html=alert(_('Action interdite'),true);
|
||||
$invalid=1;
|
||||
}
|
||||
if ($invalid == 1) {
|
||||
$ctl="info_div";
|
||||
}
|
||||
break;
|
||||
case 'upc':
|
||||
|
|
|
|||
71
include/ajax/ajax_payment_method.php
Normal file
71
include/ajax/ajax_payment_method.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of NOALYSS.
|
||||
*
|
||||
* PhpCompta is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpCompta is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with PhpCompta; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
|
||||
|
||||
if (!defined('ALLOWED'))
|
||||
die('Appel direct ne sont pas permis');
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Manage the payement method, existing variable (from ajax_misc.php)
|
||||
* - $http
|
||||
* - $gDossier
|
||||
* - $cn
|
||||
*
|
||||
* @see Payment_Method_SQL
|
||||
* @see Payment_Method_MTable
|
||||
*
|
||||
*/
|
||||
require_once NOALYSS_INCLUDE."/database/payment_method_sql.class.php";
|
||||
require_once NOALYSS_INCLUDE."/class/payment_method_mtable.class.php";
|
||||
|
||||
$id=$http->request("p_id", "number", -1);
|
||||
$action=$http->request("action");
|
||||
$ctl=$http->request("ctl");
|
||||
|
||||
$payment_method_sql=new Payment_method_SQL($cn, $id);
|
||||
$payment_method_mtable=new Payment_Method_MTable($payment_method_sql);
|
||||
|
||||
$payment_method_mtable->add_json_param("op", "payment_method");
|
||||
$payment_method_mtable->set_callback("ajax_misc.php");
|
||||
$payment_method_mtable->set_object_name($ctl);
|
||||
|
||||
// Display a form for modifying or adding an element
|
||||
if ($action=="input")
|
||||
{
|
||||
$payment_method_mtable->send_header();
|
||||
echo $payment_method_mtable->ajax_input()->saveXML();
|
||||
return;
|
||||
}
|
||||
// Save it
|
||||
elseif ($action=="save")
|
||||
{
|
||||
$xml=$payment_method_mtable->ajax_save();
|
||||
$payment_method_mtable->send_header();
|
||||
echo $xml->saveXML();
|
||||
return;
|
||||
}
|
||||
// delete the row
|
||||
elseif ($action=="delete")
|
||||
{
|
||||
$payment_method_mtable->send_header();
|
||||
echo $payment_method_mtable->ajax_delete()->saveXML();
|
||||
return;
|
||||
}
|
||||
|
|
@ -28,26 +28,24 @@ require_once NOALYSS_INCLUDE.'/lib/iperiod.class.php';
|
|||
require_once NOALYSS_INCLUDE.'/class/acc_report.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/class/periode.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/class/exercice.class.php';
|
||||
echo HtmlInput::title_box(_('Préférence'), 'preference_div');
|
||||
echo '<DIV class="content">';
|
||||
echo '<p class="notice">';
|
||||
echo _("Si vous validez, la page sera rechargée et vous pourriez perdre ce que vous faisiez");
|
||||
echo '</p>';
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
|
||||
|
||||
|
||||
global $g_user;
|
||||
|
||||
$g_user=new User($cn);
|
||||
$inside_dossier = false;
|
||||
$http=new HttpInput();
|
||||
$action=$http->post("action","string","display_form");
|
||||
|
||||
if (isset($_REQUEST['gDossier']) && $_REQUEST['gDossier']<>0)
|
||||
if (isset($_REQUEST['gDossier']) && $http->request("gDossier","number",0) != 0 )
|
||||
{
|
||||
$g_user->load_global_pref();
|
||||
$msg = "";
|
||||
$cn =Dossier::connect();
|
||||
$g_user->cn = $cn;
|
||||
$inside_dossier = true;
|
||||
$local_pref=$g_user->get_preference();
|
||||
$g_user->load_global_pref();
|
||||
$msg = "";
|
||||
$cn =Dossier::connect();
|
||||
$g_user->cn = $cn;
|
||||
$inside_dossier = true;
|
||||
$local_pref=$g_user->get_preference();
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Theme
|
||||
|
|
@ -62,11 +60,24 @@ if (isset($_REQUEST['gDossier']) && $_REQUEST['gDossier']<>0)
|
|||
from theme
|
||||
order by the_name");
|
||||
$style->selected =$_SESSION['g_theme'];
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
// Display the form
|
||||
//----------------------------------------------------------------------------------------------
|
||||
if ( $action == 'display_form' )
|
||||
{
|
||||
echo HtmlInput::title_box(_('Préférence'), 'preference_div');
|
||||
echo '<DIV class="content">';
|
||||
echo '<p class="notice">';
|
||||
echo _("Après validation, recharger si vous changez la langue");
|
||||
echo '</p>';
|
||||
//----------------------------------------------------------------------
|
||||
//
|
||||
?>
|
||||
|
||||
<div class="content" >
|
||||
|
||||
<FORM METHOD="POST">
|
||||
<FORM METHOD="POST" onsubmit="updatePreference();return false;" id="preference_frm">
|
||||
<fieldset style="margin: 1%"><legend><?php echo _('Options Générales')?></legend>
|
||||
<table>
|
||||
<tr>
|
||||
|
|
@ -272,3 +283,55 @@ if (isset($_REQUEST['gDossier']) && $_REQUEST['gDossier']<>0)
|
|||
|
||||
echo "</DIV>";
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// Save the form
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
if ($action == 'save')
|
||||
{
|
||||
//// Save value
|
||||
$style_user=$http->post("style_user","string","Classique");
|
||||
$lang=$http->post("lang","string","fr_FR.utf8");
|
||||
$p_size=$http->post("p_size","number",50);
|
||||
$pass_1=$http->post("pass_1","string","");
|
||||
$pass_2=$http->post("pass_2","string","");
|
||||
$p_email=$http->post("p_email","string","");
|
||||
$csv_fieldsep=$http->post("csv_fieldsep","number");
|
||||
$csv_decimal=$http->post("csv_decimal","number");
|
||||
$csv_encoding=$http->post("csv_encoding");
|
||||
|
||||
if (strlen(trim($pass_1)) != 0 && strlen(trim($pass_2)) != 0)
|
||||
{
|
||||
$g_user->save_password($pass_1,$pass_2);
|
||||
|
||||
}
|
||||
if ( $inside_dossier)
|
||||
{
|
||||
$minirap=$http->post("minirap","number","0");
|
||||
$period=$http->post("period","number");
|
||||
$g_user->set_periode($period);
|
||||
$g_user->set_mini_report($minirap);
|
||||
}
|
||||
$g_user->save_global_preference('THEME', $style_user);
|
||||
$g_user->save_global_preference('LANG', $lang);
|
||||
$g_user->save_global_preference('PAGESIZE', $p_size);
|
||||
$g_user->save_global_preference('csv_fieldsep', $csv_fieldsep);
|
||||
$g_user->save_global_preference('csv_decimal', $csv_decimal);
|
||||
$g_user->save_global_preference('csv_encoding', $csv_encoding);
|
||||
$g_user->save_email($p_email);
|
||||
|
||||
$_SESSION['g_theme']=$style_user;
|
||||
$_SESSION['g_pagesize']=$p_size;
|
||||
$_SESSION['g_lang']=$lang;
|
||||
|
||||
// find the right CSS theme
|
||||
$style= $repo->get_value("select the_filestyle from theme
|
||||
where the_name=$1" ,[$style_user]);
|
||||
if ($style == "")
|
||||
{
|
||||
$style = "style-classic7.css";
|
||||
}
|
||||
json_response(["style"=>$style]);
|
||||
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ if ($ac == 'save')
|
|||
|
||||
$cn=Dossier::connect();
|
||||
$todo=new Todo_List($cn);
|
||||
$id=$http->get("id","string", 0);
|
||||
$id=$http->post("id","string", 0);
|
||||
$todo->set_parameter("id",$id);
|
||||
if ($id <> 0 ) { $todo->load(); }
|
||||
else
|
||||
|
|
@ -105,10 +105,10 @@ if ($ac == 'save')
|
|||
$todo->set_parameter("owner", $_SESSION['g_user']);
|
||||
}
|
||||
|
||||
$todo->set_parameter("date",$http->get("p_date_todo","string", ""));
|
||||
$todo->set_parameter("title", $http->get("p_title","string", ""));
|
||||
$todo->set_parameter("desc", $http->get("p_desc","string", ""));
|
||||
$todo->set_is_public($http->get("p_public", "string","N"));
|
||||
$todo->set_parameter("date",$http->post("p_date_todo","string", ""));
|
||||
$todo->set_parameter("title", $http->post("p_title","string", ""));
|
||||
$todo->set_parameter("desc", $http->post("p_desc","string", ""));
|
||||
$todo->set_is_public($http->post("p_public", "string","N"));
|
||||
|
||||
ob_start();
|
||||
if ( $todo->get_parameter('owner') == $_SESSION['g_user'] ) $todo->save();
|
||||
|
|
|
|||
|
|
@ -28,8 +28,10 @@ require_once NOALYSS_INCLUDE."/class/acc_ledger_history_generic.class.php";
|
|||
require_once NOALYSS_INCLUDE."/class/acc_ledger_history_sale.class.php";
|
||||
require_once NOALYSS_INCLUDE."/class/acc_ledger_history_purchase.class.php";
|
||||
require_once NOALYSS_INCLUDE."/class/acc_ledger_history_financial.class.php";
|
||||
require_once NOALYSS_INCLUDE."/class/prepared_query.class.php";
|
||||
/**
|
||||
* @brief Display history of operation
|
||||
* @see acc_ledger_historyTest.php
|
||||
*/
|
||||
abstract class Acc_Ledger_History
|
||||
{
|
||||
|
|
@ -240,32 +242,19 @@ abstract class Acc_Ledger_History
|
|||
return $tiers;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepare the query for fetching the linked operation
|
||||
* @staticvar int $prepare
|
||||
*/
|
||||
protected function prepare_reconcile_date()
|
||||
{
|
||||
$prepare=$this->db->is_prepare("reconcile_date");
|
||||
if ($prepare==FALSE)
|
||||
{
|
||||
$this->db->prepare('reconcile_date',
|
||||
'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)');
|
||||
static $not_done=TRUE;
|
||||
if ($not_done ) {
|
||||
$prepare_query = new Prepared_Query($this->db);
|
||||
$prepare_query->prepare_reconcile_date();
|
||||
}
|
||||
$not_done=FALSE;
|
||||
}
|
||||
/**
|
||||
* display accounting of operations m_mode=A
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ class Acc_Ledger_History_Financial extends Acc_Ledger_History
|
|||
public function export_oneline_html()
|
||||
{
|
||||
$this->get_row();
|
||||
|
||||
$this->prepare_reconcile_date();
|
||||
require_once NOALYSS_TEMPLATE.'/acc_ledger_history_financial_oneline.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ require_once NOALYSS_INCLUDE."/class/acc_ledger_history.class.php";
|
|||
|
||||
/**
|
||||
* @brief Display the operations for Purchase
|
||||
* @see acc_ledger_historyTest.php
|
||||
*/
|
||||
class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
||||
{
|
||||
|
|
@ -251,6 +252,10 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
|||
}
|
||||
function export_csv()
|
||||
{
|
||||
// Prepare the query for reconcile date
|
||||
$prepared_query=new Prepared_Query($this->db);
|
||||
$prepared_query->prepare_reconcile_date();
|
||||
|
||||
$export=new Noalyss_Csv(_('journal'));
|
||||
$export->send_header();
|
||||
|
||||
|
|
@ -273,6 +278,7 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
|||
$title[]=_("tva non ded.");
|
||||
$title[]=_("TVA NP");
|
||||
|
||||
|
||||
|
||||
if ( $own->MY_TVA_USE=='Y')
|
||||
{
|
||||
|
|
@ -288,7 +294,10 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
|||
$title[]=_("Devise TVA");
|
||||
$title[]=_("Taux ref");
|
||||
$title[]=_("Taux utilisé");
|
||||
$title[]=_("opérations liées");
|
||||
$title[]=_("Date paiement");
|
||||
$title[]=_("Méthode paiement");
|
||||
$title[]=_("Montant paiement");
|
||||
$title[]=_("n° opération");
|
||||
$export->write_header($title);
|
||||
|
||||
foreach ($this->data as $line)
|
||||
|
|
@ -309,22 +318,24 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
|||
$export->add($line['tva_sided'],"number");
|
||||
|
||||
$a_tva_amount=array();
|
||||
//- set all TVA to 0
|
||||
foreach ($a_Tva as $l) {
|
||||
$t_id=$l["tva_id"];
|
||||
$a_tva_amount[$t_id]=0;
|
||||
}
|
||||
foreach ($line['detail_vat'] as $lineTVA)
|
||||
{
|
||||
$idx_tva=$lineTVA['qp_vat_code'];
|
||||
$a_tva_amount[$idx_tva]=$lineTVA['vat_amount'];
|
||||
}
|
||||
if ($own->MY_TVA_USE == 'Y' )
|
||||
if ($own->MY_TVA_USE=='Y')
|
||||
{
|
||||
//- set all TVA to 0
|
||||
foreach ($a_Tva as $l)
|
||||
{
|
||||
$t_id=$l["tva_id"];
|
||||
$a_tva_amount[$t_id]=0;
|
||||
}
|
||||
foreach ($line['detail_vat'] as $lineTVA)
|
||||
{
|
||||
$idx_tva=$lineTVA['qp_vat_code'];
|
||||
$a_tva_amount[$idx_tva]=$lineTVA['vat_amount'];
|
||||
}
|
||||
|
||||
foreach ($a_Tva as $line_tva)
|
||||
{
|
||||
$a=$line_tva['tva_id'];
|
||||
$export->add($a_tva_amount[$a],"number");
|
||||
$export->add($a_tva_amount[$a], "number");
|
||||
}
|
||||
}
|
||||
$export->add($line['tvac'],"number");
|
||||
|
|
@ -346,6 +357,8 @@ class Acc_Ledger_History_Purchase extends Acc_Ledger_History
|
|||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
$export->add($row['jr_date']);
|
||||
$export->add($row['qcode_bank']);
|
||||
$export->add($row['jr_montant'],"number");
|
||||
$export->add($row['jr_internal']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,7 +282,11 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
|
|||
$title[]=_("Devise TVA");
|
||||
$title[]=_("Taux ref");
|
||||
$title[]=_("Taux utilisé");
|
||||
$title[]=_("opérations liées");
|
||||
$title[]=_("Date paiement");
|
||||
$title[]=_("Méthode paiement");
|
||||
$title[]=_("Montant paiement");
|
||||
$title[]=_("n° opération");
|
||||
|
||||
$export->write_header($title);
|
||||
|
||||
foreach ($this->data as $line)
|
||||
|
|
@ -301,18 +305,19 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
|
|||
$export->add($line['tva_sided'],"number");
|
||||
|
||||
$a_tva_amount=array();
|
||||
//- set all TVA to 0
|
||||
foreach ($a_Tva as $l) {
|
||||
$t_id=$l["tva_id"];
|
||||
$a_tva_amount[$t_id]=0;
|
||||
}
|
||||
foreach ($line['detail_vat'] as $lineTVA)
|
||||
{
|
||||
$idx_tva=$lineTVA['qs_vat_code'];
|
||||
$a_tva_amount[$idx_tva]=$lineTVA['vat_amount'];
|
||||
}
|
||||
|
||||
if ($own->MY_TVA_USE == 'Y' )
|
||||
{
|
||||
//- set all TVA to 0
|
||||
foreach ($a_Tva as $l) {
|
||||
$t_id=$l["tva_id"];
|
||||
$a_tva_amount[$t_id]=0;
|
||||
}
|
||||
foreach ($line['detail_vat'] as $lineTVA)
|
||||
{
|
||||
$idx_tva=$lineTVA['qs_vat_code'];
|
||||
$a_tva_amount[$idx_tva]=$lineTVA['vat_amount'];
|
||||
}
|
||||
foreach ($a_Tva as $line_tva)
|
||||
{
|
||||
$a=$line_tva['tva_id'];
|
||||
|
|
@ -338,7 +343,10 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
|
|||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
$export->add($row['jr_date']);
|
||||
$export->add($row['qcode_bank']);
|
||||
$export->add($row['jr_montant'],"number");
|
||||
$export->add($row['jr_internal']);
|
||||
|
||||
}
|
||||
}
|
||||
$export->write();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
// Copyright Author Dany De Bontridder danydb@aevalys.eu
|
||||
|
||||
/*!\file
|
||||
* \brief Handle the table mod_payment
|
||||
* \brief Handle the table payment_method
|
||||
*/
|
||||
require_once NOALYSS_INCLUDE.'/lib/iselect.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/icard.class.php';
|
||||
|
|
@ -31,7 +31,7 @@ require_once NOALYSS_INCLUDE.'/class/fiche_def.class.php';
|
|||
require_once NOALYSS_INCLUDE.'/constant.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
|
||||
|
||||
/*!\brief Handle the table mod_payment
|
||||
/*!\brief Handle the table payment_method
|
||||
*\note the private data member are accessed via
|
||||
- mp_id ==> id ( Primary key )
|
||||
- mp_lib ==> lib (label)
|
||||
|
|
@ -90,74 +90,10 @@ class Acc_Payment
|
|||
{
|
||||
return var_export(self::$variable,true);
|
||||
}
|
||||
public function verify()
|
||||
{
|
||||
// Verify that the elt we want to add is correct
|
||||
}
|
||||
public function save()
|
||||
{
|
||||
/* please adapt */
|
||||
if ( $this->get_parameter("id") == 0 )
|
||||
$this->insert();
|
||||
else
|
||||
$this->update();
|
||||
}
|
||||
|
||||
public function insert()
|
||||
{
|
||||
if ( $this->verify() != 0 ) return;
|
||||
$sql='INSERT INTO mod_payment(
|
||||
mp_lib, mp_jrn_def_id, mp_fd_id, mp_qcode,jrn_def_id)
|
||||
VALUES ($1, $2, $3, upper($4),$5) returning mp_id';
|
||||
$this->mp_id=$this->cn->exec_sql($sql,array(
|
||||
$this->mp_lib,
|
||||
$this->mp_jrn_def_id,
|
||||
$this->mp_fd_id,
|
||||
$this->mp_qcode,
|
||||
$this->jrn_def_id));
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
if ( $this->verify() != 0 ) return;
|
||||
|
||||
$sql="update mod_payment set mp_lib=$1,mp_qcode=$2,mp_jrn_def_id=$3,mp_fd_id=$4,jrn_def_id=$5 ".
|
||||
" where mp_id = $6";
|
||||
$res=$this->cn->exec_sql(
|
||||
$sql,
|
||||
array($this->mp_lib,
|
||||
$this->mp_qcode,
|
||||
$this->mp_jrn_def_id,
|
||||
$this->mp_fd_id,
|
||||
$this->jrn_def_id,
|
||||
$this->mp_id)
|
||||
);
|
||||
if ( strlen (trim($this->mp_jrn_def_id))==0)
|
||||
$this->cn->exec_sql(
|
||||
'update mod_payment '.
|
||||
'set mp_jrn_def_id = null where mp_id=$1',
|
||||
array($this->mp_id));
|
||||
if ( strlen (trim($this->jrn_def_id))==0)
|
||||
$this->cn->exec_sql(
|
||||
'update mod_payment '.
|
||||
'set mp_jrn_def_id = null where mp_id=$1',
|
||||
array($this->mp_id));
|
||||
if ( strlen (trim($this->mp_qcode))==0)
|
||||
$this->cn->exec_sql(
|
||||
'update mod_payment '.
|
||||
'set mp_qcode = null where mp_id=$1',
|
||||
array($this->mp_id));
|
||||
if ( strlen (trim($this->mp_fd_id))==0)
|
||||
$this->cn->exec_sql(
|
||||
'update mod_payment '.
|
||||
'set mp_fd_id = null where mp_id=$1',
|
||||
array($this->mp_id));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function load()
|
||||
{
|
||||
$sql='select mp_id,mp_lib,mp_fd_id,mp_jrn_def_id,mp_qcode,jrn_def_id from mod_payment '.
|
||||
$sql='select mp_id,mp_lib,mp_fd_id,mp_jrn_def_id,mp_qcode,jrn_def_id from payment_method '.
|
||||
' where mp_id = $1';
|
||||
$res=$this->cn->exec_sql(
|
||||
$sql,
|
||||
|
|
@ -172,14 +108,7 @@ class Acc_Payment
|
|||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*@brief remove a middle of payment
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$sql="delete from mod_payment where mp_id=$1";
|
||||
$this->cn->exec_sql($sql,array($this->mp_id));
|
||||
}
|
||||
|
||||
/*!\brief retrieve all the data for all ledgers
|
||||
*\param non
|
||||
*\return an array of row
|
||||
|
|
@ -187,7 +116,7 @@ class Acc_Payment
|
|||
public function get_all()
|
||||
{
|
||||
$sql='select mp_id,mp_lib '.
|
||||
' from mod_payment order by mp_lib';
|
||||
' from payment_method order by mp_lib';
|
||||
$array=$this->cn->get_array($sql);
|
||||
$ret=array();
|
||||
if ( !empty($array) )
|
||||
|
|
@ -209,7 +138,7 @@ class Acc_Payment
|
|||
public function get_valide()
|
||||
{
|
||||
$sql='select mp_id '.
|
||||
' from mod_payment '.
|
||||
' from payment_method '.
|
||||
' where jrn_def_id=$1 and mp_jrn_def_id is not null and '.
|
||||
' (mp_fd_id is not null or mp_qcode is not null)';
|
||||
$array=$this->cn->get_array($sql,array($this->jrn_def_id));
|
||||
|
|
@ -338,7 +267,7 @@ class Acc_Payment
|
|||
}
|
||||
$s=new ISpan();
|
||||
$s->name=$a->name.'_label';
|
||||
$f=_(" paiement par ").$a->input().$s->input();
|
||||
$f=_(" paiement par ").$a->input().$s->input().$a->search();
|
||||
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ $order
|
|||
$count=$this->cn->get_value($sql,array(trim($p_nom_mod)));
|
||||
|
||||
if ($count != 0 ) {
|
||||
echo alert (_('Catégorie existante'));
|
||||
alert (_('Catégorie existante'));
|
||||
return 1;
|
||||
}
|
||||
// Set the value of fiche_def.fd_create_account
|
||||
|
|
|
|||
144
include/class/payment_method_mtable.class.php
Normal file
144
include/class/payment_method_mtable.class.php
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of NOALYSS.
|
||||
*
|
||||
* PhpCompta is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpCompta is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with PhpCompta; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
* @see Payment_Method_SQL
|
||||
* @see ajax_payment_method.php
|
||||
*/
|
||||
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
|
||||
|
||||
class Payment_Method_MTable extends Manage_Table_SQL
|
||||
{
|
||||
|
||||
function __construct(\Data_SQL $p_table)
|
||||
{
|
||||
parent::__construct($p_table);
|
||||
|
||||
// Column header
|
||||
$this->set_col_label("mp_lib", _("Libellé"));
|
||||
$this->set_col_label("mp_jrn_def_id", _("Enregistrement dans"));
|
||||
$this->set_col_label("mp_fd_id", _("Type de fiche"));
|
||||
$this->set_col_label("mp_qcode", _("Fiche"));
|
||||
$this->set_col_label("jrn_def_id", _("Utilisation dans"));
|
||||
// Hide id
|
||||
$this->set_property_visible("mp_id", FALSE);
|
||||
$this->icon_mod="right";
|
||||
|
||||
// Set value for col
|
||||
$this->set_col_type("mp_qcode","custom");
|
||||
$this->set_col_type("mp_jrn_def_id", "select",
|
||||
$p_table->cn->make_array("select jrn_def_id,jrn_def_name from jrn_def where jrn_def_type in ('FIN','ODS') and jrn_enable=1 order by 2",1));
|
||||
$this->set_col_type("mp_fd_id", "select",
|
||||
$p_table->cn->make_array("select fd_id,fd_label from fiche_def order by 2",1));
|
||||
$this->set_col_type("jrn_def_id", "select",
|
||||
$p_table->cn->make_array("select jrn_def_id,jrn_def_name from jrn_def where jrn_def_type in ('ACH','VEN') and jrn_enable=1 order by 2",1));
|
||||
$this->set_col_tips("mp_fd_id", 71);
|
||||
$this->set_col_tips("mp_qcode", 72);
|
||||
$this->set_order(["mp_lib","jrn_def_id","mp_jrn_def_id","mp_fd_id","mp_qcode"]);
|
||||
|
||||
}
|
||||
|
||||
function check()
|
||||
{
|
||||
$table=$this->get_table();
|
||||
$cn=$table->cn;
|
||||
$has_error=0;
|
||||
|
||||
if ( trim($table->mp_lib) == "") {
|
||||
$this->set_error("mp_lib", _("Un libellé est obligatoire"));
|
||||
$has_error++;
|
||||
}
|
||||
$count_ledger_target=0;
|
||||
if ( trim($table->mp_jrn_def_id) !="") {
|
||||
$count_ledger_target=$cn->get_value("select count(*) from jrn_def where jrn_def_id=$1",[$table->mp_jrn_def_id]);
|
||||
|
||||
}
|
||||
if ($count_ledger_target == 0 ) {
|
||||
$this->set_error("mp_jrn_def_id", _("Choisissez un journal"));
|
||||
$has_error++;
|
||||
}
|
||||
|
||||
$count_ledger_used=0;
|
||||
if ( trim($table->jrn_def_id) != "") {
|
||||
$count_ledger_used=$cn->get_value("select count(*) from jrn_def where jrn_def_id=$1",[$table->jrn_def_id]);
|
||||
}
|
||||
|
||||
if ($count_ledger_used == 0) {
|
||||
$this->set_error("jrn_def_id", _("Choisissez un journal"));
|
||||
$has_error++;
|
||||
}
|
||||
// if the ledger is financial, the qcode MUST be the default one
|
||||
if ( trim($table->mp_lib) == "") {
|
||||
$this->set_error("mp_lib", _("Un libellé est obligatoire"));
|
||||
$has_error++;
|
||||
}
|
||||
if (trim ($table->mp_qcode) != "" && $a_row['jrn_def_type'] != 'FIN') {
|
||||
$fiche=new Fiche($cn);
|
||||
if ( $fiche->get_by_qcode($table->mp_qcode,FALSE) == 1) {
|
||||
$this->set_error("mp_qcode",_("Fiche inexistante"));
|
||||
$has_error++;
|
||||
}
|
||||
}
|
||||
// get the type of the ledger
|
||||
$a_row= $cn->get_row("select jrn_def_type,jrn_def_bank from jrn_def where jrn_def_id = $1",[$table->mp_jrn_def_id]);
|
||||
|
||||
// if ledger FIN then set the mp_qcode to the right card and set mp_fd_id to the same than mp_qcode
|
||||
if ( $a_row['jrn_def_type'] == 'FIN') {
|
||||
$fiche=new Fiche($cn,$a_row['jrn_def_bank']);
|
||||
$table->mp_qcode=$fiche->get_quick_code();
|
||||
$table->mp_fd_id=$cn->get_value("select fd_id from fiche where f_id=$1",[$a_row['jrn_def_bank']]);
|
||||
}
|
||||
|
||||
|
||||
if ( $a_row['jrn_def_type'] != 'FIN' && $table->mp_fd_id == -1)
|
||||
{
|
||||
$this->set_error("mp_fd_id",_("Choisissez un type de fiche"));
|
||||
$has_error++;
|
||||
}
|
||||
if ( $has_error > 0) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
/**
|
||||
* For the quickcode
|
||||
* @param type $p_key
|
||||
* @param type $p_value
|
||||
*/
|
||||
function input_custom($p_key,$p_value)
|
||||
{
|
||||
$cn=$this->get_table()->cn;
|
||||
switch ($p_key)
|
||||
{
|
||||
case "mp_qcode":
|
||||
$w=new ICard("mp_qcode",$p_value);
|
||||
$w->set_attribute("typecard", "all");
|
||||
$w->autocomplete=0;
|
||||
|
||||
echo $w->input();
|
||||
echo $w->search();
|
||||
break;
|
||||
default:
|
||||
printf (_("Erreur key %s value %s"),$p_key,$p_value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ class Pre_operation
|
|||
$this->detail=new Pre_op_advanced($this->db);
|
||||
break;
|
||||
default:
|
||||
throw new Exception('Load PreOperatoin failed'.$this->od_jrn_type);
|
||||
throw new Exception(sprintf(_('Echec PreOperatoin chargement %s'),$this->od_jrn_type));
|
||||
}
|
||||
$this->detail->set_od_id($this->od_id);
|
||||
$this->detail->jrn_def_id=$this->jrn_def_id;
|
||||
|
|
|
|||
83
include/class/prepared_query.class.php
Normal file
83
include/class/prepared_query.class.php
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 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 contains prepared query used in different classes of the application
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Prepared_Query {
|
||||
private $db; //!< Database connection
|
||||
|
||||
function __construct(Database $cn)
|
||||
{
|
||||
$this->db=$cn;
|
||||
}
|
||||
|
||||
public function get_db()
|
||||
{
|
||||
return $this->db;
|
||||
}
|
||||
|
||||
public function set_db($db)
|
||||
{
|
||||
$this->db=$db;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the query for fetching the linked operation. ONE paramete is needed : jrn.jr_id , returns all columns
|
||||
* from the table PUBLIC.JRN, column qcode_bank (default card for fin ledger) of the operation concerning
|
||||
* to the payment
|
||||
*
|
||||
* @see export_ledger_pdf.php
|
||||
* @see Acc_Ledger_History
|
||||
*
|
||||
*/
|
||||
public function prepare_reconcile_date()
|
||||
{
|
||||
$prepare=$this->db->is_prepare("reconcile_date");
|
||||
if ($prepare==FALSE)
|
||||
{
|
||||
$this->db->prepare('reconcile_date',
|
||||
'select *
|
||||
, (select ad_value from fiche_detail where ad_id=23 and f_id=jrn_def.jrn_def_bank ) as qcode_bank
|
||||
from
|
||||
jrn
|
||||
join jrn_def on (jrn.jr_def_id=jrn_def.jrn_def_id)
|
||||
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)');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -149,7 +149,6 @@ class Print_Ledger {
|
|||
{
|
||||
$pdf=new Print_Ledger_Detail($cn, $p_ledger);
|
||||
return $pdf;
|
||||
;
|
||||
}
|
||||
if ($jrn_type=='ODS'||$p_ledger->id==0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -90,21 +90,25 @@ class Print_Ledger_Detail_Item extends PDFLand
|
|||
{
|
||||
bcscale(2);
|
||||
$jrn_type=$this->ledger->get_type();
|
||||
$http=new HttpInput();
|
||||
switch ($jrn_type)
|
||||
{
|
||||
case 'VEN':
|
||||
$ledger=new Acc_Ledger_Sold($this->cn, $this->ledger->jrn_def_id);
|
||||
$ret_detail=$ledger->get_detail_sale($_GET['from_periode'],$_GET['to_periode']);
|
||||
$ret_detail=$ledger->get_detail_sale($http->get('from_periode','number'),$http->get('to_periode','number'));
|
||||
break;
|
||||
case 'ACH':
|
||||
$ledger=new Acc_Ledger_Purchase($this->cn, $this->ledger->jrn_def_id);
|
||||
$ret_detail=$ledger->get_detail_purchase($_GET['from_periode'],$_GET['to_periode']);
|
||||
$ret_detail=$ledger->get_detail_purchase($http->get('from_periode','number'),$http->get('to_periode','number'));
|
||||
break;
|
||||
default:
|
||||
die (__FILE__.":".__LINE__.'Journal invalide');
|
||||
break;
|
||||
}
|
||||
if ( $ret_detail == null ) return;
|
||||
$prepared_query=new Prepared_Query($this->ledger->db);
|
||||
$prepared_query->prepare_reconcile_date();
|
||||
|
||||
$nb=Database::num_row($ret_detail);
|
||||
$this->SetFont('DejaVu', '', 6);
|
||||
$internal="";
|
||||
|
|
@ -130,20 +134,35 @@ class Print_Ledger_Detail_Item extends PDFLand
|
|||
$this->write_cell(20, $high, nbm($sum), 1, 0, 'R', true);
|
||||
$internal=$row['jr_internal'];
|
||||
$this->line_new(6);
|
||||
// on the first line, the code for each column is displaid
|
||||
// Payment info
|
||||
// Prepare the query for reconcile date
|
||||
$ret_reconcile=$this->ledger->db->execute('reconcile_date', array($row['jr_id']));
|
||||
$max=Database::num_row($ret_reconcile);
|
||||
for ($e=0; $e<$max; $e++)
|
||||
{
|
||||
$ret_row=Database::fetch_array($ret_reconcile, $e);
|
||||
$msg=( $ret_row['qcode_bank']!="")?"[".$ret_row['qcode_bank']."]":$ret_row['jr_internal'];
|
||||
$this->write_cell(200, $high,
|
||||
sprintf(_("Paiement montant %s date %s methoded %s "), $ret_row['jr_montant'],
|
||||
$ret_row['jr_date'], $msg
|
||||
));
|
||||
$this->line_new(6);
|
||||
}
|
||||
// on the first line, the code for each column is displaid
|
||||
if ( $this->show_col == true ) {
|
||||
//
|
||||
|
||||
|
||||
// Header detail
|
||||
$this->LongLine(30,$high,'QuickCode');
|
||||
$this->write_cell(30,$high,'Poste');
|
||||
$this->LongLine(70,$high,'Libellé');
|
||||
$this->write_cell(20,$high,'Prix/Unit',0,0,'R');
|
||||
$this->write_cell(20,$high,'Quant.',0,0,'R');
|
||||
$this->write_cell(20,$high,'HTVA',0,0,'R');
|
||||
$this->write_cell(20,$high,'TVA NP',0,0,'R');
|
||||
$this->write_cell(20,$high,'Code TVA');
|
||||
$this->write_cell(20,$high,'TVA',0,0,'R');
|
||||
$this->write_cell(20,$high,'TVAC',0,0,'R');
|
||||
$this->LongLine(30,$high,_('QuickCode'));
|
||||
$this->write_cell(30,$high,_('Poste'));
|
||||
$this->LongLine(70,$high,_('Libellé'));
|
||||
$this->write_cell(20,$high,_('Prix/Unit'),0,0,'R');
|
||||
$this->write_cell(20,$high,_('Quant.'),0,0,'R');
|
||||
$this->write_cell(20,$high,_('HTVA'),0,0,'R');
|
||||
$this->write_cell(20,$high,_('TVA NP'),0,0,'R');
|
||||
$this->write_cell(20,$high,_('Code TVA'));
|
||||
$this->write_cell(20,$high,_('TVA'),0,0,'R');
|
||||
$this->write_cell(20,$high,_('TVAC'),0,0,'R');
|
||||
$this->line_new(6);
|
||||
$this->show_col=false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,12 +24,14 @@
|
|||
* of any ledgers
|
||||
*/
|
||||
require_once NOALYSS_INCLUDE.'/class/pdf.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
|
||||
|
||||
class Print_Ledger_Simple extends PDF
|
||||
{
|
||||
public function __construct ($p_cn, Acc_Ledger $p_jrn)
|
||||
{
|
||||
|
||||
$http=new HttpInput();
|
||||
if($p_cn == null) die("No database connection. Abort.");
|
||||
|
||||
parent::__construct($p_cn,'L', 'mm', 'A4');
|
||||
|
|
@ -48,7 +50,8 @@ class Print_Ledger_Simple extends PDF
|
|||
* get rappel to initialize amount rap_xx
|
||||
*the easiest way is to compute sum from quant_
|
||||
*/
|
||||
$this->previous=$this->ledger->previous_amount($_GET['from_periode']);
|
||||
$from_periode=$http->get('from_periode',"number");
|
||||
$this->previous=$this->ledger->previous_amount($from_periode);
|
||||
|
||||
/* initialize the amount to report */
|
||||
foreach($this->previous['tva'] as $line_tva)
|
||||
|
|
@ -93,24 +96,24 @@ class Print_Ledger_Simple extends PDF
|
|||
$tmp1=$line_tva['tva_id'];
|
||||
$this->rap_tva[$tmp1]=(isset($this->rap_tva[$tmp1]))?$this->rap_tva[$tmp1]:0;
|
||||
}
|
||||
$this->Cell(15,6,'Pièce');
|
||||
$this->Cell(10,6,'Date');
|
||||
$this->Cell(13,6,'ref');
|
||||
$this->Cell(15,6,_('Pièce'));
|
||||
$this->Cell(10,6,_('Date'));
|
||||
$this->Cell(13,6,_('ref'));
|
||||
if ( $this->jrn_type=='ACH')
|
||||
$this->Cell(40,6,'Client');
|
||||
$this->Cell(40,6,_('Client'));
|
||||
else
|
||||
$this->Cell(40,6,'Fournisseur');
|
||||
$this->Cell(40,6,_('Fournisseur'));
|
||||
|
||||
$flag_tva=(count($this->a_Tva) > 4)?true:false;
|
||||
if ( !$flag_tva ) $this->Cell(65,6,'Description');
|
||||
if ( !$flag_tva ) $this->Cell(65,6,_('Description'));
|
||||
|
||||
$this->Cell(15,6,'HTVA',0,0,'R');
|
||||
$this->Cell(15,6,_('HTVA'),0,0,'R');
|
||||
if ( $this->jrn_type=='ACH')
|
||||
{
|
||||
$this->Cell(15,6,'Priv/DNA',0,0,'R');
|
||||
$this->Cell(15,6,'TVA ND',0,0,'R');
|
||||
$this->Cell(15,6,_('Priv/DNA'),0,0,'R');
|
||||
$this->Cell(15,6,_('TVA ND'),0,0,'R');
|
||||
}
|
||||
$this->Cell(15,6,'TVA NP',0,0,'R'); // Unpaid TVA --> autoliquidation, NPR
|
||||
$this->Cell(15,6,_('TVA NP'),0,0,'R'); // Unpaid TVA --> autoliquidation, NPR
|
||||
foreach($this->a_Tva as $line_tva)
|
||||
{
|
||||
$this->Cell(15,6,$line_tva['tva_label'],0,0,'R');
|
||||
|
|
@ -203,10 +206,17 @@ class Print_Ledger_Simple extends PDF
|
|||
function export()
|
||||
{
|
||||
bcscale(2);
|
||||
$a_jrn=$this->ledger->get_operation($_GET['from_periode'],
|
||||
$_GET['to_periode']);
|
||||
$http=new HttpInput();
|
||||
|
||||
$a_jrn=$this->ledger->get_operation($http->get('from_periode',"number"),
|
||||
$http->get('to_periode',"number"));
|
||||
|
||||
if ( $a_jrn == null ) return;
|
||||
|
||||
// Prepare the query for reconcile date
|
||||
$prepared_query=new Prepared_Query($this->ledger->db);
|
||||
$prepared_query->prepare_reconcile_date();
|
||||
|
||||
for ( $i=0;$i<count($a_jrn);$i++)
|
||||
{
|
||||
/* initialize tva */
|
||||
|
|
@ -228,8 +238,8 @@ class Print_Ledger_Simple extends PDF
|
|||
$this->rap_tva[$l]=bcadd($this->rap_tva[$l],$aAmountVat[$f]['sum_vat']);
|
||||
|
||||
}
|
||||
|
||||
$row=$a_jrn[$i];
|
||||
$ret_reconcile=$this->ledger->db->execute('reconcile_date',array($row['id']));
|
||||
$this->LongLine(15,5,($row['pj']),0);
|
||||
$this->write_cell(10,5,$row['date_fmt'],0,0);
|
||||
$this->write_cell(13,5,$row['internal'],0,0);
|
||||
|
|
@ -260,7 +270,24 @@ class Print_Ledger_Simple extends PDF
|
|||
$l_tvac=bcadd($other['price'], bcsub($other['vat'],$other['tva_np']));
|
||||
$l_tvac=bcadd($l_tvac,$other['tva_nd']);
|
||||
$this->write_cell(15,5,nbm($l_tvac),0,0,'R');
|
||||
$this->line_new(5);
|
||||
$this->line_new(2);
|
||||
$this->write_cell(15,5, _("Payé par"));
|
||||
// Add the payment information on another row
|
||||
$max=Database::num_row($ret_reconcile);
|
||||
$str_payment="";
|
||||
if ($max > 0) {
|
||||
$sep="";
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
$msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
|
||||
$str_payment=$row['jr_date'].$msg.$sep;
|
||||
$sep=' , ';
|
||||
}
|
||||
$this->write_cell (120,5,$str_payment);
|
||||
}
|
||||
|
||||
|
||||
$this->line_new(3);
|
||||
// Total page
|
||||
$this->tp_htva=bcadd($this->tp_htva,$other['price']);
|
||||
$this->tp_tvac=bcadd($this->tp_tvac,$other['price']);
|
||||
|
|
|
|||
|
|
@ -141,11 +141,15 @@ class Print_Ledger_Simple_Without_Vat extends PDF
|
|||
*/
|
||||
function export()
|
||||
{
|
||||
|
||||
$a_jrn=$this->ledger->get_operation($_GET['from_periode'],
|
||||
$_GET['to_periode']);
|
||||
$http=new HttpInput;
|
||||
$a_jrn=$this->ledger->get_operation($http->get('from_periode','number'),$http->get('to_periode','number'));
|
||||
|
||||
if ( $a_jrn == null ) return;
|
||||
|
||||
// Prepare the query for reconcile date
|
||||
$prepared_query=new Prepared_Query($this->cn);
|
||||
$prepared_query->prepare_reconcile_date();
|
||||
|
||||
for ( $i=0;$i<count($a_jrn);$i++)
|
||||
{
|
||||
|
||||
|
|
@ -169,10 +173,23 @@ class Print_Ledger_Simple_Without_Vat extends PDF
|
|||
|
||||
if ( $this->jrn_type !='VEN')
|
||||
{
|
||||
$this->write_cell(15,6,sprintf("%.2f",$other['priv']),0,0,'R');
|
||||
$this->write_cell(15,5,sprintf("%.2f",$other['priv']),0,0,'R');
|
||||
}
|
||||
|
||||
$this->write_cell(15,6,sprintf("%.2f",$other['price']),0,0,'R');
|
||||
$this->write_cell(15,5,sprintf("%.2f",$other['price']),0,0,'R');
|
||||
$ret_reconcile=$this->cn->execute('reconcile_date',array($row['id']));
|
||||
$max=Database::num_row($ret_reconcile);
|
||||
$str_payment="";
|
||||
if ($max > 0) {
|
||||
$sep="";
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
$msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
|
||||
$str_payment=$row['jr_date'].$msg.$sep;
|
||||
$sep=' , ';
|
||||
}
|
||||
$this->write_cell (50,5,$str_payment);
|
||||
}
|
||||
$this->line_new(5);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class Todo_List
|
|||
}
|
||||
if ( strcmp ($p_idx, 'tl_desc') == 0 )
|
||||
{
|
||||
$p_value=mb_substr($p_value,0,400) ;
|
||||
$p_value=mb_substr($p_value,0,1000) ;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -337,14 +337,14 @@ class Todo_List
|
|||
{
|
||||
// This a note the user owns
|
||||
$r.= '<td>'.
|
||||
HtmlInput::button('del','X','onClick="todo_list_remove('.$this->tl_id.')"','smallbutton').
|
||||
Icon_Action::trash(uniqid(),sprintf("todo_list_remove('%s')",$this->tl_id)).
|
||||
'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// this is a note shared by someone else
|
||||
$r.= '<td>'.
|
||||
HtmlInput::button('del','X','onClick="todo_list_remove_share('.$this->tl_id.',\''.$this->use_login.'\','.Dossier::id().')"','smallbutton').
|
||||
Icon_Action::trash(uniqid(),sprintf("todo_list_remove_share('%s','%s','%s')",$this->tl_id,$this->use_login,Dossier::id())).
|
||||
'</td>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -483,9 +483,9 @@ class User
|
|||
return $fr_id;
|
||||
}
|
||||
|
||||
/**\brief set the mini rapport to display on the welcome page
|
||||
/**
|
||||
* \brief set the mini rapport to display on the welcome page
|
||||
*/
|
||||
|
||||
function set_mini_report($p_id)
|
||||
{
|
||||
$count = $this->db->get_value("select count(*) from user_local_pref where user_id=$1 and parameter_type=$2", array($this->id, 'MINIREPORT'));
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
|
|||
if ( ! defined ("SYSINFO_DISPLAY")) {
|
||||
define ("SYSINFO_DISPLAY",TRUE);
|
||||
}
|
||||
define ("DBVERSION",134);
|
||||
define ("DBVERSION",136);
|
||||
define ("MONO_DATABASE",25);
|
||||
define ("DBVERSIONREPO",18);
|
||||
define ('NOTFOUND','--not found--');
|
||||
|
|
|
|||
|
|
@ -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 ');
|
||||
|
|
|
|||
71
include/database/payment_method_sql.class.php
Normal file
71
include/database/payment_method_sql.class.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Autogenerated file
|
||||
* 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
|
||||
*/
|
||||
require_once NOALYSS_INCLUDE.'/lib/noalyss_sql.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/class/database.class.php';
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief abstract of the table public.payment_method
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief abstract of the table public.payment_method
|
||||
*/
|
||||
class Payment_method_SQL extends Noalyss_SQL
|
||||
{
|
||||
|
||||
function __construct(Database $p_cn, $p_id=-1)
|
||||
{
|
||||
$this->table="public.payment_method";
|
||||
$this->primary_key="mp_id";
|
||||
/*
|
||||
* List of columns
|
||||
*/
|
||||
$this->name=array(
|
||||
"mp_id"=>"mp_id"
|
||||
, "mp_lib"=>"mp_lib"
|
||||
, "mp_jrn_def_id"=>"mp_jrn_def_id"
|
||||
, "mp_fd_id"=>"mp_fd_id"
|
||||
, "mp_qcode"=>"mp_qcode"
|
||||
, "jrn_def_id"=>"jrn_def_id"
|
||||
);
|
||||
/*
|
||||
* Type of columns
|
||||
*/
|
||||
$this->type=array(
|
||||
"mp_id"=>"numeric"
|
||||
, "mp_lib"=>"text"
|
||||
, "mp_jrn_def_id"=>"numeric"
|
||||
, "mp_fd_id"=>"numeric"
|
||||
, "mp_qcode"=>"text"
|
||||
, "jrn_def_id"=>"numeric"
|
||||
);
|
||||
|
||||
|
||||
$this->default=array(
|
||||
"mp_id"=>"auto"
|
||||
);
|
||||
|
||||
$this->date_format="DD.MM.YYYY";
|
||||
parent::__construct($p_cn, $p_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -135,6 +135,18 @@ if ( $get_option=="E")
|
|||
}
|
||||
if ($ret_detail==null)
|
||||
return;
|
||||
$a_heading[]="";
|
||||
$a_heading[]="";
|
||||
$a_heading[]="";
|
||||
$a_heading[]=_("Date paiement");
|
||||
$a_heading[]=_("Montant paiement");
|
||||
$a_heading[]=_("Methode paiement");
|
||||
$a_heading[]=_("Opération paiement");
|
||||
|
||||
// Prepare the query for reconcile date
|
||||
$prepared_query=new Prepared_Query($cn);
|
||||
$prepared_query->prepare_reconcile_date();
|
||||
|
||||
$nb=Database::num_row($ret_detail);
|
||||
$title=array();
|
||||
foreach ($a_heading as $key=> $value)
|
||||
|
|
@ -156,6 +168,16 @@ if ( $get_option=="E")
|
|||
$type="number";
|
||||
$export->add($row[$j], $type);
|
||||
}
|
||||
//info payment
|
||||
$ret_reconcile=$cn->execute('reconcile_date',array($row['jr_id']));
|
||||
$max=Database::num_row($ret_reconcile);
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
$export->add($row['jr_date']);
|
||||
$export->add($row['jr_montant'],"number");
|
||||
$export->add($row['qcode_bank']);
|
||||
$export->add($row['jr_internal']);
|
||||
}
|
||||
$export->write();
|
||||
}
|
||||
}
|
||||
|
|
@ -188,22 +210,10 @@ if ($get_option=="L" && ($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL') )
|
|||
}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)');
|
||||
// Prepare the query for reconcile date
|
||||
$prepared_query=new Prepared_Query($cn);
|
||||
$prepared_query->prepare_reconcile_date();
|
||||
|
||||
$title=array();
|
||||
$title[]=_("operation");
|
||||
$title[]=_("Date");
|
||||
|
|
@ -255,7 +265,7 @@ if ($get_option=="L" && ($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL') )
|
|||
$export->add($line['currency_rate_ref']);
|
||||
|
||||
//------ Add reconcilied operation ---------------
|
||||
$ret_reconcile=$cn->execute('reconcile_date_csv',
|
||||
$ret_reconcile=$cn->execute('reconcile_date',
|
||||
array($line['jr_id']));
|
||||
$max=Database::num_row($ret_reconcile);
|
||||
if ($max>0)
|
||||
|
|
@ -263,9 +273,11 @@ if ($get_option=="L" && ($jrn_type=='ODS'||$jrn_type=='FIN'||$jrn_type=='GL') )
|
|||
for ($e=0; $e<$max; $e++)
|
||||
{
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
$export->add($row['qcode_bank']);
|
||||
$export->add($row['jr_date']);
|
||||
$export->add($row['jr_internal']);
|
||||
$export->add($row['jr_pj_number']);
|
||||
$export->add($row['jr_montant'],"number");
|
||||
}
|
||||
}
|
||||
$export->write();
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ $filter_year = " where p_exercice='" . sql_string($exercice) . "'";
|
|||
$periode_start = $cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$w->selected = $from_periode ;
|
||||
|
||||
print td('Depuis') . $w->input('from_periode', $periode_start);
|
||||
print td(_('Depuis')) . $w->input('from_periode', $periode_start);
|
||||
print '</TR>';
|
||||
print '<TR>';
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ $w->selected = $to_periode ;
|
|||
if ($w->selected== '' ){
|
||||
$w->selected=$per_max->p_id;
|
||||
}
|
||||
print td('Jusque ') . $w->input('to_periode', $periode_end);
|
||||
print td(_('Jusque')). $w->input('to_periode', $periode_end);
|
||||
print "</TR><TR>";
|
||||
$a = array(
|
||||
array('value' => 'L', 'label' => _('Liste opérations')),
|
||||
|
|
@ -153,7 +153,7 @@ print '</TR>';
|
|||
print '<TR>';
|
||||
$simple=$http->get("p_simple","string","L");
|
||||
$w->selected = $simple;
|
||||
echo '<td>Style d\'impression '.Icon_Action::infobulle(32).'</td>' . $w->input('p_simple', $a);
|
||||
echo '<td>'._("Style d'impression")." ".Icon_Action::infobulle(32).'</td>' . $w->input('p_simple', $a);
|
||||
print "</TR>";
|
||||
|
||||
echo '</TABLE>';
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ function html_page_start($p_theme="", $p_script="", $p_script2="")
|
|||
<TITLE>$title</TITLE>
|
||||
<link rel=\"icon\" type=\"image/ico\" href=\"favicon.ico\" />
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<LINK REL=\"stylesheet\" type=\"text/css\" href=\"".$style."?version=".SVNINFO."\" media=\"screen\"/>
|
||||
<LINK id=\"pagestyle\" REL=\"stylesheet\" type=\"text/css\" href=\"".$style."?version=".SVNINFO."\" media=\"screen\"/>
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"./style-print.css?version=".SVNINFO."\" media=\"print\"/>" .
|
||||
$p_script2 . "
|
||||
";
|
||||
|
|
|
|||
|
|
@ -165,12 +165,12 @@ class DatabaseCore
|
|||
} else {
|
||||
$a = is_array($p_array);
|
||||
if (!is_array($p_array)) {
|
||||
throw new Exception("Erreur : exec_sql attend un array");
|
||||
throw new Exception(_("Erreur : exec_sql attend un array"));
|
||||
}
|
||||
if (!DEBUG)
|
||||
$this->ret = pg_query_params($this->db, $p_string, $p_array);
|
||||
$this->ret =@pg_query_params($this->db, $p_string, $p_array);
|
||||
else
|
||||
$this->ret = @pg_query_params($this->db, $p_string, $p_array);
|
||||
$this->ret = pg_query_params($this->db, $p_string, $p_array);
|
||||
}
|
||||
if (!$this->ret) {
|
||||
$str_error = pg_last_error($this->db) . pg_result_error($this->ret);
|
||||
|
|
|
|||
|
|
@ -2755,6 +2755,7 @@ function load_all_script()
|
|||
static $already_call=0;
|
||||
if ( $already_call==1)return;
|
||||
$already_call=1;
|
||||
|
||||
include_once NOALYSS_INCLUDE."/lib/message_javascript.php";
|
||||
echo JS_INFOBULLE;
|
||||
echo js_include('smoke.js');
|
||||
|
|
@ -2784,4 +2785,16 @@ function load_all_script()
|
|||
echo js_include('acc_currency.js');
|
||||
|
||||
}
|
||||
/**
|
||||
* Send header and json object
|
||||
* @param array $p_answer this array will be converted to json object
|
||||
* @see json_encode
|
||||
*/
|
||||
function json_response($p_answer)
|
||||
{
|
||||
header("Content-type: text/json; charset: utf8", true);
|
||||
echo json_encode($p_answer,
|
||||
JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ class HtmlInput
|
|||
static function print_window()
|
||||
{
|
||||
$r='';
|
||||
$r.=HtmlInput::button('print', 'Imprimer', 'onclick="window.print();"');
|
||||
$r.=HtmlInput::button('print', _('Imprimer'), 'onclick="window.print();"');
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
|
@ -976,6 +976,22 @@ class HtmlInput
|
|||
$r.=' <span class="notice" id="info_'.$p_table_id.'"></span>';
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Display a field for searching an element in a list
|
||||
* @param string $p_list_id DOM ID of the list (ul or ol)
|
||||
* @return string
|
||||
*/
|
||||
static function filter_list($p_list_id)
|
||||
{
|
||||
$r="<span>";
|
||||
$r.='<span class=" icon"></span>';
|
||||
$r.=sprintf('<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" onkeyup="filter_list(this,\'%s\')">',
|
||||
$p_list_id,$p_list_id,$p_list_id);
|
||||
|
||||
$r.=sprintf('<input type="button" class="smallbutton" onclick="$(\'search_%s\').value=\'\';filter_list(\'search_%s\',\'%s\')" value="x">',$p_list_id,$p_list_id,$p_list_id);
|
||||
$r.='</span>';
|
||||
return $r;
|
||||
}
|
||||
|
||||
static function show_reconcile($p_div, $let, $span="")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -262,8 +262,11 @@ function check()
|
|||
* select must supply an array of possible values [val=> , label=>] with
|
||||
* the variable $this->key_name->a_value
|
||||
* @param $p_key col name
|
||||
* @param $p_type is SELECT NUMERIC TEXT or DATE
|
||||
* @param $p_type is SELECT NUMERIC TEXT , DATE or custom
|
||||
* @param $p_array if type is SELECT an array is expected
|
||||
* @note if $p_type is custom then a function named input_custom($p_key,$p_value) must be implemented
|
||||
* in the class
|
||||
* @see Manage_Table_SQL:input_custom
|
||||
*/
|
||||
function set_col_type($p_key, $p_value, $p_array=NULL)
|
||||
{
|
||||
|
|
@ -271,7 +274,7 @@ function check()
|
|||
throw new Exception("invalid key $p_key");
|
||||
|
||||
if (!in_array($p_value,
|
||||
array("text", "numeric", "date", "select", "timestamp")))
|
||||
array("text", "numeric", "date", "select", "timestamp","custom")))
|
||||
throw new Exception("invalid type $p_value");
|
||||
|
||||
$this->a_type[$p_key]=$p_value;
|
||||
|
|
@ -770,7 +773,11 @@ function check()
|
|||
/**
|
||||
* @brief display a data row in the table, with the order defined
|
||||
* in a_order and depending of the visibility of the column
|
||||
* @param array $p_row contains a row from the database
|
||||
* @see set_col_type
|
||||
* @see input_custom
|
||||
* @see display_table
|
||||
* @see display_row_custom
|
||||
*/
|
||||
function display_row($p_row)
|
||||
{
|
||||
|
|
@ -832,8 +839,11 @@ function check()
|
|||
echo td("--");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} elseif ($this->get_col_type($v)=="custom") {
|
||||
// For custom col
|
||||
echo td($this->display_row_custom($v,$p_row[$v]));
|
||||
}
|
||||
else {
|
||||
echo td($p_row[$v]);
|
||||
}
|
||||
}
|
||||
|
|
@ -847,7 +857,18 @@ function check()
|
|||
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
/**
|
||||
* For the type custom , we can call a function to display properly the value
|
||||
* @param $p_key string key name
|
||||
* @param $p_value string value
|
||||
* @see input_custom
|
||||
* @see set_type
|
||||
* @note must return a string which will be in surrounded by td in the function display_row
|
||||
* @return string
|
||||
*/
|
||||
function display_row_custom($p_key,$p_value) {
|
||||
return $p_value;
|
||||
}
|
||||
/**
|
||||
* @brief display into a dialog box the datarow in order
|
||||
* to be appended or modified. Can be override if you need
|
||||
|
|
@ -926,6 +947,9 @@ function check()
|
|||
$min_size=10;
|
||||
$text->size=$min_size;
|
||||
echo $text->input();
|
||||
} elseif ($this->a_type[$key]=="custom")
|
||||
{
|
||||
$this->input_custom($key,$value);
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
|
|
@ -940,7 +964,26 @@ function check()
|
|||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief this function let you create your own input , for example for a ITEXT , a IRADIO , ...
|
||||
* it must be override , there is not default
|
||||
* @code
|
||||
* function input_custom($p_key,$p_value) {
|
||||
* switch ($p_key) {
|
||||
* case 'name':
|
||||
* $w=new ICard($p_key,$p_value);
|
||||
* $w->input();
|
||||
* break;
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* @parameter string $p_key name of the column
|
||||
* @parameter string $p_value current value
|
||||
* @return nothing
|
||||
*/
|
||||
function input_custom($p_key,$p_value) {
|
||||
throw new Exception(__FILE__.":".__LINE__."-"._("non implémenté"));
|
||||
}
|
||||
/**
|
||||
* @brief Save the record from Request into the DB and returns an XML
|
||||
* to update the Html Element
|
||||
|
|
|
|||
|
|
@ -28,52 +28,80 @@
|
|||
?>
|
||||
<script>
|
||||
var content=new Array();
|
||||
content[0]="<?php echo _("Cherchez en saisissant le quickcode, le poste comptable ou une partie du nom de la fiche ou de l'adresse")?>";
|
||||
content[1]="<?php echo _("(optionnel) La description est un commentaire libre qui sert à identifier cette opération")?>";
|
||||
content[2]="<?php echo _("Selectionnez le journal où l'opération doit être sauvée")?>";
|
||||
content[3]="<?php echo _("Les périodes comptables servent comme un second contrôle pour la date de l'opération. Modifiez dans vos préférence pour avoir une autre période par défaut. Pour ne plus avoir à changer la période aller dans COMPANY, et mettez 'Afficher la période comptable' à non")?>";
|
||||
content[4]="<?php echo _("(optionnel) L'échéance est la date limite de paiement")?>";
|
||||
content[5]="<?php echo _("(optionnel)Le numéro d'extrait permet de retrouver plus facilement l'extrait de banque")?>";
|
||||
content[6]="<?php echo _("Indiquez ici le prix hors tva si vous êtes affilié à la tva et que vous pouvez la déduire , sinon indiquez ici le total tva incluse et utilisez un taux tva de 0%")?>";
|
||||
content[7]="<?php echo _("(optionnel) Ces champs servent à contrôler que les montants correspondent à l'extrait")?>";
|
||||
content[8]="<?php echo _("(optionnel) Ce montant correspond au total tva, si vous le laissez à vide, il sera calculé automatiquement en fonction du taux")?>";
|
||||
content[9]="<?php echo _("Tapez le numéro de poste ou une partie du poste ou du libellé puis sur recherche, Si vous avez donné un quickcode, le poste comptable ne sera pas utilisé")?>";
|
||||
content[10]="<?php echo _("ATTENTION changer le poste comptable d'une fiche <b>ne modifiera pas toutes les opérations</b> où cette fiche est utilisée")?>";
|
||||
content[11]="<?php echo _("ATTENTION si le poste comptable est vide, il sera créé automatiquement")?>";
|
||||
content[12]="<?php echo _("Document généré uniquement si le mode de paiement est utilisé")?>";
|
||||
content[13]="<?php echo _("Vous pouvez utiliser le % pour indiquer le poste parent")?>";
|
||||
content[14]="<?php echo _("Attention, le poste comptable doit exister, il ne sera pas vérifié")?>";
|
||||
content[15]="<?php echo _("Laissez à 0 pour ne rien changer")?>";
|
||||
content[16]="<?php echo _("Vous devez donner la date par opération")?>";
|
||||
content[17]="<?php echo _("Cliquez sur le titre d'une colonne pour trier")?>";
|
||||
content[18]="<?php echo _("Donnez une partie du nom, prénom, de la description, du poste comptable, du n° de TVA,quick code ... ")?>";
|
||||
content[19]="<?php echo _("Donnez une partie du nom, de la description, du n° de TVA du poste comptable ou du quick code")?>";
|
||||
content[20]="<?php echo _("Les menus ne peuvent dépendre que dans d'un menu principal ou d'un menu, si cette liste est vide, ajouter des modules ou menu principal sans donner de dépendance")?>";
|
||||
content[21]="<?php echo _("Donnez un nombre entre 0 & 100")?>";
|
||||
content[22]="<?php echo _("Donnez une partie du nom du dossier,du nom, du prénom ou du login pour filtrer")?>";
|
||||
content[23]="<?php echo _("Donnez une partie du nom du dossier ou de la description pour filtrer")?>";
|
||||
content[24]="<?php echo _("Donnez une partie du poste comptable ou du libellé pour filtrer")?>";
|
||||
content[25]="<?php echo _("Donnez une partie du libellé, la date, le montant ou le numéro d'opération pour filtrer, cela n'efface pas ce qui a déjà été sélectionné")?>";
|
||||
content[26]="<?php echo _("Donnez une partie du quickcode, nom, description... pour filtrer")?>";
|
||||
content[27]="<?php echo _("Attention, <b>SI</b> la fiche a changé de poste comptable, c'est seulement le dernier qui est affiché")?>";
|
||||
content[28]="<?php echo _("Attention Différence entre TVA calculée et donnée")?>";
|
||||
content[29]="<?php echo _("Si vous ne donnez pas de nom, ce sera le nom du fichier qui sera utilisé")?>";
|
||||
content[30]="<?php echo _("Peut contenir une information telle que le message structuré sur le virement")?>";
|
||||
content[31]="<?php echo _("Peut contenir un numéro de bon de commande")?>";
|
||||
content[32]="<?php echo _("<h3> Remarque : choix possibles </h3> <ul style='padding-left:15px'> <li> Détail opérations ne donne pas le même résultat si on regarde tous les journaux ou un journal de type ACH ou VEN</li> <li> Liste opérations ne donne pas le même résultat si on regarde tous les journaux ou un journal de type ACH ou VEN</li> <li> Journaux VEN ou ACH en mode détail opérations donne les détails des factures, y compris les montants, TVA et quantité par article</li> <li> Journaux VEN ou ACH en mode liste opérations donne pour chaque opération, le total de la TVA, ND, ...</li> </ul>")?>";
|
||||
content[33]="<?php echo _("le type vaut :<ul> <li> ME pour Menu</li> <li> PR pour les impressions </li> <li> PL pour les plugins</li> <li> SP pour des valeurs spéciales</li> </ul>")?>";
|
||||
content[34]="<?php echo _("Cliquez sur le code AD pour ouvrir le menu dans un nouvel onglet")?>";
|
||||
content[35]="<?php echo _("Cliquez sur le chemin pour ouvrir le menu")?>";
|
||||
content[36]="<?php echo _("En utilisant les dates d échéance ou de paiement, seuls les journaux de type ACH et VEN seront utilisés ,vous excluez d office les autres journaux")?>";
|
||||
content[37]="<?php echo _("Les dates sont en format DD.MM.YYYY")?>";
|
||||
content[38]="<?php echo _("La numérotation est propre à chaque journal. Laissez à 0 pour ne pas changer le numéro")?>";
|
||||
content[39]="<?php echo _("Le préfixe des pièces doit être différent pour chaque journal, on peut aussi utiliser l'année")?>";
|
||||
content[40]="<?php echo _("Laissez à 0 pour ne pas changer le numéro")?>";
|
||||
content[41]="<?php echo _("Mettez le pourcentage <br> à zéro pour effacer la ligne")?>";
|
||||
content[42]="<?php echo _("Selectionnez le plan qui vous intéresse avant de cliquer sur Recherche")?>";
|
||||
content[43]="<?php echo _("Autoliquidation : Utilisé en même temps au crédit et au débit")?>";
|
||||
content[44]="<?php echo _("Ne donner pas ce poste comptable si ce code n'est pas utilisé à l'achat")?>";
|
||||
content[45]="<?php echo _("Ne donner pas ce poste comptable si ce code n'est pas utilisé à la vente")?>";
|
||||
content[46]="<?php echo _("Un instant svp")?>";
|
||||
content[47]="<?php echo _("Vous confirmez ?")?>";
|
||||
content[0]="<?php echo escape_xml(_("Cherchez en saisissant le quickcode, le poste comptable ou une partie du nom de la fiche ou de l'adresse"))?>";
|
||||
content[1]="<?php echo escape_xml(_("(optionnel) La description est un commentaire libre qui sert à identifier cette opération"))?>";
|
||||
content[2]="<?php echo escape_xml(_("Selectionnez le journal où l'opération doit être sauvée"))?>";
|
||||
content[3]="<?php echo escape_xml(_("Les périodes comptables servent comme un second contrôle pour la date de l'opération. Modifiez dans vos préférence pour avoir une autre période par défaut. Pour ne plus avoir à changer la période aller dans COMPANY, et mettez 'Afficher la période comptable' à non"))?>";
|
||||
content[4]="<?php echo escape_xml(_("(optionnel) L'échéance est la date limite de paiement"))?>";
|
||||
content[5]="<?php echo escape_xml(_("(optionnel)Le numéro d'extrait permet de retrouver plus facilement l'extrait de banque"))?>";
|
||||
content[6]="<?php echo escape_xml(_("Indiquez ici le prix hors tva si vous êtes affilié à la tva et que vous pouvez la déduire , sinon indiquez ici le total tva incluse et utilisez un taux tva de 0%"))?>";
|
||||
content[7]="<?php echo escape_xml(_("(optionnel) Ces champs servent à contrôler que les montants correspondent à l'extrait"))?>";
|
||||
content[8]="<?php echo escape_xml(_("(optionnel) Ce montant correspond au total tva, si vous le laissez à vide, il sera calculé automatiquement en fonction du taux"))?>";
|
||||
content[9]="<?php echo escape_xml(_("Tapez le numéro de poste ou une partie du poste ou du libellé puis sur recherche, Si vous avez donné un quickcode, le poste comptable ne sera pas utilisé"))?>";
|
||||
content[10]="<?php echo escape_xml(_("ATTENTION changer le poste comptable d'une fiche <b>ne modifiera pas toutes les opérations</b> où cette fiche est utilisée"))?>";
|
||||
content[11]="<?php echo escape_xml(_("ATTENTION si le poste comptable est vide, il sera créé automatiquement"))?>";
|
||||
content[12]="<?php echo escape_xml(_("Document généré uniquement si le mode de paiement est utilisé"))?>";
|
||||
content[13]="<?php echo escape_xml(_("Vous pouvez utiliser le % pour indiquer le poste parent"))?>";
|
||||
content[14]="<?php echo escape_xml(_("Attention, le poste comptable doit exister, il ne sera pas vérifié"))?>";
|
||||
content[15]="<?php echo escape_xml(_("Laissez à 0 pour ne rien changer"))?>";
|
||||
content[16]="<?php echo escape_xml(_("Vous devez donner la date par opération"))?>";
|
||||
content[17]="<?php echo escape_xml(_("Cliquez sur le titre d'une colonne pour trier"))?>";
|
||||
content[18]="<?php echo escape_xml(_("Donnez une partie du nom, prénom, de la description, du poste comptable, du n° de TVA,quick code ... "))?>";
|
||||
content[19]="<?php echo escape_xml(_("Donnez une partie du nom, de la description, du n° de TVA du poste comptable ou du quick code"))?>";
|
||||
content[20]="<?php echo escape_xml(_("Les menus ne peuvent dépendre que dans d'un menu principal ou d'un menu, si cette liste est vide, ajouter des modules ou menu principal sans donner de dépendance"))?>";
|
||||
content[21]="<?php echo escape_xml(_("Donnez un nombre entre 0 & 100"))?>";
|
||||
content[22]="<?php echo escape_xml(_("Donnez une partie du nom du dossier,du nom, du prénom ou du login pour filtrer"))?>";
|
||||
content[23]="<?php echo escape_xml(_("Donnez une partie du nom du dossier ou de la description pour filtrer"))?>";
|
||||
content[24]="<?php echo escape_xml(_("Donnez une partie du poste comptable ou du libellé pour filtrer"))?>";
|
||||
content[25]="<?php echo escape_xml(_("Donnez une partie du libellé, la date, le montant ou le numéro d'opération pour filtrer, cela n'efface pas ce qui a déjà été sélectionné"))?>";
|
||||
content[26]="<?php echo escape_xml(_("Donnez une partie du quickcode, nom, description... pour filtrer"))?>";
|
||||
content[27]="<?php echo escape_xml(_("Attention, <b>SI</b> la fiche a changé de poste comptable, c'est seulement le dernier qui est affiché"))?>";
|
||||
content[28]="<?php echo escape_xml(_("Attention Différence entre TVA calculée et donnée"))?>";
|
||||
content[29]="<?php echo escape_xml(_("Si vous ne donnez pas de nom, ce sera le nom du fichier qui sera utilisé"))?>";
|
||||
content[30]="<?php echo escape_xml(_("Peut contenir une information telle que le message structuré sur le virement"))?>";
|
||||
content[31]="<?php echo escape_xml(_("Peut contenir un numéro de bon de commande"))?>";
|
||||
// Because we are using HTML tag , we cannot escape and we must be careful with quote and double-quote, the best
|
||||
// is to avoid them
|
||||
content[32]="<?php echo _("<h3> Remarque : choix possibles </h3> <ul> <li> Détail opérations ne donne pas le même résultat si on regarde tous les journaux ou un journal de type ACH ou VEN</li> <li> Liste opérations ne donne pas le même résultat si on regarde tous les journaux ou un journal de type ACH ou VEN</li> <li> Journaux VEN ou ACH en mode détail opérations donne les détails des factures, y compris les montants, TVA et quantité par article</li> <li> Journaux VEN ou ACH en mode liste opérations donne pour chaque opération, le total de la TVA, ND, ...</li> </ul>")?>";
|
||||
content[33]="<?php echo escape_xml(_("le type vaut :<ul> <li> ME pour Menu</li> <li> PR pour les impressions </li> <li> PL pour les plugins</li> <li> SP pour des valeurs spéciales</li> </ul>"))?>";
|
||||
content[34]="<?php echo escape_xml(_("Cliquez sur le code AD pour ouvrir le menu dans un nouvel onglet"))?>";
|
||||
content[35]="<?php echo escape_xml(_("Cliquez sur le chemin pour ouvrir le menu"))?>";
|
||||
content[36]="<?php echo escape_xml(_("En utilisant les dates d échéance ou de paiement, seuls les journaux de type ACH et VEN seront utilisés ,vous excluez d office les autres journaux"))?>";
|
||||
content[37]="<?php echo escape_xml(_("Les dates sont en format DD.MM.YYYY"))?>";
|
||||
content[38]="<?php echo escape_xml(_("La numérotation est propre à chaque journal. Laissez à 0 pour ne pas changer le numéro"))?>";
|
||||
content[39]="<?php echo escape_xml(_("Le préfixe des pièces doit être différent pour chaque journal, on peut aussi utiliser l'année"))?>";
|
||||
content[40]="<?php echo escape_xml(_("Laissez à 0 pour ne pas changer le numéro"))?>";
|
||||
content[41]="<?php echo escape_xml(_("Mettez le pourcentage <br> à zéro pour effacer la ligne"))?>";
|
||||
content[42]="<?php echo escape_xml(_("Selectionnez le plan qui vous intéresse avant de cliquer sur Recherche"))?>";
|
||||
content[43]="<?php echo escape_xml(_("Autoliquidation : Utilisé en même temps au crédit et au débit"))?>";
|
||||
content[44]="<?php echo escape_xml(_("Ne donner pas ce poste comptable si ce code n'est pas utilisé à l'achat"))?>";
|
||||
content[45]="<?php echo escape_xml(_("Ne donner pas ce poste comptable si ce code n'est pas utilisé à la vente"))?>";
|
||||
content[46]="<?php echo escape_xml(_("Un instant svp"))?>";
|
||||
content[47]="<?php echo escape_xml(_("Vous confirmez ?"))?>";
|
||||
content[48]="<?php echo escape_xml(_("Echec "))?>";
|
||||
content[49]="<?php echo escape_xml(_("Echec donnée manquante ou incorrecte"))?>";
|
||||
content[50]="<?php echo escape_xml(_("Vous confirmez effacement ?"))?>";
|
||||
content[51]="<?php echo escape_xml(_("Vous confirmez mise à jour ?"))?>";
|
||||
content[52]="<?php echo escape_xml(_("Si vous changez de page vous perdez les reconciliations, continuez ?")) ?>";
|
||||
content[53]="<?php echo escape_xml(_("Echec réponse"))?>";
|
||||
content[54]="<?php echo escape_xml(_("Désolé, les montants pour la comptabilité analytique sont incorrects"))?>";
|
||||
content[55]="<?php echo escape_xml(_("Maximum 15 lignes"))?>";
|
||||
content[56]="<?php echo escape_xml(_("Maximum"))?>";
|
||||
content[57]="<?php echo escape_xml(_("calculé"))?>";
|
||||
content[58]="<?php echo escape_xml(_("Balance incorrecte D/C")); ?>";
|
||||
content[59]="<?php echo escape_xml(_("Action non autorisée")); ?>";
|
||||
content[60]="<?php echo escape_xml(_("Donnée manquante ou déjà supprimée")) ?>";
|
||||
content[61]="<?php echo escape_xml(_('Désolé, événement en cours de création à sauver')); ?>";
|
||||
content[62]="<?php echo escape_xml(_("Cacher"))?>";
|
||||
content[63]="<?php echo escape_xml(_("Afficher"))?>";
|
||||
content[64]="<?php echo escape_xml(_("Traitement en cours"))?>";
|
||||
content[65]="<?php echo escape_xml(_("Un instant"))?>";
|
||||
content[66]="<?php echo escape_xml(_("Calculatrice"))?>";
|
||||
content[67]="<?php echo escape_xml(_('Taper une formule (ex 20*5.1) puis enter'))?>";
|
||||
content[68]="<?php echo escape_xml(_("Calculatrice simplifiée: écrivez simplement les opérations que vous voulez puis la touche retour. exemple : 1+2+3*(1/5)"));?>";
|
||||
content[69]="<?php echo escape_xml(_("Aucune donnée"))?>";
|
||||
content[70]="<?php echo escape_xml(_("Votre demande est en cours de traitement"))?>";
|
||||
content[71]="<?php echo _('Limite le type de fiche si vous choisissez la fiche à la saisie, uniquement avec journaux OD');?>";
|
||||
content[72]="<?php echo _("Pour les journaux FIN, ce sera la fiche du journal");?>";
|
||||
|
||||
</script>
|
||||
|
|
@ -34,6 +34,7 @@ class Select_Box
|
|||
var $id;
|
||||
var $item;
|
||||
private $cnt;
|
||||
private $filter; //!< allow a dynamic not case sensitive search
|
||||
var $default_value;
|
||||
|
||||
/**
|
||||
|
|
@ -50,22 +51,27 @@ class Select_Box
|
|||
$this->cnt=0;
|
||||
$this->default_value=-1;
|
||||
$this->style_box="";
|
||||
$this->filter="";
|
||||
}
|
||||
|
||||
function input()
|
||||
{
|
||||
$list_id=sprintf('%s_list',$this->id);
|
||||
|
||||
// Show when click
|
||||
$javascript=sprintf('$("%s_bt").onclick=function() {
|
||||
try {
|
||||
var newDiv=$("select_box%s");
|
||||
var pos=$("%s_bt").cumulativeOffset();
|
||||
newDiv.setStyle({display:"block",position:"fixed",top:pos.top+25+"px",left:pos.left+5+"px"});
|
||||
|
||||
if ( $("search_%s") ) { $("search_%s").focus();}
|
||||
|
||||
} catch(e) {
|
||||
alert(e.message);
|
||||
}
|
||||
}
|
||||
', $this->id, $this->id, $this->id, $this->id);
|
||||
', $this->id, $this->id, $this->id, $list_id,$list_id);
|
||||
|
||||
// Hide when out of the zone
|
||||
$javascript.=sprintf('$("select_box%s").onmouseleave=function() {
|
||||
|
|
@ -85,9 +91,14 @@ class Select_Box
|
|||
printf('<div class="select_box" id="select_box%s" style="%s">',
|
||||
$this->id, $this->style_box);
|
||||
|
||||
|
||||
// Show the filter if there is one,
|
||||
if ( $this->filter != "" ) {
|
||||
|
||||
echo HtmlInput::filter_list($list_id);
|
||||
}
|
||||
|
||||
// Print the list of possible options
|
||||
printf('<ul id="%s_list">',$this->id);
|
||||
printf('<ul id="%s">',$list_id);
|
||||
for ($i=0; $i<count($this->item); $i++)
|
||||
{
|
||||
if ($this->item[$i]['type']=="url")
|
||||
|
|
@ -162,5 +173,12 @@ class Select_Box
|
|||
$this->item[$this->cnt]['type']='input';
|
||||
$this->cnt++;
|
||||
}
|
||||
function set_filter($p_filter)
|
||||
{
|
||||
$this->filter=$p_filter;
|
||||
}
|
||||
function get_filter() {
|
||||
return $this->filter;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,52 +27,6 @@ require_once NOALYSS_INCLUDE.'/lib/idate.class.php';
|
|||
require_once NOALYSS_INCLUDE.'/lib/icard.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/ispan.class.php';
|
||||
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Show the menu for the card management
|
||||
*
|
||||
* \param $p_dossier dossier 1
|
||||
*
|
||||
*
|
||||
*
|
||||
* \return nothing
|
||||
*/
|
||||
function ShowMenuFiche($p_dossier)
|
||||
{
|
||||
$cn=new Database($p_dossier);
|
||||
$mod="&ac=".$_REQUEST['ac'];
|
||||
$str_dossier=dossier::get().$mod;
|
||||
echo '<div class="lmenu">';
|
||||
echo '<TABLE>';
|
||||
|
||||
echo '<TR><TD colspan="1" class="mtitle" style="width:auto" >
|
||||
<A class="mtitle" HREF="?p_action=fiche&action=add_modele&fiche=modele&'.$str_dossier.'">'._('Création').'</A></TD>
|
||||
<TD><A class="mtitle" HREF="?p_action=fiche&'.$str_dossier.'">'._('Recherche').'</A></TD>
|
||||
</TR>';
|
||||
$Res=$cn->exec_sql("select fd_id,fd_label from fiche_def order by fd_label");
|
||||
$Max=Database::num_row($Res);
|
||||
for ( $i=0; $i < $Max;$i++)
|
||||
{
|
||||
$l_line=Database::fetch_array($Res,$i);
|
||||
printf('<TR><TD class="cell">
|
||||
<A class="mtitle" HREF="?p_action=fiche&action=modifier&fiche=%d&%s">%s</A></TD>
|
||||
<TD class="mshort">
|
||||
<A class="mtitle" HREF="?p_action=fiche&action=vue&fiche=%d&%s">Liste</A>
|
||||
</TD>
|
||||
</TR>',
|
||||
$l_line['fd_id'],
|
||||
$str_dossier,
|
||||
$l_line['fd_label'],
|
||||
$l_line['fd_id'],
|
||||
$str_dossier
|
||||
|
||||
);
|
||||
}
|
||||
echo "</TABLE>";
|
||||
echo '</div>';
|
||||
}
|
||||
/*! MenuAdmin */
|
||||
/* \brief show the menu for user/database management
|
||||
/*
|
||||
|
|
@ -82,11 +36,14 @@ function ShowMenuFiche($p_dossier)
|
|||
function MenuAdmin()
|
||||
{
|
||||
$def=-1;
|
||||
$http=new HttpInput();
|
||||
|
||||
if (isset($_REQUEST['UID']))
|
||||
$def=0;
|
||||
if ( isset ($_REQUEST['action']))
|
||||
{
|
||||
switch ($_REQUEST['action'])
|
||||
$action=$http->request('action');
|
||||
switch ($action)
|
||||
{
|
||||
case 'user_mgt':
|
||||
$def=0;
|
||||
|
|
@ -163,7 +120,8 @@ function MenuAdmin()
|
|||
|
||||
function menu_acc_plan($p_start=1)
|
||||
{
|
||||
$base="?ac=".$_REQUEST['ac'];
|
||||
$http=new HttpInput();
|
||||
$base="?ac=".$http->request('ac');
|
||||
$str_dossier="&".dossier::get();
|
||||
for ($i=0;$i<10;$i++) { $class[$i]="tabs";}
|
||||
$class[$p_start]="tabs_selected";
|
||||
|
|
|
|||
|
|
@ -19,133 +19,15 @@
|
|||
|
||||
// Copyright Author Dany De Bontridder danydb@aevalys.eu
|
||||
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
|
||||
require_once NOALYSS_INCLUDE.'/class/acc_payment.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/sort_table.class.php';
|
||||
//---------------------------------------------------------------------------
|
||||
// Common variable
|
||||
$td='<TD>';
|
||||
$etd='</td>';
|
||||
$tr='<tr>';
|
||||
$etr='</tr>';
|
||||
$th='<th>';
|
||||
$eth='</th>';
|
||||
global $http;
|
||||
/*!\file
|
||||
* \brief payment mode
|
||||
*/
|
||||
$sb=$http->request('sb', "string","");
|
||||
echo '<div class="content">';
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// change
|
||||
if ( $sb=='change')
|
||||
{
|
||||
if ( !isset($_GET['id'])) exit;
|
||||
$row=new Acc_Payment($cn,$_GET['id']);
|
||||
$row->load();
|
||||
echo '<form method="post" id="modify_acc_pay_frm" onsubmit="return confirm_box(\'modify_acc_pay_frm\',\''._('Vous confirmez').'\')">';
|
||||
echo dossier::hidden();
|
||||
echo HtmlInput::hidden('sa','mp');
|
||||
echo HtmlInput::hidden('sb','save');
|
||||
echo HtmlInput::hidden('id',$row->get_parameter("id"));
|
||||
echo HtmlInput::hidden('delete_ck',0);
|
||||
echo $row->form();
|
||||
echo HtmlInput::submit('save',_('Sauve'), ' onclick="$(\'delete_ck\').value=0"');
|
||||
echo HtmlInput::submit('delete',_('Efface'),' onclick="$(\'delete_ck\').value=1"');
|
||||
echo HtmlInput::button_anchor(_('Retour sans sauver'),
|
||||
'?p_action=divers&sa=mp&'.dossier::get()."&ac=".$_REQUEST['ac'],
|
||||
"","","smallbutton");
|
||||
echo '</form>';
|
||||
return;
|
||||
}
|
||||
//----------------------------------------------------------------------
|
||||
// Save the change
|
||||
//
|
||||
if ( $sb=='save')
|
||||
{
|
||||
$http=new HttpInput();
|
||||
$delete=$http->post("delete_ck","string", 0);
|
||||
if ( $delete == 0 )
|
||||
{
|
||||
$row=new Acc_Payment($cn,$_POST ['id']);
|
||||
$row->from_array($_POST);
|
||||
$row->update();
|
||||
} else {
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a card
|
||||
//---------------------------------------------------------------------------
|
||||
$row=new Acc_Payment($cn,$_POST['id']);
|
||||
$row->from_array($_POST);
|
||||
$row->delete();
|
||||
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// Insert a new mod of payment
|
||||
//---------------------------------------------------------------------------
|
||||
if ( isset($_POST['insert']))
|
||||
{
|
||||
$row=new Acc_Payment($cn);
|
||||
$row->from_array($_POST);
|
||||
$row->insert();
|
||||
$sb="list";
|
||||
}
|
||||
require_once NOALYSS_INCLUDE."/database/payment_method_sql.class.php";
|
||||
require_once NOALYSS_INCLUDE."/class/payment_method_mtable.class.php";
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Show form to enter a new one
|
||||
//---------------------------------------------------------------------------
|
||||
if ($sb=='ins')
|
||||
{
|
||||
$mp=new Acc_Payment($cn);
|
||||
$r=$mp->blank();
|
||||
echo '<form method="POST" id="payment_frm" onsubmit="return confirm_box(this,\'Vous confirmez ?\')">';
|
||||
echo dossier::hidden();
|
||||
echo HtmlInput::hidden('ac',$_REQUEST['ac']),HtmlInput::hidden('insert',0);
|
||||
echo $r;
|
||||
echo HtmlInput::submit('insertsub',_('Enregistre'));
|
||||
echo HtmlInput::button_anchor(_('Retour sans sauver'),
|
||||
'?p_action=divers&sa=mp&'.dossier::get()."&ac=".$_REQUEST['ac'],
|
||||
"","","smallbutton");
|
||||
echo '</form>';
|
||||
$payment_method_sql=new Payment_method_SQL($cn);
|
||||
$payment_method_mtable=new Payment_Method_MTable($payment_method_sql);
|
||||
|
||||
return;
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
//LIST
|
||||
//--------------------------------------------------------------------------------
|
||||
/* Get the data from database */
|
||||
$header=new Sort_Table();
|
||||
$base_url=$_SERVER['PHP_SELF']."?".Dossier::get()."&ac=".$_REQUEST['ac'];
|
||||
$payment_method_mtable->add_json_param("op", "payment_method");
|
||||
$payment_method_mtable->set_callback("ajax_misc.php");
|
||||
$payment_method_mtable->create_js_script();
|
||||
|
||||
$header->add(_("Libelle"),$base_url,"order by mp_lib asc","order by mp_lib desc",'la','ld');
|
||||
$header->add(_("Pour le journal"),$base_url,"order by jrn_def_name asc","order by jrn_def_name desc",'ja','jd');
|
||||
$header->add(_("Type de fiche"),$base_url,"order by fd_label asc","order by fd_label desc",'tc','td');
|
||||
$header->add(_("Enregistré dans le journal"),$base_url,"order by jrn_target asc","order by jrn_target desc",'jta','jtd');
|
||||
$header->add(_("Avec la fiche"),$base_url,"order by vw_name asc","order by vw_name desc",'na','nd');
|
||||
|
||||
$order=(isset($_REQUEST['ord']))?$_REQUEST['ord']:'la';
|
||||
|
||||
$sql=$header->get_sql_order($order);
|
||||
|
||||
$array=$cn->get_array("
|
||||
select
|
||||
mp_id,mp_lib,mp_jrn_def_id,mp_fd_id,mp_qcode,j.jrn_def_id,
|
||||
j.jrn_def_name as jrn_def_name,
|
||||
j2.jrn_def_name as jrn_target,
|
||||
fd_label,
|
||||
coalesce(mp_qcode,'A choisir à l''encodage') as vw_name
|
||||
from mod_payment as mp
|
||||
left join jrn_def as j on (j.jrn_def_id=mp.jrn_def_id)
|
||||
left join jrn_def as j2 on (j2.jrn_def_id=mp.mp_jrn_def_id)
|
||||
left join fiche_def as fd on (mp.mp_fd_id=fd.fd_id)
|
||||
$sql
|
||||
");
|
||||
/* if there are data show them in a table */
|
||||
if ( ! empty ($array))
|
||||
{
|
||||
|
||||
require_once NOALYSS_TEMPLATE.'/list_mod_payment.php';
|
||||
}
|
||||
echo HtmlInput::button_anchor("Ajout", $base_url."&sb=ins","","","smallbutton");
|
||||
echo '</div>';
|
||||
?>
|
||||
echo $payment_method_mtable->display_table();
|
||||
|
|
|
|||
8
include/sql/patch/upgrade134.sql
Normal file
8
include/sql/patch/upgrade134.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
begin;
|
||||
|
||||
update attr_def set ad_extra = '[sql] fd_id in (select fd_id from fiche_def where frd_id in (4,8,9,14))' where ad_id=25;
|
||||
|
||||
alter table mod_payment rename to payment_method;
|
||||
|
||||
insert into version (val,v_description) values (135,'rename table mod_payment');
|
||||
commit ;
|
||||
23
include/sql/patch/upgrade135.sql
Normal file
23
include/sql/patch/upgrade135.sql
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
begin;
|
||||
|
||||
insert into menu_ref (me_code,me_menu,me_file,me_description,me_type,me_description_etendue)
|
||||
values('PRINTTVA','Résumé TVA','tax_summary.inc.php','totaux par TVA et par journal','ME','Calcul des totaux par TVA et par journal');
|
||||
|
||||
insert into profile_menu (me_code,me_code_dep,p_id,p_order,p_type_display,pm_default,pm_id_dep)
|
||||
select me_code,'PRINT',1,250,'E',0,6 from menu_ref where me_code='PRINTTVA'
|
||||
union
|
||||
select me_code,'PRINT',1,250,'E',0,35 from menu_ref where me_code='PRINTTVA'
|
||||
union
|
||||
select me_code,'PRINT',2,250,'E',0,719 from menu_ref where me_code='PRINTTVA'
|
||||
union
|
||||
select me_code,'PRINT',2,250,'E',0,716 from menu_ref where me_code='PRINTTVA'
|
||||
;
|
||||
insert into menu_ref (me_code,me_menu,me_file,me_type)
|
||||
values ('CSV:printtva','Export Résumé TVA','export_printtva_csv.php','PR'),
|
||||
('PDF:printtva','Export Résumé TVA','export_printtva_pdf.php','PR')
|
||||
;
|
||||
|
||||
insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:printtva',1,'P'),('PDF:printtva',1,'P'),('CSV:printtva',2,'P'),('PDF:printtva',2,'P');
|
||||
|
||||
insert into version (val,v_description) values (136,'new feature PRINTTVA');
|
||||
commit ;
|
||||
|
|
@ -151,7 +151,8 @@ foreach ($this->data as $line) {
|
|||
$sep="";
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $row['jr_internal']);
|
||||
$msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
|
||||
$sep=' ,';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,8 @@ for ($i=0;$i<$nb_data;$i++):
|
|||
$sep="";
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $row['jr_internal']);
|
||||
$msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
|
||||
$sep=' ,';
|
||||
}
|
||||
} ?>
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@ if (!defined('ALLOWED'))
|
|||
<th class="num">
|
||||
<?=_('Devise')?>
|
||||
</th>
|
||||
<th>
|
||||
<?=_('Lien')?>
|
||||
</th>
|
||||
</tr>
|
||||
<?php
|
||||
$nb_data=count($this->data);
|
||||
|
|
@ -129,7 +132,8 @@ for ($i=0;$i<$nb_data;$i++):
|
|||
$sep="";
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $row['jr_internal']);
|
||||
$msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
|
||||
$sep=' ,';
|
||||
}
|
||||
} ?>
|
||||
|
|
|
|||
|
|
@ -138,7 +138,8 @@ foreach ($this->data as $line) {
|
|||
$sep="";
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $row['jr_internal']);
|
||||
$msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
|
||||
$sep=' ,';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,9 @@ for ($i=0;$i<$nb_data;$i++):
|
|||
$sep="";
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $row['jr_internal']);
|
||||
$msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
|
||||
|
||||
$sep=' ,';
|
||||
}
|
||||
} ?>
|
||||
|
|
|
|||
|
|
@ -112,7 +112,8 @@ for ($i=0;$i<$nb_data;$i++):
|
|||
$sep="";
|
||||
for ($e=0;$e<$max;$e++) {
|
||||
$row=Database::fetch_array($ret_reconcile, $e);
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $row['jr_internal']);
|
||||
$msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
|
||||
echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
|
||||
$sep=' ,';
|
||||
}
|
||||
} ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue