phpBMS

Show
Ignore:
Timestamp:
01/01/10 14:34:39 (2 years ago)
Author:
nate
Message:
  • Removed references to 'deposits' and replaced them with references to 'credits' (in relation to ar items and receipts).
  • Made sure that the type field for aritems should be able to take 'credit' but not 'deposit', and the update will change the references from deposit to credit (this time on the database side).
  • Fixed bugs with generateuuids.php and with the load open items button on the receipts add-edit.
Files:
1 modified

Legend:

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

    r672 r701  
    5555                                        `receiptitems`.`discount`, 
    5656                                        `receiptitems`.`taxadjustment`, 
    57                                         IF(`aritems`.`type` = 'credit', 'deposit', `aritems`.`type`) AS `type`, 
     57                                        `aritems`.`type`, 
    5858                                        `aritems`.`relatedid`, 
    5959                                        `aritems`.`itemdate`, 
     
    9898                                        $dueDate = " "; 
    9999 
    100                                 if($therecord["type"] == "deposit" && $therecord["relatedid"] == $receiptid){ 
     100                                if($therecord["type"] == "credit" && $therecord["relatedid"] == $receiptid){ 
    101101                                        $therecord["relatedid"] = ""; 
    102102                                        $therecord["amount"] = 0; 
     
    149149                        $this->db->query($deletestatement); 
    150150 
    151                         //remove any ar deposits created by ths receipt 
     151                        //remove any ar credits created by ths receipt 
    152152                        $deletestatement = "DELETE FROM aritems WHERE relatedid = '".mysql_real_escape_string($receiptid)."' AND `type` = 'credit'"; 
    153153                        $this->db->query($deletestatement); 
     
    155155                        foreach($itemlist as $itemRecord){ 
    156156 
    157                                 //if no ar uuid, or the deposit is from this record, we need to create the ar item 
    158                                 if(!$itemRecord["aritemid"] || ($itemRecord["relatedid"] == $receiptid && $itemRecord["type"] == "deposit") ){ 
     157                                //if no ar uuid, or the credit is from this record, we need to create the ar item 
     158                                if(!$itemRecord["aritemid"] || ($itemRecord["relatedid"] == $receiptid && $itemRecord["type"] == "credit") ){ 
    159159 
    160160                                        $arrecord = array(); 
     
    638638                                        aritems 
    639639                                WHERE 
    640                                         `type` = 'deposit' 
     640                                        `type` = 'credit' 
    641641                                        AND (".str_replace("uuid", "relatedid", $newWhere).")"; 
    642642 
     
    827827                                                aritems.status, 
    828828                                                aritems.relatedid, 
    829                                                 IF(`aritems`.`type` = 'credit', 'deposit', `aritems`.`type`) AS `type` 
     829                                                `aritems`.`type` 
    830830                                        FROM 
    831831                                                `receiptitems` INNER JOIN `aritems` ON `receiptitems`.`aritemid` = `aritems`.`uuid` 
     
    838838                                while($itemrecord = $this->db->fetchArray($itemsresult)){ 
    839839 
    840                                         if($itemrecord["relatedid"] == $therecord["uuid"] && $itemrecord["type"] == "deposit") 
     840                                        if($itemrecord["relatedid"] == $therecord["uuid"] && $itemrecord["type"] == "credit") 
    841841                                                $paid = $itemrecord["paid"]; 
    842842                                        else 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.