Changeset 184
- Timestamp:
- 02/15/07 17:55:42 (5 years ago)
- Location:
- trunk/phpbms
- Files:
-
- 6 added
- 34 modified
-
advancedsearch.php (modified) (2 diffs)
-
advancedsort.php (modified) (2 diffs)
-
common/javascript/fields.js (modified) (1 diff)
-
common/stylesheet/mozilla/pages/invoice.css (modified) (1 diff)
-
common/stylesheet/mozilla/pages/invoicestatuses.css (added)
-
common/stylesheet/mozilla/pages/invoicestatushistory.css (added)
-
include/common_functions.php (modified) (1 diff)
-
include/fields.php (modified) (2 diffs)
-
include/login_include.php (modified) (1 diff)
-
include/print_class.php (modified) (1 diff)
-
include/search_class.php (modified) (4 diffs)
-
index.php (modified) (1 diff)
-
loadsearch.php (modified) (1 diff)
-
modules/base/notes_addedit.php (modified) (3 diffs)
-
modules/bms/clients_email.php (modified) (1 diff)
-
modules/bms/clients_purchasehistory.php (modified) (3 diffs)
-
modules/bms/include/invoicestatuses_addedit_include.php (added)
-
modules/bms/include/invoicestatuses_search_functions.php (added)
-
modules/bms/include/invoices_addedit_include.php (modified) (16 diffs)
-
modules/bms/include/invoices_functions.php (modified) (1 diff)
-
modules/bms/include/invoices_search_functions.php (modified) (5 diffs)
-
modules/bms/install/createtables.sql (modified) (1 diff)
-
modules/bms/install/menu.sql (modified) (1 diff)
-
modules/bms/install/tablecolumns.sql (modified) (1 diff)
-
modules/bms/install/tabledefs.sql (modified) (2 diffs)
-
modules/bms/install/tablefindoptions.sql (modified) (2 diffs)
-
modules/bms/install/tableoptions.sql (modified) (1 diff)
-
modules/bms/install/tablesearchablefields.sql (modified) (1 diff)
-
modules/bms/install/update.php (modified) (2 diffs)
-
modules/bms/install/updatev0.70.sql (modified) (1 diff)
-
modules/bms/invoicestatuses_addedit.php (added)
-
modules/bms/invoices_addedit.php (modified) (4 diffs)
-
modules/bms/invoices_lineitem_ajax.php (modified) (1 diff)
-
modules/bms/invoices_statushistory.php (added)
-
modules/bms/javascript/invoice.js (modified) (3 diffs)
-
modules/bms/products_addedit.php (modified) (3 diffs)
-
modules/bms/products_saleshistory.php (modified) (1 diff)
-
modules/bms/report/invoices_totals.php (modified) (1 diff)
-
modules/bms/snapshot.php (modified) (1 diff)
-
print.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/advancedsearch.php
r145 r184 59 59 </p> 60 60 61 <p>match <select id="ASanyall" on Change="updateAS()">61 <p>match <select id="ASanyall" onchange="updateAS()"> 62 62 <option value="and" selected="selected">all</option> 63 63 <option value="or">any</option> … … 65 65 <div id="theASCs"> 66 66 <div id="ASC1"> 67 <select id="ASC1field" on Change="updateAS()">67 <select id="ASC1field" onchange="updateAS()"> 68 68 <?php 69 69 foreach($fieldlist as $field){ 70 70 echo "<option value=\"".$field."\" >".$field."</option>\n";}?> 71 71 </select> 72 <select id="ASC1operator" on Change="updateAS()">72 <select id="ASC1operator" onchange="updateAS()"> 73 73 <option value="=" selected="selected">=</option> 74 74 <option value="!=">!=</option> -
trunk/phpbms/advancedsort.php
r155 r184 63 63 $numrows=mysql_num_rows($queryresult); 64 64 ?> 65 <select id="sortSavedList" name="sortSavedList" <?php if ($numrows<1) echo "disabled" ?> size="10" style="width:99%" on Change="sortSavedSelect(this)" />65 <select id="sortSavedList" name="sortSavedList" <?php if ($numrows<1) echo "disabled" ?> size="10" style="width:99%" onchange="sortSavedSelect(this)" /> 66 66 <?php if($numrows<1) {?> 67 67 <option value="NA">No Saved Sorts</option> … … 144 144 <div id="theSorts"> 145 145 <div id="Sort1"> 146 <select id="Sort1Field" on Change="updateSort()">146 <select id="Sort1Field" onchange="updateSort()"> 147 147 <?php 148 148 foreach($fieldlist as $field){ 149 149 echo "<option value=\"".$field."\" >".$field."</option>\n";}?> 150 150 </select> 151 <select id="Sort1Order" on Change="updateSort()">151 <select id="Sort1Order" onchange="updateSort()"> 152 152 <option value="ASC" selected="selected">Ascending</option> 153 153 <option value="DESC">Descending</option> -
trunk/phpbms/common/javascript/fields.js
r145 r184 271 271 theitem.value=formatCurrency(thenumber); 272 272 273 //in case the field has an additional on Change code to be run273 //in case the field has an additional onchange code to be run 274 274 if (theitem.thechange) theitem.thechange(); 275 275 } -
trunk/phpbms/common/stylesheet/mozilla/pages/invoice.css
r176 r184 17 17 #printButton input{width:75px;} 18 18 19 #fsAttributes{clear:both;float:right;width:2 50px;}19 #fsAttributes{clear:both;float:right;width:260px;} 20 20 #attributesRight{float:right;padding-top:0px;} 21 21 #type{width:90px} 22 #leadsource{width:98%} 22 #leadsource,#statusid{width:98%} 23 #ds-assignedtoid{width:99%} 23 24 24 #fsTops{margin-right:275px;} 25 26 #fsTops{margin-right:270px;} 25 27 #address1{margin-bottom:2px;} 26 28 .cszP{float:left;} -
trunk/phpbms/include/common_functions.php
r177 r184 206 206 207 207 function addSlashesToArray($thearray){ 208 if(!get_magic_quotes_runtime() && !get_magic_quotes_gpc()) 209 foreach($thearray as $key=>$value) 210 $thearray[$key]=addslashes($value); 208 if(get_magic_quotes_runtime() || get_magic_quotes_gpc()) 209 foreach ($thearray as $key=>$value) 210 $thearray[$key] = stripslashes($value); 211 212 foreach ($thearray as $key=>$value) 213 $thearray[$key] = mysql_real_escape_string($value); 214 211 215 return $thearray; 212 216 } -
trunk/phpbms/include/fields.php
r176 r184 268 268 if(is_numeric($value)) $value=$value."%"; 269 269 ?><input name="<?php echo $name?>" id="<?php echo $name?>" type="text" value="<?php echo $value?>" <?php 270 if ($attributes) foreach($attributes as $attribute => $tvalue) if($attribute!="on Change") echo " ".$attribute."=\"".$tvalue."\"";271 ?> onchange="validatePercentage(this,<?php echo $precision ?>);<?php if(isset($attributes["on Change"])) echo $attributes["onChange"] ?>" style="text-align:right;" /><?php270 if ($attributes) foreach($attributes as $attribute => $tvalue) if($attribute!="onchange") echo " ".$attribute."=\"".$tvalue."\""; 271 ?> onchange="validatePercentage(this,<?php echo $precision ?>);<?php if(isset($attributes["onchange"])) echo $attributes["onchange"] ?>" style="text-align:right;" /><?php 272 272 if ($required) {?><script language="JavaScript" type="text/javascript">requiredArray[requiredArray.length]=new Array('<?php echo $name?>','<?php echo $message?>');</script><?php }//end required if 273 273 } … … 287 287 if ($attributes) 288 288 foreach($attributes as $attribute => $tvalue) 289 if($attribute!="on Change")289 if($attribute!="onchange") 290 290 echo " ".$attribute."=\"".$tvalue."\""; 291 ?> onchange="formatDateField(this);<?php if(isset($attributes["on Change"])) echo $attributes["onChange"]?>" /><button id="<?php echo $name?>Button" type="button" class="graphicButtons buttonDate" onclick="showDP('<?php echo $_SESSION["app_path"]?>','<?php echo $name?>');"><span>pick date</span></button>291 ?> onchange="formatDateField(this);<?php if(isset($attributes["onchange"])) echo $attributes["onchange"]?>" /><button id="<?php echo $name?>Button" type="button" class="graphicButtons buttonDate" onclick="showDP('<?php echo $_SESSION["app_path"]?>','<?php echo $name?>');"><span>pick date</span></button> 292 292 <?php if ($required) {?><script language="JavaScript" type="text/javascript">requiredArray[requiredArray.length]=new Array('<?php echo $name?>','<?php echo $message?>');</script><?php }//end if 293 293 ?><script language="JavaScript" type="text/javascript">dateArray[dateArray.length]=new Array('<?php echo $name?>','<?php echo $message?>');</script><?php -
trunk/phpbms/include/login_include.php
r170 r184 42 42 $querystatement="SELECT id, firstname, lastname, email, phone, department, employeenumber, admin 43 43 FROM users 44 WHERE login=\"". $username."\" and password=ENCODE(\"".$password."\",\"".$seed."\") and revoked=0 and portalaccess=0";44 WHERE login=\"".mysql_real_escape_string($username)."\" and password=ENCODE(\"".mysql_real_escape_string($password)."\",\"".mysql_real_escape_string($seed)."\") and revoked=0 and portalaccess=0"; 45 45 $queryresult=mysql_query($querystatement,$dblink); 46 46 if(!$queryresult) reportError(300,"Error verifing user record: ".$querystatement); -
trunk/phpbms/include/print_class.php
r170 r184 177 177 178 178 ?> 179 <select name="singlefield" on Change="checkForCustom(this.value)">179 <select name="singlefield" onchange="checkForCustom(this.value)"> 180 180 <?php 181 181 foreach($fieldlist as $field){ -
trunk/phpbms/include/search_class.php
r177 r184 530 530 echo "<div>records: ".$this->numrows."</div>"; 531 531 else {?> 532 <input name="offset" type="hidden" value=""><select name="offsetselector" on Change="this.form.offset.value=this.value;this.form.submit();">532 <input name="offset" type="hidden" value=""><select name="offsetselector" onchange="this.form.offset.value=this.value;this.form.submit();"> 533 533 <?php 534 534 $displayedoffset=0; … … 569 569 570 570 if($this->tableoptions["othercommands"] || ($this->thetabledef["deletebutton"] != "delete" && $this->thetabledef["deletebutton"] != "NA") ){?> 571 <select id="othercommands" name="othercommands" disabled=true on Change="chooseOtherCommand(this)">571 <select id="othercommands" name="othercommands" disabled=true onchange="chooseOtherCommand(this)"> 572 572 <option value="" selected class="choiceListBlank">commands...</option> 573 573 <?php if($this->thetabledef["deletebutton"] != "delete" && $this->thetabledef["deletebutton"] != "NA") {?> … … 583 583 ?></select><?php 584 584 } 585 if($this->tableoptions["select"]["allowed"] && hasRights($this->tableoptions["select"]["roleid"])){?> <select id="searchSelection" on Change="perfromToSelection(this)">585 if($this->tableoptions["select"]["allowed"] && hasRights($this->tableoptions["select"]["roleid"])){?> <select id="searchSelection" onchange="perfromToSelection(this)"> 586 586 <option class="choiceListBlank" value="">selection...</option> 587 587 <option value="">_____________</option> … … 634 634 if (mysql_num_rows($queryresult)) { 635 635 ?><div class="small box" style="margin:0px;margin-top:3px;"> 636 relate selected records to <select id="relationship" name="relationship" on Change="setSelIDs(this.form);this.form.submit();" disabled="true">636 relate selected records to <select id="relationship" name="relationship" onchange="setSelIDs(this.form);this.form.submit();" disabled="true"> 637 637 <option value="" selected class="choiceListBlank">area...</option><?php 638 638 while($therecord = mysql_fetch_array($queryresult)){ -
trunk/phpbms/index.php
r155 r184 65 65 <p> 66 66 <label for="username">name</label><br /> 67 <input name="name" type="text" id="username" size="25" maxlength="64" value="<?php echo $_POST["name"]?>"/>67 <input name="name" type="text" id="username" size="25" maxlength="64" value="<?php echo htmlQuotes($_POST["name"])?>"/> 68 68 </p> 69 69 -
trunk/phpbms/loadsearch.php
r170 r184 81 81 $numrows=mysql_num_rows($queryresult); 82 82 ?> 83 <select id="LSList" name="LSList" <?php if ($numrows<1) echo "disabled" ?> size="10" style="width:170px;height:160px;" on Change="LSsearchSelect(this,'<?php echo $basepath ?>')">83 <select id="LSList" name="LSList" <?php if ($numrows<1) echo "disabled" ?> size="10" style="width:170px;height:160px;" onchange="LSsearchSelect(this,'<?php echo $basepath ?>')"> 84 84 <?php if($numrows<1) {?> 85 85 <option value="NA">No Saved Searches</option> -
trunk/phpbms/modules/base/notes_addedit.php
r170 r184 79 79 <p> 80 80 <label for="type" class="important">type</label><br /> 81 <?php basic_choicelist("thetype",$therecord["type"],array(array("value"=>"NT","name"=>"Note"),array("value"=>"TS","name"=>"Task"),array("value"=>"EV","name"=>"Event"),array("value"=>"SM","name"=>"System Message")),Array("class"=>"important","on Change"=>"changeType();"));?>81 <?php basic_choicelist("thetype",$therecord["type"],array(array("value"=>"NT","name"=>"Note"),array("value"=>"TS","name"=>"Task"),array("value"=>"EV","name"=>"Event"),array("value"=>"SM","name"=>"System Message")),Array("class"=>"important","onchange"=>"changeType();"));?> 82 82 <input type="hidden" id="typeCheck" name="typeCheck" value="<?php echo $therecord["type"]?>" /> 83 83 </p> … … 103 103 <label for="startdate" id="starttext">start</label><br /> 104 104 <input name="dostart" id="startcheck" type="checkbox" value="1" <?php if($therecord["startdate"]) echo "checked" ?> onClick="dateChecked('start')" class="radiochecks" /> 105 <?php field_datepicker("startdate",$therecord["startdate"],0,"",Array("size"=>"11","maxlength"=>"15","on Change"=>"checkEndDate();setEnglishDates()"));?>106 <?php field_timepicker("starttime",$therecord["starttime"],0,"",Array("size"=>"11","maxlength"=>"15","on Change"=>"checkEndDate()"));?>105 <?php field_datepicker("startdate",$therecord["startdate"],0,"",Array("size"=>"11","maxlength"=>"15","onchange"=>"checkEndDate();setEnglishDates()"));?> 106 <?php field_timepicker("starttime",$therecord["starttime"],0,"",Array("size"=>"11","maxlength"=>"15","onchange"=>"checkEndDate()"));?> 107 107 </p> 108 108 <p> … … 209 209 if($therecord["repeatfrequency"]>1) $plural="s"; 210 210 ?> 211 <select id="repeattype" name="repeattype" on Change="changeRepeatType();">211 <select id="repeattype" name="repeattype" onchange="changeRepeatType();"> 212 212 <option value="Daily" <?php if ($therecord["repeattype"]=="repeatDaily") echo "selected"?>>Day<?php echo $plural?></option> 213 213 <option value="Weekly" <?php if ($therecord["repeattype"]=="repeatWeekly") echo "selected"?>>Week<?php echo $plural?></option> -
trunk/phpbms/modules/bms/clients_email.php
r166 r184 131 131 <p id="toP"> 132 132 <label for="therecords">to</label><br /> 133 <select id="therecords" name="therecords" on Change="showSavedSearches(this);">133 <select id="therecords" name="therecords" onchange="showSavedSearches(this);"> 134 134 <option value="selected" <?php if ($therecord["emailto"]=="selected") echo "selected"?>>e-mail addresses from selected records (<?php echo count($_SESSION["emailids"]) ?> record<?php if(count($_SESSION["emailids"])>1) echo "s"?>)</option> 135 135 <option value="savedsearch" <?php if ($therecord["emailto"]!="selected" AND $therecord["emailto"]!="all") echo "selected"?>>e-mail addresses from saved search...</option> -
trunk/phpbms/modules/bms/clients_purchasehistory.php
r161 r184 119 119 </head> 120 120 <body><?php include("../../menu.php")?> 121 <?php client_tabs("Purchase History",$_GET["id"]);?><div class="bodyline" style="padding:4px;">121 <?php client_tabs("Purchase History",$_GET["id"]);?><div class="bodyline"> 122 122 <h1><?php echo $pageTitle ?></h1> 123 123 … … 125 125 <div class="box"> 126 126 <p class="timelineP"> 127 <label for="status"> invoice status</label><br />127 <label for="status">type</label><br /> 128 128 <select name="status" id="status"> 129 129 <option value="Orders/Invoices" <?php if($_POST["status"]=="Orders/Invoices") echo "selected"?>>Orders/Invoices</option> … … 171 171 ?> 172 172 <tr class="row<?php echo $row?>"> 173 <td style="padding:0px;margin:0px;" nowrap>173 <td > 174 174 <button type="button" class="invisibleButtons" onClick="location.href='<?php echo getAddEditFile(3) ?>?id=<?php echo $therecord["id"]?>'"><img src="<?php echo $_SESSION["app_path"] ?>common/stylesheet/<?php echo $_SESSION["stylesheet"] ?>/image/button-edit.png" align="middle" alt="edit" width="16" height="16" border="0" /></button> 175 175 </td> -
trunk/phpbms/modules/bms/include/invoices_addedit_include.php
r176 r184 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 function updateStatus($invoiceid,$statusid,$statusdate,$assignedtoid,$dblink){ 40 $querystatement="DELETE FROM invoicestatushistory WHERE invoiceid=".$invoiceid." AND invoicestatusid=".$statusid; 41 $queryresult=mysql_query($querystatement,$dblink); 42 if(!$queryresult) reportError(300,"Error Updating Status History: deleteing<br />".mysql_error($dblink)); 43 44 $querystatement="INSERT INTO invoicestatushistory (invoiceid,invoicestatusid,statusdate,assignedtoid) values("; 45 $querystatement.=((int) $invoiceid).", "; 46 $querystatement.=((int) $statusid).", "; 47 48 if($statusdate=="" || $statusdate=="0/0/0000") $tempdate="NULL"; 49 else{ 50 $sd="/".ereg_replace(",.","/",$statusdate); 51 $temparray=explode("/",$sd); 52 $tempdate="\"".$temparray[3]."-".$temparray[1]."-".$temparray[2]."\""; 53 } 54 $querystatement.=$tempdate.","; 55 if($assignedtoid=="") 56 $querystatement.="NULL"; 57 else 58 $querystatement.=((int) $assignedtoid); 59 60 $querystatement.=")"; 61 62 $queryresult=mysql_query($querystatement,$dblink); 63 if(!$queryresult) reportError(300,"Error Updating Status History: inserting<br />".mysql_error($dblink)); 64 } 65 39 66 function showPaymentSelect($id,$paymentMethods){ 40 67 ?><select name="paymentmethodid" id="paymentmethodid" onchange="showPaymentOptions()"> … … 233 260 } 234 261 262 function getDefaultStatus(){ 263 global $dblink; 264 265 $querystatement="SELECT id FROM invoicestatuses WHERE invoicedefault=1"; 266 $queryresult=mysql_query($querystatement,$dblink); 267 if(!$queryresult) reportError(100,"Could Not Retrieve Stauts Default: ".mysql_error($dblink)."<br /><br />".$querystatement); 268 $therecord=mysql_fetch_array($queryresult); 269 270 return $therecord["id"]; 271 } 272 273 function displayStatusDropDown($statusid,$dblink){ 274 $querystatement="SELECT invoicestatuses.id,invoicestatuses.name,invoicestatuses.invoicedefault,users.firstname,users.lastname FROM 275 (invoicestatuses LEFT JOIN users ON invoicestatuses.defaultassignedtoid=users.id)WHERE invoicestatuses.inactive=0 276 ORDER BY invoicestatuses.priority,invoicestatuses.name"; 277 $queryresult=mysql_query($querystatement,$dblink); 278 if(!$queryresult) reportError(300,"Error Retrieving Statuses: ".mysql_error($dblink)); 279 ?><select id="statusid" name="statusid" onchange="updateAssignedTo();updateStatusDate()" class="important"> 280 <?php 281 $options=""; 282 while($therecord=mysql_fetch_array($queryresult)){ 283 if($therecord["firstname"]!="" || $therecord["lastname"]!="") 284 $options["s".$therecord["id"]]=trim($therecord["firstname"]." ".$therecord["lastname"]); 285 ?><option value="<?php echo $therecord["id"]?>" <?php if($statusid==$therecord["id"]) echo "selected=\"selected\""?>><?php echo $therecord["name"]?></option><?php 286 } 287 ?> 288 </select><script language="javascript" type="text/javascript">statusAssignedto=new Array;<?php 289 if($options!="") 290 foreach($options as $key=>$value){ 291 echo "statusAssignedto[\"".$key."\"] = \"".$value."\";\n"; 292 } 293 ?></script><?php 294 } 235 295 236 296 // These following functions and processing are similar for all pages … … 252 312 global $dblink; 253 313 254 $querystatement="SELECT id, clientid, status , type, totalweight, totaltni, totalti, totalcost,314 $querystatement="SELECT id, clientid, statusid, assignedtoid, type, totalweight, totaltni, totalti, totalcost, 255 315 leadsource, shippingmethodid, paymentmethodid, checkno, bankname, ccnumber, routingnumber, 256 316 accountnumber, transactionid, … … 261 321 date_Format(invoicedate,\"%c/%e/%Y\") as invoicedate, 262 322 date_Format(orderdate,\"%c/%e/%Y\") as orderdate, 263 date_Format(s hippeddate,\"%c/%e/%Y\") as shippeddate,323 date_Format(statusdate,\"%c/%e/%Y\") as statusdate, 264 324 ponumber, 265 325 date_Format(requireddate,\"%c/%e/%Y\") as requireddate, … … 293 353 $therecord["clientid"]=$_GET["cid"]; 294 354 $therecord["type"]="Order"; 295 $therecord["status"]="Open"; 355 $therecord["statusid"]=getDefaultStatus(); 356 $therecord["statusdate"]=date("n/d/Y"); 357 $therecord["assignedtoid"]=""; 296 358 297 359 $therecord["leadsource"]=""; … … 324 386 325 387 $therecord["weborder"]=0; 326 $therecord["shippeddate"]=NULL;327 388 $therecord["trackingno"]=""; 328 389 $therecord["webconfirmationno"]=""; … … 377 438 378 439 $querystatement.="type=\"".$variables["type"]."\", "; 379 $querystatement.="status=\"".$variables["status"]."\", "; 440 441 $querystatement.="statusid=".((int)$variables["statusid"]).", "; 442 $querystatement.="assignedtoid=".((int) $variables["assignedtoid"]).", "; 443 if($variables["statusdate"]=="" || $variables["statusdate"]=="0/0/0000") $tempdate="NULL"; 444 else{ 445 $statusdate="/".ereg_replace(",.","/",$variables["statusdate"]); 446 $temparray=explode("/",$statusdate); 447 $tempdate="\"".$temparray[3]."-".$temparray[1]."-".$temparray[2]."\""; 448 } 449 $querystatement.="statusdate=".$tempdate.", "; 450 380 451 381 452 if($variables["orderdate"]=="" || $variables["orderdate"]=="0/0/0000") $tempdate="NULL"; … … 399 470 } 400 471 //make sure there is an invoice date if the status is set to invoice!!! 401 if($variables[" status"]=="Invoice" && $tempdate=="NULL") $tempdate="Now()";472 if($variables["type"]=="Invoice" && $tempdate=="NULL") $tempdate="Now()"; 402 473 $querystatement.="invoicedate=".$tempdate.", "; 403 474 … … 428 499 $querystatement.="shippingmethodid=".$variables["shippingmethodid"].", "; 429 500 430 if($variables["shippeddate"]=="" || $variables["shippeddate"]=="0/0/0000")431 {$tempdate="NULL";}432 else{433 $shippeddate="/".ereg_replace(",.","/",$variables["shippeddate"]);434 $temparray=explode("/",$shippeddate);435 $tempdate="\"".$temparray[3]."-".$temparray[1]."-".$temparray[2]."\"";436 }437 $querystatement.="shippeddate=".$tempdate.", ";438 501 $querystatement.="trackingno=\"".$variables["trackingno"]."\", "; 439 502 … … 486 549 if($variables["lineitemschanged"]==1) 487 550 addLineItems($variables["thelineitems"],$variables["id"],$userid); 551 552 if($variables["statuschanged"]==1) 553 updateStatus($variables["id"],$variables["statusid"],$variables["statusdate"],$variables["assignedtoid"],$dblink); 488 554 489 555 return "Record Updated"; … … 495 561 global $dblink; 496 562 497 if($variables[" status"]=="VOID"){563 if($variables["type"]=="VOID"){ 498 564 $variables["totaltni"]=0; 499 565 $variables["totalti"]=0; … … 501 567 } 502 568 $querystatement="INSERT INTO invoices 503 (clientid,leadsource,type,status ,orderdate,discountamount,discountid,569 (clientid,leadsource,type,statusid,assignedtoid,statusdate,orderdate,discountamount,discountid, 504 570 invoicedate,address1,address2,city,state,postalcode, country, totaltni, totaltaxable, totalti,shipping,tax,amountpaid, 505 totalcost,totalweight,shippingmethodid, shippeddate,trackingno,paymentmethodid,accountnumber,routingnumber,transactionid,571 totalcost,totalweight,shippingmethodid,trackingno,paymentmethodid,accountnumber,routingnumber,transactionid, 506 572 checkno,bankname,ccnumber,ccexpiration,ccverification,specialinstructions,printedinstructions, 507 573 taxareaid, taxpercentage, weborder,webconfirmationno,ponumber,requireddate, … … 512 578 513 579 $querystatement.="\"".$variables["type"]."\", "; 514 $querystatement.="\"".$variables["status"]."\", "; 580 $querystatement.=((int)$variables["statusid"]).", "; 581 $querystatement.=((int) $variables["assignedtoid"]).", "; 582 if($variables["statusdate"]=="" || $variables["statusdate"]=="0/0/0000") $tempdate="NULL"; 583 else{ 584 $statusdate="/".ereg_replace(",.","/",$variables["statusdate"]); 585 $temparray=explode("/",$statusdate); 586 $tempdate="\"".$temparray[3]."-".$temparray[1]."-".$temparray[2]."\""; 587 } 588 $querystatement.=$tempdate.", "; 515 589 516 590 if($variables["orderdate"]=="" || $variables["orderdate"]=="0/0/0000") $tempdate="NULL"; … … 534 608 } 535 609 //make sure there is an invoice date if the status is set to invoice!!! 536 if($variables[" status"]=="Invoice" && $tempdate=="NULL") $tempdate="Now()";610 if($variables["type"]=="Invoice" && $tempdate=="NULL") $tempdate="Now()"; 537 611 $querystatement.=$tempdate.", "; 538 612 … … 563 637 $querystatement.=$variables["shippingmethodid"].", "; 564 638 565 if($variables["shippeddate"]=="" || $variables["shippeddate"]=="0/0/0000") $tempdate="NULL";566 else{567 $shippeddate="/".ereg_replace(",.","/",$variables["shippeddate"]);568 $temparray=explode("/",$shippeddate);569 $tempdate="\"".$temparray[3]."-".$temparray[1]."-".$temparray[2]."\"";570 }571 $querystatement.=$tempdate.", ";572 639 $querystatement.="\"".$variables["trackingno"]."\", "; 573 640 … … 617 684 if($variables["lineitemschanged"]==1) 618 685 addLineItems($variables["thelineitems"],$newid,$userid); 686 687 if($variables["statuschanged"]==1) 688 updateStatus($newid,$variables["statusid"],$variables["statusdate"],$variables["assignedtoid"],$dblink); 619 689 620 690 return $newid; -
trunk/phpbms/modules/bms/include/invoices_functions.php
r145 r184 57 57 ), 58 58 array( 59 "name"=>"Status History", 60 "href"=>(($id)?"invoices_statushistory.php?refid=".$id:"N/A"), 61 "disabled"=>(($id)?false:true), 62 ), 63 array( 59 64 "name"=>"Attachments", 60 65 "href"=>(($id)?"invoices_attachments.php?refid=".$id:"N/A"), -
trunk/phpbms/modules/bms/include/invoices_search_functions.php
r145 r184 47 47 48 48 $whereclause=buildWhereClause($theids,"invoices.id"); 49 50 $querystatement = "UPDATE invoices SET invoices.status=\"Shipped\",invoices.shippeddate=Now(),modifiedby=\"".$_SESSION["userinfo"]["id"]."\" WHERE (".$whereclause.") AND (invoices.type!=\"Invoice\" or invoices.type!=\"VOID\");"; 49 $whereclause="(".$whereclause.") AND (invoices.type!=\"Invoice\" or invoices.type!=\"VOID\");"; 50 51 //Look up default assignedto 52 $querystatement="SELECT defaultassignedtoid FROM invoicestatuses WHERE id=4"; 53 $queryresult = mysql_query($querystatement,$dblink); 54 if (!$queryresult) reportError(300,"Could not retrieve default assignedto: ".mysql_error($dblink)." -- ".$querystatement); 55 $therecord=mysql_fetch_array($queryresult); 56 $assignedtoid="NULL"; 57 if($therecord["defaultassignedtoid"]!="") 58 $assignedtoid=$therecord["defaultassignedtoid"]; 59 60 $querystatement = "UPDATE invoices SET invoices.statusid=4, invoices.statusdate=Now(), assignedtoid=".$assignedtoid.",modifiedby=\"".$_SESSION["userinfo"]["id"]."\" WHERE ".$whereclause; 51 61 $queryresult = mysql_query($querystatement,$dblink); 52 62 if (!$queryresult) reportError(300,"Couldn't Mark As Shipped: ".mysql_error($dblink)." -- ".$querystatement); … … 54 64 $message=buildStatusMessage(mysql_affected_rows($dblink),count($theids)); 55 65 $message.=" marked as shipped."; 66 67 //delete/update history 68 $querystatement="SELECT id FROM invoices WHERE ".$whereclause; 69 $queryresult = mysql_query($querystatement,$dblink); 70 71 while($therecord=mysql_fetch_array($queryresult)){ 72 $querystatement="DELETE FROM invoicestatushistory WHERE invoiceid=".$therecord["id"]." AND invoicestatusid=4"; 73 $deleteresult = mysql_query($querystatement,$dblink); 74 if (!$deleteresult ) reportError(300,"Could not delete status history: ".mysql_error($dblink)." -- ".$querystatement); 75 76 $querystatement="INSERT INTO invoicestatushistory (invoiceid,invoicestatusid,statusdate,assignedtoid) values ("; 77 $querystatement.=$therecord["id"].",4,NOW(),"; 78 $querystatement.=$assignedtoid; 79 $querystatement.=")"; 80 $insertresult = mysql_query($querystatement,$dblink); 81 if (!$insertresult) reportError(300,"Could not insert status history: ".mysql_error($dblink)." -- ".$querystatement); 82 } 83 56 84 57 85 return $message; … … 64 92 65 93 $whereclause=buildWhereClause($theids,"invoices.id"); 66 94 67 95 $querystatement = "UPDATE invoices SET invoices.amountpaid=invoices.totalti,modifiedby=\"".$_SESSION["userinfo"]["id"]."\" WHERE (".$whereclause.") AND (invoices.type!=\"Invoice\" OR invoices.type!=\"VOID\")"; 68 96 $queryresult = mysql_query($querystatement,$dblink); … … 71 99 $message=buildStatusMessage(mysql_affected_rows($dblink),count($theids)); 72 100 $message.=" marked as paid in full."; 101 102 73 103 74 104 return $message; … … 80 110 81 111 $whereclause=buildWhereClause($theids,"invoices.id"); 112 $whereclause="(".$whereclause.") AND (invoices.type!=\"Invoice\" OR invoices.type!=\"VOID\") AND invoices.amountpaid=invoices.totalti;"; 82 113 83 $querystatement = "UPDATE invoices SET invoices.type=\"Invoice\",invoices.status=\"shipped\",invoices.invoicedate=ifnull(invoices.invoicedate,Now()),modifiedby=\"".$_SESSION["userinfo"]["id"]."\" WHERE (".$whereclause.") AND (invoices.type!=\"Invoice\" OR invoices.type!=\"VOID\") AND invoices.amountpaid=invoices.totalti;"; 114 //Look up default assignedto 115 $querystatement="SELECT defaultassignedtoid FROM invoicestatuses WHERE id=4"; 84 116 $queryresult = mysql_query($querystatement,$dblink); 85 if (!$queryresult) reportError(300,"Could not convert to client: ".mysql_error($dblink)." -- ".$querystatement); 117 if (!$queryresult) reportError(300,"Could not retrieve default assignedto: ".mysql_error($dblink)." -- ".$querystatement); 118 $therecord=mysql_fetch_array($queryresult); 119 $assignedtoid="NULL"; 120 if($therecord["defaultassignedtoid"]!="") 121 $assignedtoid=$therecord["defaultassignedtoid"]; 122 123 $querystatement = "UPDATE invoices SET invoices.type=\"Invoice\" invoices.invoicedate=ifnull(invoices.invoicedate,Now()),modifiedby=\"".$_SESSION["userinfo"]["id"]."\" WHERE".$whereclause; 124 $queryresult = mysql_query($querystatement,$dblink); 125 if (!$queryresult) reportError(300,"Could not mark as invoice: ".mysql_error($dblink)." -- ".$querystatement); 86 126 87 127 $message=buildStatusMessage(mysql_affected_rows($dblink),count($theids)); 88 128 $message.=" converted to invoice."; 129 130 //delete/update history 131 $querystatement="SELECT id FROM invoices WHERE (".$whereclause.") AND statusid!=4"; 132 $queryresult = mysql_query($querystatement,$dblink); 133 134 while($therecord=mysql_fetch_array($queryresult)){ 135 $querystatement = "UPDATE invoices SET invoices.statusid=4,invoices.statusdate=Now(), invoices.assignedtoid=".$assignedtoid.", WHERE id=".$therecord["id"]; 136 $queryresult = mysql_query($querystatement,$dblink); 137 if (!$queryresult) reportError(300,"Could not mark as invoice: ".mysql_error($dblink)." -- ".$querystatement); 138 139 $querystatement="DELETE FROM invoicestatushistory WHERE invoiceid=".$therecord["id"]." AND invoicestatusid=4"; 140 $deleteresult = mysql_query($querystatement,$dblink); 141 if (!$deleteresult ) reportError(300,"Could not delete status history: ".mysql_error($dblink)." -- ".$querystatement); 142 143 $querystatement="INSERT INTO invoicestatushistory (invoiceid,invoicestatusid,statusdate,assignedtoid) values ("; 144 $querystatement.=$therecord["id"].",4,NOW(),"; 145 $querystatement.=$assignedtoid; 146 $querystatement.=")"; 147 $insertresult = mysql_query($querystatement,$dblink); 148 if (!$insertresult) reportError(300,"Could not insert status history: ".mysql_error($dblink)." -- ".$querystatement); 149 } 89 150 90 151 return $message; -
trunk/phpbms/modules/bms/install/createtables.sql
r183 r184 245 245 PRIMARY KEY (`id`) 246 246 ) TYPE=MyISAM PACK_KEYS=0; 247 248 CREATE TABLE `invoicestatuses` ( 249 `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 250 `name` VARCHAR(128), 251 `invoicedefault` TINYINT UNSIGNED NOT NULL DEFAULT 0, 252 `defaultassignedtoid` INTEGER UNSIGNED, 253 `inactive` TINYINT UNSIGNED NOT NULL DEFAULT 0, 254 `priority` INTEGER UNSIGNED NOT NULL DEFAULT 0, 255 `createdby` INTEGER UNSIGNED, 256 `creationdate` DATETIME, 257 `modifiedby` INTEGER UNSIGNED, 258 `modifieddate` TIMESTAMP, 259 PRIMARY KEY(`id`) 260 ) 261 ENGINE = MYISAM; 262 263 CREATE TABLE `invoicestatushistory` ( 264 `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 265 `invoicedefault` INTEGER UNSIGNED 266 `invoiceid` INTEGER UNSIGNED, 267 `invoicestatusid` INTEGER UNSIGNED, 268 `statusdate` DATE, 269 `assignedtoid` INTEGER UNSIGNED, 270 PRIMARY KEY(`id`) 271 ) 272 ENGINE = MYISAM; -
trunk/phpbms/modules/bms/install/menu.sql
r176 r184 14 14 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (213,'Shipping Methods','search.php?id=300',204,30,1,1,NOW(),NOW(),30); 15 15 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (214,'Payment Methods','search.php?id=301',204,40,1,1,NOW(),NOW(),30); 16 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (215,'----','',204,15,1,1,NOW(),NOW(),30); 17 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (216,'invoice statuses','search.php?id=302',204,50,1,1,NOW(),NOW(),30); -
trunk/phpbms/modules/bms/install/tablecolumns.sql
r176 r184 64 64 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (301,'priority','paymentmethods.priority','center','',3,'',0,'',NULL); 65 65 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (301,'online process','paymentmethods.onlineprocess','center','',4,'',0,'','boolean'); 66 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (302,'name','invoicestatuses.name','left','',0,'',1,'99%',NULL); 67 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (302,'priority','invoicestatuses.priority','right','',1,'',0,'',NULL); 68 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (302,'inactive','invoicestatuses.inactive','center','',2,'',0,'','boolean'); -
trunk/phpbms/modules/bms/install/tabledefs.sql
r176 r184 1 1 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (22,'Client E-mail Projects','system',2,'clientemailprojects','clientemailprojects left join users on clientemailprojects.userid=users.id','modules/bms/clientemailprojects_edit.php',0,'NA',0,0,-100,-100,'delete','clientemailprojects.id !=-1','clientemailprojects.name','search','','',1,NOW(),1,NOW()); 2 2 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (2,'Clients/Prospects','table',2,'clients','clients','modules/bms/clients_addedit.php',0,'modules/bms/clients_addedit.php',0,0,-100,-100,'inactivate','clients.id=-100','concat(clients.lastname,\", \",clients.firstname)','','','',1,NOW(),1,NOW()); 3 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (3,'Quotes/Orders/Invoices','table',2,'invoices','( invoices inner join clients on invoices.clientid=clients.id)','modules/bms/invoices_addedit.php',0,'modules/bms/invoices_addedit.php',0,0,-100,-100,'void','invoices.type+0<3','invoices.id','','','',1,NOW(),1,NOW());3 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (3,'Quotes/Orders/Invoices','table',2,'invoices','((invoices inner join clients on invoices.clientid=clients.id) inner join invoicestatuses on invoices.statusid=invoicestatuses.id)','modules/bms/invoices_addedit.php',0,'modules/bms/invoices_addedit.php',0,0,-100,-100,'void','invoices.type+0<3','invoices.id','','','',1,NOW(),1,NOW()); 4 4 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (4,'Products','table',2,'products','(products inner join productcategories on products.categoryid=productcategories.id)','modules/bms/products_addedit.php',0,'modules/bms/products_addedit.php',0,0,-100,-100,'inactivate','products.id =-100','products.partnumber','','','',1,NOW(),1,NOW()); 5 5 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (5,'Line Items','table',2,'lineitems','((lineitems left join products on lineitems.productid=products.id) inner join invoices on lineitems.invoiceid=invoices.id)','N/A',0,'N/A',0,0,-100,-100,'NA','lineitems.id =-1','lineitems.invoiceid,lineitems.id','','','',1,NOW(),1,NOW()); … … 11 11 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (300,'Shipping Methods','table',2,'shippingmethods','shippingmethods','modules/bms/shippingmethods_addedit.php',30,'modules/bms/shippingmethods_addedit.php',30,30,30,-100,'inactivate','shippingmethods.inactive!=0','shippingmethods.priority, shippingmethods.name','','','',1,NOW(),1,NOW()); 12 12 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (301,'Payment Methods','table',2,'paymentmethods','paymentmethods','modules/bms/paymentmethods_addedit.php',30,'modules/bms/paymentmethods_addedit.php',30,30,30,-100,'inactivate','paymentmethods.inactive=0','paymentmethods.priority,paymentmethods.name','','','',1,NOW(),1,NOW()); 13 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (302,'Invoice Statuses','table',2,'invoicestatuses','invoicestatuses','modules/bms/invoicestatuses_addedit.php',30,'modules/bms/invoicestatuses_addedit.php',30,30,-100,-100,'inactivate','invoicestatuses.inactive=0','invoicestatuses.priority,invoicestatuses.name','','',''1,NOW(),1,NOW()); -
trunk/phpbms/modules/bms/install/tablefindoptions.sql
r176 r184 9 9 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (103,3,'Invoices - This Year','invoices.type=\"Invoice\" AND YEAR(invoices.invoicedate)=YEAR(CURDATE())',17,30); 10 10 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (104,3,'Invoices - Last Quarter','invoices.type=\"Invoice\" AND YEAR(invoices.invoicedate)=YEAR(DATE_SUB(CURDATE(),INTERVAL 3 MONTH)) and QUARTER(invoices.invoicedate)=QUARTER(DATE_SUB(CURDATE(),INTERVAL 3 MONTH))',16,30); 11 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (106,3,'Orders - Committed','invoices.type=\"Order\" and invoices .status=\"Committed\"',3,0);12 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (107,3,'Orders - Open','invoices.type=\"Order\" and invoices .status=\"Open\"',2,0);11 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (106,3,'Orders - Committed','invoices.type=\"Order\" and invoicestatuses.name=\"Committed\"',3,0); 12 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (107,3,'Orders - Open','invoices.type=\"Order\" and invoicestatuses.name=\"Open\"',2,0); 13 13 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (49,3,'Invoices - Today','invoices.type=\"Invoice\" and invoices.invoicedate=curdate()',9,20); 14 14 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (50,3,'Invoices - Yesterday','invoices.type=\"Invoice\" and invoices.invoicedate=date_sub(curdate(),INTERVAL 1 DAY)',10,20); 15 15 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (45,3,'Invoices - This Month','invoices.type=\"Invoice\" and year(invoicedate)=year(curdate()) and month(invoicedate)=month(curdate())',13,30); 16 16 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (22,3,'Orders','invoices.type=\"Order\"',1,0); 17 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (23,3,'Orders - Packed','invoices.type=\"Order\" and invoices .status=\"Packed\"',4,0);18 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (24,3,'Orders - Shipped','invoices.type=\"Order\" and invoices .status=\"Shipped\"',5,0);17 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (23,3,'Orders - Packed','invoices.type=\"Order\" and invoicestatuses.name=\"Packed\"',4,0); 18 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (24,3,'Orders - Shipped','invoices.type=\"Order\" and invoicestatuses.name=\"Shipped / Ready To Invoice\"',5,0); 19 19 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (25,3,'Invoices','invoices.type=\"Invoice\"',8,30); 20 20 INSERT INTO `tablefindoptions` (`id`, `tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (26,3,'Quotes','invoices.type=\"Quote\"',7,20); … … 62 62 INSERT INTO `tablefindoptions` (`tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (301,'Active','paymentmethods.inactive=0',0,0); 63 63 INSERT INTO `tablefindoptions` (`tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (301,'Inactive','paymentmethods.inactive=1',1,0); 64 INSERT INTO `tablefindoptions` (`tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (302,'Active Records','invoicestatuses.inactive=0',0,0); 65 INSERT INTO `tablefindoptions` (`tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (302,'All Records','invoicestatuses.id!=-1',1,0); -
trunk/phpbms/modules/bms/install/tableoptions.sql
r176 r184 52 52 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (301,'edit','1',0,0); 53 53 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (301,'printex','1',0,0); 54 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (302,'new','1',0,0); 55 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (302,'select','1',0,0); 56 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (302,'edit','1',0,0); 57 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (302,'printex','0',0,0); -
trunk/phpbms/modules/bms/install/tablesearchablefields.sql
r176 r184 42 42 INSERT INTO `tablesearchablefields` (`tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (300,'shippingmethods.name','name',0,'field'); 43 43 INSERT INTO `tablesearchablefields` (`tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (301,'paymentmethods.name','name',0,'field'); 44 INSERT INTO `tablesearchablefields` (`tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (302,'invoicestatuses.name','name',0,'field'); -
trunk/phpbms/modules/bms/install/update.php
r180 r184 278 278 case "0.62"; 279 279 $thereturn.="Updating BMS Module to 0.7\n"; 280 280 281 281 $thereturn.=processSQLfile("updatev0.7.sql"); 282 283 //update to new status system 284 if(updateInvoiceStatus($dblink)) 285 $thereturn.=" - Updated to new invoice status system\n."; 286 else 287 $thereturn.=" - Failed to updated to new invoice status system\n."; 288 282 289 283 290 //Update shipping from invoices … … 348 355 } 349 356 357 function updateInvoiceStatus($dblink){ 358 $querystatement="SELECT id,status,statusdate FROM invoices;"; 359 while($therecord=mysql_fetch_array($queryresult)){ 360 $newstatus=1; 361 switch(){ 362 case "Open": 363 $newstatus=1; 364 break; 365 case "Committed": 366 $newstatus=2; 367 break; 368 case "Packed": 369 $newstatus=3; 370 break; 371 case "Shipped": 372 $newstatus=4; 373 break; 374 } 375 $querystatement="UPDATE invoices SET statusid=".$newstatus." WHERE id=".$therecord["id"]; 376 $updatequery=mysql_query($querystatement,$dblink); 377 378 //now create the history 379 if($therecord["statusdate"]!="" && $newstatus=4) 380 $querystatement="INSERT INTO invoicestatushistory (invoiceid,statusid,statusdate)VALUES(".$therecord["id"].",".$newstatus.",".$therecord["statusdate"].")"; 381 elseif($therecord["statusdate"]!="" && $newstatus!=4){ 382 $querystatement="INSERT INTO invoicestatushistory (invoiceid,statusid,statusdate)VALUES(".$therecord["id"].",4,".$therecord["statusdate"].")"; 383 $insertquery=mysql_query($querystatement,$dblink); 384 $querystatement="INSERT INTO invoicestatushistory (invoiceid,statusid)VALUES(".$therecord["id"].",".$newstatus.")"; 385 } 386 else 387 $querystatement="INSERT INTO invoicestatushistory (invoiceid,statusid)VALUES(".$therecord["id"].",".$newstatus.")"; 388 $insertquery=mysql_query($querystatement,$dblink); 389 390 } 391 $querystatement="ALTER TABLE `invoices` DROP COLUMN `status`"; 392 $dropcolumnquery=mysql_query($querystatement,$dblink); 393 394 return true; 395 } 350 396 351 397 $thereturn=doUpdate(); -
trunk/phpbms/modules/bms/install/updatev0.70.sql
r179 r184 46 46 ALTER TABLE `clients` ALTER COLUMN `shiptostate` `shiptostate` varchar(5) default NULL; 47 47 ALTER TABLE `invoices` ALTER COLUMN `state` `state` varchar(5) default NULL; 48 CREATE TABLE `invoicestatuses` (`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,`name` VARCHAR(128), `invoicedefault` TINYINT UNSIGNED NOT NULL DEFAULT 0,`defaultassignedtoid` INTEGER UNSIGNED,`inactive` TINYINT UNSIGNED NOT NULL DEFAULT 0, `priority` INTEGER UNSIGNED NOT NULL DEFAULT 0, `createdby` INTEGER UNSIGNED, `creationdate` DATETIME, `modifiedby` INTEGER UNSIGNED, `modifieddate` TIMESTAMP, PRIMARY KEY(`id`))ENGINE = MYISAM; 49 CREATE TABLE `invoicestatushistory` (`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `invoiceid` INTEGER UNSIGNED, `invoicestatusid` INTEGER UNSIGNED, `statusdate` DATE, `assignedtoid` INTEGER UNSIGNED, PRIMARY KEY(`id`))ENGINE = MYISAM; 50 INSERT INTO `tabledefs` (`id`, `displayname`, `type`, `moduleid`, `maintable`, `querytable`, `editfile`, `editroleid`, `addfile`, `addroleid`, `searchroleid`, `advsearchroleid`, `viewsqlroleid`, `deletebutton`, `defaultwhereclause`, `defaultsortorder`, `defaultsearchtype`, `defaultcriteriafindoptions`, `defaultcriteriaselection`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES (302,'Invoice Statuses','table',2,'invoicestatuses','invoicestatuses','modules/bms/invoicestatuses_addedit.php',30,'modules/bms/invoicestatuses_addedit.php',30,30,-100,-100,'inactivate','invoicestatuses.inactive=0','invoicestatuses.priority,invoicestatuses.name','','',''1,NOW(),1,NOW()); 51 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (215,'----','',204,15,1,1,NOW(),NOW(),30); 52 INSERT INTO `menu` (`id`, `name`, `link`, `parentid`, `displayorder`, `createdby`, `modifiedby`, `creationdate`, `modifieddate`, `roleid`) VALUES (216,'invoice statuses','search.php?id=302',204,50,1,1,NOW(),NOW(),30); 53 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (302,'name','invoicestatuses.name','left','',0,'',1,'99%',NULL); 54 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (302,'priority','invoicestatuses.priority','right','',1,'',0,'',NULL); 55 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`) VALUES (302,'inactive','invoicestatuses.inactive','center','',2,'',0,'','boolean'); 56 INSERT INTO `tablefindoptions` (`tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (302,'Active Records','invoicestatuses.inactive=0',0,0); 57 INSERT INTO `tablefindoptions` (`tabledefid`, `name`, `search`, `displayorder`, `roleid`) VALUES (302,'All Records','invoicestatuses.id!=-1',1,0); 58 INSERT INTO `tablesearchablefields` (`tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES (302,'invoicestatuses.name','name',0,'field'); 59 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (302,'new','1',0,0); 60 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (302,'select','1',0,0); 61 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (302,'edit','1',0,0); 62 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `othercommand`, `roleid`) VALUES (302,'printex','0',0,0); 63 ALTER TABLE `invoices` CHANGE COLUMN `shippeddate` `statusdate` DATE DEFAULT NULL; 64 ALTER TABLE `invoices` ADD COLUMN `statusid` INTEGER UNSIGNED AFTER `status`; 65 ALTER TABLE `invoices` ADD COLUMN `assignedtoid` INTEGER UNSIGNED AFTER `statusid`; 66 UPDATE `tabledefs` SET `querytable`='((invoices inner join clients on invoices.clientid=clients.id) inner join invoicestatuses on invoices.statusid=invoicestatuses.id)' WHERE `id` =3; 67 UPDATE `tablefindoptions` SET `search`='invoices.type=\"Order\" and invoicestatuses.name=\"Shipped / Ready To Invoice\"' WHERE `id`=24; 68 UPDATE `tablefindoptions` SET `search`='invoices.type=\"Order\" and invoicestatuses.name=\"Packed\"' WHERE `id`=23; 69 UPDATE `tablefindoptions` SET `search`='invoices.type=\"Order\" and invoicestatuses.name=\"Committed\"' WHERE `id`=106; 70 UPDATE `tablefindoptions` SET `search`='invoices.type=\"Order\" and invoicestatuses.name=\"Open\"' WHERE `id`=107; -
trunk/phpbms/modules/bms/invoices_addedit.php
r178 r184 76 76 </div> 77 77 <h1 id="h1With<?php if(!$therecord["id"]) echo "out"?>Print"><?php echo $pageTitle ?></h1> 78 79 <fieldset id="fsAttributes"> 80 <legend>attributes</legend> 78 <div id="fsAttributes"> 79 <fieldset > 80 <legend>attributes</legend> 81 82 <div id="attributesRight"> 83 <p> 84 <label for="orderdate">order date</label><br /> 85 <?php field_datepicker("orderdate",$therecord["orderdate"],0,"Order date must be a valid date",Array("size"=>"11","maxlength"=>"11","tabindex"=>"10"),false);?> 86 </p> 87 <p> 88 <label for="invoicedate">invoice date</label> 89 <br /> 90 <?php field_datepicker("invoicedate",$therecord["invoicedate"],0,"Invoice date must be a valid date",Array("size"=>"11","maxlength"=>"11","tabindex"=>"11"),false);?> 91 </p> 92 93 <p> 94 <label for="requireddate">required date</label> 95 <br /> 96 <?php field_datepicker("requireddate",$therecord["requireddate"],0,"Required date must be a valid date",Array("size"=>"11","maxlength"=>"11","tabindex"=>"13"),false);?> 97 </p> 98 </div> 81 99 82 <div id="attributesRight"> 83 <p> 84 <label for="orderdate">order date</label><br /> 85 <?php field_datepicker("orderdate",$therecord["orderdate"],0,"Order date must be a valid date",Array("size"=>"11","maxlength"=>"11","tabindex"=>"10"),false);?> 86 </p> 87 <p> 88 <label for="invoicedate">invoice date</label> 89 <br /> 90 <?php field_datepicker("invoicedate",$therecord["invoicedate"],0,"Invoice date must be a valid date",Array("size"=>"11","maxlength"=>"11","tabindex"=>"11"),false);?> 91 </p> 100 <div> 101 <p> 102 <label for="id">id</label> 103 <br /> 104 <input name="id" id="id" type="text" value="<?php echo $therecord["id"]; ?>" size="11" maxlength="11" readonly="true" class="uneditable" tabindex="0" /> 105 </p> 106 107 <p> 108 <label for="type" class="important">type</label><br /> 109 <?php if($therecord["type"]=="VOID" || $therecord["type"]=="Invoice") {?> 110 <input id="type" name="type" type="text" value="<?php echo htmlQuotes($therecord["type"])?>" size="11" maxlength="11" readonly="true" class="uneditable important" tabindex=9 /> 111 <?php }else { 112 $thechoices=array(); 113 $thechoices[]=array("name"=>"Quote","value"=>"Quote"); 114 $thechoices[]=array("name"=>"Order","value"=>"Order"); 115 if(hasRights(30)) $thechoices[]=array("name"=>"Invoice","value"=>"Invoice"); 116 $thechoices[]=array("name"=>"VOID","value"=>"VOID"); 117 basic_choicelist("type",$therecord["type"],$thechoices,array("onchange"=>"checkType(this)","class"=>"important","style"=>"width:90px","tabindex"=>"9")); 118 } 119 ?><input type="hidden" id="oldType" name="oldType" value="<?php echo $therecord["type"]?>"/> 120 </p> 121 122 <p> 123 <label for="ponumber">client PO#</label> 124 <br /> 125 <input name="ponumber" id="ponumber" type="text" value="<?php echo htmlQuotes($therecord["ponumber"])?>" size="11" maxlength="64" tabindex=12 /> 126 </p> 127 </div> 128 92 129 93 130 <p> 94 <label for=" requireddate">required date</label>131 <label for="leadsource">lead source</label> 95 132 <br /> 96 <?php field_datepicker("requireddate",$therecord["requireddate"],0,"Required date must be a valid date",Array("size"=>"11","maxlength"=>"11","tabindex"=>"13"),false);?> 97 </p> 98 133 <?php choicelist("leadsource",$therecord["leadsource"],"leadsource",Array("tabindex"=>"14")); ?> 134 </p> 135 </fieldset> 136 <fieldset> 137 <legend>Status</legend> 99 138 <p> 100 <label for="shippeddate">shipped date</label> 101 <br /> 102 <?php field_datepicker("shippeddate",$therecord["shippeddate"],0,"Shipped date must be a valid date.",Array("size"=>"11","maxlength"=>"11","tabindex"=>"14"),false); ?> 103 </p> 104 </div> 105 106 <div> 139 <label for="statusid" class="important">current status</label><br /> 140 <?php displayStatusDropDown($therecord["statusid"],$dblink)?> 141 <input type="hidden" id="statuschanged" name="statuschanged" value="<?php if($therecord["id"]=="") echo "1"; else echo "0"?>" /> 142 </p> 107 143 <p> 108 <label for="id">id</label> 109 <br /> 110 <input name="id" id="id" type="text" value="<?php echo $therecord["id"]; ?>" size="11" maxlength="11" readonly="true" class="uneditable" tabindex="0" /> 111 </p> 112 144 <label for="statusdate">status date</label><br /> 145 <?PHP field_datepicker("statusdate",$therecord["statusdate"],0,"Status date must be a valid date",Array("size"=>"11","maxlength"=>"11","tabindex"=>"13","onchange"=>"updateStatusChange();"),false);?> 146 </p> 113 147 <p> 114 <label for="type" class="important">type</label><br /> 115 <?php if($therecord["type"]=="VOID" || $therecord["type"]=="Invoice") {?> 116 <input id="type" name="type" type="text" value="<?php echo htmlQuotes($therecord["type"])?>" size="11" maxlength="11" readonly="true" class="uneditable important" tabindex=9 /> 117 <?php }else { 118 $thechoices=array(); 119 $thechoices[]=array("name"=>"Quote","value"=>"Quote"); 120 $thechoices[]=array("name"=>"Order","value"=>"Order"); 121 if(hasRights(30)) $thechoices[]=array("name"=>"Invoice","value"=>"Invoice"); 122 $thechoices[]=array("name"=>"VOID","value"=>"VOID"); 123 basic_choicelist("type",$therecord["type"],$thechoices,array("onchange"=>"checkType(this)","class"=>"important","style"=>"width:90px","tabindex"=>"9")); 124 } 125 ?><input type="hidden" id="oldType" name="oldType" value="<?php echo $therecord["type"]?>"/> 126 </p> 127 128 <p> 129 <label for="ponumber">client PO#</label> 130 <br /> 131 <input name="ponumber" id="ponumber" type="text" value="<?php echo htmlQuotes($therecord["ponumber"])?>" size="11" maxlength="64" tabindex=12 /> 132 </p> 133 </div> 148 <label for="assignedtoid">assigned to</label><br /> 149 <?php autofill("assignedtoid",$therecord["assignedtoid"],9,"users.id","concat(users.firstname,\" \",users.lastname)","\"\"","users.revoked!=1",Array("size"=>"30","maxlength"=>"128")) ?> 150 </p> 134 151 135 <p> 136 <strong>order status</strong><br /> 137 <input type="radio" name="status" id="statusOpen" value="Open" <?php if($therecord["status"]=="Open") echo "checked"?> class="radiochecks" align="baseline" tabindex="13"/><label for="statusOpen">open</label><br /> 138 <input type="radio" name="status" id="statusCommited" value="Committed" <?php if($therecord["status"]=="Committed") echo "checked"?> class="radiochecks" align="baseline" tabindex="13"/><label for="statusCommited">committed</label><br /> 139 <input type="radio" name="status" id="statusPacked" value="Packed" <?php if($therecord["status"]=="Packed") echo "checked"?> class="radiochecks" align="baseline" tabindex="13"/><label for="statusPacked">packed</label><br /> 140 <input type="radio" name="status" id="statusShipped" value="Shipped" <?php if($therecord["status"]=="Shipped") echo "checked"?> class="radiochecks" align="baseline" tabindex="13" onClick="setShipped()"/><label for="statusShipped">shipped/invoice</label> 141 </p> 142 143 <p> 144 <label for="leadsource">lead source</label> 145 <br /> 146 <?php choicelist("leadsource",$therecord["leadsource"],"leadsource",Array("tabindex"=>"14")); ?> 147 </p> 148 </fieldset> 152 </fieldset> 153 </div> 149 154 150 155 <div id="fsTops"> 151 156 <fieldset > 152 157 <legend><label for="ds-clientid">client</label></legend> 153 <div class="important fauxP"> 158 <div class="important fauxP"><br /> 154 159 <?php autofill("clientid",$therecord["clientid"],2,"clients.id","if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company)","if(clients.city!=\"\",concat(clients.city,\", \",clients.state),\"\")","clients.inactive!=1 AND clients.type=\"client\"",Array("size"=>"45","maxlength"=>"128","style"=>"","style"=>"font-weight:bold","tabindex"=>"1"),1,"The record must have a client chosen.") ?> 155 160 <script language="JavaScript" type="text/javascript"> … … 164 169 <fieldset> 165 170 <legend><label for="address1">shipping address</label></legend> 166 <p> 171 <p><br /> 167 172 <input name="address1" id="address1" type="text" value="<?php echo htmlQuotes($therecord["address1"])?>" size="65" maxlength="128" tabindex=3 /><br /> 168 173 <input name="address2" id="address2" type="text" value="<?php echo htmlQuotes($therecord["address2"])?>" size="65" maxlength="128" tabindex="4" /> … … 188 193 <fieldset> 189 194 <legend>web / confirmation number</legend> 190 <p> 195 <p><br /> 191 196 <?php field_checkbox("weborder",$therecord["weborder"],0,array("tabindex"=>"14"));?> 192 197 <input name="webconfirmationno" type="text" value="<?php echo $therecord["webconfirmationno"] ?>" size="41" maxlength="64" tabindex="14" /> 193 198 </p> 199 <p> </p> 194 200 </fieldset> 195 201 </div> … … 279 285 <p> 280 286 <label for="taxpercentage">tax percentage</label><br /> 281 <?php field_percentage("taxpercentage",$therecord["taxpercentage"],5,0,"Tax percentage must be a valid percentage.",Array("size"=>"9","maxlength"=>"9","on Change"=>"clearTaxareaid()","tabindex"=>"22")); ?>287 <?php field_percentage("taxpercentage",$therecord["taxpercentage"],5,0,"Tax percentage must be a valid percentage.",Array("size"=>"9","maxlength"=>"9","onchange"=>"clearTaxareaid()","tabindex"=>"22")); ?> 282 288 </p> 283 289 </fieldset> -
trunk/phpbms/modules/bms/invoices_lineitem_ajax.php
r145 r184 58 58 (clients inner join invoices on clients.id=invoices.clientid) 59 59 inner join lineitems on invoices.id = lineitems.invoiceid 60 where clients.id=".$_GET["cid"]." and invoices. status != \"Void\" and invoices.status!= \"Quote\" and60 where clients.id=".$_GET["cid"]." and invoices.type != \"Void\" and invoices.type != \"Quote\" and 61 61 (".$checkpids.")"; 62 62 $prquery=mysql_query($prlookupstatement,$dblink); -
trunk/phpbms/modules/bms/javascript/invoice.js
r176 r184 55 55 displayClient.focus(); 56 56 } 57 } 57 58 var clientinfo=getObjectFromID("clientid"); 59 clientinfo.onchange=populateShipping; 60 61 var assignedtoid=getObjectFromID("assignedtoid"); 62 assignedtoid.onchange=updateStatusChange; 63 } 64 65 function updateAssignedTo(){ 66 var status=getObjectFromID("statusid"); 67 var assignedto=getObjectFromID("ds-assignedtoid"); 68 if(statusAssignedto["s"+status.value]){ 69 assignedto.value=statusAssignedto["s"+status.value] 70 lastLookup(assignedto); 71 } 72 } 73 74 function updateStatusChange(){ 75 var statuschanged=getObjectFromID("statuschanged"); 76 statuschanged.value=1; 77 } 78 79 function updateStatusDate(){ 80 var statusdate=getObjectFromID("statusdate"); 81 var today=new Date(); 82 statusdate.value=englishDate(today); 83 84 updateStatusChange(); 85 } 86 58 87 59 88 function payInFull(){ … … 64 93 } 65 94 66 // These function are used when redefining the on Change property of95 // These function are used when redefining the onchange property of 67 96 // a hidden field for the the taxAreaID. It uses XMLHttpRequest to 68 97 // grab the tax percentage. … … 149 178 } 150 179 151 // This function is used when redefining the on Change property of180 // This function is used when redefining the onchange property of 152 181 // a hidden field for the the client ID. It will then open a small window 153 182 // passing the client ID, and retrieve the appropriate shipping info -
trunk/phpbms/modules/bms/products_addedit.php
r155 r184 121 121 <p> 122 122 <label for="partnumber"><span class="important">part number</span> <span class="notes">(must be unique)</span></label><br /> 123 <?php field_text("partnumber",$therecord["partnumber"],1,"Part number name cannot be blank.","",Array("size"=>"20","maxlength"=>"32","class"=>"important","tabindex"=>"20","on Change"=>"checkUnique('../../',this.value,this.name,'products','partnumber','".$therecord["id"]."')")); ?>123 <?php field_text("partnumber",$therecord["partnumber"],1,"Part number name cannot be blank.","",Array("size"=>"20","maxlength"=>"32","class"=>"important","tabindex"=>"20","onchange"=>"checkUnique('../../',this.value,this.name,'products','partnumber','".$therecord["id"]."')")); ?> 124 124 </p> 125 125 … … 240 240 <input type="hidden" id="thumbchange" name="thumbchange" value="" /> 241 241 <div id="thumbdelete" style="display:<?php if($therecord["thumbnailmime"]) echo "block"; else echo "none";?>"><input type="button" class="Buttons" value="delete thumbnail" onClick="deletePicture('thumb')" tabindex="260"/></div> 242 <div id="thumbadd" style="display:<?php if($therecord["thumbnailmime"]) echo "none"; else echo "block";?>"><input id="thumbnailupload" name="thumbnailupload" type="file" size="40" on Change="updatePictureStatus('thumb','upload')" tabindex="260" /></div>242 <div id="thumbadd" style="display:<?php if($therecord["thumbnailmime"]) echo "none"; else echo "block";?>"><input id="thumbnailupload" name="thumbnailupload" type="file" size="40" onchange="updatePictureStatus('thumb','upload')" tabindex="260" /></div> 243 243 </div> 244 244 … … 253 253 <input type="hidden" id="picturechange" name="picturechange" value="" /> 254 254 <div id="picturedelete" style="display:<?php if($therecord["picturemime"]) echo "block"; else echo "none";?>"><input type="button" class="Buttons" value="delete picture" onClick="deletePicture('picture')" tabindex="270"/></div> 255 <div id="pictureadd" style="display:<?php if($therecord["picturemime"]) echo "none"; else echo "block";?>"><input id="pictureupload" name="pictureupload" type="file" size="40" on Change="updatePictureStatus('picture','upload')" tabindex="270"/></div>255 <div id="pictureadd" style="display:<?php if($therecord["picturemime"]) echo "none"; else echo "block";?>"><input id="pictureupload" name="pictureupload" type="file" size="40" onchange="updatePictureStatus('picture','upload')" tabindex="270"/></div> 256 256 </div> 257 257 </div> -
trunk/phpbms/modules/bms/products_saleshistory.php
r170 r184 113 113 </head> 114 114 <body><?php include("../../menu.php")?> 115 <?php product_tabs("Sales History",$_GET["id"]);?><div class="bodyline" style="padding:4px;">115 <?php product_tabs("Sales History",$_GET["id"]);?><div class="bodyline"> 116 116 <h1><span><?php echo $pageTitle ?></span></h1> 117 117 <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="post" name="record"> 118 118 <div class="box"> 119 119 <p class="timelineP"> 120 <label for="status"> invoice status</label><br />120 <label for="status">type</label><br /> 121 121 <select name="status" id="status"> 122 122 <option value="Orders/Invoices" <?php if($_POST["status"]=="Orders/Invoices") echo "selected"?>>Orders/Invoices</option> -
trunk/phpbms/modules/bms/report/invoices_totals.php
r176 r184 410 410 <option value="invoices.shipstate">Shipping State</option> 411 411 <option value="invoices.shipcity">Shipping City</option> 412 <option value="invoices.status">Invoice Status</option>413 412 <option value="invoices.weborder">Web Orders</option> 414 413 </select> -
trunk/phpbms/modules/bms/snapshot.php
r170 r184 85 85 global $dblink; 86 86 $querystatement="SELECT invoices.id, 87 invoices .status,87 invoicestatuses.name as status, 88 88 if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company) as thename, 89 89 invoices.totalti as total, 90 90 invoices.totalti-invoices.amountpaid as amtdue 91 FROM invoices INNER JOIN clients ON invoices.clientid=clients.id91 FROM (invoices INNER JOIN clients ON invoices.clientid=clients.id) INNER JOIN invoicestatuses on invoices.statusid=invoicestatuses.id 92 92 WHERE invoices.creationdate>= DATE_SUB(NOW(),INTERVAL ".$interval.") AND (invoices.type=\"Order\") 93 93 ORDER BY invoices.creationdate DESC LIMIT 0,50 -
trunk/phpbms/print.php
r170 r184 195 195 <p> 196 196 <label class="important" for="therecords">from</label><br /> 197 <select id="therecords" name="therecords" on Change="showSavedSearches(this);">197 <select id="therecords" name="therecords" onchange="showSavedSearches(this);"> 198 198 <option value="selected">selected records (<?php echo count($tablePrinter->theids) ?> record<?php if(count($tablePrinter->theids)>1) echo "s"?>)</option> 199 199 <option value="savedsearch">saved search...</option> … … 221 221 <p class="important"> 222 222 <label for="thesort">by</label><br /> 223 <select id="thesort" name="thesort" on Change="showSortOptions(this)">223 <select id="thesort" name="thesort" onchange="showSortOptions(this)"> 224 224 <option value="default" selected>report default</option> 225 225 <option value="single">single field</option>