Merge branch 'master' of github.com:kivitendo/kivitendo-erp
authorJan Büren <jan@kivitendo-premium.de>
Thu, 2 Jul 2015 16:03:48 +0000 (18:03 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Thu, 2 Jul 2015 16:03:48 +0000 (18:03 +0200)
SL/ClientJS.pm
SL/Controller/BankTransaction.pm
bin/mozilla/is.pl
css/kivitendo/main.css
doc/dokumentation.xml
templates/print/RB/letter.tex
templates/print/RB/purchase_order.tex
templates/print/RB/sales_order.tex
templates/webpages/is/form_footer.html

index c12b9ea..335bf81 100644 (file)
@@ -122,6 +122,8 @@ my %supported_methods = (
   scroll_into_view       => 1,  # $(<TARGET>)[0].scrollIntoView()
 );
 
+my %trim_target_for = map { ($_ => 1) } qw(insertAfter insertBefore appendTo prependTo);
+
 sub AUTOLOAD {
   our $AUTOLOAD;
 
@@ -139,10 +141,10 @@ sub action {
   $method      =  (delete($self->{_prefix}) || '') . $method;
   my $num_args =  $supported_methods{$method};
 
-  croak "Unsupported jQuery action: $method"                                                    unless defined $num_args;
+  croak "Unsupported jQuery action: $method" unless defined $num_args;
 
   if ($num_args > 0) {
-    croak "Parameter count mismatch for $method(actual: " . scalar(@args) . " wanted: $num_args)" if scalar(@args) != $num_args;
+    croak "Parameter count mismatch for $method(actual: " . scalar(@args) . " wanted: $num_args)"          if scalar(@args) != $num_args;
   } else {
     $num_args *= -1;
     croak "Parameter count mismatch for $method(actual: " . scalar(@args) . " wanted at least: $num_args)" if scalar(@args) < $num_args;
@@ -150,10 +152,15 @@ sub action {
   }
 
   foreach my $idx (0..$num_args - 1) {
-    # Force flattening from SL::Presenter::EscapedText and trim leading whitespace for scalars
-    $args[$idx] =  "" . $args[$idx] if  ref($args[$idx]) eq 'SL::Presenter::EscapedText';
+    # Force flattening from SL::Presenter::EscapedText.
+    $args[$idx] = "" . $args[$idx] if ref($args[$idx]) eq 'SL::Presenter::EscapedText';
   }
 
+  # Trim leading whitespaces for certain jQuery functions that operate
+  # on HTML code: $("<p>test</p>").appendTo('#some-id'). jQuery croaks
+  # on leading whitespaces, e.g. on $(" <p>test</p>").
+  $args[0] =~ s{^\s+}{} if $trim_target_for{$method};
+
   push @{ $self->_actions }, [ $method, @args ];
 
   return $self;
index a41957d..5dd8180 100644 (file)
@@ -24,7 +24,6 @@ use SL::DB::Tax;
 use SL::DB::Draft;
 use SL::DB::BankAccount;
 use SL::Presenter;
-use SL::DB::Helper::Payment qw(validate_payment_type);
 use List::Util qw(max);
 
 use Rose::Object::MakeMethods::Generic
@@ -317,8 +316,8 @@ sub action_ajax_add_list {
   my $all_open_ar_invoices = SL::DB::Manager::Invoice->get_all(where => \@where_sale, with_objects => 'customer');
   my $all_open_ap_invoices = SL::DB::Manager::PurchaseInvoice->get_all(where => \@where_purchase, with_objects => 'vendor');
 
-  my @all_open_invoices;
-  # filter out subcent differences from ap invoices
+  my @all_open_invoices = @{ $all_open_ar_invoices };
+  # add ap invoices, filtering out subcent open amounts
   push @all_open_invoices, grep { abs($_->amount - $_->paid) >= 0.01 } @{ $all_open_ap_invoices };
 
   @all_open_invoices = sort { $a->id <=> $b->id } @all_open_invoices;
@@ -376,7 +375,6 @@ sub action_save_invoices {
       my $payment_type;
       if ( defined $skonto_hash->{"$bt_id"} ) {
         $payment_type = shift(@{ $skonto_hash->{"$bt_id"} });
-        SL::DB::Helper::Payment->validate_payment_type($payment_type);
       } else {
         $payment_type = 'without_skonto';
       };
index 286e9ab..e184cd8 100644 (file)
@@ -840,7 +840,7 @@ sub post {
     $form->{action} = 'edit';
     $form->{script} = 'is.pl';
     $form->{saved_message} = $form->{label} . " $form->{invnumber} " . $locale->text('posted!');
-    $form->{callback} = build_std_url(qw(action edit id saved_message));
+    $form->{callback} = build_std_url(qw(action edit id callback saved_message));
     $form->redirect;
   }
 
index d09f72b..e9b54a1 100644 (file)
@@ -73,7 +73,7 @@ hr {
        height: 2px;
 }
 
-/* I.E. & Chrome können das nicht! */
+/* I.E. & Chrome können das nicht! */
 /* input[type="radio"], input[type="checkbox"]{
        width:1.15em;
        height:1.15em;
@@ -85,7 +85,7 @@ input:focus, textarea:focus, select:focus {
        border: 2px solid #FE5F14;
        /* border-bottom: medium solid #FE5F14; */
 }
-/* Fängt den "Schrink" beim focus - problem für i.e. und chrome */
+/* Fängt den "Schrink" beim focus - problem für i.e. und chrome */
 /* input[type="radio"]:focus, input[type="checkbox"]:focus{
        width:1.2em;
        height:1.2em;
index eb91dc0..a339634 100644 (file)
@@ -4825,7 +4825,7 @@ ln -s $(pwd)/kivitendo-task-server.service /etc/systemd/system/</programlisting>
         <title>Blöcke, bedingte Anweisungen und Schleifen</title>
 
         <sect3 id="dokumentenvorlagen-und-variablen.bloecke.einfuehrung">
-          <title>Einfürhung</title>
+          <title>Einführung</title>
 
           <para>Der Parser kennt neben den Variablen einige weitere
           Konstrukte, die gesondert behandelt werden. Diese sind wie
@@ -4901,7 +4901,7 @@ Zahlungseingänge:
           auf Ungleichheit getestet.</para>
 
           <para>Erfahrere Benutzer können neben der Tests auf (Un-)Gleichheit
-          auch Tests auf Ã¼bereinstimmung mit regulären Ausdrücken ohne
+          auch Tests auf Ã\9cbereinstimmung mit regulären Ausdrücken ohne
           Berücksichtung der Groß- und Kleinschreibung durchführen. Dazu dient
           dieselbe Syntax wie oben nur mit <function>=~</function> und
           <function>!~</function> als Vergleichsoperatoren.</para>
index 67a2642..b924152 100644 (file)
@@ -1,43 +1,20 @@
-\documentclass[twoside]{scrartcl}
-\usepackage{eurosym}
-\usepackage{tabularx}
-\usepackage[utf8]{inputenc}
-\setlength{\voffset}{0.5cm}
-\setlength{\hoffset}{-2.0cm}
-\setlength{\topmargin}{0cm}
-\setlength{\headheight}{0.5cm}
-\setlength{\headsep}{1cm}
-\setlength{\topskip}{0pt}
-\setlength{\oddsidemargin}{1.0cm}
-\setlength{\evensidemargin}{1.0cm}
-\setlength{\textwidth}{19.2cm}
-\setlength{\textheight}{24.5cm}
-\setlength{\footskip}{1cm}
-\setlength{\parindent}{0pt}
-\begin{document}
-
-\thispagestyle{empty}
+\input{inheaders.tex}
 
-\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
-\setlength{\parindent}{0cm}
 
-\fontfamily{cmss}\fontshape{n}\selectfont
+% Variablen, die in settings verwendet werden
+\newcommand{\lxlangcode} {<%template_meta.language.template_code%>}
+\newcommand{\lxmedia} {<%media%>}
+\newcommand{\lxcurrency} {<%currency%>}
+\newcommand{\lxtitlebar} {<%titlebar%>}
 
-<%pagebreak 80 28 37%>
-\end{tabularx}
+% settings: Einstellungen, Logo, Briefpapier, Kopfzeile, Fusszeile
+\input{insettings.tex}
 
-\newpage
+% laufende Kopfzeile:
+%\ourhead{}{}{<%subject%>}{<%letternumber%>}{<%date%>}
+\ourhead{}{}{}{}{}
 
-%\begin{tabularx}{\textwidth}{lrXrr}
-%  \hline
-%  \textbf{Pos} & \textbf{Menge} & \textbf{Bezeichnung} &
-%  \textbf{E-Preis/\euro} & \textbf{G-Preis/\euro} \\
-%  \hline
-%  <%foreach number%>
-%    <%runningnumber%> & <%qty%> <%unit%> & \raggedright <%description%> &
-%    <%sellprice%> & <%linetotal%>\\
-%  <%end number%>
-%<%end pagebreak%>
+\begin{document}
 
 \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
 
   <%country%>
 
 \end{minipage}
-\hfill
-\begin{minipage}{6cm}
-\end{minipage}
 
 \vspace{2.5cm}
-
-\begin{minipage}{14cm}
-
+\hfill<%date%>
 \textbf{<%reference%>}
 
 \vspace{1cm}
 
   <%company_name%>
 
-\end{minipage}
-\hfill
-\begin{minipage}{6cm}
-  <%date%>
-
-\vspace{5cm}
-
-Anlagen | Attch.:
-\end{minipage}
-
 \vspace*{0.5cm}
 
 \begin{minipage}{6cm}
 
-\textbf{<%employee%>}
+\textbf{<%employee_name%>}
 
 <%employee_position%>
 
 \end{minipage}
 \begin{minipage}{6cm}
 
-\textbf{<%salesman%>}
+\textbf{<%salesman_name%>}
 
 <%salesman_position%>
 
index 2025896..bd820ee 100644 (file)
 \begin{minipage}{8cm}
   \vspace*{1.0cm}
 
-  <%shiptoname%>
+  <%name%>
 
-  <%shiptostreet%>
+  <%street%>
 
-  <%shiptozipcode%> <%shiptocity%>
+  <%zipcode%> <%city%>
 
-  <%shiptocountry%>
+  <%country%>
 \end{minipage}
 \hfill
 \begin{minipage}{6cm}
index 77dd677..b86f159 100644 (file)
 \begin{minipage}[t]{8cm}
   \vspace*{1.0cm}
 
-  <%shiptoname%>
+  <%name%>
 
-  <%shiptostreet%>
+  <%street%>
 
-  <%shiptozipcode%> <%shiptocity%>
+  ~
 
-  <%shiptocountry%>
+  <%zipcode%> <%city%>
+
+  <%country%>
 \end{minipage}
 \hfill
 \begin{minipage}[t]{6cm}
index fdbdc21..2c271dd 100644 (file)
       [% END %]
   [% END %]
 
+  [% IF callback %]
+    <a href="[% callback %]">[% 'back' | $T8  %]</a>
+  [% END %]
+
 <input type="hidden" name="rowcount" value="[% rowcount %]">
 <input type="hidden" name="callback" value="[% callback | html %]">
 <input type="hidden" name="draft_id" value="[% draft_id %]">