Changeset 701 for trunk/phpbms/modules/bms/include/receipts.php
- Timestamp:
- 01/01/10 14:34:39 (2 years ago)
- Files:
-
- 1 modified
-
trunk/phpbms/modules/bms/include/receipts.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/bms/include/receipts.php
r672 r701 55 55 `receiptitems`.`discount`, 56 56 `receiptitems`.`taxadjustment`, 57 IF(`aritems`.`type` = 'credit', 'deposit', `aritems`.`type`) AS`type`,57 `aritems`.`type`, 58 58 `aritems`.`relatedid`, 59 59 `aritems`.`itemdate`, … … 98 98 $dueDate = " "; 99 99 100 if($therecord["type"] == " deposit" && $therecord["relatedid"] == $receiptid){100 if($therecord["type"] == "credit" && $therecord["relatedid"] == $receiptid){ 101 101 $therecord["relatedid"] = ""; 102 102 $therecord["amount"] = 0; … … 149 149 $this->db->query($deletestatement); 150 150 151 //remove any ar deposits created by ths receipt151 //remove any ar credits created by ths receipt 152 152 $deletestatement = "DELETE FROM aritems WHERE relatedid = '".mysql_real_escape_string($receiptid)."' AND `type` = 'credit'"; 153 153 $this->db->query($deletestatement); … … 155 155 foreach($itemlist as $itemRecord){ 156 156 157 //if no ar uuid, or the deposit is from this record, we need to create the ar item158 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") ){ 159 159 160 160 $arrecord = array(); … … 638 638 aritems 639 639 WHERE 640 `type` = ' deposit'640 `type` = 'credit' 641 641 AND (".str_replace("uuid", "relatedid", $newWhere).")"; 642 642 … … 827 827 aritems.status, 828 828 aritems.relatedid, 829 IF(`aritems`.`type` = 'credit', 'deposit', `aritems`.`type`) AS`type`829 `aritems`.`type` 830 830 FROM 831 831 `receiptitems` INNER JOIN `aritems` ON `receiptitems`.`aritemid` = `aritems`.`uuid` … … 838 838 while($itemrecord = $this->db->fetchArray($itemsresult)){ 839 839 840 if($itemrecord["relatedid"] == $therecord["uuid"] && $itemrecord["type"] == " deposit")840 if($itemrecord["relatedid"] == $therecord["uuid"] && $itemrecord["type"] == "credit") 841 841 $paid = $itemrecord["paid"]; 842 842 else