X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FGL.pm;h=09fc2f03bf382ac21c01fe7f65f7253c1b44ee0e;hb=dd2ee66b1d04c3644c48c32b33673463af223077;hp=9e3806a05b1878cc967b0fbe54e60371eee180e7;hpb=c078749ac84160099a6bca79c288f4f11e871eb8;p=kivitendo-erp.git diff --git a/SL/GL.pm b/SL/GL.pm index 9e3806a05..09fc2f03b 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -25,7 +25,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # General ledger backend code @@ -112,8 +113,6 @@ sub _post_transaction { do_query($form, $dbh, $query, @values); } - my ($null, $department_id) = split(/--/, $form->{department}); - $form->{ob_transaction} *= 1; $form->{cb_transaction} *= 1; @@ -125,7 +124,7 @@ sub _post_transaction { WHERE id = ?|; @values = ($form->{reference}, $form->{description}, $form->{notes}, - conv_date($form->{transdate}), conv_i($department_id), $form->{taxincluded} ? 't' : 'f', + conv_date($form->{transdate}), conv_i($form->{department_id}), $form->{taxincluded} ? 't' : 'f', $form->{storno} ? 't' : 'f', conv_i($form->{storno_id}), $form->{ob_transaction} ? 't' : 'f', $form->{cb_transaction} ? 't' : 'f', conv_i($form->{id})); do_query($form, $dbh, $query, @values); @@ -232,14 +231,13 @@ sub all_transactions { push(@apvalues, like($form->{reference})); } - if ($form->{department}) { - my ($null, $department) = split /--/, $form->{department}; + if ($form->{department_id}) { $glwhere .= qq| AND g.department_id = ?|; $arwhere .= qq| AND a.department_id = ?|; $apwhere .= qq| AND a.department_id = ?|; - push(@glvalues, $department); - push(@arvalues, $department); - push(@apvalues, $department); + push(@glvalues, $form->{department_id}); + push(@arvalues, $form->{department_id}); + push(@apvalues, $form->{department_id}); } if ($form->{source}) { @@ -638,7 +636,8 @@ sub transaction { if ($form->{id}) { $query = qq|SELECT g.reference, g.description, g.notes, g.transdate, g.storno, g.storno_id, - d.description AS department, e.name AS employee, g.taxincluded, g.gldate, + g.department_id, d.description AS department, + e.name AS employee, g.taxincluded, g.gldate, g.ob_transaction, g.cb_transaction FROM gl g LEFT JOIN department d ON (d.id = g.department_id)