From 573b9275a6ab3fa1c0b24ce202ab69c44238b963 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 28 Oct 2011 17:33:31 +0200 Subject: [PATCH] Bug 3388: Restore account number on vendor page This patch makes it possible to add the account number to the vendor information. The used field aqbookseller.accountnumber was already existent in the database. To test: 1) Add a new vendor with accountnumber > Verify form has a field for accountnumber > Verify accountnumber does show up on vendor summary page 2) Edit this vendor, change accountnumber > Verify change was correctly saved and new number is displayed on vendor summary page 3) Delete accountnumber Signed-off-by: Liz Rea Tested 1-3, no troubles found. Signed-off-by: Paul Poulain --- C4/Bookseller.pm | 15 +++++++++------ acqui/supplier.pl | 2 ++ acqui/updatesupplier.pl | 1 + .../prog/en/modules/acqui/supplier.tt | 11 ++++++++--- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/C4/Bookseller.pm b/C4/Bookseller.pm index 4ad42cb6f2..6a91f995e6 100644 --- a/C4/Bookseller.pm +++ b/C4/Bookseller.pm @@ -65,7 +65,7 @@ sub GetBookSeller { $searchstring = q{%} . $searchstring . q{%}; my $query = 'select aqbooksellers.*, count(*) as basketcount from aqbooksellers left join aqbasket ' - . 'on aqbasket.booksellerid = aqbooksellers.id where name lIke ? group by aqbooksellers.id order by name'; + . 'on aqbasket.booksellerid = aqbooksellers.id where name like ? group by aqbooksellers.id order by name'; my $dbh = C4::Context->dbh; my $sth = $dbh->prepare($query); @@ -141,20 +141,22 @@ sub AddBookseller { INSERT INTO aqbooksellers ( name, address1, address2, address3, address4, - postal, phone, fax, url, contact, + postal, phone, accountnumber, fax, url, + contact, contpos, contphone, contfax, contaltphone, contemail, contnotes, active, listprice, invoiceprice, gstreg, listincgst,invoiceincgst, gstrate, discount, notes ) - VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) | + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) | ; my $sth = $dbh->prepare($query); $sth->execute( $data->{'name'}, $data->{'address1'}, $data->{'address2'}, $data->{'address3'}, $data->{'address4'}, $data->{'postal'}, - $data->{'phone'}, $data->{'fax'}, + $data->{'phone'}, $data->{'accountnumber'}, + $data->{'fax'}, $data->{'url'}, $data->{'contact'}, $data->{'contpos'}, $data->{'contphone'}, $data->{'contfax'}, $data->{'contaltphone'}, @@ -192,7 +194,7 @@ sub ModBookseller { my $dbh = C4::Context->dbh; my $query = 'UPDATE aqbooksellers SET name=?,address1=?,address2=?,address3=?,address4=?, - postal=?,phone=?,fax=?,url=?,contact=?,contpos=?, + postal=?,phone=?,accountnumber=?,fax=?,url=?,contact=?,contpos=?, contphone=?,contfax=?,contaltphone=?,contemail=?, contnotes=?,active=?,listprice=?, invoiceprice=?, gstreg=?,listincgst=?,invoiceincgst=?, @@ -203,7 +205,8 @@ sub ModBookseller { $data->{'name'}, $data->{'address1'}, $data->{'address2'}, $data->{'address3'}, $data->{'address4'}, $data->{'postal'}, - $data->{'phone'}, $data->{'fax'}, + $data->{'phone'}, $data->{'accountnumber'}, + $data->{'fax'}, $data->{'url'}, $data->{'contact'}, $data->{'contpos'}, $data->{'contphone'}, $data->{'contfax'}, $data->{'contaltphone'}, diff --git a/acqui/supplier.pl b/acqui/supplier.pl index 44ff2501c0..3faa560f25 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -93,6 +93,7 @@ if ( $op eq 'display' ) { address3 => $supplier->{'address3'}, address4 => $supplier->{'address4'}, phone => $supplier->{'phone'}, + accountnumber => $supplier->{'accountnumber'}, fax => $supplier->{'fax'}, url => $supplier->{'url'}, contact => $supplier->{'contact'}, @@ -152,6 +153,7 @@ if ( $op eq 'display' ) { address3 => $supplier->{'address3'}, address4 => $supplier->{'address4'}, phone => $supplier->{'phone'}, + accountnumber=> $supplier->{'accountnumber'}, fax => $supplier->{'fax'}, url => $supplier->{'url'}, contact => $supplier->{'contact'}, diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl index 6bc978f97e..bd59c6b95a 100755 --- a/acqui/updatesupplier.pl +++ b/acqui/updatesupplier.pl @@ -80,6 +80,7 @@ $data{'address2'}=$addresses[1]; $data{'address3'}=$addresses[2]; $data{'address4'}=$addresses[3]; $data{'phone'}=$input->param('company_phone'); +$data{'accountnumber'}=$input->param('accountnumber'); $data{'fax'}=$input->param('company_fax'); $data{'url'}=$input->param('website'); $data{'contact'}=$input->param('company_contact_name'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index 9c76b7ced5..f30d83987f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -53,7 +53,9 @@ if (f.company.value == "") {
  • -
  • + +
  • +
  • Contact details @@ -136,7 +138,7 @@ if (f.company.value == "") { %
  • % (leave blank for default tax of [% default_gst_rate %]%)
  • -
  • +
    [% IF ( id ) %] [% ELSE %] @@ -154,7 +156,10 @@ if (f.company.value == "") {

    Phone: [% phone %]

    Fax: [% fax %]

    [% IF ( url ) %] -

    Web site: [% url %]

    +

    Website: [% url %]

    + [% END %] + [% IF ( accountnumber ) %] +

    Account number: [% accountnumber %]

    [% END %]
    -- 2.39.5