Skip to content

Commit

Permalink
Add business lot scrubbing to Check & Repair->All/This transaction(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjanssens committed Sep 2, 2014
1 parent 1015a43 commit 6114a96
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/gnome/gnc-plugin-page-register.c
Expand Up @@ -74,6 +74,7 @@
#include "gnucash-sheet.h"
#include "dialog-lot-viewer.h"
#include "Scrub.h"
#include "ScrubBusiness.h"
#include "qof.h"
#include "window-reconcile.h"
#include "window-autoclear.h"
Expand Down Expand Up @@ -3691,6 +3692,8 @@ gnc_plugin_page_register_cmd_scrub_current (GtkAction *action,
Query *query;
Account *root;
Transaction *trans;
Split *split;
GNCLot *lot;
SplitRegister *reg;

g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
Expand All @@ -3717,6 +3720,11 @@ gnc_plugin_page_register_cmd_scrub_current (GtkAction *action,
root = gnc_get_current_root_account();
xaccTransScrubOrphans(trans);
xaccTransScrubImbalance(trans, root, NULL);

split = gnc_split_register_get_current_split (reg);
lot = xaccSplitGetLot (split);
if (lot && xaccAccountIsAPARType (xaccAccountGetType (xaccSplitGetAccount (split))))
gncScrubBusinessLot (lot);
gnc_resume_gui_refresh();
LEAVE(" ");
}
Expand All @@ -3729,6 +3737,7 @@ gnc_plugin_page_register_cmd_scrub_all (GtkAction *action,
Query *query;
Account *root;
Transaction *trans;
GNCLot *lot;
Split *split;
GList *node;

Expand All @@ -3754,6 +3763,10 @@ gnc_plugin_page_register_cmd_scrub_all (GtkAction *action,

xaccTransScrubOrphans(trans);
xaccTransScrubImbalance(trans, root, NULL);

lot = xaccSplitGetLot (split);
if (lot && xaccAccountIsAPARType (xaccAccountGetType (xaccSplitGetAccount (split))))
gncScrubBusinessLot (lot);
}

gnc_resume_gui_refresh();
Expand Down

0 comments on commit 6114a96

Please sign in to comment.