mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 13:27:33 -04:00 
			
		
		
		
	Working on CSV import/export
This commit is contained in:
		
							parent
							
								
									ad60af661d
								
							
						
					
					
						commit
						01b721f4f0
					
				| @ -215,7 +215,7 @@ class BaseTransformer extends TransformerAbstract | ||||
|      */ | ||||
|     public function getInvoiceNumber($number) | ||||
|     { | ||||
|         return str_pad(trim($number), 4, '0', STR_PAD_LEFT); | ||||
|         return $number ? str_pad(trim($number), 4, '0', STR_PAD_LEFT) : null; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
| @ -41,10 +41,10 @@ class InvoiceTransformer extends BaseTransformer | ||||
|                         'notes' => $this->getString($data, 'item_notes') ?: $this->getProduct($data, 'item_product', 'notes', ''), | ||||
|                         'cost' => $this->getFloat($data, 'item_notes') ?: $this->getProduct($data, 'item_product', 'cost', 0), | ||||
|                         'qty' => $this->getFloat($data, 'item_quantity') ?: 1, | ||||
|                         'tax_name1' => $this->getTaxName($this->getString($data, 'item_tax1')), | ||||
|                         'tax_rate1' => $this->getTaxRate($this->getString($data, 'item_tax1')), | ||||
|                         'tax_name2' => $this->getTaxName($this->getString($data, 'item_tax2')), | ||||
|                         'tax_rate2' => $this->getTaxRate($this->getString($data, 'item_tax2')), | ||||
|                         'tax_name1' => $this->getTaxName($this->getString($data, 'item_tax1')) ?: $this->getProduct($data, 'item_product', 'tax_name1', ''), | ||||
|                         'tax_rate1' => $this->getTaxRate($this->getString($data, 'item_tax1')) ?: $this->getProduct($data, 'item_product', 'tax_rate1', 0), | ||||
|                         'tax_name2' => $this->getTaxName($this->getString($data, 'item_tax2')) ?: $this->getProduct($data, 'item_product', 'tax_name2', ''), | ||||
|                         'tax_rate2' => $this->getTaxRate($this->getString($data, 'item_tax2')) ?: $this->getProduct($data, 'item_product', 'tax_rate2', 0), | ||||
|                     ], | ||||
|                 ], | ||||
|             ]; | ||||
|  | ||||
| @ -21,33 +21,71 @@ | ||||
|     @if ($account->custom_invoice_text_label2) | ||||
|         <td>{{ $account->custom_invoice_text_label2 }}</td> | ||||
|     @endif | ||||
|     <td>{{ trans('texts.item_product') }}</td> | ||||
|     <td>{{ trans('texts.item_notes') }}</td> | ||||
|     @if ($account->custom_invoice_item_label1) | ||||
|         <td>{{ $account->custom_invoice_item_label1 }}</td> | ||||
|     @endif | ||||
|     @if ($account->custom_invoice_item_label2) | ||||
|         <td>{{ $account->custom_invoice_item_label2 }}</td> | ||||
|     @endif | ||||
|     <td>{{ trans('texts.item_cost') }}</td> | ||||
|     <td>{{ trans('texts.item_quantity') }}</td> | ||||
|     @if ($account->invoice_item_taxes) | ||||
|         <td>{{ trans('texts.item_tax_name') }}</td> | ||||
|         <td>{{ trans('texts.item_tax_rate') }}</td> | ||||
|         @if ($account->enable_second_tax_rate) | ||||
|             <td>{{ trans('texts.item_tax_name') }}</td> | ||||
|             <td>{{ trans('texts.item_tax_rate') }}</td> | ||||
|         @endif | ||||
|     @endif | ||||
| </tr> | ||||
| 
 | ||||
