X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/422f2f17365ea7879c14b902c5db1e4cd7023e48..98c23539610c6d083265454858ef25e563f74b21:/SL/IS.pm diff --git a/SL/IS.pm b/SL/IS.pm index 49d3cca38..7d6413094 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -591,6 +591,7 @@ sub customer_details { $ref->{street} = $customer->street; $ref->{zipcode} = $customer->zipcode; $ref->{country} = $customer->country; + $ref->{gln} = $customer->gln; } my $contact = SL::DB::Manager::Contact->find_by(cp_id => $::form->{cp_id}); if ($contact) { @@ -1243,6 +1244,8 @@ SQL $query = qq|UPDATE ar SET paid = ? WHERE id = ?|; do_query($form, $dbh, $query, $form->{paid}, conv_i($form->{id})); + $form->new_lastmtime('ar'); + $dbh->commit if !$provided_dbh; $main::lxdebug->leave_sub(); @@ -1298,6 +1301,8 @@ SQL do_query($form, $dbh, qq|UPDATE ar SET paid = amount WHERE id = ?|, conv_i($form->{"id"})); } + $form->new_lastmtime('ar'); + $form->{name} = $form->{customer}; $form->{name} =~ s/--\Q$form->{customer_id}\E//; @@ -1906,7 +1911,7 @@ sub retrieve_invoice { qq|SELECT a.invnumber, a.ordnumber, a.quonumber, a.cusordnumber, a.orddate, a.quodate, a.globalproject_id, - a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.gldate, + a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.storno_id, a.gldate, a.shippingpoint, a.shipvia, a.notes, a.intnotes, a.taxzone_id, a.duedate, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.shipto_id, a.cp_id, a.employee_id, a.salesman_id, a.payment_id, @@ -1932,6 +1937,12 @@ sub retrieve_invoice { ($form->{"delivery_${vc}_string"}) = selectrow_query($form, $dbh, qq|SELECT name FROM customer WHERE id = ?|, $id); } + # get shipto + $query = qq|SELECT * FROM shipto WHERE (trans_id = ?) AND (module = 'AR')|; + $ref = selectfirst_hashref_query($form, $dbh, $query, $id); + delete($ref->{id}); + map { $form->{$_} = $ref->{$_} } keys %$ref; + # get printed, emailed $query = qq|SELECT printed, emailed, spoolfile, formname FROM status WHERE trans_id = ?|; $sth = prepare_execute_query($form, $dbh, $query, $id); @@ -2310,7 +2321,7 @@ sub retrieve_item { push @{ $ref->{matches} ||= [] }, $::locale->text('Model') . ': ' . join ', ', map { $_->{model} } @{ $mm_by_id{$ref->{id}} }; } - if ($ref->{ean} eq $::form->{"partnumber_$i"}) { + if (($::form->{"partnumber_$i"} ne '') && ($ref->{ean} eq $::form->{"partnumber_$i"})) { push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean}; }