diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css
index d8057d772..22e046a09 100644
--- a/html/css/style-classic7.css
+++ b/html/css/style-classic7.css
@@ -72,13 +72,17 @@ BODY {
--bg-inner-box:#DCE1EF;
--underline-menu:#d7e8ee;
--bg-slide:#c5d5e8;
+ --end-level1:#eb7c7e;
+ --border-color:#b7b7b7;
+ --bg-white:white;
+ --bg-readonly:#f9f9f9;
}
input{
font-family: 'OpenSansRegular';
padding : 2px;
margin:2px;
- border:1px solid var(--input-color);
-
+ border:1px solid var(--border-color);
+ background-color:var(--bg-white);
color:var(--input-color);
}
@@ -111,6 +115,7 @@ p.notice,span.notice {
margin-left: 5ch;
border:1px solid transparent;
border-radius: 5px;
+ text-align: center;
}
.valid {
color:green;
@@ -805,12 +810,12 @@ a.document:hover {
}
.input_text_ro {
border:1px solid #0000FF;
- background:#EDEDED;
- color:#0000FF;
+ background-color:var(--bg-readonly);
+ border-radius: 5px;
margin:1px;
}
.input_text {
- border:1px solid var(--input-color);
+ border:1px solid var(--border-color);
margin:1px;
border-radius: 5px;
}
@@ -854,9 +859,9 @@ fieldset fieldset legend {
color:#888;
}
select {
- border: 1px solid #0000FF;
+ border: 1px solid var(--border-color);
margin:2px;
- background-color:#FFFFFF;
+ background-color:var(--bg-white);
border-radius: 3px;
padding: 3px;
}
@@ -2051,9 +2056,9 @@ td.workday ol {
}
input.inum {
text-align:right;
- border:1px solid var(--input-color);
margin:2px;
border-radius: 5px;
+ border:1px solid var(--border-color);
}
div.box {
background-color:#e4e7ed;
@@ -2089,7 +2094,7 @@ div.box {
div.box {
width: 35rem;
max-height: 30%;
- height: 45vh;
+ height: 40rem;
}
}
@@ -2186,7 +2191,7 @@ margin-left: 0px;
.inner_box li.tabs:hover ,li.tabs:hover {
display:inline;
background-color: lightblue;
- color:wheat;
+ color:var(--bg-white);
margin-left: 2px;
padding: 5px;
border-top-left-radius: 10px;
@@ -2211,7 +2216,7 @@ margin-left: 2px;
.inner_box li.tabs:hover ,li.tabs:hover {
display:inline;
background-color: lightblue;
- color:wheat;
+ color:var(--bg-white);
margin-left: 2px;
padding: 15px 7px 10px 10px;
border-top-left-radius: 5px;
@@ -2336,21 +2341,21 @@ hr {
******************************************************************************/
li.highlight,tr.highlight{
font-weight: bolder;
- font-size:90%;
- background-color: #8A8787;
- color:whitesmoke !important;
+ font-size:100%;
+ font-size:1rem;
+ background-color: lightsteelblue;
+ color:var(--bg-white) !important;
border-width: 2px;
border-style: solid;
/*! border-color: blue; */
}
li.highlight a,tr.highlight a{
- color:whitesmoke !important;
+ color:var(--bg-white) !important;
}
*|*:link {
color: inherit;
}
-
/*****************************************************************************
* Table of one column to present menu
* as in CFGLED, FORECAST, REPORT
@@ -2500,6 +2505,8 @@ ul.aligned-block li {
padding: 2rem;
border:1px solid navy;
margin-right:1rem;
+ width: 20rem;
+
}
/***************************************************************************
* column in the dashboard
@@ -2513,6 +2520,7 @@ td.cut {
}
td.box {
border-left: #9999ff solid 1px;
+ border-radius: 10px 0px;
}
/****************************************************************************
@@ -2700,7 +2708,7 @@ td.selectedmenu {
.field_follow_up
{
margin-top:1px;
- border:1px solid blue;
+ border:1px solid var(--border-color);
min-height: 5rem;
}
@@ -2988,6 +2996,11 @@ div.progressbar {
/**
* Warning
*/
+span.warning::before {
+ content: '\e806';
+ font-family: "fontello" !important;
+ font-weight:normal;
+}
span.warning {
color:white;
font-style: normal;
@@ -2999,6 +3012,7 @@ span.warning {
animation-duration: 4s;
animation-iteration-count: infinite;
display: block;
+ border-radius: 10px;
}
/**********************************************************************************************************************/
/* LI as list
@@ -3062,7 +3076,7 @@ span.warning {
li.tab_row:hover {
display:block;
background-color: lightblue;
- color:wheat;
+ color:var(--bg-white);
margin-left: 2px;
padding: 5px;
border-top-left-radius: 10px;
@@ -3085,7 +3099,7 @@ margin-left: 2px;
li.tab_row:hover {
display:block;
background-color: lightblue;
- color:wheat;
+ color:var(--bg-white);
margin-left: 2px;
padding: 20px 15px 15px 20px;
margin: 20px 15px 15px 15px;
@@ -3781,7 +3795,7 @@ margin:1px;
div.concerned_action {
height: 11rem;
overflow: auto;
- background-color: white;
+ background-color: var(--bg-white);
border:navy 1px solid;
width: 100%;
scroll-padding-right: 20px;
@@ -3957,7 +3971,8 @@ h2.h-section {
content:'';
left:0;
bottom:0;
- right:0;3 position:absolute;
+ right:0.3;
+ position:absolute;
height:var(--border-size);
background-color:red;
transform:scaleX(0);
@@ -3973,8 +3988,7 @@ h2.h-section {
.nav-item.li-active.nav-item-underline::before {
transform: scale(1);
background-color: #d03100;
- background-image: linear-gradient(to right,#cc0000 0%,red 20%) ;
- background-image: linear-gradient(to right,darkred 0%,red 10%,red 90%,darkred);
+ background-image: linear-gradient(to right,var(--end-level1) 0%,red 10%,red 90%,var(--end-level1));
}
/**
@@ -4171,7 +4185,7 @@ h2.h-section {
}
.topmenu .nav-item.nav-item-underline:hover::before,.topmenu .nav-item.nav-item-underline:focus::before {
transform: scaleX(1) scaleY(1);
- background-image: linear-gradient(to right,darkred,red);
+ background-image: linear-gradient(to right,var(--end-level1),red);
}
@@ -4182,7 +4196,7 @@ h2.h-section {
.topmenu .nav-item.nav-item-underline:hover::before,.topmenu .nav-item.nav-item-underline:focus::before {
transform: scaleX(1) scaleY(1);
- background-image: linear-gradient(to right,darkred 0%,red 30%);
+ background-image: linear-gradient(to right,var(--end-level1) 0%,red 30%);
}
/*.topmenu .nav-item.nav-item-underline::before {
@@ -4258,6 +4272,8 @@ span.nb-round {
.bt-center {
margin-bottom: 2rem;
+ float:inherit;
+ clear:both;
}
@@ -4287,4 +4303,35 @@ span.nb-round {
#module_setting .selectedcell {
background-color:beige;
-}
\ No newline at end of file
+}
+
+#facturation_div_id{
+ height:auto;
+ float:left
+
+}
+#ag_title {
+ width:80%;
+}
+#message1 {
+ text-align: center;
+ padding: 10px;
+}
+
+
+.inner_box div.fu_comment_div {
+ padding-left: 1rem;
+ padding-right: 1rem;
+
+}
+
+
+.field_follow_up {
+ padding: 1rem;
+ border-radius: 10px;
+
+}
+
+.field_follow_up {
+ background-color: var(--bg-white);
+}
diff --git a/html/direct.php b/html/direct.php
index acac14599..5550132ec 100644
--- a/html/direct.php
+++ b/html/direct.php
@@ -12,7 +12,7 @@
* 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
@@ -39,7 +39,7 @@ if ( ! $g_user->is_double_identified()) {
exit();
}
$g_user->check_dossier($http->get('gDossier'));
-$res=$cn->exec_sql("select distinct code,coalesce(description,code) description from get_profile_menu($1) where code ~* $2 or description ~* $2 order by code limit 5 ",array($g_user->get_profile(),$http->post("acs")));
+$res=$cn->exec_sql("select distinct code,coalesce(description,code) as description from get_profile_menu($1) where code ~* $2 or description ~* $2 order by code limit 5 ",array($g_user->get_profile(),$http->post("acs")));
$nb=Database::num_row($res);
echo "
";
set_language();
diff --git a/html/do.php b/html/do.php
index 2f1ec3f12..e19f6f910 100644
--- a/html/do.php
+++ b/html/do.php
@@ -73,6 +73,8 @@ if ( ! $cn->exist_table('version')) {
echo '';
return;
}
+global $level;
+$level=0;
/**
* if access_mode is MOBILE than force it to mobile.php
@@ -93,6 +95,7 @@ if ( DEBUGNOALYSS > 1 ) {
\Noalyss\Dbg::display_size();
\Noalyss\Dbg::display_request();
\Noalyss\Dbg::display_global();
+ echo "encoding";echo mb_internal_encoding();
} //<--- if DEBUG
$g_parameter=new Noalyss_Parameter_Folder($cn);
@@ -322,6 +325,7 @@ else
$_GET['ac']=$default;
$_POST['ac']=$default;
$_REQUEST['ac']=$default;
+
show_module($menu_id);
$all[0] = $default;
show_menu($menu_id);
diff --git a/html/export.php b/html/export.php
index d287a8ce4..209e45363 100644
--- a/html/export.php
+++ b/html/export.php
@@ -33,6 +33,7 @@ global $g_user,$cn,$g_parameter;
require_once NOALYSS_INCLUDE.'/class/database.class.php';
require_once NOALYSS_INCLUDE . '/class/noalyss_user.class.php';
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
+mb_internal_encoding("UTF-8");
//
// for loading javascripts or style-sheet, it is needed to know the user
@@ -49,12 +50,47 @@ if (isset ($_REQUEST['loadjs']) && $_REQUEST['loadjs']=='message')
include_once NOALYSS_INCLUDE."/lib/message_javascript.php";
return;
}
+
+
+//------------------------------------------------
+// Export File from ADMINISTRATION MENU
+//------------------------------------------------
+$hi=new HttpInput();
+if ($hi->request("admin","string",0)==1 ) {
+ $g_user=new Noalyss_user(new Database());
+ if ($g_user->admin != 1)
+ {
+ $g_user->audit('FAIL', "ADMIN: export admin".var_export($_REQUEST,true));
+ echo_warning(_("Accès interdit"));
+ exit();
+ }
+ if ( $hi->get("action")=="logfile") {
+ $directory=dir( NOALYSS_BASE.DIRECTORY_SEPARATOR."log");
+ $a_file=[];
+ while ( $file = $directory->read()) {
+ if (preg_match("/noalyss.*log/", $file)) {
+ $a_file[]=$file;
+ }
+ }
+ $file=$hi->get("file");
+ if (! in_array($file,$a_file ) )
+ {
+ echo_warning(sprintf("%s non trouvé",$file));
+ return;
+ }
+ header('Content-Type: application/x-download');
+ header('Content-Disposition: attachment; filename="'.$file.'"');
+ header('Cache-Control: private, max-age=0, must-revalidate');
+ header('Pragma: public');
+ echo file_get_contents(NOALYSS_BASE.DIRECTORY_SEPARATOR."/log/{$file}");
+ }
+ return;
+}
+//------------------------------------------------
// Connect the user to the current folder and export file
+//------------------------------------------------
$cn=Dossier::connect();
$g_user=new Noalyss_user($cn);
-$gDossier=dossier::id();
-$g_parameter=new Noalyss_Parameter_Folder($cn);
-mb_internal_encoding("UTF-8");
$g_user->Check();
/**
* check if 2FA is completed
@@ -62,9 +98,10 @@ $g_user->Check();
if ( ! $g_user->is_double_identified()) {
exit();
}
+$gDossier=dossier::id();
+$g_parameter=new Noalyss_Parameter_Folder($cn);
$action=$g_user->check_dossier($gDossier);
-$hi=new HttpInput();
$action=$hi->get("act");
if ( $action=='X' || $g_user->check_print($action)==0 )
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index b19270895..5c02037c3 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -1297,14 +1297,12 @@ function search_letter(obj) {
*/
function op_save(obj) {
try {
- var queryString = id$(obj).serialize(true);
- queryString ["gDossier"] = obj.gDossier.value;
- var rapt2 = "rapt" + obj.whatdiv.value;
- queryString ["rapt"] = id$(rapt2).value;
- queryString ["jr_id"] = obj.jr_id.value;
- var jr_id = obj.jr_id.value;
- queryString ["div"] = obj.whatdiv.value;
- var divid = obj.whatdiv.value;
+ var queryString = Form.serialize(obj,true);
+ var divid = queryString['whatdiv'];
+ queryString["div"] = queryString['whatdiv'];
+ queryString["rapt"] = id$("rapt"+divid).value;
+ var jr_id = queryString['jr_id'];
+
queryString ["act"] = "save";
queryString ["op"] = "ledger";
queryString ["jr_note"]=encodeURI(tinyMCE.get("jrn_note"+divid).getContent());
@@ -1346,7 +1344,7 @@ function op_save(obj) {
}
new Ajax.Request('ajax_misc.php', {
parameters: {
- 'gDossier': obj.gDossier.value,
+ 'gDossier': queryString ["gDossier"],
'act': 'de',
'op': 'ledger',
'jr_id': jr_id,
@@ -1359,7 +1357,7 @@ function op_save(obj) {
id$(divid).innerHTML = unescape(getNodeText(html[0]));
id$(divid).innerHTML.evalScripts();
remove_waiting_box();
- noalyss.refresh_note(jr_id,obj.gDossier.value);
+ noalyss.refresh_note(jr_id,queryString ["gDossier"]);
} catch (e) {
console.error("D1. op_save")
alert_box("1038" + e.message)
@@ -1539,7 +1537,9 @@ function save_filter(p_div, p_dossier) {
// Get all elt from the form
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- eltValue[idx] = id$(p_div + elt[i]).value;
+ eltValue[idx] = null;
+ if ( document.getElementById(p_div+elt[i]) )
+ eltValue[idx]=id$(p_div + elt[i]).value;
}
if (eltValue['amount_min'] == "") eltValue["amount_min"] = 0;
@@ -1602,7 +1602,9 @@ function load_filter(p_div, p_dossier, p_filter_id) {
, 'p_currency_code', 'tva_id_search'];
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- id$(p_div + idx).value = answer[elt[i]];
+
+ if ( document.getElementById(p_div + idx))
+ id$(p_div + idx).value = answer[elt[i]];
}
// fillup the r_jrn array
var eltLedgerId = id$("ledger_id" + p_div);
diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js
index d8f18af0a..841e69a68 100644
--- a/html/js/accounting_item.js
+++ b/html/js/accounting_item.js
@@ -273,7 +273,7 @@ function search_account_card(p_obj)
onSuccess: function (req){
var pos=calcy(50);
- var obj={id:"search_account_div",cssclass:"inner_box",style:"top:"+pos+"px",
+ var obj={id:"search_account_div",cssclass:"inner_box",style:"top:"+pos+"px;z-index:"+get_next_layer(),
html:req.responseText};
add_div(obj);
remove_waiting_box();
diff --git a/html/js/card.js b/html/js/card.js
index 1ca042912..3f690e4d2 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -1215,7 +1215,7 @@ function modify_card(p_fiche_id)
nTop = 170;
}
var str_top = fixed_position(250, nTop)
- var str_style = str_top + ";width:45em;height:auto;position:absolute";
+ var str_style = str_top + ";width:45em;height:auto;position:absolute"+"; z-index:"+get_next_layer();
var popup = {'id': content, 'cssclass': 'inner_box', 'style': str_style, 'html': loading(), 'drag': false};
@@ -1383,7 +1383,7 @@ function linked_card_option(p_action_person_id,p_dossier) {
},
onSuccess:function(req) {
remove_waiting_box();
- add_div({ "id":"d_linked_card_option",cssclass:"inner_box",style:"position:fixed;top:30%;min-width:20rem;width:auto;",drag:0});
+ add_div({ "id":"d_linked_card_option",cssclass:"inner_box",style:"position:fixed;top:30%;min-width:20rem;width:auto;z-index:"+get_next_layer(),drag:0});
id$("d_linked_card_option").update(req.responseText);
}
diff --git a/html/js/gestion.js b/html/js/gestion.js
index 6de51f234..44d6d7665 100644
--- a/html/js/gestion.js
+++ b/html/js/gestion.js
@@ -282,7 +282,7 @@ function action_show(p_dossier)
parameters : {gDossier:p_dossier,'op':'action_show'},
onSuccess : function(p_xml, p_text) {
remove_waiting_box();
- add_div({id: 'action_list_div', style:"position:fixed;top:1%;width:90%;left:5%" , cssclass: 'inner_box'});
+ add_div({id: 'action_list_div', style:"position:fixed;top:1%;width:90%;left:5%;z-index:"+get_next_layer() , cssclass: 'inner_box'});
$('action_list_div').innerHTML=p_xml.responseText;
var table_followup=document.getElementById('event_followup');
if ( table_followup) { sorttable.makeSortable(table_followup); }
@@ -312,7 +312,7 @@ function action_add(p_dossier) {
onSuccess : function(p_xml, p_text) {
if (p_xml.responseText === 'NOCONX') { reconnect();return;}
remove_waiting_box();
- add_div({id: 'action_add_div',style:'top:25px',
+ add_div({id: 'action_add_div',style:'top:25px;z-index:'+get_next_layer(),
cssclass: 'inner_box'});
$('action_add_div').innerHTML=p_xml.responseText;
p_xml.responseText.evalScripts();
diff --git a/html/js/modele_document.js b/html/js/modele_document.js
index 3813caf9e..644b4d911 100644
--- a/html/js/modele_document.js
+++ b/html/js/modele_document.js
@@ -25,7 +25,7 @@ function modifyModeleDocument(p_value,dossier)
id='det'+layer;
var pos_y=posY+offsetY-20;
var pos_x=posX+offsetX+40;
- var style="position:absolute;top:"+pos_y+"px;left:10%;width:80%";
+ var style="position:absolute;top:"+pos_y+"px;left:10%;width:80%;z-index:"+get_next_layer();
var popup={'id':'mod_doc',
'cssclass':'inner_box',
'html': loading(),
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index b3d949ce5..f259df367 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -579,7 +579,7 @@ function cat_doc_change(p_dt_id, p_dossier) {
var queryString = "gDossier=" + p_dossier + "&op=mod_cat_doc" + "&dt_id=" + p_dt_id;
var nTop = calcy(posY);
var nLeft = "200px";
- var str_style = "top:" + nTop + "px;left:" + nLeft + ";width:50em;height:auto";
+ var str_style = "top:" + nTop + "px;left:" + nLeft + ";width:50em;height:auto"+"; z-index:"+get_next_layer();
removeDiv('change_doc_div');
waiting_box();
@@ -1170,7 +1170,7 @@ function display_periode(p_dossier, p_id) {
'id': 'mod_periode',
'cssclass': 'inner_box',
'html': loading(),
- 'style': 'width:30em',
+ 'style': 'width:30em'+"; z-index:"+get_next_layer(),
'drag': true
};
if (!document.getElementById('mod_periode')) {
@@ -1295,7 +1295,7 @@ function fill_box(req) {
function mod_predf_op(dossier_id, od_id, p_ledger) {
var target = "mod_predf_op";
removeDiv(target);
- var str_style = "top:10%;left:2%;width:96%";
+ var str_style = "top:10%;left:2%;width:96%;"+"; z-index:"+get_next_layer();
var div = {id: target, cssclass: 'inner_box', style: str_style, html: loading(), drag: 1};
@@ -1582,7 +1582,7 @@ function mod_menu(gdossier, pm_id) {
waiting_box();
removeDiv('divdm' + pm_id);
var qs = "op=det_menu&gDossier=" + gdossier + "&pm_id=" + pm_id + "&ctl=divdm" + pm_id;
- var pos = fixed_position(50, 250);
+ var pos = fixed_position(50, 250)+"; z-index:"+get_next_layer();
var action = new Ajax.Request('ajax_misc.php',
{
method: 'get',
@@ -1690,7 +1690,7 @@ function add_menu(obj) {
waiting_box();
removeDiv('divdm' + p_id);
- var pos = fixed_position(250, 150) + ";width:50%;";
+ var pos = fixed_position(250, 150) + ";width:50%;"+"; z-index:"+get_next_layer();
var action = new Ajax.Request('ajax_misc.php',
{
method: 'get',
@@ -1736,7 +1736,7 @@ function add_plugin(p_dossier) {
onSuccess: function (req) {
try {
remove_waiting_box();
- var pos = fixed_position(250, 150) + ";width:30%";
+ var pos = fixed_position(250, 150) + ";width:30%"+"; z-index:"+get_next_layer();
add_div({id: "divplugin", drag: 1, cssclass: "inner_box", style: pos});
id$('divplugin').innerHTML = req.responseText;
} catch (e) {
@@ -1766,7 +1766,7 @@ function mod_plugin(p_dossier, me_code) {
onSuccess: function (req) {
try {
remove_waiting_box();
- var pos = fixed_position(250, 150) + ";width:30%";
+ var pos = fixed_position(250, 150) + ";width:30%"+"; z-index:"+get_next_layer();
add_div({id: "divplugin", drag: 1, cssclass: "inner_box", style: pos});
id$('divplugin').innerHTML = req.responseText;
@@ -1791,7 +1791,7 @@ function create_menu(p_dossier) {
onSuccess: function (req) {
try {
remove_waiting_box();
- var pos = fixed_position(250, 150) + ";width:30%";
+ var pos = fixed_position(250, 150) + ";width:30%"+"; z-index:"+get_next_layer();
add_div({
id: "divmenu",
drag: 1,
@@ -1820,7 +1820,7 @@ function modify_menu(p_dossier, me_code) {
onSuccess: function (req) {
try {
remove_waiting_box();
- var pos = fixed_position(250, 150) + ";width:30%";
+ var pos = fixed_position(250, 150) + ";width:30%"+"; z-index:"+get_next_layer();
add_div({
id: "divmenu",
drag: 1,
@@ -2603,7 +2603,7 @@ function show_tag(p_dossier, p_ac, p_tag_id, p_post) {
code_html = unescape_xml(code_html);
remove_waiting_box();
var posy = calcy(250);
- add_div({id: 'tag_div', cssclass: 'inner_box', drag: 0, style: "position:fixed;top:15%;"});
+ add_div({id: 'tag_div', cssclass: 'inner_box', drag: 0, style: "position:fixed;top:15%; z-index:"+get_next_layer()});
id$('tag_div').innerHTML = code_html;
try {
code_html.evalScripts();
@@ -2670,7 +2670,7 @@ function action_tag_select(p_dossier, ag_id) {
}
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- var pos = fixed_position(35, 229);
+ var pos = fixed_position(35, 229)+"; z-index:"+get_next_layer();
add_div({id: 'tag_div', style: pos, cssclass: 'inner_box tag', drag: 0});
remove_waiting_box();
@@ -2806,7 +2806,7 @@ function search_display_tag(p_dossier, p_prefix, p_object) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
remove_waiting_box();
- add_div({id: p_prefix + 'tag_div', style: 'left:10%;width:70%', cssclass: 'inner_box', drag: 1});
+ add_div({id: p_prefix + 'tag_div', style: 'left:10%;width:70%;z-index:'+get_next_layer(), cssclass: 'inner_box', drag: 1});
id$(p_prefix + 'tag_div').style.top = calcy(200) + "px"
id$(p_prefix + 'tag_div').style.left = 20 + "%";
remove_waiting_box();
@@ -2966,7 +2966,7 @@ function calendar_zoom(obj) {
obj.outdiv = 'calendar_zoom_div';
}
if (id$(obj.outdiv) == undefined) {
- var str_style = 'top:10%;min-height:60rem';
+ var str_style = 'top:10%;min-height:60rem'+"; z-index:"+get_next_layer();
// var str_style = fixed_position(0, 120);
add_div({
id: obj.outdiv,
@@ -3464,7 +3464,7 @@ var Periode = function (p_ledger) {
var y = 100;
add_div({
"id": "mod_periode",
- "style": "position:fixed;top:" + y + "px;width:50%",
+ "style": "position:fixed;top:" + y + "px;width:50%"+"; z-index:"+get_next_layer(),
"cssclass": "inner_box",
'html': "wait"
});
@@ -4026,7 +4026,7 @@ var operation_tag = function (p_div) {
}
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- var pos = fixed_position(35, 229);
+ var pos = fixed_position(35, 229)+"; z-index:"+get_next_layer();
add_div({id: 'tag_div', style: pos, cssclass: 'inner_box tag', drag: 0});
remove_waiting_box();
diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php
index cc3ce03fd..ee4f1cd0e 100644
--- a/include/XMLDocument/invoiceubl21.class.php
+++ b/include/XMLDocument/invoiceubl21.class.php
@@ -162,18 +162,10 @@ class InvoiceUBL21 extends XMLInvoice {
$a_error[]=$value;
}
}
- if ( $this->data['customer']["endpoint_id"] != "")
+ // check if peppol id has the form 9999:9999...
+ if (preg_match('/[0-9]+:[[:alnum:]]+/',$this->data['customer']["endpoint_id"]) == 0)
{
- // check if peppol id has the form 9999:9999...
- list($scheme_id,$peppol)=explode(":", $this->data['customer'][$value]);
- if (preg_replace('/[0-9]/', '', $scheme_id) != "")
- {
$a_error[]='endpoint_id';
- }elseif(\noalyss_trim($peppol) =="")
- {
- $a_error[]='endpoint_id';
-
- }
}
if ( $this->data['customer']["customer_vat_id"] != "" && preg_match('/[a-z]{2}/i',$this->data['customer']["customer_vat_id"] ) == false)
{
@@ -235,7 +227,7 @@ class InvoiceUBL21 extends XMLInvoice {
// LegalEntity
$ple=$this->createElement('cac:PartyLegalEntity');
///@todo customer = name doit être fiche
- $ple->appendChild($this->createElement("cbc:RegistrationName", $this->data['customer']['name']??"ERROR"));
+ $ple->appendChild($this->createElement("cbc:RegistrationName", htmlspecialchars($this->data['customer']['name'],ENT_XML1,'UTF-8')));
///@todo customer_vat_id = numéro de TVA doit être dans fiche
$ple->appendChild($this->createElement("cbc:CompanyID", $this->data['customer']['customer_vat_id']??"ERROR"));
@@ -245,6 +237,31 @@ class InvoiceUBL21 extends XMLInvoice {
$customer->appendChild($customer_party);
return $customer;
}
+ /**
+ * @brief Delivery Date is mandatory for INTRACOMM , so by default
+ * we set the invoice date
+
+
+ 2026-01-06
+
+
+ */
+ function build_deliveryDate()
+ {
+ $delivery=$this->createElement("cac:Delivery");
+ $delivery->appendChild($this->createElement("cbc:ActualDeliveryDate",$this->data['issue_date']));
+ //(cac:Delivery/cac:DeliveryLocation/cac:Address/cac:Country/cbc:IdentificationCode//
+ $loc= $this->createElement("cac:DeliveryLocation");
+ $addr=$this->createElement('cac:Address');
+ $country=$this->createElement("cac:Country");
+ $country->appendChild($this->createElement("cbc:IdentificationCode", $this->data['customer']['country']));
+ $addr->appendChild($country);
+ $loc->appendChild($addr);
+ $delivery->appendChild($loc);
+
+ return $delivery;
+ }
+ /**
/**
* @brief Build XML Block for payment
* @code
@@ -450,6 +467,7 @@ class InvoiceUBL21 extends XMLInvoice {
$result->appendChild($this->createElement("cbc:ID", $i));
$amount=sprintf("%.2f",$row['price']);
+ if ( $row['quantity'] > 0 && $amount < 0 ) $row['quantity'] =bcsub(0,$row['quantity'] ,4);
$result->appendChild(
$this->createElement("cbc:InvoicedQuantity", sprintf("%.2f",$row['quantity'])))
->setAttribute("unitCode", $row["code_quantity"]);
@@ -659,6 +677,9 @@ class InvoiceUBL21 extends XMLInvoice {
// add the customer
$root->appendChild($this->build_customer());
+ // add delivery date
+ $root->appendChild($this->build_deliveryDate());
+
// add the payment if there is a bank account
if ( $company['COMPANY_BANK_IBAN'] != "")
$root->appendChild($this->build_paymentInfo());
diff --git a/include/XMLDocument/xml_reader.class.php b/include/XMLDocument/xml_reader.class.php
index 2497cbfff..6e291df2f 100644
--- a/include/XMLDocument/xml_reader.class.php
+++ b/include/XMLDocument/xml_reader.class.php
@@ -25,6 +25,10 @@ namespace Noalyss\XMLDocument;
* @file
* @brief answer to an inplace object
*/
+/**
+ \pure
+ \brief Abstract class
+*/
abstract class XML_Reader
{
@@ -229,6 +233,9 @@ abstract class XML_Reader
$result = [];
$result['ID'] = $this->get_node_value("//cac:AccountingCustomerParty[1]/cac:Party[1]/cbc:EndpointID[1]");
$result['name'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PartyName[1]/cbc:Name[1]');
+ if ($result['name'] == '') {
+ $result['name'] = $this->get_node_value("//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:RegistrationName[1]");
+ }
$result['street'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:StreetName[1]');
$result['city'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:CityName[1]');
$result['postcode'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:PostalZone[1]');
@@ -247,12 +254,28 @@ abstract class XML_Reader
$result = [];
$result['ID'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cbc:EndpointID[1]");
$result['name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyName[1]/cbc:Name[1]");
+ if ($result['name'] == '') {
+ $result['name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:RegistrationName[1]");
+ }
$result['street'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:StreetName[1]");
$result['city'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:CityName[1]");
$result['postcode'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:PostalZone[1]");
$result['country_code'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cac:Country[1]/cbc:IdentificationCode[1]");
$result['company_id'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyTaxScheme[1]/cbc:CompanyID[1]");
+ if ($result['company_id'] == "" ) {
+ $result['company_id'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:CompanyID[1]");
+ }
$result['scheme'] = $this->get_node("//cac:AccountingSupplierParty[1]/cac:Party[1]/cbc:EndpointID[1]")[0]->getAttribute("schemeID");
+ /**
+ * get contact
+
+ Facturation NOALYSS
+ invoice@noalyss
+
+ */
+ $result['contact_name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:Contact[1]/cbc:Name[1]");
+ $result['contact_mail'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:Contact[1]/cbc:ElectronicMail");
+
return $result;
}
@@ -378,8 +401,6 @@ abstract class XML_Reader
/**
*
* @return array
- * @TODODNY
- * Implémenter les allowances
*/
function get_info(): array
{
@@ -390,6 +411,7 @@ abstract class XML_Reader
$result['InvoiceTypeCode'] =$this->get_document_type_code();
$result['DocumentCurrencyCode'] = $this->get_node_value('cbc:DocumentCurrencyCode');
$result['BuyerReference'] = $this->get_node_value('cbc:BuyerReference');
+ $result['OrderReference'] = $this->get_node_value('//cac:OrderReference[1]/cbc:ID[1]');
$result['ActualDeliveryDate'] = $this->get_node_value('//cac:Delivery[1]/cbc:ActualDeliveryDate[1]');
$result['info']=array();
@@ -410,6 +432,7 @@ abstract class XML_Reader
public function to_pdf(): PDF
{
//$pdf = new PDF($cn);
+
$pdf = new PDF();
$result = $this->get_info();
$info=$result;
@@ -419,97 +442,133 @@ abstract class XML_Reader
$pdf->AddPage();
// 180 mm large
$pdf->setFont("DejaVu", "B", 16);
- $pdf->write_cell(20, 10, "");
- $pdf->write_cell(170, 10, _("Résumé facture"),1,0,'C');
- $pdf->line_new(10);
+ $pdf->line_new(2);
+ $pdf->SetTextColor(0,0,127);
+ $pdf->write_cell(10, 10, "");
+ $pdf->write_cell(170, 10, _("Résumé document"),1,0,'C');
+ $pdf->line_new(20);
+ $pdf->Image(NOALYSS_HOME.'/image/logo10000.png', 10, 10, 20, 0, 'PNG');
+
$pdf->setFont("DejaVu", "", 7);
+ $pdf->SetTextColor(0,0,0);
$pdf->write(4, sprintf(_("Document ID %s"), $result['id']));
$pdf->ln();
- $pdf->write(4, sprintf(_("Date facture %s"), $result['IssueDate']));
- $pdf->ln();
- $pdf->write(4, sprintf(_("Date échéance %s"), $result['DueDate']));
- $pdf->ln();
+ $pdf->setFont("DejaVu", "B", 8);
+ $pdf->write_cell(20,4,_('Date'));
+ $pdf->print_row();
+ $pdf->setFont("DejaVuCond", "", 7);
+ $pdf->write_multi(38,4, sprintf(_(" Facture %s"), $result['IssueDate']));
+ $pdf->write_multi(38,4, sprintf(_("Echéance %s"), $result['DueDate']));
+ $pdf->write_multi(38,4, sprintf(_("Livraison %s"), $result['ActualDeliveryDate']));
+ $pdf->line_new();
$pdf->write(4, sprintf(_("Type et code document %s"), $result['InvoiceTypeCode']));
$pdf->ln();
$pdf->write(4, sprintf(_("Devise document %s"), $result['DocumentCurrencyCode']));
$pdf->ln();
$pdf->write(4, sprintf(_("Référence client %s"), $result['BuyerReference']));
$pdf->ln();
- $pdf->write(4, sprintf(_("Date Livraison %s"), $result['ActualDeliveryDate']));
+ $pdf->write(4, sprintf(_("Référence commande %s"), $result['OrderReference']));
$pdf->ln(10);
$pdf->setFont("DejaVu", "B", 12);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Fournisseur"));
- $pdf->line_new(12);
+ $pdf->line_new(6);
$supplier = $this->get_supplier();
- $pdf->setFont("DejaVu", "", 7);
- $pdf->write_cell(60, 4, $supplier['name']);
- $pdf->write_cell(60, 4, $supplier['company_id']);
- $pdf->write_cell(60, 4,$supplier['scheme'].":". $supplier['ID']);
+ $pdf->setFont("DejaVu", "B", 8);
+ $pdf->write_multi(10, 4, "");
+ $pdf->write_multi(150, 4, $supplier['name']);
$pdf->line_new();
- $pdf->write_cell(60, 4, $supplier['street']);
- $pdf->write_cell(30, 4, $supplier['postcode']);
- $pdf->write_cell(60, 4, $supplier['city']);
- $pdf->write_cell(20, 4, $supplier['country_code']);
- $pdf->line_new(10);
+ $pdf->SetTextColor(0,0,0);
+ $pdf->setFont("DejaVuCond", "", 7);
+ $pdf->write_multi(70, 4, $supplier['street']);
+ $pdf->write_multi(30, 4, $supplier['postcode']);
+ $pdf->write_multi(50, 4, $supplier['city']);
+ $pdf->write_cell(10, 4, $supplier['country_code']);
+ $pdf->line_new();
+ $pdf->write_cell(50, 4, $supplier['company_id']);
+ $pdf->write_cell(50, 4,'PEPPOL ID:'.$supplier['scheme'].":". $supplier['ID']);
+ $pdf->line_new();
+ if ( $supplier['contact_name'] != '' || $supplier['contact_mail'] != '') {
+ $pdf->write_multi(100, 4, "contact: ".$supplier['contact_name']." ". $supplier['contact_mail']);
+ $pdf->line_new();
+ }
+ $pdf->line_new(4);
$customer = $this->get_customer();
$pdf->setFont("DejaVu", "B", 12);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Client"));
- $pdf->line_new(10);
- $pdf->setFont("DejaVu", "", 7);
- $pdf->write_cell(60, 4, $customer['name']);
- $pdf->write_cell(60, 4, $customer['company_id']);
- $pdf->write_cell(60, 4, $customer['scheme'].":".$customer['ID']);
+ $pdf->line_new(6);
+ $pdf->setFont("DejaVu", "B", 8);
+ $pdf->write_multi(10, 4, "");
+ $pdf->write_multi(150, 4, $customer['name']);
$pdf->line_new();
- $pdf->write_cell(60, 4, $customer['street']);
- $pdf->write_cell(40, 4, $customer['postcode']);
- $pdf->write_cell(60, 4, $customer['city']);
- $pdf->write_cell(20, 4, $customer['country_code']);
- $pdf->line_new(10);
+ $pdf->SetTextColor(0,0,0);
+ $pdf->setFont("DejaVu", "", 7);
+ $pdf->write_multi(70, 4, $customer['street']);
+ $pdf->write_multi(30, 4, $customer['postcode']);
+ $pdf->write_multi(50, 4, $customer['city']);
+ $pdf->write_multi(10, 4, $customer['country_code']);
+ $pdf->line_new();
+ $pdf->write_cell(50, 4, $customer['company_id']);
+ $pdf->write_cell(50, 4, 'PEPPOL ID:'.$customer['scheme'].":".$customer['ID']);
+ $pdf->line_new(6);
/**
* note invoice
*/
if ( $info['info']['note'] != "")
{
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60, 4, _("Notes"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
- $pdf->write_multi(50, 4,$info['info']['note']);
+ $pdf->write_multi(130, 8,$info['info']['note']);
$pdf->line_new(10);
}
/**
* ITEM
*/
$pdf->setFont("DejaVu", "B", 12);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Articles"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$result = $this->get_invoiceLine();
$pdf->write_cell(50, 4, _("Code"), border: 'B');
- $pdf->write_cell(50, 4, _("Description"), border: 'B');
- $pdf->write_cell(30, 4, _("TVA"), border: 'B', align: 'R');
- $pdf->write_cell(25, 4, _("Quantité"), border: 'B', align: 'R');
- $pdf->write_cell(25, 4, _("Montant HT"), border: 'B', align: 'R');
+ $pdf->write_cell(60, 4, _("Description"), border: 'B');
+ $pdf->write_cell(20, 4, _("TVA"), border: 'B', align: 'R');
+ $pdf->write_cell(20, 4, _("Prix unitaire"), border: 'B', align: 'R');
+ $pdf->write_cell(20, 4, _("Quantité"), border: 'B', align: 'R');
+ $pdf->write_cell(20, 4, _("Montant HT"), border: 'B', align: 'R');
$pdf->line_new();
$nb_inline = count($result);
for ($i = 0; $i < $nb_inline; $i++)
{
- $pdf->write_cell(50, 4, $result[$i]['name']);
- $pdf->write_cell(50, 4, $result[$i]['description']);
- $pdf->write_cell(25, 4, $result[$i]['tva_percent'], align: 'R');
- $pdf->write_cell(5, 4, $result[$i]['tva_id']);
- $pdf->write_cell(25, 4, $result[$i]['quantity'], align: 'R');
- $pdf->write_cell(25, 4, nbm($result[$i]['amount']), align: 'R');
+ if ( $result[$i]['description'] == '') {
+ $pdf->write_multi(110, 4, $result[$i]['name']);
+ }else {
+ $pdf->write_multi(50, 4, $result[$i]['name']);
+ $pdf->write_multi(60, 4, $result[$i]['description']);
+ }
+ $pdf->write_cell(20, 4, $result[$i]['tva_percent'], align: 'R');
+ //$pdf->write_cell(5, 4, $result[$i]['tva_id']);
+ $pdf->write_cell(20, 4, $result[$i]['unit_price'], align: 'R');
+ $pdf->write_cell(20, 4, $result[$i]['quantity'], align: 'R');
+ $pdf->write_cell(20, 4, nbm($result[$i]['amount']), align: 'R');
$pdf->line_new();
}
$pdf->line_new(10);
-
+
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60, 4, _("Totaux"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$result = $this->get_amount_summary();
// @TODO DNY : Qu'est-ce que LineExtension Amount ??
@@ -535,9 +594,11 @@ abstract class XML_Reader
$nb_inline = count($result);
if ( !empty ($result ))
{
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60, 4, _("Charge et déduction"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$pdf->write_cell(20, 4, _("code"), align: 'L', border: '1');
$pdf->write_cell(20, 4, _("Type"), border: '1');
@@ -564,13 +625,15 @@ abstract class XML_Reader
$pdf->line_new();
}
}
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60, 4, _("TVA"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$result = $this->get_taxes();
$pdf->write_cell(25, 4, _("% Taxe"), align: 'R', border: 'B');
- $pdf->write_cell(5, 4, _("Code taxe"), border: 'B');
+ $pdf->write_cell(30, 4, _("Code taxe"), border: 'B');
$pdf->write_cell(50, 4, _("Base"), align: 'R', border: 'B');
$pdf->write_cell(50, 4, _("Taxe"), align: 'R', border: 'B');
$pdf->line_new();
@@ -579,7 +642,7 @@ abstract class XML_Reader
{
$pdf->write_cell(25, 4, $result[$i]['tax_percent'], align: 'R');
$pdf->write_cell(5, 4, $result[$i]['tax_id']);
- $pdf->write_cell(25, 4, $result[$i]['vatex']);
+ $pdf->write_multi(25, 4, $result[$i]['vatex']);
$pdf->write_cell(50, 4, nbm($result[$i]['taxable_amount']), align: 'R');
$pdf->write_cell(50, 4, nbm($result[$i]['tax']), align: 'R');
@@ -589,8 +652,11 @@ abstract class XML_Reader
$pdf->setFont("DejaVu", "B", 12);
+ $pdf->SetTextColor(0,0,127);
$pdf->write_cell(60, 4, _("Paiement"));
- $pdf->line_new(10);
+ $pdf->line_new(6);
+ $pdf->SetTextColor(0,0,0);
+
$pdf->setFont("DejaVu", "", 7);
$result = $this->get_payment_mean();
$pdf->write_cell(50, 4, _("Code"));
@@ -612,6 +678,7 @@ abstract class XML_Reader
$pdf->write_multi(140, 4, str_replace(["\n", "\r", "\t"], " ", $result['note'][$i]));
$pdf->line_new();
}
+ $pdf->line_new(6);
/**
* display name of embedded from files
* @var $result(array of Document_Reference)
@@ -619,17 +686,19 @@ abstract class XML_Reader
$result=$this->get_embedded_document();
if ( count($result) > 0)
{
+ $pdf->SetTextColor(0,0,127);
$pdf->setFont("DejaVu", "B", 12);
$pdf->write_cell(60,4,_('Documents inclus'));
$pdf->line_new();
+ $pdf->SetTextColor(0,0,0);
$pdf->setFont("DejaVu", "", 7);
$nb_result=count($result);
for ($i=0;$i< $nb_result;$i++)
{
$binary=$result[$i]->getBinary_object();
- $pdf->write_cell(50,4,$result[$i]->getId());
- $pdf->write_cell(50,4,$binary->filename);
- $pdf->write_cell(50,4,$result[$i]->getDescription());
+ $pdf->write_multi(50,4,$result[$i]->getId());
+ $pdf->write_multi(50,4,$binary->filename);
+ $pdf->write_multi(50,4,$result[$i]->getDescription());
$pdf->line_new();
}
diff --git a/include/XMLDocument/xmlcreditnote_reader.class.php b/include/XMLDocument/xmlcreditnote_reader.class.php
index d2f845bab..848ca78de 100644
--- a/include/XMLDocument/xmlcreditnote_reader.class.php
+++ b/include/XMLDocument/xmlcreditnote_reader.class.php
@@ -143,15 +143,14 @@ class XMLCreditNote_Reader extends XML_Reader
for ($e = 0; $e < $node->length; $e++)
{
$row = [];
- $xml = simplexml_import_dom($node->item($e));
- $row ['quantity'] = $this->get_node_value("//cbc:CreditedQuantity", $e);
- $row ['amount'] = $this->get_node_value("//cbc:LineExtensionAmount", $e);
- $row ['description'] = $this->get_node_value("//cac:Item/cbc:Description", $e);
- $row ['name'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cbc:Name", $e);
- $row ['unit_price'] = $this->get_node_value("//cac:CreditNoteLine/cac:Price/cbc:PriceAmount", $e);
- $row ['tva_id'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID", $e);
- $row ['tva_percent'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", $e);
-
+ $row ['quantity'] = $node->item($e)->getElementsByTagName("CreditedQuantity")->item(0)->textContent;
+ $row ['code_quantity'] = $node->item($e)->getElementsByTagName("CreditedQuantity")->item(0)->getAttribute('unitCode');
+ $row ['amount'] = $node->item($e)->getElementsByTagName("LineExtensionAmount")->item(0)->textContent;
+ $row ['description'] = $node->item($e)->getElementsByTagName("Description")->item(0)?->textContent;
+ $row ['name'] = $node->item($e)->getElementsByTagName("Name")->item(0)->textContent;
+ $row ['unit_price'] = $node->item($e)->getElementsByTagName("PriceAmount")->item(0)->textContent;
+ $row ['tva_id'] = $node->item($e)->getElementsByTagName("ID")->item(0)->textContent;
+ $row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)?->textContent;
$result[] = $row;
}
return $result;
diff --git a/include/XMLDocument/xmlinvoice.class.php b/include/XMLDocument/xmlinvoice.class.php
index 52244fc32..84509ea73 100644
--- a/include/XMLDocument/xmlinvoice.class.php
+++ b/include/XMLDocument/xmlinvoice.class.php
@@ -208,8 +208,16 @@ abstract class XMLInvoice extends \DOMDocument
$card=new \Fiche($this->cn,$operation->det->array[$i]['qs_fiche']);
$result['operation'][$i]['qcode']=$card->get_attribute(ATTR_DEF_QUICKCODE);
$result['operation'][$i]['name']=$card->get_attribute(ATTR_DEF_NAME);
- $result['operation'][$i]['description']=($operation->det->array[$i]['j_text']=="")?$card->get_attribute(9):$operation->det->array[$i]['j_text'];
-
+ $result['operation'][$i]['description']=$operation->det->array[$i]['j_text'];
+ if ($operation->det->array[$i]['j_text'] == "")
+ {
+ $a=$card->get_attribute(9);
+ if ( $a != "") {
+ $result['operation'][$i]['description']=$a;
+ }else {
+ $result['operation'][$i]['description']=$result['operation'][$i]['name'];
+ }
+ }
// get the type of unity, if not found then it will be EA
$x= $card->get_attribute(ATTR_DEF_QUANTITY_TYPE,0);
$result['operation'][$i]['code_quantity']=($x===false||$x=="")?"EA":$x;
@@ -257,7 +265,7 @@ abstract class XMLInvoice extends \DOMDocument
}
}
- $result['info']['communication']=($result['info']['communication']=="")?$result['id']:"";
+ $result['info']['communication']=($result['info']['communication']=="")?$result['id']:$result['info']['communication'];
$result['document']=$this->fill_document($jr_id);
/**
@@ -292,7 +300,10 @@ abstract class XMLInvoice extends \DOMDocument
$VAT_SubTotal[$idx_subtotal]=array();
$VAT_SubTotal[$idx_subtotal]['idx']=$idx;
$VAT_SubTotal[$idx_subtotal]['vat_code']=$result['operation'][$i]['vat_code'] ;
- $VAT_SubTotal[$idx_subtotal]['percent']=$percent;
+ if ( $acc_tva->tva_both_side == 1 )
+ $VAT_SubTotal[$idx_subtotal]['percent']=0;
+ else
+ $VAT_SubTotal[$idx_subtotal]['percent']=$percent;
$VAT_SubTotal[$idx_subtotal]['vatex']=$acc_tva->vx_code;
$VAT_SubTotal[$idx_subtotal]['amount']=$VAT_SubTotal[$idx_subtotal]['vat']=0;
@@ -302,12 +313,19 @@ abstract class XMLInvoice extends \DOMDocument
* @todo Pour les intracomm , quel taux utilisé ? 0 ou 21%
*/
$VAT_SubTotal[$n]['amount']=bcadd($VAT_SubTotal[$n]['amount'],$result['operation'][$i]['price']);
- $VAT_SubTotal[$n]['vat']=bcadd($VAT_SubTotal[$n]['vat'],$result['operation'][$i]['vat']);
- $VAT_SubTotal[$n]['vat']=bcsub($VAT_SubTotal[$n]['vat'],$result['operation'][$i]['vat_reversed']);
+ if ( $acc_tva->tva_both_side == 0 )
+ $VAT_SubTotal[$n]['vat']=bcadd($VAT_SubTotal[$n]['vat'],$result['operation'][$i]['vat']);
+
$result['TaxableAmount']=bcadd( $result['TaxableAmount'],$result['operation'][$i]['price']);
- $result['TaxAmount']=bcadd( $result['TaxAmount'],$result['operation'][$i]['vat']);
- $result['TaxAmount']=bcsub( $result['TaxAmount'],$result['operation'][$i]['vat_reversed']);
+
+ // $result['TaxAmount']=bcsub( $result['TaxAmount'],$result['operation'][$i]['vat_reversed']);
$result['operation'][$i]['vat_percent']=$percent;
+ if ( $acc_tva->tva_both_side == 1 )
+ {
+ $result['operation'][$i]['vat_percent']=0;
+ }else {
+ $result['TaxAmount']=bcadd( $result['TaxAmount'],$result['operation'][$i]['vat']);
+ }
}
$result['subTotalVAT']=$VAT_SubTotal;
$result['LineExtensionAmount']= $result['TaxableAmount'];
diff --git a/include/XMLDocument/xmlinvoice_reader.class.php b/include/XMLDocument/xmlinvoice_reader.class.php
index eb94cdb4a..eafb539cc 100644
--- a/include/XMLDocument/xmlinvoice_reader.class.php
+++ b/include/XMLDocument/xmlinvoice_reader.class.php
@@ -109,17 +109,17 @@ class XMLInvoice_Reader extends XML_Reader
for ($e = 0; $e < $node->length; $e++)
{
$row = [];
- $row ['quantity'] = $this->get_node_value("//cbc:InvoicedQuantity", $e);
- $row ['amount'] = $this->get_node_value("//cbc:LineExtensionAmount", $e);
- $row ['description'] = $this->get_node_value("//cac:Item/cbc:Description", $e);
- $row ['name'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cbc:Name", $e);
- $row ['unit_price'] = $this->get_node_value("//cac:InvoiceLine/cac:Price/cbc:PriceAmount", $e);
- $row ['tva_id'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID", $e);
- $row ['tva_percent'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", $e);
-
+ $row ['quantity'] = $node->item($e)->getElementsByTagName("InvoicedQuantity")->item(0)->textContent;
+ $row ['code_quantity'] = $node->item($e)->getElementsByTagName("InvoicedQuantity")->item(0)->getAttribute('unitCode');
+ $row ['amount'] = $node->item($e)->getElementsByTagName("LineExtensionAmount")->item(0)->textContent;
+ $row ['description'] = $node->item($e)->getElementsByTagName("Description")->item(0)?->textContent;
+ $row ['name'] = $node->item($e)->getElementsByTagName("Name")->item(0)->textContent;
+ $row ['unit_price'] = $node->item($e)->getElementsByTagName("PriceAmount")->item(0)->textContent;
+ $row ['tva_id'] = $node->item($e)->getElementsByTagName("ID")->item(0)?->textContent;
+ $row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)?->textContent;
$result[] = $row;
- return $result;
}
+ return $result;
}
/**
* @brief return the code of the document
@@ -164,7 +164,12 @@ class XMLInvoice_Reader extends XML_Reader
$row ['taxable_amount'] = $xml->xpath("//cbc:TaxableAmount")[$e] . "";
$row ['tax'] = $xml->xpath("//cbc:TaxAmount")[$e] . "";
$row ['tax_id'] = $xml->xpath("//cac:TaxCategory/cbc:ID")[$e] . "";
- $row ['tax_percent'] = $xml->xpath("//cac:TaxCategory/cbc:Percent")[$e] . "";
+ $row ['tax_percent'] =0;
+ $r=$xml->xpath("//cac:TaxCategory/cbc:Percent");
+ if ( isset($r[$e]) )
+ {
+ $row ['tax_percent'] = $xml->xpath("//cac:TaxCategory/cbc:Percent")[$e] . "";
+ }
if (isset($xml->xpath("//cac:InvoiceLine/cac:Item/cbc:Name")[$e]))
{
$row ['name'] =$xml->xpath("//cac:InvoiceLine/cac:Item/cbc:Name")[$e]."";
diff --git a/include/admin_logfile.inc.php b/include/admin_logfile.inc.php
new file mode 100644
index 000000000..ef24a9e8b
--- /dev/null
+++ b/include/admin_logfile.inc.php
@@ -0,0 +1,93 @@
+';
+print '';
+print _("Fichiers trace");
+print "
";
+//print p(_("Fichiers trace"),' class="text-muted"');
+
+$directory=dir( NOALYSS_BASE.DIRECTORY_SEPARATOR."log");
+$a_file=[];
+while ( $file = $directory->read()) {
+ if (preg_match("/noalyss.*log/", $file)) {
+ $a_file[]=$file;
+ }
+
+}
+
+rsort($a_file);
+$nb_file=count($a_file);
+if ( $nb_file == 0) {
+ echo p(_("Aucune donnée"),' class="notice"');
+ return;
+}
+if ( $http->get("sa","string","x")=="dwn")
+{
+ $file=$http->get("file");
+ if (! in_array($file,$a_file ) )
+ {
+ echo_warning(sprintf("%s non trouvé",$file));
+ record_log("admin_logfile : {$file} not found");
+ return;
+ }
+ print "";
+ print "- ";
+ print \HtmlInput::button_anchor(_("Retour"), NOALYSS_URL."/admin-noalyss.php?action=logfile");
+ print "
";
+ print "- ";
+ print \HtmlInput::button_anchor(_("Télécharger").''
+ , NOALYSS_URL."/export.php?admin=1&action=logfile&file={$file}");
+
+ print "
";
+ print "
";
+ echo '
';
+ echo file_get_contents(NOALYSS_BASE.DIRECTORY_SEPARATOR."/log/{$file}");
+ echo '';
+ print "";
+ print "- ";
+ print \HtmlInput::button_anchor(_("Retour"), NOALYSS_URL."/admin-noalyss.php?action=logfile");
+ print "
";
+ print "- ";
+ print \HtmlInput::button_anchor(_("Télécharger").''
+ , NOALYSS_URL."/export.php?admin=1&action=logfile&file={$file}");
+
+ print "
";
+ print "
";
+ return;
+}
+echo '';
+for ( $i=0;$i < $nb_file;$i++)
+{
+ $url=sprintf("%s?%s", NOALYSS_URL."/admin-noalyss.php"
+ , http_build_query(["action"=>"logfile","sa"=>"dwn","file"=>$a_file[$i]]));
+ printf ("- %s
",$url,$a_file[$i]);
+}
+print "
";
\ No newline at end of file
diff --git a/include/admin_repo.inc.php b/include/admin_repo.inc.php
index e1fd207c2..651c6b015 100644
--- a/include/admin_repo.inc.php
+++ b/include/admin_repo.inc.php
@@ -47,6 +47,7 @@ if ($User->admin != 1)
{
$theme=(isset($User->theme))?$User->theme:"";
$User->audit('FAIL',"ADMIN : [$action]".var_export($_REQUEST,true));
+ record_log("Security alert [{$action}]".var_export($_REQUEST,true));
html_page_start($theme);
echo '';
echo "
";
@@ -206,6 +207,12 @@ hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #0
echo $html->saveHTML();
}
+if ($action== 'logfile' && SYSINFO_DISPLAY == true )
+{
+ /* List the connexion successfull and failed */
+ require_once NOALYSS_INCLUDE."/admin_logfile.inc.php";
+}
+
//------------------------------------------------------------------------------
// Upgrade
//------------------------------------------------------------------------------
diff --git a/include/ajax/ajax_bookmark.php b/include/ajax/ajax_bookmark.php
index d0557fb67..824e74c0b 100644
--- a/include/ajax/ajax_bookmark.php
+++ b/include/ajax/ajax_bookmark.php
@@ -123,9 +123,15 @@ endif;
echo _("Menu actuel")." : ".hb($_GET['ac']);
echo HtmlInput::array_to_hidden(array("gDossier","ac"), $_REQUEST);
?>
-
-
+
+
+ -
+ =\HtmlInput::button_hide("bookmark_div")?>
+
+ -
+
+
+
+
-
-
diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php
index 7009598e7..f52bc70e3 100644
--- a/include/ajax/ajax_card.php
+++ b/include/ajax/ajax_card.php
@@ -88,7 +88,6 @@ $html=var_export($_REQUEST,true);
// For storing extra information , example the HTML elt id to update
// after creating
$extra="";
-$http=new \HttpInput();
switch($op2)
{
case 'attribute':
@@ -717,7 +716,7 @@ case 'upc':
}
else
{
- if ($cn->get_value('select count(*) from fiche where f_id=$1',array($_GET['f_id'])) == '0' )
+ if ($cn->get_value('select count(*) from fiche where f_id=$1',array($http->get('f_id'))) == '0' )
{
$html.=alert(_('Fiche non valide'),true);
}
@@ -726,7 +725,7 @@ case 'upc':
{
$html=HtmlInput::title_box(_('Détail fiche (sauvée)'),$ctl);
- $f=new Fiche($cn,$_GET['f_id']);
+ $f=new Fiche($cn,$http->get('f_id'));
ob_start();
$f->update($_GET);
$html.=ob_get_contents();
diff --git a/include/ajax/ajax_ledger.php b/include/ajax/ajax_ledger.php
index d5d042c7d..eba232337 100644
--- a/include/ajax/ajax_ledger.php
+++ b/include/ajax/ajax_ledger.php
@@ -564,7 +564,7 @@ switch ($action) {
break;
case 'note_refresh':
$acc_operation_note= Acc_Operation_Note::build_jrn_id($jr_id);
- echo substr($acc_operation_note->getNote()??"",0,120);
+ echo mb_substr($acc_operation_note->getNote()??"",0,120);
return;
case "rmsup":
diff --git a/include/ajax/ajax_navigator.php b/include/ajax/ajax_navigator.php
index 867c70885..00b8beefd 100644
--- a/include/ajax/ajax_navigator.php
+++ b/include/ajax/ajax_navigator.php
@@ -113,7 +113,11 @@ for ($i=0;$i<$nMax;$i++):
-
+
+ -
+ =\HtmlInput::button_hide("navi_div")?>
+
+
- input();
- ?>
+
+ input(); ?>
+
+
+ value; ?>
+
+
dt_id) == "ONE_EDIT" )
{
+ echo '';
}
-
- if ( count($acomment) > 0
+ //------------------------------------------------
+ // Multiple comments
+ //------------------------------------------------
+
+ if ( count($acomment) > 0
&& Document_Option::can_add_comment($ag_id)
&& Document_Option::option_comment($this->dt_id) == "SOME_FIXED")
{
echo h2(_("Commentaire"));
-
+ echo '