| @foreach ($recurringInvoices as $invoice) | ||||
|     @if (!$invoice->client->is_deleted) | ||||
|         <tr> | ||||
|             <td>{{ $invoice->present()->client }}</td> | ||||
|             <td>{{ $invoice->present()->email }}</td> | ||||
|             @if ($multiUser) | ||||
|                 <td>{{ $invoice->present()->user }}</td> | ||||
|             @endif | ||||
|             <td>{{ $invoice->present()->frequency }}</td> | ||||
|             <td>{{ $account->formatMoney($invoice->balance, $invoice->client) }}</td> | ||||
|             <td>{{ $account->formatMoney($invoice->amount, $invoice->client) }}</td> | ||||
|             <td>{{ $invoice->po_number }}</td> | ||||
|             <td>{{ $invoice->present()->status }}</td> | ||||
|             @if ($account->custom_invoice_label1) | ||||
|                 <td>{{ $invoice->custom_value1 }}</td> | ||||
|             @endif | ||||
|             @if ($account->custom_invoice_label2) | ||||
|                 <td>{{ $invoice->custom_value2 }}</td> | ||||
|             @endif | ||||
|             @if ($account->custom_invoice_label1) | ||||
|                 <td>{{ $invoice->custom_text_value1 }}</td> | ||||
|             @endif | ||||
|             @if ($account->custom_invoice_label2) | ||||
|                 <td>{{ $invoice->custom_text_value2 }}</td> | ||||
|             @endif | ||||
|         </tr> | ||||
|         @foreach ($invoice->invoice_items as $item) | ||||
|             <tr> | ||||
|                 <td>{{ $invoice->present()->client }}</td> | ||||
|                 <td>{{ $invoice->present()->email }}</td> | ||||
|                 @if ($multiUser) | ||||
|                     <td>{{ $invoice->present()->user }}</td> | ||||
|                 @endif | ||||
|                 <td>{{ $invoice->present()->frequency }}</td> | ||||
|                 <td>{{ $account->formatMoney($invoice->balance, $invoice->client) }}</td> | ||||
|                 <td>{{ $account->formatMoney($invoice->amount, $invoice->client) }}</td> | ||||
|                 <td>{{ $invoice->po_number }}</td> | ||||
|                 <td>{{ $invoice->present()->status }}</td> | ||||
|                 @if ($account->custom_invoice_label1) | ||||
|                     <td>{{ $invoice->custom_value1 }}</td> | ||||
|                 @endif | ||||
|                 @if ($account->custom_invoice_label2) | ||||
|                     <td>{{ $invoice->custom_value2 }}</td> | ||||
|                 @endif | ||||
|                 @if ($account->custom_invoice_label1) | ||||
|                     <td>{{ $invoice->custom_text_value1 }}</td> | ||||
|                 @endif | ||||
|                 @if ($account->custom_invoice_label2) | ||||
|                     <td>{{ $invoice->custom_text_value2 }}</td> | ||||
|                 @endif | ||||
|                 <td>{{ $item->product_key }}</td> | ||||
|                 <td>{{ $item->notes }}</td> | ||||
|                 @if ($account->custom_invoice_item_label1) | ||||
|                     <td>{{ $item->custom_value1 }}</td> | ||||
|                 @endif | ||||
|                 @if ($account->custom_invoice_item_label2) | ||||
|                     <td>{{ $item->custom_value2 }}</td> | ||||
|                 @endif | ||||
|                 <td>{{ $item->cost }}</td> | ||||
|                 <td>{{ $item->qty }}</td> | ||||
|                 @if ($account->invoice_item_taxes) | ||||
|                     <td>{{ $item->tax_name1 }}</td> | ||||
|                     <td>{{ $item->tax_rate1 }}</td> | ||||
|                     @if ($account->enable_second_tax_rate) | ||||
|                         <td>{{ $item->tax_name2 }}</td> | ||||
|                         <td>{{ $item->tax_rate2 }}</td> | ||||
|                     @endif | ||||
|                 @endif | ||||
|             </tr> | ||||
|         @endforeach | ||||
|     @endif | ||||
| @endforeach | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user