[Koha-bugs] [Bug 14946] Remove C4::Dates from files acqui/*.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Nov 10 12:08:16 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14946

--- Comment #12 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Comment on attachment 44596
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44596
Bug 14946 - Remove C4::Dates from files acqui/*.pl

Review of attachment 44596:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14946&attachment=44596)
-----------------------------------------------------------------

::: acqui/finishreceive.pl
@@ +63,5 @@
>  my $new_ordernumber  = $ordernumber;
>  
> +my $datereceived_dt = eval { dt_from_string( $datereceived) };
> +$datereceived_dt = dt_from_string unless ( $datereceived_dt );
> +$datereceived = output_pref( { dt => $datereceived_dt , dateonly => 1, dateformat => 'iso' } ) ;

I don't understand how this change could be useful.

::: acqui/histsearch.pl
@@ +126,5 @@
>      );
>  }
>  
> +my $from_date = output_pref( { dt => $from_placed_on, dateformat => 'iso',  dateonly => 1 } );
> +my $to_date = output_pref( { dt => $to_placed_on, dateformat => 'iso',  dateonly => 1 } );

This is wrong, why do you want to display in iso format?
Prefer to do that on TT side.

::: acqui/invoice.pl
@@ +90,5 @@
> +
> +    if ( $input->param('billingdate') ) {
> +        $billingdate = eval { dt_from_string( $input->param('billingdate') ) };
> +        $billingdate = output_pref( { dt => $billingdate, dateformat => 'iso',  dateonly => 1 } ) if ( $billingdate );
> +    }

This is not exactly the same as before but is an improvement.
If the date is wrong, don't set it as today, but keep is undef (not important
atm, the input is readonly).

::: acqui/invoices.pl
@@ +68,5 @@
> +
> +my $shipmentdatefrom_iso = '';
> +my $shipmentdateto_iso = '';
> +my $billingdatefrom_iso = '';
> +my $billingdateto_iso = '';

prefer my ($var1, $var2, ..., $varN). No need to assign them an empty string.

@@ +162,5 @@
> +    suppliername     => $suppliername,
> +    shipmentdatefrom => $shipmentdatefrom_iso,
> +    shipmentdateto   => $shipmentdateto_iso,
> +    billingdatefrom  => $billingdatefrom_iso,
> +    billingdateto    => $billingdateto_iso,

This is wrong, the dates are displayed in iso format.

::: acqui/orderreceive.pl
@@ -74,4 @@
>  use C4::Biblio;
>  use C4::Suggestions;
>  
> -use Koha::Acquisition::Bookseller;

Why do you remove it?

@@ +193,5 @@
>  
>  my $datereceived = $order->{datereceived} ? dt_from_string( $order->{datereceived} ) : dt_from_string;
>  
> +my $orderentrydate =  eval{ dt_from_string( $order->{entrydate} ); };
> +$orderentrydate = output_pref( { dt => $orderentrydate, dateonly => 1 } ) if ( $orderentrydate );

I don't understand these changes.

::: acqui/parcels.pl
@@ +169,5 @@
>  my @parcels = GetInvoices(
> +    supplierid       => $booksellerid,
> +    invoicenumber    => $code,
> +    shipmentdatefrom => $datefrom_iso,
> +    shipmentdateto   => $dateto_iso,

I'd keep the previous behavior, don't pass shipmentdateto/from if no need to
pass them.
Why did you change this part of code?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list