X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/e0f5deeae4cdcf3faf3bc68a202f20ec6cd9af2e..aae306cda6274d:/bin/mozilla/ar.pl?ds=sidebyside diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 6c4dcb8b4..16be58c09 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -24,7 +24,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. #====================================================================== # # Accounts Receivables @@ -37,9 +38,12 @@ use List::UtilsBy qw(sort_by); use SL::AR; use SL::FU; +use SL::GL; use SL::IS; -use SL::PE; +use SL::DB::Business; +use SL::DB::Currency; use SL::DB::Default; +use SL::DB::Employee; use SL::DB::Invoice; use SL::ReportGenerator; @@ -101,6 +105,12 @@ sub add { $form->{initial_transdate} = $form->{transdate}; create_links(dont_save => 1); $form->{transdate} = $form->{initial_transdate}; + + if ($form->{customer_id}) { + my $last_used_ar_chart = SL::DB::Customer->load_cached($form->{customer_id})->last_used_ar_chart; + $form->{"AR_amount_chart_id_1"} = $last_used_ar_chart->id if $last_used_ar_chart; + } + &display_form; $main::lxdebug->leave_sub(); } @@ -165,41 +175,13 @@ sub create_links { IS->get_customer(\%myconfig, \%$form); $form->{$_} = $saved{$_} for keys %saved; - $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}"; $form->{rowcount} = 1; + $form->{AR_chart_id} = $form->{acc_trans} && $form->{acc_trans}->{AR} ? $form->{acc_trans}->{AR}->[0]->{chart_id} : $form->{AR_links}->{AR}->[0]->{chart_id}; # currencies $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - $form->{selectcurrency} = ""; - map { $form->{selectcurrency} .= "