diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css
index bab8568b8..410b6815a 100644
--- a/html/css/style-classic7.css
+++ b/html/css/style-classic7.css
@@ -25,16 +25,18 @@ BODY {
color:darkblue !important;
background-color:#FCFDFD;
--hover : rgba(108, 130, 208, 0.9);
- --border-size:4px;
+ --border-size:8px;
--accent-color:lightblue;
+ --input-color:#4b4b91;
+ --color-red:Crimson;
}
input{
font-family: 'OpenSansRegular';
padding : 2px;
margin:2px;
- border:1px solid #4b4b91;
- font-size:14px;
- color:#4b4b91;
+ border:1px solid var(--input-color);
+
+ color:var(--input-color);
}
input:focus {
@@ -112,16 +114,16 @@ h2 {
background-color:#9fbcd6;
/*! margin:1px; */
font-style: italic;
- font-size:15px;
+
font-size:1.1rem !important;
margin-top: 5px;
- font-size: 1.1rem;
-margin-bottom: 1rem;
-margin-top: 1rem;
-margin-right:1rem;
-margin-left:1rem;
-border-radius: 10px 0px;
-padding:1rem;
+ font-size: 1.20rem;
+ margin-bottom: 1rem;
+ margin-top: 1rem;
+ margin-right:1rem;
+ margin-left:1rem;
+ border-radius: 10px;
+ padding:1rem;
}
@media only screen and (max-width: 1280px) {
h2{
@@ -261,6 +263,43 @@ td.tool a.mtitle:hover {
transition:color 300ms ease-in-out;
}
+ #module .nav-pills a.nav-link:hover {
+ color:white !important;
+ border:1px solid transparent;
+ }
+ #module .nav-item-active , #module .nav-item-active > a.nav-link{
+ background-color: #5d90cd ;
+ color:white !important;
+ border: 0px solid black;
+ }
+ /* animate module : sliding */
+ #module .nav-item-module {
+ position:relative;
+ background-color: white;
+ color:navy;
+ }
+ #module .nav-item-module.nav-item-slide::before {
+ content:'';
+ top:0;
+ left:0;
+ bottom:0;
+ right:0;
+ position:absolute;
+ background-color:#5d90cd;
+ z-index:-1;
+ transform:scaleX(0);
+ transition:transform 300ms ease-in-out;
+ mix-blend-mode: darken;
+ }
+ #module .nav-item-module.nav-item-slide:hover::before,
+ #module .nav-item-module.nav-item-slide:focus::before {
+ transform:scaleX(1);
+ }
+ #module .nav-item-slide {
+ z-index:0;
+ transition:color 300ms ease-in-out;
+ }
+
@@ -280,6 +319,7 @@ td.tool a.mtitle:hover {
/**
menu left (not used)
*/
+
div.lmenu {
float:left;
clear:left;
@@ -301,7 +341,7 @@ div.content{
width:99.7%;
font-family: Arial, Helvetica, "Liberation Sans", FreeSans, sans-serif;
font-family: 'OpenSansRegular';
- font-size:12px;
+ font-size:100%;
font-size:1rem;
}
@@ -471,7 +511,7 @@ tr.odd > td,tr.even > td {
}
.highlight {
font-weight: bolder;
- font-size:14px;
+ font-size:105%;
font-size:1.05rem;
}
tr.highlight {
@@ -671,7 +711,7 @@ a.document:hover {
margin:1px;
}
.input_text {
- border:1px solid #4b4b91;
+ border:1px solid var(--input-color);
margin:1px;
border-radius: 5px;
}
@@ -698,7 +738,7 @@ a.document:hover {
h1.legend, legend {
font-weight: bold;
font-style: italic;
- font-size: 19.2px;
+ font-size: 120%;
font-size: 1.2rem;
border: navy;
border-width: 1px;
@@ -968,7 +1008,7 @@ a#smallanchorbutton, .smallbutton, a.smallbutton,div.content a.smallbutton {
font-weight: normal;
text-decoration:none;
font-family: arial,verdana,sans-serif,helvetica;
- font-size:12px;
+ font-size:85%;
font-size:0.85rem;
font-family: SansationLight;
border-style: ridge ;
@@ -1050,7 +1090,7 @@ td.toolselected a.mtitle {
background-color:#FF0000;
}
div.topmenu {
- font-size:13.6px;
+ font-size:100%;
font-size:1rem;
}
@@ -1135,7 +1175,7 @@ div.inner_box {
border:1px solid #00008B;
-moz-box-shadow: 10px 10px 5px #888;
box-shadow: 15px 15px 15px #888;
- font-size:14.4px;
+ font-size:90%;
font-size:0.9rem;
width: 100%;
left:0px ;
@@ -1154,7 +1194,7 @@ div.inner_box {
border:1px solid #00008B;
-moz-box-shadow: 10px 10px 5px #888;
box-shadow: 15px 15px 15px #888;
- font-size:14.4px;
+ font-size:90%;
font-size:0.9rem;
width: 50%;
left:22% ;
@@ -1496,7 +1536,7 @@ div.content a.nav:hover img,a.nav:hover img {
}
div.foldercontent {
- font-size:14px;
+ font-size:95%;
font-size:0.95rem;
width: 95%;
margin-left: 2.5%;
@@ -1522,7 +1562,7 @@ div.foldercontent {
}
div.foldercontent {
- font-size:14px;
+ font-size:95%;
font-size:0.95rem;
width: 95%;
margin-left: 2.5%;
@@ -1603,7 +1643,7 @@ div.myfieldset
border-style: groove;
}
div.menu2 a.mtitle{
- font-size:13.6px;
+ font-size:100%;
font-size:1rem;
font-weight: normal;
/*color: darkblue;*/
@@ -1629,7 +1669,7 @@ div.menu2 table {
/*! border-spacing:1px; */
}
div.menu3 {
- font-size:13.6px;
+ font-size:80%;
font-size:0.80rem;
}
@@ -1640,7 +1680,7 @@ div.menu3 {
margin-left:30px;
}
#folder {
- border: 1px solid #4b4b91;
+ border: 1px solid var(--input-color);
border-collapse: separate;
border-radius: 10px;
border-spacing: 0px;
@@ -1887,7 +1927,7 @@ left:25%;
/**========*/
#error_div h2 {
- background: #FF0000;
+ background: var(--color-red);
}
div#error_content_div {
color:#FF0000;
@@ -1902,7 +1942,7 @@ td.workday ol {
}
input.inum {
text-align:right;
- border:1px solid #4b4b91;
+ border:1px solid var(--input-color);
margin:2px;
border-radius: 5px;
}
@@ -1912,7 +1952,7 @@ div.box {
font-family: 'openSansRegular';
overflow:hidden;
border:1px solid #00008B;
- font-size:10px;
+ font-size:90%;
font-size:0.90rem;
border-radius:5px;
width:97%;
@@ -1962,7 +2002,7 @@ div.even ,div.box tr.even {
padding:2px;
}
#jrn_name_div h2{
- font-size:38.4px;
+ font-size:240%;
font-size: 2.4rem;
}
#search_account {
@@ -2187,7 +2227,7 @@ hr {
******************************************************************************/
li.highlight,tr.highlight{
font-weight: bolder;
- font-size:14px;
+ font-size:90%;
background-color: #8A8787;
color:whitesmoke !important;
border-width: 2px;
@@ -2256,7 +2296,7 @@ div.content a.tinybutton,a.tinybutton{
/* background-image: url("font/bg-submit2.gif");
background-repeat: repeat-x;
background-position: left; */
- font-size: 8px;
+ font-size: 70%;
font-size: 0.7rem;
padding-bottom: 0px;
padding-top: 0px;
@@ -2279,7 +2319,7 @@ input[type="button"].tinybutton {
font-weight: bold;
text-decoration: none;
font-family: arial,verdana,sans-serif,helvetica;
- font-size: 8px;
+ font-size: 70%;
font-size: 0.7rem;
padding-bottom: 0px;
padding-top: 0px;
@@ -2472,7 +2512,7 @@ width: 85%;
/*! background-image: url("font/bg-submit2.gif"); */
/*! background-repeat: repeat-x; */
/*! background-position: left; */
- font-size:12px;
+ font-size:85%;
font-size:0.85rem;
font-family: SansationLight;
border-style: ridge ;
@@ -2508,7 +2548,8 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', end
width: 75%;
display: inline-block;
background-color: white;
- font-size: 16px;
+ font-size: 100%;
+ font-size: 1rem;
padding: 8px;
}
@@ -2758,7 +2799,7 @@ div.bxbutton .icon
margin-left: 6px;
margin-right:6px;
/*! padding-top:10px; */
- font-size:14px;
+ font-size:100%;
font-size:1rem;
cursor: pointer;
border:0px;
@@ -3283,10 +3324,10 @@ margin:1px;
margin: 1px;
background: navy;
color: white;
- border-radius: 3px;
+ border-radius: 4px;
}
.nav-fill .nav-item:hover {
- background-color:#6393c1;
+ background-color:#6393c1;
color:navy;
text-decoration: none;
}
@@ -3301,9 +3342,39 @@ margin:1px;
color:white ;
}
-li.li-active {
- background-color: lightgray !important;
+ /****************************************/
+ /* MENU LEVEL 0 */
+ /****************************************/
+.nav-level0 {
+
}
+
+ /* SM */
+ @media (min-width: 576px) {
+
+ }
+
+ /* MD */
+ @media (min-width: 768px) {
+ .nav-level0 > li >a {
+ padding:6%;
+ }
+
+ }
+
+ /* LG */
+ @media (min-width: 992px) {
+
+ }
+
+ /* XL */
+ @media (min-width: 1200px) {
+
+ }
+/****************************************/
+ /* MENU LEVEL2 */
+/****************************************/
+
.nav-level2 {
background-color: hsl(240, 39%, 41.2%);
}
@@ -3316,10 +3387,21 @@ li.li-active {
color:navy;
text-decoration: none;
}
+
+ /* MD */
+ @media (min-width: 768px) {
+ .nav-level2 .nav-item {
+ padding : 0%;
+ }
+ }
+
+/****************************************/
+ /* MENU LEVEL 3 */
+ /***************************************/
.nav-level3 {
background-color:#336699;
-
-
+
+
}
.nav-level3>li {
border-right: 1px #9fbcd6 ridge;
@@ -3337,9 +3419,9 @@ li.li-active {
border-radius:0px !important;
}
-/**
- * Module for smartphone menu
- */
+ /****************************************/
+ /* Module for smartphone menu */
+ /***************************************/
#mobile_module .nav-pills a.nav-link {
background-color:transparent !important;
color:navy !important;
@@ -3722,7 +3804,7 @@ h2.h-section {
height:var(--border-size);
background-color:lightblue;
transform:scaleX(0);
- transition:transform 300ms ease-in-out;
+ transition:transform 150ms ease-in-out;
}
.nav-item.nav-item-underline:hover::before,
@@ -3733,7 +3815,7 @@ h2.h-section {
.nav-item.li-active.nav-item-underline::before {
transform: scale(1);
- background-color: darkred;
+ background-color: #d03100;
}
/**
@@ -3747,9 +3829,58 @@ h2.h-section {
left: 0;
right: 0;
background-color:darkorange;
- height: 3px;
+ height: var(--border-size);
}
.nav-level3 .nav-link.active::after {
background-color:yellow;
- }
\ No newline at end of file
+ }
+/***
+ * Animate menu
+ *
+ */
+
+.nav-item {
+ position:relative;
+
+}
+
+.nav-item.nav-item-underline::before {
+ content:'';
+ left:0;
+ bottom:0;
+ right:0;
+ position:absolute;
+ height:var(--border-size);
+ background-color:lightblue;
+ transform:scaleX(0);
+ transition:transform 300ms ease-in-out;
+}
+
+.nav-item.nav-item-underline:hover::before,
+.nav-item.nav-item-underline:focus::before
+{
+ transform:scaleX(1);
+}
+
+ .nav-item.li-active.nav-item-underline::before {
+ transform: scale(1);
+ background-color: var(--color-red);
+ }
+
+ /**
+ * For level 2 and 3 no animation but border difference if active
+ */
+
+ .nav-level2 .nav-link.active::after, .nav-level3 .nav-link.active::after {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color:darkorange;
+ }
+
+ .nav-level3 .nav-link.active::after {
+ background-color:yellow;
+ }
diff --git a/html/export.php b/html/export.php
index 4c4443cca..b5faeb100 100644
--- a/html/export.php
+++ b/html/export.php
@@ -53,6 +53,27 @@ if ( $action=='X' || $g_user->check_print($action)==0 )
// get file and execute it
$prfile=$cn->get_value("select me_file from menu_ref where me_code=$1",array($action));
+
+if ( LOGINPUT)
+{
+ $file_loginput=fopen($_ENV['TMP'].'/export-'.$prfile.'-'.$_SERVER['REQUEST_TIME'].'.php','a+');
+ fwrite ($file_loginput,"search($http->request("plugin_code")) != -1 )
{
exit();
}
+ if ( LOGINPUT)
+ {
+ $file_loginput=fopen($_ENV['TMP'].'/plugin-export-'.$ext->me_code.'-'.$_SERVER['REQUEST_TIME'].'.php','a+');
+ fwrite ($file_loginput,"me_code."\n");
+ fwrite($file_loginput, '$_GET='.var_export($_GET,true));
+ fwrite($file_loginput,";\n");
+ fwrite($file_loginput, '$_POST='.var_export($_POST,true));
+ fwrite($file_loginput,";\n");
+ fwrite($file_loginput, '$_POST[\'gDossier\']=$gDossierLogInput;');
+ fwrite($file_loginput,"\n");
+ fwrite($file_loginput, '$_GET[\'gDossier\']=$gDossierLogInput;');
+ fwrite($file_loginput,"\n");
+ fwrite($file_loginput,' $_REQUEST=array_merge($_GET,$_POST);');
+ fwrite($file_loginput,"\n");
+ $string='require_once "'.NOALYSS_PLUGIN.DIRECTORY_SEPARATOR.dirname(trim($ext->getp('me_file'))).DIRECTORY_SEPARATOR.'raw.php'.'";';
+ fwrite($file_loginput,sprintf("%s",$string));
+ fwrite($file_loginput,"\n");
+ fclose($file_loginput);
+ }
/* call the ajax script */
- require_once(NOALYSS_PLUGIN.DIRECTORY_SEPARATOR.dirname(trim($ext->getp('me_file'))).DIRECTORY_SEPARATOR.'raw.php');
+ require_once NOALYSS_PLUGIN.DIRECTORY_SEPARATOR.dirname(trim($ext->getp('me_file'))).DIRECTORY_SEPARATOR.'raw.php';
}
else
{
diff --git a/html/js/acc_currency.js b/html/js/acc_currency.js
index 5c6d238d1..f2188a9fe 100644
--- a/html/js/acc_currency.js
+++ b/html/js/acc_currency.js
@@ -45,7 +45,7 @@ function CurrencyRateDelete(p_dossier, p_id)
if ( answer['status'] == 'NOK') {
smoke.alert(answer['content']);
} else {
- $('currency_rate_'+p_id).hide();
+ id$('currency_rate_'+p_id).hide();
alternate_row_color("currency_rate_table");
}
}
@@ -64,11 +64,11 @@ function CurrencyUpdateValue(p_dossier,p_code,p_update)
new Ajax.Request("ajax_misc.php",{
method:"get",
asynchronous:false,
- parameters:{p_code:$(p_code).value,gDossier:p_dossier,op:'CurrencyRate'},
+ parameters:{p_code:id$(p_code).value,gDossier:p_dossier,op:'CurrencyRate'},
onSuccess:function (req) {
var answer=req.responseText.evalJSON();
if ( answer.status == "OK") {
- $(p_update).value=answer.content;
+ id$(p_update).value=answer.content;
} else {
smoke.alert(answer.content);
}
@@ -84,11 +84,11 @@ function CurrencyUpdateCode(p_dossier,p_code,p_update)
{
new Ajax.Request("ajax_misc.php",{
method:"get",
- parameters:{p_code:$(p_code).value,gDossier:p_dossier,op:'CurrencyCode'},
+ parameters:{p_code:id$(p_code).value,gDossier:p_dossier,op:'CurrencyCode'},
onSuccess:function (req) {
var answer=req.responseText.evalJSON();
if ( answer.status == "OK") {
- $(p_update).innerHTML=answer.content;
+ id$(p_update).innerHTML=answer.content;
} else {
smoke.alert(answer.content);
}
@@ -104,22 +104,22 @@ function CurrencyCompute(p_rate,p_update)
{
var tvac=1;
- if ($('tvac')) {
- tvac=$('tvac').innerHTML;
- } else if ($("htva")) {
- tvac=$('htva').innerHTML;
+ if (document.getElementById('tvac')) {
+ tvac=id$('tvac').innerHTML;
+ } else if (document.getElementById("htva")) {
+ tvac=id$('htva').innerHTML;
}
if ( isNaN(tvac)) {
tvac=1;
}
- var rate=$(p_rate).value;
+ var rate=id$(p_rate).value;
if ( isNaN(rate)) {
rate=1;
}
var tot=tvac/rate;
tot=Math.round(tot*100)/100;
- $(p_update).innerHTML=tot;
+ id$(p_update).innerHTML=tot;
}
/**
@@ -131,8 +131,8 @@ function CurrencyCompute(p_rate,p_update)
*/
function CurrencyComputeMisc(p_rate,p_update)
{
- var debAmount=$('totalDeb').innerHTML;
- var credAmount=$('totalCred').innerHTML;
+ var debAmount=id$('totalDeb').innerHTML;
+ var credAmount=id$('totalCred').innerHTML;
if ( isNaN(debAmount)) {
debAmount=0;
@@ -140,17 +140,17 @@ function CurrencyComputeMisc(p_rate,p_update)
if ( isNaN(credAmount)) {
credAmount=0;
}
- var rate=$(p_rate).value;
+ var rate=id$(p_rate).value;
if ( isNaN(rate) || parseFloat(rate) == 0) {
rate=1;
}
var totDeb=debAmount/rate;
totDeb=Math.round(totDeb*100)/100;
- $('default_currency_deb').innerHTML=totDeb;
+ id$('default_currency_deb').innerHTML=totDeb;
var totCred=credAmount/rate;
totCred=Math.round(totCred*100)/100;
- $('default_currency_cred').innerHTML=totCred;
+ id$('default_currency_cred').innerHTML=totCred;
}
@@ -166,10 +166,10 @@ function CurrencyComputeMisc(p_rate,p_update)
function LedgerCurrencyUpdate(p_dossier,p_code,p_update,p_rate,p_eur_amount)
{
// Hide or show the row of the table with the amount in EUR
- if ($(p_code).value != 0) {
- $('row_currency').show();
+ if (document.getElementById(p_code).value != 0) {
+ id$('row_currency').show();
}else {
- $('row_currency').hide();
+ id$('row_currency').hide();
}
CurrencyUpdateValue(p_dossier,p_code,p_rate);
CurrencyUpdateCode(p_dossier,p_code,p_update);
@@ -189,10 +189,10 @@ function LedgerCurrencyUpdate(p_dossier,p_code,p_update,p_rate,p_eur_amount)
function LedgerCurrencyUpdateMisc(p_dossier,p_code,p_update,p_rate,p_eur_amount)
{
// Hide or show the row of the table with the amount in EUR (= default currency)
- if ($(p_code).value != -1) {
- $('row_currency').show();
+ if (document.getElementById(p_code).value != -1) {
+ id$('row_currency').show();
}else {
- $('row_currency').hide();
+ id$('row_currency').hide();
}
CurrencyUpdateValue(p_dossier,p_code,p_rate);
CurrencyUpdateCode(p_dossier,p_code,p_update);
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index c4891fa53..86c6fc0e6 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -32,10 +32,10 @@ var layer = 1;
* \brief update the list of available predefined operation when we change the ledger.
*/
function update_predef(p_type, p_direct, p_ac) {
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn + '&t=' + p_type + '&d=' + p_direct + "&op=up_predef&ac=" + p_ac;
- g("p_jrn_predef").value = jrn;
+ id$("p_jrn_predef").value = jrn;
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -44,7 +44,7 @@ function update_predef(p_type, p_direct, p_ac) {
onFailure: error_get_predef,
onSuccess: function (req) {
try {
- $('info_div').innerHTML = "ok";
+ id$('info_div').innerHTML = "ok";
var answer = req.responseXML;
var a = answer.getElementsByTagName('code');
var html = answer.getElementsByTagName('value');
@@ -55,9 +55,9 @@ function update_predef(p_type, p_direct, p_ac) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
// document.getElementsByName(name_ctl)[0].value = code_html;
- $('modele_op_div').innerHTML = code_html;
+ id$('modele_op_div').innerHTML = code_html;
} catch (e) {
- $('info_div').innerHTML = e.message;
+ id$('info_div').innerHTML = e.message;
}
}
}
@@ -69,8 +69,8 @@ function update_predef(p_type, p_direct, p_ac) {
*/
function update_pay_method() {
waiting_box();
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn + "&op=up_pay_method";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -81,7 +81,7 @@ function update_pay_method() {
onSuccess: function (req) {
remove_waiting_box();
var answer = req.responseText;
- $('payment').innerHTML = answer;
+ id$('payment').innerHTML = answer;
}
}
);
@@ -92,8 +92,8 @@ function update_pay_method() {
*/
function update_other_tax() {
waiting_box();
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = {gDossier: dossier, jrn_id: jrn, op: "up_other_tax"};
var action = new Ajax.Request(
"ajax_misc.php",
@@ -105,7 +105,7 @@ function update_other_tax() {
remove_waiting_box();
var answer = req.responseText;
answer.evalScripts();
- $('additional_tax_div').innerHTML = answer;
+ id$('additional_tax_div').innerHTML = answer;
}
}
);
@@ -115,8 +115,8 @@ function update_other_tax() {
* update ctl id =jrn_name with the value of p_jrn
*/
function update_name() {
- var jrn_id = $('p_jrn').value;
- var dossier = g("gDossier").value;
+ var jrn_id = id$('p_jrn').value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn_id + "&op=ledger_description";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -125,7 +125,7 @@ function update_name() {
parameters: querystring,
onFailure: error_get_pj,
onSuccess: function (req) {
- $('jrn_name_div').innerHTML = req.responseText;
+ id$('jrn_name_div').innerHTML = req.responseText;
}
}
);
@@ -143,9 +143,9 @@ function error_get_predef(request, json) {
/**
* update the list of available predefined operation when we change the ledger.
*/
-function update_pj() {
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+function update_receipt() {
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn + "&op=upd_receipt";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -162,8 +162,8 @@ function update_pj() {
* ask the name, quick_code of the bank for the ledger
*/
function update_bank() {
- var jrn = g('p_jrn').value;
- var dossier = g('gDossier').value;
+ var jrn = id$('p_jrn').value;
+ var dossier = id$('gDossier').value;
var qs = 'gDossier=' + dossier + '&op=bkname&p_jrn=' + jrn;
var action = new Ajax.Request(
"ajax_misc.php",
@@ -186,10 +186,10 @@ function update_row(ctl) {
if (ctl === 'quick_item') {
row_to_keep = 1;
} /* for ODS , only 1 rows to keep */
- var jrn = g('p_jrn').value;
- var dossier = g('gDossier').value;
+ var jrn = id$('p_jrn').value;
+ var dossier = id$('gDossier').value;
var qs = encodeURI('gDossier=' + dossier + '&op=minrow&j=' + jrn + '&ctl=' + ctl);
- var current_row = parseFloat($('nb_item').value);
+ var current_row = parseFloat(id$('nb_item').value);
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -201,11 +201,11 @@ function update_row(ctl) {
var answer = request.responseText.evalJSON(true);
var row = parseFloat(answer.row);
- var table_to_update = $(ctl);
+ var table_to_update = id$(ctl);
if (current_row > row) {
// Too many row, we always must keep 2 rows for the sum
- var delta = $('nb_item').value - row;
- var idx = $('nb_item').value;
+ var delta = id$('nb_item').value - row;
+ var idx = id$('nb_item').value;
for (var i = 0; i < delta; i++) {
var pos_row = table_to_update.rows.length;
var cell0 = table_to_update.rows[pos_row - row_to_keep].cells[0];
@@ -239,7 +239,7 @@ function update_row(ctl) {
}
}
- $('nb_item').value = table_to_update.rows.length - row_to_keep;
+ id$('nb_item').value = table_to_update.rows.length - row_to_keep;
}
if (current_row < row) {
// We need to add rows
@@ -271,8 +271,8 @@ function update_row(ctl) {
* @brief hide or show the column quantity
*/
function update_visibility_quantity() {
- var jrn = g("p_jrn").value;
- var dossier = g("gDossier").value;
+ var jrn = id$("p_jrn").value;
+ var dossier = id$("gDossier").value;
var querystring = 'gDossier=' + dossier + '&l=' + jrn + "&op=update_visibility_quantity";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -321,7 +321,7 @@ function success_update_bank(req) {
var name_ctl = a[0].firstChild.nodeValue;
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
} catch (e) {
alert_box("success_update_bank" + e.message);
}
@@ -331,8 +331,8 @@ function success_update_bank(req) {
* call ajax, ask what is the last date for the current ledger
*/
function get_last_date() {
- var jrn = g('p_jrn').value;
- var dossier = g('gDossier').value;
+ var jrn = id$('p_jrn').value;
+ var dossier = id$('gDossier').value;
var qs = 'gDossier=' + dossier + '&op=lastdate&p_jrn=' + jrn;
var action = new Ajax.Request(
"ajax_misc.php",
@@ -372,12 +372,12 @@ function success_get_last_date(req) {
function success_get_pj(request, json) {
var answer = request.responseText.evalJSON(true);
- var obj = g("e_pj");
+ var obj = id$("e_pj");
obj.value = '';
if (answer.length == 0)
return;
obj.value = answer.pj;
- g("e_pj_suggest").value = answer.pj;
+ id$("e_pj_suggest").value = answer.pj;
}
/**
@@ -392,10 +392,10 @@ function error_get_pj(request, json) {
*/
function ledger_fin_add_row() {
var style = 'class="input_text"';
- var mytable = g("fin_item").tBodies[0];
+ var mytable = id$("fin_item").tBodies[0];
var line = mytable.rows.length;
var row = mytable.insertRow(line);
- var nb = g("nb_item");
+ var nb = id$("nb_item");
var rowToCopy = mytable.rows[1];
var nNumberCell = rowToCopy.cells.length;
for (var e = 0; e < nNumberCell; e++) {
@@ -415,15 +415,15 @@ function ledger_fin_add_row() {
newCell.className = rowToCopy.cells[e].className;
new_tt.evalScripts();
}
- g("e_other" + nb.value).value = "";
- g("e_other_name" + nb.value).value = "";
- g("e_other" + nb.value + '_amount').value = "0";
- g("e_other" + nb.value + '_comment').value = "";
- g("e_concerned" + nb.value).value = "";
+ id$("e_other" + nb.value).value = "";
+ id$("e_other_name" + nb.value).value = "";
+ id$("e_other" + nb.value + '_amount').value = "0";
+ id$("e_other" + nb.value + '_comment').value = "";
+ id$("e_concerned" + nb.value).value = "";
- var ch = $('chdate').options[$('chdate').selectedIndex].value;
+ var ch = id$('chdate').options[id$('chdate').selectedIndex].value;
if (ch == 1) {
- $('tdchdate' + nb.value).hide();
+ id$('tdchdate' + nb.value).hide();
}
nb.value++;
}
@@ -433,11 +433,11 @@ function ledger_fin_add_row() {
* @param string p_elid is the id of element with the number of rows to add, and p_elid+"_ledger" is the type of ledger : M : Misc Operation O : Sales or purchase and F for financial
*/
function ledger_add_multiple(p_elid) {
- var nbrow = $(p_elid).value;
+ var nbrow = id$(p_elid).value;
if (nbrow == NaN) {
nbrow = 1;
}
- var type_ledger = $(p_elid + "_ledger").value;
+ var type_ledger = id$(p_elid + "_ledger").value;
var i = 0;
for (i = 0; i < nbrow; i++) {
if (type_ledger == 'O') {
@@ -464,12 +464,12 @@ function ledger_add_multiple(p_elid) {
function ledger_add_row() {
try {
style = 'class="input_text"';
- var mytable = g("sold_item").tBodies[0];
+ var mytable = id$("sold_item").tBodies[0];
var ofirstRow = mytable.rows[1];
var line = mytable.rows.length;
var nCell = mytable.rows[1].cells.length;
var row = mytable.insertRow(line);
- var nb = g("nb_item");
+ var nb = id$("nb_item");
for (var e = 0; e < nCell; e++) {
var newCell = row.insertCell(e);
var tt = ofirstRow.cells[e].innerHTML;
@@ -483,13 +483,13 @@ function ledger_add_row() {
new_tt.evalScripts();
}
- $("e_march" + nb.value + "_label").innerHTML = '';
- $("e_march" + nb.value + "_label").value = '';
- $("e_march" + nb.value + "_price").value = '0';
- $("e_march" + nb.value).value = "";
- $("e_quant" + nb.value).value = "1";
- if ($("e_march" + nb.value + "_tva_amount"))
- $("e_march" + nb.value + "_tva_amount").value = 0;
+ id$("e_march" + nb.value + "_label").innerHTML = '';
+ id$("e_march" + nb.value + "_label").value = '';
+ id$("e_march" + nb.value + "_price").value = '0';
+ id$("e_march" + nb.value).value = "";
+ id$("e_quant" + nb.value).value = "1";
+ if (document.getElementById("e_march" + nb.value + "_tva_amount"))
+ id$("e_march" + nb.value + "_tva_amount").value = 0;
nb.value++;
@@ -505,17 +505,17 @@ function ledger_add_row() {
* @param the number of the changed ctrl
*/
function compute_ledger(p_ctl_nb) {
- var dossier = g("gDossier").value;
+ var dossier = id$("gDossier").value;
var a = -1;
if (document.getElementById("e_march" + p_ctl_nb + '_tva_amount')) {
- a = trim(g("e_march" + p_ctl_nb + '_tva_amount').value);
- g("e_march" + p_ctl_nb + '_tva_amount').value = a;
+ a = trim(id$("e_march" + p_ctl_nb + '_tva_amount').value);
+ id$("e_march" + p_ctl_nb + '_tva_amount').value = a;
}
if (!document.getElementById("e_march" + p_ctl_nb)) {
return;
}
- g("e_march" + p_ctl_nb).value = trim(g("e_march" + p_ctl_nb).value);
- var qcode = g("e_march" + p_ctl_nb).value;
+ id$("e_march" + p_ctl_nb).value = trim(id$("e_march" + p_ctl_nb).value);
+ var qcode = id$("e_march" + p_ctl_nb).value;
if (qcode.length == 0) {
clean_ledger(p_ctl_nb);
@@ -526,19 +526,19 @@ function compute_ledger(p_ctl_nb) {
* if tva_id is empty send a value of -1
*/
var tva_id = -1;
- if (g('e_march' + p_ctl_nb + '_tva_id')) {
- tva_id = g('e_march' + p_ctl_nb + '_tva_id').value;
+ if (document.getElementById('e_march' + p_ctl_nb + '_tva_id')) {
+ tva_id = id$('e_march' + p_ctl_nb + '_tva_id').value;
if (trim(tva_id) == '') {
tva_id = -1;
}
}
- g('e_march' + p_ctl_nb + '_price').value = trim(g('e_march' + p_ctl_nb + '_price').value);
- var price = g('e_march' + p_ctl_nb + '_price').value;
+ id$('e_march' + p_ctl_nb + '_price').value = trim(id$('e_march' + p_ctl_nb + '_price').value);
+ var price = id$('e_march' + p_ctl_nb + '_price').value;
- g('e_quant' + p_ctl_nb).value = trim(g('e_quant' + p_ctl_nb).value);
- var quantity = g('e_quant' + p_ctl_nb).value;
- let other_tax = g("other_tax");
+ id$('e_quant' + p_ctl_nb).value = trim(id$('e_quant' + p_ctl_nb).value);
+ var quantity = id$('e_quant' + p_ctl_nb).value;
+ let other_tax = document.getElementById("other_tax");
let other_tax_id = (other_tax && other_tax.checked) ? other_tax.value : -1;
var querystring = {
@@ -569,26 +569,26 @@ function refresh_ledger() {
var htva = 0;
var tvac = 0;
- nb_item = g("nb_item").value;
+ nb_item = id$("nb_item").value;
for (var i = 0; i < nb_item; i++) {
- if (g('tva_march' + i))
- tva += g('tva_march' + i).value * 1;
- if (g('htva_march' + i))
- htva += g('htva_march' + i).value * 1;
- if (g('tvac_march' + i))
- tvac += g('tvac_march' + i).value * 1;
+ if (document.getElementById('tva_march' + i))
+ tva += id$('tva_march' + i).value * 1;
+ if (document.getElementById('htva_march' + i))
+ htva += id$('htva_march' + i).value * 1;
+ if (document.getElementById('tvac_march' + i))
+ tvac += id$('tvac_march' + i).value * 1;
}
- id_tva = g("tva");
- id_htva = g("htva");
- id_tvac = g("tvac");
- id_other_tax = g("other_tax_amount");
+ id_tva = id$("tva");
+ id_htva = id$("htva");
+ id_tvac = id$("tvac");
+ id_other_tax = document.getElementById("other_tax_amount");
if (id_tva)
id_tva.innerHTML = Math.round(tva * 100) / 100;
if (id_htva)
id_htva.innerHTML = Math.round(htva * 100) / 100;
if (id_other_tax) {
let total_operation = tvac + parseFloat(id_other_tax.value);
- $('total_operation_other_tax').innerHTML = Math.round(total_operation * 100) / 100;
+ id$('total_operation_other_tax').innerHTML = Math.round(total_operation * 100) / 100;
}
if (id_tvac)
id_tvac.innerHTML = Math.round(tvac * 100) / 100;
@@ -607,15 +607,15 @@ function success_compute_ledger(request, json) {
var rtva = answer.tva;
var rhtva = answer.htva;
var rtvac = answer.tvac;
- let other_tax = g("other_tax_amount")
+ let other_tax = id$("other_tax_amount")
if (other_tax) {
other_tax.value = answer.other_tax;
}
if (rtva == 'NA') {
var rhtva = answer.htva * 1;
- g('htva_march' + ctl).value = rhtva;
- g('tvac_march' + ctl).value = rtvac;
- g('sum').show();
+ id$('htva_march' + ctl).value = rhtva;
+ id$('tvac_march' + ctl).value = rtvac;
+ id$('sum').show();
refresh_ledger();
CurrencyCompute('p_currency_rate', 'p_currency_euro');
@@ -624,17 +624,18 @@ function success_compute_ledger(request, json) {
rtva = answer.tva * 1;
- g('sum').show();
- if (g('e_march' + ctl + '_tva_amount').value == "" || g('e_march' + ctl + '_tva_amount').value == 0) {
- g('tva_march' + ctl).value = rtva;
- g('e_march' + ctl + '_tva_amount').value = rtva;
+ id$('sum').show();
+ if (document.getElementById('e_march' + ctl + '_tva_amount').value == "" ||
+ document.getElementById('e_march' + ctl + '_tva_amount').value == 0) {
+ id$('tva_march' + ctl).value = rtva;
+ id$('e_march' + ctl + '_tva_amount').value = rtva;
} else {
- g('tva_march' + ctl).value = g('e_march' + ctl + '_tva_amount').value;
+ id$('tva_march' + ctl).value = id$('e_march' + ctl + '_tva_amount').value;
}
- g('htva_march' + ctl).value = Math.round(parseFloat(rhtva) * 100) / 100;
- var tmp1 = Math.round(parseFloat(g('htva_march' + ctl).value) * 100) / 100;
- var tmp2 = Math.round(parseFloat(g('tva_march' + ctl).value) * 100) / 100;
- g('tvac_march' + ctl).value = Math.round((tmp1 + tmp2) * 100) / 100;
+ id$('htva_march' + ctl).value = Math.round(parseFloat(rhtva) * 100) / 100;
+ var tmp1 = Math.round(parseFloat(id$('htva_march' + ctl).value) * 100) / 100;
+ var tmp2 = Math.round(parseFloat(id$('tva_march' + ctl).value) * 100) / 100;
+ id$('tvac_march' + ctl).value = Math.round((tmp1 + tmp2) * 100) / 100;
refresh_ledger();
CurrencyCompute('p_currency_rate', 'p_currency_euro');
@@ -649,7 +650,7 @@ function error_compute_ledger(request, json) {
function compute_all_ledger() {
var loop = 0;
- let nb_item = g("nb_item").value;
+ let nb_item = id$("nb_item").value;
for (loop = 0; loop < nb_item; loop++) {
compute_ledger(loop);
}
@@ -658,53 +659,52 @@ function compute_all_ledger() {
var tvac = 0;
for (var i = 0; i < nb_item; i++) {
- if (g('tva_march'))
- tva += g('tva_march' + i).value * 1;
- if (g('htva_march' + i))
- htva += g('htva_march' + i).value * 1;
- if (g('tvac_march' + i))
- tvac += g('tvac_march' + i).value * 1;
+ if (document.getElementById('tva_march'))
+ tva += id$('tva_march' + i).value * 1;
+ if (document.getElementById('htva_march' + i))
+ htva += id$('htva_march' + i).value * 1;
+ if (document.getElementById('tvac_march' + i))
+ tvac += id$('tvac_march' + i).value * 1;
}
- id_other_tax = g("other_tax_amount");
- if (g('tva'))
- g('tva').innerHTML = Math.round(tva * 100) / 100;
- if (g('htva'))
- g('htva').innerHTML = Math.round(htva * 100) / 100;
+ id_other_tax = document.getElementById("other_tax_amount");
+ if (document.getElementById('tva')) id$('tva').innerHTML = Math.round(tva * 100) / 100;
+ if (document.getElementById ('htva'))
+ id$('htva').innerHTML = Math.round(htva * 100) / 100;
if (id_other_tax) {
tvac += id_other_tax.value;
}
- if (g('tvac'))
- g('tvac').innerHTML = Math.round(tvac * 100) / 100;
+ if (document.getElementById('tvac'))
+ id$('tvac').innerHTML = Math.round(tvac * 100) / 100;
}
function clean_tva(p_ctl) {
- if (g('e_march' + p_ctl + '_tva_amount'))
- g('e_march' + p_ctl + '_tva_amount').value = 0;
+ if (document.getElementById('e_march' + p_ctl + '_tva_amount'))
+ id$('e_march' + p_ctl + '_tva_amount').value = 0;
}
function clean_ledger(p_ctl_nb) {
- if (g("e_march" + p_ctl_nb)) {
- g("e_march" + p_ctl_nb).value = trim(g("e_march" + p_ctl_nb).value);
+ if (document.getElementById("e_march" + p_ctl_nb)) {
+ id$("e_march" + p_ctl_nb).value = trim(id$("e_march" + p_ctl_nb).value);
}
- if (g('e_march' + p_ctl_nb + '_price')) {
- g('e_march' + p_ctl_nb + '_price').value = '';
+ if (document.getElementById('e_march' + p_ctl_nb + '_price')) {
+ id$('e_march' + p_ctl_nb + '_price').value = '';
}
- if (g('e_quant' + p_ctl_nb)) {
- g('e_quant' + p_ctl_nb).value = '1';
+ if (document.getElementById('e_quant' + p_ctl_nb)) {
+ id$('e_quant' + p_ctl_nb).value = '1';
}
- if (g('tva_march' + p_ctl_nb + '_show')) {
- g('tva_march' + p_ctl_nb + '_show').value = '0';
+ if (document.getElementById('tva_march' + p_ctl_nb + '_show')) {
+ id$('tva_march' + p_ctl_nb + '_show').value = '0';
}
- if (g('tva_march' + p_ctl_nb)) {
- g('tva_march' + p_ctl_nb).value = 0;
+ if (document.getElementById('tva_march' + p_ctl_nb)) {
+ id$('tva_march' + p_ctl_nb).value = 0;
}
- if (g('htva_march' + p_ctl_nb)) {
- g('htva_march' + p_ctl_nb).value = 0;
+ if (document.getElementById('htva_march' + p_ctl_nb)) {
+ id$('htva_march' + p_ctl_nb).value = 0;
}
- if (g('tvac_march' + p_ctl_nb)) {
- g('tvac_march' + p_ctl_nb).value = 0;
+ if (document.getElementById('tvac_march' + p_ctl_nb)) {
+ id$('tvac_march' + p_ctl_nb).value = 0;
}
}
@@ -714,12 +714,12 @@ function clean_ledger(p_ctl_nb) {
*/
function quick_writing_add_row() {
style = 'class="input_text"';
- var mytable = g("quick_item").tBodies[0];
+ var mytable = id$("quick_item").tBodies[0];
var nNumberRow = mytable.rows.length;
var oRow = mytable.insertRow(nNumberRow);
var rowToCopy = mytable.rows[1];
var nNumberCell = rowToCopy.cells.length;
- var nb = g("nb_item");
+ var nb = id$("nb_item");
var oNewRow = mytable.insertRow(nNumberRow);
for (var e = 0; e < nNumberCell; e++) {
@@ -735,17 +735,17 @@ function quick_writing_add_row() {
new_tt.evalScripts();
}
- var ck = $('ck' + nb.value);
+ var ck = id$('ck' + nb.value);
ck.addEventListener('click', function (event) {
display_range_dcside(event, ck);
display_dcside(ck);
});
- $("qc_" + nb.value).value = "";
- $("amount" + nb.value).value = "";
- $("poste" + nb.value).value = "";
- $("ld" + nb.value).value = "";
+ id$("qc_" + nb.value).value = "";
+ id$("amount" + nb.value).value = "";
+ id$("poste" + nb.value).value = "";
+ id$("ld" + nb.value).value = "";
nb.value++;
@@ -805,7 +805,7 @@ function view_history_account(p_value, dossier, p_exercice) {
add_div(popup);
success_box(req, xml);
- $(idbox).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(idbox).style.top = calcy(140 + (layer * 3)) + "px";
}
}
);
@@ -845,8 +845,8 @@ function view_history_anc_account(p_value, dossier, p_exercice) {
if (req.responseText === 'NOCONX') { reconnect();return;}
add_div(popup);
- $(idbox).innerHTML = req.responseText;
- $(idbox).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(idbox).innerHTML = req.responseText;
+ id$(idbox).style.top = calcy(140 + (layer * 3)) + "px";
}
}
);
@@ -881,7 +881,7 @@ function update_history_account(obj) {
if (req.responseText === 'NOCONX') { reconnect();return;}
success_box(req, xml);
- g(obj.div).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(obj.div).style.top = calcy(140 + (layer * 3)) + "px";
}
});
} catch (e) {
@@ -925,7 +925,7 @@ function view_history_card(p_value, dossier, p_exercice) {
add_div(popup);
success_box(req, xml);
- g(idbox).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(idbox).style.top = calcy(140 + (layer * 3)) + "px";
}
}
);
@@ -962,8 +962,8 @@ function view_followup_card(p_value, dossier) {
if (req.responseText === 'NOCONX') { reconnect();return;}
add_div(popup);
- $(idbox).update(req.responseText);
- g(idbox).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(idbox).update(req.responseText);
+ id$(idbox).style.top = calcy(140 + (layer * 3)) + "px";
}
}
);
@@ -997,7 +997,7 @@ function update_history_card(obj) {
remove_waiting_box();
success_box(req, xml);
- g(obj.div).style.top = calcy(140 + (layer * 3)) + "px";
+ id$(obj.div).style.top = calcy(140 + (layer * 3)) + "px";
}
});
} catch (e) {
@@ -1039,8 +1039,8 @@ function removeOperation(p_jr_id, dossier, div) {
*@param pointer to the FORM
*/
function reverseOperation(obj) {
- var qs = $(obj).serialize() + "&op=ledger";
- g('ext' + obj.divname).style.display = 'none';
+ var qs = id$(obj).serialize() + "&op=ledger";
+ id$('ext' + obj.divname).style.display = 'none';
waiting_box();
new Ajax.Request(
"ajax_misc.php",
@@ -1112,8 +1112,8 @@ function modifyOperation(p_value, dossier) {
remove_waiting_box();
add_div(popup);
success_box(xml, txt);
- $(id_div).style.position = "absolute";
- $(id_div).style.top = calcy(100 + (layer * 3)) + "px";
+ id$(id_div).style.position = "absolute";
+ id$(id_div).style.top = calcy(100 + (layer * 3)) + "px";
}
}
);
@@ -1154,9 +1154,9 @@ function dropLink(p_dossier, p_div, p_jr_id, p_jr_id2) {
*@see ICard::input
*/
function filter_card(obj, queryString) {
- jrn = $('p_jrn').value;
+ jrn = id$('p_jrn').value;
if (jrn == -1) {
- type = $('ledger_type').value;
+ type = id$('ledger_type').value;
queryString = queryString + '&type=' + type;
} else {
queryString = queryString + '&j=' + jrn;
@@ -1182,10 +1182,10 @@ function dsp_letter(obj) {
onSuccess: success_dsp_letter
}
);
- g('search').style.display = 'none';
- g('list').style.display = 'none';
- $('detail').innerHTML = loading();
- g('detail').style.display = 'block';
+ id$('search').style.display = 'none';
+ id$('list').style.display = 'none';
+ id$('detail').innerHTML = loading();
+ id$('detail').style.display = 'block';
} catch (e) {
alert_box('dsp_letter failed ' + e.message);
}
@@ -1203,20 +1203,20 @@ function success_dsp_letter(req) {
var name_ctl = a[0].firstChild.nodeValue;
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- $('detail').innerHTML = code_html;
+ id$('detail').innerHTML = code_html;
} catch (e) {
alert_box(e.message);
}
try {
code_html.evalScripts();
} catch (e) {
- alert_box("DSPLETTER:" + content[48] + e.message);
+ alert_box("DSPLETTER1:" + content[48] + e.message);
}
}
function error_dsp_letter(req) {
- alert_box("DSPLETTER:" + content[48]);
+ alert_box("DSPLETTER2:" + content[48]);
}
function search_letter(obj) {
@@ -1251,10 +1251,10 @@ function search_letter(obj) {
onSuccess: success_dsp_letter
}
);
- $('list').hide();
- $('search').hide();
- $('detail').innerHTML = loading();
- $('detail').show();
+ id$('list').hide();
+ id$('search').hide();
+ id$('detail').innerHTML = loading();
+ id$('detail').show();
} catch (e) {
alert_box('search_letter ' + e.message);
}
@@ -1268,10 +1268,10 @@ function search_letter(obj) {
*/
function op_save(obj) {
try {
- var queryString = $(obj).serialize(true);
+ var queryString = id$(obj).serialize(true);
queryString ["gDossier"] = obj.gDossier.value;
var rapt2 = "rapt" + obj.whatdiv.value;
- queryString ["rapt"] = g(rapt2).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;
@@ -1283,7 +1283,7 @@ function op_save(obj) {
/*
* Operation detail is in a new window
*/
- if (g('inpopup')) {
+ if (document.getElementById('inpopup')) {
var action = new Ajax.Request('ajax_misc.php',
{
method: 'post',
@@ -1327,8 +1327,8 @@ function op_save(obj) {
try {
var answer = xml.responseXML;
var html = answer.getElementsByTagName('code');
- $(divid).innerHTML = unescape(getNodeText(html[0]));
- $(divid).innerHTML.evalScripts();
+ id$(divid).innerHTML = unescape(getNodeText(html[0]));
+ id$(divid).innerHTML.evalScripts();
remove_waiting_box();
} catch (e) {
console.error("D1. op_save")
@@ -1348,8 +1348,8 @@ function op_save(obj) {
}
function get_history_account(ctl, dossier) {
- if ($(ctl).value != '') {
- view_history_account($(ctl).value, dossier);
+ if (document.getElementById(ctl).value != '') {
+ view_history_account(id$(ctl).value, dossier);
}
}
@@ -1398,12 +1398,12 @@ function show_reconcile(p_div, p_let) {
function gestion_add_row() {
try {
style = 'class="input_text"';
- var mytable = g("art").tBodies[0];
+ var mytable = id$("art").tBodies[0];
var ofirstRow = mytable.rows[1];
var line = mytable.rows.length;
var nCell = mytable.rows[1].cells.length;
var row = mytable.insertRow(line);
- var nb = g("nb_item");
+ var nb = id$("nb_item");
for (var e = 0; e < nCell; e++) {
var newCell = row.insertCell(e);
var tt = ofirstRow.cells[e].innerHTML;
@@ -1421,14 +1421,14 @@ function gestion_add_row() {
new_tt.evalScripts();
}
- g("e_march" + nb.value + "_label").innerHTML = ' ';
- g("e_march" + nb.value + "_label").value = '';
- g("e_march" + nb.value + "_price").value = '0';
- g("e_march" + nb.value).value = "";
- g("e_quant" + nb.value).value = "1";
- g('tvac_march' + nb.value).value = "0";
- if ($("e_march" + nb.value + "_tva_amount"))
- g("e_march" + nb.value + "_tva_amount").value = 0;
+ id$("e_march" + nb.value + "_label").innerHTML = ' ';
+ id$("e_march" + nb.value + "_label").value = '';
+ id$("e_march" + nb.value + "_price").value = '0';
+ id$("e_march" + nb.value).value = "";
+ id$("e_quant" + nb.value).value = "1";
+ id$('tvac_march' + nb.value).value = "0";
+ if (document.getElementById("e_march" + nb.value + "_tva_amount"))
+ id$("e_march" + nb.value + "_tva_amount").value = 0;
nb.value++;
@@ -1446,7 +1446,7 @@ function document_remove(p_dossier, p_div, p_jrid) {
{
parameters: {"op": "ledger", "gDossier": p_dossier, "div": p_div, "p_jrid": p_jrid, 'act': 'rmf'},
onSuccess: function (x) {
- $('receipt' + p_div).innerHTML = x.responseText;
+ id$('receipt' + p_div).innerHTML = x.responseText;
}
})
}
@@ -1481,7 +1481,7 @@ function manage_search_filter(p_obj) {
'style': 'top:' + y + 'px;left:' + x + 'px;position:absolute;width:400px',
drag: 1
});
- $('boxfilter' + p_obj.div).show();
+ id$('boxfilter' + p_obj.div).show();
}
});
}
@@ -1503,11 +1503,11 @@ function save_filter(p_div, p_dossier) {
eltValue['gDossier'] = p_dossier;
eltValue['op'] = "save_filter";
eltValue['div'] = p_div;
- eltValue['filter_name'] = $(p_div + "filter_new").value;
+ eltValue['filter_name'] = id$(p_div + "filter_new").value;
// Get all elt from the form
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- eltValue[idx] = $(p_div + elt[i]).value;
+ eltValue[idx] = id$(p_div + elt[i]).value;
}
if (eltValue['amount_min'] == "") eltValue["amount_min"] = 0;
@@ -1518,7 +1518,7 @@ function save_filter(p_div, p_dossier) {
eltValue['r_jrn'] = [];
for (i = 0; i < eltValue['nb_jrn']; i++) {
var idx = p_div + 'r_jrn[' + i + ']';
- eltValue['r_jrn' + i] = $(idx).value
+ eltValue['r_jrn' + i] = id$(idx).value
}
}
@@ -1539,8 +1539,8 @@ function save_filter(p_div, p_dossier) {
var new_item = document.createElement('li');
new_item.innerHTML = answer.filter_name;
new_item.setAttribute("id", "manageli" + p_div + "_" + answer.filter_id);
- $('manage' + p_div).appendChild(new_item);
- $(p_div + "filter_new").value = "";
+ id$('manage' + p_div).appendChild(new_item);
+ id$(p_div + "filter_new").value = "";
} else {
throw answer.message;
}
@@ -1570,10 +1570,10 @@ 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];
- $(p_div + idx).value = answer[elt[i]];
+ id$(p_div + idx).value = answer[elt[i]];
}
// fillup the r_jrn array
- var eltLedgerId = $("ledger_id" + p_div);
+ var eltLedgerId = id$("ledger_id" + p_div);
eltLedgerId.innerHTML = "";
var eltHidden = document.createElement("input");
eltHidden.setAttribute("name", p_div + "nb_jrn");
@@ -1599,7 +1599,7 @@ function load_filter(p_div, p_dossier, p_filter_id) {
uf_tag: answer.uf_tag
},
onSuccess: function (req) {
- $(p_div + 'tag_choose_td').update(req.responseText);
+ id$(p_div + 'tag_choose_td').update(req.responseText);
}
})
@@ -1629,9 +1629,9 @@ function delete_filter(p_div, p_dossier, p_filter_id) {
try {
var answer = req.evalJSON;
- var child = $("manageli" + p_div + "_" + p_filter_id);
+ var child = id$("manageli" + p_div + "_" + p_filter_id);
if (child) {
- $("manage" + p_div).removeChild(child);
+ id$("manage" + p_div).removeChild(child);
}
} catch (e) {
console.log(e.message)
@@ -1651,16 +1651,16 @@ function reset_filter(p_div) {
var elt = ['date_start', 'date_end', 'date_paid_start', 'date_paid_end', 'desc', 'amount_min', 'amount_max', 'qcode', 'accounting', 'tva_id_search'];
for (var i = 0; i < elt.length; i++) {
var idx = elt[i];
- $(p_div + idx).value = "";
+ id$(p_div + idx).value = "";
}
- if ($(p_div + "date_start_hidden")) {
- $(p_div + "date_start").value = $(p_div + "date_start_hidden").value;
+ if (document.getElementById(p_div + "date_start_hidden")) {
+ id$(p_div + "date_start").value = id$(p_div + "date_start_hidden").value;
}
- if ($(p_div + "date_end_hidden")) {
- $(p_div + "date_end").value = $(p_div + "date_end_hidden").value;
+ if (document.getElementById(p_div + "date_end_hidden")) {
+ id$(p_div + "date_end").value = id$(p_div + "date_end_hidden").value;
}
// clean all the selected ledger
- var eltLedgerId = $("ledger_id" + p_div);
+ var eltLedgerId = id$("ledger_id" + p_div);
eltLedgerId.innerHTML = "";
var eltHidden = document.createElement("input");
eltHidden.setAttribute("name", p_div + "nb_jrn");
@@ -1670,7 +1670,7 @@ function reset_filter(p_div) {
eltLedgerId.appendChild(eltHidden);
// By default , unpaid is uncked
- $(p_div + "operation_filter").value = "all";
+ id$(p_div + "operation_filter").value = "all";
}
function display_list_filter(p_dossier,access_code,ledger_type)
{
@@ -1744,7 +1744,7 @@ function tax_detail_view (dossier_id,date_from,date_to,nLedger_id,nTva_id)
removeDiv(dgbox);
// For form , most of the parameters are in the FORM
// method is then POST
- //var queryString=$(p_form_id).serialize(true);
+ //var queryString=id$(p_form_id).serialize(true);
var queryString = {
op: 'tax_detail',
@@ -1771,7 +1771,7 @@ function tax_detail_view (dossier_id,date_from,date_to,nLedger_id,nTva_id)
var y=calcy(15);
var div_style="position:absolute;"+";top:"+y+"px";
add_div({id:dgbox,cssclass:'inner_box',html:loading(),style:div_style,drag:true});
- $(dgbox).update(req.responseText);
+ id$(dgbox).update(req.responseText);
}
}
@@ -1791,7 +1791,7 @@ var operation_exercice = {
waiting_box();
var queryString = {
op: 'operation_exercice+update_periode',
- folder: $('dos_id').value,
+ folder: id$('dos_id').value,
gDossier: dossier_id
};
var action = new Ajax.Request(
@@ -1807,7 +1807,7 @@ var operation_exercice = {
return;
}
- $("select_exercice_id").update(req.responseText);
+ id$("select_exercice_id").update(req.responseText);
}
}
@@ -1823,13 +1823,13 @@ var operation_exercice = {
removeDiv(dgbox);
// For form , most of the parameters are in the FORM
// method is then POST
- //var queryString=$(p_form_id).serialize(true);
+ //var queryString=id$(p_form_id).serialize(true);
console.debug(row_operation_exercice);
var queryString = {
op: 'operation_exercice+modify_row',
oe_id: oe_id,
row_id: row_operation_exercice,
- gDossier: $('gDossier').value
+ gDossier: id$('gDossier').value
};
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1847,7 +1847,7 @@ var operation_exercice = {
var y = calcy(15);
var div_style = "position:absolute;" + ";top:" + y + "px";
add_div({id: dgbox, cssclass: 'inner_box', html: loading(), style: div_style, drag: true});
- $(dgbox).update(req.responseText);
+ id$(dgbox).update(req.responseText);
}
}
);
@@ -1865,9 +1865,9 @@ var operation_exercice = {
// For form , most of the parameters are in the FORM
// method is then POST
- //var queryString=$(p_form_id).serialize(true);
+ //var queryString=id$(p_form_id).serialize(true);
- var queryString = $('operation_exercice_input_row_frm').serialize(true);
+ var queryString = id$('operation_exercice_input_row_frm').serialize(true);
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1890,24 +1890,24 @@ var operation_exercice = {
row.setAttribute("oed_id", rowid);
row.setAttribute("oe_id", req.responseJSON['oe_id']);
row.update(req.responseJSON['content']);
- $("operation_exercice_tb").appendChild(row);
+ id$("operation_exercice_tb").appendChild(row);
row.addEventListener("click", function (event) {
operation_exercice.click_modify_row(row)
})
} else {
- $("oe_" + rowid).update(req.responseJSON['content']);
+ id$("oe_" + rowid).update(req.responseJSON['content']);
}
new Effect.Highlight("oe_" + req.responseJSON['row_id'], {
startcolor: '#FAD4D4',
endcolor: '#F78082'
});
operation_exercice.display_total(rowid)
- $(dgbox).remove();
+ id$(dgbox).remove();
return;
}
- $(dgbox).update(req.responseText);
+ id$(dgbox).update(req.responseText);
}
}
@@ -1925,7 +1925,7 @@ var operation_exercice = {
var queryString = {
op: 'operation_exercice+display_total',
row_id: row_id,
- gDossier: $('gDossier').value
+ gDossier: id$('gDossier').value
};
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1940,7 +1940,7 @@ var operation_exercice = {
return;
}
- $(dgbox).update(req.responseText);
+ id$(dgbox).update(req.responseText);
}
}
@@ -1957,7 +1957,7 @@ var operation_exercice = {
var queryString = {
op: 'operation_exercice+delete_row',
row_id: row_id,
- gDossier: $('gDossier').value
+ gDossier: id$('gDossier').value
};
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1974,8 +1974,8 @@ var operation_exercice = {
if (req.responseJSON["row_id"] != "") {
operation_exercice.display_total(req.responseJSON["row_id"])
}
- $('oe_' + queryString['row_id']).remove();
- $('operation_exercice_bx').remove();
+ id$('oe_' + queryString['row_id']).remove();
+ id$('operation_exercice_bx').remove();
}
}
);
@@ -1994,7 +1994,7 @@ var operation_exercice = {
var dgbox = "oe_transfer_div";
waiting_box();
- var queryString = $("operation_exercice_transfer_frm").serialize(true);
+ var queryString = id$("operation_exercice_transfer_frm").serialize(true);
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -2009,7 +2009,7 @@ var operation_exercice = {
}
var answer=req.responseJSON;
- $('operation_exercice_transfer_info').update(answer.content);
+ id$('operation_exercice_transfer_info').update(answer.content);
}
diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js
index 20db90d03..9c261a847 100644
--- a/html/js/accounting_item.js
+++ b/html/js/accounting_item.js
@@ -49,7 +49,7 @@ function search_accounting(obj)
removeDiv('search_account');
add_div({id:'search_account',cssclass:'inner_box',html:loading(),style:div_style,drag:false});
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString="gDossier="+dossier;
@@ -61,8 +61,8 @@ function search_accounting(obj)
{
queryString+="&j="+obj.jrn;
}else {
- if ($("p_jrn")) {
- queryString+="&j="+$("p_jrn").value;
+ if (document.getElementById("p_jrn")) {
+ queryString+="&j="+id$("p_jrn").value;
}
}
if ( obj.account)
@@ -97,10 +97,10 @@ function search_accounting(obj)
}
else
{
- if ($(obj).account)
+ if (id$(obj).account)
{
- var e=$(obj).account;
- var str_account=$(e).value;
+ var e=id$(obj).account;
+ var str_account=id$(e).value;
queryString+="&q="+str_account;
}
}
@@ -130,7 +130,7 @@ function search_accounting(obj)
*/
function search_get_poste(obj)
{
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString="gDossier="+dossier;
queryString+="&op=account";
@@ -169,7 +169,7 @@ function search_get_poste(obj)
queryString+="&bracket";
}
- $('asearch').innerHTML=loading();
+ id$('asearch').innerHTML=loading();
var action=new Ajax.Request ( 'ajax_misc.php',
{
method:'get',
@@ -201,7 +201,7 @@ function result_poste_search(req)
var nodeXml=html[0];
var code_html=getNodeText(nodeXml);
code_html=unescape_xml(code_html);
- $('search_account').innerHTML=code_html;
+ id$('search_account').innerHTML=code_html;
}
catch (e)
{
diff --git a/html/js/admin.js b/html/js/admin.js
index 6c4643e32..91c2c8232 100644
--- a/html/js/admin.js
+++ b/html/js/admin.js
@@ -33,8 +33,8 @@ function folder_display(p_user)
*
*/
var p_filter = "";
- if ($('database_filter_input')) {
- p_filter = $('database_filter_input').value;
+ if (document.getElementById('database_filter_input')) {
+ p_filter = id$('database_filter_input').value;
}
/*
* Ajax request to display the folder
@@ -46,11 +46,11 @@ function folder_display(p_user)
// table id = database_list
var folder = {};
var create = false;
- if (!$('folder_list_div')) {
+ if (!document.getElementById('folder_list_div')) {
folder = create_div({'id': 'folder_list_div', 'cssclass': "inner_box", 'style': 'width:90%,right:5%;top:100px'});
create = true;
}
- folder = $('folder_list_div');
+ folder = id$('folder_list_div');
// Analyze XML answer
var answer = p_xml.responseXML;
var a = answer.getElementsByTagName('status');
@@ -66,7 +66,7 @@ function folder_display(p_user)
folder.innerHTML.evalScripts();
// show it
folder.show();
- $('database_filter_input').focus();
+ id$('database_filter_input').focus();
}
});
}
@@ -123,7 +123,7 @@ function folder_add(p_user, p_dossier)
}
var content = getNodeText(html[0]);
- var nb = $('database_list').rows.length + 1;
+ var nb = id$('database_list').rows.length + 1;
var row = new Element('tr', {'id': 'row' + p_dossier});
if (nb % 2 == 0) {
row.addClassName('even');
@@ -131,8 +131,8 @@ function folder_add(p_user, p_dossier)
row.addClassName('odd');
}
row.innerHTML = unescape_xml(content);
- $('database_list').appendChild(row);
- $('row_db_'+p_dossier).hide();
+ id$('database_list').appendChild(row);
+ id$('row_db_'+p_dossier).hide();
remove_waiting_box();
}
});
@@ -157,16 +157,16 @@ function display_admin_answer(p_dossier,p_action)
var folder;
var create = false;
- if (!$(div_display)) {
+ if (!document.getElementById(div_display)) {
folder = create_div({'id': div_display, 'cssclass': "inner_box", style: 'width:90%;right:5%;top:100px'});
create = true;
}
- folder=$(div_display);
+ folder=id$(div_display);
var content = getNodeText(html[0]);
folder.innerHTML=unescape_xml(content);
var pos=calcy(250);
- $(div_display).setStyle({top:pos+'px'});
+ id$(div_display).setStyle({top:pos+'px'});
folder.show();
remove_waiting_box();
diff --git a/html/js/ajax_fiche.js b/html/js/ajax_fiche.js
index 03415c18a..d4051de21 100644
--- a/html/js/ajax_fiche.js
+++ b/html/js/ajax_fiche.js
@@ -27,29 +27,21 @@
/**
* clean the row (the label, price and vat)
- * @param p_ctl the calling ctrl
+ * @param {string} p_ctl the calling ctrl
*/
function clean_Fid(p_ctl)
{
- nSell=p_ctl+"_price";
- nTvaAmount=p_ctl+"_tva_amount";
- nBuy=p_ctl+"_price";
- nTva_id=p_ctl+"_tva_id";
- if ( $(nSell) )
- {
- $(nSell).value="";
+
+ document.getElementById(p_ctl).value='';
+ var aField=['_price','_tva_amount','_tva_id'];
+ for ( field of aField) {
+ let obj=document.getElementById(p_ctl+field);
+ if ( obj ) {obj.value='0'}
}
- if ( $(nBuy) )
- {
- $(nBuy).value="";
- }
- if ( $(nTva_id) )
- {
- $(nTva_id).value="-1";
- }
- if ( $(nTvaAmount))
- {
- $(nTvaAmount).value=0;
+ var aField=['_label'];
+ for ( field of aField) {
+ let obj=document.getElementById(p_ctl+field);
+ if ( obj ) {obj.value=''}
}
}
function errorFid(request,json)
@@ -58,7 +50,7 @@ function errorFid(request,json)
}
/**
* this function fills the data from fid.php,
- * @param {object} p_ctl : field of the input,
+ * @param {object or string} p_ctl : field of the input, : object or string
* possible object member
* - label field to update with the card's name
* - price field to update with the card's price
@@ -68,56 +60,56 @@ function errorFid(request,json)
*/
function ajaxFid(p_ctl)
{
+ debugger
try
{
- var gDossier=$('gDossier').value;
- var jrn=$(p_ctl).jrn;
- $(p_ctl).value=$(p_ctl).value.toUpperCase();
- if ( jrn == undefined )
+ var gDossier=id$('gDossier').value;
+ // if p_ctl is a string that find the object
+ var dome =id$(p_ctl);
+
+ var jrn = (dome.jrn) ? dome.jrn.value:-1;
+ dome.value=dome.value.toUpperCase();
+
+ if ( jrn == undefined && document.getElementById('p_jrn')!=undefined)
{
- if ($('p_jrn')!=undefined)
- {
- jrn=$('p_jrn').value;
- }
+ jrn=id$('p_jrn').value;
}
- if ( jrn == undefined )
+
+
+ if ( trim(dome.value)=="" )
{
- jrn=-1;
- }
- if ( trim($(p_ctl).value)=="" )
- {
- nLabel=$(p_ctl).label;
- if ($(nLabel) )
+ nLabel=id$(dome).label;
+ if (document.getElementById(nLabel) )
{
- $(nLabel).value="";
- $(nLabel).innerHTML=" ";
- clean_Fid(p_ctl);
+ id$(nLabel).value="";
+ id$(nLabel).innerHTML=" ";
+ clean_Fid(dome.id);
return;
}
}
- var queryString="FID="+trim($(p_ctl).value);
- if ( $(p_ctl).label)
+ var queryString="FID="+trim(dome.value);
+ if ( dome.label)
{
- queryString+='&l='+$(p_ctl).label;
+ queryString+='&l='+dome.label;
}
- if ( $(p_ctl).tvaid)
+ if ( dome.tvaid)
{
- queryString+='&t='+$(p_ctl).tvaid;
+ queryString+='&t='+dome.tvaid;
}
- if ( $(p_ctl).price)
+ if ( dome.price)
{
- queryString+='&p='+$(p_ctl).price;
+ queryString+='&p='+dome.price;
}
- if ( $(p_ctl).purchase)
+ if ( dome.purchase)
{
- queryString+='&b='+$(p_ctl).purchase;
+ queryString+='&b='+dome.purchase;
}
- if ( $(p_ctl).typecard)
+ if ( dome.typecard)
{
- queryString+='&d='+$(p_ctl).typecard;
+ queryString+='&d='+dome.typecard;
}
queryString=queryString+"&j="+jrn+'&gDossier='+gDossier;
- queryString=queryString+'&ctl='+p_ctl.id;
+ queryString=queryString+'&ctl='+dome.id;
queryString=encodeURI(queryString);
var action=new Ajax.Request (
@@ -196,9 +188,9 @@ function ajax_error_saldo(request,json)
*/
function ajax_saldo(p_ctl)
{
- var gDossier=$('gDossier').value;
- var ctl_value=trim($(p_ctl).value);
- var jrn=$('p_jrn').value;
+ var gDossier=id$('gDossier').value;
+ var ctl_value=trim(id$(p_ctl).value);
+ var jrn=id$('p_jrn').value;
queryString="FID="+ctl_value+"&op=saldo";
queryString=queryString+'&gDossier='+gDossier+'&j='+jrn;
queryString=queryString+'&ctl='+ctl_value;
@@ -221,7 +213,7 @@ function ajax_saldo(p_ctl)
function ajax_success_saldo(request,json)
{
var answer=request.responseText.evalJSON(true);
- $('first_sold').value=answer.saldo;
+ id$('first_sold').value=answer.saldo;
}
@@ -231,8 +223,8 @@ function ajax_success_saldo(request,json)
function ajax_get_success(request,json)
{
var answer=request.responseText.evalJSON(false);
- $(answer.ctl).show();
- $(answer.ctl).innerHTML=answer.html;
+ id$(answer.ctl).show();
+ id$(answer.ctl).innerHTML=answer.html;
}
/*!\brief callback function for ajax_get when fails
*/
@@ -252,7 +244,7 @@ var category_card={};
* @param string p_object_name , name of the prefix for id
*/
category_card.add_attribut=function (p_dossier,p_fiche_def_ref,p_object_name) {
- var select=$("sel"+p_object_name);
+ var select=id$("sel"+p_object_name);
var selected_attr=select.value;
new Ajax.Request("ajax_misc.php",{
method:"post",
@@ -268,7 +260,7 @@ category_card.add_attribut=function (p_dossier,p_fiche_def_ref,p_object_name) {
if ( answer.status == 'OK') {
var newli = document.createElement("li")
- $(p_object_name + "_list").append(newli);
+ id$(p_object_name + "_list").append(newli);
newli.replace(answer.content);
document.getElementById('attribut_order').value = Sortable.serialize(p_object_name + "_list");
select.remove(select.selectedIndex);
@@ -304,11 +296,11 @@ category_card.remove_attribut=function (p_dossier,p_fiche_def_ref,p_object_name,
onSuccess:function(req) {
var answer=req.responseText.evalJSON();
if ( answer.status == 'OK') {
- $(p_object_name+"_elt"+p_attribute_id).remove();
+ id$(p_object_name+"_elt"+p_attribute_id).remove();
var option=document.createElement("option");
option.text=answer['content'];
option.value=p_attribute_id;
- $('sel'+p_object_name).add(option);
+ id$('sel'+p_object_name).add(option);
} else {
smoke.alert(answer.message);
}
@@ -328,11 +320,11 @@ category_card.check_vatnumber=function(p_domid) {
// For form , most of the parameters are in the FORM
// method is then POST
- //var queryString=$(p_form_id).serialize(true);
+ //var queryString=id$(p_form_id).serialize(true);
var queryString = {
op: 'check_vatnumber',
- vatnr:$(p_domid).value,
+ vatnr:id$(p_domid).value,
boxid: dgbox,
p_domid:p_domid
};
@@ -352,14 +344,14 @@ category_card.check_vatnumber=function(p_domid) {
if ( answer.status == 'OK')
{
- $(dgbox).update(answer.html);
- $(p_domid).value=answer.vat;
- $(p_domid).removeClassName("notice")
- $(p_domid).addClassName("valid")
+ id$(dgbox).update(answer.html);
+ id$(p_domid).value=answer.vat;
+ id$(p_domid).removeClassName("notice")
+ id$(p_domid).addClassName("valid")
} else {
- $(p_domid).addClassName("notice");
- $(p_domid).removeClassName("valid");
- $(dgbox).update(answer.html);
+ id$(p_domid).addClassName("notice");
+ id$(p_domid).removeClassName("valid");
+ id$(dgbox).update(answer.html);
}
}
diff --git a/html/js/anc_script.js b/html/js/anc_script.js
index f238ad35f..1dfbaca36 100644
--- a/html/js/anc_script.js
+++ b/html/js/anc_script.js
@@ -31,7 +31,7 @@
*/
function add_row(p_table, p_seq)
{
- var mytable = g(p_table).tBodies[0];
+ var mytable = id$(p_table).tBodies[0];
if (!mytable)
{
return;
@@ -120,14 +120,14 @@ function anc_refresh_remain(p_table, p_seq)
var remain = tot_line - tot_table;
remain = Math.round(remain * 100) / 100;
- $('remain' + p_table).innerHTML = remain;
+ id$('remain' + p_table).innerHTML = remain;
if (remain == 0)
{
- $('remain' + p_table).style.color = "green"
+ id$('remain' + p_table).style.color = "green"
}
else
{
- $('remain' + p_table).style.color = "red"
+ id$('remain' + p_table).style.color = "red"
}
} catch (a)
{
@@ -152,7 +152,7 @@ function verify_ca(div)
while (idx < 50)
{
var table = div + 't' + idx;
- if (g(table))
+ if (document.getElementById(table))
{
var total_amount = 0;
// table is found compute the different val[]
@@ -182,12 +182,12 @@ function verify_ca(div)
var diff = amount*100 - total_amount*100;
if (Math.round(diff/100) != 0.0)
{
- g(table).style.backgroundColor = 'red';
+ id$(table).style.backgroundColor = 'red';
amount_error++;
}
else
{
- g(table).style.backgroundColor = 'lightgreen';
+ id$(table).style.backgroundColor = 'lightgreen';
}
idx++;
@@ -216,7 +216,7 @@ function verify_ca(div)
*/
function search_ca(p_dossier, p_target, p_source)
{
- var pa_id = g(p_source).value;
+ var pa_id = id$(p_source).value;
waiting_box();
removeDiv('search_anc');
var qs = "op=openancsearch&gDossier=" + p_dossier + "&ctl=searchanc";
@@ -237,7 +237,7 @@ function search_ca(p_dossier, p_target, p_source)
cssclass: "inner_box",
style: pos
});
- $('searchanc').innerHTML = req.responseText;
+ id$('searchanc').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
@@ -251,7 +251,7 @@ function search_anc_form(obj)
{
var qs = "op=resultancsearch&ctl=searchanc&";
var name = obj.id;
- qs += $(name).serialize(false);
+ qs += id$(name).serialize(false);
waiting_box();
var action = new Ajax.Request('ajax_misc.php',
{
@@ -261,7 +261,7 @@ function search_anc_form(obj)
onSuccess: function(req) {
try {
remove_waiting_box();
- $('searchanc').innerHTML = req.responseText;
+ id$('searchanc').innerHTML = req.responseText;
req.responseText.evalScripts();
} catch (e) {
@@ -281,16 +281,16 @@ function caod_checkTotal()
}// Ajouter getElementById par document.all[str]
var total_deb = 0.0;
var total_cred = 0.0;
- var nb_item = g('nbrow').value;
+ var nb_item = id$('nbrow').value;
for (var i = 0; i < nb_item; i++)
{
- var doc_amount = g("pamount" + i);
+ var doc_amount = id$("pamount" + i);
if (!doc_amount)
{
return;
}
- var side = g("pdeb" + i);
+ var side = id$("pdeb" + i);
if (!side)
{
return;
@@ -316,22 +316,22 @@ function caod_checkTotal()
var r_total_cred = Math.round(total_cred * 100) / 100;
var r_total_deb = Math.round(total_deb * 100) / 100;
- g('totalDeb').innerHTML = r_total_deb;
- g('totalCred').innerHTML = r_total_cred;
+ id$('totalDeb').innerHTML = r_total_deb;
+ id$('totalCred').innerHTML = r_total_cred;
if (r_total_deb != r_total_cred)
{
- g("totalDiff").style.color = "red";
- g("totalDiff").style.fontWeight = "bold";
- g("totalDiff").innerHTML = "Différence";
+ id$("totalDiff").style.color = "red";
+ id$("totalDiff").style.fontWeight = "bold";
+ id$("totalDiff").innerHTML = "Différence";
var diff = total_deb - total_cred;
diff = Math.round(diff * 100) / 100;
- g("totalDiff").innerHTML = diff;
+ id$("totalDiff").innerHTML = diff;
}
else
{
- g("totalDiff").innerHTML = "0.0";
+ id$("totalDiff").innerHTML = "0.0";
}
}
@@ -352,7 +352,7 @@ function anc_remove_operation(p_dossier, p_oa_group)
var queryString = encodeJSON(obj);
var e = new Ajax.Request("ajax_misc.php",
{method: 'get', parameters: queryString,onSuccess:function req() {
- $("tr"+p_oa_group).remove();
+ id$("tr"+p_oa_group).remove();
}
});
@@ -370,12 +370,12 @@ function anc_remove_operation(p_dossier, p_oa_group)
function anc_add_row(tableid)
{
var style = 'class="input_text"';
- var mytable = g(tableid).tBodies[0];
+ var mytable = id$(tableid).tBodies[0];
var nNumberRow = mytable.rows.length;
var oRow = mytable.insertRow(nNumberRow);
var rowToCopy = mytable.rows[1];
var nNumberCell = rowToCopy.cells.length;
- var nb = g("nbrow");
+ var nb = id$("nbrow");
var oNewRow = mytable.insertRow(nNumberRow);
for (var e = 0; e < nNumberCell; e++)
{
@@ -388,7 +388,7 @@ function anc_add_row(tableid)
newCell.innerHTML = new_tt;
new_tt.evalScripts();
}
- $("pamount" + nb.value).value = "0";
+ id$("pamount" + nb.value).value = "0";
nb.value++;
}
/**
@@ -438,7 +438,7 @@ function anc_key_compute(p_dossier, p_table, p_amount, p_key_id)
var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car.
code_html = unescape_xml(code_html);
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
code_html.evalScripts();
removeDiv('div_anc_key_choice');
} catch (e)
@@ -491,7 +491,7 @@ function anc_key_choice(p_dossier, p_table, p_amount,p_ledger)
code_html = unescape_xml(code_html);
var position=fixed_position(50,120);
add_div({id: name_ctl, cssclass: 'inner_box', style: position, drag: 1});
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
} catch (e)
{
error_message(e.message);
@@ -540,7 +540,7 @@ function anc_key_clean(p_dossier, p_table, p_amount,p_ledger,p_jrnx_id,p_sequenc
var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car.
code_html = unescape_xml(code_html);
- $(p_table+"t"+p_sequence).innerHTML=code_html;
+ id$(p_table+"t"+p_sequence).innerHTML=code_html;
} catch (e)
{
error_message(e.message);
@@ -561,7 +561,7 @@ function anc_key_clean(p_dossier, p_table, p_amount,p_ledger,p_jrnx_id,p_sequenc
*/
function add_row_key(p_table)
{
- var mytable = g(p_table).tBodies[0];
+ var mytable = id$(p_table).tBodies[0];
if (!mytable)
{
return;
@@ -595,7 +595,7 @@ function add_row_key(p_table)
cell.innerHTML = txt;
}
}
- $('total_key').innerHTML="?";
+ id$('total_key').innerHTML="?";
}
function anc_key_compute_table()
{
@@ -615,7 +615,7 @@ function anc_key_compute_table()
}
tot=tot+Math.round(value*100)/100;
}
- $('total_key').innerHTML=Math.round(tot*100)/100;
+ id$('total_key').innerHTML=Math.round(tot*100)/100;
}
@@ -627,7 +627,7 @@ function anc_detail_op(p_oa_group,gDossier) {
parameters:{"gDossier":gDossier,"op":"anc_detail_op","oa_group":p_oa_group},
onSuccess:function (req) {
add_div({"id":"anc_detail_op_div","cssclass":"inner_box","style":"position:fixed;top:5%"});
- $('anc_detail_op_div').update(req.responseText);
+ id$('anc_detail_op_div').update(req.responseText);
remove_waiting_box();
}
});
diff --git a/html/js/card.js b/html/js/card.js
index c3e17db9a..e8168fa19 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -34,7 +34,7 @@ function boxsearch_card(p_dossier)
{
waiting_box();
removeDiv('boxsearch_card_div');
- var queryString="gDossier="+p_dossier+"&op=cardsearch"+"&card="+encodeURI($("card_search").value);
+ var queryString="gDossier="+p_dossier+"&op=cardsearch"+"&card="+encodeURI(id$("card_search").value);
var action = new Ajax.Request(
"ajax_misc.php" ,
{
@@ -49,8 +49,8 @@ function boxsearch_card(p_dossier)
var y=calcy(15);
var div_style="position:absolute;"+";top:"+y+"px";
add_div({id:'boxsearch_card_div',cssclass:'inner_box',html:loading(),style:div_style,drag:true});
- $('boxsearch_card_div').innerHTML=req.responseText;
- sorttable.makeSortable($('tb_fiche'));
+ id$('boxsearch_card_div').innerHTML=req.responseText;
+ sorttable.makeSortable(id$('tb_fiche'));
}
}
);
@@ -76,9 +76,9 @@ function search_card(obj)
{
try
{
- var gDossier=$('gDossier').value;
+ var gDossier=id$('gDossier').value;
var inp=obj.inp;
- var string_to_search=$(inp).value;
+ var string_to_search=id$(inp).value;
var label=obj.label;
var typecard=obj.typecard;
var price=obj.price;
@@ -93,8 +93,8 @@ function search_card(obj)
}
if ( jrn==undefined)
{
- if ( g('p_jrn')) {
- jrn=$('p_jrn').value;
+ if ( document.getElementById('p_jrn')) {
+ jrn=id$('p_jrn').value;
}
else {
jrn=-1;
@@ -114,7 +114,7 @@ function search_card(obj)
'amount_from_type':amount_from_type,
'inactive_card':inactive_card
});
- if ( $('search_card') ) {
+ if ( document.getElementById('search_card') ) {
removeDiv('search_card');
}
@@ -164,7 +164,7 @@ function action_concerned_save_card(obj)
var nodeXml = html[0];
var code_html = getNodeText(nodeXml);
code_html = unescape_xml(code_html);
- $(namectl).update(code_html);
+ id$(namectl).update(code_html);
removeDiv('search_card');
/* if dialog box exist with list other card, then refresh it */
if ( document.getElementById("action_concerned_list_dv") ) {
@@ -222,7 +222,7 @@ function action_concerned_list(p_obj) {
code_html = unescape_xml(code_html);
- $('action_concerned_list_dv').innerHTML = code_html;
+ id$('action_concerned_list_dv').innerHTML = code_html;
} catch (e) {
alert_box(e.message);
}
@@ -336,9 +336,9 @@ function action_concerned_search_card(obj)
sx = document.body.scrollTop + 60;
}
var div_style = "top:" + sx + "px;height:52rem";
- if ( ! $('search_card')) { add_div({id: 'search_card', cssclass: 'inner_box', html: "", style: div_style, drag: true}); }
- $('search_card').innerHTML = code_html;
- $('query').focus();
+ if ( ! document.getElementById('search_card')) { add_div({id: 'search_card', cssclass: 'inner_box', html: "", style: div_style, drag: true}); }
+ id$('search_card').innerHTML = code_html;
+ id$('query').focus();
activate_checkbox_range('select_card_ck');
}catch (e) {
alert_box(e.message);
@@ -360,10 +360,11 @@ function action_concerned_search_card(obj)
*@param obj form
*@note the same as search_card, except it answer to a FORM and not
* to a click event
+ * @see ajax_card.php
*/
function search_get_card(obj)
{
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString="gDossier="+dossier;
queryString+="&op2=fs&op=card";
@@ -417,7 +418,7 @@ function search_get_card(obj)
}
queryString=encodeURI(queryString);
- $('asearch').innerHTML=loading();
+ id$('asearch').innerHTML=loading();
var action=new Ajax.Request ( 'ajax_misc.php',
{
@@ -430,6 +431,7 @@ function search_get_card(obj)
}
/**
* show the answer of ajax request
+ * @see search_get_card
*@param answer in XML
*/
function result_card_search(req)
@@ -466,9 +468,9 @@ function result_card_search(req)
var div_style="top:"+sx+"px;min-height:80%;height:auto";
add_div({id:'search_card',cssclass:'inner_box',html:"",style:div_style,drag:false,effect:'blinddown'});
- $('search_card').innerHTML=code_html;
+ id$('search_card').innerHTML=code_html;
- if ($('query')) { $('query').focus();}
+ if (document.getElementById('query')) { id$('query').focus();}
}
catch (e)
{
@@ -500,12 +502,12 @@ function result_card_search(req)
*/
function setCtrl(p_ctrl,p_quickcode,p_ctrlname,p_label)
{
- var ctrl=g(p_ctrl);
+ var ctrl=id$(p_ctrl);
if ( ctrl )
{
ctrl.value=p_quickcode;
}
- var ctrl_name=g(p_ctrlname);
+ var ctrl_name=id$(p_ctrlname);
if ( ctrl_name )
{
ctrl_name.value=p_label;
@@ -514,29 +516,7 @@ function setCtrl(p_ctrl,p_quickcode,p_ctrlname,p_label)
-/**
- * clean the row (the label, price and vat)
- * @param p_ctl the calling ctrl
- */
-function clean_Fid(p_ctl)
-{
- nSell=p_ctl+"_price";
- nBuy=p_ctl+"_price";
- nTva_id=p_ctl+"_tva_id";
- if ( $(nSell) )
- {
- $(nSell).value="";
- }
- if ( $(nBuy) )
- {
- $(nBuy).value="";
- }
- if ( $(nTva_id) )
- {
- $(nTva_id).value="-1";
- }
-}
function errorFid(request,json)
{
alert_box(content[53]);
@@ -583,7 +563,7 @@ function fill_fin_data_onchange(ctl)
function fill_fin_data(text,li)
{
ajaxFid(text);
- ajax_saldo($(text.id));
+ ajax_saldo(id$(text.id));
}
/**
* show the ipopup window and display the details of a card,
@@ -611,17 +591,17 @@ function fill_ipopcard(obj)
var popup={'id': content,'cssclass':'inner_box2','style':str_style,'html':"",'drag':false};
add_div(popup);
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var qcode='';
- if ( $(obj).qcode != undefined )
+ if ( obj.qcode != undefined )
{
qcode=obj.qcode;
}
else
{
- qcode=$(obj).value;
+ qcode=id$(obj).value;
}
- // ctl=$(obj).id;
+ // ctl=id$(obj).id;
var queryString='gDossier='+dossier;
queryString+='&qcode='+qcode;
@@ -671,7 +651,7 @@ function successFill_ipopcard(req,json)
var code_html=getNodeText(html[0]);
code_html=unescape_xml(code_html);
- $(name_ctl).innerHTML=code_html;
+ id$(name_ctl).innerHTML=code_html;
}
catch (e)
{
@@ -698,16 +678,16 @@ function successFill_ipopcard(req,json)
*/
function select_card_type(obj)
{
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var elementId="";
// give a filter, -1 if not
- var filter=$(obj).filter;
+ var filter=id$(obj).filter;
if ( filter==undefined)
{
filter=-1;
}
var content="select_card_div";
- if ( $(content)){removeDiv(content);}
+ if ( document.getElementById(content)){removeDiv(content);}
var sx=0;
sx=calcy(160);
@@ -721,25 +701,25 @@ function select_card_type(obj)
queryString+='&ctl='+content;
queryString+='&op2=st'; // st for selecting type
queryString+='&op=card'; // st for selecting type
- if ( $(obj).win_refresh!=undefined)
+ if ( document.getElementById(obj).win_refresh!=undefined)
{
queryString+='&ref';
}
/* if an element id must be updated after creating a new card */
- if ( $(obj).elementId) {
- var elementId=$(obj).elementId;
+ if ( document.getElementById(obj).elementId) {
+ var elementId=id$(obj).elementId;
queryString+="&eltid="+elementId;
}
queryString+='&fil='+filter;
// filter on the ledger, -1 if not
- var oledger=$(obj).jrn;
+ var oledger=id$(obj).jrn;
if (oledger==undefined)
{
ledger=-1;
}
else
{
- ledger=$(obj).jrn;
+ ledger=id$(obj).jrn;
}
queryString+='&ledger='+ledger;
@@ -773,7 +753,7 @@ function select_card_type(obj)
return;
}
fill_box(req);
- $('lk_cat_card_table').focus();
+ id$('lk_cat_card_table').focus();
}
}
);
@@ -810,7 +790,7 @@ function dis_blank_card(obj)
add_div(popup);
if ( obj.gDossier.value != undefined ) {
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
} else {
var dossier=obj.gDossier;
}
@@ -848,11 +828,11 @@ function form_blank_card(obj)
var str_style="top:"+nTop+"px;left:"+nLeft+"px;width:60em;height:auto";
var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':true};
- if ( $(content)) {removeDiv(content);}
+ if ( document.getElementById(content)) {removeDiv(content);}
add_div(popup);
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString='gDossier='+dossier;
queryString+='&ctl='+content;
@@ -878,8 +858,8 @@ function form_blank_card(obj)
*/
function save_card(obj)
{
- var content=$(obj).ipopup;
- var accounting= $(obj)['av_text5'];
+ var content=id$(obj).ipopup;
+ var accounting= id$(obj)['av_text5'];
if ( accounting && accounting.value.length > 40 ) {
smoke.alert('Poste comptable trop grand');
return false;
@@ -887,9 +867,9 @@ function save_card(obj)
// Data must be taken here
- var data=$('save_card').serialize(false);
+ var data=id$('save_card').serialize(false);
waiting_box();
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString='gDossier='+dossier;
queryString+='&ctl='+content;
queryString+=data;
@@ -922,7 +902,7 @@ function save_card(obj)
// if status == OK and after_save == 1
// then add a row to the table
if ( status_value == 'OK' && after_save == 1) {
- var table_card=$('fiche_tb_id');
+ var table_card=id$('fiche_tb_id');
f_id=getNodeText(req.responseXML.getElementsByTagName("f_id")[0]);
var row=new Element('tr');
row.id="row_card"+f_id;
@@ -943,9 +923,9 @@ function save_card(obj)
var eltid=getNodeText(elt[0]);
if ( eltid !="") {
var eltvalue=req.responseXML.getElementsByTagName("elt_value");
- $(eltid).value=getNodeText(eltvalue[0]);
+ id$(eltid).value=getNodeText(eltvalue[0]);
fill_data_onchange(eltid);
- $(eltid).focus();
+ id$(eltid).focus();
}
}
if (status_value == "OK") {
@@ -984,12 +964,12 @@ function add_category(obj)
// show ipopup
var div={id:obj.ipopup,
cssclass:"inner_box",drag:1,style:div_style};
- if ( $(div) ) {
+ if ( document.getElementById(div) ) {
removeDiv(div);
}
add_div(div);
waiting_box();
- var dossier=$('gDossier').value;
+ var dossier=id$('gDossier').value;
var queryString='gDossier='+dossier;
queryString+='&op2=ac';
queryString+='&op=card';
@@ -1014,15 +994,15 @@ function add_category(obj)
*/
function save_card_category(obj)
{
- if ( ! $(obj).ipopup)
+ if ( ! document.getElementById(obj).ipopup)
{
alert_box('Erreur pas d\' attribut ipopup '+obj.id);
return;
};
try {
// Data must be taken here
- data=$('newcat').serialize(false);
- var dossier=$('gDossier').value;
+ data=id$('newcat').serialize(false);
+ var dossier=id$('gDossier').value;
var queryString='ctl='+obj.ipopup+'&';
queryString+=data;
queryString+='&op2=scc'; // sc for save card
@@ -1124,7 +1104,7 @@ function action_save_concerned(p_form_id) {
var code_html = getNodeText(nodeXml);
code_html = unescape_xml(code_html);
removeDiv('search_card');
- $('concerned_card_td').innerHTML = code_html;
+ id$('concerned_card_td').innerHTML = code_html;
} catch (e) {
}
@@ -1156,10 +1136,10 @@ function action_remove_concerned(p_dossier,p_fiche_id,p_action_id)
var nodeXml=html[0];
var code_html = getNodeText(nodeXml);
code_html = unescape_xml(code_html);
- $('concerned_card_td').innerHTML = code_html;
+ id$('concerned_card_td').innerHTML = code_html;
removeDiv('search_card');
- $(namectl).remove();
+ id$(namectl).remove();
} catch (e) {
if ( console) { console.log('Erreur ') + e.message;}
@@ -1234,7 +1214,7 @@ function modify_card(p_fiche_id)
console.error("card_gdossier error");
throw ("card_gdossier not set");
}
- var dossier = $('card_gdossier').value;
+ var dossier = id$('card_gdossier').value;
var action = new Ajax.Request('ajax_misc.php',
@@ -1262,8 +1242,8 @@ function delete_card_id(p_fiche_id)
console.error("card_gdossier error");
throw ("card_gdossier not set");
}
- $(row).addClassName("background-selected");
- var dossier = $('card_gdossier').value;
+ id$(row).addClassName("background-selected");
+ var dossier = id$('card_gdossier').value;
smoke.confirm(content[47], function (e) {
if (e) {
waiting_box();
@@ -1272,7 +1252,7 @@ function delete_card_id(p_fiche_id)
parameters: {'gDossier':dossier,"op":'card',"op2":"rm_card","f_id":p_fiche_id,'ctl':row} ,
onSuccess: function (req) {
remove_waiting_box();
- var table_card=$('fiche_tb_id');
+ var table_card=id$('fiche_tb_id');
var answer = req.responseXML;
var a = answer.getElementsByTagName('ctl');
if (a.length == 0)
@@ -1288,7 +1268,7 @@ function delete_card_id(p_fiche_id)
if ((code_html) == "OK") {
Effect.Fade(row, {duration: 0.1});
- table_card.tBodies[0].removeChild($(row));
+ table_card.tBodies[0].removeChild(id$(row));
alternate_row_color("fiche_tb_id");
} else {
smoke.alert(code_html);
@@ -1298,7 +1278,7 @@ function delete_card_id(p_fiche_id)
});
} else{
- $(row).removeClassName("background-selected");
+ id$(row).removeClassName("background-selected");
}
});
@@ -1338,11 +1318,11 @@ function card_update_row(obj)
if ( document.getElementById(name_ctl)) {
// update the row
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
new Effect.Highlight(name_ctl ,{startcolor: '#FAD4D4',endcolor: '#F78082' });
}
- $(a[0].firstChild.nodeValue).remove();
+ id$(a[0].firstChild.nodeValue).remove();
} catch (e) {
@@ -1391,7 +1371,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});
- $("d_linked_card_option").update(req.responseText);
+ id$("d_linked_card_option").update(req.responseText);
}
});
@@ -1414,7 +1394,7 @@ function save_linked_card_option(obj)
onSuccess:function(req) {
remove_waiting_box();
removeDiv("d_linked_card_option");
- $("other_"+obj.action_person_id.value).update(req.responseText);
+ id$("other_"+obj.action_person_id.value).update(req.responseText);
new Effect.Highlight("other_"+obj.action_person_id.value,{startcolor: '#FAD4D4',endcolor: '#F78082' });
}
});
@@ -1503,10 +1483,10 @@ CategoryCardDefinition.prototype.add_attribut = function (attribut_id) {
// if successfull add id on existing_list and remove from available_list
// remove from available_list
- $('avail_attr_' + attribut_id).remove();
+ id$('avail_attr_' + attribut_id).remove();
var parser = new DOMParser();
var element = parser.parseFromString(req.responseText, 'text/html');
- $(here.existing_list).appendChild(element.body.firstChild);
+ id$(here.existing_list).appendChild(element.body.firstChild);
new Effect.Highlight('existing_attr_' + attribut_id, {
startcolor: '#FAD4D4',
endcolor: '#F78082'
@@ -1551,10 +1531,10 @@ CategoryCardDefinition.prototype.remove_attribut = function (attribut_id) {
// if successfull add id on existing_list and remove from available_list
// remove from available_list
- $('existing_attr_' + attribut_id).remove();
+ id$('existing_attr_' + attribut_id).remove();
var parser = new DOMParser();
var element = parser.parseFromString(req.responseText, 'text/html');
- $(here.available_list).appendChild(element.body.firstChild);
+ id$(here.available_list).appendChild(element.body.firstChild);
alternate_row_color_list(here.available_list);
Sortable.create('attribut_card', {tag: 'li', hoverclass: inner_box});
diff --git a/html/js/infobulle.js b/html/js/infobulle.js
index e2d054392..2ab0cfd96 100644
--- a/html/js/infobulle.js
+++ b/html/js/infobulle.js
@@ -81,9 +81,9 @@ function displaySelectBox(p_name) {
newDiv.id="select_box_content"+p_name;
document.body.appendChild(newDiv);
newDiv.addClassName("select_box");
- $("select_box_content"+p_name).onmouseleave=function() {
+ id$("select_box_content"+p_name).onmouseleave=function() {
try {
- var newDiv=$("select_box_content"+p_name);
+ var newDiv=id$("select_box_content"+p_name);
newDiv.setStyle({display:"none"});
} catch(e) {
alert(e.message);
@@ -92,7 +92,7 @@ function displaySelectBox(p_name) {
} else {
newDiv=document.getElementById("select_box_content"+p_name);
}
- newDiv.innerHTML=$("select_box"+p_name).innerHTML;
+ newDiv.innerHTML=id$("select_box"+p_name).innerHTML;
var viewport = document.viewport.getDimensions();
var locPosY=posY;
if ( posY+offsetY+ newDiv.getHeight() > window.innerHeight -3) {
@@ -101,14 +101,15 @@ function displaySelectBox(p_name) {
newDiv.style.top=locPosY+"px";
newDiv.style.left=document.getElementById(p_name+"_bt").offsetLeft+"px";
- newDiv.setStyle({display:"block",position:"absolute","z-index":999});
+ card_layer++;
+ newDiv.setStyle({display:"block",position:"absolute","z-index":card_layer});
- if ( $("search_"+p_name+"_list") ) {
+ if ( id$("search_"+p_name+"_list") ) {
var sTmp = newDiv.innerHTML;
var regex=new RegExp(p_name+"_list","g");
sTmp = sTmp.replace(regex,p_name+"_t_list");
newDiv.innerHTML=sTmp;
- $("search_"+p_name+"_t_list").focus();
+ id$("search_"+p_name+"_t_list").focus();
}
} catch(e) {
alert(e.message);
diff --git a/html/js/managetable.js b/html/js/managetable.js
index 7b522288d..8026f1e21 100644
--- a/html/js/managetable.js
+++ b/html/js/managetable.js
@@ -384,7 +384,7 @@ var ManageTable = function (p_table_name)
$(obj.id).setStyle(here.mt_style);
remove_waiting_box();
$(obj.id).update(x['html']);
- Effect.SlideDown(obj.id,{duration:0.3,scaleX:false,scaleY:true,scaleContent:false});
+ $(obj.id).show();
} catch (e) {
smoke.alert(content[48] + e.message);
}
diff --git a/html/js/modele_document.js b/html/js/modele_document.js
index 6bbf8d12f..6872f2e6e 100644
--- a/html/js/modele_document.js
+++ b/html/js/modele_document.js
@@ -71,8 +71,8 @@ function modify_document_success_box(req,json)
var code_html=getNodeText(html[0]);
code_html=unescape_xml(code_html);
- g(name_ctl).innerHTML=code_html;
- g(name_ctl).style.height='auto';
+ id$(name_ctl).innerHTML=code_html;
+ id$(name_ctl).style.height='auto';
}
catch (e)
{
diff --git a/html/js/noalyss_debug.js b/html/js/noalyss_debug.js
new file mode 100644
index 000000000..cf9e3bdbb
--- /dev/null
+++ b/html/js/noalyss_debug.js
@@ -0,0 +1,22 @@
+/*
+ * 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
+ */
+
+/**
+ * @file this file is for enable debug , just check variable document.debug_noalyss
+ */
+document.debug_noalyss=true;
\ No newline at end of file
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index e4d4e7070..080b9c483 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -28,14 +28,15 @@ var ask_reload = 0;
// tag_choose Element which contains all the selected tags
var tag_choose = '';
var aDraggableElement = new Array();
-
+// Layer for z-index , see function get_next_layer , must be used in PHP and JS
+var layer=0;
// document.viewport depends of prototype.js
var viewport = document.viewport.getDimensions(); // Gets the viewport as an object literal
var width = viewport.width; // Usable window width
var height = viewport.height;
/**
- * return undefined if nothing is found , otherwise return the DOM elemnt
+ * return undefined if nothing is found , otherwise return the DOM elemnt, try to find an DOM Element inside p_element
* @param {type} p_name_dom
* @param {type} name_child
* @returns {undefined}
@@ -73,7 +74,7 @@ function infodiv(req, json) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- g(name_ctl + "info").innerHTML = code_html;
+ id$(name_ctl + "info").innerHTML = code_html;
} catch (e) {
alert_box("success_box" + e.message);
}
@@ -95,7 +96,7 @@ function deleteRow(tb, obj) {
var td = obj.parentNode;
var tr = td.parentNode;
var lidx = tr.rowIndex;
- g(tb).deleteRow(lidx);
+ id$(tb).deleteRow(lidx);
} else {
return;
@@ -106,7 +107,7 @@ function deleteRow(tb, obj) {
function deleteRowRec(tb, obj) {
var tr = obj;
var lidx = tr.rowIndex;
- g(tb).deleteRow(lidx);
+ id$(tb).deleteRow(lidx);
}
/*!\brief remove trailing and heading space
@@ -122,32 +123,47 @@ function trim(s) {
* @param ID is a string
* @return the found object of undefined if not found
*/
-function g(ID) {
- if (document.getElementById) {
- return this.document.getElementById(ID);
+function id$(ID) {
+ if (ID instanceof Object ) return ID;
+ if (document.getElementById(ID)) {
+ return document.getElementById(ID);
} else if (document.all) {
return document.all[ID];
} else {
+ document.debug_noalyss&&console.error(`id$ ${ID}`)
return undefined;
}
}
+/**
+ * this function is deprecated and replaced by id$
+ * @deprecated
+ * @param ID
+ * @returns {*}
+ */
+function g(ID) {
+ document.debug_noalyss&& console.warn(`g(${ID} is deprecated, use id$`);
+ return id$(ID);
+}
+function get_next_layer(){
+ return layer++;
+}
/**
* enable the type of periode
*/
function enable_type_periode() {
- if ($("type_periode").options[$("type_periode").selectedIndex].value == 0) {
- $('from_periode').enable();
- $('to_periode').enable();
- $('from_date').disable();
- $('to_date').disable();
- $('p_step').enable();
+ if (document.getElementById("type_periode").options[id$("type_periode").selectedIndex].value == 0) {
+ id$('from_periode').enable();
+ id$('to_periode').enable();
+ id$('from_date').disable();
+ id$('to_date').disable();
+ id$('p_step').enable();
} else {
- $('from_periode').disable();
- $('to_periode').disable();
- $('from_date').enable();
- $('to_date').enable();
- $('p_step').disable();
+ id$('from_periode').disable();
+ id$('to_periode').disable();
+ id$('from_date').enable();
+ id$('to_date').enable();
+ id$('p_step').disable();
}
}
@@ -188,11 +204,11 @@ function encodeJSON(obj) {
}
function hide(p_param) {
- g(p_param).style.display = 'none';
+ id$(p_param).style.display = 'none';
}
function show(p_param) {
- g(p_param).style.display = 'block';
+ id$(p_param).style.display = 'block';
}
/**
@@ -201,7 +217,7 @@ function show(p_param) {
*@param selectIt : the value selected in case of Field is a object select, numeric
*/
function SetFocus(Field, SelectIt) {
- var elem = g(Field);
+ var elem = id$(Field);
if (elem) {
elem.focus();
}
@@ -226,21 +242,21 @@ function set_inparent(p_ctl, p_value, p_add) {
@param p_add if we don't replace the current value but we add something
*/
function set_value(p_ctl, p_value, p_add) {
- if (g(p_ctl)) {
- var g_ctrl = g(p_ctl);
+ if (document.getElementById(p_ctl)) {
+ var g_ctrl = id$(p_ctl);
if (p_add != undefined && p_add === 1) {
if (g_ctrl.value) {
p_value = g_ctrl.value + ',' + p_value;
}
}
if (g_ctrl.tagName === 'INPUT') {
- g(p_ctl).value = p_value;
+ id$(p_ctl).value = p_value;
}
if (g_ctrl.tagName === 'SPAN') {
- g(p_ctl).innerHTML = p_value;
+ id$(p_ctl).innerHTML = p_value;
}
if (g_ctrl.tagName === 'SELECT') {
- g(p_ctl).value = p_value;
+ id$(p_ctl).value = p_value;
}
}
}
@@ -302,7 +318,7 @@ function format_number(obj, p_prec) {
value = Math.round(value * arrondi) / arrondi;
- $(obj).value = value;
+ id$(obj).value = value;
}
/**
@@ -340,37 +356,37 @@ function format_date(p_object) {
* @param rotate : if true with rotate the object of p_button otherwise
*/
function toggleHideShow(p_obj, p_button, rotate) {
- var div_obj = g(p_obj);
+ var div_obj = id$(p_obj);
var stat = div_obj.style.display;
- var str = (g(p_button)) ? g(p_button).value : "";
+ var str = (id$(p_button)) ? id$(p_button).value : "";
if (stat === 'none') {
// specific for the DIV id search_form
if (div_obj.id == 'search_form') {
show(p_obj);
} else {
- $(p_obj).show()
+ id$(p_obj).show()
}
str = str.replace(/Afficher/, content[62]);
- g(p_button).value = str;
+ id$(p_button).value = str;
} else {
// specific for the DIV di search_form
if (!div_obj.id == 'search_form') {
hide(p_obj);
} else {
- $(p_obj).hide()
+ id$(p_obj).hide()
}
str = str.replace(/Cacher/, content[63]);
- g(p_button).value = str;
+ id$(p_button).value = str;
}
if (!rotate) return;
if (stat == "none") {
- g(p_button).addClassName("icon-up-open-1")
- g(p_button).removeClassName(" icon-down-open-2")
+ id$(p_button).addClassName("icon-up-open-1")
+ id$(p_button).removeClassName(" icon-down-open-2")
} else {
- g(p_button).removeClassName("icon-up-open-1")
- g(p_button).addClassName(" icon-down-open-2")
+ id$(p_button).removeClassName("icon-up-open-1")
+ id$(p_button).addClassName(" icon-down-open-2")
}
@@ -459,7 +475,7 @@ function success_misc(req) {
var nodeXml = html[0];
var code_html = getNodeText(nodeXml);
code_html = unescape_xml(code_html);
- $("user_cal").innerHTML = code_html;
+ id$("user_cal").innerHTML = code_html;
} catch (e) {
alert_box(e.message);
}
@@ -523,9 +539,9 @@ function cat_doc_remove(p_dt_id, p_dossier) {
alert_box('erreur
' + message_text);
return;
}
- $('row' + row_id).style.textDecoration = "line-through";
- $('X' + row_id).style.display = 'none';
- $('M' + row_id).style.display = 'none';
+ id$('row' + row_id).style.textDecoration = "line-through";
+ id$('X' + row_id).style.display = 'none';
+ id$('M' + row_id).style.display = 'none';
} catch (e) {
alert_box(e.message);
}
@@ -553,7 +569,7 @@ function cat_doc_change(p_dt_id, p_dossier) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'change_doc_div', style: str_style, cssclass: 'inner_box', drag: "1"});
- $('change_doc_div').innerHTML = req.responseText;
+ id$('change_doc_div').innerHTML = req.responseText;
}
}
@@ -567,7 +583,7 @@ function cat_doc_change(p_dt_id, p_dossier) {
*/
function popup_select_tva(obj, p_function_callback) {
try {
- if ($('tva_select')) {
+ if (document.getElementById('tva_select')) {
removeDiv('tva_select');
}
@@ -612,8 +628,8 @@ function popup_select_tva(obj, p_function_callback) {
'drag': false
};
add_div(popup);
- $('lk_tva_select_table').focus();
- sorttable.makeSortable($('tva_select_table'));
+ id$('lk_tva_select_table').focus();
+ sorttable.makeSortable(id$('tva_select_table'));
if (p_function_callback) {
p_function_callback.call(null);
}
@@ -694,10 +710,10 @@ function create_div(obj) {
try {
var top = document;
var elt = null;
- if (!$(obj.id)) {
+ if (!document.getElementById(obj.id)) {
elt = top.createElement('div');
} else {
- elt = $(obj.id);
+ elt = id$(obj.id);
}
if (obj.id) {
elt.setAttribute('id', obj.id);
@@ -763,11 +779,11 @@ function add_div(obj) {
/**
* remove a object created with add_div
- * @param elt id of the elt
+ * @param str_elt string id of the elt
*/
-function removeDiv(elt) {
- if (g(elt)) {
- document.body.removeChild(g(elt));
+function removeDiv(str_elt) {
+ if (document.getElementById(str_elt)) {
+ document.body.removeChild(id$(str_elt));
}
// if reloaded if asked the window will be reloaded when
// the box is closed
@@ -778,8 +794,8 @@ function removeDiv(elt) {
}
function waiting_node() {
- $('info_div').innerHTML = 'Un instant';
- $('info_div').style.display = "block";
+ id$('info_div').innerHTML = 'Un instant';
+ id$('info_div').style.display = "block";
}
/**
@@ -793,7 +809,7 @@ function waiting_box() {
};
var y = fixed_position(10, 250)
obj.style = y + ";width:20%;margin-left:40%;";
- if ($('wait_box')) {
+ if (document.getElementById('wait_box')) {
removeDiv('wait_box');
}
waiting_node();
@@ -817,7 +833,7 @@ function waiting_box() {
function show_box(obj) {
add_div(obj);
if (!obj.fixed) {
- g(obj.id).style.top = calcy(40) + "px";
+ id$(obj.id).style.top = calcy(40) + "px";
show(obj.id);
} else {
show(obj.id);
@@ -852,11 +868,11 @@ function success_box(req, json) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- g(name_ctl).innerHTML = code_html;
- g(name_ctl).style.height = 'auto';
+ id$(name_ctl).innerHTML = code_html;
+ id$(name_ctl).style.height = 'auto';
if (name_ctl == 'popup')
- g(name_ctl).style.width = 'auto';
+ id$(name_ctl).style.width = 'auto';
} catch (e) {
alert_box("success_box" + e.message);
}
@@ -879,10 +895,10 @@ function show_ledger_choice(json_obj) {
waiting_box();
var i = 0;
var query = "gDossier=" + json_obj.dossier + '&type=' + json_obj.type + '&div=' + json_obj.div + '&op=ledger_show';
- query = query + '&nbjrn=' + $(json_obj.div + 'nb_jrn').value;
+ query = query + '&nbjrn=' + id$(json_obj.div + 'nb_jrn').value;
query = query + '&all_type=' + json_obj.all_type;
- for (i = 0; i < $(json_obj.div + 'nb_jrn').value; i++) {
- query = query + "&r_jrn[]=" + $(json_obj.div + 'r_jrn[' + i + ']').value;
+ for (i = 0; i < id$(json_obj.div + 'nb_jrn').value; i++) {
+ query = query + "&r_jrn[]=" + id$(json_obj.div + 'r_jrn[' + i + ']').value;
}
query = encodeURI(query);
var action = new Ajax.Request(
@@ -926,7 +942,7 @@ function show_ledger_choice(json_obj) {
code_html = unescape_xml(code_html);
remove_waiting_box();
- g(obj.id).innerHTML = code_html;
+ id$(obj.id).innerHTML = code_html;
} catch (e) {
alert_box("show_ledger_callback" + e.message);
@@ -951,10 +967,10 @@ function show_ledger_choice(json_obj) {
*/
function hide_ledger_choice(p_frm_search) {
try {
- var nb = $(p_frm_search).nb_jrn.value;
+ var nb = id$(p_frm_search).nb_jrn.value;
var div = "";
- if ($(p_frm_search).div) {
- div = $(p_frm_search).div.value;
+ if (document.getElementById(p_frm_search).div) {
+ div = id$(p_frm_search).div.value;
}
var i = 0;
var str = "";
@@ -964,13 +980,13 @@ function hide_ledger_choice(p_frm_search) {
for (i = 0; i < nb; i++) {
n_name = div + "r_jrn[" + sel + "]";
name = div + "r_jrn" + i;
- if ($(name).checked) {
- str += '';
+ if (document.getElementById(name).checked) {
+ str += '';
sel++;
}
}
str += '';
- $('ledger_id' + div).innerHTML = str;
+ id$('ledger_id' + div).innerHTML = str;
removeDiv(div + 'jrn_search');
return false;
} catch (e) {
@@ -984,14 +1000,14 @@ function hide_ledger_choice(p_frm_search) {
* show the cat of ledger choice
*/
function show_cat_choice() {
- g('div_cat').style.visibility = 'visible';
+ id$('div_cat').style.visibility = 'visible';
}
/**
* hide the cat of ledger choice
*/
function hide_cat_choice() {
- g('div_cat').style.visibility = 'hidden';
+ id$('div_cat').style.visibility = 'hidden';
}
/**
@@ -999,12 +1015,12 @@ function hide_cat_choice() {
*/
function for_add_row(tableid) {
style = 'class="input_text"';
- var mytable = g(tableid).tBodies[0];
+ var mytable = id$(tableid).tBodies[0];
var nNumberRow = mytable.rows.length;
var oRow = mytable.insertRow(nNumberRow);
var rowToCopy = mytable.rows[1];
var nNumberCell = rowToCopy.cells.length;
- var nb = g("nbrow");
+ var nb = id$("nbrow");
var oNewRow = mytable.insertRow(nNumberRow);
for (var e = 0; e < nNumberCell; e++) {
var newCell = oRow.insertCell(e);
@@ -1019,10 +1035,10 @@ function for_add_row(tableid) {
newCell.innerHTML = new_tt;
new_tt.evalScripts();
}
- $("an_cat_acc" + nb.value).value = "";
- $("an_qc" + nb.value).value = "";
- $("an_label" + nb.value).value = "";
- $("an_cat_amount" + nb.value).value = "0";
+ id$("an_cat_acc" + nb.value).value = "";
+ id$("an_qc" + nb.value).value = "";
+ id$("an_label" + nb.value).value = "";
+ id$("an_cat_amount" + nb.value).value = "0";
nb.value++;
}
@@ -1031,7 +1047,7 @@ function for_add_row(tableid) {
* @param form_id id of the form
*/
function toggle_checkbox(form_id) {
- var form = g(form_id);
+ var form = id$(form_id);
for (var i = 0; i < form.length; i++) {
var e = form.elements[i];
if (e.type === 'checkbox') {
@@ -1049,7 +1065,7 @@ function toggle_checkbox(form_id) {
* @param form_id id of the form
*/
function select_checkbox(form_id) {
- var form = $(form_id);
+ var form = id$(form_id);
for (var i = 0; i < form.length; i++) {
var e = form.elements[i];
if (e.type === 'checkbox') {
@@ -1066,7 +1082,7 @@ function select_checkbox(form_id) {
* @param attribute value
*/
function select_checkbox_attribute(form_id, p_attribute_name, p_attribute_value) {
- var form = $(form_id);
+ var form = id$(form_id);
for (var i = 0; i < form.length; i++) {
var e = form.elements[i];
if (e.type === 'checkbox' && e.getAttribute(p_attribute_name) == p_attribute_value) {
@@ -1080,7 +1096,7 @@ function select_checkbox_attribute(form_id, p_attribute_name, p_attribute_value)
* @param form_id id of the form
*/
function unselect_checkbox(form_id) {
- var form = $(form_id);
+ var form = id$(form_id);
for (var i = 0; i < form.length; i++) {
var e = form.elements[i];
if (e.type === 'checkbox') {
@@ -1093,7 +1109,7 @@ function unselect_checkbox(form_id) {
* show the calculator
*/
function show_calc() {
- if (g('calc1')) {
+ if (document.getElementById('calc1')) {
this.document.getElementById('inp').value = "";
this.document.getElementById('inp').focus();
return;
@@ -1126,7 +1142,7 @@ function display_periode(p_dossier, p_id) {
'style': 'width:30em',
'drag': true
};
- if (!$('mod_periode')) {
+ if (!document.getElementById('mod_periode')) {
add_div(popup);
}
var action = new Ajax.Request(
@@ -1138,8 +1154,8 @@ function display_periode(p_dossier, p_id) {
onSuccess: success_display_periode
}
);
- $('mod_periode').style.top = (posY - 70) + "px";
- $('mod_periode').style.left = (posX - 70) + "px";
+ id$('mod_periode').style.top = (posY - 70) + "px";
+ id$('mod_periode').style.left = (posX - 70) + "px";
} catch (e) {
alert_box("display_periode " + e.message);
}
@@ -1160,7 +1176,7 @@ function success_display_periode(req) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- $('mod_periode').innerHTML = code_html;
+ id$('mod_periode').innerHTML = code_html;
} catch (e) {
alert_box("success_display_periode".e.message);
}
@@ -1174,7 +1190,7 @@ function success_display_periode(req) {
function save_periode(obj) {
try {
- var queryString = $(obj).serialize() + "&op=save_per";
+ var queryString = id$(obj).serialize() + "&op=save_per";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -1219,7 +1235,7 @@ function fill_box(req) {
var name_ctl = a[0].firstChild.nodeValue;
var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car.
code_html = unescape_xml(code_html);
- $(name_ctl).innerHTML = code_html;
+ id$(name_ctl).innerHTML = code_html;
} catch (e) {
alert_box(e.message);
if (console) {
@@ -1269,7 +1285,7 @@ function mod_predf_op(dossier_id, od_id, p_ledger) {
function save_predf_op(obj) {
waiting_box();
- var querystring = $(obj).serialize() + '&op=save_predf';
+ var querystring = id$(obj).serialize() + '&op=save_predf';
// Create a ajax request to get all the person
var action = new Ajax.Request('ajax_misc.php',
{
@@ -1286,8 +1302,8 @@ function save_predf_op(obj) {
/**
*ctl_concern is the widget to update
*amount_id is either a html obj. or an amount and the field tiers if given
- * @param {type} dossier
- * @param {type} ctl_concern
+ * @param {int} dossier
+ * @param {string} ctl_concern DOM id that receive the number
* @param {float or string} amount_id Amount or DOM Id of the element containing the amount
* @param {float} ledger
* @param {type} p_id_targetDom Element (div) where to display the search result
@@ -1297,12 +1313,12 @@ function save_predf_op(obj) {
function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target, p_tiers) {
if (amount_id === undefined) {
amount_id = 0;
- } else if ($(amount_id)) {
- if ($(amount_id).value) {
- amount_id = $(amount_id).value;
+ } else if (document.getElementById(amount_id)) {
+ if (id$(amount_id).value) {
+ amount_id = id$(amount_id).value;
} else if
- ($(amount_id).innerHTML) {
- amount_id = $(amount_id).innerHTML;
+ (id$(amount_id).innerHTML) {
+ amount_id = id$(amount_id).innerHTML;
}
}
var tiers = "";
@@ -1318,8 +1334,8 @@ function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target,
var str_style = fixed_position(77, 99);
str_style += ";width:92%;overflow:auto;";
waiting_box();
- var hide_operation = $(ctl_concern).getAttribute("hide_operation");
- var single_operation = $(ctl_concern).getAttribute("single_operation");
+ var hide_operation = id$(ctl_concern).getAttribute("hide_operation");
+ var single_operation = id$(ctl_concern).getAttribute("single_operation");
var param_send = {
gDossier: dossier,
@@ -1345,7 +1361,7 @@ function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target,
remove_waiting_box();
var div = {id: target, cssclass: 'inner_box', style: str_style, drag: 0};
add_div(div);
- $(target).innerHTML = req.responseText;
+ id$(target).innerHTML = req.responseText;
req.responseText.evalScripts();
}
}
@@ -1353,15 +1369,16 @@ function search_reconcile(dossier, ctl_concern, amount_id, ledger, p_id_target,
}
/**
- * search in a popin obj if the object form
+ * search in a popin obj if the object form,
+ * @param obj DOM of the FORM
*/
function search_operation(obj) {
try {
- var dossier = g('gDossier').value;
+ var dossier = id$('gDossier').value;
waiting_box();
var target = "search" + layer;
- if ($(obj)["target"]) {
- target = $(obj)["target"].value;
+ if (obj["target"]) {
+ target = obj["target"].value;
}
var qs = Form.serialize('search_form_ajx') + "&op=search_op";
var action = new Ajax.Request('ajax_misc.php',
@@ -1371,7 +1388,7 @@ function search_operation(obj) {
onFailure: null,
onSuccess: function (req) {
remove_waiting_box();
- $(target).innerHTML = req.responseText;
+ id$(target).innerHTML = req.responseText;
req.responseText.evalScripts();
}
}
@@ -1386,7 +1403,11 @@ function search_operation(obj) {
* Update the field e_concerned, from class_iconcerned
* Value is the field where to put the quick-code but only if one checkbox has been
* selected
- * @param {type} obj
+ * @param {DOM Element} obj : DOM FORM ,
+ * - element : ctlc : will contain the JRN.JR_ID ,
+ * - tiers : the name of the counterparty
+ * - target : DGBOX displaying the search result
+ *
* @returns {undefined}
*/
function set_reconcile(obj) {
@@ -1405,13 +1426,13 @@ function set_reconcile(obj) {
if (elmt.checked === true) {
var str_name = elmt.name;
var nValue = str_name.replace("jr_concerned", "");
- if ($(ctlc.value).value != '') {
- $(ctlc.value).value += ',';
+ if (id$(ctlc.value).value != '') {
+ id$(ctlc.value).value += ',';
} else {
if (tiers && tiers.value != "") {
- $(tiers.value).value = elmt.value;
+ id$(tiers.value).value = elmt.value;
/* set the name */
new Ajax.Request("fid.php", {
method: "get",
@@ -1423,15 +1444,15 @@ function set_reconcile(obj) {
var num = tiers_card.replace("e_other", "");
var tiers_name_id = "e_other" + "_name" + num;
var answer = req.responseText.evalJSON();
- $(tiers_name_id).value = answer["name"];
+ id$(tiers_name_id).value = answer["name"];
}
});
}
}
if (single_operation == 0) {
- $(ctlc.value).value += nValue;
+ id$(ctlc.value).value += nValue;
} else {
- $(ctlc.value).value = nValue;
+ id$(ctlc.value).value = nValue;
}
}
@@ -1444,13 +1465,13 @@ function set_reconcile(obj) {
}
function remove_waiting_node() {
- $('info_div').innerHTML = "";
- $('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
}
function remove_waiting_box() {
- if ($('wait_box')) {
+ if (document.getElementById('wait_box')) {
Effect.Fade('wait_box', {duration: 0.6});
}
@@ -1474,10 +1495,10 @@ function get_profile_detail(gDossier, profile_id) {
onFailure: null,
onSuccess: function (req) {
remove_waiting_box();
- $('list_profile').hide();
- $('detail_profile').innerHTML = req.responseText;
+ id$('list_profile').hide();
+ id$('detail_profile').innerHTML = req.responseText;
req.responseText.evalScripts();
- $('detail_profile').show();
+ id$('detail_profile').show();
if (profile_id != "-1")
profile_show('profile_gen_div');
}
@@ -1539,7 +1560,7 @@ function mod_menu(gdossier, pm_id) {
try {
remove_waiting_box();
add_div({id: "divdm" + pm_id, drag: 1, cssclass: "inner_box", style: pos});
- $('divdm' + pm_id).innerHTML = req.responseText;
+ id$('divdm' + pm_id).innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
}
@@ -1571,13 +1592,13 @@ function display_sub_menu(p_dossier, p_profile, p_dep, p_level) {
onSuccess: function (req) {
try {
remove_waiting_box();
- if ($('menu_table').rows.length > p_level) {
- $('menu_table').rows[1].remove();
+ if (id$('menu_table').rows.length > p_level) {
+ id$('menu_table').rows[1].remove();
}
- $('sub' + p_dep).addClassName("selectedmenu");
+ id$('sub' + p_dep).addClassName("selectedmenu");
var new_row = document.createElement('TR');
new_row.innerHTML = req.responseText;
- $('menu_table').appendChild(new_row);
+ id$('menu_table').appendChild(new_row);
} catch (e) {
alert_box(e.message);
}
@@ -1605,9 +1626,9 @@ function remove_sub_menu(p_dossier, profile_menu_id) {
onSuccess: function (req) {
try {
remove_waiting_box();
- $('sub' + profile_menu_id).remove();
- if ($('menu_table').rows.length > 1) {
- $('menu_table').rows[1].remove();
+ id$('sub' + profile_menu_id).remove();
+ if (id$('menu_table').rows.length > 1) {
+ id$('menu_table').rows[1].remove();
}
} catch (e) {
@@ -1655,7 +1676,7 @@ function add_menu(obj) {
try {
remove_waiting_box();
add_div({id: "divdm" + p_id, drag: 1, "cssclass": "inner_box", "style": pos});
- $('divdm' + p_id).innerHTML = req.responseText;
+ id$('divdm' + p_id).innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
}
@@ -1685,7 +1706,7 @@ function add_plugin(p_dossier) {
remove_waiting_box();
var pos = fixed_position(250, 150) + ";width:30%";
add_div({id: "divplugin", drag: 1, cssclass: "inner_box", style: pos});
- $('divplugin').innerHTML = req.responseText;
+ id$('divplugin').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
}
@@ -1715,7 +1736,7 @@ function mod_plugin(p_dossier, me_code) {
remove_waiting_box();
var pos = fixed_position(250, 150) + ";width:30%";
add_div({id: "divplugin", drag: 1, cssclass: "inner_box", style: pos});
- $('divplugin').innerHTML = req.responseText;
+ id$('divplugin').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
@@ -1745,7 +1766,7 @@ function create_menu(p_dossier) {
cssclass: "inner_box",
style: pos
});
- $('divmenu').innerHTML = req.responseText;
+ id$('divmenu').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
}
@@ -1774,7 +1795,7 @@ function modify_menu(p_dossier, me_code) {
cssclass: "inner_box",
style: pos
});
- $('divmenu').innerHTML = req.responseText;
+ id$('divmenu').innerHTML = req.responseText;
} catch (e) {
alert_box(e.message);
@@ -1799,7 +1820,7 @@ function get_properties(obj) {
*/
function rapport_add_row(p_dossier) {
style = 'style="border: 1px solid blue;"';
- var table = $("rap1");
+ var table = id$("rap1");
var line = table.rows.length;
var row = table.insertRow(line);
@@ -1818,7 +1839,7 @@ function rapport_add_row(p_dossier) {
cellbutton.innerHTML = but_html;
but_html.evalScripts();
- g('form' + line).value = '';
+ id$('form' + line).value = '';
}
/**
@@ -1827,7 +1848,7 @@ function rapport_add_row(p_dossier) {
function search_action(dossier, ctl_concern) {
try {
waiting_box();
- var dossier = g('gDossier').value;
+ var dossier = id$('gDossier').value;
var target = "search_action_div";
removeDiv(target);
@@ -1854,7 +1875,7 @@ function search_action(dossier, ctl_concern) {
try {
remove_waiting_box();
add_div(div);
- $('search_action_div').innerHTML = req.responseText;
+ id$('search_action_div').innerHTML = req.responseText;
req.responseText.evalScripts();
} catch (e) {
alert_box(e.message);
@@ -1869,7 +1890,7 @@ function search_action(dossier, ctl_concern) {
function result_search_action(obj) {
try {
- var queryString = $(obj).serialize() + "&op=search_action";
+ var queryString = id$(obj).serialize() + "&op=search_action";
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -1879,7 +1900,7 @@ function result_search_action(obj) {
onSuccess: function (req) {
try {
remove_waiting_box();
- $('search_action_div').innerHTML = req.responseText;
+ id$('search_action_div').innerHTML = req.responseText;
req.responseText.evalScripts();
} catch (e) {
alert_box(e.message);
@@ -1898,7 +1919,7 @@ function result_search_action(obj) {
function set_action_related(p_obj) {
try {
- var obj = $(p_obj);
+ var obj = id$(p_obj);
var ctlc = obj.elements['ctlc'];
for (var e = 0; e < obj.elements.length; e++) {
@@ -1908,10 +1929,10 @@ function set_action_related(p_obj) {
if (elmt.checked === true) {
var str_name = elmt.name;
var nValue = elmt.value;
- if ($(ctlc.value).value != '') {
- $(ctlc.value).value += ',';
+ if (id$(ctlc.value).value != '') {
+ id$(ctlc.value).value += ',';
}
- $(ctlc.value).value += nValue;
+ id$(ctlc.value).value += nValue;
}
}
}
@@ -1944,7 +1965,7 @@ function stock_repo_change(p_dossier, r_id) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'change_stock_repo_div', style: str_style, cssclass: 'inner_box', drag: "1"});
- $('change_stock_repo_div').innerHTML = req.responseText;
+ id$('change_stock_repo_div').innerHTML = req.responseText;
}
}
@@ -1967,7 +1988,7 @@ function stock_inv_detail(p_dossier, p_id) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'view_mod_stock_div', style: str_style, cssclass: 'inner_box', drag: "1"});
- $('view_mod_stock_div').innerHTML = req.responseText;
+ id$('view_mod_stock_div').innerHTML = req.responseText;
req.responseText.evalScripts();
}
}
@@ -1976,23 +1997,23 @@ function stock_inv_detail(p_dossier, p_id) {
function show_fin_chdate(obj_id) {
try {
- var ch = $(obj_id).options[$(obj_id).selectedIndex].value;
+ var ch = id$(obj_id).options[id$(obj_id).selectedIndex].value;
if (ch == 2) {
- $('chdate_ext').hide();
- $('thdate').show();
+ id$('chdate_ext').hide();
+ id$('thdate').show();
}
if (ch == 1) {
- $('chdate_ext').show();
- $('thdate').hide();
+ id$('chdate_ext').show();
+ id$('thdate').hide();
}
- var nb = $('nb_item').value;
+ var nb = id$('nb_item').value;
for (i = 0; i < nb; i++) {
- if ($('tdchdate' + i)) {
+ if (document.getElementById('tdchdate' + i)) {
if (ch == 2) {
- $('tdchdate' + i).show();
+ id$('tdchdate' + i).show();
}
if (ch == 1) {
- $('tdchdate' + i).hide();
+ id$('tdchdate' + i).hide();
}
}
@@ -2009,18 +2030,18 @@ function profile_show(p_div) {
try {
var div = ['profile_gen_div', 'profile_menu_div', 'profile_print_div', 'profile_gestion_div', 'profile_repo_div', 'profile_menu_mobile_div'];
for (var r = 0; r < div.length; r++) {
- $(div[r]).hide();
+ id$(div[r]).hide();
}
- $(p_div).show();
+ id$(p_div).show();
} catch (e) {
alert_box(e.message);
}
}
function detail_category_show(p_div, p_dossier, p_id) {
- $(p_div).show();
+ id$(p_div).show();
waiting_box();
- $('detail_category_div').innerHTML = "";
+ id$('detail_category_div').innerHTML = "";
var queryString = "gDossier=" + p_dossier + "&id=" + p_id + "&op=fddetail";
var action = new Ajax.Request(
"ajax_misc.php",
@@ -2029,9 +2050,9 @@ function detail_category_show(p_div, p_dossier, p_id) {
onFailure: ajax_misc_failure,
onSuccess: function (req) {
remove_waiting_box();
- $('list_cat_div').hide();
- $('detail_category_div').innerHTML = req.responseText;
- $('detail_category_div').show();
+ id$('list_cat_div').hide();
+ id$('detail_category_div').innerHTML = req.responseText;
+ id$('detail_category_div').show();
req.responseText.evalScripts();
}
}
@@ -2043,7 +2064,7 @@ function detail_category_show(p_div, p_dossier, p_id) {
*/
function check_new_category()
{
- if ( $('nom_mod_id').value.trim()=="") {
+ if ( id$('nom_mod_id').value.trim()=="") {
new Effect.Highlight('nom_mod_id',{startcolor:"#ff0000"});
smoke.alert('Nom catégorie obligatoire');
return false;
@@ -2085,7 +2106,7 @@ function check_date(p_str_date) {
* @see check_date
*/
function check_date_id(p_id_date) {
- var str_date = $(p_id_date).value;
+ var str_date = id$(p_id_date).value;
return check_date(str_date);
}
@@ -2133,7 +2154,7 @@ function view_action(ag_id, dossier, modify) {
cssclass: "inner_box",
style: pos
});
- $(id).innerHTML = code_html;
+ id$(id).innerHTML = code_html;
if (ctl_txt == 'ok') {
// compute detail
var detail = in_child(id, "follow_up_detail");
@@ -2162,9 +2183,9 @@ function view_action(ag_id, dossier, modify) {
* @see HtmlInput::filter_table
*/
function filter_table(phrase, _id, colnr, start_row) {
- $('info_div').innerHTML = content[65];
- $('info_div').style.display = "block";
- var words = $(phrase).value.toLowerCase();
+ id$('info_div').innerHTML = content[65];
+ id$('info_div').style.display = "block";
+ var words = id$(phrase).value.toLowerCase();
var table = document.getElementById(_id);
// if colnr contains a comma then check several columns
@@ -2196,20 +2217,20 @@ function filter_table(phrase, _id, colnr, start_row) {
} else {
table.rows[r].style.display = 'none';
}
- $('info_div').style.display = "none";
- $('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
}
if (tot_found == 0) {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = content[69];
+ if (document.getElementById('info_' + _id)) {
+ id$('info_' + _id).innerHTML = content[69];
}
} else {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = " ";
+ if (document.getElementById('info_' + _id)) {
+ id$('info_' + _id).innerHTML = " ";
}
}
- $('info_div').style.display = "none";
- $('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
}
/**
@@ -2220,9 +2241,9 @@ function filter_table(phrase, _id, colnr, start_row) {
* @see HtmlInput::filter_list
*/
function filter_list(phrase, _id) {
- $('info_div').innerHTML = content[65];
- $('info_div').style.display = "block";
- var words = $(phrase).value.toLowerCase();
+ id$('info_div').innerHTML = content[65];
+ id$('info_div').style.display = "block";
+ var words = id$(phrase).value.toLowerCase();
var l_list = document.getElementById(_id);
@@ -2252,16 +2273,16 @@ function filter_list(phrase, _id) {
}
if (tot_found == 0) {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = content[69];
+ if (document.getElementById('info_' + _id)) {
+ id$('info_' + _id).innerHTML = content[69];
}
} else {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = " ";
+ if (document.getElementById('info_' + _id)) {
+ id$('info_' + _id).innerHTML = " ";
}
}
- $('info_div').style.display = "none";
- $('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
}
/**
@@ -2272,9 +2293,9 @@ function filter_list(phrase, _id) {
* @see HtmlInput::filter_list
*/
function filter_multiselect(phrase, _id) {
- $('info_div').innerHTML = content[65];
- $('info_div').style.display = "block";
- var words = $(phrase).value.toLowerCase();
+ id$('info_div').innerHTML = content[65];
+ id$('info_div').style.display = "block";
+ var words = id$(phrase).value.toLowerCase();
var l_list = document.getElementById(_id);
var tot_found = 0;
@@ -2289,16 +2310,16 @@ function filter_multiselect(phrase, _id) {
} else {
l_list.options[r].style.display = 'none';
}
- $('info_div').style.display = "none";
- $('info_div').innerHTML = "";
+ id$('info_div').style.display = "none";
+ id$('info_div').innerHTML = "";
}
if (tot_found == 0) {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = content[69];
+ if (document.getElementById('info_' + _id)) {
+ id$('info_' + _id).innerHTML = content[69];
}
} else {
- if ($('info_' + _id)) {
- $('info_' + _id).innerHTML = " ";
+ if (document.getElementById('info_' + _id)) {
+ id$('info_' + _id).innerHTML = " ";
}
}
}
@@ -2309,10 +2330,10 @@ function filter_multiselect(phrase, _id) {
*/
function display_task(p_id) {
- $(p_id).style.top = posY + 'px';
- $(p_id).style.left = "10%";
- $(p_id).style.width = "80%";
- $(p_id).style.display = 'block';
+ id$(p_id).style.top = posY + 'px';
+ id$(p_id).style.left = "10%";
+ id$(p_id).style.width = "80%";
+ id$(p_id).style.display = 'block';
}
@@ -2321,15 +2342,15 @@ function display_task(p_id) {
* Set a message in the info
*/
function info_message(p_message) {
- $('info_div').innerHTML = p_message;
- $('info_div').style.display = "block";
+ id$('info_div').innerHTML = p_message;
+ id$('info_div').style.display = "block";
}
/**
* hide the info box
*/
function info_hide() {
- $('info_div').style.display = "none";
+ id$('info_div').style.display = "none";
}
/**
@@ -2349,10 +2370,10 @@ function ask_navigator(p_dossier) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'navi_div', style: 'top:2em;', cssclass: 'inner_box'});
- $('navi_div').innerHTML = req.responseText;
+ id$('navi_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
- sorttable.makeSortable($("navi_tb"));
+ sorttable.makeSortable(id$("navi_tb"));
} catch (e) {
alert_box("answer_box Impossible executer script de la reponse\n" + e.message);
}
@@ -2387,7 +2408,7 @@ function set_preference(p_dossier) {
return;
}
add_div({id: 'preference_div', drag: 1});
- $('preference_div').innerHTML = req.responseText;
+ id$('preference_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
} catch (e) {
@@ -2422,7 +2443,7 @@ function show_bookmark(p_dossier) {
onSuccess: function (req) {
remove_waiting_box();
add_div({id: 'bookmark_div', cssclass: 'inner_box', drag: 1});
- $('bookmark_div').innerHTML = req.responseText;
+ id$('bookmark_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
} catch (e) {
@@ -2444,7 +2465,7 @@ function show_bookmark(p_dossier) {
function save_bookmark() {
try {
waiting_box();
- var queryString = "op=bookmark&" + $("bookmark_frm").serialize();
+ var queryString = "op=bookmark&" + id$("bookmark_frm").serialize();
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -2454,7 +2475,7 @@ function save_bookmark() {
remove_waiting_box();
// removeDiv('bookmark_div');
//
- $('bookmark_div').innerHTML = req.responseText;
+ id$('bookmark_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
} catch (e) {
@@ -2476,7 +2497,7 @@ function save_bookmark() {
function remove_bookmark() {
try {
waiting_box();
- var queryString = "op=bookmark&" + $("bookmark_del_frm").serialize();
+ var queryString = "op=bookmark&" + id$("bookmark_del_frm").serialize();
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -2484,7 +2505,7 @@ function remove_bookmark() {
onFailure: ajax_misc_failure,
onSuccess: function (req) {
remove_waiting_box();
- $('bookmark_div').innerHTML = req.responseText;
+ id$('bookmark_div').innerHTML = req.responseText;
try {
req.responseText.evalScripts();
} catch (e) {
@@ -2506,8 +2527,8 @@ function remove_bookmark() {
*@note there is no protection
*/
function error_message(message) {
- $('error_content_div').innerHTML = message;
- $('error_div').style.visibility = 'visible';
+ id$('error_content_div').innerHTML = message;
+ id$('error_div').style.visibility = 'visible';
}
/**
@@ -2534,7 +2555,7 @@ function show_tag(p_dossier, p_ac, p_tag_id, p_post) {
remove_waiting_box();
var posy = calcy(250);
add_div({id: 'tag_div', cssclass: 'inner_box', drag: 0, style: "position:fixed;top:15%;"});
- $('tag_div').innerHTML = code_html;
+ id$('tag_div').innerHTML = code_html;
try {
code_html.evalScripts();
} catch (e) {
@@ -2555,7 +2576,7 @@ function show_tag(p_dossier, p_ac, p_tag_id, p_post) {
function save_tag() {
try {
waiting_box();
- var queryString = "op=tag_save&" + $("tag_detail_frm").serialize();
+ var queryString = "op=tag_save&" + id$("tag_detail_frm").serialize();
var action = new Ajax.Request(
"ajax_misc.php",
{
@@ -2604,7 +2625,7 @@ function action_tag_select(p_dossier, ag_id) {
add_div({id: 'tag_div', style: pos, cssclass: 'inner_box tag', drag: 0});
remove_waiting_box();
- $('tag_div').innerHTML = code_html;
+ id$('tag_div').innerHTML = code_html;
}
}
);
@@ -2639,7 +2660,7 @@ function action_tag_add(p_dossier, ag_id, t_id, p_isgroup) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
remove_waiting_box();
- $('action_tag_td').innerHTML = code_html;
+ id$('action_tag_td').innerHTML = code_html;
removeDiv('tag_div');
}
}
@@ -2675,7 +2696,7 @@ function action_tag_remove(p_dossier, ag_id, t_id) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
remove_waiting_box();
- $('action_tag_td').innerHTML = code_html;
+ id$('action_tag_td').innerHTML = code_html;
}
}
@@ -2701,8 +2722,8 @@ function activate_tag(p_dossier, p_tag_id) {
remove_waiting_box();
var answer = req.responseText.evalJSON();
var tagId = "tag_onoff" + p_tag_id;
- $(tagId).update(answer.code);
- $(tagId).setStyle(answer.style);
+ id$(tagId).update(answer.code);
+ id$(tagId).setStyle(answer.style);
remove_waiting_box();
}
})
@@ -2737,10 +2758,10 @@ function search_display_tag(p_dossier, p_prefix, p_object) {
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});
- $(p_prefix + 'tag_div').style.top = calcy(200) + "px"
- $(p_prefix + 'tag_div').style.left = 20 + "%";
+ id$(p_prefix + 'tag_div').style.top = calcy(200) + "px"
+ id$(p_prefix + 'tag_div').style.left = 20 + "%";
remove_waiting_box();
- $(p_prefix + 'tag_div').innerHTML = code_html;
+ id$(p_prefix + 'tag_div').innerHTML = code_html;
code_html.evalScripts();
}
}
@@ -2762,7 +2783,7 @@ function search_add_tag(p_dossier, p_tag_id, p_prefix, p_obj) {
try {
var clear_button = 0;
if (tag_choose === '' && p_prefix === 'search') {
- tag_choose = $(p_prefix + 'tag_choose_td').innerHTML;
+ tag_choose = id$(p_prefix + 'tag_choose_td').innerHTML;
clear_button = 1;
}
waiting_box();
@@ -2782,7 +2803,7 @@ function search_add_tag(p_dossier, p_tag_id, p_prefix, p_obj) {
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
remove_waiting_box();
- $(p_prefix + 'tag_choose_td').innerHTML = $(p_prefix + 'tag_choose_td').innerHTML + code_html;
+ id$(p_prefix + 'tag_choose_td').innerHTML = id$(p_prefix + 'tag_choose_td').innerHTML + code_html;
removeDiv(p_prefix + 'tag_div');
}
}
@@ -2798,7 +2819,7 @@ function search_add_tag(p_dossier, p_tag_id, p_prefix, p_obj) {
*/
function search_clear_tag(p_dossier, p_prefix) {
if (p_prefix != 'search') {
- $(p_prefix + 'tag_choose_td').innerHTML = "";
+ id$(p_prefix + 'tag_choose_td').innerHTML = "";
return;
}
try {
@@ -2817,7 +2838,7 @@ function search_clear_tag(p_dossier, p_prefix) {
}
var code_html = getNodeText(html[0]);
code_html = unescape_xml(code_html);
- $(p_prefix + 'tag_choose_td').innerHTML = code_html;
+ id$(p_prefix + 'tag_choose_td').innerHTML = code_html;
tag_choose = "";
}
}
@@ -2856,8 +2877,8 @@ function calendar_zoom(obj) {
var per_periode = null;
var notitle = 0;
var from = 0;
- if ($(obj.invalue)) {
- per_periode = $(obj.invalue).value;
+ if (id$(obj.invalue)) {
+ per_periode = id$(obj.invalue).value;
}
if (obj.notitle && obj.notitle == 1) {
notitle = 1;
@@ -2895,7 +2916,7 @@ function calendar_zoom(obj) {
if (obj.outdiv === undefined) {
obj.outdiv = 'calendar_zoom_div';
}
- if ($(obj.outdiv) == undefined) {
+ if (id$(obj.outdiv) == undefined) {
var str_style = 'top:10%;min-height:60rem';
// var str_style = fixed_position(0, 120);
add_div({
@@ -2906,8 +2927,8 @@ function calendar_zoom(obj) {
});
}
remove_waiting_box();
- $(obj.outdiv).innerHTML = code_html;
- $(obj.outdiv).show();
+ id$(obj.outdiv).innerHTML = code_html;
+ id$(obj.outdiv).show();
}
}
);
@@ -2924,12 +2945,12 @@ function calendar_zoom(obj) {
function stock_add_row() {
try {
style = 'class="input_text"';
- var mytable = g("stock_tb").tBodies[0];
+ var mytable = id$("stock_tb").tBodies[0];
var ofirstRow = mytable.rows[1];
var line = mytable.rows.length;
var nCell = mytable.rows[1].cells.length;
var row = mytable.insertRow(line);
- var nb = g("row");
+ var nb = id$("row");
for (var e = 0; e < nCell; e++) {
var newCell = row.insertCell(e);
if (mytable.rows[1].cells[e].hasClassName('num')) {
@@ -2944,10 +2965,10 @@ function stock_add_row() {
new_tt.evalScripts();
}
- g("sg_code" + nb.value).innerHTML = ' ';
- g("sg_code" + nb.value).value = '';
- g("label" + nb.value).innerHTML = '';
- g("sg_quantity" + nb.value).value = '0';
+ id$("sg_code" + nb.value).innerHTML = ' ';
+ id$("sg_code" + nb.value).value = '';
+ id$("label" + nb.value).innerHTML = '';
+ id$("sg_quantity" + nb.value).value = '0';
nb.value++;
@@ -2959,8 +2980,8 @@ function stock_add_row() {
}
function show_description(p_id) {
- $('print_desc' + p_id).hide();
- $('input_desc' + p_id).show();
+ id$('print_desc' + p_id).hide();
+ id$('input_desc' + p_id).show();
}
@@ -2996,9 +3017,9 @@ function show_tabs(a_tabs, p_display_tab) {
}
var i = 0;
for (i = 0; i < a_tabs.length; i++) {
- $(a_tabs[i]).hide();
+ id$(a_tabs[i]).hide();
}
- $(p_display_tab).show();
+ id$(p_display_tab).show();
} catch (e) {
alert_box(e.message);
}
@@ -3050,8 +3071,8 @@ function create_anchor_up() {
newElt.setAttribute('id', 'up_top');
newElt.innerHTML = '';
- var parent = $('info_div').parentNode;
- parent.insertBefore(newElt, $('info_div'));
+ var parent = id$('info_div').parentNode;
+ parent.insertBefore(newElt, id$('info_div'));
}
@@ -3074,13 +3095,13 @@ function init_scroll() {
}
;
if (document.viewport.getScrollOffsets().top > 0) {
- if ($('go_up').visible() == false) {
- $('go_up').setOpacity(0.65);
- $('go_up').show();
- $('go_up').style.zIndex = 99;
+ if (id$('go_up').visible() == false) {
+ id$('go_up').setOpacity(0.65);
+ id$('go_up').show();
+ id$('go_up').style.zIndex = 99;
}
} else {
- $('go_up').hide();
+ id$('go_up').hide();
}
}
@@ -3142,7 +3163,7 @@ function confirm_box(p_obj, p_message, p_callback_true, p_waiting) {
if (p_waiting) {
waiting_box();
}
- $(name).submit();
+ id$(name).submit();
}
});
} else {
@@ -3165,7 +3186,7 @@ function confirm_box(p_obj, p_message, p_callback_true, p_waiting) {
* @returns void
*/
function alert_box(p_message) {
- smoke.alert(p_message, undefined, {ok: 'ok', classname: "inner_box"});
+ smoke.alert(p_message, undefined, {ok: 'ok', classname: "inner_box",title:'ATTENTION'});
}
@@ -3174,7 +3195,7 @@ function alert_box(p_message) {
* @param string p_table id of the table
*/
function alternate_row_color(p_table) {
- var table_colored = $(p_table);
+ var table_colored = id$(p_table);
if (!table_colored.tBodies[0]) return;
var len = table_colored.tBodies[0].rows.length;
@@ -3197,7 +3218,7 @@ function alternate_row_color(p_table) {
* @param p_list {string} DOM id of the list
*/
function alternate_row_color_list(p_list) {
- var list_colored = $(p_list);
+ var list_colored = id$(p_list);
if ( list_colored.children.length==0 ) return;
var len = list_colored.children.length;
@@ -3225,7 +3246,7 @@ function pin(object_id) {
if (aDraggableElement[object_id]) {
aDraggableElement[object_id].destroy();
aDraggableElement[object_id] = undefined;
- $('pin_' + object_id).innerHTML = "";
+ id$('pin_' + object_id).innerHTML = "";
} else {
aDraggableElement[object_id] = new Draggable(object_id, {
starteffect: function () {
@@ -3233,7 +3254,7 @@ function pin(object_id) {
}
}
);
- $('pin_' + object_id).innerHTML = "";
+ id$('pin_' + object_id).innerHTML = "";
}
}
@@ -3245,10 +3266,10 @@ function pin(object_id) {
* @param p_attribute_value the value of the attribute we want to show
*/
function show_only_row(p_table_id, p_attribute_name, p_attribute_value) {
- if (!$(p_table_id)) {
+ if (!id$(p_table_id)) {
throw "Invalide table id"
}
- var mTable = $(p_table_id);
+ var mTable = id$(p_table_id);
var ncount = mTable.rows.length
for (var i = 0; i < ncount; i++) {
var mRow = mTable.rows[i];
@@ -3265,10 +3286,10 @@ function show_only_row(p_table_id, p_attribute_name, p_attribute_value) {
* @param p_table_id table id
*/
function show_all_row(p_table_id) {
- if (!$(p_table_id)) {
+ if (!id$(p_table_id)) {
throw "Invalide table id"
}
- var mTable = $(p_table_id);
+ var mTable = id$(p_table_id);
var ncount = mTable.rows.length
for (var i = 0; i < ncount; i++) {
var mRow = mTable.rows[i];
@@ -3349,7 +3370,7 @@ var Periode = function (p_ledger) {
var answer = req.responseText.evalJSON();
remove_waiting_box();
if (answer.status == "OK") {
- $("row_per_" + p_periode_id).remove();
+ id$("row_per_" + p_periode_id).remove();
alternate_row_color("periode_tbl");
} else {
smoke.alert(answer.content);
@@ -3398,7 +3419,7 @@ var Periode = function (p_ledger) {
"cssclass": "inner_box",
'html': "wait"
});
- $('mod_periode').update(json.content);
+ id$('mod_periode').update(json.content);
}
});
};
@@ -3452,7 +3473,7 @@ var Periode = function (p_ledger) {
remove_waiting_box();
var json = req.responseText.evalJSON();
if (json.status == 'OK') {
- $('row_per_' + p_periode_id).update(json.content);
+ id$('row_per_' + p_periode_id).update(json.content);
new Effect.Highlight('row_per_' + p_periode_id, {startcolor: '#FAD4D4', endcolor: '#F78082'});
} else {
smoke.alert(json.content);
@@ -3492,7 +3513,7 @@ var Periode = function (p_ledger) {
remove_waiting_box();
var json = req.responseText.evalJSON();
if (json.status == 'OK') {
- $('row_per_' + p_periode_id).update(json.content);
+ id$('row_per_' + p_periode_id).update(json.content);
new Effect.Highlight('row_per_' + p_periode_id, {
startcolor: '#FAD4D4',
endcolor: '#F78082'
@@ -3511,7 +3532,7 @@ var Periode = function (p_ledger) {
* @returns {Boolean}
*/
this.save = function (p_frm) {
- var js_param = $(p_frm).serialize(true);
+ var js_param = id$(p_frm).serialize(true);
waiting_box();
js_param["js_var"] = this.js_obj_name;
js_param["act"] = "save";
@@ -3525,7 +3546,7 @@ var Periode = function (p_ledger) {
var answer = req.responseText.evalJSON();
remove_waiting_box();
if (answer.status == "OK") {
- $('row_per_' + js_param['periode_id']).update(answer.content);
+ id$('row_per_' + js_param['periode_id']).update(answer.content);
removeDiv('mod_periode');
new Effect.Highlight('row_per_' + js_param['periode_id'], {
startcolor: '#FAD4D4',
@@ -3555,7 +3576,7 @@ var Periode = function (p_ledger) {
}
}
if (count == 0) {
- smoke.signal("Sélectionner au moins une période", function () {
+ smoke.signal("Sélectionner au moins une période", function () {
}, {duration: 1500});
return;
}
@@ -3582,7 +3603,7 @@ var Periode = function (p_ledger) {
*/
this.insert_periode = function () {
var p_frm = 'insert_periode_frm';
- var js_param = $(p_frm).serialize(true);
+ var js_param = id$(p_frm).serialize(true);
waiting_box();
js_param["js_var"] = this.js_obj_name;
js_param["act"] = "insert_periode";
@@ -3598,11 +3619,11 @@ var Periode = function (p_ledger) {
remove_waiting_box();
if (answer.status == "OK") {
var new_row = document.createElement("tr");
- $('periode_tbl').append(new_row);
+ id$('periode_tbl').append(new_row);
new_row.replace(answer.content);
// hide the form
- $('periode_add').hide();
+ id$('periode_add').hide();
new Effect.Highlight('row_per_' + answer.p_id, {startcolor: '#FAD4D4', endcolor: '#F78082'});
alternate_row_color('periode_tbl');
} else {
@@ -3619,8 +3640,8 @@ var Periode = function (p_ledger) {
* @param p_table_id DOM ID of the table
*/
Periode.filter_exercice = function (p_table_id) {
- var rows = $(p_table_id).rows;
- var selected_value = $('p_exercice_sel').value;
+ var rows = id$(p_table_id).rows;
+ var selected_value = id$('p_exercice_sel').value;
for (var i = 1; i < rows.length; i++) {
var exercice = rows[i].getAttribute("per_exercice");
if (selected_value == -1) {
@@ -3661,7 +3682,7 @@ function progress_bar_start(p_taskid, p_message) {
cssclass: "inner_box",
style: "z-index:1000;position:fixed;top:30%;width:40%;left:30%"
});
- $("message" + progressIdx).update('
| '; + echo ''; + echo "Tous les tests du module $title "; + echo ''; + echo ' | '; + echo ''; + echo ''; + echo 'Tous les scripts'; + echo ''; + echo ' | '; + echo '|
| '; + echo $e; + echo ' | '; + echo ''; + echo ''; + echo basename($aHtml_files[$e]['file']); + echo ''; + echo ' | '; + echo ''.$aHtml_files[$e]['desc'].' | '; + echo '
| '; - echo ''; - echo "Tous "; - echo ''; - echo ' | '; - echo 'Tous les scripts | '; - echo '|
| '; - echo $e; - echo ' | '; - echo ''; - echo ''; - echo $scenario[$e]['file']; - echo ''; - echo ' | '; - echo ''.$scenario[$e]['desc'].' | '; - echo '
start mem : ".$start_mem; - echo '
'; - echo "end mem : ".$end_mem; - echo '
'; - echo "Diff = ".($end_mem-$start_mem)." bytes "; - echo "
Diff = ".(round(($end_mem-$start_mem)/1024, 2))." kbytes "; - echo "
Diff = ".(round(($end_mem-$start_mem)/1024/1024, 2))." Mbytes "; - echo '
'; - echo "Execution script ".$script." time = ".(round(($end_time-$start_time), 4))." secondes
"; - $nb++; - if ( $nb == $maxscan ) { - echo "Dernier test"; - } else { - $get='test.php?'.http_build_query(array('script'=>"all", 'gDossier'=>$gDossierLogInput, 'nb_script'=>$nb)); - echo ''; - echo $scenario[$nb]['file']; + } + + $maxscan=$http->get('nb_script', "number",count($scenario)-1); + $maxscan++; + for ($i=$nb;$i< $maxscan;$i++) { + echo 'start mem : ".$start_mem; + echo '
'; + echo "end mem : ".$end_mem; + echo '
'; + echo "Diff = ".($end_mem-$start_mem)." bytes "; + echo "
Diff = ".(round(($end_mem-$start_mem)/1024, 2))." kbytes "; + echo "
Diff = ".(round(($end_mem-$start_mem)/1024/1024, 2))." Mbytes "; + echo '
'; + echo "Execution script ".$script." time = ".(round(($end_time-$start_time), 4))." secondes
"; + $nb++; + if ( $nb == $maxscan ) { + echo "Dernier test"; + } else { + $get='test.php?'.http_build_query(array('script'=>"all", 'gDossier'=>$gDossierLogInput, 'nb_script'=>$nb)); + echo ''; + echo $scenario[$nb]['file']; + echo ''; + } } } else { $start_mem=memory_get_usage(); $start_time=microtime(true); - $script=noalyss_str_replace('../', '', $script); $description=$http->get("description","string", "aucune description"); echo 'description = '.$description.'
'; - include '../scenario/'.$script; + include $script; $end_mem=memory_get_usage(); $end_time=microtime(true); @@ -225,4 +276,4 @@ else echo "
Diff = ".(round(($end_mem-$start_mem)/1024/1024, 2))." Mbytes "; echo '
'; echo "Execution script ".$script." time = ".(round(($end_time-$start_time), 4))." secondes
"; -} \ No newline at end of file +} diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php index 7e0dcf1f7..466ab6aae 100644 --- a/include/ajax/ajax_card.php +++ b/include/ajax/ajax_card.php @@ -326,7 +326,8 @@ case 'st': $r.=''.h($array[$i]['fd_label']).''; $r.=''; $r.='| "; + $hid->input("type","poste").$hid->input('ac',$http->request('ac')).""; } $id=uniqid("pdf_"); @@ -668,21 +669,21 @@ class Acc_Account_Ledger HtmlInput::hidden('act',$action_pdf). $hid->input("type","poste").$str_ople. $hid->input('p_action','impress'). - $hid->input("from_periode",$_REQUEST['from_periode']). - $hid->input("to_periode",$_REQUEST['to_periode']) + $hid->input("from_periode",$http->request('from_periode')). + $hid->input("to_periode",$http->request('to_periode')) ; if ( isset($_REQUEST['letter'] )) echo HtmlInput::hidden('letter','2'); if ( isset($_REQUEST['solded'] )) echo HtmlInput::hidden('solded','1'); if (isset($_REQUEST['from_poste'])) - echo HtmlInput::hidden('from_poste',$_REQUEST['from_poste']); + echo HtmlInput::hidden('from_poste',$http->request('from_poste')); if (isset($_REQUEST['to_poste'])) - echo HtmlInput::hidden('to_poste',$_REQUEST['to_poste']); + echo HtmlInput::hidden('to_poste',$http->request('to_poste')); if (isset($_REQUEST['poste_id'])) - echo HtmlInput::hidden("poste_id",$_REQUEST['poste_id']); + echo HtmlInput::hidden("poste_id",$http->request('poste_id')); if (isset($_REQUEST['poste_fille'])) echo $hid->input('poste_fille','on'); @@ -697,17 +698,17 @@ class Acc_Account_Ledger HtmlInput::hidden('act',$action_csv). $hid->input("type","poste").$str_ople. $hid->input('p_action','impress'). - $hid->input("from_periode",$_REQUEST['from_periode']). - $hid->input("to_periode",$_REQUEST['to_periode']); + $hid->input("from_periode",$http->request('from_periode')). + $hid->input("to_periode",$http->request('to_periode')); if (isset($_REQUEST['from_poste'])) - echo HtmlInput::hidden('from_poste',$_REQUEST['from_poste']); + echo HtmlInput::hidden('from_poste',$http->request('from_poste')); if (isset($_REQUEST['to_poste'])) - echo HtmlInput::hidden('to_poste',$_REQUEST['to_poste']); + echo HtmlInput::hidden('to_poste',$http->request('to_poste')); if (isset($_REQUEST['poste_id'])) - echo HtmlInput::hidden("poste_id",$_REQUEST['poste_id']); + echo HtmlInput::hidden("poste_id",$http->request('poste_id')); if ( isset($_REQUEST['letter'] )) echo HtmlInput::hidden('letter','2'); if ( isset($_REQUEST['solded'] )) echo HtmlInput::hidden('solded','1'); @@ -716,7 +717,7 @@ class Acc_Account_Ledger echo $hid->input('poste_fille','on'); if (isset($_REQUEST['oper_detail'])) echo $hid->input('oper_detail','on'); - if (isset($_REQUEST['poste_id'])) echo $hid->input("poste_id",$_REQUEST['poste_id']); + if (isset($_REQUEST['poste_id'])) echo $hid->input("poste_id",$http->request('poste_id')); echo ""; echo ' | ';
diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php
index 51fc616f2..ca9223c9f 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -22,12 +22,13 @@ require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
require_once NOALYSS_INCLUDE.'/database/jrn_def_sql.class.php';
require_once NOALYSS_INCLUDE.'/database/operation_currency_sql.class.php';
-/** \file
+/**
+ * \file
* @brief Class for jrn, class acc_ledger for manipulating the ledger
*/
/**
- * @class
+ * @class Acc_Ledger
* @brief Class for jrn, class acc_ledger for manipulating the ledger AND some acc. operations
*
*/
@@ -45,6 +46,7 @@ class Acc_Ledger extends jrn_def_sql
/**
+ * @brief construct
* @param $p_cn database connexion
* @param $p_id jrn.jrn_def_id
*/
@@ -896,7 +898,7 @@ class Acc_Ledger extends jrn_def_sql
$add_js="";
if ($g_parameter->MY_PJ_SUGGEST !='N')
{
- $add_js="update_pj();";
+ $add_js="update_receipt();";
}
if ($g_parameter->MY_DATE_SUGGEST=='Y')
{
diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php
index 394284953..153000c69 100644
--- a/include/class/acc_ledger_fin.class.php
+++ b/include/class/acc_ledger_fin.class.php
@@ -311,7 +311,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
if ($g_parameter->MY_DATE_SUGGEST=='Y')
$onchange.='get_last_date();';
if ($g_parameter->MY_PJ_SUGGEST=='Y')
- $onchange.='update_pj();';
+ $onchange.='update_receipt();';
$add_js='onchange="'.$onchange.'"';
$wLedger=$this->select_ledger('FIN', 2, FALSE);
diff --git a/include/class/acc_ledger_history.class.php b/include/class/acc_ledger_history.class.php
index 38b2b8847..d244cb9f0 100644
--- a/include/class/acc_ledger_history.class.php
+++ b/include/class/acc_ledger_history.class.php
@@ -38,7 +38,7 @@ abstract class Acc_Ledger_History
public $db; //!< database connx
protected $ledger_type; //! type of ledger VEN , ACH , ODS, FIN
protected $filter_operation; //!< to filter paid, unpaid or all operation
-
+ protected $data; // Contains data see acc_ledger_history_financial->get_row
/**
*
* @param Database $cn
diff --git a/include/class/acc_ledger_history_generic.class.php b/include/class/acc_ledger_history_generic.class.php
index 6bbabe3b1..53f5bcf2d 100644
--- a/include/class/acc_ledger_history_generic.class.php
+++ b/include/class/acc_ledger_history_generic.class.php
@@ -33,7 +33,7 @@
class Acc_Ledger_History_Generic extends Acc_Ledger_History
{
- private $data; //!< array of rows
+
/**
* Constructor
diff --git a/include/class/acc_ledger_history_purchase.class.php b/include/class/acc_ledger_history_purchase.class.php
index 0dca3160f..3e03c08c0 100644
--- a/include/class/acc_ledger_history_purchase.class.php
+++ b/include/class/acc_ledger_history_purchase.class.php
@@ -32,8 +32,6 @@
class Acc_Ledger_History_Purchase extends Acc_Ledger_History
{
- private $data;//!< Contains rows from SQL
-
/**
* @param mixed $data
*/
diff --git a/include/class/acc_ledger_history_sale.class.php b/include/class/acc_ledger_history_sale.class.php
index 0240db9b1..0b3b80208 100644
--- a/include/class/acc_ledger_history_sale.class.php
+++ b/include/class/acc_ledger_history_sale.class.php
@@ -31,8 +31,7 @@
class Acc_Ledger_History_Sale extends Acc_Ledger_History
{
- private $data; //!< Contains rows from SQL
-
+
public function __construct(\Database $cn, $pa_ledger, $p_from, $p_to,
$p_mode)
diff --git a/include/class/acc_ledger_purchase.class.php b/include/class/acc_ledger_purchase.class.php
index ad114e14f..6c1c6031c 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -19,27 +19,32 @@
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-/*!\file
+/*!
+ * \file
* \brief class for the purchase, herits from acc_ledger
*/
require_once NOALYSS_INCLUDE.'/lib/user_common.php';
require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
-/*!\brief Handle the ledger of purchase,
+/*!
+ * \class Acc_Ledger_Purchase
+ * \brief Handle the ledger of purchase,
*
*
*/
class Acc_Ledger_Purchase extends Acc_Ledger
{
private $payment_operation; /*ledger_type='ACH';
parent::__construct($p_cn,$p_init);
$this->payment_operation=-1;
}
- /*!\brief verify that the data are correct before inserting or confirming
+ /*!
+ * \brief verify that the data are correct before inserting or confirming
*\param an array (usually $_POST)
*\return String
*\throw Exception if an error occurs
@@ -472,7 +477,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger
}
}
- /*!\brief insert into the database, it calls first the verify function
+ /*!
+ * \brief insert into the database, it calls first the verify function
* change the value of this->jr_id and this->jr_internal.
* It generates the document and save the middle of payment, if 'gen_invoice is set
* and e_mp
@@ -548,19 +554,36 @@ class Acc_Ledger_Purchase extends Acc_Ledger
try
{
bcscale(4);
- // total amount of the purchase
+ // variable : $tot_amount float : total amount of the purchase (debit)
$tot_amount=0;
+ // variable : $tot_tva float : total amount of the VAT
$tot_tva=0;
+
$tot_debit=0;
$this->db->start();
+ // variable : $tot_nd float total not Deductible
$tot_nd=0;
+ // variable : $tot_perso float total private amount
$tot_perso=0;
+ // variable : $tot_tva_nd float total vat not deductible
$tot_tva_nd=0;
+
+ // variable : $tot_tva_ndded float total vat not deductible - deductible via another tax
$tot_tva_ndded=0;
- $tot_tva_reversed=0;
+
+ $tot_tva_reversed=0; //@todo to remove
+
+ // variable : $tva array that will contain all the VAT Amount
$tva=array();
+
+ // variable : $tva_reverse array that contain all the VAT autoreverse AND negative
+ $tva_reverse = array();
+
+ // variable : $tot_amount_cur : total amount in currency
$tot_amount_cur=0;
+
// find the currency from v_currency_last_value
+ // variable : $currency_rate_ref Acc_Currency , currency object for this operation
$currency_rate_ref=new Acc_Currency($this->db, $p_currency_code);
/* Save all the items without vat and no deductible vat and expense*/
@@ -571,7 +594,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger
/* First we save all the items without vat */
$fiche=new Fiche($this->db);
$fiche->get_by_qcode(${"e_march".$i});
- $tva_both=0;
+ // variable : $tva_both integer 1 for autoreverse ,0 normal, fetch it once for this item,
+ $tva_both=0;
/* tva */
if ($g_parameter->MY_TVA_USE=='Y')
{
@@ -676,13 +700,14 @@ class Acc_Ledger_Purchase extends Acc_Ledger
if ( $g_parameter->MY_TVA_USE=='Y')
{
$tva_item=$acc_amount->amount_vat;
-
- if (isset($tva[$idx_tva]))
- {
+ $tva[$idx_tva]=(isset( $tva[$idx_tva]))? $tva[$idx_tva]:0;
+ if ($tva_both == 0 || $tva_item >= 0){
$tva[$idx_tva]=bcadd($tva[$idx_tva], $tva_item);
+ }else {
+ // $tva_item < 0 && $tva_both == 1
+ $tva_reverse[$idx_tva]=(isset($tva_reverse[$idx_tva]))?$tva_reverse[$idx_tva]:0;
+ $tva_reverse[$idx_tva]=bcadd($tva_item,$tva_reverse[$idx_tva]);
}
- else
- $tva[$idx_tva]=$tva_item;
}
/* Save the stock */
/* if the quantity is < 0 then the stock increase (return of
@@ -853,8 +878,6 @@ class Acc_Ledger_Purchase extends Acc_Ledger
foreach ($tva as $i => $value)
{
$oTva=Acc_Tva::build($this->db,$i);
- $oTva->load();
-
$poste_vat=$oTva->get_side('d');
$cust_amount=round(bcadd($tot_amount,$tot_tva),2);
@@ -867,12 +890,15 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$acc_operation->type='d';
$acc_operation->periode=$tperiode;
if ( $value > 0 ) $tot_debit=bcadd($tot_debit,abs($value));
+ if ( $oTva->get_parameter("both_side") == 1 && $value ==0 ) continue;
$acc_operation->insert_jrnx();
// if TVA is on both side, we deduce it immediately
if ( $oTva->get_parameter("both_side")==1 )
{
- $poste_vat=$oTva->get_side('c');
+ // $x temp variable is the tva_reverse_account and will be used to check $poste_vat
+ $x=$oTva->get_parameter("tva_reverse_account");
+ $poste_vat =(trim($x??"")=="")? $oTva->get_side('c'):$x;
if ( $poste_vat == '#')
{
$poste_vat=$oTva->get_side('d');
@@ -880,16 +906,54 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$acc_operation=new Acc_Operation($this->db);
$acc_operation->date=$e_date;
$acc_operation->poste=$poste_vat;
- $acc_operation->amount=$tot_tva_reversed;
+ $acc_operation->amount=$value;
$acc_operation->grpt=$seq;
$acc_operation->jrn=$p_jrn;
$acc_operation->type='c';
$acc_operation->periode=$tperiode;
$acc_operation->insert_jrnx();
- if ( $value < 0 ) $tot_debit=bcadd($tot_debit,abs($value));
+ //if ( $value < 0 ) $tot_debit=bcadd($tot_debit,abs($value));
}
- }
+ } // LOOP : foreach $tva
+ foreach ($tva_reverse as $i => $value) {
+ $oTva = Acc_Tva::build($this->db,$i);
+ $poste_vat = $oTva->get_side('d');
+ if ( $poste_vat == '#')
+ {
+ $poste_vat=$oTva->get_side('c');
+ }
+
+ $acc_operation = new Acc_Operation($this->db);
+ $acc_operation->date = $e_date;
+ $acc_operation->poste = $poste_vat;
+ $acc_operation->amount = $value;
+ $acc_operation->grpt = $seq;
+ $acc_operation->jrn = $p_jrn;
+ $acc_operation->type = 'd';
+ $acc_operation->periode = $tperiode;
+
+ $acc_operation->insert_jrnx();
+
+ // if TVA is on both side, we deduce it immediately
+ $poste_vat = $oTva->get_side('c');
+ if ( $poste_vat == '#')
+ {
+ $poste_vat=$oTva->get_side('d');
+ }
+ $acc_operation = new Acc_Operation($this->db);
+ $acc_operation->date = $e_date;
+ $acc_operation->poste = $poste_vat;
+ $acc_operation->amount = $value;
+ $acc_operation->grpt = $seq;
+ $acc_operation->jrn = $p_jrn;
+ $acc_operation->type = 'c';
+ $acc_operation->periode = $tperiode;
+ $acc_operation->insert_jrnx();
+ $tot_debit = bcadd($tot_debit, $value);
+ $tot_debit = round($tot_debit, 2);
+ $n_both = $value;
+ } //LOOP: foreach $tva_reverse
}
/* insert into jrn */
@@ -1015,7 +1079,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$acc_pay->grpt=$acseq;
$acc_pay->jrn=$mp->get_parameter('ledger_target');
$acc_pay->periode=$tperiode;
- $acc_pay->type=($famount>=0)?'d':'c';
+ $acc_pay->type=($famount>=0)?'d':'c';
$let_other=$acc_pay->insert_jrnx();
// insert into operation_currency
@@ -1057,11 +1121,11 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$r1=$this->get_id($internal);
$r2=$this->get_id($acinternal);
- /*
- * add lettering
- */
- $oletter=new Lettering($this->db);
- $oletter->insert_couple($let_client,$let_other);
+ /*
+ * add lettering
+ */
+ $oletter=new Lettering($this->db);
+ $oletter->insert_couple($let_client,$let_other);
/* set the flag paid */
$Res=$this->db->exec_sql("update jrn set jr_rapt='paid' where jr_id=$1",array($r1));
@@ -1225,7 +1289,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$add_js="";
if ( $g_parameter->MY_PJ_SUGGEST !='N')
{
- $add_js="update_pj();";
+ $add_js="update_receipt();";
}
if ($g_parameter->MY_DATE_SUGGEST == 'Y')
{
@@ -1518,7 +1582,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
/* if we suggest the pj n# the run the script */
if ( $g_parameter->MY_PJ_SUGGEST !='N')
{
- $r.='';
+ $r.='';
}
// set focus on date
$r.= create_script("$('".$Date->id."').focus()");
diff --git a/include/class/acc_ledger_sale.class.php b/include/class/acc_ledger_sale.class.php
index 2f57664fe..1888669fc 100644
--- a/include/class/acc_ledger_sale.class.php
+++ b/include/class/acc_ledger_sale.class.php
@@ -300,21 +300,28 @@ class Acc_Ledger_Sale extends Acc_Ledger {
bcscale(4);
try {
- // total amount of the sales (credit)
+ // variable : $tot_amount : total amount of the sales (credit)
$tot_amount = 0;
- // total amount of the VAT
+ // variable : $tot_tva : total amount of the VAT
$tot_tva = 0;
// tot debit if item's amount < 0
$tot_debit = 0;
- // total amount in currency
+ // variable : $tot_amount_cur : total amount in currency
$tot_amount_cur=0;
$this->db->start();
+ // variable : $tva array that will contain all the VAT Amount
$tva = array();
+ // variable : $tva_reverse array that contain all the VAT autoreverse AND negative
+ $tva_reverse = array();
+
// find the currency from v_currency_last_value
+ // variable : $currency_rate_ref Acc_Currency , currency object for this operation
$currency_rate_ref=new Acc_Currency($this->db, $p_currency_code);
+
/* Save all the items without vat */
for ($i = 0; $i < $nb_item; $i++) {
+ // variable : $n_both float auto-reverse amount
$n_both = 0;
if ( empty(${'e_march'.$i}) || empty(${'e_quant'.$i}) ) continue;
@@ -328,7 +335,6 @@ class Acc_Ledger_Sale extends Acc_Ledger {
$tot_amount = bcadd($tot_amount, $amount);
$tot_amount = round($tot_amount, 2);
- if ( DEBUGNOALYSS > 1 ) { echo __LINE__." tot_amount $tot_amount ";} $acc_operation = new Acc_Operation($this->db); $acc_operation->date = $e_date; $sposte = $fiche->strAttribut(ATTR_DEF_ACCOUNT); @@ -367,39 +373,44 @@ class Acc_Ledger_Sale extends Acc_Ledger { if ($g_parameter->MY_TVA_USE == 'Y') { /* Compute sum vat */ $oTva = Acc_Tva::build($this->db, trim(${'e_march' . $i . '_tva_id'})); - $oTva->load(); $idx_tva =$oTva->get_parameter("id"); + // variable : $auto_reverse = if the oTVA autoreverse, fetch it once for this item, + $auto_reverse=$oTva->get_parameter("both_side"); $tva_item_currency = ${'e_march' . $i . '_tva_amount'}; /* if empty then we need to compute it */ if (trim($tva_item_currency) == '' || ${'e_march'.$i.'_tva_amount'} == 0) { - /* retrieve tva */ - $l = Acc_Tva::build($this->db, $idx_tva); - $l->load(); - $tva_item_currency = bcmul($amount, $l->get_parameter('rate')); - $tva_item=round($tva_item_currency,2); + $tva_item_currency = bcmul($amount, $oTva->get_parameter('rate')); + $tva_item=round($tva_item_currency,2); } $tva_item=bcdiv($tva_item_currency,$p_currency_rate); $tva_item=round($tva_item,2); - if (isset($tva[$idx_tva])) + + $tva[$idx_tva]=(isset($tva[$idx_tva]))?$tva[$idx_tva]:0; + + if ( $auto_reverse == 0) { $tva[$idx_tva]=bcadd($tva_item,$tva[$idx_tva]); $tva[$idx_tva]=round($tva[$idx_tva],2); + $tot_tva = bcadd($tva_item, $tot_tva); + $tot_tva = round($tot_tva, 2); } else { - $tva[$idx_tva]=$tva_item; - } - if ($oTva->get_parameter("both_side") == 0) { - $tot_tva = bcadd($tva_item, $tot_tva); - $tot_tva = round($tot_tva, 2); - } else { $n_both = $tva_item; $tva_item_currency = 0; if ($n_both<0) { $tot_debit=round(bcadd($tot_debit, abs($n_both)),2); + $tva_reverse[$idx_tva]=(isset($tva_reverse[$idx_tva]))?$tva_reverse[$idx_tva]:0; + $tva_reverse[$idx_tva]=bcadd($tva_item,$tva_reverse[$idx_tva]); + $tva_reverse[$idx_tva]=round($tva_reverse[$idx_tva],2); + + } else { + $tva[$idx_tva]=bcadd($tva_item,$tva[$idx_tva]); + $tva[$idx_tva]=round($tva[$idx_tva],2); + } } } @@ -548,20 +559,16 @@ class Acc_Ledger_Sale extends Acc_Ledger { $operation_currency->j_id=$let_tiers ; $operation_currency->insert(); - - /** save all vat + + /************************************************************************************************** + * save all vat * $i contains the tva_id and value contains the vat amount * if if ($g_parameter->MY_TVA_USE == 'Y' ) - */ + ************************************************************************************************** */ if ($g_parameter->MY_TVA_USE == 'Y') { - if ( DEBUGNOALYSS > 1 ) { - var_dump($tva); - } + foreach ($tva as $i => $value) { $oTva = Acc_Tva::build($this->db,$i); - - $oTva->load(); - $poste_vat = $oTva->get_side('c'); $cust_amount = bcadd($tot_amount, $tot_tva); @@ -578,14 +585,16 @@ class Acc_Ledger_Sale extends Acc_Ledger { $tot_debit=bcadd($tot_debit, abs($value)); $tot_debit=round($tot_debit, 2); } + if ( $oTva->get_parameter("both_side") == 1 && $value ==0 ) continue; $acc_operation->insert_jrnx(); - if ( DEBUGNOALYSS > 1 ) { - echo __LINE__." tot_tva $tot_tva "; - } // if TVA is on both side, we deduce it immediately - if ($oTva->get_parameter("both_side") == 1) { - $poste_vat = $oTva->get_side('d'); + if ($oTva->get_parameter("both_side") == 1 ) { + // $x temp variable is the tva_reverse_account and will be used to check $poste_vat + $x=$oTva->get_parameter("tva_reverse_account"); + + $poste_vat =(trim($x??"")=="")? $oTva->get_side('d'):$x; + if ($poste_vat == '#') $poste_vat=$oTva->get_side('c'); $cust_amount = bcadd($tot_amount, $tot_tva); $acc_operation = new Acc_Operation($this->db); $acc_operation->date = $e_date; @@ -600,7 +609,52 @@ class Acc_Ledger_Sale extends Acc_Ledger { $tot_debit = round($tot_debit, 2); $n_both = $value; } + } + foreach ($tva_reverse as $i => $value) { + $oTva = Acc_Tva::build($this->db,$i); + $poste_vat = $oTva->get_side('c'); + if ( $poste_vat == '#') + { + $poste_vat=$oTva->get_side('d'); + } + + $acc_operation = new Acc_Operation($this->db); + $acc_operation->date = $e_date; + $acc_operation->poste = $poste_vat; + $acc_operation->amount = $value; + $acc_operation->grpt = $seq; + $acc_operation->jrn = $p_jrn; + $acc_operation->type = 'c'; + $acc_operation->periode = $tperiode; + if ($value<0) + { + $tot_debit=bcadd($tot_debit, abs($value)); + $tot_debit=round($tot_debit, 2); + } + $acc_operation->insert_jrnx(); + + // if TVA is on both side, we deduce it immediately + $poste_vat = $oTva->get_side('d'); + if ( $poste_vat == '#') + { + $poste_vat=$oTva->get_side('c'); + } + $acc_operation = new Acc_Operation($this->db); + $acc_operation->date = $e_date; + $acc_operation->poste = $poste_vat; + $acc_operation->amount = $value; + $acc_operation->grpt = $seq; + $acc_operation->jrn = $p_jrn; + $acc_operation->type = 'd'; + $acc_operation->periode = $tperiode; + $acc_operation->insert_jrnx(); + $tot_debit = bcadd($tot_debit, $value); + $tot_debit = round($tot_debit, 2); + $n_both = $value; + + } + } // if ($g_parameter->MY_TVA_USE=='Y') /* * Balance the amount on D and C , the difference must be inserted as "difference due to a rounded value" @@ -1366,7 +1420,7 @@ EOF; /* if we suggest the next pj, then we need a javascript */ $add_js = ""; if ($g_parameter->MY_PJ_SUGGEST != 'N') { - $add_js = "update_pj();"; + $add_js = "update_receipt();"; } if ($g_parameter->MY_DATE_SUGGEST == 'Y') { $add_js.='get_last_date();'; diff --git a/include/class/acc_ledger_search.class.php b/include/class/acc_ledger_search.class.php index d94dd2a37..2a25e2fbc 100644 --- a/include/class/acc_ledger_search.class.php +++ b/include/class/acc_ledger_search.class.php @@ -35,10 +35,10 @@ class Acc_Ledger_Search protected $cn; //!< Database Connection private $type; //!< type of ledger : FIN,ODS,VEN,ACH - private $all; //!< Flag to indicate if all ledgers must searched (1 for yes) - private $div; //! prefix for id of DOM id - //! id of the ledger - var $id ; + private $all; //!< Flag to indicate if all ledgers must be searched (1 for yes) + private $div; //!< prefix for id of DOM id + var $id ; //!< id of the ledger + /** * @brief return a HTML string with the form for the search * @param $p_type if the type of ledger possible values=ALL,VEN,ACH,ODS,FIN: uppercase ! @@ -47,9 +47,9 @@ class Acc_Ledger_Search * - 1 means all the ledger of this type * - 0 No have the "Tous les journaux" availables * @param $div is the div (for reconciliation) - * @param type $p_type - * @param type $p_all - * @param type $p_div + * @param string $p_type ACH, VEN , ODS or FIN + * @param int $p_all 1 means all the ledger + * @param string $p_div prefix of the DOM ID * * @todo the parameter $all_type_ledger is useless : ALL means all the ledgers, VEN all the ledger of sales... */ @@ -258,7 +258,7 @@ class Acc_Ledger_Search } /** - * Build the button for managing the filter for search + * @brief Build the button for managing the filter for search * @param type $p_div id prefix of the div, button, table .. * @param $this->type if the type of ledger possible values=ALL,VEN,ACH,ODS,FIN * @param $all_type_ledger diff --git a/include/class/acc_operation.class.php b/include/class/acc_operation.class.php index a09581c95..08c332870 100644 --- a/include/class/acc_operation.class.php +++ b/include/class/acc_operation.class.php @@ -860,9 +860,12 @@ EOF; $cn=Dossier::connect(); $g_user=new Noalyss_user($cn); $a=new Acc_Operation($cn); - $a->jr_id=1444; + $a->jr_id=993; $b=$a->get_quant(); + echo h1('contain of get_quant() '); var_dump($b); + echo h1('contain of get_jrnx_detail()'); + var_dump($a->get_jrnx_detail()); } /** * Return a select object to choose the type of operation diff --git a/include/class/acc_operation_note.class.php b/include/class/acc_operation_note.class.php index 9a2638347..c6188b6e8 100644 --- a/include/class/acc_operation_note.class.php +++ b/include/class/acc_operation_note.class.php @@ -25,7 +25,7 @@ */ /*! - * \class + * \class Acc_Operation_Note * \brief Manage the note attached to an operation */ diff --git a/include/class/acc_tva.class.php b/include/class/acc_tva.class.php index d9fcf4d28..43a66b9b7 100644 --- a/include/class/acc_tva.class.php +++ b/include/class/acc_tva.class.php @@ -41,13 +41,17 @@ class Acc_Tva "comment"=>"tva_comment", "account"=>"tva_poste", "both_side"=>'tva_both_side', - 'tva_code'); + 'tva_reverse_account'=>'tva_reverse_account', + 'tva_code'=>'tva_code'); public $tva_id, $tva_label, $tva_rate, $tva_comment, $tva_poste, - $tva_both_side,$tva_code; + $tva_both_side, + $tva_code, + $tva_reverse_account; + private $cn; //!< Database connection private Tva_Rate_SQL $tva_rate_sql; @@ -63,6 +67,7 @@ class Acc_Tva $this->tva_poste=&$this->tva_rate_sql->tva_poste; $this->tva_both_side=&$this->tva_rate_sql->tva_both_side; $this->tva_code=&$this->tva_rate_sql->tva_code; + $this->tva_reverse_account=&$this->tva_rate_sql->tva_reverse_account; } /** @@ -90,7 +95,7 @@ class Acc_Tva return $this->$idx; } - echo (__FILE__.":".__LINE__.'Erreur attribut inexistant'); + echo (__FILE__.":".__LINE__."AT97:Erreur attribut inexistant [$p_string]"); } public function set_parameter($p_string,$p_value) { diff --git a/include/class/admin.class.php b/include/class/admin.class.php index e22468b5b..a90254638 100644 --- a/include/class/admin.class.php +++ b/include/class/admin.class.php @@ -40,7 +40,7 @@ class Admin extends Fiche var $vat_number; /*!< $vat_number vat number */ /*! \brief Constructor - /* only a db connection is needed */ + * only a db connection is needed */ function __construct($p_cn,$p_id=0) { $this->fiche_def_ref=FICHE_TYPE_ADM_TAX; diff --git a/include/class/anc_operation.class.php b/include/class/anc_operation.class.php index 49ff5aa44..ceb7cd033 100644 --- a/include/class/anc_operation.class.php +++ b/include/class/anc_operation.class.php @@ -717,16 +717,15 @@ EOF; return $result; } /** - * Save the ND VAT with prorata + * @brief Save the ND VAT in ANL, and distribute the amount among ANL Axis proportionnaly to the source * - * @param $p_array usually $_POST - * @param $p_item item of the form - * @param $p_j_id jrnx.j_id concerned writing - * @param $p_nd amount nd vat - * @see Anc_Operation::save_form_plan_vat_nd - * @return type + * @param $p_array array usually $_POST + * @param $p_item int nb of the item of the form + * @param $p_j_id int jrnx.j_id concerned writing + * @param $p_nd float amount nd vat + * @see Anc_Operation::save_form_plan() */ - function save_form_plan_vat_nd($p_array,$p_item,$p_j_id,$p_nd) + function save_form_plan_vat_nd($p_array,$p_item,$p_j_id,$p_nd):void { bcscale(4); extract($p_array, EXTR_SKIP); @@ -734,18 +733,16 @@ EOF; if ( ! isset(${'amount_t'.$p_item}) ) throw new Exception ('amount not set'); - - $tot=0; - /* variable for in array - pa_id array of existing pa_id - hplan double array with the pa_id (column) - val double array by row with amount - op contains sequence - p_item is used to identify what op is concerned + + /** + * variable for in array + * @var pa_id array of existing pa_id + @var hplan double array with the pa_id as key (column) + @var val double array by row with amount + * @var op contains sequence + @var p_item is used to identify what op is concerned */ - /* echo "j_id = $j_id p_item = $p_item hplan=".var_export($hplan[$p_item],true)." val = ".var_export($val[$p_item],true).' '; */ - /* for each row */ - // for ($i=0;$i '; + print "ERROR : $lineno"; + print $msg; + print ' '; + } + // prepare test + $old_value=[]; + try { + $cn->start(); + $old_value[0]=$cn->get_row('select * from document_type where dt_id=$1',[8]); + $old_value[1]=$cn->get_row('select * from document_type where dt_id=$1',[6]); + + $cn->exec_sql("update document_type set dt_value='Email' where dt_id=$1",[6]); + $cn->exec_sql("update document_type set dt_prefix='PML' where dt_id=$1",[8]); + $document_type=new Document_Type($cn,8); + echo $document_type; + + if ( $document_type->get() == 1 ) { + } + + if ( $document_type->dt_prefix!='PML') { + prv_echo_error("PREFIX :". $document_type,__LINE__); + } + + $document_type->set_number(6); + $document_type->get(); + + if ( $document_type->dt_value!='Email') { + prv_echo_error("VALUE :". $document_type,__LINE__); + } + $list=Document_Type::get_list($cn); + + // list array > 1 and key =5 + if (count ($list) == 0) { + prv_echo_error("GET_LIST :EMPTY",__LINE__); + } else { + foreach (['js_mod','dt_id','dt_value','dt_prefix','js_remove'] as $key) { + if ( ! isset ($list[0][$key])) { + prv_echo_error ('NOT SET '.$key,__LINE__); + } else { + echo ''; + var_dump( $list[0][$key]); + echo ''; + } + } + } + } catch (\Exception $e) { + prv_echo_error("EXCEPTION :". $document_type,__LINE__); + print_r($e->getTraceAsString()); + } + $cn->rollback(); + } } diff --git a/include/class/follow_up.class.php b/include/class/follow_up.class.php index c058174ad..6f0748dd5 100644 --- a/include/class/follow_up.class.php +++ b/include/class/follow_up.class.php @@ -34,7 +34,7 @@ require_once NOALYSS_INCLUDE.'/lib/user_common.php'; */ /** - * \class + * \class Follow_Up * \brief class_action for manipulating actions * action can be : *
= $alpha_num->input('p_alphanum') ?>
diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php
index f0eafa255..9943602d8 100644
--- a/include/compta_ven.inc.php
+++ b/include/compta_ven.inc.php
@@ -302,7 +302,7 @@ echo '';
/* if we suggest the pj n# the run the script */
if ( $g_parameter->MY_PJ_SUGGEST=='Y')
{
- echo '';
+ echo '';
}
$e_date=$http->request("e_date","string","");
diff --git a/include/constant.php b/include/constant.php
index e81d73934..806867ebb 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -28,7 +28,7 @@ global $version_noalyss;
define('NOALYSS_VERSION', 9300 );
// Database schema version
-define("DBVERSION", 202);
+define("DBVERSION", 203);
// version for MONO_DATABASE
define("MONO_DATABASE", 25);
diff --git a/include/database/operation_exercice_detail_sql.class.php b/include/database/operation_exercice_detail_sql.class.php
index a05afb44b..551bc9e97 100644
--- a/include/database/operation_exercice_detail_sql.class.php
+++ b/include/database/operation_exercice_detail_sql.class.php
@@ -27,8 +27,8 @@
*/
/**
- * @class
- * @brief abstract of the table
+ * @class Operation_Exercice_Detail_SQL
+ * @brief abstract of the table operation_exercice_detail
*/
class Operation_Exercice_Detail_SQL extends Table_Data_SQL
{
diff --git a/include/database/tva_rate_sql.class.php b/include/database/tva_rate_sql.class.php
index 5fc0593da..78bb589b4 100644
--- a/include/database/tva_rate_sql.class.php
+++ b/include/database/tva_rate_sql.class.php
@@ -51,6 +51,7 @@ class Tva_Rate_SQL extends Table_Data_SQL
,"tva_payment_purchase"=>"tva_payment_purchase"
,"tva_payment_sale"=>"tva_payment_sale"
,"tva_code"=>"tva_code"
+ ,'tva_reverse_account'=>'tva_reverse_account'
);
/*
* Type of columns
@@ -65,6 +66,7 @@ class Tva_Rate_SQL extends Table_Data_SQL
,"tva_payment_purchase"=>"text"
,"tva_payment_sale"=>"text"
,"tva_code"=>"text"
+ ,'tva_reverse_account'=>'text'
);
diff --git a/include/database/v_tva_rate_sql.class.php b/include/database/v_tva_rate_sql.class.php
index f336b6433..5d74a662b 100644
--- a/include/database/v_tva_rate_sql.class.php
+++ b/include/database/v_tva_rate_sql.class.php
@@ -49,6 +49,7 @@ class V_Tva_Rate_SQL extends Table_Data_SQL
, "tva_purchase"=>"tva_purchase"
, "tva_sale"=>"tva_sale"
, "tva_both_side"=>"tva_both_side"
+ ,'tva_reverse_account'=>'tva_reverse_account'
,'tva_payment_purchase'=>'tva_payment_purchase'
,'tva_payment_sale'=>'tva_payment_sale'
@@ -65,6 +66,7 @@ class V_Tva_Rate_SQL extends Table_Data_SQL
, "tva_purchase"=>"text"
, "tva_sale"=>"text"
, "tva_both_side"=>"numeric"
+ ,'tva_reverse_account'=>'text'
, 'tva_payment_purchase'=>'text'
, 'tva_payment_sale'=>'text'
);
diff --git a/include/export/export_gl_csv.php b/include/export/export_gl_csv.php
index 98a7411da..f02cd464b 100644
--- a/include/export/export_gl_csv.php
+++ b/include/export/export_gl_csv.php
@@ -35,7 +35,7 @@
[from_poste] =>
[to_poste] =>
)
-@encode
+@endcode
*/
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
diff --git a/include/extension_choice.inc.php b/include/extension_choice.inc.php
deleted file mode 100644
index 8bc6c1785..000000000
--- a/include/extension_choice.inc.php
+++ /dev/null
@@ -1,54 +0,0 @@
-';
-@html_page_start($_SESSION[SESSION_KEY.'g_theme']);
-
-$cn=Dossier::connect();
-global $g_user;
-$g_user=new Noalyss_user($cn);
-$g_user->check();
-$only_plugin=$g_user->check_dossier(dossier::id());
-
-
-/* javascript file */
-echo load_all_script();
-
-/* show all the extension we can access */
-$a=new ISelect('plugin_code');
-$a->value=Extension::make_array($cn);
-$a->selected=(isset($_REQUEST['plugin_code']))?strtoupper($_REQUEST['plugin_code']):'';
-
-/* no plugin available */
-if ( count($a->value) == 0 )
-{
- alert(j(_("Aucune extension disponible")));
- exit;
-}
-
-/* only one plugin available then we don't propose a choice*/
-if ( count($a->value)==1 )
-{
- $_REQUEST['plugin_code']=$a->value[0]['value'];
-}
-echo ' ';
-/*else
-{
- if (!isset($_REQUEST['ac'])) echo_warning ("ac non positionné");
- echo ''; -}*/ - -//if ( isset($_REQUEST['plugin_code'])) -// require_once NOALYSS_INCLUDE.'/extension_get.inc.php'; -?> diff --git a/include/lettering.gestion.inc.php b/include/lettering.gestion.inc.php index e3251389c..ac201118d 100644 --- a/include/lettering.gestion.inc.php +++ b/include/lettering.gestion.inc.php @@ -1,7 +1,29 @@ '; @@ -22,13 +44,13 @@ $periode=new Periode($cn); list($first_per,$last_per)=$periode->get_limit($exercice); $start=new IDate('start'); -$start->value=(isset($_GET['start']))?$http->get('start'):$first_per->first_day(); +$start->value=(isset($_GET['start']))?$http->get('start','date'):$first_per->first_day(); $r=td(_('Date début')); $r.=td($start->input()); echo tr($r); $end=new IDate('end'); -$end->value=(isset($_GET['end']))?$_GET['end']:$last_per->last_day(); +$end->value=(isset($_GET['end']))?$http->get('end','date'):$last_per->last_day(); $r=td(_('Date fin')); $r.=td($end->input()); echo tr($r); @@ -52,7 +74,7 @@ echo ' '; echo HtmlInput::submit("seek",_('Recherche')); echo ''; echo ''; -//if (! isset($_REQUEST['seek'])) exit; + echo ' '; //-------------------------------------------------------------------------------- // record the data @@ -74,7 +96,7 @@ if ( isset($_GET['start']) && isset($_GET['end'])) } } echo ' ';
-$fiche=new Fiche($cn,$_REQUEST['f_id']);
+$fiche=new Fiche($cn, $http->request('f_id',"number"));
$quick_code=$fiche->get_quick_code();
$letter=new Lettering_Card($cn);
$letter->set_parameter('quick_code',$quick_code);
diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index 9b5a2a87a..588d06292 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -36,9 +36,9 @@ function h($p_string)
{
return ( $p_string === null)?"":htmlspecialchars($p_string,ENT_QUOTES|ENT_HTML5,'UTF-8',true);
}
-function p($p_string)
+function p($p_string, $p_extra='')
{
- return ' ';
- return;
-}
-/* --------------------------------------------------
- * Step 2 choose now the exercice of this folder
- */
-$back='do.php?ac='.$http->request("ac").'&'.dossier::get();
-if ($sa=='step2')
-{
- echo ''.$p_string." "; + return ''.$p_string.""; } function span($p_string, $p_extra='') { @@ -1800,4 +1800,5 @@ function sanitize_filename($filename) $new_filename=strtolower($filename_no)."-".date("Ymd-Hi").$filename_suff; return $new_filename; -} \ No newline at end of file +} + diff --git a/include/lib/function_javascript.php b/include/lib/function_javascript.php index c5478fa92..c94def571 100644 --- a/include/lib/function_javascript.php +++ b/include/lib/function_javascript.php @@ -2784,7 +2784,9 @@ EOF; echo js_include('acc_currency.js'); echo js_include('taggroup.js'); echo js_include('noalyss_checkbox.js'); - + if (DEBUGNOALYSS > 1) { + echo js_include('noalyss_debug.js'); + } } /** diff --git a/include/lib/http_input.class.php b/include/lib/http_input.class.php index 535573f4b..894095439 100644 --- a/include/lib/http_input.class.php +++ b/include/lib/http_input.class.php @@ -172,7 +172,7 @@ class HttpInput } if (!array_key_exists($p_name,$this->array)) { - throw new Exception(_('Paramètre invalide')."[$p_name]", + throw new Exception("C175."._('Paramètre invalide')."[$p_name]", EXC_PARAM_VALUE); } $this->check_type($p_name, $p_type); diff --git a/include/lib/icard.class.php b/include/lib/icard.class.php index 01b5a8dc0..8d195cc83 100644 --- a/include/lib/icard.class.php +++ b/include/lib/icard.class.php @@ -476,7 +476,7 @@ class ICard extends HtmlInput } $input=' '.
- Icon_Action::clean_zone(uniqid("remove"),"$('{$this->id}').value=''").
+ Icon_Action::clean_zone(uniqid("remove"),"clean_Fid('{$this->id}');compute_all_ledger();").
" ";
$input.=sprintf('
diff --git a/include/lib/input_checkbox.class.php b/include/lib/input_checkbox.class.php
index aa1cc8f5f..f14ecd7cd 100644
--- a/include/lib/input_checkbox.class.php
+++ b/include/lib/input_checkbox.class.php
@@ -28,7 +28,7 @@
* value , either 1 or 0 EXPERIMENTAL
*/
/**
- * @class
+ * @class InputCheckBox
* @brief modern checkbox, using a javascript to change the icon when clicked and a hidden field, there is always a
* value , either 1 or 0 , EXPERIMENTAL
*/
diff --git a/include/lib/iposte.class.php b/include/lib/iposte.class.php
index 74ea4b054..3cd03c11a 100644
--- a/include/lib/iposte.class.php
+++ b/include/lib/iposte.class.php
@@ -88,12 +88,12 @@ class IPoste extends HtmlInput
$this->extra2="all";
$this->extra="";
$this->attribute=array();
- $this->id=$p_id;
+ $this->id=$p_id;
$this->nb_row=1;
}
- static function ipopup($p_name)
+ static function ipopup($p_name)
{
$ip=new IPopup($p_name);
$ip->title='Plan comptable';
diff --git a/include/lib/manage_table_sql.class.php b/include/lib/manage_table_sql.class.php
index e0f2b6b39..fbce42565 100644
--- a/include/lib/manage_table_sql.class.php
+++ b/include/lib/manage_table_sql.class.php
@@ -218,7 +218,7 @@ class Manage_Table_SQL
*/
function send_header()
{
- header('Content-type:text/xml;charset="UTF-8"');
+ @header('Content-type:text/xml;charset="UTF-8"');
}
/**
diff --git a/include/lib/message_javascript.php b/include/lib/message_javascript.php
index 75b38033c..a42c4bfdf 100644
--- a/include/lib/message_javascript.php
+++ b/include/lib/message_javascript.php
@@ -121,4 +121,6 @@ content[84]="";
content[86]="";
content[87]="";
+content[88]="";
+
diff --git a/include/lib/noalyss_csv.class.php b/include/lib/noalyss_csv.class.php
index 0ac94699f..11dcbb700 100644
--- a/include/lib/noalyss_csv.class.php
+++ b/include/lib/noalyss_csv.class.php
@@ -77,11 +77,16 @@ class Noalyss_Csv
}
/***
- *@brief Send an header for CSV , the filename is corrected
+ *@brief Send an header for CSV , the filename is corrected. If TEST_UNIT is defined, the function is called
+ * from a test file (located in scenario , see manual )and no header are requested
*/
function send_header()
{
$this->correct_name();
+ if ( defined('TEST_UNIT')) {
+
+ return;
+ }
header('Pragma: public');
header('Content-type: application/csv');
header("Content-Disposition: attachment;filename=\"{$this->filename}\"",
@@ -292,5 +297,32 @@ class Noalyss_Csv
$this->size = $size;
return $this;
}
+ /**
+ * @brief convert CSV strings (content of a file) into HTML table,
+ * @param $string CSV files
+ */
+ static function csv2table ($string)
+ {
+ $a_field=[';',','];
+ $sep_field=$a_field[$_SESSION[SESSION_KEY.'csv_fieldsep']];
+ $a_field=['.',','];
+ $sep_dec=$a_field[$_SESSION[SESSION_KEY.'csv_decimal']];
+ $encoding=$_SESSION[SESSION_KEY.'csv_encoding'];
+ $aRow=explode("\r\n", $string);
+
+ echo '
Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2" + . " Très longue chaine HTML pour 2"); + + $tab3 = new Html_Tab('tab3',_("Titre 3")); + $tab3->set_content(' '
+ . " '._("Opération enregistrée")." "._("Piece ").h($ledger->pj).''; - if (strcmp($ledger->pj, $_POST['e_pj'])!=0) - { - echo ''._('Attention numéro pièce existante, elle a du être adaptée').''; - } - printf('%s', - $jr_id, dossier::id(), $ledger->internal); - - // show feedback - echo ' '; echo ' ';
- echo $ledger->confirm($_POST, true);
- }
- catch (Exception $e)
- {
- require(NOALYSS_INCLUDE.'/operation_ods_new.inc.php');
- alert($e->getMessage());
- }
- return;
-}
-
-
-/* --------------------------------------------------
- * step 1 if nothing is asked we show the available folders
- */
-if ($sa=='')
-{
- echo ''.$ledger->get_name().''; echo '';
-
- echo ' ';
- echo ''._("Etape 1 : choix du dossier").''; - - echo _('Choisissez le dossier où sont les soldes à importer'); - $avail=$g_user->get_available_folder(); - - if (empty($avail)) - { - echo '*** '._("Aucun dossier").' ***'; - return; - } - echo ''; - echo ''.
- ' '._('Etape 2 : période').''. - ''.dossier::name($_REQUEST['f']).''. - '"; - echo HtmlInput::button_anchor(_('Retour'), $back); - exit(0); -} -/* -------------------------------------------------- - * select the ledger where we will import the data - */ -if ($sa=='step3') -{ - echo ''.
- ' Etape 3'. - ''.dossier::name($_REQUEST['f']).''. - '"; - echo HtmlInput::button_anchor('Retour', - $back.'&sa=step2&f='.$_REQUEST['f']); - exit(0); -} -/* -------------------------------------------------- - * Step 4 we import data from the selected folder and year and - * transform it into a misc operation - */ -if ($sa=='step4') -{ - echo '';
- echo ' '._("étape 4").''; - $dossier_id=$http->request("f","number"); - $p_periode=$http->request("p_periode","number"); - $p_jrn=$http->request("p_jrn","number"); - $cn_target=new Database($dossier_id); - $saldo=new Acc_Ledger($cn_target, 0); - $array=$saldo->get_saldo_exercice($p_periode); - /* we need to transform the array into a Acc_Ledger array */ - - $result=array(); - $result['desc']=sprintf(_("Ecriture d'ouverture %d"),$g_user->get_exercice()); - $result['nb_item']=sizeof($array); - $result['p_jrn']=$p_jrn; - $result["ac"]=$http->request("ac"); - $result['p_periode']=$p_periode; - $result['gDossier']=Dossier::id(); - $result['jr_optype']="OPE"; - // default date = first day of Exercice - $periode=new Periode($cn,$g_user->get_periode()); - list($periode_start,$periode_end)=$periode->get_limit($g_user->get_exercice()); - $result["e_date"]=$periode_start->first_day(); - - $idx=0; - - foreach ($array as $row) - { - $qcode='qc_'.$idx; - $poste='poste'.$idx; - $amount='amount'.$idx; - $ck='ck'.$idx; - $result[$qcode]=$row['j_qcode']; - if (trim($row['j_qcode']??"")=='') - $result[$poste]=$row['j_poste']; - $result[$amount]=abs($row['solde']); - if ($row['solde']>0) - $result[$ck]='on'; - $idx++; - } - $cn=Dossier::connect(); - $jrn=new Acc_Ledger($cn,$p_jrn); - $_POST=$result; - $_REQUEST=$result; - $ledger=new Acc_Ledger($cn, $p_jrn); - require_once NOALYSS_INCLUDE.'/operation_ods_new.inc.php'; - - echo ' | ||
| @@ -112,19 +133,19 @@ echo $f_accounting->input(); ?> | |
| - + div."tag_option"); $iselect->value=array( array("value"=>0,"label"=>_("Toutes les étiquettes")), array("value"=>1,"label"=>_("Au moins une étiquette")) ); - + $iselect->set_value($http->request($this->div."tag_option","number",0)); - echo $iselect->input(); - + echo $iselect->input(); + ?> div); @@ -132,7 +153,7 @@ echo $f_accounting->input(); ?> | - request($this->div."tag","string",0); if (is_array($aTag) ) { $nb_tag=count($aTag); @@ -142,9 +163,9 @@ echo $f_accounting->input(); ?> } } ?> - + |