PY2LGI6ZRSXVQNYW64Z5UCGLUHSY6HLK
[
"autonomous agent",
{
"init": "{
$nom_AA = 'Consultes_Accions';
$args = trigger.data;
$_Portal = $args._Portal;
$refcons = $args.refcons;
$geto = $args.geto;
$ref = $args.ref;
$__dada = $refval =>
data_feed[[ oracles = $args._Registre, feed_name = $refval, ifnone = false ]];
$Lapse = $__dada( 'Lapse' );
$Origen = $__dada( 'Origen' );
$cicle_actual =
1 + floor( ( timestamp - $Origen ) / $__dada( 'Interval' ) );
}",
"messages": [
{
"app": "state",
"state": "{
response[ 'consulta' ] = $refcons;
//$dada_args_ref = !! $ref ? $__dada( $ref ) : false;
if ( $refcons == 'Dades_Node' ) {
$ref_activacio = 'activacio_' || $geto || '_' || $args.adr;
$ord_activacio = $__dada( $ref_activacio );
$data_activacio = $__dada( $ord_activacio || '_data' );
if ( !! $data_activacio ) {
response[ 'Node ' || $args.adr || ' activat per a' ] = $geto;
response[ 'Nom node' ] = $__dada( $ord_activacio || '_nom' );
response[ 'Aportació per activació' ] = $__dada( $ord_activacio || '_qt' );
response[ 'Cicle activació' ] = $__dada( $ord_activacio || '_cicle' );
response[ 'Escala activació' ] = $__dada( $ord_activacio || '_escala' );
response[ 'Interval activació' ] = $__dada( $ord_activacio || '_interval' );
response[ 'Data activació' ] = timestamp_to_string( $data_activacio, 'date' );
$ref_subscripcio = 'subscripcio_' || $geto || '_' || $args.adr;
$ord_subscripcio = $__dada( $ref_subscripcio );
$data_subscripcio = $__dada( $ord_subscripcio || '_data' );
if ( !! $data_subscripcio ) {
response[ 'Subscripció per a ' || $geto || ' de' ] = $args.adr;
response[ 'Nom subscripció' ] = $__dada( $ord_subscripcio || '_nom' );
response[ '% que hi aporta' ] = $__dada( $ord_subscripcio || '_aportacio' );
response[ 'Cicle subscripció' ] = $__dada( $ord_subscripcio || '_cicle' );
response[ 'Data subscripció' ] = timestamp_to_string( $data_subscripcio, 'date' );
response[ 'Total aportat' ] =
$__dada( 'total_aportacions_' || $geto || '_' || $args.adr ) otherwise 0;
$ref_renovacio = 'renovacio_' || $geto || '_' || $args.adr;
$ord_renovacio = $__dada( $ref_renovacio );
response[ 'Darrer cicle renovat' ] =
$__dada( $ord_renovacio || '_cicle' );
}
$ref_avis = 'avis_' || $geto || '_' || $args.adr;
$temps_avis = $__dada( $ref_avis );
if ( $temps_avis ) {
$avis_es_actual = $temps_avis + ( $Lapse * 2 ) < timestamp;
if ( $avis_es_actual ) {
response[ 'Avís' ] = $__dada( $ref_avis || '_text' );
response[ 'Data' ] = timestamp_to_string( $temps_avis, 'date' );
response[ 'Rebot' ] = $__dada( $ref_avis || '_rebot' );
}
}
} else {
response[ 'adr ' || $args.adr ] = 'NO activada per a ' || $geto;
}
response[ 'Cicle actual' ] = $cicle_actual;
}
if ( $refcons == 'Dades_Diposit' ) {
response[ 'Ref' ] = $ref;
response[ 'Quantitat dipositada' ] = $__dada( $ref || '_qt' );
response[ 'Dipositant' ] = $__dada( $ref || '_dipositant' );
response[ 'Cicle dipòsit' ] = $__dada( $ref || '_cicle' );
response[ 'Getó dipòsit' ] = $__dada( $ref || '_geto_diposit' );
response[ 'Data dipòsit' ] = $__dada( $ref || '_data');
//response[ 'Data dipòsit' ] = timestamp_to_string( $__dada( $ref || '_data'), 'date' );
response[ 'Taxa' ] = $__dada( $ref || '_taxa' );
response[ 'Qt conversió' ] = $__dada( $ref || '_qt_conversio' );
response[ 'Cicle conversió' ] = $__dada( $ref || '_cicle_conversio' );
response[ 'Cicle actual' ] = $cicle_actual;
}
if ( $refcons == 'Dades_Contribucio' ) {
response[ 'Ref' ] = $ref;
response[ 'Quantitat' ] = $__dada( $ref || '_qt' );
response[ 'Contribuidora' ] = $__dada( $ref || '_contribuidora' );
response[ 'Cicle contribució' ] = $__dada( $ref || '_cicle' );
response[ 'Escala contribució' ] = $__dada( $ref || '_escala' );
response[ 'Interval contribució' ] = $__dada( $ref || '_interval' );
response[ 'Data contribució' ] = $__dada( $ref || '_data');
$data_escala = $__dada( 'data_escala_actual' );
response[ "Segons transcorreguts des del darrer salt d'escala" ] =
timestamp - $data_escala;
response[ 'Total Contribucions' ] = $__dada( 'total_contribucions_Estels' );
}
if ( $refcons == 'Dades_Conversio' OR $refcons == 'Dades_Retribucio' ) {
response[ 'Ref' ] = $ref;
response[ 'Rebedora' ] = $__dada( $ref || '_rebedora' );
response[ 'Quantitat' ] = $__dada( $ref || '_qt' );
response[ 'Data' ] = timestamp_to_string( $__dada( $ref || '_data' ), 'date' );
if ( $refcons == 'Dades_Conversio' )
response[ 'Unitat' ] = $__dada( $ref || '_unitat' );
}
if ( $refcons == 'Totals' ) {
$total_geto = $__dada( 'total_' || $geto ) otherwise 0;
$total_FOP = $__dada( 'total_FOP_' || $geto ) otherwise 0;
$total_donacions = $__dada( 'total_donacions' ) otherwise 0;
$total_activacions = $__dada( 'total_activacions_' || $geto ) otherwise 0;
$total_subscripcions = $__dada( 'total_subscripcions_' || $geto ) otherwise 0;
$total_renovacions = $__dada( 'total_renovacions_' || $geto ) otherwise 0;
$total_aportacions = $__dada( 'total_aportacions_' || $geto ) otherwise 0;
$total_diposits = $__dada( 'total_diposits_' || $geto ) otherwise 0;
$total_contribucions = $__dada( 'total_contribucions_Estels' ) otherwise 0;
$total_conversions = $__dada( 'total_conversions_' || $geto ) otherwise 0;
$total_taxes = $__dada( 'total_taxes_' || $geto ) otherwise 0;
$total_retribucions = $__dada( 'total_retribucions' ) otherwise 0;
$total_assignacions = $__dada( 'total_assignacions' ) otherwise 0;
$volum_ASRA = $total_activacions + $total_subscripcions + $total_renovacions + $total_aportacions;
response[ 'Total Getó' ] = $total_geto;
response[ 'Total Donacions' ] = $total_donacions || ' Estels';
response[ 'Total Assignacions' ] = $total_assignacions;
response[ 'Total Activacions' ] = $total_activacions;
response[ 'Total Subscripcions' ] = $total_subscripcions;
response[ 'Total Renovacions' ] = $total_renovacions;
response[ 'Total Aportacions' ] = $total_aportacions;
response[ 'Total Diposits' ] = $total_diposits;
response[ 'Total Contribucions' ] = $total_contribucions;
response[ 'Total Conversions' ] = $total_conversions;
response[ 'Total Taxes' ] = $total_taxes;
response[ 'Total Retribucions' ] = $total_retribucions;
response[ 'Total FOP' ] = $total_FOP;
response[ 'Volum ASRA calculat' ] = $volum_ASRA;
response[ 'Volum ASRA registrat' ] = $__dada( 'volum_ASRA' ) otherwise 0;
}
if ( $refcons == 'Cicle_Actual' ) {
$interval = $__dada( 'Interval' );
$segons_cicle_actual = ( $Origen + ( $cicle_actual * $interval ) ) - timestamp;
$percent_cicle_actual = $segons_cicle_actual / $interval * 100;
response[ 'Cicle actual' ] = $cicle_actual;
response[ 'Data actual' ] = timestamp;
response[ 'Data origen' ] = $Origen;
response[ 'Durada cicles' ] = $interval;
response[ 'Segons restants cicle actual' ] = $segons_cicle_actual;
response[ '% restant del cicle actual' ] =
round( $percent_cicle_actual, 0 ) || ' %';
}
if ( $refcons == 'Escala_Actual' ) {
$escala_actual = $__dada( 'escala_actual' );
$data_escala = $__dada( 'data_escala_actual' );
response[ 'Escala actual' ] = $escala_actual;
response[ "Data del salt d'escala" ] = timestamp_to_string( $data_escala, 'date' );
response[ 'Data en segons' ] = $data_escala;
response[ 'Segons transcorreguts des de darrer salt escala' ] = timestamp - $data_escala;
response[ 'Volum ASRA actual' ] = $__dada( 'volum_ASRA' ) otherwise 0;
}
}"
}
]
}
]
Show transactions in assets:
No transactions found, it may be worth changing the filter
Unit ID
Date
From
Direction
To
Amount