https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23049
Marcel de Rooy <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED --- Comment #221 from Marcel de Rooy <[email protected]> --- (In reply to Martin Renvoize from comment #220) > I managed at least to get this all running under MariaDB 10.2.27 and see the > check constraint in action myself. Turns out one cannot use a ternary the > way I tried to inside an execute call. I think that you are mistaken. You used the wrong conditions in the ternary: - $sth->execute($borrower->borrowernumber, $data->{amount}, $data->{days_ago}, $data->{description}, 'commandline', $data->{amount} > 0 ? 'W' : undef, $data->{amount} >= 0 ? undef : 'OVERDUE' ); + $sth->execute($borrower->borrowernumber, $data->{amount}, $data->{days_ago}, $data->{description}, 'commandline', $data->{amount} < 0 ? 'W' : undef, $data->{amount} < 0 ? undef : 'OVERDUE' ); This should work. Note the differences between >0 and <0 but also between >=0 and <0. Credit is negative ! I would suggest to remove patch 34. Coming back here soon. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
