X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAM.pm;h=323556bd4ae1d3dbf7d9b231b7b2d6805c4dfecf;hb=f8f101f30251b63e62e36e2aec1d6986e3167f78;hp=91a334bde1c33f839ad5fcb2e0b63348b2899b63;hpb=be47ce7f0ee15e692ade53804c8b4682dc89d627;p=kivitendo-erp.git diff --git a/SL/AM.pm b/SL/AM.pm index 91a334bde..323556bd4 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -48,7 +48,7 @@ sub get_account { # connect to database my $dbh = $form->dbconnect($myconfig); my $query = - qq!SELECT c.accno, c.description, c.charttype, c.gifi_accno, c.category,! . + qq!SELECT c.accno, c.description, c.charttype, c.category,! . qq! c.link, c.pos_bilanz, c.pos_eur, c.new_chart_id, c.valid_from, ! . qq! c.pos_bwa, ! . qq! tk.taxkey_id, tk.pos_ustva, tk.tax_id, ! . @@ -180,16 +180,16 @@ sub save_account { my ($tax_id, $taxkey) = split(/--/, $form->{tax}); my $startdate = $form->{startdate} ? $form->{startdate} : "1970-01-01"; - if ($form->{id} && $form->{orphaned}) { + if ($form->{id}) { $query = qq|UPDATE chart SET accno = ?, description = ?, charttype = ?, - gifi_accno = ?, category = ?, link = ?, + category = ?, link = ?, taxkey_id = ?, pos_ustva = ?, pos_bwa = ?, pos_bilanz = ?, pos_eur = ?, new_chart_id = ?, valid_from = ? WHERE id = ?|; @values = ($form->{accno}, $form->{description}, $form->{charttype}, - $form->{gifi_accno}, $form->{category}, $form->{link}, + $form->{category}, $form->{link}, conv_i($taxkey), conv_i($form->{pos_ustva}), conv_i($form->{pos_bwa}), conv_i($form->{pos_bilanz}), conv_i($form->{pos_eur}), @@ -205,14 +205,12 @@ sub save_account { } else { $query = qq|INSERT INTO chart (accno, description, charttype, - gifi_accno, category, link, - taxkey_id, + category, link, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, new_chart_id, valid_from) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|; @values = ($form->{accno}, $form->{description}, $form->{charttype}, - $form->{gifi_accno}, $form->{category}, $form->{link}, - conv_i($taxkey), + $form->{category}, $form->{link}, conv_i($taxkey), conv_i($form->{pos_ustva}), conv_i($form->{pos_bwa}), conv_i($form->{pos_bilanz}), conv_i($form->{pos_eur}), conv_i($form->{new_chart_id}), @@ -506,7 +504,7 @@ sub business { # connect to database my $dbh = $form->dbconnect($myconfig); - my $query = qq|SELECT id, description, discount, customernumberinit, salesman + my $query = qq|SELECT id, description, discount, customernumberinit FROM business ORDER BY 2|; @@ -533,7 +531,7 @@ sub get_business { my $dbh = $form->dbconnect($myconfig); my $query = - qq|SELECT b.description, b.discount, b.customernumberinit, b.salesman + qq|SELECT b.description, b.discount, b.customernumberinit FROM business b WHERE b.id = ?|; my $sth = $dbh->prepare($query); @@ -559,20 +557,19 @@ sub save_business { my $dbh = $form->dbconnect($myconfig); my @values = ($form->{description}, $form->{discount}, - $form->{customernumberinit}, $form->{salesman} ? 't' : 'f'); + $form->{customernumberinit}); # id is the old record if ($form->{id}) { $query = qq|UPDATE business SET description = ?, discount = ?, - customernumberinit = ?, - salesman = ? + customernumberinit = ? WHERE id = ?|; push(@values, $form->{id}); } else { $query = qq|INSERT INTO business - (description, discount, customernumberinit, salesman) - VALUES (?, ?, ?, ?)|; + (description, discount, customernumberinit) + VALUES (?, ?, ?)|; } do_query($form, $dbh, $query, @values); @@ -1223,36 +1220,85 @@ sub delete_payment { $main::lxdebug->leave_sub(); } -sub load_template { + +sub prepare_template_filename { $main::lxdebug->enter_sub(); - my ($self, $form) = @_; + my ($self, $myconfig, $form) = @_; + + my ($filename, $display_filename); - open(TEMPLATE, "$form->{file}") or $form->error("$form->{file} : $!"); + if ($form->{type} eq "stylesheet") { + $filename = "css/$myconfig->{stylesheet}"; + $display_filename = $myconfig->{stylesheet}; - while (