InvoiceItemInlineForm.php in Commerce Invoice 8.2
File
src/Form/InvoiceItemInlineForm.php
View source
<?php
namespace Drupal\commerce_invoice\Form;
use Drupal\inline_entity_form\Form\EntityInlineForm;
class InvoiceItemInlineForm extends EntityInlineForm {
public function getEntityTypeLabels() {
return [
'singular' => $this
->t('invoice item'),
'plural' => $this
->t('invoice items'),
];
}
public function getTableFields($bundles) {
$fields = parent::getTableFields($bundles);
$fields['quantity'] = [
'type' => 'field',
'label' => $this
->t('Quantity'),
'weight' => 2,
];
$fields['unit_price'] = [
'type' => 'field',
'label' => $this
->t('Unit price'),
'weight' => 3,
];
return $fields;
}
}