当前位置: 首页>>代码示例>>PHP>>正文


PHP Project::GetProject方法代码示例

本文整理汇总了PHP中Project::GetProject方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::GetProject方法的具体用法?PHP Project::GetProject怎么用?PHP Project::GetProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Project的用法示例。


在下文中一共展示了Project::GetProject方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testRaiseInvoice

 public function testRaiseInvoice()
 {
     $client = Client::GetClient(2);
     $project = Project::GetProject(4);
     $quotes = $project->quotations;
     $quote = $quotes[0];
     $discount = 5;
     $invoice = Invoice::RaiseQuotationInvoice($quote->id, $discount);
     //in session
     $invoice->post();
     $this->assertInstanceOf('Invoice', $invoice);
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:12,代码来源:OperationsTest.php

示例2: ProjectReport

    public static function ProjectReport()
    {
        $project = Project::GetProject($_GET['sid']);
        //, $_GET['period'], $_GET['all']
        echo '
				<div class="logo">
				  <h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5>
				  <h4>' . $project->name . '</h4><h5>CLIENT: ' . $project->client->name . '</h5>';
        /*if ($_GET['period'] != '' && $_GET['period'] ) {
        			echo '<h5 style="margin-top:-10px">Period: '.$_GET['period'].'</h5>';
        		}	*/
        echo '</div>
				<h5>PROJECT ACTIVITIES</h5>
				<table class="table table-bordered table-striped" style="text-align:center;margin-left:0;margin-right:0;width:760px;font-size:12px;">
			      <thead class="title">
			        <tr>
			          <td>NO</td>
			          <td>SERVICE</td>
			          <td>TASK</td>
			          <td>QTY</td>
			          <td>DATE PROPOSED</td>
			          <td>DATE EXECUTED</td>
					  <td>STATUS</td>
			        </tr>
			      </thead>
			      <tbody>';
        $count = 1;
        foreach ($project->activities as $activity) {
            if ($activity->status == 0) {
                $status = '<td style="color: #027c97">SCHEDULED</td>';
            } elseif ($activity->status == 1) {
                $status = '<td style="color: #e8e624">ON GOING</td>';
            } elseif ($activity->status == 2) {
                $status = '<td style="color: #e81c34">STALLED</td>';
            } elseif ($activity->status == 3) {
                $status = '<td style="color: #27c97b">COMPLETED</td>';
            } elseif ($activity->status == 4) {
                $status = '<td style="color: #9c2488">SUSPENDED</td>';
            }
            echo '<tr>
			      <td>' . $count . '</td>
			      <td>' . $activity->service . '</td>
			      <td>' . $activity->task . '</td>
			      <td>' . $activity->instances . '</td>
			      <td>' . $activity->requestDate . '</td>
			      <td>' . $activity->executionDate . '</td>' . $status . '
			      </tr>';
            $count++;
        }
        echo '</tbody>
			    </table>';
        echo '<h5>QUOTED ITEMS</h5>
					<table class="table table-bordered table-striped" style="text-align:center;margin-left:0;margin-right:0;width:760px;font-size:12px;">
			      <thead class="title">
			        <tr>
			          <td>NO</td>
			          <td>SERVICE</td>
			          <td>DESCRIPTION</td>
			          <td>QTY</td>
			          <td>UNIT PRICE</td>
			          <td>VAT</td>
			          <td>SUB-TOTAL</td>					  
			        </tr>
			      </thead>
			      <tbody>';
        $count = 1;
        $amount = 0.0;
        foreach ($project->quotations as $quote) {
            foreach ($quote->lineItems as $item) {
                echo '<tr>
				      <td>' . $count . '</td>
				      <td>' . $item->itemName . '</td>
				      <td>' . $item->itemDesc . '</td>
				      <td>' . $item->quantity . '</td>
				      <td>' . $item->unitPrice . '</td>
				      <td>' . $item->tax . '</td>
				      <td><script>document.writeln((' . ($item->quantity * $item->unitPrice + $item->quantity * $item->unitPrice * $item->tax / 100) . ').formatMoney(2, \'.\', \',\'));</script></td>
				      </tr>';
                $count++;
            }
            $amount += $quote->total;
        }
        echo '</tbody>
			    </table>
			    <div class="logo">
			    <h5 style="margin: 5px 0 0 5px;float:right">Total Quoted: <b>Ksh. <script>document.writeln((' . $amount . ').formatMoney(2, \'.\', \',\'));</script></b></h5>				    
			   </div>';
        $invoices = SalesInvoice::GetProjectInvoices($_GET['sid'], $project->client);
        echo '<h5>INVOICED ITEMS</h5>
					<table class="table table-bordered table-striped" style="text-align:center;margin-left:0;margin-right:0;width:760px;font-size:12px;">
			      <thead class="title">
			        <tr>
			          <td>NO</td>
			          <td>DATE</td>
			          <td>ITEM</td>
			          <td>DESCRIPTION</td>
			          <td>QTY</td>
			          <td>UNIT PRICE</td>
			          <td>VAT</td>
			          <td>SUB-TOTAL</td>					  
//.........这里部分代码省略.........
开发者ID:xander-mbaka,项目名称:momentum,代码行数:101,代码来源:reports.php

示例3: count

<?php

//The aim of a test is to test for the end user use cases, this is their originating principle - BDD, TDD
require_once '/../domain/LSOfficeDomain.php';
$client = Client::GetParty(2);
$project = Project::GetProject(20);
echo count($project->getActivities());
//$invoice->post();
?>


开发者ID:xander-mbaka,项目名称:momentum,代码行数:9,代码来源:test.php

示例4: post

 public function post()
 {
     if ($this->prepare()) {
         $voucher = TransactionProcessor::ProcessPurchaseTX($this);
         if ($voucher) {
             if ($this->invoice->orderIds != null && $this->invoice->orderIds != '') {
                 $this->invoice->loadOrders();
                 foreach ($this->invoice->orders as $order) {
                     $order->setpurchased();
                 }
             }
             if ($this->invoice->projectId != 0) {
                 $project = Project::GetProject($this->invoice->projectId);
                 $project->debit($this->amount);
             }
             //TX successful
             $this->invoice->updateStatus(1);
             $extras = new stdClass();
             $extras->amount = $this->invoice->amount->amount;
             $extras->tax = $this->invoice->taxamt->amount;
             $extras->discount = $this->invoice->discamt->amount;
             $extras->total = $this->invoice->total->amount;
             $extras->balance = $this->invoice->balance->amount;
             //$voucher->setExtras($extras);
             return $voucher;
         } else {
             return false;
         }
     }
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:30,代码来源:DomainSCM.php

示例5: getProject

 public function getProject($projectid)
 {
     if ($this->validateAdmin()) {
         echo json_encode(Project::GetProject($projectid));
     } else {
         echo 0;
     }
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:8,代码来源:index.php

示例6: processLatestProjects

 private function processLatestProjects()
 {
     try {
         $sql = 'SELECT id FROM projects ORDER BY modified DESC LIMIT 0,6';
         $res = DatabaseHandler::GetAll($sql);
         $sql2 = 'SELECT count(id) FROM projects';
         $res2 = DatabaseHandler::GetOne($sql2);
         $projects = [];
         foreach ($res as $project) {
             $projects[] = Project::GetProject(intval($project['id']));
         }
         $obj = new stdClass();
         $obj->projects = $projects;
         $obj->total = $res2;
         $this->latestProjects = $obj;
     } catch (Exception $e) {
     }
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:18,代码来源:LSOfficeDomain.php

示例7: ReceivePayment

    public static function ReceivePayment($clientId, $purpose, $ledgerId, $amount, $voucherno, $descr)
    {
        try {
            $datetime = new DateTime();
            if ($purpose == "G") {
                $ref = $descr;
                $purp = 0;
            } else {
                $prj = Project::GetProject(intval($purpose));
                $ref = $prj->name . " - " . $descr;
                $purp = $purpose;
            }
            $sql = 'INSERT INTO receipts (client_id, project_id, voucher_no, amount, ledger_id, description, status) VALUES 
			(' . $clientId . ', ' . $purp . ', "' . $voucherno . '", ' . $amount . ', ' . $ledgerId . ', "' . $ref . '", 0)';
            DatabaseHandler::Execute($sql);
            $sql2 = 'SELECT * FROM receipts WHERE client_id = ' . $clientId . ' ORDER BY id DESC LIMIT 0,1';
            $res = DatabaseHandler::GetRow($sql2);
            return self::initialize($res);
        } catch (Exception $e) {
        }
    }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:21,代码来源:DomainAccounting.php


注:本文中的Project::GetProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。