-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8136 from ehuelsmann/cleanup/old-code-to-workflows
Move some functionality from 'workflow scripts' to workflows
- Loading branch information
Showing
13 changed files
with
193 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package LedgerSMB::Workflow::Action::TransactionApprove; | ||
|
||
=head1 NAME | ||
LedgerSMB::Workflow::Action::TransactionApprove - Approve draft AR/AP/GL transactions | ||
=head1 SYNOPSIS | ||
# action configuration | ||
<actions> | ||
<action name="Approve" class="LedgerSMB::Workflow::Action::TransactionApprove" | ||
history-text="Some description for the workflow history" /> | ||
</actions> | ||
=head1 DESCRIPTION | ||
This module implements an action which approves a transaction, synchronizing the | ||
workflow state to the C< transactions > table. | ||
=head1 METHODS | ||
=cut | ||
|
||
|
||
use v5.36; | ||
use warnings; | ||
use parent qw( LedgerSMB::Workflow::Action::Null ); | ||
|
||
=head2 execute($wf) | ||
Implements the C<Workflow::Action> protocol. | ||
=cut | ||
|
||
sub execute( $self, $wf ) { | ||
# When the persister finds a true-ish 'approved' value, | ||
# it syncs that state between the context and the 'transactions' table | ||
$wf->context->param( 'approved', 1 ); | ||
|
||
$self->SUPER::execute($wf); | ||
return; | ||
} | ||
|
||
1; | ||
|
||
=head1 LICENSE AND COPYRIGHT | ||
Copyright (C) 2024 The LedgerSMB Core Team | ||
This file is licensed under the GNU General Public License version 2, or at your | ||
option any later version. A copy of the license should have been included with | ||
your software. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package LedgerSMB::Workflow::Action::TransactionDelete; | ||
|
||
=head1 NAME | ||
LedgerSMB::Workflow::Action::TransactionDelete - Delete draft AR/AP/GL transactions | ||
=head1 SYNOPSIS | ||
# action configuration | ||
<actions> | ||
<action name="Delete" class="LedgerSMB::Workflow::Action::TransactionDelete" | ||
history-text="Some description for the workflow history" /> | ||
</actions> | ||
=head1 DESCRIPTION | ||
This module implements an action which deletes a transaction, removing it from | ||
the C< transactions > table. | ||
=head1 METHODS | ||
=cut | ||
|
||
|
||
use v5.36; | ||
use warnings; | ||
use parent qw( LedgerSMB::Workflow::Action::Null ); | ||
|
||
=head2 execute($wf) | ||
Implements the C<Workflow::Action> protocol. | ||
=cut | ||
|
||
sub execute( $self, $wf ) { | ||
# When the persister finds a true-ish 'deleted' value, | ||
# it syncs that state between the context and the 'transactions' table | ||
$wf->context->param( 'deleted', 1 ); | ||
|
||
$self->SUPER::execute($wf); | ||
return; | ||
} | ||
|
||
1; | ||
|
||
=head1 LICENSE AND COPYRIGHT | ||
Copyright (C) 2024 The LedgerSMB Core Team | ||
This file is licensed under the GNU General Public License version 2, or at your | ||
option any later version. A copy of the license should have been included with | ||
your software. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters