This commit is contained in:
Nicolas Héron 2016-05-20 14:16:10 +02:00
commit 474d3bf5b1
86 changed files with 675 additions and 529 deletions

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -1,34 +1,32 @@
//#created on: 30 oct. 2010
package cours
//#list any import classes here.
import droolscours.Account;
import droolscours.AccountingPeriod;
import droolscours.CashFlow;
import droolscours.util.OutputDisplay;
//#declare any global variables here
global OutputDisplay showResult;
rule "Account and accounting period both exist"
when
Account( )
AccountingPeriod( )
then
showResult.showText("Un compte est un accountingperiod existe");
end
rule "Credit rule"
when
$cash :CashFlow( $aDate : mvtDate, $no : accountNo ,type == CashFlow.CREDIT )
$acc : Account(accountno ==$no )
$period : AccountingPeriod( startDate <= $aDate && endDate >= $aDate)
then
$acc.setBalance($acc.getBalance()+$cash.getAmount());
showResult.showText("Account no "+$acc.getAccountno()+ " has now a balance of "+$acc.getBalance());
end
rule "Debit rule"
when
$cash :CashFlow( $no : accountNo ,type == CashFlow.CREDIT )
$cash :CashFlow( $aDate : mvtDate, $no : accountNo ,type == CashFlow.DEBIT )
$acc : Account(accountno ==$no )
$period : AccountingPeriod( startDate <= $aDate && endDate >= $aDate)
then
$acc.setBalance($acc.getBalance()+$cash.getAmount());
showResult.showText("le compte no "+$no+ " a maintenant une valeur de "+$acc.getBalance());
$acc.setBalance($acc.getBalance()-$cash.getAmount());
showResult.showText("Account no "+$acc.getAccountno()+ " has now a balance of "+$acc.getBalance());
end