Laravel\Cashier\Invoice::subtotal PHP Метод

subtotal() публичный Метод

Get the total of the invoice (before discounts).
public subtotal ( ) : string
Результат string
    public function subtotal()
    {
        return $this->formatAmount(max(0, $this->transaction->amount + $this->discountAmount()));
    }

Usage Example

 public function testGettingSubtotal()
 {
     $invoice = new Invoice($billable = m::mock('Laravel\\Cashier\\Contracts\\Billable'), (object) ['subtotal' => 10000]);
     $billable->shouldReceive('formatCurrency')->andReturn(100.0);
     $this->assertEquals(100.0, $invoice->subtotal());
 }