1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Fixes for client statements where no products / invoices are present

This commit is contained in:
David Bomba 2022-01-27 16:15:30 +11:00
parent 1668a3b684
commit 61f7cefae6
2 changed files with 12 additions and 9 deletions

View File

@ -156,7 +156,8 @@ class AuthorizePaymentMethod
$paymentOne = new PaymentType();
$paymentOne->setOpaqueData($op);
$contact = $this->authorize->client->primary_contact()->first();
$contact = $this->authorize->client->primary_contact()->first() ?: $this->authorize->client->contacts()->first();
$billto = false;
if ($contact) {

View File

@ -174,15 +174,17 @@ class Statement
$item->tax_rate1 = 5;
}
$product = Product::first();
//$product = Product::first();
$item->cost = (float) $product->cost;
$item->product_key = $product->product_key;
$item->notes = $product->notes;
$item->custom_value1 = $product->custom_value1;
$item->custom_value2 = $product->custom_value2;
$item->custom_value3 = $product->custom_value3;
$item->custom_value4 = $product->custom_value4;
$product = new \stdClass;
$item->cost = (float) 10;
$item->product_key = 'test';
$item->notes = 'test notes';
$item->custom_value1 = 'custom value1';
$item->custom_value2 = 'custom value2';
$item->custom_value3 = 'custom value3';
$item->custom_value4 = 'custom value4';
$line_items[] = $item;
}