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


PHP Account::GetLedger方法代码示例

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


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

示例1: ClaimsPerEmployee

    public static function ClaimsPerEmployee()
    {
        $statement = FinancialStatements::LedgerStatement($_GET['sid'], $_GET['period'], $_GET['all']);
        $ledger = Account::GetLedger($_GET['sid']);
        echo '
				<div class="logo">
				  <h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5>
				  <h4 style="text-transform:uppercase">' . $ledger->ledgerName . ' LEDGER STATEMENT</h4>';
        if ($_GET['period'] != '' && $_GET['period']) {
            echo '<h5 style="margin-top:-10px">Period: ' . $_GET['period'] . '</h5>';
        }
        echo '</div>

				<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>DATE</td>
			          <td>TX ID</td>
			          <td>DR</td>
			          <td>CR</td>
			          <td>DESCRIPTION</td>
			          <td>BALANCE</td>
			        </tr>
			      </thead>
			      <tbody>';
        $cr = 0.0;
        $dr = 0.0;
        foreach ($statement as $item) {
            echo '<tr>
			      <td style="width:90px">' . $item['when_booked'] . '</td>
			      <td style="width: 100px">' . $item['transaction_id'] . '</td>';
            if ($item['effect'] == 'cr') {
                $cr += $item['amount'];
                echo '<td style="width: 100px"></td>
			      	<td style="width: 100px"><script>document.writeln((' . $item['amount'] . ').formatMoney(2, \'.\', \',\'));</script></td>';
            } else {
                $dr += $item['amount'];
                echo '<td style="width: 100px"><script>document.writeln((' . $item['amount'] . ').formatMoney(2, \'.\', \',\'));</script></td>
			      	<td style="width: 100px"></td>';
            }
            echo '<td style="max-width: 220px;">' . $item['description'] . '</td>
			      <td class="text-right" style="padding: 0 5px;"><script>document.writeln((' . $item['balance'] . ').formatMoney(2, \'.\', \',\'));</script></td>
			    </tr>';
        }
        echo '</tbody>
			    </table>
			    <div class="logo">
				    <p style="margin: 5px 0 0 5px">Total Debits: <b>Ksh. <script>document.writeln((' . $dr . ').formatMoney(2, \'.\', \',\'));</script></b></p>
				    <p style="margin: 5px 0 0 5px">Total Credits: <b>Ksh. <script>document.writeln((' . $cr . ').formatMoney(2, \'.\', \',\'));</script></b></p>			    
				    <p style="margin: 5px 0 0 5px">Balance: <b>Ksh. <script>document.writeln((' . ($dr - $cr) . ').formatMoney(2, \'.\', \',\'));</script></b></p>
				</div>';
    }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:52,代码来源:reports.php

示例2: prepare

 private function prepare()
 {
     if ($this->transactionType->name == 'General Purchase Invoice' || $this->transactionType->name == 'Purchase Order Invoice') {
         $this->transactionType->drAccounts = [];
         $this->transactionType->drRatios = [];
         foreach ($this->invoice->lineItems as $invoiceLine) {
             $amount = $invoiceLine->quantity * $invoiceLine->unitPrice;
             $taxamt = $amount * ($invoiceLine->tax / 100);
             $discamt = ($amount + $taxamt) * ($invoiceLine->discount / 100);
             $lineTotal = $amount + $taxamt - $discamt;
             $this->transactionType->drAccounts[] = Account::GetLedger($invoiceLine->ledgerId);
             $this->transactionType->drRatios[] = floatval($lineTotal / $this->amount->amount);
             Logger::Log(get_class($this), 'Test', 'Credit: ' . $this->amount->amount . ', Ratio:' . floatval($lineTotal / $this->amount->amount));
         }
     }
     for ($i = 0; $i < count($this->transactionType->drAccounts); $i++) {
         $amount = new Money(floatval($this->amount->amount * $this->transactionType->drRatios[$i]), $this->amount->unit);
         $this->add(new AccountEntry($this, $this->transactionType->drAccounts[$i], $amount, $this->date, 'dr'));
     }
     for ($i = 0; $i < count($this->transactionType->crAccounts); $i++) {
         $amount = new Money(floatval($this->amount->amount * $this->transactionType->crRatios[$i]), $this->amount->unit);
         $this->add(new AccountEntry($this, $this->transactionType->crAccounts[$i], $amount, $this->date, 'cr'));
     }
     return true;
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:25,代码来源:DomainSCM.php

示例3: __construct

 function __construct($ledgerId, $clientId)
 {
     parent::__construct("Sales Receipt");
     $this->drAccounts[] = Account::GetLedger($ledgerId);
     $this->drRatios[] = 1;
     $this->crAccounts[] = Account::GetAccountByNo($clientId, 'clients', 'Debtors');
     $this->crRatios[] = 1;
     //this info should originate from the database, insert ignore protocol included
     //$this->code = self::GetCode('PayPal');
     //parent::__construct();
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:11,代码来源:DomainCRM.php

示例4: prepare

 private function prepare()
 {
     foreach ($this->txentries as $entry) {
         if ($entry['effect'] == 'dr') {
             $amount = new Money(floatval($entry['amount']), $this->amount->unit);
             $this->add(new AccountEntry($this, Account::GetLedger($entry['lid']), $amount, $this->date, 'dr'));
         } else {
             if ($entry['effect'] == 'cr') {
                 $amount = new Money(floatval($entry['amount']), $this->amount->unit);
                 $this->add(new AccountEntry($this, Account::GetLedger($entry['lid']), $amount, $this->date, 'cr'));
             }
         }
     }
     return true;
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:15,代码来源:DomainAccounting.php

示例5: __construct

 function __construct($ledgerId, $employeeId, $type)
 {
     parent::__construct("Employee Benefit - " . $type);
     $this->drAccounts[] = Account::GetAccountByNo($employeeId, 'employees', 'PAYROLL');
     $this->drRatios[] = 1;
     $this->crAccounts[] = Account::GetLedger($ledgerId);
     $this->crRatios[] = 1;
 }
开发者ID:xander-mbaka,项目名称:momentum,代码行数:8,代码来源:DomainHRM.php


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