# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
=head1 NAME
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
=head1 NAME
this script allow to update or create (if id == 0)
a supplier. This script is called from acqui/supplier.pl.
=head1 CGI PARAMETERS
this script allow to update or create (if id == 0)
a supplier. This script is called from acqui/supplier.pl.
=head1 CGI PARAMETERS
supplier, id, company, company_postal, physical, company_phone,
physical, company_phone, company_fax, website, company_contact_name,
company_contact_position, contact_phone, contact_phone_2, contact_fax,
company_email, contact_notes, notes, status, publishers_imprints,
list_currency, gst, list_gst, invoice_gst, discount, gstrate.
supplier, id, company, company_postal, physical, company_phone,
physical, company_phone, company_fax, website, company_contact_name,
company_contact_position, contact_phone, contact_phone_2, contact_fax,
company_email, contact_notes, notes, status, publishers_imprints,
list_currency, gst, list_gst, invoice_gst, discount, gstrate.
$data{'address3'}=$addresses[2];
$data{'address4'}=$addresses[3];
$data{'phone'}=$input->param('company_phone');
$data{'address3'}=$addresses[2];
$data{'address4'}=$addresses[3];
$data{'phone'}=$input->param('company_phone');
$data{'fax'}=$input->param('company_fax');
$data{'url'}=$input->param('website');
$data{'contact'}=$input->param('company_contact_name');
$data{'fax'}=$input->param('company_fax');
$data{'url'}=$input->param('website');
$data{'contact'}=$input->param('company_contact_name');
# warn "".$data{'contnotes'};
$data{'notes'}=$input->param('notes');
$data{'active'}=$input->param('status');
# warn "".$data{'contnotes'};
$data{'notes'}=$input->param('notes');
$data{'active'}=$input->param('status');
$data{'listprice'}=$input->param('list_currency');
$data{'invoiceprice'}=$input->param('invoice_currency');
$data{'gstreg'}=$input->param('gst');
$data{'listincgst'}=$input->param('list_gst');
$data{'invoiceincgst'}=$input->param('invoice_gst');
#have to transform this into fraction so it's easier to use
$data{'listprice'}=$input->param('list_currency');
$data{'invoiceprice'}=$input->param('invoice_currency');
$data{'gstreg'}=$input->param('gst');
$data{'listincgst'}=$input->param('list_gst');
$data{'invoiceincgst'}=$input->param('invoice_gst');
#have to transform this into fraction so it's easier to use
-$data{'gstrate'}=$input->param('gstrate')/100;
-$data{'discount'}=$input->param('discount');
+$data{'gstrate'} = $input->param('gstrate');
+$data{'discount'} = $input->param('discount');
+$data{deliverytime} = $input->param('deliverytime');