00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00026 define ("phpcompta_password","dany");
00027 define ("domaine","");
00028
00029 define ("DEBUG","true");
00030
00031
00032
00033
00034 define ("ENCJRN",1);
00035
00036 define("FACT",2);
00037
00038 define ("FICHE_READ",3);
00039
00040 define ("IMP",4);
00041
00042 define("FORM",5);
00043
00044 define ("MPCMN",6);
00045
00046 define ("GJRN",7);
00047
00048 define ("PARM",8);
00049
00050 define ("SECU",9);
00051
00052 define ("DEVISE",18);
00053
00054 define ("PERIODE",19);
00055
00056 define ("BALANCE",20);
00057
00058 define ("CENTRALIZE",10);
00059 define ("VEN",11);
00060 define ("BQE",12);
00061 define ("ODS",13);
00062
00063 define ("FICHE_WRITE",15);
00064 define ("STOCK_WRITE",16);
00065 define ("STOCK_READ",17);
00066 define ("EXP_IMP_ECR",21);
00067 define ("IMP_BQE",22);
00068
00069 define ("NOERROR",0);
00070 define ("BADPARM",1);
00071 define ("BADDATE",2);
00072 define ("NOTPERIODE",3);
00073 define ("PERIODCLOSED",4);
00074 define ("INVALID_ECH",5);
00075 define ("RAPPT_ALREADY_USED",6);
00076 define ("RAPPT_NOT_EXIST",7);
00077 define ("DIFF_AMOUNT",8);
00078 define ("RAPPT_NOMATCH_AMOUNT",9);
00079 define ("NO_PERIOD_SELECTED",10);
00080 define ("NO_POST_SELECTED",11);
00081 define ("LAST",1);
00082 define ("FIRST",0);
00083 define ("ERROR",12);
00084
00085
00086 define ("YES",1);
00087 define ("NO",0);
00088 define ("OPEN",1);
00089 define ("CLOSED",0);
00090 define ("NOTCENTRALIZED",3);
00091
00092
00093 define ("MENU_FACT",1);
00094 define ("MENU_FICHE",2);
00095 define ("MENU_PARAM",3);
00096
00097
00098 define ("ALL_FICHE_DEF_REF", 1000);
00099
00100
00101 define ("ATTR_DEF_ACCOUNT",5);
00102 define ("ATTR_DEF_NAME",1);
00103 define ("ATTR_DEF_PRIX_ACHAT",7);
00104 define ("ATTR_DEF_PRIX_VENTE",6);
00105 define ("ATTR_DEF_TVA",2);
00106 define ("ATTR_DEF_NUMTVA",13);
00107 define ("ATTR_DEF_ADRESS",14);
00108 define ("ATTR_DEF_CP",15);
00109 define ("ATTR_DEF_PAYS",16);
00110 define ("ATTR_DEF_STOCK",19);
00111 define ("ATTR_DEF_TEL",17);
00112 define ("ATTR_DEF_EMAIL",18);
00113 define ("ATTR_DEF_COMPANY",25);
00114 define ("ATTR_DEF_FAX",26);
00115
00116
00117 define ("FICHE_TYPE_CLIENT",9);
00118 define ("FICHE_TYPE_VENTE",1);
00119 define ("FICHE_TYPE_FOURNISSEUR",8);
00120 define ("FICHE_TYPE_FIN",4);
00121 define ("FICHE_TYPE_CONTACT",16);
00122 define ("FICHE_TYPE_ADM_TAX",14);
00123 define ("ATTR_DEF_DEPENSE_NON_DEDUCTIBLE",20);
00124 define ("ATTR_DEF_TVA_NON_DEDUCTIBLE",21);
00125 define ("ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP",22);
00126 define ("ATTR_DEF_QUICKCODE",23);
00127 define ("JS_SEARCH_POSTE","<SCRIPT language=\"javascript\">function SearchPoste(p_sessid,p_ctl,p_jrn)
00128 {
00129 var win=window.open('poste_search.php?p_jrn='+p_jrn+'&p_ctl='+p_ctl+'&PHPSESSID='+p_sessid,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
00130 }
00131 function SearchPosteFilter(p_sessid,p_ctl,p_filter,jrn)
00132 {
00133 var win=window.open('poste_search.php?p_jrn='+jrn+'&p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+'&filter='+p_filter,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
00134 }
00135 function GetIt() {
00136 window.close();
00137 }
00138 function SetItChild(p_ctl,p_value) {
00139 self.opener.SetItParent(p_ctl,p_value);
00140 window.close();
00141 }
00142 function SetItParent(p_ctl,p_value) {
00143
00144 var f=document.getElementsByName(p_ctl);
00145 for (var h=0; h < f.length; h++) {
00146 f[h].value=p_value;
00147 }
00148
00149 }
00150 /* SetValue( p_ctl,p_value )
00151 /* p_ctl is the name of the control
00152 /* p_value is the value to set in
00153 */
00154 function SetValue(p_ctl,p_value)
00155 {
00156
00157 var f=document.getElementsByName(p_ctl);
00158 for (var h=0; h < f.length; h++) {
00159 f[h].value=p_value;
00160 }
00161
00162
00163 }
00164 </SCRIPT>"
00165 );
00166 define ("JS_SHOW_TVA","<SCRIPT language=\"javascript\">
00167 function ShowTva(p_sessid,ctl)
00168 {
00169 var win=window.open('show_tva.php?ctl='+ctl+'&PHPSESSID='+p_sessid,'Montre','scrollbar,toolbar=no,width=300,height=300,resizable=yes');
00170 }
00171 function GetIt(ctl,tva_id) {
00172 self.opener.SetValue(ctl,tva_id)
00173 window.close();
00174 }
00175
00176 </SCRIPT>"
00177 );
00178
00179 define ("JS_VIEW_JRN_DETAIL","<script language=\"javascript\">function viewDetail(p_value,p_sessid)
00180 {
00181 var win=window.open('jrn_op_detail.php?jrn_op='+p_value+'&PHPSESSID='+p_sessid,'Cherche','toolbar=no,width=400,height=400,scrollbars=yes,resizable=yes');
00182 }
00183
00184 </script>");
00185 define ("JS_VIEW_JRN_CANCEL","<script language=\"javascript\" >function cancelOperation(p_value,p_sessid,p_jrn)
00186 {
00187 var win=window.open('annulation.php?p_jrn='+p_jrn+'&jrn_op='+p_value+'&PHPSESSID='+p_sessid,'Annule','toolbar=no,width=400,height=400,scrollbars=yes,resizable=yes');
00188 }
00189 function RefreshMe() {
00190 window.location.reload();
00191 }
00192 </script>");
00193 define ("JS_VIEW_JRN_MODIFY","<script language=\"javascript\">function modifyOperation(p_value,p_sessid,p_jrn)
00194 {
00195 var win=window.open('modify_op.php?action=update&p_jrn='+p_jrn+'&line='+p_value+'&PHPSESSID='+p_sessid,'Modifie','toolbar=no,width=500,height=400,scrollbars=yes,resizable=yes');
00196 }
00197 function RefreshMe() {
00198 window.location.reload();
00199 }
00200 function dropLink(p_value,p_value2,p_sessid) {
00201 var win=window.open('modify_op.php?action=delete&line='+p_value+'&line2='+p_value2+'&PHPSESSID='+p_sessid,'Liaison','toolbar=no,width=500,height=400,scrollbars=yes,resizable=yes');
00202 }
00203
00204
00205 </script>");
00206 define ("JS_UPDATE_PCMN","<script language=\"javascript\">function PcmnUpdate(p_value,p_lib,p_parent,p_sessid)
00207 {
00208 var win=window.open('line_update.php?l='+p_value+'&n='+p_lib+'&p='+p_parent+'&PHPSESSID='+p_sessid,'Modifie','toolbar=no,width=500,height=400,scrollbars=yes,resizable=yes');
00209 }
00210 function RefreshMe() {
00211 window.location.reload();
00212 }
00213
00214
00215 </script>");
00216
00217 define ("JS_SEARCH_CARD","
00218 <script language=\"javascript\">
00219 /* type must be cred or deb and name is
00220 * the control's name
00221 */
00222 function SearchCard(p_sessid,type,name,jrn)
00223 {
00224 var a=window.open('fiche_search.php?p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name,'item','toolbar=no,width=350,height=450,scrollbars=yes');
00225 }
00226 function NewCard(p_sessid,type,name,jrn)
00227 {
00228 var a=window.open('fiche_new.php?p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name,'item','toolbar=no,width=350,height=450,scrollbars=yes');
00229 }
00230 /* SetValue( p_ctl,p_value )
00231 /* p_ctl is the name of the control
00232 /* p_value is the value to set in
00233 */
00234 function SetValue(p_ctl,p_value)
00235 {
00236
00237 var f=document.getElementsByName(p_ctl);
00238 for (var h=0; h < f.length; h++) {
00239 f[h].value=p_value;
00240 }
00241
00242
00243 }
00244 /* Parameters
00245 * i = ctl _name
00246 * p_id = code id (fiche.f_id)
00247 *¨p_label = label
00248 * p_sell vw_fiche_attr.vw_sell
00249 * p_buy vw_fiche_attr.vw_buy
00250 * p_tva_id vw_fiche_attr.tva_id
00251 * p_tva_label vw_fiche_attr.tva_label
00252 */
00253 function SetData(i,p_id,p_label,p_sell,p_buy,p_tva_id, p_tva_label)
00254 {
00255 SetValue(i,p_id);
00256 // for the form we use 1. and for span 2.
00257 //1. document.form_detail.eval(a).value=p_buy;
00258 //2. document.getElementById(a).innerHTML=p_sell;
00259
00260 // Compute name of label ctl
00261 var a=i+'_label';
00262 document.getElementById(a).innerHTML=p_label;
00263
00264 // Compute name of sell ctl
00265 var a=i+'_sell';
00266 // if the object exist
00267 var e=document.getElementsByName(a)
00268 if ( e.length != 0 ) {
00269 SetValue(a,p_sell);
00270
00271 }
00272
00273 // Compute name of buy ctl
00274 var a=i+'_buy';
00275 // if the object exist
00276 var e=document.getElementsByName(a)
00277 if ( e.length != 0 ) {
00278 SetValue(a,p_buy);
00279 }
00280 // Compute name of tva_id ctl
00281 var a=i+'_tva_id';
00282 // if the object exist
00283 var e=document.getElementsByName(a)
00284 if ( e.length != 0 ) {
00285 SetValue(a,p_tva_id);
00286 }
00287
00288 // Compute name of tva_label ctl
00289 var a=i+'_tva_label';
00290 // if the object exist
00291 if (document.getElementById(a) ) {
00292 document.getElementById(a).innerHTML=p_tva_label;
00293 }
00294 }
00295
00296
00297 </script>
00298
00299
00300 ");
00301
00302 define ("JS_CONCERNED_OP","
00303 <script language=\"javascript\">
00304
00305 function SearchJrn(p_sessid,p_ctl)
00306 {
00307 var win=window.open('jrn_search.php?p_ctl='+p_ctl+'&PHPSESSID='+p_sessid,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes');
00308 }
00309 function GetIt(p_ctl,p_value) {
00310 self.opener.SetIt(p_value,p_ctl);
00311 window.close();
00312 }
00313 /* SetValue( p_ctl,p_value )
00314 /* p_ctl is the name of the control
00315 /* p_value is the value to set in
00316 */
00317 function SetIt(p_value,p_ctl) {
00318
00319 var f=document.getElementsByName(p_ctl);
00320 for (var h=0; h < f.length; h++) {
00321 f[h].value=p_value;
00322 }
00323
00324
00325 }
00326
00327
00328 </script>
00329 ");
00330
00331 define ("JS_CALC_LINE","
00332
00333 <form name=\"calc_line\" onSubmit=\"cal()\">
00334 <input type=\"text\" size=\"20\" name=\"calculator\" onBlur=\"cal()\">
00335 Answer:<span id=\"name\"></span>
00336 <br>
00337
00338 <!-- <input type=\"button\" name=\"B1\" value=\"Calculate\" > -->
00339
00340 <input type=\"reset\" name=\"B2\" value=\"Reset\"><br>
00341
00342
00343 </form>
00344 <SCRIPT language=\"javascript\">
00345
00346 function cal()
00347 {
00348 document.getElementById(\"name\").innerHTML=
00349 eval(document.calc_line.calculator.value)
00350 }
00351 </script>
00352
00353
00354
00355 "
00356 );
00357
00358 define ("JS_TVA","<script language=\"javascript\">
00359
00360 function ChangeTVA(p_ctl,p_value) {
00361 if (document.getElementById(p_ctl) ) {
00362 var f=document.getElementsByName(p_value);
00363 for ( var i=0; i < f.length ; i++) {
00364 document.getElementById(p_ctl).innerHTML=f[i].value;
00365 }
00366 }
00367 }
00368
00369 </script>");
00370
00371 define ("SQL_LIST_ALL_INVOICE","");
00372
00373 define ("SQL_LIST_UNPAID_INVOICE"," where (jr_rapt is null or jr_rapt = '') and jr_valid = true ");
00374 define ("SQL_LIST_UNPAID_INVOICE_DATE_LIMIT" ," where (jr_rapt is null or jr_rapt = '')
00375 and to_date(to_char(jr_ech,'DD.MM.YYYY'),'DD.MM.YYYY') < to_date(to_char(now(),'DD.MM.YYYY'),'DD.MM.YYYY') and jr_valid = true" );
00376 ?>