| 1 | <?php |
||
| 8 | class Payable extends DataExtension { |
||
| 9 | |||
| 10 | private static $has_many = array( |
||
| 11 | 'Payments' => 'Payment' |
||
| 12 | ); |
||
| 13 | |||
| 14 | public function updateCMSFields(FieldList $fields) { |
||
| 15 | $fields->addFieldToTab("Root.Payments", |
||
| 16 | GridField::create("Payments", "Payments", $this->owner->Payments(), |
||
| 17 | GridFieldConfig_RecordEditor::create() |
||
| 18 | ->removeComponentsByType('GridFieldAddNewButton') |
||
| 19 | ->removeComponentsByType('GridFieldDeleteAction') |
||
| 20 | ->removeComponentsByType('GridFieldFilterHeader') |
||
| 21 | ->removeComponentsByType('GridFieldPageCount') |
||
| 22 | ) |
||
| 23 | ); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function TotalPaid() { |
||
| 37 | |||
| 38 | } |
||
| 39 |