mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 19:47:34 -05: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)
 | 
					    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', ''),
 | 
					                        '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),
 | 
					                        'cost' => $this->getFloat($data, 'item_notes') ?: $this->getProduct($data, 'item_product', 'cost', 0),
 | 
				
			||||||
                        'qty' => $this->getFloat($data, 'item_quantity') ?: 1,
 | 
					                        'qty' => $this->getFloat($data, 'item_quantity') ?: 1,
 | 
				
			||||||
                        'tax_name1' => $this->getTaxName($this->getString($data, 'item_tax1')),
 | 
					                        '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')),
 | 
					                        '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')),
 | 
					                        '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')),
 | 
					                        'tax_rate2' => $this->getTaxRate($this->getString($data, 'item_tax2')) ?: $this->getProduct($data, 'item_product', 'tax_rate2', 0),
 | 
				
			||||||
                    ],
 | 
					                    ],
 | 
				
			||||||
                ],
 | 
					                ],
 | 
				
			||||||
            ];
 | 
					            ];
 | 
				
			||||||
 | 
				
			|||||||
@ -21,10 +21,29 @@
 | 
				
			|||||||
    @if ($account->custom_invoice_text_label2)
 | 
					    @if ($account->custom_invoice_text_label2)
 | 
				
			||||||
        <td>{{ $account->custom_invoice_text_label2 }}</td>
 | 
					        <td>{{ $account->custom_invoice_text_label2 }}</td>
 | 
				
			||||||
    @endif
 | 
					    @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>
 | 
					</tr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@foreach ($recurringInvoices as $invoice)
 | 
					@foreach ($recurringInvoices as $invoice)
 | 
				
			||||||
    @if (!$invoice->client->is_deleted)
 | 
					    @if (!$invoice->client->is_deleted)
 | 
				
			||||||
 | 
					        @foreach ($invoice->invoice_items as $item)
 | 
				
			||||||
            <tr>
 | 
					            <tr>
 | 
				
			||||||
                <td>{{ $invoice->present()->client }}</td>
 | 
					                <td>{{ $invoice->present()->client }}</td>
 | 
				
			||||||
                <td>{{ $invoice->present()->email }}</td>
 | 
					                <td>{{ $invoice->present()->email }}</td>
 | 
				
			||||||
@ -48,6 +67,25 @@
 | 
				
			|||||||
                @if ($account->custom_invoice_label2)
 | 
					                @if ($account->custom_invoice_label2)
 | 
				
			||||||
                    <td>{{ $invoice->custom_text_value2 }}</td>
 | 
					                    <td>{{ $invoice->custom_text_value2 }}</td>
 | 
				
			||||||
                @endif
 | 
					                @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>
 | 
					            </tr>
 | 
				
			||||||
 | 
					        @endforeach
 | 
				
			||||||
    @endif
 | 
					    @endif
 | 
				
			||||||
@endforeach
 | 
					@endforeach
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user