global $db; ob_start(); if ( $this -> operation['id'] ) $date = $this -> operation['date']; elseif ( $this -> operation_date ) $date = $this -> operation_date; else $date = date( 'Y-m-d' ); echo \Html::input( [ 'label' => 'Data', 'name' => 'date', 'value' => $date ? $date : date( 'Y-m-d' ), 'class' => 'datetime require', 'inline' => true ] ); echo \Html::input( [ 'label' => 'Kwota', 'name' => 'amount', 'value' => $this -> operation['amount'], 'class' => 'price require', 'inline' => true ] ); echo \Html::input( [ 'label' => 'Opis', 'name' => 'description', 'value' => $this -> operation['description'], 'inline' => true ] ); $clients_values = [ '' => '--- brak ---' ]; if ( is_array( $this -> clients ) ) foreach ( $this -> clients as $client ) $clients_values[ $client['id'] ] = $client['firm']; echo \Html::select( [ 'label' => 'Klient', 'name' => 'client_id', 'id' => 'client_id', 'values' => $clients_values, 'value' => $this -> operation['client_id'], ] ); foreach ( $this -> operation['tags'] as $tag ) { $tags_value .= $tag['tag']; if ( $tag != end( $this -> operation['tags'] ) ) $tags_value .= ','; } echo \Html::input( [ 'label' => 'Tagi', 'name' => 'tags', 'id' => 'tags', 'value' => $tags_value, 'inline' => true ] ); $fakturowniaOperationContext = $this -> fakturownia_operation_context; if ( ( !is_array( $fakturowniaOperationContext ) || empty( $fakturowniaOperationContext ) ) && !empty( $this -> operation['id'] ) ) { $financeRepository = new \Domain\Finances\FinanceRepository(); $fakturowniaOperationContext = $financeRepository -> fakturowniaOperationContext( (int)$this -> operation['id'] ); } if ( is_array( $fakturowniaOperationContext ) && !empty( $fakturowniaOperationContext ) ) { $currentCategoryId = (int)( $fakturowniaOperationContext['finance_category_id'] ?? 0 ); ?>