phpBMS

Changeset 451

Show
Ignore:
Timestamp:
03/12/09 11:42:41 (3 years ago)
Author:
nate
Message:
  • Fixed lack of msql quotes in lineitems for invoices.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/bms/include/invoices.php

    r405 r451  
    3939if(class_exists("phpbmsTable")){ 
    4040        class invoices extends phpbmsTable{ 
    41          
     41 
    4242                function showClientType($id){ 
    43                  
     43 
    4444                        if(((int) $id) != 0){ 
    45                                  
     45 
    4646                                $querystatement=" 
    47                                         SELECT  
     47                                        SELECT 
    4848                                                type 
    4949                                        FROM 
     
    5151                                        WHERE 
    5252                                                id=".((int) $id); 
    53                  
     53 
    5454                                $therecord = $this->db->fetchArray($this->db->query($querystatement)); 
    5555 
    56                         } else {                 
    57                          
     56                        } else { 
     57 
    5858                                $therecord["type"] = "client"; 
    59                                  
     59 
    6060                        }//endif id 
    6161 
    62                         ?><input type="hidden" id="clienttype" name="clienttype"  <?php if($id) echo 'value="'.$therecord["type"].'"'?> /><?php  
    63                                                  
    64                 }//end method 
    65                  
    66          
     62                        ?><input type="hidden" id="clienttype" name="clienttype"  <?php if($id) echo 'value="'.$therecord["type"].'"'?> /><?php 
     63 
     64                }//end method 
     65 
     66 
    6767                function updateStatus($invoiceid,$statusid,$statusdate,$assignedtoid){ 
    68          
     68 
    6969                        $querystatement="DELETE FROM invoicestatushistory WHERE invoiceid=".$invoiceid." AND invoicestatusid=".$statusid; 
    7070                        $queryresult=$this->db->query($querystatement); 
    71                          
     71 
    7272                        $querystatement="INSERT INTO invoicestatushistory (invoiceid,invoicestatusid,statusdate,assignedtoid) values("; 
    7373                        $querystatement.=((int) $invoiceid).", "; 
    7474                        $querystatement.=((int) $statusid).", "; 
    75                  
     75 
    7676                        if($statusdate=="" || $statusdate=="0/0/0000") $tempdate="NULL"; 
    7777                        else{ 
     
    8383                        else 
    8484                                $querystatement.=((int) $assignedtoid); 
    85                  
     85 
    8686                        $querystatement.=")"; 
    87                  
     87 
    8888                        $queryresult=$this->db->query($querystatement); 
    8989                } 
    90          
    91          
     90 
     91 
    9292                function showPaymentSelect($id,$paymentMethods){ 
    9393                        ?><select name="paymentmethodid" id="paymentmethodid" onchange="showPaymentOptions()"> 
    9494                                <option value="0" <?php if($id==0) echo "selected=\"selected\""?>>&lt;none&gt;</option> 
    9595                        <?php foreach($paymentMethods as $method){?> 
    96                                 <option value="<?php echo $method["id"]?>" <?php if($id==$method["id"]) echo "selected=\"selected\""?>><?php echo $method["name"]?></option>     
     96                                <option value="<?php echo $method["id"]?>" <?php if($id==$method["id"]) echo "selected=\"selected\""?>><?php echo $method["name"]?></option> 
    9797                        <?php } ?> 
    9898                        </select> 
    99                         <?php  
     99                        <?php 
    100100                } 
    101          
    102          
     101 
     102 
    103103                function getDefaultStatus(){ 
    104                                  
     104 
    105105                        $querystatement="SELECT id FROM invoicestatuses WHERE invoicedefault=1"; 
    106106                        $queryresult=$this->db->query($querystatement); 
    107          
     107 
    108108                        $therecord=$this->db->fetchArray($queryresult); 
    109                          
     109 
    110110                        return $therecord["id"]; 
    111111                } 
    112                  
    113                  
     112 
     113 
    114114                function getStatuses($statusid){ 
    115                          
     115 
    116116                        global $phpbms; 
    117                          
     117 
    118118                        $querystatement=" 
    119                                 SELECT  
     119                                SELECT 
    120120                                        invoicestatuses.id, 
    121121                                        invoicestatuses.name, 
     
    125125                                        users.firstname, 
    126126                                        users.lastname 
    127                                 FROM  
     127                                FROM 
    128128                                        (invoicestatuses LEFT JOIN users ON invoicestatuses.defaultassignedtoid=users.id) 
    129                                 WHERE  
     129                                WHERE 
    130130                                        invoicestatuses.inactive=0 
    131131                                        OR invoicestatuses.id =".((int) $statusid)." 
    132                                 ORDER BY  
     132                                ORDER BY 
    133133                                        invoicestatuses.priority, 
    134134                                        invoicestatuses.name"; 
    135                                          
     135 
    136136                        $queryresult=$this->db->query($querystatement); 
    137                          
     137 
    138138                        $thereturn = array(); 
    139139 
    140140                        $phpbms->topJS[] = 'statuses=Array();'; 
    141141 
    142                          
     142 
    143143                        while($therecord = $this->db->fetchArray($queryresult)){ 
    144                                  
     144 
    145145                                $thereturn[] = $therecord; 
    146                          
     146 
    147147                                $phpbms->topJS[] = 'statuses['.$therecord["id"].']=Array();'; 
    148148                                $phpbms->topJS[] = 'statuses['.$therecord["id"].']["name"]="'.htmlQuotes($therecord["name"]).'";'; 
     
    150150                                $phpbms->topJS[] = 'statuses['.$therecord["id"].']["userid"]="'.htmlQuotes($therecord["defaultassignedtoid"]).'";'; 
    151151                                $phpbms->topJS[] = 'statuses['.$therecord["id"].']["firstname"]="'.htmlQuotes($therecord["firstname"]).'";'; 
    152                                 $phpbms->topJS[] = 'statuses['.$therecord["id"].']["lastname"]="'.htmlQuotes($therecord["lastname"]).'";';                               
    153                          
     152                                $phpbms->topJS[] = 'statuses['.$therecord["id"].']["lastname"]="'.htmlQuotes($therecord["lastname"]).'";'; 
     153 
    154154                        }//endwhile 
    155                          
     155 
    156156                        return $thereturn; 
    157                  
     157 
    158158                }//end function 
    159159 
    160                  
     160 
    161161                function displayStatusDropDown($statusid,$statuses){ 
    162          
     162 
    163163                        ?><select id="statusid" name="statusid" class="important"> 
    164164                                <?php 
     
    167167                                        ?><option value="<?php echo $therecord["id"]?>" <?php if($statusid==$therecord["id"]) echo "selected=\"selected\""?>><?php echo $therecord["name"]?></option><?php 
    168168                                }//endforeach 
    169                                  
     169 
    170170                                ?> 
    171171                        </select><?php 
     
    173173                }//end method 
    174174 
    175                  
     175 
    176176                function getPayments($paymentmethodid){ 
    177177 
    178178                        $querystatement=" 
    179                                 SELECT  
     179                                SELECT 
    180180                                        id, 
    181181                                        name, 
     
    183183                                        onlineprocess, 
    184184                                        processscript 
    185                                 FROM  
    186                                         paymentmethods  
    187                                 WHERE  
    188                                         inactive=0  
     185                                FROM 
     186                                        paymentmethods 
     187                                WHERE 
     188                                        inactive=0 
    189189                                        OR id=".((int) $paymentmethodid)." 
    190                                 ORDER BY  
     190                                ORDER BY 
    191191                                        priority, 
    192192                                        name"; 
    193                                          
     193 
    194194                        $queryresult=$this->db->query($querystatement); 
    195          
     195 
    196196                        $thereturn = array(); 
    197                          
     197 
    198198                        global $phpbms; 
    199                          
     199 
    200200                        $phpbms->topJS[] = 'paymentMethods=Array();'; 
    201                          
     201 
    202202                        while($therecord = $this->db->fetchArray($queryresult)) { 
    203                                 $thereturn[$therecord["id"]]=$therecord;                         
    204                                  
     203                                $thereturn[$therecord["id"]]=$therecord; 
     204 
    205205                                $phpbms->topJS[] = 'paymentMethods['.$therecord["id"].']=Array();'; 
    206206                                $phpbms->topJS[] = 'paymentMethods['.$therecord["id"].']["name"]="'.htmlQuotes($therecord["name"]).'";'; 
    207207                                $phpbms->topJS[] = 'paymentMethods['.$therecord["id"].']["type"]="'.htmlQuotes($therecord["type"]).'";'; 
    208208                                $phpbms->topJS[] = 'paymentMethods['.$therecord["id"].']["onlineprocess"]="'.htmlQuotes($therecord["onlineprocess"]).'";'; 
    209                                 $phpbms->topJS[] = 'paymentMethods['.$therecord["id"].']["processscript"]="'.htmlQuotes($therecord["processscript"]).'";';                       
     209                                $phpbms->topJS[] = 'paymentMethods['.$therecord["id"].']["processscript"]="'.htmlQuotes($therecord["processscript"]).'";'; 
    210210                        } 
    211                          
     211 
    212212                        return $thereturn; 
    213213 
    214214                }//end function 
    215          
    216          
     215 
     216 
    217217                function showShippingSelect($id,$shippingMethods){ 
    218218 
     
    220220                                <option value="0" <?php if($id==0) echo "selected=\"selected\""?>>&lt;none&gt;</option> 
    221221                        <?php foreach($shippingMethods as $method){?> 
    222                                 <option value="<?php echo $method["id"]?>" <?php if($id==$method["id"]) echo "selected=\"selected\""?>><?php echo $method["name"]?></option>     
     222                                <option value="<?php echo $method["id"]?>" <?php if($id==$method["id"]) echo "selected=\"selected\""?>><?php echo $method["name"]?></option> 
    223223                        <?php } ?> 
    224224                        </select> 
    225                         <?php  
     225                        <?php 
    226226 
    227227                }//end function 
    228          
    229          
     228 
     229 
    230230                function getShipping($shippingmethodid){ 
    231231 
    232232                        $querystatement=" 
    233                                 SELECT  
     233                                SELECT 
    234234                                        id, 
    235235                                        name, 
    236236                                        canestimate, 
    237237                                        estimationscript 
    238                                 FROM  
    239                                         shippingmethods  
    240                                 WHERE  
     238                                FROM 
     239                                        shippingmethods 
     240                                WHERE 
    241241                                        inactive=0 
    242                                         OR id=".((int) $shippingmethodid)."  
    243                                 ORDER BY  
     242                                        OR id=".((int) $shippingmethodid)." 
     243                                ORDER BY 
    244244                                        priority, 
    245245                                        name"; 
    246                                          
     246 
    247247                        $queryresult=$this->db->query($querystatement); 
    248          
     248 
    249249                        $thereturn=array(); 
    250                          
     250 
    251251                        global $phpbms; 
    252                          
     252 
    253253                        $phpbms->topJS[] = 'shippingMethods=Array();'; 
    254                          
     254 
    255255                        while($therecord = $this->db->fetchArray($queryresult)) { 
    256                                 $thereturn[$therecord["id"]]=$therecord;                         
    257                                  
     256                                $thereturn[$therecord["id"]]=$therecord; 
     257 
    258258                                $phpbms->topJS[] = 'shippingMethods['.$therecord["id"].']=Array();'; 
    259259                                $phpbms->topJS[] = 'shippingMethods['.$therecord["id"].']["name"]="'.htmlQuotes($therecord["name"]).'";'; 
     
    265265 
    266266                }//end function 
    267          
    268          
     267 
     268 
    269269                function showTaxSelect($id){ 
    270270 
     
    272272                        $querystatement="SELECT id,name,percentage FROM tax WHERE inactive=0 OR id=".$id." ORDER BY name"; 
    273273                        $queryresult=$this->db->query($querystatement); 
    274          
     274 
    275275                        ?><select name="taxareaid" id="taxareaid" onchange="getPercentage()" size="5"> 
    276276                                <option value="0" <?php if($id==0) echo "selected=\"selected\""?>>&lt;none&gt;</option> 
    277                                 <?php  
     277                                <?php 
    278278                                        while($therecord = $this->db->fetchArray($queryresult)){ 
    279279                                                ?><option value="<?php echo $therecord["id"]?>" <?php if($id==$therecord["id"]) echo "selected=\"selected\""?>><?php echo $therecord["name"].": ".$therecord["percentage"]."%"?></option><?php 
     
    281281                                ?> 
    282282                        </select><?php 
    283                          
     283 
    284284                }//end function 
    285          
    286          
     285 
     286 
    287287                function showDiscountSelect($id){ 
    288288 
     
    290290                        $querystatement="SELECT id,name,type,value FROM discounts WHERE inactive!=1 ORDER BY name"; 
    291291                        $queryresult=$this->db->query($querystatement); 
    292          
     292 
    293293                        ?><select name="discountid" id="discountid" size="8"> 
    294294                                <option value="0" <?php if($id==0) echo 'selected="selected"'?>>&lt;none&gt;</option> 
    295                                 <?php  
     295                                <?php 
    296296                                        while($therecord=$this->db->fetchArray($queryresult)){ 
    297297                                                if($therecord["type"]=="amount") 
     
    305305 
    306306                }//end function 
    307          
    308          
     307 
     308 
    309309                function getDiscount($id){ 
    310310 
    311311                        $therecord["name"]=""; 
    312312                        $therecord["value"]=0; 
    313                          
    314                         if(((int) $id)!=0){              
     313 
     314                        if(((int) $id)!=0){ 
    315315                                $querystatement="SELECT name,type,value FROM discounts WHERE id=".$id; 
    316316                                $queryresult=$this->db->query($querystatement); 
    317          
     317 
    318318                                $therecord=$this->db->fetchArray($queryresult); 
    319319                                if($therecord["type"]!="amount"){ 
     
    323323                                        $therecord["name"].=": ".numberToCurrency($therecord["value"]); 
    324324                        } 
    325          
     325 
    326326                        $therecord["name"]=htmlQuotes($therecord["name"]); 
    327          
     327 
    328328                        return $therecord; 
    329329 
    330330                }//end function 
    331                  
    332          
     331 
     332 
    333333                function getTax($id){ 
    334334 
    335335                        $therecord["name"]=""; 
    336                          
     336 
    337337                        if(((int) $id)!=0){ 
    338                                  
     338 
    339339                                $querystatement="SELECT name,percentage FROM tax WHERE id=".$id; 
    340340                                $queryresult=$this->db->query($querystatement); 
    341          
     341 
    342342                                if($this->db->numRows($queryresult)) 
    343343                                        $therecord=$this->db->fetchArray($queryresult); 
     
    346346                                $therecord["percentage"] = NULL; 
    347347                        } 
    348                          
     348 
    349349                        $therecord["name"]= htmlQuotes($therecord["name"]); 
    350                          
     350 
    351351                        return $therecord; 
    352352 
     
    355355 
    356356                function prospectToClient($clientid){ 
    357                  
     357 
    358358                        $updatestatement = " 
    359359                                UPDATE 
     
    364364                                WHERE 
    365365                                        id=".$clientid; 
    366                          
     366 
    367367                        $this->db->query($updatestatement); 
    368                  
     368 
    369369                }//end function 
    370                  
     370 
    371371                // CLASS OVERRIDES ====================================================================================== 
    372                  
     372 
    373373                function getDefaults(){ 
    374374                        $therecord = parent::getDefaults(); 
    375                          
     375 
    376376                        if(isset($_GET["cid"])) 
    377377                                $therecord["clientid"] = $_GET["cid"]; 
    378                         else  
     378                        else 
    379379                                $therecord["clientid"]=""; 
    380                                  
     380 
    381381                        $therecord["type"] = "Order"; 
    382382                        $therecord["statusid"] = $this->getDefaultStatus(); 
     
    393393                        $therecord["discountname"]=$discountinfo["name"]; 
    394394                        $therecord["discount"]=$discountinfo["value"]; 
    395                  
     395 
    396396                        $taxinfo = $this->getTax($therecord["taxareaid"]); 
    397397                        $therecord["taxname"]=$taxinfo["name"]; 
     
    404404                        return $therecord; 
    405405                } 
    406                  
    407                  
     406 
     407 
    408408                function getRecord($id){ 
    409                  
     409 
    410410                        $therecord = parent::getRecord($id); 
    411          
     411 
    412412                        $discountinfo=$this->getDiscount($therecord["discountid"]); 
    413413                        $therecord["discountname"]=$discountinfo["name"]; 
    414414                        $therecord["discount"]=$discountinfo["value"]; 
    415                  
     415 
    416416                        $taxinfo = $this->getTax($therecord["taxareaid"]); 
    417417                        $therecord["taxname"]=$taxinfo["name"]; 
    418418 
    419419                        $therecord["amountdue"] = $therecord["totalti"] - $therecord["amountpaid"]; 
    420                          
     420 
    421421                        $querystatement = "SELECT hascredit, creditlimit FROM clients WHERE id=".$therecord["clientid"]; 
    422422                        $queryresult = $this->db->query($querystatement); 
    423                          
     423 
    424424                        $therecord = array_merge($this->db->fetchArray($queryresult), $therecord); 
    425425 
     
    427427                                $querystatement = "SELECT SUM(`amount` - `paid`) AS amtopen FROM aritems WHERE `status` = 'open' AND clientid=".$therecord["clientid"]." AND posted=1"; 
    428428                                $queryresult = $this->db->query($querystatement); 
    429                                  
     429 
    430430                                $arrecord = $this->db->fetchArray($queryresult); 
    431                                  
     431 
    432432                                $therecord["creditleft"] = $therecord["creditlimit"] - $arrecord["amtopen"]; 
    433433                        } else 
    434434                                $therecord["creditleft"] =0; 
    435                                  
     435 
    436436                        return $therecord; 
    437437                } 
    438                  
    439                  
     438 
     439 
    440440                function prepareVariables($variables){ 
    441                                          
     441 
    442442                        $variables["totaltni"] = currencyToNumber($variables["totaltni"]); 
    443443                        $variables["discountamount"] = currencyToNumber($variables["discountamount"]); 
     
    446446                        $variables["shipping"] = currencyToNumber($variables["shipping"]); 
    447447                        $variables["tax"] = currencyToNumber($variables["tax"]); 
    448                         $variables["amountpaid"] = currencyToNumber($variables["amountpaid"]);   
    449          
     448                        $variables["amountpaid"] = currencyToNumber($variables["amountpaid"]); 
     449 
    450450                        if($variables["type"]=="Invoice" && $variables["invoicedate"] == "") 
    451451                                $variables["invoicedate"] = dateToString(mktime()); 
    452          
     452 
    453453                        if($variables["taxpercentage"]=="" or  $variables["taxpercentage"]=="0" or $variables["taxpercentage"]=="0.0") 
    454454                                $variables["taxpercentage"]="NULL"; 
    455          
     455 
    456456                        $variables["taxpercentage"]=str_replace("%","",$variables["taxpercentage"]); 
    457          
     457 
    458458                        if($variables["type"]=="VOID"){ 
    459459                                $variables["totaltni"]=0; 
     
    461461                                $variables["amountpaid"]=0; 
    462462                        } 
    463                                  
     463 
    464464                        return $variables; 
    465465                } 
    466                  
     466 
    467467                function addressUpdate($variables, $invoiceid, $modifiedby, $method){ 
    468468                // Updates/Inserts address records (billing or shipping )for the sales order's corresponding client 
     
    472472                                        $idprefix = "shipto"; 
    473473                                break; 
    474                                  
     474 
    475475                                case "billing": 
    476476                                        $varprefix = ""; 
     
    478478                                break; 
    479479                        }//endswitch 
    480                          
     480 
    481481                        switch($variables[$idprefix."saveoptions"]){ 
    482                          
     482 
    483483                                case "updateAddress": 
    484484                                        if($variables[$idprefix."addressid"]){ 
    485                                                  
     485 
    486486                                                $address = new addresses($this->db, 306); 
    487                                                  
     487 
    488488                                                $addressRecord = $address->getRecord($variables[$idprefix."addressid"]); 
    489                                                  
     489 
    490490                                                if($varprefix == "shipto") 
    491491                                                        $addressRecord["shiptoname"] = $variables["shiptoname"]; 
     
    496496                                                $addressRecord["postalcode"] = $variables[$varprefix."postalcode"]; 
    497497                                                $addressRecord["country"] = $variables[$varprefix."country"]; 
    498                                                  
     498 
    499499                                                $address->updateRecord($addressRecord, $modifiedby); 
    500                                                  
     500 
    501501                                        }//endif 
    502                                          
     502 
    503503                                        break; 
    504                          
     504 
    505505                                case "createAddress": 
    506506                                        $addresstorecord = new addresstorecord($this->db,306); 
    507                                          
     507 
    508508                                        if($varprefix == "shipto") 
    509509                                                $addressRecord["shiptoname"] = $variables["shiptoname"]; 
     
    519519                                        $atrRecord["shiptodefault"] = 0; 
    520520                                        $atrRecord["notes"] = "Created from sales order #".$invoiceid; 
    521                                          
     521 
    522522                                        $newAtrID = $addresstorecord->insertRecord($atrRecord, $modifiedby); 
    523                                          
     523 
    524524                                        $atrRecord = $addresstorecord->getRecord($newAtrID); 
    525                          
     525 
    526526                                        //Need to connect the sales order to the new address record 
    527527                                        $updatestatement = " 
     
    532532                                                WHERE 
    533533                                                        id = ".$invoiceid; 
    534                                          
     534 
    535535                                        $this->db->query($updatestatement); 
    536                                          
     536 
    537537                                        break; 
    538                          
     538 
    539539                        }//endswitch - saveoptions 
    540                          
     540 
    541541                }//end method - addressUpdate 
    542                  
    543                  
     542 
     543 
    544544                function updateRecord($variables, $modifiedby = NULL){ 
    545          
     545 
    546546                        if($modifiedby === NULL) 
    547547                                $modifiedby = $_SESSION["userinfo"]["id"]; 
    548                  
    549          
     548 
     549 
    550550                        if($variables["oldType"]=="Invoice") 
    551551                                return false; 
    552          
     552 
    553553                        $variables = $this->prepareVariables($variables); 
    554          
     554 
    555555                        if(!hasRights(20)){ 
    556                          
     556 
    557557                                unset($this->fields["paymentmethodid"]); 
    558558                                unset($this->fields["checkno"]); 
     
    564564                                unset($this->fields["transactionid"]); 
    565565 
    566                         }//endif                         
     566                        }//endif 
    567567 
    568568                        if(parent::updateRecord($variables, $modifiedby)){ 
    569          
     569 
    570570                                if($variables["lineitemschanged"]==1){ 
    571571 
    572572                                        $lineitems = new lineitems($this->db, $variables["id"]); 
    573                                         $lineitems->set($variables["thelineitems"], $modifiedby);                
    574                                  
     573                                        $lineitems->set($variables["thelineitems"], $modifiedby); 
     574 
    575575                                }//endif 
    576                          
     576 
    577577                                if($variables["statuschanged"]==1) 
    578                                         $this->updateStatus($variables["id"],$variables["statusid"],$variables["statusdate"],$variables["assignedtoid"]);                
    579  
    580                                 // Check to see if we need to update/create the client addresses from the  
     578                                        $this->updateStatus($variables["id"],$variables["statusid"],$variables["statusdate"],$variables["assignedtoid"]); 
     579 
     580                                // Check to see if we need to update/create the client addresses from the 
    581581                                // billing address 
    582582                                if($variables["billingsaveoptions"] != "orderOnly" || $variables["shiptosaveoptions"] != "orderOnly"){ 
    583                                          
     583 
    584584                                        require_once("addresses.php"); 
    585585                                        require_once("addresstorecord.php"); 
    586                                          
     586 
    587587                                        $this->addressUpdate($variables, $variables["id"], $modifiedby, "billing"); 
    588588                                        $this->addressUpdate($variables, $variables["id"], $modifiedby, "shipping"); 
    589                                          
     589 
    590590                                }//end if 
    591                                  
     591 
    592592                        }//end if 
    593                          
     593 
    594594                        if($variables["clienttype"] == "prospect" && $variables["type"] == "Order") 
    595595                                $this->prospectToClient($variables["clientid"]); 
    596                          
     596 
    597597                        //reset field after updating (if unset by rights management) 
    598598                        $this->getTableInfo(); 
    599599                } 
    600          
    601          
    602          
     600 
     601 
     602 
    603603                function insertRecord($variables, $createdby = NULL){ 
    604          
     604 
    605605                        if($createdby === NULL) 
    606606                                $createdby = $_SESSION["userinfo"]["id"]; 
    607          
     607 
    608608                        $variables = $this->prepareVariables($variables); 
    609          
     609 
    610610                        $newid = parent::insertRecord($variables, $createdby); 
    611                          
     611 
    612612                        if($variables["billingsaveoptions"] != "orderOnly" || $variables["shiptosaveoptions"] != "orderOnly"){ 
    613                                  
     613 
    614614                                require_once("addresses.php"); 
    615615                                require_once("addresstorecord.php"); 
    616                                  
     616 
    617617                                $this->addressUpdate($variables, $newid, $createdby, "billing"); 
    618618                                $this->addressUpdate($variables, $newid, $createdby, "shipping"); 
    619                                  
     619 
    620620                        }//end if 
    621                          
     621 
    622622                        if($variables["lineitemschanged"]==1){ 
    623                                  
     623 
    624624                                $lineitems = new lineitems($this->db, $newid); 
    625625                                $lineitems->set($variables["thelineitems"],$createdby); 
    626                                  
     626 
    627627                        }//end if 
    628                  
     628 
    629629                        if($variables["statuschanged"]==1) 
    630630                                $this->updateStatus($newid,$variables["statusid"],$variables["statusdate"],$variables["assignedtoid"]); 
     
    632632                        if($variables["clienttype"] == "prospect" && $variables["type"] == "Order") 
    633633                                $this->prospectToClient($variables["clientid"]); 
    634          
     634 
    635635                        return $newid; 
    636                  
     636 
    637637                }//end method - insertRecord 
    638                  
     638 
    639639        }//end class 
    640640 
    641641 
    642         // LINE ITEMS CLASS  
     642        // LINE ITEMS CLASS 
    643643        // ============================================================================================== 
    644644        class lineitems{ 
    645          
     645 
    646646                var $queryresult = NULL; 
    647          
     647 
    648648                function lineitems($db, $invoiceid, $invoicetype = "Order"){ 
    649                          
     649 
    650650                        $this->db = $db; 
    651651                        $this->invoiceid = ((int) $invoiceid); 
    652652                        $this->invoicetype = $invoicetype; 
    653                          
    654                 }//end method 
    655                  
    656                  
     653 
     654                }//end method 
     655 
     656 
    657657                function get(){ 
    658                  
     658 
    659659                        $querystatement = " 
    660660                                SELECT 
     
    666666                                        lineitems.taxable, 
    667667                                        lineitems.quantity, 
    668                                         lineitems.unitprice,  
    669                                         lineitems.unitcost,  
     668                                        lineitems.unitprice, 
     669                                        lineitems.unitcost, 
    670670                                        lineitems.unitweight, 
    671671                                        lineitems.memo 
     
    676676                                ORDER BY 
    677677                                        lineitems.displayorder"; 
    678                                          
     678 
    679679                        $this->queryresult = $this->db->query($querystatement); 
    680                  
    681                 }//end method 
    682                  
    683                  
     680 
     681                }//end method 
     682 
     683 
    684684                function show(){ 
    685                  
     685 
    686686                        if($this->queryresult === NULL) 
    687687                                $this->get(); 
    688                  
     688 
    689689                        $count = 1; 
    690690                        while($therecord = $this->db->fetchArray($this->queryresult)){ 
    691                          
     691 
    692692                                ?><tr id="li<?php echo $count?>" class="lineitems"> 
    693                                  
     693 
    694694                                        <td colspan="2" class="lineitemsLeft" <?php if($this->invoicetype == "Void" || $this->invoicetype == "Invoice") echo 'nowrap="nowrap"'?>> 
    695695                                                <input type="hidden" id="li<?php echo $count?>ProductID" value="<?php echo $therecord["productid"]?>"/> 
     
    706706                                                </div> 
    707707                                        </td> 
    708                                          
     708 
    709709                                        <td><input id="li<?php echo $count?>Memo" class="lineitemMemos" value="<?php echo formatVariable($therecord["memo"])?>"/></td> 
    710                                          
     710 
    711711                                        <td><input id="li<?php echo $count?>UnitPrice" class="fieldCurrency lineitemPrices" value="<?php echo formatVariable($therecord["unitprice"], "currency")?>"/></td> 
    712712                                        <td><input id="li<?php echo $count?>Quantity" class="lineitemQuantities" value="<?php echo formatVariable($therecord["quantity"], "real")?>"/></td> 
    713713                                        <td><input id="li<?php echo $count?>Extended" class="uneditable fieldCurrency lineitemExtendeds" readonly="readonly" value="<?php echo formatVariable($therecord["quantity"] * $therecord["unitprice"], "currency")?>"/></td> 
    714                                          
     714 
    715715                                        <td class="lineitemsButtonTDs"> 
    716716                                                <div id="li<?php echo $count?>ButtonsDiv" class="lineitemsButtonDivs"> 
     
    718718                                                        <button type="button" id="li<?php echo $count?>ButtonMoveUp" class="graphicButtons buttonUp LIUpButtons" title="Move Item Up"><span>Up</span></button><br /> 
    719719                                                        <button type="button" id="li<?php echo $count?>ButtonMoveDown" class="graphicButtons buttonDown LIDnButtons" title="Move Item Down"><span>Dn</span></button><br /> 
    720                                                 </div>                                           
     720                                                </div> 
    721721                                        </td> 
    722                                          
     722 
    723723                                </tr><?php 
    724                          
     724 
    725725                                $count++; 
    726                          
     726 
    727727                        }//endwhile 
    728                  
    729                 }//end method 
    730                  
    731                  
     728 
     729                }//end method 
     730 
     731 
    732732                function set($itemlist, $userid = NULL){ 
    733                  
     733 
    734734                        if(!$userid) 
    735735                                $userid = $_SESSION["userinfo"]["id"]; 
    736                  
     736 
    737737                        $deletestatement = " 
    738738                                DELETE FROM 
     
    740740                                WHERE 
    741741                                        invoiceid = ".$this->invoiceid; 
    742                          
     742 
    743743                        $this->db->query($deletestatement); 
    744                          
     744 
    745745                        $itemsArray = explode(";;", $itemlist); 
    746                          
     746 
    747747                        $count = 0; 
    748                          
     748 
    749749                        foreach($itemsArray as $item){ 
    750                          
     750 
    751751                                $itemRecord = explode("::", $item); 
    752752                                if(count($itemRecord) > 1){ 
    753                                  
     753 
    754754                                        $insertstatement =" 
    755755                                                INSERT INTO 
    756756                                                        lineitems( 
    757                                                                 invoiceid,  
    758                                                                 productid,  
     757                                                                invoiceid, 
     758                                                                productid, 
    759759                                                                memo, 
    760                                                                 taxable,  
     760                                                                taxable, 
    761761                                                                unitweight, 
    762762                                                                unitcost, 
     
    772772                                                        ".$this->invoiceid.", 
    773773                                                        ".((int) $itemRecord[0]).", 
    774                                                         '".$itemRecord[1]."', 
     774                                                        '".mysql_real_escape_string($itemRecord[1])."', 
    775775                                                        ".((int) $itemRecord[2]).", 
    776776                                                        ".((real) $itemRecord[3]).", 
     
    782782                                                        NOW(), 
    783783                                                        ".$userid.", 
    784                                                         NOW()                                                    
     784                                                        NOW() 
    785785                                                )"; 
    786                                          
     786 
    787787                                        $this->db->query($insertstatement); 
    788                                                  
     788 
    789789                                        $count++; 
    790                                          
     790 
    791791                                }//end if 
    792                                  
    793                         }//endforeach                                            
    794                  
    795                 }//end method 
    796          
     792 
     793                        }//endforeach 
     794 
     795                }//end method 
     796 
    797797        }//end class 
    798          
     798 
    799799}// end if 
    800800 
     
    804804 
    805805                function email_invoice(){ 
    806                  
     806 
    807807                                if(DEMO_ENABLED == "true") 
    808808                                        return "Functionality disabled in demo."; 
    809                  
     809 
    810810                                $this->db->setEncoding("latin1"); 
    811811 
    812812                                include("modules/bms/report/invoices_pdf_class.php"); 
    813                                  
     813 
    814814                                $processed = 0; 
    815                                  
     815 
    816816                                foreach($this->idsArray as $id){ 
    817                                          
    818                                         $report = new invoicePDF($this->db, 'P', 'in', 'Letter');                                
    819                                  
     817 
     818                                        $report = new invoicePDF($this->db, 'P', 'in', 'Letter'); 
     819 
    820820                                        $report->generate("invoices.id = ".$id); 
    821                                          
     821 
    822822                                        if($report->output("email")) 
    823823                                                $processed++; 
    824                                                  
    825                                 }//end foreach                                                           
     824 
     825                                }//end foreach 
    826826 
    827827                                $this->db->setEncoding(); 
    828                                  
    829                                  
     828 
     829 
    830830                                $count = count($this->idsArray); 
    831831                                $message = $processed." of ".$count." invoice PDF"; 
     
    833833                                if($count !== 1) 
    834834                                        $message .= "s"; 
    835                                          
     835 
    836836                                $message .= " e-mailed to client."; 
    837837 
    838838                                return $message; 
    839                                  
     839 
    840840                }//end method 
    841841 
    842842 
    843843                function email_quote(){ 
    844                  
     844 
    845845                                if(DEMO_ENABLED == "true") 
    846846                                        return "Functionality disabled in demo."; 
    847                  
     847 
    848848                                $this->db->setEncoding("latin1"); 
    849          
     849 
    850850                                $noOutput = true; 
    851851                                include("modules/bms/report/invoices_pdf_class.php"); 
    852852                                include("modules/bms/report/invoices_pdfquote.php"); 
    853                                  
     853 
    854854                                $processed = 0; 
    855                                  
     855 
    856856                                foreach($this->idsArray as $id){ 
    857                                          
    858                                         $report = new quotePDF($this->db, 'P', 'in', 'Letter');                          
    859                                  
     857 
     858                                        $report = new quotePDF($this->db, 'P', 'in', 'Letter'); 
     859 
    860860                                        $report->generate("invoices.id = ".$id); 
    861                                          
     861 
    862862                                        if($report->output("email")) 
    863863                                                $processed++; 
    864                                                  
    865                                 }//end foreach                                                           
     864 
     865                                }//end foreach 
    866866 
    867867                                $this->db->setEncoding(); 
    868                                  
    869                                  
     868 
     869 
    870870                                $count = count($this->idsArray); 
    871871                                $message = $processed." of ".$count." quote PDF"; 
     
    873873                                if($count !== 1) 
    874874                                        $message .= "s"; 
    875                                          
     875 
    876876                                $message .= " e-mailed to client."; 
    877877 
    878878                                return $message; 
    879                                  
    880                 }//end method    
    881          
    882          
     879 
     880                }//end method 
     881 
     882 
    883883                function _mark_as_status($statusid){ 
    884                  
     884 
    885885                        //Look up shippings defaults 
    886886                        $querystatement="SELECT defaultassignedtoid,setreadytopost FROM invoicestatuses WHERE id = ".$statusid; 
     
    889889                        if($this->db->numRows($queryresult)){ 
    890890                                $therecord = $this->db->fetchArray($queryresult); 
    891          
     891 
    892892                                if($therecord["defaultassignedtoid"]!="") 
    893893                                        $assignedtoid = $therecord["defaultassignedtoid"]; 
    894894                                else 
    895895                                        $assignedtoid="NULL"; 
    896                                          
     896 
    897897                                $readytopost = $therecord["setreadytopost"]; 
    898898                        } else { 
     
    906906                        // items must be updated individually 
    907907                        $querystatement = " 
    908                                 SELECT  
     908                                SELECT 
    909909                                        invoices.id, 
    910910                                        paymentmethods.type, 
     
    914914                                WHERE 
    915915                                        ".$whereclause; 
    916                          
     916 
    917917                        $queryresult = $this->db->query($querystatement); 
    918                          
     918 
    919919                        $count=0; 
    920920                        while($therecord = $this->db->fetchArray($queryresult)){ 
    921                          
     921 
    922922                                $updatestatement = " 
    923                                         UPDATE  
    924                                                 invoices  
    925                                         SET  
    926                                                 invoices.statusdate=NOW(),  
     923                                        UPDATE 
     924                                                invoices 
     925                                        SET 
     926                                                invoices.statusdate=NOW(), 
    927927                                                assignedtoid=".$assignedtoid.", 
    928928                                                modifiedby=".$_SESSION["userinfo"]["id"].", "; 
     
    939939                                        else 
    940940                                                $updatestatement.="amountpaid = totalti,"; 
    941                          
     941 
    942942                                }//endif 
    943                                  
     943 
    944944                                $updatestatement.=" 
    945945                                                invoices.statusid=".$statusid.", 
    946                                                 modifieddate=NOW()                                               
    947                                         WHERE  
     946                                                modifieddate=NOW() 
     947                                        WHERE 
    948948                                                id =".$therecord["id"]; 
    949949 
    950950                                $updateresult = $this->db->query($updatestatement); 
    951                                  
     951 
    952952                                //delete conlflicting history 
    953953                                $querystatement="DELETE FROM invoicestatushistory WHERE invoiceid=".$therecord["id"]." AND invoicestatusid=".$statusid; 
    954954                                $deleteresult = $this->db->query($querystatement); 
    955                                  
     955 
    956956                                //insert new history 
    957957                                $querystatement="INSERT INTO invoicestatushistory (invoiceid,invoicestatusid,statusdate,assignedtoid) values ("; 
     
    959959                                $querystatement.=$assignedtoid; 
    960960                                $querystatement.=")"; 
    961                                 $insertresult = $this->db->query($querystatement);                               
    962                                  
     961                                $insertresult = $this->db->query($querystatement); 
     962 
    963963                                $count++; 
    964                                  
    965                         }//endwhile                      
    966                          
     964 
     965                        }//endwhile 
     966 
    967967                        $message = $this->buildStatusMessage($count); 
    968968 
    969969                        return $message; 
    970                          
     970 
    971971                }//end private method 
    972972 
    973                  
     973 
    974974                function mark_ashipped(){ 
    975                          
     975 
    976976                        $statusid = 4; //The default id for "shipped"; 
    977                          
     977 
    978978                        $message = $this->_mark_as_status($statusid); 
    979                          
     979 
    980980                        return $message." marked as shipped."; 
    981                          
    982                 }//end method 
    983          
    984          
     981 
     982                }//end method 
     983 
     984 
    985985                function mark_rtp(){ 
    986                          
     986 
    987987                        $whereclause=$this->buildWhereClause(); 
    988988                        $whereclause="(".$whereclause.") AND invoices.type='Order'"; 
     
    991991                        // items must be updated individually 
    992992                        $querystatement = " 
    993                                 SELECT  
     993                                SELECT 
    994994                                        invoices.id, 
    995995                                        paymentmethods.type, 
     
    999999                                WHERE 
    10001000                                        ".$whereclause; 
    1001                          
     1001 
    10021002                        $queryresult = $this->db->query($querystatement); 
    1003                          
     1003 
    10041004                        $count=0; 
    10051005                        while($therecord = $this->db->fetchArray($queryresult)){ 
    10061006                                $updatestatement =" 
    1007                                         UPDATE  
    1008                                                 invoices  
    1009                                         SET  
     1007                                        UPDATE 
     1008                                                invoices 
     1009                                        SET 
    10101010                                                modifiedby=".$_SESSION["userinfo"]["id"].", "; 
    10111011 
    10121012                                if(!$therecord["invoicedate"] || $therecord["invoicedate"] == "0000-00-00") 
    10131013                                        $updatestatement.="invoicedate = NOW(), "; 
    1014                                  
     1014 
    10151015                                if($therecord["type"] == "receivable") 
    10161016                                        $updatestatement.="amountpaid = 0, "; 
     
    10211021                                                readytopost=1, 
    10221022                                                modifieddate=NOW() 
    1023                                         WHERE  
     1023                                        WHERE 
    10241024                                                id =".$therecord["id"]; 
    10251025 
    10261026                                $updateresult = $this->db->query($updatestatement); 
    1027                                  
     1027 
    10281028                                $count++; 
    1029                                  
     1029 
    10301030                        }//endwhile 
    10311031 
    10321032                        $message = $this->buildStatusMessage($count); 
    10331033                        return $message." marked ready to post."; 
    1034                  
    1035                 }//end method 
    1036                  
     1034 
     1035                }//end method 
     1036 
    10371037 
    10381038                function mark_aspaid(){ 
    1039                  
     1039 
    10401040                        $whereclause = $this->buildWhereClause(); 
    10411041                        $whereclause = trim(" 
    10421042                                invoices.type='Order' 
    1043                                 AND paymentmethods.type != 'receivable'  
     1043                                AND paymentmethods.type != 'receivable' 
    10441044                                AND (".$whereclause.")"); 
    1045                                  
     1045 
    10461046                        $querystatement =" 
    10471047                                SELECT 
    10481048                                        invoices.id 
    10491049                                FROM 
    1050                                         invoices LEFT JOIN paymentmethods ON invoices.paymentmethodid = paymentmethods.id  
     1050                                        invoices LEFT JOIN paymentmethods ON invoices.paymentmethodid = paymentmethods.id 
    10511051                                WHERE 
    10521052                                        ".$whereclause; 
    10531053 
    10541054                        $queryresult = $this->db->query($querystatement); 
    1055                          
     1055 
    10561056                        $count = 0; 
    10571057                        while($therecord = $this->db->fetchArray($queryresult)){ 
    1058                          
     1058 
    10591059                                $updatestatement = " 
    1060                                         UPDATE invoices  
    1061                                         SET  
     1060                                        UPDATE invoices 
     1061                                        SET 
    10621062                                                invoices.amountpaid=invoices.totalti, 
    1063                                                 modifiedby=\"".$_SESSION["userinfo"]["id"]."\",  
    1064                                                 modifieddate=NOW()  
     1063                                                modifiedby=\"".$_SESSION["userinfo"]["id"]."\", 
     1064                                                modifieddate=NOW() 
    10651065                                        WHERE 
    10661066                                                id=".$therecord["id"]; 
    1067                                  
     1067 
    10681068                                $this->db->query($updatestatement); 
    1069                                  
     1069 
    10701070                                $count++; 
    1071                                  
     1071 
    10721072                        }//endwhile 
    1073                          
    1074                          
     1073 
     1074 
    10751075                        $message=$this->buildStatusMessage($count); 
    10761076                        $message.=" paid in full."; 
    1077                  
     1077 
    10781078                        return $message; 
    1079                          
    1080                 }//end method 
    1081          
    1082          
     1079 
     1080                }//end method 
     1081 
     1082 
    10831083                function mark_asinvoice(){ 
    1084                  
     1084 
    10851085                        $whereclause = $this->buildWhereClause(); 
    1086                  
     1086 
    10871087                        include_once("include/post_class.php"); 
    10881088                        defineInvoicePost(); 
    1089                          
     1089 
    10901090                        $invoicePost = new invoicePost($this->db); 
    1091                          
     1091 
    10921092                        $count = $invoicePost->post($whereclause); 
    1093                  
     1093 
    10941094                        $message = $this->buildStatusMessage($count); 
    10951095                        $message .= " posted as invoice"; 
    1096                          
     1096 
    10971097                        return $message; 
    10981098                }//end method 
    1099                  
    1100          
     1099 
     1100 
    11011101                function delete_record(){ 
    1102                  
     1102 
    11031103                        //passed variable is array of user ids to be revoked 
    11041104                        $whereclause = $this->buildWhereClause(); 
    1105                          
     1105 
    11061106                        $querystatement = " 
    1107                                 UPDATE  
    1108                                         invoices  
    1109                                 SET  
     1107                                UPDATE 
     1108                                        invoices 
     1109                                SET 
    11101110                                        invoices.type='VOID',"; 
    1111                                          
     1111 
    11121112                        if(CLEAR_PAYMENT_ON_INVOICE){ 
    11131113                                $querystatement .=" 
     
    11191119                                "; 
    11201120                        }//endif 
    1121                          
     1121 
    11221122                        $querystatement .=" 
    1123                                         modifiedby = ".$_SESSION["userinfo"]["id"].",  
    1124                                         modifieddate = NOW()  
    1125                                 WHERE (".$whereclause.")  
     1123                                        modifiedby = ".$_SESSION["userinfo"]["id"].", 
     1124                                        modifieddate = NOW() 
     1125                                WHERE (".$whereclause.") 
    11261126                                        AND invoices.type!='Invoice';"; 
    1127                                          
     1127 
    11281128                        $queryresult = $this->db->query($querystatement); 
    1129                          
     1129 
    11301130                        $message = $this->buildStatusMessage(); 
    11311131                        $message.=" voided."; 
    1132                  
     1132 
    11331133                        return $message; 
    11341134                } 
    1135          
     1135 
    11361136        }//end class 
    11371137}//end if 
     
    11541154 
    11551155        class invoicePost extends tablePost{ 
    1156                  
     1156 
    11571157                function invoicePost($db, $modifiedby = NULL){ 
    1158                          
     1158 
    11591159                        parent::tablePost($db, $modifiedby); 
    1160                          
     1160 
    11611161                }//end method 
    11621162 
    11631163 
    11641164                function prepareWhere($whereclause=NULL){ 
    1165                          
     1165 
    11661166                        $this->whereclause = ""; 
    1167                          
    1168                         if($whereclause)                         
     1167 
     1168                        if($whereclause) 
    11691169                                $this->whereclause = "(".$whereclause.") AND "; 
    1170                          
     1170 
    11711171                        $this->whereclause .= "invoices.type='Order' AND readytopost = 1"; 
    1172                  
    1173                 }//end method 
    1174                  
    1175                  
     1172 
     1173                }//end method 
     1174 
     1175 
    11761176                function post($whereclause=NULL){ 
    1177                          
     1177 
    11781178                        if($whereclause) 
    11791179                                $this->prepareWhere($whereclause); 
    1180                          
    1181                          
     1180 
     1181 
    11821182                        $querystatement = " 
    11831183                                SELECT 
     
    11971197                                        ".$this->whereclause; 
    11981198                        $queryresult = $this->db->query($querystatement); 
    1199                          
     1199 
    12001200                        $count =0; 
    12011201                        while($therecord = $this->db->fetchArray($queryresult)){ 
     
    12081208 
    12091209                                if(CLEAR_PAYMENT_ON_INVOICE){ 
    1210                                                                  
     1210 
    12111211                                        $therecord = obfuscatePayment($therecord); 
    1212                                          
     1212 
    12131213                                        if($therecord["ccnumber"]) 
    12141214                                                $updatestatement .= "ccnumber = '".$therecord["ccnumber"]."', "; 
     
    12161216                                        if($therecord["ccexpiration"]) 
    12171217                                                $updatestatement .= "ccexpiration = '".$therecord["ccexpiration"]."', "; 
    1218                                  
     1218 
    12191219                                        if($therecord["ccverification"]) 
    12201220                                                $updatestatement .= "ccverification = '".$therecord["ccverification"]."', "; 
     
    12251225                                        if($therecord["accountnumber"]) 
    12261226                                                $updatestatement .= "accountnumber = NULL, "; 
    1227                                                  
     1227 
    12281228                                }//endif - CLEAR_PAYMENT_ON_INVOICE 
    1229                                                  
     1229 
    12301230                                if(!$therecord["invoicedate"] || $therecord["invoicedate"] == "0000-00-00"){ 
    12311231                                        $therecord["invoicedate"] = dateToString(mktime(0,0,0),"SQL"); 
     
    12331233                                        $updatestatement .= " 
    12341234                                                `invoicedate` = NOW(), "; 
    1235                                                  
     1235 
    12361236                                }//end if 
    1237                                  
     1237 
    12381238                                $updatestatement .= " 
    12391239                                                `modifiedby` = ".$this->modifiedby.", 
     
    12411241                                        WHERE 
    12421242                                                `id` = ".$therecord["id"]; 
    1243                                                  
     1243 
    12441244                                $updateresult = $this->db->query($updatestatement); 
    1245                                                  
     1245 
    12461246                                if($therecord["type"] == "receivable") { 
    12471247                                        // if type = AR, create AR item 
    1248                                          
     1248 
    12491249                                        $arrecord["type"] = "invoice"; 
    12501250                                        $arrecord["status"] = "open"; 
    12511251                                        $arrecord["posted"] = 1; 
    1252                                         $arrecord["amount"] = $therecord["totalti"];                                             
     1252                                        $arrecord["amount"] = $therecord["totalti"]; 
    12531253                                        $arrecord["itemdate"] = dateToString(stringToDate($therecord["invoicedate"],"SQL") ); 
    12541254                                        $arrecord["clientid"] = $therecord["clientid"]; 
    12551255                                        $arrecord["relatedid"] = $therecord["id"]; 
    1256                                          
     1256 
    12571257                                        if(!class_exists("phpbmsTable")) 
    12581258                                                include("include/tables.php"); 
    1259                                                  
     1259 
    12601260                                        $aritems = new phpbmsTable($this->db, 303); 
    1261                                          
     1261 
    12621262                                        $aritems->insertRecord($arrecord,$this->modifiedby); 
    1263                                          
     1263 
    12641264                                }//endif 
    1265                                  
     1265 
    12661266                                $count++; 
    1267                                  
     1267 
    12681268                        }//endwhile 
    1269                          
     1269 
    12701270                        return $count; 
    1271                          
    1272                 }//end method 
    1273                  
     1271 
     1272                }//end method 
     1273 
    12741274        }//end class invoicePost 
    12751275 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.