X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FHelper%2FFlattenToForm.pm;h=80633b602d484bc783ec5618c116d7216a844aba;hb=937e37ad007405c6a3a389ee18006379ffecc073;hp=c21df974693ea98d9b41c9b7e94d13656ad1481f;hpb=79c048aa6a9699c5a994d7e21f4fd3ec8fa29693;p=kivitendo-erp.git diff --git a/SL/DB/Helper/FlattenToForm.pm b/SL/DB/Helper/FlattenToForm.pm index c21df9746..80633b602 100644 --- a/SL/DB/Helper/FlattenToForm.pm +++ b/SL/DB/Helper/FlattenToForm.pm @@ -14,11 +14,11 @@ sub flatten_to_form { my $vc = $self->can('customer_id') && $self->customer_id ? 'customer' : 'vendor'; - _copy($self, $form, '', '', 0, qw(id type taxzone_id ordnumber quonumber invnumber donumber cusordnumber taxincluded shippingpoint shipvia notes intnotes curr cp_id + _copy($self, $form, '', '', 0, qw(id type taxzone_id ordnumber quonumber invnumber donumber cusordnumber taxincluded shippingpoint shipvia notes intnotes cp_id employee_id salesman_id closed department_id language_id payment_id delivery_customer_id delivery_vendor_id shipto_id proforma globalproject_id delivered transaction_description container_type accepted_by_customer invoice terms storno storno_id dunning_config_id orddate quodate reqdate gldate duedate deliverydate datepaid transdate)); - $form->{currency} = $form->{curr}; # curr is called currency in almost all forms + $form->{currency} = $form->{curr} = $self->currency_id ? $self->currency->name || '' : ''; if (_has($self, 'transdate')) { my $transdate_idx = ref($self) eq 'SL::DB::Order' ? ($self->quotation ? 'quodate' : 'orddate') @@ -29,9 +29,11 @@ sub flatten_to_form { $form->{vc} = $vc if ref($self) =~ /^SL::DB::.*Invoice/; - my @vc_fields = (qw(account_number bank bank_code bic business city contact country creditlimit discount - email fax homepage iban language name payment_terms phone street taxnumber zipcode), - "${vc}number"); + my @vc_fields = (qw(account_number bank bank_code bic business city contact country creditlimit + department_1 department_2 discount email fax homepage iban language name + payment_terms phone street taxnumber ustid zipcode), + "${vc}number", + ($vc eq 'customer')? 'c_vendor_id': 'v_customer_id'); my @vc_prefixed_fields = qw(email fax notes number phone); _copy($self, $form, '', '', 1, qw(amount netamount marge_total marge_percent container_remaining_weight container_remaining_volume paid)); @@ -52,7 +54,7 @@ sub flatten_to_form { my $idx = 0; my $format_amounts = $params{format_amounts} ? 1 : 0; my $format_notnull = $params{format_amounts} ? 2 : 0; - foreach my $item (@{ $self->items }) { + foreach my $item (@{ $self->items_sorted }) { next if _has($item, 'assemblyitem'); $idx++;