+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ _check_io_auth();
+
+ my $invdate = $form->{invdate} eq 'undefined' ? undef : $form->{invdate};
+ my $duedate = $form->get_duedate(\%myconfig, $invdate);
+
+ print $form->ajax_response_header() . $duedate;
+
+ $main::lxdebug->leave_sub();
+}
+
+sub _update_part_information {
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+
+ my %part_information = IC->get_basic_part_info('id' => [ grep { $_ } map { $form->{"id_${_}"} } (1..$form->{rowcount}) ],
+ 'vendor_id' => $form->{vendor_id});
+
+ $form->{PART_INFORMATION} = \%part_information;
+
+ foreach my $i (1..$form->{rowcount}) {
+ next unless ($form->{"id_${i}"});
+
+ my $info = $form->{PART_INFORMATION}->{$form->{"id_${i}"}} || { };
+ $form->{"partunit_${i}"} = $info->{unit};
+ }
+
+ $main::lxdebug->leave_sub();
+}
+
+sub _update_ship {
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ if (!$form->{ordnumber} || !$form->{id}) {
+ map { $form->{"ship_$_"} = 0 } (1..$form->{rowcount});
+ $main::lxdebug->leave_sub();
+ return;
+ }
+
+ my $all_units = AM->retrieve_all_units();