[Patches] [PATCH] Bug 3388: Restore account number on vendor page
koha-patchbot at kohaaloha.com
koha-patchbot at kohaaloha.com
Fri Nov 4 19:54:58 NZDT 2011
From: Katrin Fischer <Katrin.Fischer.83 at web.de>
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
---
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 4ad42cb..6a91f99 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 2a4078a..4bfb9db 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'},
@@ -142,6 +143,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 6bc978f..bd59c6b 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 001bf0d..adb28ac 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 == "") {
<li><label for="company_fax">Fax</label>
<input type="text" size="20" id="company_fax" name="company_fax" value="[% fax %]" /></li>
<li><label for="website">Website</label>
- <input type="text" size="40" id="website" name="website" value="[% url %]" /></li></ol>
+ <input type="text" size="40" id="website" name="website" value="[% url %]" /></li>
+ <li><label for="accountnumber">Account number</label>
+ <input type="text" size="40" id="accountnumber" name="accountnumber" value="[% accountnumber %]" /></li></ol>
</fieldset>
<fieldset class="rows">
<legend>Contact details</legend>
@@ -136,7 +138,7 @@ if (f.company.value == "") {
<input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
<li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
<li><label for="notes">Notes</label>
- <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
+ <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol>
</fieldset>
<fieldset class="action"><input type="button" value="Save" onclick="check(this.form);" /> [% IF ( id ) %]
<a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?supplierid=[% id %]">[% ELSE %]<a class="cancel" href="/cgi-bin/koha/acqui/acqui-home.pl">
@@ -154,7 +156,10 @@ if (f.company.value == "") {
<p><span class="label">Phone: </span>[% phone %]</p>
<p><span class="label">Fax: </span>[% fax %]</p>
[% IF ( url ) %]
- <p><span class="label">Web site: </span><a href="[% url %]">[% url %]</a></p>
+ <p><span class="label">Website: </span><a href="[% url %]">[% url %]</a></p>
+ [% END %]
+ [% IF ( accountnumber ) %]
+ <p><span class="label">Account number: </span>[% accountnumber %]</p>
[% END %]
</div>
<div id="supplier-contact-details" class="yui-u">
--
1.7.5.4
More information about the Patches
mailing list