⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠


profile picture

Add row from another table


  • profile picture
  • Member

Posted 03 December 2019 - 12:31 PM


I would like to create default payment record by selecting an invoice: selecting a row in the invoice list with an action button would filled the add payment page with information from the selected invoice.

I'm using GroceryCrud 1.6.3 with Bootstrap 3.


In the controller, as shown below, I added an add_action line (*) that lead the user to the cash management add page with the id of the invoice he has selected in the url

ex: "/plans/cash_management/add/559"

The thing is I cannot manage to populate fields of the payment to be added by elements from the invoice with id ''559''. Fields are just empty.


public function billing_management()
            $crud = new grocery_CRUD();
            $crud->columns('Societe', 'Fiscale', 'Code_chantier', 'Lieu', 'Code_facture', 'Composant', 'Date_facture', 'Date_echeance', 'Date_revue', 'Montant_HT', 'Montant_TTC', 'Lettrage','Note');
            $crud->field_type('Societe', 'hidden', 'ART');
        *   //$crud->add_action('Encaissement', '' , 'plans/cash_management/add', 'fa-euro');


            $output = $crud->render();

Thx for your help.