mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:27:33 -05:00 
			
		
		
		
	Fixes for client statements where no products / invoices are present
This commit is contained in:
		
							parent
							
								
									1668a3b684
								
							
						
					
					
						commit
						61f7cefae6
					
				@ -156,7 +156,8 @@ class AuthorizePaymentMethod
 | 
				
			|||||||
        $paymentOne = new PaymentType();
 | 
					        $paymentOne = new PaymentType();
 | 
				
			||||||
        $paymentOne->setOpaqueData($op);
 | 
					        $paymentOne->setOpaqueData($op);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $contact = $this->authorize->client->primary_contact()->first();
 | 
					        $contact = $this->authorize->client->primary_contact()->first() ?: $this->authorize->client->contacts()->first();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $billto = false;
 | 
					        $billto = false;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if ($contact) {
 | 
					        if ($contact) {
 | 
				
			||||||
 | 
				
			|||||||
@ -174,15 +174,17 @@ class Statement
 | 
				
			|||||||
                $item->tax_rate1 = 5;
 | 
					                $item->tax_rate1 = 5;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $product = Product::first();
 | 
					            //$product = Product::first();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $item->cost = (float) $product->cost;
 | 
					            $product = new \stdClass;
 | 
				
			||||||
            $item->product_key = $product->product_key;
 | 
					
 | 
				
			||||||
            $item->notes = $product->notes;
 | 
					            $item->cost = (float) 10;
 | 
				
			||||||
            $item->custom_value1 = $product->custom_value1;
 | 
					            $item->product_key = 'test';
 | 
				
			||||||
            $item->custom_value2 = $product->custom_value2;
 | 
					            $item->notes = 'test notes';
 | 
				
			||||||
            $item->custom_value3 = $product->custom_value3;
 | 
					            $item->custom_value1 = 'custom value1';
 | 
				
			||||||
            $item->custom_value4 = $product->custom_value4;
 | 
					            $item->custom_value2 = 'custom value2';
 | 
				
			||||||
 | 
					            $item->custom_value3 = 'custom value3';
 | 
				
			||||||
 | 
					            $item->custom_value4 = 'custom value4';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $line_items[] = $item;
 | 
					            $line_items[] = $item;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user