功能错误

时间:2013-09-24 22:44:04

标签: javascript

BEGIN


   -- ===== Populate Records ======
   rec_s_prop_im := Dml_S_Property_Item_Master.get_rec(pv_item_master_id,pvPropertyId);

  vScript :=
           'function updateTransCode() {'||CHR(10)||
         --  'alert(parent.head.document.form1.pv_cc_valid.checked)'||chr(10)||
             'var ccValid = parent.head.document.form1.pv_cc_valid.checked ? "Y" : "N";'||CHR(10)||
             'var ecValid = parent.head.document.form1.pv_extra_chg_valid.checked ? "Y" : "N";'||CHR(10)||
             'var folioValid = parent.head.document.form1.pv_folio_valid.checked ? "Y" : "N";'||CHR(10)||
             'var rrValid = parent.head.document.form1.pv_room_rev.checked ? "Y" : "N";'||CHR(10)||
             'var tourValid = parent.head.document.form1.pv_tour_valid.checked ? "Y" : "N";'||CHR(10)|| --hponnal for 7995
             'var adValid = parent.head.document.form1.pv_adv_dep_valid.checked ? "Y" : "N";'||CHR(10)||
             'var pkgValid = parent.head.document.form1.pv_package_valid.checked ? "Y" : "N";'||CHR(10)||
             'var clValid = parent.head.document.form1.pv_city_ledger_valid.checked ? "Y" : "N";'||CHR(10)||
        --     'alert(ccValid);'||chr(10)||
             'if (checkfields()) {'||CHR(10)||
               'window.parent.mid.location=("setup_cl_trans_codes.show_mid?pv_item_master_id='||pv_item_master_id||'");'||CHR(10)||
               'window.parent.detail.location=("setup_cl_trans_codes.updaterecs'||
                 '?pv_item_master_id='||pv_item_master_id||
                 '&pvPropertyId="+document.form1.pvProperty.value+'||
                 -- 29095b
                 --'"&pv_des1="+parent.head.document.form1.pv_des1.value+'||
                 '"&pv_des1="+escape(parent.head.document.form1.pv_des1.value)+'||
                 -- 29095e
                 '"&pv_trans_type_code="+parent.head.document.form1.pv_trans_type_code.value+'||
                 '"&pv_ar_account_number="+document.form1.pv_ar_account_number.value+'||
                 '"&pv_income_account_number="+document.form1.pv_income_account_number.value+'||
                 '"&pv_taxable="+document.form1.pv_taxable.value+'||
                 '"&pv_adv_dep_valid="+adValid+'||
                 '"&pv_extra_chg_valid="+ecValid+'||
                 '"&pv_package_valid="+pkgValid+'||
                 '"&pv_folio_valid="+folioValid+'||
                 '"&pv_city_ledger_valid="+clValid+'||
                 '"&pv_cc_valid="+ccValid+'||
                 '"&pv_room_rev="+rrValid+'||
                 '"&pv_tour_valid="+tourValid+'|| --hponnal for 7995
                 '"&pv_item_type_code="+document.form1.pv_item_type_code.value+'||
                 '"&pv_item_categ_code="+parent.head.document.form1.pv_item_categ_code.value+'||
                 '"&pv_transfer_code="+document.form1.pv_transfer_code.value+'||
                 '"&pv_active="+document.form1.pv_active.value+'||
                 '"&pvRoomRevDist="+document.form1.pvRoomRevDist.value+'||
                 '"&pv_sales_tax="+document.form1.pv_sales_tax.value'||
                 ');'||CHR(10)||
              '}'||CHR(10)||
           '}'||CHR(10)||
           'function setTaxTypeCode() {'||CHR(10)||
           '    frm=document.form1;'||CHR(10)||
           '    if (frm.pv_taxable.value == "N") {'||CHR(10)||
           '        frm.pv_item_type_code.value = "";'||CHR(10)||
           '    }'||CHR(10)||
           '}'||CHR(10)||
           'function checkfields() {'||CHR(10)||
           '    frm=document.form1;'||CHR(10)||
           '    missinginfo = "";' ||CHR(10)||
           '    if (parent.head.document.form1.pv_des1.value == "") {'||CHR(10)||
           '        missinginfo += "\n - Description";' ||CHR(10)||
           '    }'||CHR(10)||
           '    /*'||CHR(10)||
           '     * for inv and fin, make sure have ar and income acct numbers'||CHR(10)||
           '     */'||CHR(10)||
           '    if (parent.head.document.form1.pv_trans_type_code.value == "") {'||CHR(10)||
           '        missinginfo += "\n - Transaction Type";' ||CHR(10)||
           '    }'||CHR(10)||
           '    if (parent.head.document.form1.pv_trans_type_code.value == "INV" || '||CHR(10)||
           '        parent.head.document.form1.pv_trans_type_code.value == "FIN") {'||CHR(10)||
           '        if (frm.pv_ar_account_number == "" || '||CHR(10)||
           '            frm.pv_income_account_number.value == "") {'||CHR(10)||
           '              missinginfo += "\n - AR and Income Account numbers";' ||CHR(10)||
           '        }'||CHR(10)||
           '    }'||CHR(10)||
           '    /*'||CHR(10)||
           '     * for db and cr memos, make sure have income acct number'||CHR(10)||
           '     */'||CHR(10)||
           '    if (parent.head.document.form1.pv_trans_type_code.value == "CR" || '||CHR(10)||
           '        parent.head.document.form1.pv_trans_type_code.value == "DB") {'||CHR(10)||
           '        if (frm.pv_income_account_number.value == "") {'||CHR(10)||
           '              missinginfo += "\n - Income Account number";' ||CHR(10)||
           '        }'||CHR(10)||
           '    }'||CHR(10)||
           '    /*'||CHR(10)||
           '     * if say it is taxable, make sure item type code is not null'||CHR(10)||
           '     */'||CHR(10)||
           '    if (frm.pv_taxable.value == "Y") {'||CHR(10)||
           '        if (frm.pv_item_type_code.value == "") {'||CHR(10)||
           '              missinginfo += "\n - Tax Type Code";' ||CHR(10)||
           '        }'||CHR(10)||
           '    }'||CHR(10)||
           '    /*'||CHR(10)||
           '     * make sure code is valid for at least one thing'||CHR(10)||
           '     */'||CHR(10)||
           '    if (parent.head.document.form1.pv_adv_dep_valid.checked == false &&'||CHR(10)||
           '        parent.head.document.form1.pv_extra_chg_valid.checked == false &&'||CHR(10)||
           '        parent.head.document.form1.pv_package_valid.checked == false &&'||CHR(10)||
           '        parent.head.document.form1.pv_folio_valid.checked == false &&'||CHR(10)||
           '        parent.head.document.form1.pv_city_ledger_valid.checked == false &&'||CHR(10)||
           '        parent.head.document.form1.pv_cc_valid.checked == false &&'||CHR(10)||
           '        parent.head.document.form1.pv_room_rev.checked == false &&'||CHR(10)||
           '        parent.head.document.form1.pv_tour_valid.checked == false &&'||CHR(10)|| --hponnal for 7995
           '        parent.head.document.form1.pv_city_ledger_valid.checked == false) {'||CHR(10)||
           '          missinginfo += "\n - Must be Valid for something";'||CHR(10)||
           '    }'||CHR(10)||
           '    if (frm.pvProperty.value != "" || frm.pv_taxable.value != "" || frm.pv_item_type_code.value != "" || '||
           '        frm.pv_ar_account_number.value != "" || frm.pv_income_account_number.value != "" || frm.pv_transfer_code.value  != "") {'||CHR(10)||
           '        /* one of the fields in the MID frame is populated. Check required fields */'||CHR(10)||
           '       if (frm.pvProperty.value == "") missinginfo += "\n - Property Id";' ||CHR(10)||
           '       if (frm.pv_taxable.value == "") missinginfo += "\n - Taxable Flag";' ||CHR(10)||
           '       if (frm.pv_active.value == "") missinginfo += "\n - Active Flag";' ||CHR(10)||
           '       if (frm.pv_ar_account_number.value == "") missinginfo += "\n - A/R Account";'||CHR(10)||
           '       if (frm.pv_income_account_number.value == "") missinginfo += "\n - Income Acct.";' ||CHR(10)|| --Ramesh Issue 7827
           '       if (frm.pv_taxable.value == "Y" && frm.pv_item_type_code.value == ""){'||CHR(10)||
           '         alert("You must enter a Tax Type Code if Taxable flag is set to Yes");'||CHR(10)||
           '         return false;'||CHR(10)||
           '       }'||CHR(10)||
           '       if (frm.pv_taxable.value == "N" && frm.pv_item_type_code.value != "") {'||CHR(10)||
           '         alert("You cannot assign a Tax Type Code to a Non-Taxable Item.");'||CHR(10)||
           '         return false;'||CHR(10)||
           '       }'||CHR(10)||
           '       if (parent.head.document.form1.pv_room_rev.checked == true && frm.pvRoomRevDist.value == "") {'||CHR(10)||
           '         alert("You must indicate Room Revenue Distribution for items that are Valid for Room Revenue.");'||CHR(10)||
           '         return false;'||CHR(10)||
           '       }'||CHR(10)||
           '    }'||CHR(10)||
           '    if (missinginfo != "") {'||CHR(10)||
           '        missinginfo ="_____________________________\n" +'||CHR(10)||
           '        "you failed to correctly fill in your:\n" +'||CHR(10)||
           '        missinginfo + "\n_____________________________" +'||CHR(10)||
           '        "\nplease re-enter and submit again!";'||CHR(10)||
           '        alert(missinginfo);'||CHR(10)||
           '        return false;'||CHR(10)||
           '    }'||CHR(10)||
           '    else {'||CHR(10)||
           '        return true;'||CHR(10)||
           '    }'||CHR(10)||
       '}'||CHR(10)||
       -- FP12430
       ' function getProperty() { '||CHR(10)||
        '  var frm = document.form1; '||CHR(10)||
        '  var codes = frm.pvProperty.value; '||CHR(10)||
        ' if (codes == "ALL") { codes = ""; } '||CHR(10)||
        ' var params = "?pvSwapName=PROPERTY";'||CHR(10)||
        ' params += "&pvformFieldName=form1.pvProperty";'||CHR(10)||
        ' params +="&pvCodes="+codes;' ||CHR(10)||
        '  sSearch = window.open("swaplist_util_pkg.swap_this"+params,"swap","menubar=no,height=400,width=700");'||CHR(10)||
       '}'||CHR(10)


        ' function getResvType() { '||CHR(10)||
        '  var frm = document.form1; '||CHR(10)||
        '  var codes = frm.pvProperty.value; '||CHR(10)||
        ' if (codes == "ALL") { codes = ""; } '||CHR(10)||
        ' var params = "?pvSwapName=PROPERTY";'||CHR(10)||
        ' params += "&pvformFieldName=form1.pvProperty";'||CHR(10)||
        ' params +="&pvCodes="+codes;' ||CHR(10)||
        '  sSearch = window.open("swaplist_util_pkg.swap_this"+params,"swap","menubar=no,height=400,width=700");'||CHR(10)||
       '}'||CHR(10);

   Util_Pkg.print_header(pvShowNav    => FALSE,
                         pvJavaScript => vScript,
                         pbCachePage  => TRUE);


     htp.p('<table class="tabledef" width=890 border="0">');
     htp.p('<tr>');
        htp.p('<td class="tablehead">Property Transaction Code Maintenance</td>');
     htp.p('</tr>');
     htp.p('</table>');


     htp.p('<table class="tabledef" width=890 border="0">');
      htp.p('<tr align="left">');
        htp.p('<td width=2>&nbsp;</td>');
        htp.p('<td width=215 class="reqlabel1">Property Id:</td>');
        htp.p('<td width=100 class="reqlabel1">Taxable:</td>');
        htp.p('<td width=218 class="tablelabel">Tax Type Code:</td>');
        htp.p('<td width=155 class="tablelabel">Room Revenue Dist:</td>');
        htp.p('<td class="reqlabel1">Active:</td>');
       htp.p('</tr>');
     htp.p('</table>');


     htp.p('<table class="tabledef" width=890 border="0">');
     htp.p('<FORM name="form1" method="post" action=" ">');
      htp.p('<tr align="left">');
        htp.p('<td width=2>&nbsp;</td>');
        htp.p('<td width=215 class="tabletext1">');

    -- FP12430
    htp.p('<input class="reqinput1" type="text" name="pvProperty" size="28" maxlength="150" value="'||pvPropertyId||'">');
    htp.p('<a href="javascript:getProperty();"><b>oo</b></a>');

        htp.p('</td>');


        htp.p('<td width=100  class="tabletext1">');
          htp.p(Get_Yesno_Dd(pvName => 'pv_taxable',
                             pvDefVal => rec_s_prop_im.taxable,
                             pvEvent => 'class="droptext1" style="width:60px" onChange="setTaxTypeCode()"'));
        htp.p('</td>');


        htp.p('<td width=218 class="tabletext1">');
          htp.p(Get_Ar_Item_Type_Code_Dd(pvName => 'pv_item_type_code',
                                         pvDefVal => rec_s_prop_im.item_type_code,
                                         pvEvent => 'class="droptext1" style="width:200px"',
                                         pvFirstItmDesc => ' '));
        htp.p('</td>');

        IF rec_s_prop_im.item_master_id IS NOT NULL THEN
          vRdDistDef := rec_s_prop_im.room_revenue_dist;
        ELSE
          vRdDistDef := 'N';
        END IF;
        htp.p('<td width=155  class="tabletext1">');
          htp.p(Get_Yesno_Dd(pvName => 'pvRoomRevDist',
                             pvDefVal => vRdDistDef,
                             pvEvent => 'class="droptext1" style="width:60px"'));
        htp.p('</td>');

        IF rec_s_prop_im.item_master_id IS NOT NULL THEN
          vActiveDef := rec_s_prop_im.active;
        ELSE
          vActiveDef := 'Y';
        END IF;
        htp.p('<td class="tabletext1">');
          htp.p(Get_Yesno_Dd(pvName => 'pv_active',
                             pvDefVal => vActiveDef,
                             pvEvent => 'class="reqinput1" style="width:60px"'));
        htp.p('</td>');

      htp.p('</tr>');
      htp.p('</table>');

      htp.p('<table class="tabledef" width=890 border="0">');
      htp.p('<tr align="left">');
        htp.p('<td width=2>&nbsp;</td>');
        htp.p('<td width=40 class="reqlabel1">A/R Acct:</td>');


        htp.p('<td width=170 class="tabletext1">');
          htp.p('<input class="reqinput1" VALUE="'||rec_s_prop_im.gl_account_code||'" TYPE="text" name="pv_ar_account_number" SIZE="20" MAXLENGTH="35">');
        htp.p('</td>');

        htp.p('<td width=50  class="reqlabel1">Income Acct:</td>');  --Ramesh Issue 7827
        htp.p('<td width=180 class="tabletext1">');
           htp.p('<input class="droptext1" VALUE="'||rec_s_prop_im.income_account_number||'" TYPE="text" name="pv_income_account_number" SIZE="20" MAXLENGTH="35">');
        htp.p('</td>');


        htp.p('<td width=60  class="tablelabel">Transfer Code:</td>');
        htp.p('<td class="tabletext1"><span id="transCode">');
        IF pvPropertyId IS NOT NULL THEN
           htp.p(Get_Cl_Item_Master_Dd(pvName => 'pv_transfer_code',
                                          pvDefVal => rec_s_prop_im.transfer_code,
                                       pvEvent => 'class="droptext1" style="width:200px"',
                                       pvFirstItmDesc => '',
                                       pvTransType => 'CHG',
                                       pvProperty => pvPropertyId));
        ELSE

          htp.p('<SELECT NAME="pv_transfer_code" class="droptext1" style="width:220px">'||CHR(10)||
                '<OPTION value=""> '||CHR(10)||
                '</SELECT>');
        END IF;

        htp.p('</span></td>');
        --hponnal for 10651
        htp.p('<td width=60  class="tablelabel">Sales Tax:</td>');
        htp.p('<td class="tabletext1">');
          htp.p(Get_Yesno_Dd(pvName => 'pv_sales_tax',
                             pvDefVal => rec_s_prop_im.sales_tax,
                             pvEvent => 'class="reqinput1" style="width:60px"'));
        htp.p('</td>');
       --
      htp.p('</tr>');

      --32303 + start
      htp.p('<tr>');
      htp.p('<td width=2>&nbsp;</td>');
      htp.p('<td colspan=2 class="tablelabel">Order Description:</td>');
      htp.p('<td colspan=2 class="tabletext1">');
        htp.p('<input class="" type="text" name="pvOnlineDesc" size="28" maxlength="1000" value="'||pvPropertyId||'">');
      htp.p('</td>');
      htp.p('<td class="tablelabel">Amount:</td>');
      htp.p('<td class="tabletext1">');
        htp.p('<input class="" type="text" name="pvAmount" size="7" maxlength="20" value="'||pvPropertyId||'">');
