X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAM.pm;h=5ffb6a1c54eba2e7444cf48b3b6c70522f254c63;hb=21ca8cb76721b756440cfe75fd8710bfe1caf31b;hp=fa22706eec2773ec10a2cb5385025b1b3d24b5cc;hpb=07948c344b0f699314c1b05b4e9c41b8babc3981;p=kivitendo-erp.git diff --git a/SL/AM.pm b/SL/AM.pm index fa22706ee..5ffb6a1c5 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -230,6 +230,13 @@ sub save_account { $form->{id} = ""; } + if (!$form->{id} || $form->{id} eq "") { + $query = qq|SELECT nextval('id')|; + ($form->{"id"}) = selectrow_query($form, $dbh, $query); + $query = qq|INSERT INTO chart (id, accno) VALUES (?, ?)|; + do_query($form, $dbh, $query, $form->{"id"}, $form->{"accno"}); + } + my @values; if ($form->{id}) { @@ -262,52 +269,6 @@ sub save_account { $form->{id}, ); - } - elsif ($form->{id} && !$form->{new_chart_valid}) { - - $query = qq| - UPDATE chart - SET new_chart_id = ?, - valid_from = ? - WHERE id = ? - |; - - @values = ( - conv_i($form->{new_chart_id}), - conv_date($form->{valid_from}), - $form->{id} - ); - } - else { - - $query = qq| - INSERT INTO chart ( - accno, - description, - charttype, - category, - link, - pos_bwa, - pos_bilanz, - pos_eur, - new_chart_id, - valid_from, - datevautomatik ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - |; - - @values = ( - $form->{accno}, - $form->{description}, - $form->{charttype}, - $form->{category}, $form->{link}, - conv_i($form->{pos_bwa}), - conv_i($form->{pos_bilanz}), conv_i($form->{pos_eur}), - conv_i($form->{new_chart_id}), - conv_date($form->{valid_from}), - ($form->{datevautomatik} eq 'T') ? 'true':'false', - ); - } do_query($form, $dbh, $query, @values); @@ -325,6 +286,9 @@ sub save_account { # Loop control # Check if the account already exists, else cancel + + print(STDERR "Keine Taxkeys weil ID =: $form->{id}\n"); + last READTAXKEYS if ( $form->{'id'} == 0); # check if there is a startdate @@ -1506,6 +1470,8 @@ sub save_defaults { vendornumber = ?, articlenumber = ?, servicenumber = ?, + sdonumber = ?, + pdonumber = ?, yearend = ?, curr = ?, businessnumber = ?|; @@ -1516,6 +1482,7 @@ sub save_defaults { $form->{sqnumber}, $form->{rfqnumber}, $form->{customernumber}, $form->{vendornumber}, $form->{articlenumber}, $form->{servicenumber}, + $form->{sdonumber}, $form->{pdonumber}, $form->{yearend}, $currency, $form->{businessnumber}); do_query($form, $dbh, $query, @values);