phpBMS

Changeset 762

Show
Ignore:
Timestamp:
01/15/10 13:13:56 (2 years ago)
Author:
brieb
Message:
  • Fixed invoice creation error reporting
  • Added getDefaults to API and wrapper
Location:
trunk/phpbms/modules
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/api/apiwrapper.php

    r761 r762  
    258258 
    259259    }//end function 
     260 
     261 
     262    /** 
     263     * function getDefaults 
     264     * 
     265     */ 
     266 
     267    function getDefaults($tabledefuuid){ 
     268 
     269        $params["request"][0]["command"] = "getDefaults"; 
     270        $params["request"][0]["data"] = ""; 
     271        $params["request"][0]["tabledefid"] = $tabledefuuid; 
     272 
     273        $response = $this->_callServer($params); 
     274 
     275        if($response !== false) 
     276            return $response[0]; 
     277        else 
     278            return false; 
     279         
     280    }//end function getDefaults 
    260281 
    261282 
  • trunk/phpbms/modules/api/include/apiclass.php

    r760 r762  
    464464                        break; 
    465465 
     466                    case "getDefaults": 
     467 
     468                        include_once("include/tables.php"); 
     469 
     470                        if($hasTableClassOveride){ 
     471 
     472                            @ include_once("modules/".$modulename."/include/".$maintable.".php"); 
     473 
     474                            if(class_exists($maintable)){ 
     475 
     476                                $processor = new $maintable($this->db, $tabledefid); 
     477                                $processor->dateFormat =  $this->options->dateFormat; 
     478                                $processor->timeFormat =  $this->options->timeFormat; 
     479 
     480                            }else{ 
     481 
     482                                $processor = new phpbmsTable($this->db, $tabledefid); 
     483                                $processor->dateFormat =  $this->options->dateFormat; 
     484                                $processor->timeFormat =  $this->options->timeFormat; 
     485 
     486                            }//end if 
     487 
     488                        } else { 
     489 
     490                            $processor = new phpbmsTable($this->db, $tabledefid); 
     491                            $processor->dateFormat =  $this->options->dateFormat; 
     492                            $processor->timeFormat =  $this->options->timeFormat; 
     493 
     494                        }//end if 
     495 
     496                        $therecord = $processor->getDefaults(); 
     497                         
     498                        $this->_addToResponse("retrieved", "defaults retrieved in tabledef ".$tabledefid, $therecord); 
     499 
     500                       break; 
     501 
    466502                    case "insert": 
    467503                        //====================================================== 
     
    616652 
    617653                        if($errorMessage) 
    618                             $this->sendError("Update failed from request number ".$i, $errorMessage); 
     654                            $this->sendError("Get failed from request number ".$i, $errorMessage); 
    619655                        elseif(!$this->options->useUuid){ 
    620656                            $therecord = $processor->getRecord((int) $request["data"]["id"], $this->options->useUuid); 
  • trunk/phpbms/modules/bms/include/invoices.php

    r750 r762  
    625625                        $therecord["taxpercentage"]=$taxinfo["percentage"]; 
    626626                        $therecord["amountdue"]=0; 
     627                        $therecord["amountpaid"]=0; 
    627628 
    628629                        $therecord["hascredit"]=0; 
     
    632633                        $therecord["thelineitems"] = array(); 
    633634                        $therecord["cmid"] = ""; 
     635 
     636                        $therecord["lineitemschanged"] = ""; 
    634637 
    635638                        return $therecord; 
     
    833836                                        $this->verifyErrors[] = "The `statusid` field does not give an existing/acceptable status id number."; 
    834837 
    835                         }//end if 
     838                        } else { 
     839 
     840                                $this->verifyErrors[] = "The `statusid` field must be set."; 
     841 
     842                        }//end if 
    836843 
    837844                        //check booleans 
     
    11871194                                require_once("addresstorecord.php"); 
    11881195 
     1196                                if(!isset($variables["uuid"])) 
     1197                                    $variables["uuid"] = getUuid($this->db, $this->uuid, $newid); 
     1198 
    11891199                                $newuuid = mysql_real_escape_string($variables["uuid"]); 
    11901200 
     
    11941204                        }//end if 
    11951205 
     1206 
     1207                        if(!isset($variables["lineitemschanged"])) 
     1208                            $variables["lineitemschanged"] =''; 
    11961209 
    11971210                        if($variables["lineitemschanged"]==1){ 
     
    12061219                        }//end if 
    12071220 
     1221                        if(!isset($variables["statusdate"])) 
     1222                            $variables["statusdate"] =''; 
     1223 
     1224                        if(!isset($variables["assignedtoid"])) 
     1225                            $variables["assignedtoid"] =''; 
     1226 
    12081227                        //if($variables["statuschanged"]==1) 
    1209                                 $this->updateStatus($id,$variables["statusid"],$variables["statusdate"],$variables["assignedtoid"], $replace); 
     1228                        $this->updateStatus($id, $variables["statusid"], $variables["statusdate"], $variables["assignedtoid"], $replace); 
    12101229 
    12111230                        if($variables["clienttype"] == "prospect" && $variables["type"] == "Order") 
     
    20612080 
    20622081                                }//end foreach 
    2063                                  
     2082 
    20642083                                if($count == count($this->idsArray)) 
    20652084                                        $message = $count." related credit memo(s) have been created."; 
    20662085                                else 
    20672086                                        $message = $count." related credit memo(s) (of ".count($this->idsArray)." selected) have been created."; 
    2068                                  
     2087 
    20692088                                return $message; 
    20702089 
Scanned by Orvant Copyright © 2010 Kreotek, LLC. All Rights reserved.