UpdateBalancesBetween depends on BalancesBetween product when required

This commit is contained in:
RunasSudo 2025-06-01 23:21:40 +10:00
parent bbb91ad1e7
commit 1d6c6e1da3
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -764,14 +764,17 @@ impl ReportingStep for UpdateBalancesBetween {
let dependencies_for_step = dependencies.dependencies_for_step(&parent_step.id()); let dependencies_for_step = dependencies.dependencies_for_step(&parent_step.id());
let balances_between_product = &dependencies_for_step[0].product; // Existence and uniqueness checked in can_build let balances_between_product = &dependencies_for_step[0].product; // Existence and uniqueness checked in can_build
if matches!( let mut is_already_transitive_dependency = false;
balances_between_product.args, if let ReportingStepArgs::DateStartDateEndArgs(args) = &balances_between_product.args {
ReportingStepArgs::DateStartDateEndArgs(_) if *args == self.args {
) { // Directly depends on BalanceBetween -> Transaction with appropriate date
// Directly depends on BalanceBetween -> Transaction with appropriate date // Do not need to add extra dependencies
// Do not need to add extra dependencies is_already_transitive_dependency = true;
} else { }
// Depends on BalanceBetween with appropriate date }
if !is_already_transitive_dependency {
// Add dependency on BalanceBetween with appropriate date
dependencies.add_dependency( dependencies.add_dependency(
self.id(), self.id(),
ReportingProductId { ReportingProductId {