X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FOE.pm;h=3e3ed3f56e51d29d4859d4736db5054404794e34;hb=0e60202e4d9de0e0377e63fccc3a2f93e68bd24f;hp=0e671bd38307ff2942149fea72bdfbca33adef50;hpb=8e0f6e70f1acb084e6757ccd8b59221f78a2ff56;p=kivitendo-erp.git diff --git a/SL/OE.pm b/SL/OE.pm index 0e671bd38..3e3ed3f56 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -25,7 +25,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # Order entry module @@ -867,7 +868,7 @@ sub _close_quotations_rfqs { my ($quotation) = $sth->fetchrow_array(); if ($quotation) { - return; + return 1; } my @close_ids; @@ -885,8 +886,8 @@ sub _close_quotations_rfqs { $query = qq|UPDATE oe SET closed = TRUE WHERE id IN (| . join(', ', ('?') x scalar @close_ids) . qq|)|; do_query($form, $dbh, $query, @close_ids); } - - }); + 1; + }) or do { die SL::DB->client->error }; $main::lxdebug->leave_sub(); } @@ -905,7 +906,7 @@ sub delete { unlink map { "$spool/$_" } @spoolfiles if $spool; 1; - }); + }) or do { die SL::DB->client->error }; $main::lxdebug->leave_sub(); @@ -1093,8 +1094,8 @@ sub _retrieve { c2.accno AS income_accno, c2.new_chart_id AS income_new_chart, date($transdate) - c2.valid_from as income_valid, c3.accno AS expense_accno, c3.new_chart_id AS expense_new_chart, date($transdate) - c3.valid_from as expense_valid, oe.ordnumber AS ordnumber_oe, oe.transdate AS transdate_oe, oe.cusordnumber AS cusordnumber_oe, - p.partnumber, p.assembly, p.listprice, o.description, o.qty, - o.sellprice, o.parts_id AS id, o.unit, o.discount, p.notes AS partnotes, p.inventory_accno_id AS part_inventory_accno_id, + p.partnumber, p.part_type, p.listprice, o.description, o.qty, + o.sellprice, o.parts_id AS id, o.unit, o.discount, p.notes AS partnotes, p.part_type, o.reqdate, o.project_id, o.serialnumber, o.ship, o.lastcost, o.ordnumber, o.transdate, o.cusordnumber, o.subtotal, o.longdescription, o.price_factor_id, o.price_factor, o.marge_price_factor, o.active_price_source, o.active_discount_source, @@ -1126,10 +1127,10 @@ sub _retrieve { map { $ref->{"ic_cvar_$_->{name}"} = $_->{value} } @{ $cvars }; # Handle accounts. - if (!$ref->{"part_inventory_accno_id"}) { + if (!$ref->{"part_type"} eq 'part') { map({ delete($ref->{$_}); } qw(inventory_accno inventory_new_chart inventory_valid)); } - delete($ref->{"part_inventory_accno_id"}); + # delete($ref->{"part_inventory_accno_id"}); # in collective order, copy global ordnumber, transdate, cusordnumber into item scope # unless already present there @@ -1257,7 +1258,7 @@ sub order_details { my ($self, $myconfig, $form) = @_; # connect to database - my $dbh = $form->get_standard_dbh; + my $dbh = SL::DB->client->dbh; my $query; my @values = (); my $sth; @@ -1605,8 +1606,6 @@ sub order_details { $form->{username} = $myconfig->{name}; - $dbh->disconnect; - $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef); $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id};