This commit is contained in:
nheron 2025-05-30 11:39:57 +02:00
commit f592787ab7
29 changed files with 173 additions and 451 deletions

View file

@ -15,11 +15,15 @@
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<artifactId>drools-engine-classic</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<groupId>org.drools</groupId>
<artifactId>drools-model-compiler</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-ecj</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
@ -45,11 +49,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>${maven.compiler.version}</version>
</plugin>
<plugin>
<groupId>org.kie</groupId>
@ -59,4 +59,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View file

@ -19,20 +19,16 @@ rule "Credit and Debit Rule"
when
$c : Account( $acc : accountno )
$p : AccountingPeriod ($sDate : startDate ,$eDate : endDate )
$totalCredit : Number( doubleValue > 100 )
from accumulate( CashFlow( type ==CashFlow.CREDIT,$value : amount, mvtDate >= $sDate && mvtDate <= $eDate,accountNo == $acc ),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
sum($value))
$totalDebit : Number( doubleValue > 100 )
from accumulate( CashFlow( type ==CashFlow.DEBIT,$value : amount, mvtDate >= $sDate && mvtDate <= $eDate,accountNo == $acc ),
init( double total = 0; ),
action( total += $value; ),
reverse( total -= $value; ),
result( total ) )
sum($value) )
then
showResult.showText(" Found "+$totalCredit+" as a credit");
showResult.showText(" Found "+$totalDebit+" as a debit");
end
end