mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 07:57:33 -05:00 
			
		
		
		
	add alias to task searvice from task product
This commit is contained in:
		
							parent
							
								
									66445631ee
								
							
						
					
					
						commit
						1a066f2f9f
					
				@ -292,9 +292,18 @@ class Design extends BaseDesign
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        $elements = [];
 | 
					        $elements = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Some of column can be aliased. This is simple workaround for these.
 | 
				
			||||||
 | 
					        $aliases = [
 | 
				
			||||||
 | 
					            '$task.product_key' => '$task.service',
 | 
				
			||||||
 | 
					        ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) {
 | 
					        foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) {
 | 
				
			||||||
 | 
					            if (array_key_exists($column, $aliases)) {
 | 
				
			||||||
 | 
					                $elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label'];
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
                $elements[] = ['element' => 'th', 'content' => $column . '_label'];
 | 
					                $elements[] = ['element' => 'th', 'content' => $column . '_label'];
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $elements;
 | 
					        return $elements;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -316,6 +316,7 @@ class HtmlEngine
 | 
				
			|||||||
        $data['$task.tax_name2'] = ['value' => '', 'label' => ctrans('texts.tax')];
 | 
					        $data['$task.tax_name2'] = ['value' => '', 'label' => ctrans('texts.tax')];
 | 
				
			||||||
        $data['$task.tax_name3'] = ['value' => '', 'label' => ctrans('texts.tax')];
 | 
					        $data['$task.tax_name3'] = ['value' => '', 'label' => ctrans('texts.tax')];
 | 
				
			||||||
        $data['$task.line_total'] = ['value' => '', 'label' => ctrans('texts.line_total')];
 | 
					        $data['$task.line_total'] = ['value' => '', 'label' => ctrans('texts.line_total')];
 | 
				
			||||||
 | 
					        $data['$task.service'] = ['value' => '', 'label' => ctrans('texts.service')];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($this->settings->signature_on_pdf) {
 | 
					        if ($this->settings->signature_on_pdf) {
 | 
				
			||||||
            $data['$contact.signature'] = ['value' => $this->invitation->signature_base64, 'label' => ctrans('texts.signature')];
 | 
					            $data['$contact.signature'] = ['value' => $this->invitation->signature_base64, 'label' => ctrans('texts.signature')];
 | 
				
			||||||
 | 
				
			|||||||
@ -3311,4 +3311,6 @@ return [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    'billing_country' => 'Billing Country',
 | 
					    'billing_country' => 'Billing Country',
 | 
				
			||||||
    'shipping_country' => 'Shipping Country',
 | 
					    'shipping_country' => 'Shipping Country',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    'service' => 'Service',
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user