Debugmodi umgeschrieben auf das viel schoenere shiftingformat.
[kivitendo-erp.git] / SL / IS.pm
index e78e3e1..b47944b 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -492,6 +492,8 @@ sub post_invoice {
   if (!$form->{employee_id}) {
     $form->get_employee($dbh);
   }
+  
+  $form->{defaultcurrency} = $form->get_default_currency($myconfig);
 
   ($null, $form->{department_id}) = split(/--/, $form->{department});
 
@@ -1099,9 +1101,6 @@ sub post_payment {
   # Delete all entries in acc_trans from prior payments.
   $self->_delete_payments($form, $dbh);
 
-  my @after_dp;
-  push @after_dp, selectall_hashref_query($form, $dbh, qq|SELECT * FROM acc_trans WHERE trans_id = ? ORDER BY oid|, $form->{id});
-
   # Save the new payments the user made before cleaning up $form.
   map { $payments{$_} = $form->{$_} } grep m/^datepaid_\d+$|^memo_\d+$|^source_\d+$|^exchangerate_\d+$|^paid_\d+$|^AR_paid_\d+$|^paidaccounts$/, keys %{ $form };
 
@@ -1112,7 +1111,7 @@ sub post_payment {
   # Retrieve the invoice from the database.
   $self->retrieve_invoice($myconfig, $form);
 
-  # Set up the content of $form in the way that IR::post_invoice() expects.
+  # Set up the content of $form in the way that IS::post_invoice() expects.
   $form->{exchangerate} = $form->format_amount($myconfig, $form->{exchangerate});
 
   for $row (1 .. scalar @{ $form->{invoice_details} }) {
@@ -1130,7 +1129,7 @@ sub post_payment {
   # Restore the payment options from the user input.
   map { $form->{$_} = $payments{$_} } keys %payments;
 
-  # Get the AP accno (which is normally done by Form::create_links()).
+  # Get the AR accno (which is normally done by Form::create_links()).
   $query =
     qq|SELECT c.accno
        FROM acc_trans at
@@ -1795,7 +1794,7 @@ sub retrieve_item {
   my $query =
     qq|SELECT
          p.id, p.partnumber, p.description, p.sellprice,
-         p.listprice, p.inventory_accno_id,
+         p.listprice, p.inventory_accno_id, p.lastcost,
 
          c1.accno AS inventory_accno,
          c1.new_chart_id AS inventory_new_chart,