mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Billing Subs
This commit is contained in:
parent
ba91c96c40
commit
6be79ad022
@ -103,14 +103,32 @@ class BillingSubscriptionService
|
|||||||
|
|
||||||
//do we have a promocode? enter this as a line item.
|
//do we have a promocode? enter this as a line item.
|
||||||
if(strlen($data['coupon']) >=1)
|
if(strlen($data['coupon']) >=1)
|
||||||
$line_items = $this->createPromoLine($data);
|
$line_items[] = $this->createPromoLine($data);
|
||||||
|
|
||||||
return $line_items;
|
return $line_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createPromoLine($data)
|
private function createPromoLine($data)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$product = $this->billing_subscription->product;
|
||||||
|
|
||||||
|
$price = 0;
|
||||||
|
|
||||||
$item = new InvoiceItem;
|
$item = new InvoiceItem;
|
||||||
|
$item->quantity = 1;
|
||||||
|
$item->product_key = ctrans('texts.promo_code');
|
||||||
|
$item->notes = ctrans('texts.promo_code');
|
||||||
|
$item->cost = $price;
|
||||||
|
$item->tax_rate1 = $product->tax_rate1 ?: 0;
|
||||||
|
$item->tax_name1 = $product->tax_name1 ?: '';
|
||||||
|
$item->tax_rate2 = $product->tax_rate2 ?: 0;
|
||||||
|
$item->tax_name2 = $product->tax_name2 ?: '';
|
||||||
|
$item->tax_rate3 = $product->tax_rate3 ?: 0;
|
||||||
|
$item->tax_name3 = $product->tax_name3 ?: '';
|
||||||
|
|
||||||
|
return $item;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function convertInvoiceToRecurring()
|
private function convertInvoiceToRecurring()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user