--      IF rec_p_item_master.cc_valid = 'Y' THEN vChecked := 'CHECKED'; ELSE vChecked := NULL; END IF;
        vChecked := 'CHECKED';
        htp.p('<input type="checkbox" name="pv_cc_valid" value="Y" '||vChecked||'> Force on Folio');
      htp.p('</td>');
      htp.p('</tr>');


      htp.p('<tr>');
          htp.p('<td width=2>&nbsp;</td>');
          htp.p('<td colspan=2 class="tablelabel">Reservation Type(s):</td>');
          htp.p('<td colspan=2 class="tabletext1">');
             htp.p('<input class="" type="text" name="pvResvType" size="28" maxlength="150" value="'||pvPropertyId||'">');
             htp.p('<a href="javascript:getResvType();"><b>oo</b></a>');
          htp.p('</td>');
      htp.p('</tr>');

      htp.p('<tr>');
          htp.p('<td width=2>&nbsp;</td>');
          htp.p('<td colspan=2 class="tablelabel">Not Offered From:</td>');
          htp.p('<td colspan=2 class="tabletext1">');
            htp.p('<input class="" type="text" name="pvNotFrom" size="15" maxlength="150" value="'||pvPropertyId||'">');
          htp.p('</td>');
          htp.p('<td colspan=2 class="tablelabel">');
            htp.p('Extra Charge type:');
            htp.p(Get_Ar_Extra_Charge_Type_Dd(pvName => 'pv_extra_charge_type',
--                                             pvDefVal => rec_s_prop_im.item_type_code,
                                             pvEvent => 'class="droptext1"',
                                             pvFirstItmDesc => ' '));
          htp.p('</td>');

      htp.p('</tr>');

      htp.p('<tr>');
          htp.p('<td width=2>&nbsp;</td>');
          htp.p('<td colspan=2 class="tablelabel">Not Offered To:</td>');
          htp.p('<td colspan=2 class="tablelabel">');
             htp.p('<input class="" type="text" name="pvNotTo" size="15" maxlength="150" value="'||pvPropertyId||'">');
          htp.p('</td>');
          htp.p('<td colspan=2>&nbsp;</td>');
          htp.p('<td colspan=2>');
              vChecked := 'CHECKED';
              htp.p('<input type="checkbox" name="pv_apply_to_all" value="Y" '||vChecked||'> Apply to All');
          htp.p('</td>');
      htp.p('</tr>');
      --32303 + end

     htp.p('</FORM>');
    htp.p('</table>');


