<?php
 if (!isset($R['status'])) $R['status']=$CFG['createInvoiceBalance']['fieldsDefaults']['status']; if (!isset($R['idUser'])) $R['idUser']['id']=$CFG['createInvoiceBalance']['fieldsDefaults']['idUser']; \Engine\Plugins\Manager::getInstance()->executeEvent("invoices-balances-createBalance-beforeFieldsDefinition", array()); $form = \Engine\Form\General::create(); $form->setStyle('width', 350); $formCont=\Engine\Form\Container\Fieldset::create($_LANG['invoices']['balanceCreate']['tpls']['detailsLegend']); $form->addContainer($formCont); $fld=new \Engine\Form\Input\Radio($_LANG['invoices']['balanceCreate']['formRowDefinitions']['status'], 'status', $R['status']); $fld->setPossibleValues(array('partial'=>$_LANG['balanceInvoices']['balanceDetails']['status']['partial'], 'final'=>$_LANG['balanceInvoices']['balanceDetails']['status']['final'])); $fld->importFromConfig($CFG['globalEntity']['::Balance']['balanceStatus']); $formCont->addElement($fld); $fld=new \Engine\Form\Input\Text($_LANG['invoices']['balanceCreate']['formRowDefinitions']['balanceName'], 'name', $R['name']); $fld->importFromConfig($CFG['globalEntity']['::Balance']['balanceName']); $formCont->addElement($fld); $fld=new \Engine\Form\Input\Text($_LANG['invoices']['balanceCreate']['formRowDefinitions']['balanceCode'], 'code', $R['code']); $fld->importFromConfig($CFG['globalEntity']['::Balance']['balanceCode']); $formCont->addElement($fld); $fld=new \App\Form\Input\Autocomplete_User($_LANG['invoices']['balanceCreate']['formRowDefinitions']['responsiblePerson'], 'idUser', $R['idUser']); $fld->importFromConfig($CFG['globalEntity']['::Balance']['idUser']); $formCont->addElement($fld); $fld_remarks = new \App\Form\Input\Remarks($_LANG['invoices']['balanceCreate']['formRowDefinitions']['remarks'], 'remarks', $R['remarks']); $fld_remarks->setRemarksType('balance'); $formCont->addElement($fld_remarks); $fld=new \Engine\Form\Input\Textarea($_LANG['invoices']['balanceCreate']['formRowDefinitions']['balanceComments'], 'comments', $R['comments']); $fld->importFromConfig($CFG['globalEntity']['::Balance']['comments']); $formCont->addElement($fld); $formCont->addElement(new \Engine\Form\Input\Hidden('', 'src', $R['src'])); $formCont->addElement(new \Engine\Form\Input\Hidden('', 'parent', $R['parent'])); $formCont->addElement(new \Engine\Form\Input\Hidden('', 'balanceData', $R['balanceData'])); if ($R['src']=='req') { foreach($supplierRowsIds as $idRow=>$nothing) { $formCont->addElement(new \Engine\Form\Input\Hidden('', 's['.$idRow.']', 1)); } foreach($clientServicesIds as $idServ=>$nothing) { $formCont->addElement(new \Engine\Form\Input\Hidden('', 'c['.$idServ.']', 1)); } } $formCont->addElement(new \Engine\Form\Input\Hidden('', 'createBalance', 1)); 