return true;
}
-// this function checks if date is like DD/MM/YYYY
-function CheckDate(field) {
- var d = field.value;
- if (d!="") {
- var amin = 1900;
- var amax = 2100;
- var date = d.split("/");
- var ok=1;
- var msg;
- if ( (date.length < 2) && (ok==1) ) {
- msg = _("Separator must be /");
- alert(msg); ok=0; field.focus();
- return false;
- }
- var dd = date[0];
- var mm = date[1];
- var yyyy = date[2];
- // checking days
- if ( ((isNaN(dd))||(dd<1)||(dd>31)) && (ok==1) ) {
- msg = _("day not correct.");
- alert(msg); ok=0; field.focus();
- return false;
- }
- // checking months
- if ( ((isNaN(mm))||(mm<1)||(mm>12)) && (ok==1) ) {
- msg = _("month not correct.");
- alert(msg); ok=0; field.focus();
- return false;
- }
- // checking years
- if ( ((isNaN(yyyy))||(yyyy<amin)||(yyyy>amax)) && (ok==1) ) {
- msg = _("years not correct.");
- alert(msg); ok=0; field.focus();
- return false;
- }
- // check day/month combination
- if ((mm==4 || mm==6 || mm==9 || mm==11) && dd==31) {
- msg = _("Invalid Day/Month combination. Please ensure that you have a valid day/month combination.");
- alert(msg); ok=0; field.focus();
- return false;
- }
- // check for february 29th
- if (mm == 2) {
- var isleap = (yyyy % 4 == 0 && (yyyy % 100 != 0 || yyyy % 400 == 0));
- if (dd>29 || (dd==29 && !isleap)) {
- msg = _("Invalid Day. This year is not a leap year. Please enter a value less than 29 for the day.");
- alert(msg); ok=0; field.focus();
- return false
- }
- }
- }
- return true;
-}
-
-// Checks wether start date is greater than end date
-function CompareDate(startdate, enddate) {
- startdate=startdate.split("/");
- syear = startdate[2];
- smonth = startdate[1];
- sday = startdate[0];
- enddate=enddate.split("/");
- eyear = enddate[2];
- emonth = enddate[1];
- eday = enddate[0];
-
- var sdate = new Date(syear,smonth-1,sday);
- var edate = new Date(eyear,emonth-1,eday);
- if (sdate > edate) {
- msg = _("Start date after end date, please check the dates!");
- alert(msg); ok=0; field.focus();
- return false;
- }
- return true;
-}
-
-// checks wether end date is before today, returns false if it is
-function CheckEndDate(enddate) {
- enddate=enddate.split("/");
- eyear = enddate[2];
- emonth = enddate[1];
- eday = enddate[0];
- var edate = new Date(eyear,emonth-1,eday);
- var today = new Date( );
- if (today > edate) {
- msg = _("End date before today, Invalid end date!");
- alert(msg); ok=0; field.focus();
- return false;
- }
- return true;
-}
-
-
-
//=======================================================================
//=======================================================================
div.appendChild(unclosegroup);
}
+function closeandprint(bg){
+ if(document.location = '/cgi-bin/koha/acqui/basketgroup.pl?op=closeandprint&basketgroupid=' + bg ){
+ setTimeout("window.location.reload();",3000);
+ }else{
+ alert('Error downloading the file');
+ }
+}
+
//function that lets the user unclose a basketgroup as long as he hasn't submitted the changes to the page.
function unclosegroup(bgid){
var div = document.getElementById('basketgroup-'+bgid+'-closed').parentNode;
var bud_id = cell.className;
var val1 = cell.value;
- var remainingTotal = document.getElementById("budget_est_"+bud_id) ;
+ var remainingTotal = document.getElementById("budget_est_"+bud_id).textContent;
var remainingNew =0;
var budgetTotal = document.getElementById("budget_tot_"+bud_id ).textContent;
var arr = getElementsByClass(bud_id);
function autoFillRow(bud_id) {
- var remainingTotal = document.getElementById("budget_est_"+bud_id) ;
+ var remainingTotal = document.getElementById("budget_est_"+bud_id).textContent;
var remainingNew = new Number;
var budgetTotal = document.getElementById("budget_tot_"+bud_id ).textContent;
- var arr = getElementsByClass(bud_id);
+ var arr = getElementsByClass("plan_entry_" + bud_id);
budgetTotal = budgetTotal.replace(/\,/, "");
var qty = new Number;
var listinc = new Number (f.listinc.value);
var currency = f.currency.value;
var applygst = new Number (f.applygst.value);
- var list_price = new Number(f.list_price.value);
+ var listprice = new Number(f.listprice.value);
var invoiceingst = new Number (f.invoiceincgst.value);
var exchangerate = new Number(f.elements[currency].value); //get exchange rate
var gst_on=(!listinc && invoiceingst);
//do real stuff
- var rrp = new Number(list_price*exchangerate);
+ var rrp = new Number(listprice*exchangerate);
var ecost = new Number(rrp * (100 - discount ) / 100);
var GST = new Number(0);
if (gst_on) {
f.ecost.value = ecost.toFixed(2);
f.total.value = total.toFixed(2);
- f.list_price.value = list_price.toFixed(2);
+ f.listprice.value = listprice.toFixed(2);
// gst-stuff needs verifing, mason.
if (f.GST) {
return true;
}
+// Calculates total amount in a suggestion
+
+function calcNewsuggTotal(){
+ //collect values
+ var quantity = new Number(document.getElementById('quantity').value);
+// var currency = f.currency.value;
+ var currcode = new String(document.getElementById('currency').value);
+ var price = new Number(document.getElementById('price').value);
+ var exchangerate = new Number(document.getElementById(currcode).value);
+
+ var total = new Number(quantity*price*exchangerate);
+
+ document.getElementById('total').value = total.toFixed(2);
+ document.getElementById('price').value = listprice.toFixed(2);
+ return true;
+}
+
+
// ----------------------------------------
//USED BY NEWORDEREMPTY.PL
/*