Util_Pkg.print_footer;

END show_mid;

这是一个程序,我在代码中添加了函数getResvType(它在我添加它之前工作)但现在我得到错误:

    [Error] PLS-00103 (639: 9): PLS-00103: Encountered the symbol " function getResvType() { " when expecting one of the following:

       . ( * % & = - + ; < / > at in is mod remainder not rem
       <an exponent (**)> <> or != or ~= >= <

[Error] PLS-00103 (647: 20): PLS-00103: Encountered the symbol ";" when expecting one of the following:

   . ( ) , * % & = - + < / > at in is mod remainder not rem =>
   <an exponent (**)> <> or != or ~= >= <= <> and or like lik

关于出错的任何建议。我知道getProperty和getResvType看起来一样,但这应该不是问题。

1 个答案:

答案 0 :(得分:1)

-- FP12430
       ' function getProperty() { '||CHR(10)||
        '  var frm = document.form1; '||CHR(10)||
        '  var codes = frm.pvProperty.value; '||CHR(10)||
        ' if (codes == "ALL") { codes = ""; } '||CHR(10)||
        ' var params = "?pvSwapName=PROPERTY";'||CHR(10)||
        ' params += "&pvformFieldName=form1.pvProperty";'||CHR(10)||
        ' params +="&pvCodes="+codes;' ||CHR(10)||
        '  sSearch = window.open("swaplist_util_pkg.swap_this"+params,"swap","menubar=no,height=400,width=700");'||CHR(10)||
       '}'||CHR(10)

应该有一个||之后

-- FP12430
       ' function getProperty() { '||CHR(10)||
        '  var frm = document.form1; '||CHR(10)||
        '  var codes = frm.pvProperty.value; '||CHR(10)||
        ' if (codes == "ALL") { codes = ""; } '||CHR(10)||
        ' var params = "?pvSwapName=PROPERTY";'||CHR(10)||
        ' params += "&pvformFieldName=form1.pvProperty";'||CHR(10)||
        ' params +="&pvCodes="+codes;' ||CHR(10)||
        '  sSearch = window.open("swaplist_util_pkg.swap_this"+params,"swap","menubar=no,height=400,width=700");'||CHR(10)||
       '}'||CHR(10)||