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
00064 define("SEC_ACTION", 28);
00065 define("CLIENT",22);
00066 define("SUPPL",24);
00067 define("ADMIN",26);
00068 define("SEC_GESTION",30);
00069
00070 define ("FICHE_WRITE",15);
00071 define ("STOCK_WRITE",16);
00072 define ("STOCK_READ",17);
00073 define ("EXP_IMP_ECR",21);
00074 define ("IMP_BQE",22);
00075
00076 define ("NOERROR",0);
00077 define ("BADPARM",1);
00078 define ("BADDATE",2);
00079 define ("NOTPERIODE",3);
00080 define ("PERIODCLOSED",4);
00081 define ("INVALID_ECH",5);
00082 define ("RAPPT_ALREADY_USED",6);
00083 define ("RAPPT_NOT_EXIST",7);
00084 define ("DIFF_AMOUNT",8);
00085 define ("RAPPT_NOMATCH_AMOUNT",9);
00086 define ("NO_PERIOD_SELECTED",10);
00087 define ("NO_POST_SELECTED",11);
00088 define ("LAST",1);
00089 define ("FIRST",0);
00090 define ("ERROR",12);
00091
00093 define('ACTION','1,5,6,7,8');
00094
00095
00096 define ("YES",1);
00097 define ("NO",0);
00098 define ("OPEN",1);
00099 define ("CLOSED",0);
00100 define ("NOTCENTRALIZED",3);
00101 define ("ALL",4);
00102
00103
00104 define ("MENU_FACT",1);
00105 define ("MENU_FICHE",2);
00106 define ("MENU_PARAM",3);
00107
00108
00109 define ("ALL_FICHE_DEF_REF", 1000);
00110
00111
00112 define ("ATTR_DEF_ACCOUNT",5);
00113 define ("ATTR_DEF_NAME",1);
00114 define ("ATTR_DEF_PRIX_ACHAT",7);
00115 define ("ATTR_DEF_PRIX_VENTE",6);
00116 define ("ATTR_DEF_TVA",2);
00117 define ("ATTR_DEF_NUMTVA",13);
00118 define ("ATTR_DEF_ADRESS",14);
00119 define ("ATTR_DEF_CP",15);
00120 define ("ATTR_DEF_PAYS",16);
00121 define ("ATTR_DEF_STOCK",19);
00122 define ("ATTR_DEF_TEL",17);
00123 define ("ATTR_DEF_EMAIL",18);
00124 define ("ATTR_DEF_COMPANY",25);
00125 define ("ATTR_DEF_FAX",26);
00126
00127
00128 define ("FICHE_TYPE_CLIENT",9);
00129 define ("FICHE_TYPE_VENTE",1);
00130 define ("FICHE_TYPE_FOURNISSEUR",8);
00131 define ("FICHE_TYPE_FIN",4);
00132 define ("FICHE_TYPE_CONTACT",16);
00133 define ("FICHE_TYPE_ADM_TAX",14);
00134 define ("ATTR_DEF_DEPENSE_NON_DEDUCTIBLE",20);
00135 define ("ATTR_DEF_TVA_NON_DEDUCTIBLE",21);
00136 define ("ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP",22);
00137 define ("ATTR_DEF_QUICKCODE",23);
00138 define ("JS_SEARCH_POSTE","<SCRIPT language=\"javascript\">function SearchPoste(p_sessid,p_ctl,p_jrn)
00139 {
00140 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');
00141 }
00142 function SearchPosteFilter(p_sessid,p_ctl,p_filter,jrn)
00143 {
00144 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');
00145 }
00146 function GetIt() {
00147 window.close();
00148 }
00149 function SetItChild(p_ctl,p_value) {
00150 self.opener.SetItParent(p_ctl,p_value);
00151 window.close();
00152 }
00153 function SetItParent(p_ctl,p_value) {
00154
00155 var f=document.getElementsByName(p_ctl);
00156 for (var h=0; h < f.length; h++) {
00157 f[h].value=p_value;
00158 }
00159
00160 }
00161 /* SetValue( p_ctl,p_value )
00162 /* p_ctl is the name of the control
00163 /* p_value is the value to set in
00164 */
00165 function SetValue(p_ctl,p_value)
00166 {
00167
00168 var f=document.getElementsByName(p_ctl);
00169 for (var h=0; h < f.length; h++) {
00170 f[h].value=p_value;
00171 }
00172
00173
00174 }
00175 </SCRIPT>"
00176 );
00177 define ("JS_SHOW_TVA","<SCRIPT language=\"javascript\">
00178 function ShowTva(p_sessid,ctl)
00179 {
00180 var win=window.open('show_tva.php?ctl='+ctl+'&PHPSESSID='+p_sessid,'Montre','scrollbar,toolbar=no,width=300,height=300,resizable=yes');
00181 }
00182 function GetIt(ctl,tva_id) {
00183 self.opener.SetValue(ctl,tva_id)
00184 window.close();
00185 }
00186
00187 </SCRIPT>"
00188 );
00189
00190 define ("JS_VIEW_JRN_DETAIL","<script language=\"javascript\">function viewDetail(p_value,p_sessid)
00191 {
00192 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');
00193 }
00194
00195 </script>");
00196 define ("JS_VIEW_JRN_CANCEL","<script language=\"javascript\" >function cancelOperation(p_value,p_sessid,p_jrn)
00197 {
00198 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');
00199 }
00200 function RefreshMe() {
00201 window.location.reload();
00202 }
00203 </script>");
00204 define ("JS_VIEW_JRN_MODIFY","<script language=\"javascript\">function modifyOperation(p_value,p_sessid,p_jrn)
00205 {
00206 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');
00207 }
00208 function RefreshMe() {
00209 window.location.reload();
00210 }
00211 function dropLink(p_value,p_value2,p_sessid) {
00212 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');
00213 }
00214
00215
00216 </script>");
00217 define ("JS_UPDATE_PCMN","<script language=\"javascript\">function PcmnUpdate(p_value,p_lib,p_parent,p_sessid)
00218 {
00219 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');
00220 }
00221 function RefreshMe() {
00222 window.location.reload();
00223 }
00224
00225
00226 </script>");
00227
00228 define ("JS_SEARCH_CARD","
00229 <script language=\"javascript\">
00230 function showfiche(p_sessid,qcode)
00231 {
00232 var a=window.open('show_fiche.php?PHPSESSID='+p_sessid+'&q='+qcode,'','toolbar=no,width=350,height=450,scrollbar=yes');
00233
00234 }
00235
00236 /* type must be cred or deb and name is
00237 * the control's name
00238 */
00239 function SearchCard(p_sessid,type,name,jrn)
00240 {
00241 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');
00242 }
00243 function NewCard(p_sessid,type,name,jrn)
00244 {
00245 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');
00246 }
00247 /* SetValue( p_ctl,p_value )
00248 /* p_ctl is the name of the control
00249 /* p_value is the value to set in
00250 */
00251 function SetValue(p_ctl,p_value)
00252 {
00253
00254 var f=document.getElementsByName(p_ctl);
00255 for (var h=0; h < f.length; h++) {
00256 f[h].value=p_value;
00257 }
00258
00259
00260 }
00261 /* Parameters
00262 * i = ctl _name
00263 * p_id = code id (fiche.f_id)
00264 *¨p_label = label
00265 * p_sell vw_fiche_attr.vw_sell
00266 * p_buy vw_fiche_attr.vw_buy
00267 * p_tva_id vw_fiche_attr.tva_id
00268 * p_tva_label vw_fiche_attr.tva_label
00269 */
00270 function SetData(i,p_id,p_label,p_sell,p_buy,p_tva_id, p_tva_label)
00271 {
00272 SetValue(i,p_id);
00273 // for the form we use 1. and for span 2.
00274 //1. document.form_detail.eval(a).value=p_buy;
00275 //2. document.getElementById(a).innerHTML=p_sell;
00276
00277 // Compute name of label ctl
00278 var a=i+'_label';
00279 document.getElementById(a).innerHTML=p_label;
00280
00281 // Compute name of sell ctl
00282 var a=i+'_sell';
00283 // if the object exist
00284 var e=document.getElementsByName(a)
00285 if ( e.length != 0 ) {
00286 SetValue(a,p_sell);
00287
00288 }
00289
00290 // Compute name of buy ctl
00291 var a=i+'_buy';
00292 // if the object exist
00293 var e=document.getElementsByName(a)
00294 if ( e.length != 0 ) {
00295 SetValue(a,p_buy);
00296 }
00297 // Compute name of tva_id ctl
00298 var a=i+'_tva_id';
00299 // if the object exist
00300 var e=document.getElementsByName(a)
00301 if ( e.length != 0 ) {
00302 SetValue(a,p_tva_id);
00303 }
00304
00305 // Compute name of tva_label ctl
00306 var a=i+'_tva_label';
00307 // if the object exist
00308 if (document.getElementById(a) ) {
00309 document.getElementById(a).innerHTML=p_tva_label;
00310 }
00311 }
00312
00313
00314 </script>
00315
00316
00317 ");
00318
00319 define ("JS_CONCERNED_OP","
00320 <script language=\"javascript\">
00321
00322 function SearchJrn(p_sessid,p_ctl)
00323 {
00324 var win=window.open('jrn_search.php?p_ctl='+p_ctl+'&PHPSESSID='+p_sessid,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes');
00325 }
00326 function GetIt(p_ctl,p_value) {
00327 self.opener.SetIt(p_value,p_ctl);
00328 window.close();
00329 }
00330 /* SetValue( p_ctl,p_value )
00331 /* p_ctl is the name of the control
00332 /* p_value is the value to set in
00333 */
00334 function SetIt(p_value,p_ctl) {
00335
00336 var f=document.getElementsByName(p_ctl);
00337 for (var h=0; h < f.length; h++) {
00338 f[h].value=p_value;
00339 }
00340
00341
00342 }
00343
00344
00345 </script>
00346 ");
00347
00348 define ("JS_CALC_LINE",'
00349 <div style="border:outset black 3px; position:float; float:right;background-color:white;font-family:sans-serif;font-size:9pt;">
00350 <script type="text/javascript" language="javascript" src="js/calc.js">
00351 </script>
00352 <h2 class="info"> Calculette</H2>
00353 <form name="calc_line" method="GET" onSubmit="cal();return false;" >
00354 <input style="border:solid 1px;" type="text" size="30" id="inp" name="calculator">
00355 <input type="button" value="Efface tout" onClick="Clean();return false;" >
00356 </form>
00357 <span id="result"> </span><br>
00358 <span id="sub_total"> Taper un montant puis enter puis le signe et terminer par = </span><br>
00359 <span id="listing"> </span>
00360 <br>
00361 </div>
00362 '
00363 );
00364
00365 define ("JS_TVA","<script language=\"javascript\">
00366
00367 function ChangeTVA(p_ctl,p_value) {
00368 if (document.getElementById(p_ctl) ) {
00369 var f=document.getElementsByName(p_value);
00370 for ( var i=0; i < f.length ; i++) {
00371 document.getElementById(p_ctl).innerHTML=f[i].value;
00372 }
00373 }
00374 }
00375
00376 </script>");
00377
00378 define ("SQL_LIST_ALL_INVOICE","");
00379
00380 define ("SQL_LIST_UNPAID_INVOICE"," where (jr_rapt is null or jr_rapt = '') and jr_valid = true ");
00381 define ("SQL_LIST_UNPAID_INVOICE_DATE_LIMIT" ," where (jr_rapt is null or jr_rapt = '')
00382 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" );
00383 ?>