@@ -, +, @@ * Add `AFTER` to DB update * Change "Is standing order basket:" to "Orders are standing:" * Disable item creation when adding from basket * Correctly show is_standing for existing baskets --- acqui/addorderiso2709.pl | 6 ++++-- acqui/basketheader.pl | 1 + .../mysql/atomicupdate/bug_15531-add_is_standing_to_aqbasket.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt | 6 +++++- 5 files changed, 12 insertions(+), 5 deletions(-) --- a/acqui/addorderiso2709.pl +++ a/acqui/addorderiso2709.pl @@ -99,7 +99,8 @@ if ($op eq ""){ "allmatch" => $allmatch, ); import_biblios_list($template, $cgiparams->{'import_batch_id'}); - if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) { + my $basket = GetBasket($cgiparams->{basketno}); + if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$basket->{is_standing} ) { # prepare empty item form my $cell = PrepareItemrecordDisplay( '', '', '', 'ACQ' ); @@ -238,7 +239,8 @@ if ($op eq ""){ # 4th, add items if applicable # parse the item sent by the form, and create an item just for the import_record_id we are dealing with # this is not optimised, but it's working ! - if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) { + my $basket = GetBasket($cgiparams->{basketno}); + if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$basket->{is_standing} ) { my @tags = $input->multi_param('tag'); my @subfields = $input->multi_param('subfield'); my @field_values = $input->multi_param('field_value'); --- a/acqui/basketheader.pl +++ a/acqui/basketheader.pl @@ -123,6 +123,7 @@ if ( $op eq 'add_form' ) { booksellers => \@booksellers, deliveryplace => $basket->{deliveryplace}, billingplace => $basket->{billingplace}, + is_standing => $basket->{is_standing}, ); my $billingplace = $basket->{'billingplace'} || C4::Context->userenv->{"branch"}; --- a/installer/data/mysql/atomicupdate/bug_15531-add_is_standing_to_aqbasket.sql +++ a/installer/data/mysql/atomicupdate/bug_15531-add_is_standing_to_aqbasket.sql @@ -1, +1, @@ -ALTER TABLE aqbasket ADD COLUMN is_standing TINYINT(1) NOT NULL DEFAULT 0; +ALTER TABLE aqbasket ADD COLUMN is_standing TINYINT(1) NOT NULL DEFAULT 0 AFTER branch; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -317,7 +317,7 @@ [% IF ( closedate ) %]
  • Closed on: [% closedate | $KohaDates %]
  • [% END %] [% IF ( estimateddeliverydate ) %]
  • Estimated delivery date: [% estimateddeliverydate | $KohaDates %]
  • [% END %] [% IF ( estimateddeliverydate ) %]
  • Estimated delivery date: [% estimateddeliverydate | $KohaDates %]
  • [% END %] -
  • Is standing order basket: [% IF is_standing %]Yes[% ELSE %]No[% END %]
  • +
  • Orders are standing: [% IF is_standing %]Yes[% ELSE %]No[% END %]
  • --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt @@ -115,7 +115,11 @@ [% END %]
  • - + [% IF is_standing %] + + [% ELSE %] + + [% END %]
    Standing orders do not close when received.
  • --