//------------------------------------------------------------- //-----------------Do not edit the XML tags-------------------- //------------------------------------------------------------- // //ACRO_Breakpoints // /*********** belongs to: Document-Level:ACRO_Breakpoints ***********/ var ACRO_breakpoints = [{fileName:"AcroForm:ServiceFee:Annot1:MouseDown:Action1", lineNum:14, condition:"true"}, {fileName:"AcroForm:ServiceFee:Annot1:MouseDown:Action1", lineNum:17, condition:"true"}]; // // // //Page1:Page Open:Action2 // /*********** belongs to: Page-Actions:Page1:Page Open:Action2 ***********/ this.getField("CM9_Ref").setFocus(); // // // //CM9_Ref:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:CM9_Ref:Annot1:OnBlur:Action1 ***********/ //Set var var CRef = this.getField("CM9_Ref") var CRef_1 = this.getField("CM9_Ref-1") //Set CM9 Reference Number Fields across the form to the initial one entered { CRef_1.value = CRef.value } // // // //CalculateNow:Annot1:MouseDown:Action1 // /*********** belongs to: AcroForm:CalculateNow:Annot1:MouseDown:Action1 ***********/ /* ****************************************************************************************** */ /* This Section will calculate the costs for Standard and Non-Standard Items on Page 1 */ /* ****************************************************************************************** */ //Set Standard Item Variables var ExPriceArray = new Array(); var ExPriceTotal = this.getField("ItemExPriceTotal-ExGst"); var ExPriceGst = this.getField("ItemExPriceGST"); var z = 0, l = 0; //Calculate the Standard Items (Table 2.a.) - Total Exended Price and GST //Zeroise Array while (z < 11) { ExPriceArray[z] = 0; ExPriceTotal.value = 0; z++; } while (l < 11) { ExPriceArray[l] = this.getField("ItemExPrice." + l); ExPriceTotal.value = ExPriceTotal.value + ExPriceArray[l].value; l++; } ExPriceGst.value = ExPriceTotal.value * 0.1; /* ****************************************************************************************** */ //Set Non-Standard Item Variables var NSExPriceArray = new Array(); var NSExPriceTotal = this.getField("NSExPriceTotal-ExGst"); var NSExPriceGst = this.getField("NSExPriceGST"); var z = 0, l = 0; //Calculate the Non-Standard Items (Table 2.b.) - Total Exended Price and GST //Zeroise Array while (z < 7) { NSExPriceArray[z] = 0; NSExPriceTotal.value = 0; z++; } while (l < 7) { NSExPriceArray[l] = this.getField("NSExPrice." + l); NSExPriceTotal.value = NSExPriceTotal.value + NSExPriceArray[l].value; l++; } NSExPriceGst.value = NSExPriceTotal.value * 0.1; /* ****************************************************************************************** */ /* This Section will calculate the costs for Additional Materials, */ /* Addional Labour and Travel Costs on Page 2 */ /* ****************************************************************************************** */ //Set Additional materials Item Variables var MaterialExPriceArray = new Array(); var MaterialExPriceTotal = this.getField("MaterialExPriceTotal-ExGst"); var MaterialExPriceGst = this.getField("MaterialExPriceGST"); var z = 0, l = 0; //Zeroise Array while (z < 4) { MaterialExPriceArray[z] = 0; MaterialExPriceTotal.value = 0; z++; } //Calculate Material Total and GST while (l < 4) { MaterialExPriceArray[l] = this.getField("MaterialExPrice." + l); MaterialExPriceTotal.value = MaterialExPriceTotal.value + MaterialExPriceArray[l].value; l++; } MaterialExPriceGst.value = MaterialExPriceTotal.value * 0.1; /* ******************************************************************************************* */ //Set Supplimentary Charges Variables (Table 3.b.) //GST per Line var MHRG0 = this.getField("RateGst.0") var MHRG1 = this.getField("RateGst.1") var MHRG2 = this.getField("RateGst.2") var MHRG3 = this.getField("RateGst.3") //Extended Price of Additional Manhours per line var MHEP0 = this.getField("MHExPrice.0") var MHEP1 = this.getField("MHExPrice.1") var MHEP2 = this.getField("MHExPrice.2") var MHEP3 = this.getField("MHExPrice.3") //Travel Charges var TP = this.getField("TravelPrice") //Total Supplimnetary Cost var SCT = this.getField("SuppChgTotal") //Calculate Manhours GST per Line { MHRG0.value = MHEP0.value * 0.1 MHRG1.value = MHEP1.value * 0.1 MHRG2.value = MHEP2.value * 0.1 MHRG3.value = MHEP3.value * 0.1 } //Calculate the Total Cost for Supplimentary Charges including the GST. { SCT.value = ((MHEP0.value + MHEP1.value + MHEP2.value + MHEP3.value) * 1.1) + TP.value; } /* ****************************************************************************************** */ /* This Section will determin the % value of the Service Fee to be applied */ /* and calculate the value of that Service Fee */ /* ****************************************************************************************** */ //Set Service Fees Variables (Table 3.a) var Applied = this.getField("FeeApplied"); var Fee = this.getField("FeeChBx"); var FeeGST = this.getField("FeeExGST"); var FeeTotal = this.getField("FeeExTotal"); var FeeRate = new Array("0.2","0.15","0.14","0.13","0.12","0.11","0.1"); var FeeAmount = new Array("0","10000","100000","200000","300000","400000","500000"); var FTV = 0; //Calculated Fee Test Value (FTV) used for determining Sevice Fee Rate var FM = 0; var count = 0; //Start Fee Rate Calculations FeeTotal.value = 0; if (Fee.isBoxChecked(0) == 1) { FTV = NSExPriceTotal.value + MaterialExPriceTotal.value while (count < 7) { if (FTV >= FeeAmount[count]) { FM = FeeRate[count] Applied.value = "A Service Fee of " + (FeeRate[count] * 100) + "% has been applied to this work order."; FeeTotal.value = FTV * FM; FeeGST.value = FeeTotal.value * 0.1; } count++ } Applied.hidden = false; Fee.hidden = true; } /* //Fee Rates 20% up to $10,000 15% up to $100,000 14% up to $200,000 13% up to $300,000 12% up to $400,000 11% up to $500,000 10% beyond $500,001 */ /* ****************************************************************************************** */ /* This Section will calculate the Total cost of this work order */ /* and prepare the form for final signatures */ /* ****************************************************************************************** */ //Set Total Cost variables var TotFundRequest = this.getField("Total_Funds_Requested") var ItemTotal = this.getField("ItemTotal") var NSTotal = this.getField("NSTotal") var MatTotal = this.getField("MaterialTotal") var FeeTot = this.getField("FeeExTotal") var SuppTot = this.getField("SuppChgTotal") var TotCost = this.getField("Total_Cost-1") //Calculate the Total Funds being requested for this activity { TotFundRequest.value = ItemTotal.value + NSTotal.value + MatTotal.value + FeeTot.value + SuppTot.value; TotCost.value = TotFundRequest.value; } /* ****************************************************************************************** */ /* Miscellaneous Functions */ /* ****************************************************************************************** */ //Miscellaneous Variables var Clear = this.getField("ClearForm") //Miscellaneous Functions Clear.hidden = false /* ****************************************************************************************** */ /* Set Contract ID on each page */ /* ****************************************************************************************** */ //Set var var CId = this.getField("Contract_ID") var CId_1 = this.getField("Contract_ID-1") //Set Contract ID Number Fields across the form to the initial one entered here { CId_1.value = CId.value } // // // //Contract_ID:Annot1:OnFocus:Action1 // /*********** belongs to: AcroForm:Contract_ID:Annot1:OnFocus:Action1 ***********/ //Set var var CId = this.getField("Contract_ID") var CId_1 = this.getField("Contract_ID-1") //Set Contract ID Number Fields across the form to the initial one entered here { CId_1.value = CId.value } // // // //Contractor_Signature:Annot1:MouseDown:Action1 // /*********** belongs to: AcroForm:Contractor_Signature:Annot1:MouseDown:Action1 ***********/ //Set Variables var ClearBtn = this.getField("ClearForm") var CalcBtn = this.getField("CalculateNow") //Hide Buttons ClearBtn.hidden = true CalcBtn.hidden = true // // // //EmpowerLink:Annot1:MouseDown:Action1 // /*********** belongs to: AcroForm:EmpowerLink:Annot1:MouseDown:Action1 ***********/ // This section is under development and will be used to set the Empower Reference to be a Hyperlink on he Main System { var SRRef = this.getField("Empower Reference"); var SRLink = "ServiceRequest/Edit/" + SRRef.value; var EmpLink = app.launchURL(SRLink) } // // // //FeeChBx:Annot1:MouseUp:Action1 // /*********** belongs to: AcroForm:FeeChBx:Annot1:MouseUp:Action1 ***********/ /* Script to automatically calculate the Service Fee for a given work Order */ //set local Variables var Applied = this.getField("FeeApplied"); var Fee = this.getField("FeeChBx"); var FeeGST = this.getField("FeeExGST"); var FeeTotal = this.getField("FeeExTotal"); switch (Fee.isBoxChecked(0)) { case 1: Applied.hidden = false; Applied.value = "A Service Fee will be applied to this work order."; FeeGST.hidden = false; FeeTotal.hidden = false; break; case 0: Applied.hidden = true FeeGST.value = 0 FeeTotal.value = 0 FeeGST.hidden = true; FeeTotal.hidden = true; break; } // // // //Fund_Cost_Centre:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:Fund_Cost_Centre:Annot1:OnBlur:Action1 ***********/ //Set var var FundCCC = this.getField("Fund_Cost_Centre") var FundCCC_1 = this.getField("Fund_Cost_Centre-1") //Set Contract ID Number Fields across the form to the initial one entered here { FundCCC_1.value = FundCCC.value; } // // // //Fund_Source:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:Fund_Source:Annot1:OnBlur:Action1 ***********/ //Set var var FundSrc = this.getField("Fund_Source") var FundSrc_1 = this.getField("Fund_Source-1") //Set Contract Funding Source Fileds across the form to the initial one entered here { FundSrc_1.value = FundSrc.value } // // // //Restore:Annot1:MouseDown:Action1 // /*********** belongs to: AcroForm:Restore:Annot1:MouseDown:Action1 ***********/ //Set Variables var ClearBtn = this.getField("ClearForm") var CalcBtn = this.getField("CalculateNow") var Signed = this.getField("Funds_Signature") //Toggle Buttons switch (ClearBtn.hidden) { case true: ClearBtn.hidden = false; CalcBtn.hidden = false; break; case false: ClearBtn.hidden = true; CalcBtn.hidden = true; break; } if (Signed.readOnly = true) { Signed.readOnly = false; } // // // //SuppChg.0:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:SuppChg.0:Annot1:OnBlur:Action1 ***********/ //Set the Labour Rate for Additional manpowers based on the Selection form the drop down list //Define variables var LabCat = new Array("Choose From List","Installer - WeekDay","Installer - OT","Installer - Saturday","Installer - Sunday/Public Holiday","Coord - WeekDay","Coord - OT","Coord - Saturday","Coord - Sunday/Public Holiday"); var LabRate = new Array("0","110","140","140","175","125","160","160","200"); var ManCat = this.getField("SuppChg.0"); var ManRate = this.getField("ManHourRate.0"); var count = 0; //Test Array elements for a match while (count <= 6) { if(ManCat.value == LabCat[count]) { ManRate.value = LabRate[count] } count++ } // // // //SuppChg.1:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:SuppChg.1:Annot1:OnBlur:Action1 ***********/ //Set the Labour Rate for Additional manpowers based on the Selection from the drop down list //Define variables var LabCat = new Array("Choose From List","Installer - WeekDay","Installer - OT","Installer - Saturday","Installer - Sunday/Public Holiday","Coord - WeekDay","Coord - OT","Coord - Saturday","Coord - Sunday/Public Holiday"); var LabRate = new Array("0","110","140","140","175","125","160","160","200"); var ManCat = this.getField("SuppChg.1"); var ManRate = this.getField("ManHourRate.1"); var count = 0; //Test Array elements for a match while (count <= 6) { if(ManCat.value == LabCat[count]) { ManRate.value = LabRate[count] } count++ } // // // //SuppChg.2:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:SuppChg.2:Annot1:OnBlur:Action1 ***********/ //Set the Labour Rate for Additional manpowers based on the Selection form the drop down list //Define variables var LabCat = new Array("Choose From List","Installer - WeekDay","Installer - OT","Installer - Saturday","Installer - Sunday/Public Holiday","Coord - WeekDay","Coord - OT","Coord - Saturday","Coord - Sunday/Public Holiday"); var LabRate = new Array("0","110","140","140","175","125","160","160","200"); var ManCat = this.getField("SuppChg.2"); var ManRate = this.getField("ManHourRate.2"); var count = 0; //Test Array elements for a match while (count <= 6) { if(ManCat.value == LabCat[count]) { ManRate.value = LabRate[count] } count++ } // // // //SuppChg.3:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:SuppChg.3:Annot1:OnBlur:Action1 ***********/ //Set the Labour Rate for Additional manpowers based on the Selection form the drop down list //Define variables var LabCat = new Array("Choose From List","Installer - WeekDay","Installer - OT","Installer - Saturday","Installer - Sunday/Public Holiday","Coord - WeekDay","Coord - OT","Coord - Saturday","Coord - Sunday/Public Holiday"); var LabRate = new Array("0","110","140","140","175","125","160","160","200"); var ManCat = this.getField("SuppChg.3"); var ManRate = this.getField("ManHourRate.3"); var count = 0; //Test Array elements for a match while (count <= 6) { if(ManCat.value == LabCat[count]) { ManRate.value = LabRate[count] } count++ } // // // //SurgeApprovalSign:Annot1:MouseDown:Action1 // /*********** belongs to: AcroForm:SurgeApprovalSign:Annot1:MouseDown:Action1 ***********/ this.getField("Commonwealth_Signature").readonly = false; // // // //SurgeChBx:Annot1:MouseUp:Action1 // /*********** belongs to: AcroForm:SurgeChBx:Annot1:MouseUp:Action1 ***********/ //Script to Hide or Show Additional Labour Fields //Set Variables var Surge = this.getField("SurgeChBx") var Travel = this.getField("TravelChBx") var SurgeSign = this.getField("SurgeApproval") var SurgeApprov = this.getField("SurgeApprovalSign") var CommSign = this.getField("Commonwealth_Signature") var SurgeCat = new Array() var SurgeMH = new Array() var SurgeRate = new Array() var SurgeGST = new Array() //Toggle Labour Fields switch (Surge.isBoxChecked(0)) { case 1: //Surge Hours Check Box - Checked var i = 0 while (i <= 3) { SurgeCat[i] = this.getField("SuppChg." + i); SurgeMH[i] = this.getField("ManHours." + i); SurgeRate[i] = this.getField("ManHourRate." + i); SurgeCat[i].hidden = false; SurgeMH[i].hidden = false; SurgeRate[i].hidden = false; i++ } SurgeApprov.hidden = false; SurgeSign.hidden = false; CommSign.hidden = true; this.getField("SuppChg.0").setFocus(); break; case 0: //Surge Hours Check Box - UnChecked var i = 0 while (i <= 3) { SurgeCat[i] = this.getField("SuppChg." + i); SurgeMH[i] = this.getField("ManHours." + i); SurgeRate[i] = this.getField("ManHourRate." + i); SurgeGST[i] = this.getField("RateGst." + i); SurgeCat[i].value = "Choose From List" SurgeMH[i].value = 0; SurgeRate[i].value = 0; SurgeGST[i].value = 0; SurgeCat[i].hidden = true; SurgeMH[i].hidden = true; SurgeRate[i].hidden = true; i++ } if(Travel.isBoxChecked(0) == 0) { SurgeApprov.hidden = true; SurgeSign.hidden = true; } CommSign.hidden = false; break; } // // // //TaskDescription:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:TaskDescription:Annot1:OnBlur:Action1 ***********/ this.getField("Item-a.0").setFocus(); // // // //Tracking_Number:Annot1:OnBlur:Action1 // /*********** belongs to: AcroForm:Tracking_Number:Annot1:OnBlur:Action1 ***********/ //Set var var TrackNum = this.getField("Tracking_Number") var TrackNum_1 = this.getField("Tracking_Number-1") //Set Tracking Number Fields across the form to the initial one entered in the Funds Availability sign off section { TrackNum_1.value = TrackNum.value; } // // // //TravelChBx:Annot1:MouseUp:Action1 // /*********** belongs to: AcroForm:TravelChBx:Annot1:MouseUp:Action1 ***********/ //Script to Hide or Show Travel Costs //Set Variables var Surge = this.getField("SurgeChBx") var Travel = this.getField("TravelChBx") var TvlCvr = this.getField("TvlTxtCover") var TvlPrice = this.getField("TravelPrice") var SurgeApprov = this.getField("SurgeApproval") var SurgeSign = this.getField("SurgeApprovalSign") var CommSign = this.getField("Commonwealth_Signature") //Toggle Travel Fields switch (Travel.isBoxChecked(0)) { case 1: //Travel Check Box - Checked TvlCvr.hidden = true; TvlPrice.hidden = false; SurgeApprov.hidden = false; SurgeSign.hidden = false; CommSign.hidden = true; break; case 0: //Travel Check Box - UnChecked TvlCvr.hidden = false; TvlPrice.hidden = true; TvlPrice.value = 0; if(Surge.isBoxChecked(0) == 0) { SurgeApprov.hidden = true; SurgeSign.hidden = true; } CommSign.hidden = false; break; } // // // //WorkOrderDate:Annot1:MouseDown:Action1 // /*********** belongs to: AcroForm:WorkOrderDate:Annot1:MouseDown:Action1 ***********/ //Automatically Set Date to Today var Raised = this.getField("WorkOrderDate"); var Today = new Date(); var MonthName = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); var DD = Today.getDate(); var MM = Today.getMonth(); var YY = Today.getFullYear(); { if(DD < 10) { DD = "0" + DD } Raised.value = DD + " " + MonthName[MM] + " " + YY } // // // //WorkOrderDate:Annot1:OnFocus:Action1 // /*********** belongs to: AcroForm:WorkOrderDate:Annot1:OnFocus:Action1 ***********/ //Automatically Set Date to Today var Raised = this.getField("WorkOrderDate"); var Today = new Date(); var MonthName = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); var DD = Today.getDate(); var MM = Today.getMonth(); var YY = Today.getFullYear(); { if(DD < 10) { DD = "0" + DD } Raised.value = DD + " " + MonthName[MM] + " " + YY } // //