Zahlungsbedingungen Kreditorenbeleg Speichern und Laden in Maske
authorJan Büren <jan@kivitendo.de>
Thu, 14 Jan 2021 13:04:24 +0000 (14:04 +0100)
committerJan Büren <jan@kivitendo.de>
Thu, 14 Jan 2021 13:10:07 +0000 (14:10 +0100)
Das was Commit 8b5bed7fe5 versprochen hat, jetzt auch in Echt ;-)

SL/AP.pm
bin/mozilla/ap.pl
templates/webpages/ap/form_header.html

index 71c2b4b..69a2a0a 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -141,7 +141,7 @@ sub _post_transaction {
                 transdate = ?, ordnumber = ?, vendor_id = ?, taxincluded = ?,
                 amount = ?, duedate = ?, deliverydate = ?, tax_point = ?, paid = ?, netamount = ?,
                 currency_id = (SELECT id FROM currencies WHERE name = ?), notes = ?, department_id = ?, storno = ?, storno_id = ?,
-                globalproject_id = ?, direct_debit = ?
+                globalproject_id = ?, direct_debit = ?, payment_id = ?
                WHERE id = ?|;
     @values = ($form->{invnumber}, conv_date($form->{transdate}),
                   $form->{ordnumber}, conv_i($form->{vendor_id}),
@@ -152,6 +152,7 @@ sub _post_transaction {
                   conv_i($form->{department_id}), $form->{storno},
                   $form->{storno_id}, conv_i($form->{globalproject_id}),
                   $form->{direct_debit} ? 't' : 'f',
+                  $form->{payment_id},
                   $form->{id});
     do_query($form, $dbh, $query, @values);
 
index afc2ab5..8558f38 100644 (file)
@@ -564,7 +564,7 @@ sub form_header {
   print $form->parse_html_template('ap/form_header', {
     today => DateTime->today,
     currencies => SL::DB::Manager::Currency->get_all_sorted,
-    payment_terms => SL::DB::Manager::PaymentTerm->get_all_sorted(query => [ or => [ obsolete => 0, id => $::form->{payment_id}*1 ]]),
+    payment_terms => SL::DB::Manager::PaymentTerm->get_all_sorted(query => [ or => [ obsolete => 0, id => $form->{invoice_obj}->{payment_id}*1 ]]),
   });
 
   $main::lxdebug->leave_sub();
index 2f22a96..582b649 100644 (file)
             [% L.textarea_tag("intnotes", intnotes, wrap="soft", rows=textarea_rows, cols=50, readonly=readonly) %]
            </td>
            <td>
-             [% L.select_tag('payment_id', payment_terms, default=payment_id, title_key='description', with_empty=1, style="width: 250px", onchange="kivi.SalesPurchase.set_duedate_on_reference_date_change('invdate')") %]
+             [% L.select_tag('payment_id', payment_terms, default=invoice_obj.payment_id, title_key='description', with_empty=1, style="width: 250px", onchange="kivi.SalesPurchase.set_duedate_on_reference_date_change('invdate')") %]
            </td>
           <tr>
         </table>