3 "name": "Pman.Dialog.XtupleCreditMemo",
6 "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Dialog.XtupleCreditMemo.bjs",
10 "|show": "function () {\n this.layout.getRegion('center').showPanel(0);\n}"
12 ".builderCfg": "{\"cols\":[{\"table\":\"cohead\",\"column\":\"cohead_number\",\"columnshort\":\"cohead_number\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Order#\"},{\"table\":\"cohead\",\"column\":\"cohead_cust_id\",\"columnshort\":\"cohead_cust_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"cust_id\",\"deps\":[{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_active\",\"columnshort\":\"cust_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_custtype_id\",\"columnshort\":\"cust_custtype_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_salesrep_id\",\"columnshort\":\"cust_salesrep_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_commprcnt\",\"columnshort\":\"cust_commprcnt\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_name\",\"columnshort\":\"cust_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_creditlmt\",\"columnshort\":\"cust_creditlmt\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_creditrating\",\"columnshort\":\"cust_creditrating\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_financecharge\",\"columnshort\":\"cust_financecharge\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_backorder\",\"columnshort\":\"cust_backorder\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_partialship\",\"columnshort\":\"cust_partialship\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_terms_id\",\"columnshort\":\"cust_terms_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_discntprcnt\",\"columnshort\":\"cust_discntprcnt\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_balmethod\",\"columnshort\":\"cust_balmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_ffshipto\",\"columnshort\":\"cust_ffshipto\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_shipform_id\",\"columnshort\":\"cust_shipform_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_shipvia\",\"columnshort\":\"cust_shipvia\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_blanketpos\",\"columnshort\":\"cust_blanketpos\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_shipchrg_id\",\"columnshort\":\"cust_shipchrg_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_creditstatus\",\"columnshort\":\"cust_creditstatus\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_comments\",\"columnshort\":\"cust_comments\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_ffbillto\",\"columnshort\":\"cust_ffbillto\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_usespos\",\"columnshort\":\"cust_usespos\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_number\",\"columnshort\":\"cust_number\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_dateadded\",\"columnshort\":\"cust_dateadded\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_exported\",\"columnshort\":\"cust_exported\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_emaildelivery\",\"columnshort\":\"cust_emaildelivery\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_ediemail\",\"columnshort\":\"cust_ediemail\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_edisubject\",\"columnshort\":\"cust_edisubject\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_edifilename\",\"columnshort\":\"cust_edifilename\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_ediemailbody\",\"columnshort\":\"cust_ediemailbody\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_autoupdatestatus\",\"columnshort\":\"cust_autoupdatestatus\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_autoholdorders\",\"columnshort\":\"cust_autoholdorders\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_edicc\",\"columnshort\":\"cust_edicc\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_ediprofile_id\",\"columnshort\":\"cust_ediprofile_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_preferred_warehous_id\",\"columnshort\":\"cust_preferred_warehous_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_curr_id\",\"columnshort\":\"cust_curr_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_creditlmt_curr_id\",\"columnshort\":\"cust_creditlmt_curr_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_cntct_id\",\"columnshort\":\"cust_cntct_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_corrcntct_id\",\"columnshort\":\"cust_corrcntct_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_soemaildelivery\",\"columnshort\":\"cust_soemaildelivery\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_soediemail\",\"columnshort\":\"cust_soediemail\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_soedisubject\",\"columnshort\":\"cust_soedisubject\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_soedifilename\",\"columnshort\":\"cust_soedifilename\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_soediemailbody\",\"columnshort\":\"cust_soediemailbody\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_soedicc\",\"columnshort\":\"cust_soedicc\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_soediprofile_id\",\"columnshort\":\"cust_soediprofile_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_gracedays\",\"columnshort\":\"cust_gracedays\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_ediemailhtml\",\"columnshort\":\"cust_ediemailhtml\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_soediemailhtml\",\"columnshort\":\"cust_soediemailhtml\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"custinfo\",\"column\":\"cohead_cust_id_cust_taxzone_id\",\"columnshort\":\"cust_taxzone_id\",\"ctype\":\"int4\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Customer\",\"display\":\"cohead_cust_id_cust_name\"},{\"table\":\"cohead\",\"column\":\"cohead_custponumber\",\"columnshort\":\"cohead_custponumber\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Customer PO#\"},{\"table\":\"cohead\",\"column\":\"cohead_orderdate\",\"columnshort\":\"cohead_orderdate\",\"ctype\":\"date\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ordered\"},{\"table\":\"cohead\",\"column\":\"cohead_warehous_id\",\"columnshort\":\"cohead_warehous_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"warehous_id\",\"deps\":[{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_code\",\"columnshort\":\"warehous_code\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_descrip\",\"columnshort\":\"warehous_descrip\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_fob\",\"columnshort\":\"warehous_fob\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_active\",\"columnshort\":\"warehous_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_counttag_prefix\",\"columnshort\":\"warehous_counttag_prefix\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_counttag_number\",\"columnshort\":\"warehous_counttag_number\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_bol_prefix\",\"columnshort\":\"warehous_bol_prefix\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_bol_number\",\"columnshort\":\"warehous_bol_number\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_shipping\",\"columnshort\":\"warehous_shipping\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_useslips\",\"columnshort\":\"warehous_useslips\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_usezones\",\"columnshort\":\"warehous_usezones\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_aislesize\",\"columnshort\":\"warehous_aislesize\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_aislealpha\",\"columnshort\":\"warehous_aislealpha\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_racksize\",\"columnshort\":\"warehous_racksize\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_rackalpha\",\"columnshort\":\"warehous_rackalpha\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_binsize\",\"columnshort\":\"warehous_binsize\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_binalpha\",\"columnshort\":\"warehous_binalpha\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_locationsize\",\"columnshort\":\"warehous_locationsize\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_locationalpha\",\"columnshort\":\"warehous_locationalpha\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_enforcearbl\",\"columnshort\":\"warehous_enforcearbl\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_default_accnt_id\",\"columnshort\":\"warehous_default_accnt_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_shipping_commission\",\"columnshort\":\"warehous_shipping_commission\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_cntct_id\",\"columnshort\":\"warehous_cntct_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_addr_id\",\"columnshort\":\"warehous_addr_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_transit\",\"columnshort\":\"warehous_transit\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_shipform_id\",\"columnshort\":\"warehous_shipform_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_shipvia_id\",\"columnshort\":\"warehous_shipvia_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_shipcomments\",\"columnshort\":\"warehous_shipcomments\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_costcat_id\",\"columnshort\":\"warehous_costcat_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_sitetype_id\",\"columnshort\":\"warehous_sitetype_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_taxzone_id\",\"columnshort\":\"warehous_taxzone_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"whsinfo\",\"column\":\"cohead_warehous_id_warehous_sequence\",\"columnshort\":\"warehous_sequence\",\"ctype\":\"int4\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Warehouse\",\"display\":\"cohead_warehous_id_warehous_descrip\"},{\"table\":\"cohead\",\"column\":\"cohead_shipto_id\",\"columnshort\":\"cohead_shipto_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"shipto_id\",\"deps\":[{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_cust_id\",\"columnshort\":\"shipto_cust_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_name\",\"columnshort\":\"shipto_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_salesrep_id\",\"columnshort\":\"shipto_salesrep_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_comments\",\"columnshort\":\"shipto_comments\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_shipcomments\",\"columnshort\":\"shipto_shipcomments\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_shipzone_id\",\"columnshort\":\"shipto_shipzone_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_shipvia\",\"columnshort\":\"shipto_shipvia\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_commission\",\"columnshort\":\"shipto_commission\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_shipform_id\",\"columnshort\":\"shipto_shipform_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_shipchrg_id\",\"columnshort\":\"shipto_shipchrg_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_active\",\"columnshort\":\"shipto_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_default\",\"columnshort\":\"shipto_default\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_num\",\"columnshort\":\"shipto_num\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_ediprofile_id\",\"columnshort\":\"shipto_ediprofile_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_cntct_id\",\"columnshort\":\"shipto_cntct_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_addr_id\",\"columnshort\":\"shipto_addr_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"shiptoinfo\",\"column\":\"cohead_shipto_id_shipto_taxzone_id\",\"columnshort\":\"shipto_taxzone_id\",\"ctype\":\"int4\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to\",\"display\":\"cohead_shipto_id_shipto_name\"},{\"table\":\"cohead\",\"column\":\"cohead_shiptoname\",\"columnshort\":\"cohead_shiptoname\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to name\"},{\"table\":\"cohead\",\"column\":\"cohead_shiptoaddress1\",\"columnshort\":\"cohead_shiptoaddress1\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to address\"},{\"table\":\"cohead\",\"column\":\"cohead_shiptoaddress2\",\"columnshort\":\"cohead_shiptoaddress2\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to address(2)\"},{\"table\":\"cohead\",\"column\":\"cohead_shiptoaddress3\",\"columnshort\":\"cohead_shiptoaddress3\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to address(3)\"},{\"table\":\"cohead\",\"column\":\"cohead_shiptoaddress4\",\"columnshort\":\"cohead_shiptoaddress4\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to address(4)\"},{\"table\":\"cohead\",\"column\":\"cohead_shiptoaddress5\",\"columnshort\":\"cohead_shiptoaddress5\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to address(5)\"},{\"table\":\"cohead\",\"column\":\"cohead_salesrep_id\",\"columnshort\":\"cohead_salesrep_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"salesrep_id\",\"deps\":[{\"table\":\"salesrep\",\"column\":\"cohead_salesrep_id_salesrep_active\",\"columnshort\":\"salesrep_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cohead_salesrep_id_salesrep_number\",\"columnshort\":\"salesrep_number\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cohead_salesrep_id_salesrep_name\",\"columnshort\":\"salesrep_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cohead_salesrep_id_salesrep_commission\",\"columnshort\":\"salesrep_commission\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cohead_salesrep_id_salesrep_method\",\"columnshort\":\"salesrep_method\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"salesrep\",\"column\":\"cohead_salesrep_id_salesrep_emp_id\",\"columnshort\":\"salesrep_emp_id\",\"ctype\":\"int4\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Staff I.C.\",\"display\":\"cohead_salesrep_id_salesrep_name\"},{\"table\":\"cohead\",\"column\":\"cohead_terms_id\",\"columnshort\":\"cohead_terms_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"terms_id\",\"deps\":[{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_code\",\"columnshort\":\"terms_code\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_descrip\",\"columnshort\":\"terms_descrip\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_type\",\"columnshort\":\"terms_type\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_duedays\",\"columnshort\":\"terms_duedays\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_discdays\",\"columnshort\":\"terms_discdays\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_discprcnt\",\"columnshort\":\"terms_discprcnt\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_cutoffday\",\"columnshort\":\"terms_cutoffday\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_ap\",\"columnshort\":\"terms_ap\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"terms\",\"column\":\"cohead_terms_id_terms_ar\",\"columnshort\":\"terms_ar\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Terms\",\"display\":\"cohead_terms_id_terms_descrip\"},{\"table\":\"cohead\",\"column\":\"cohead_ordercomments\",\"columnshort\":\"cohead_ordercomments\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Order Comments\"},{\"table\":\"cohead\",\"column\":\"cohead_shipcomments\",\"columnshort\":\"cohead_shipcomments\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Shipment Comments\"},{\"table\":\"cohead\",\"column\":\"cohead_curr_id\",\"columnshort\":\"cohead_curr_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"curr_id\",\"deps\":[{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_base\",\"columnshort\":\"curr_base\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_name\",\"columnshort\":\"curr_name\",\"ctype\":\"varchar\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_symbol\",\"columnshort\":\"curr_symbol\",\"ctype\":\"varchar\",\"desc\":\"\"},{\"table\":\"curr_symbol\",\"column\":\"cohead_curr_id_curr_abbr\",\"columnshort\":\"curr_abbr\",\"ctype\":\"varchar\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Currency\",\"display\":\"cohead_curr_id_curr_symbol\"},{\"table\":\"cohead\",\"column\":\"cohead_shipto_cntct_id\",\"columnshort\":\"cohead_shipto_cntct_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"cntct_id\",\"deps\":[{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_crmacct_id\",\"columnshort\":\"cntct_crmacct_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_addr_id\",\"columnshort\":\"cntct_addr_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_first_name\",\"columnshort\":\"cntct_first_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_last_name\",\"columnshort\":\"cntct_last_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_honorific\",\"columnshort\":\"cntct_honorific\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_initials\",\"columnshort\":\"cntct_initials\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_active\",\"columnshort\":\"cntct_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_phone\",\"columnshort\":\"cntct_phone\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_phone2\",\"columnshort\":\"cntct_phone2\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_fax\",\"columnshort\":\"cntct_fax\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_email\",\"columnshort\":\"cntct_email\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_webaddr\",\"columnshort\":\"cntct_webaddr\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_notes\",\"columnshort\":\"cntct_notes\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_title\",\"columnshort\":\"cntct_title\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_number\",\"columnshort\":\"cntct_number\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_middle\",\"columnshort\":\"cntct_middle\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_suffix\",\"columnshort\":\"cntct_suffix\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_owner_username\",\"columnshort\":\"cntct_owner_username\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_shipto_cntct_id_cntct_name\",\"columnshort\":\"cntct_name\",\"ctype\":\"text\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Ship to Contact\",\"display\":\"cohead_shipto_cntct_id_cntct_name\"},{\"table\":\"cohead\",\"column\":\"cohead_billto_cntct_id\",\"columnshort\":\"cohead_billto_cntct_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"cntct_id\",\"deps\":[{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_crmacct_id\",\"columnshort\":\"cntct_crmacct_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_addr_id\",\"columnshort\":\"cntct_addr_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_first_name\",\"columnshort\":\"cntct_first_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_last_name\",\"columnshort\":\"cntct_last_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_honorific\",\"columnshort\":\"cntct_honorific\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_initials\",\"columnshort\":\"cntct_initials\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_active\",\"columnshort\":\"cntct_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_phone\",\"columnshort\":\"cntct_phone\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_phone2\",\"columnshort\":\"cntct_phone2\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_fax\",\"columnshort\":\"cntct_fax\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_email\",\"columnshort\":\"cntct_email\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_webaddr\",\"columnshort\":\"cntct_webaddr\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_notes\",\"columnshort\":\"cntct_notes\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_title\",\"columnshort\":\"cntct_title\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_number\",\"columnshort\":\"cntct_number\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_middle\",\"columnshort\":\"cntct_middle\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_suffix\",\"columnshort\":\"cntct_suffix\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_owner_username\",\"columnshort\":\"cntct_owner_username\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"cntct\",\"column\":\"cohead_billto_cntct_id_cntct_name\",\"columnshort\":\"cntct_name\",\"ctype\":\"text\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Bill To (name)\",\"display\":\"cohead_billto_cntct_id_cntct_name\"},{\"table\":\"cohead\",\"column\":\"cohead_taxzone_id\",\"columnshort\":\"cohead_taxzone_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"taxzone_id\",\"deps\":[{\"table\":\"taxzone\",\"column\":\"cohead_taxzone_id_taxzone_code\",\"columnshort\":\"taxzone_code\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"taxzone\",\"column\":\"cohead_taxzone_id_taxzone_descrip\",\"columnshort\":\"taxzone_descrip\",\"ctype\":\"text\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Tax Zone\",\"display\":\"cohead_taxzone_id_taxzone_descrip\"},{\"table\":\"cohead\",\"column\":\"cohead_taxtype_id\",\"columnshort\":\"cohead_taxtype_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"taxtype_id\",\"deps\":[{\"table\":\"taxtype\",\"column\":\"cohead_taxtype_id_taxtype_name\",\"columnshort\":\"taxtype_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"taxtype\",\"column\":\"cohead_taxtype_id_taxtype_descrip\",\"columnshort\":\"taxtype_descrip\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"taxtype\",\"column\":\"cohead_taxtype_id_taxtype_sys\",\"columnshort\":\"taxtype_sys\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Tax Type\",\"display\":\"cohead_taxtype_id_taxtype_descrip\"}],\"cols_ex\":[\"cohead_cust_id_cust_name\",\"cohead_warehous_id_warehous_descrip\",\"cohead_shipto_id_shipto_name\",\"cohead_salesrep_id_salesrep_name\",\"cohead_terms_id_terms_descrip\",\"cohead_curr_id_curr_symbol\",\"cohead_shipto_cntct_id_cntct_name\",\"cohead_billto_cntct_id_cntct_name\",\"cohead_taxzone_id_taxzone_descrip\",\"cohead_taxtype_id_taxtype_descrip\"],\"table\":\"cohead\",\"xtype\":\"LayoutDialog\",\"|xns\":\"Roo\"}",
18 "title": "Edit / Create Credit Memo",
20 "xtype": "LayoutDialog",
25 "xtype": "LayoutRegion",
27 "alwaysShowTabs": true,
32 "activate": "function (_self)\n{\n // we need to reload to find out the subtotal.\n if (!_this.data || !_this.data.cmhead_id) {\n return;\n }\n \n new Pman.Request({\n method : 'GET',\n url : baseURL + '/Roo/cmhead',\n params : { \n _id : _this.data.cmhead_id\n },\n success : function(res) {\n // update the items and tax values...?\n\n _this.form.findField('cmhead_taxfree_value').setValue(res.data.cmhead_taxfree_value);\n _this.form.findField('cmhead_tax_value').setValue(res.data.cmhead_tax_value * 1); \n _this.form.findField('cmhead_taxable_value').setValue(res.data.cmhead_taxable_value * 1); \n _this.form.findField('cmhead_misc_per').update();\n _this.form.findField('cmhead_total').recalc();\n \n }\n });\n}"
35 "title": "Credit Details",
36 "xtype": "ContentPanel",
41 "|actioncomplete": "function(_self,action)\n{\n if (action.type == 'setdata') {\n _this.saveBtn.show();\n \n if (_this.data.cmhead_id) {\n this.load({ method: 'GET', params: { '_id' : _this.data.cmhead_id }});\n \n return;\n }\n _this.dialog.setTitle(\"Add New Credit Memo\");\n \n _this.form.findField('cmhead_docdate').setValue(new Date());\n \n return;\n }\n if (action.type == 'load') {\n \n _this.data = action.result.data;\n \n if(_this.data.cmhead_posted){\n _this.saveBtn.hide();\n }\n _this.dataloading = true;\n if (_this.data.cmhead_shipto_cntct_id == _this.data.cmhead_billto_cntct_id) {\n this.findField('_shipto_same').setValue(1);\n Roo.log('set shipto 1');\n } else {\n// this.findField('_shipto_same').setValue(0);\n Roo.log('set shipto 0');\n }\n _this.dataloading = false; \n \n \n this.findField('billto_address').update();\n// this.findField('shipto_address').update(); \n _this.dialog.setTitle(\"Edit Credit Memo Order - \" + this.findField('cmhead_number').getValue());\n \n _this.form.findField('cmhead_misc_per').update();\n _this.form.findField('cmhead_total').recalc();\n return;\n }\n if (action.type =='submit') {\n \n\n var id = _this.form.findField('cmhead_id').getValue() * 1;\n if (id < 1) {\n\n _this.data.cmhead_id = action.result.data.cmhead_id;\n this.load({ method: 'GET', params: { '_id' : _this.data.cmhead_id }});\n return;\n }\n \n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset();\n return;\n }\n}\n",
42 "|rendered": "function (form)\n{\n _this.form= form;\n}\n",
43 "actionfailed": "function (_self, action)\n{\n if (action.failureType == 'client') {\n Roo.MessageBox.alert(\"Error\", \"Fill in all the required fields\");\n }\n if (action.failureType == 'server') { \n Roo.log(action);\n Roo.MessageBox.alert(\"Error\", action.result.errorMsg);\n }\n _this.dialog.layout.getRegion('center').showPanel(0);\n}"
46 "style": "margin:10px;",
48 "|url": "baseURL + '/Roo/cmhead.php'",
59 "style": "width:420px",
71 "emptyText": "Automatic",
72 "fieldLabel": "Ref #",
73 "name": "cmhead_number",
81 "fieldLabel": "Customer",
82 "name": "cmhead_cust_id_cust_name",
90 "displayField": "location_name",
92 "emptyText": "select location",
93 "fieldLabel": "Return stock to",
94 "forceSelection": true,
95 "hiddenName": "cmhead_location_id",
97 "loadingText": "Searching...",
99 "name": "cmhead_location_id_location_name",
101 "qtip": "Select terms",
102 "queryParam": "query[location_name]",
103 "selectOnFocus": true,
104 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{location_name}</b> {location_descrip}</div>",
105 "triggerAction": "all",
107 "valueField": "location_id",
114 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.location_netable = 1;\n o.params._notinternalcompany = 1;\n o.params.location_restrict = 0;\n}\n"
119 "|sortInfo": "{ direction : 'ASC', field: 'location_name' }",
125 "xtype": "HttpProxy",
126 "|url": "baseURL + '/Roo/location.php'",
133 "totalProperty": "total",
134 "xtype": "JsonReader",
135 "|fields": "[{'name':'location_id','type':'int'},'location_name']",
144 "fieldLabel": "Date",
146 "name": "cmhead_docdate",
148 "xtype": "DateField",
152 "displayField": "salesrep_name",
154 "emptyText": "Select salesrep",
155 "fieldLabel": "Staff I.C.",
156 "forceSelection": true,
157 "hiddenName": "cmhead_salesrep_id",
159 "loadingText": "Searching...",
161 "name": "cmhead_salesrep_id_salesrep_name",
163 "qtip": "Select salesrep",
164 "queryParam": "query[salesrep_name]",
165 "selectOnFocus": true,
166 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{salesrep_name}</b> </div>",
167 "triggerAction": "all",
169 "valueField": "salesrep_id",
176 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n"
181 "|sortInfo": "{ direction : 'ASC', field: 'salesrep_name' }",
186 "xtype": "HttpProxy",
189 "|url": "baseURL + '/Roo/salesrep.php'"
195 "totalProperty": "total",
196 "xtype": "JsonReader",
197 "|fields": "[{'name':'salesrep_id','type':'int'},'salesrep_name']",
205 "fieldLabel": "Comments",
207 "name": "cmhead_comments",
219 "style": "margin-left:10px",
227 "legend": "Price Details",
228 "style": "width:420px",
232 "labelAlign": "right",
239 "labelAlign": "right",
246 "allowDecimals": true,
247 "cls": "roo-align-right",
248 "decimalPrecision": 3,
249 "fieldLabel": "Taxable Value",
250 "name": "cmhead_taxable_value",
253 "xtype": "NumberField",
257 "allowDecimals": true,
258 "cls": "roo-align-right",
259 "decimalPrecision": 3,
260 "fieldLabel": "Tax Free Value",
261 "name": "cmhead_taxfree_value",
264 "xtype": "NumberField",
271 "labelSeparator": " ",
278 "displayField": "curr_name",
280 "emptyText": "Select Currency",
281 "fieldLabel": "Currency",
282 "forceSelection": true,
283 "hiddenName": "cmhead_curr_id",
285 "loadingText": "Searching...",
287 "name": "cmhead_curr_id_curr_name",
289 "qtip": "Select Currency",
290 "queryParam": "query[curr_name]",
291 "selectOnFocus": true,
292 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{curr_name}</b> </div>",
293 "triggerAction": "all",
295 "valueField": "curr_id",
302 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n}\n"
307 "|sortInfo": "{ direction : 'ASC', field: 'curr_symbol' }",
312 "xtype": "HttpProxy",
315 "|url": "baseURL + '/Roo/curr_symbol.php'"
321 "totalProperty": "total",
322 "xtype": "JsonReader",
323 "|fields": "[{'name':'curr_id','type':'int'},'curr_symbol']",
332 "keyup": "function (_self, e)\n{\n _this.form.findField('cmhead_total').recalc();\n}"
334 "allowDecimals": true,
335 "cls": "roo-align-right",
336 "decimalPrecision": 3,
337 "fieldLabel": "Freight",
338 "name": "cmhead_freight",
340 "xtype": "NumberField",
347 "labelSeparator": " ",
353 "fieldLabel": "Discount Description",
354 "name": "cmhead_misc_descrip",
356 "xtype": "TextField",
361 "keyup": "function (_self, e)\n{\n var m = _this.form.findField('cmhead_misc');\n var pv = _this.form.findField('cmhead_value').getValue();\n var n = this.getValue();\n var discount = parseInt(n * pv * 0.01);\n m.setValue(discount * -1.000);\n \n \n _this.form.findField('cmhead_total').recalc();\n var val = discount * -1.0;\n if (val > 0) {\n _this.form.findField('cohead_misc_descrip').setValue(\"Discount of \" + val.toFixed(1)+'%');\n }\n}"
363 "allowDecimals": true,
364 "cls": "roo-align-right",
365 "decimalPrecision": 1,
367 "name": "cmhead_misc_per",
369 "xtype": "NumberField",
370 "|update": "function() {\n var m = _this.form.findField('cmhead_misc_per');\n var pv = parseFloat(_this.form.findField('cmhead_taxfree_value').getValue()) + \n parseFloat(_this.form.findField('cmhead_taxable_value').getValue()) ;\n var discount = parseFloat(_this.form.findField('cmhead_misc').getValue());\n \n if (discount > 0.0) {\n this.setValue(0); \n return;\n }\n if (pv < 0) {\n this.setValue(0); \n return;\n }\n var val = ((discount) / pv) * -100;\n \n //Roo.log(\"update discount?\" + val);\n this.setValue(val.toFixed(1));\n \n if (val > 0.0) {\n _this.form.findField('cmhead_misc_descrip').setValue(\"Discount of \" + val.toFixed(1)+'%');\n \n }\n \n \n}\n",
375 "keyup": "function (_self, e)\n{\n _this.form.findField('cmhead_misc_per').update();\n _this.form.findField('cmhead_total').recalc();\n}"
377 "allowDecimals": true,
378 "cls": "roo-align-right",
379 "decimalPrecision": 3,
380 "fieldLabel": " ",
381 "name": "cmhead_misc",
383 "xtype": "NumberField",
390 "labelSeparator": " ",
397 "select": "function (combo, record, index)\n{\n _this.form.findField('cmhead_tax_value').setValue(\n record.data.taxzone_rate * _this.form.findField('cmhead_taxable_value').getValue()\n );\n}"
400 "displayField": "taxzone_descrip",
402 "emptyText": "Select tax zone",
403 "fieldLabel": "Tax Zone",
404 "forceSelection": true,
405 "hiddenName": "cmhead_taxzone_id",
407 "loadingText": "Searching...",
409 "name": "cmhead_taxzone_id_taxzone_descrip",
411 "qtip": "Select tax zone",
412 "queryParam": "query[taxzone_descrip]",
413 "selectOnFocus": true,
414 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{taxzone_descrip}</b> </div>",
415 "triggerAction": "all",
417 "valueField": "taxzone_id",
424 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n o.params.with_date = _this.form.findField('cmhead_docdate').getValue().format('Y-m-d');\n Roo.log(\"with date?\" + o.params.with_date);\n \n \n}\n"
429 "|sortInfo": "{ direction : 'ASC', field: 'taxzone_descrip' }",
435 "xtype": "HttpProxy",
436 "|url": "baseURL + '/Roo/taxzone.php'",
443 "totalProperty": "total",
444 "xtype": "JsonReader",
445 "|fields": "[{'name':'taxzone_id','type':'int'},'taxzone_descrip']",
453 "allowDecimals": true,
454 "cls": "roo-align-right",
455 "decimalPrecision": 3,
457 "name": "cmhead_tax_value",
460 "xtype": "NumberField",
466 "labelAlign": "right",
473 "allowDecimals": true,
474 "cls": "roo-align-right",
475 "decimalPrecision": 3,
476 "fieldLabel": "Total",
477 "name": "cmhead_total",
480 "xtype": "NumberField",
481 "|recalc": "function() {\n var vals = _this.form.getValues();\n this.setValue(\n (1*vals.cmhead_taxable_value) + \n (1*vals.cmhead_taxfree_value) + \n (1*vals.cmhead_freight) + \n (1*vals.cmhead_tax_value) + \n (1*vals.cmhead_misc)\n );\n}\n",
492 "style": "width:420px",
504 "beforeselect": "function (combo, record, index)\n{\n // set _this.data values ..\n \n // just add everything...\n for(var i in record.data) {\n // Roo.log('cmhead_billto_cntct_id_' + i +' =' + record.data[i]);\n _this.data['cmhead_billto_cntct_id_' + i] = record.data[i];\n }\n\n _this.form.findField('billto_address').update();\n \n \n}",
505 "add": "function (combo)\n{\n \n Pman.Dialog.XtupleQuickContact.show( \n {\n _id : id,\n customer_id : _this.form.findField('cmhead_cust_id').getValue()\n },\n \n function (data) {\n \n for(var i in data) {\n \n _this.data['cmhead_billto_cntct_id_' + i] = data[i];\n }\n \n _this.form.findField('billto_address').update();\n // fill in the select box..\n _this.form.setValues( {\n cmhead_billto_cntct_id : data.cntct_id,\n cmhead_billto_cntct_id_cntct_name : data.cntct_first_name + ' '+ \n data.cntct_last_name\n \n });\n }\n );\n // Pman.Dialog.XtupleCustomer.show(\n //{ cust_id : _this.form.findField('cohead_cust_id').getValue() }, \n //function(data) {\n // refresh the data in the pulldown..\n // }); \n\n}"
509 "displayField": "cntct_name",
511 "emptyText": "Select Contact",
512 "fieldLabel": "Bill To (select)",
513 "forceSelection": true,
514 "hiddenName": "cmhead_billto_cntct_id",
516 "loadingText": "Searching...",
518 "name": "cmhead_billto_cntct_id_cntct_name",
520 "qtip": "Select Contact",
521 "queryParam": "query[cntct_name]",
522 "selectOnFocus": true,
523 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{cntct_name}</b> {cntct_addr_id_addr_line1}</div>",
524 "triggerAction": "all",
526 "valueField": "cntct_id",
533 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params._customer_id = _this.data.cmhead_cust_id;\n}\n"
538 "|sortInfo": "{ direction : 'ASC', field: 'cntct_name' }",
543 "xtype": "HttpProxy",
546 "|url": "baseURL + '/Roo/cntct.php'"
552 "totalProperty": "total",
553 "xtype": "JsonReader",
554 "|fields": "[{'name':'cntct_id','type':'int'},'cntct_name']",
563 "render": "function (_self)\n{\n Roo.log(this.el)\n \n \n \n this.el.on('click', function() { \n var id = _this.form.findField('cmhead_billto_cntct_id').getValue();\n Pman.Dialog.XtupleQuickContact.show( \n {\n _id : id,\n customer_id : _this.form.findField('cmhead_cust_id').getValue()\n },\n \n function (data) {\n \n for(var i in data) {\n \n _this.data['cmhead_billto_cntct_id_' + i] = data[i];\n }\n \n _this.form.findField('billto_address').update();\n // fill in the select box..\n _this.form.setValues( {\n cmhead_billto_cntct_id : data.cntct_id,\n cmhead_billto_cntct_id_cntct_name : data.cntct_first_name + ' '+ \n data.cntct_last_name\n });\n }\n );\n });\n}"
565 "fieldLabel": "or enter Address",
566 "name": "billto_address",
569 "|update": "function() {\n\n var c = ['first_name', 'last_name' ] ;\n var a = [ 'line1', 'line2', 'line3', 'city', 'state', 'country' ];\n var v = [];\n Roo.each(c, function(e) {\n if (_this.data['cmhead_billto_cntct_id_cntct_' +e] &&\n _this.data['cmhead_billto_cntct_id_cntct_' +e].length) {\n v.push(_this.data['cmhead_billto_cntct_id_cntct_' +e]);\n }\n });\n Roo.each(a, function(e) {\n if (_this.data['cmhead_billto_cntct_id_cntct_addr_id_addr_' +e] &&\n _this.data['cmhead_billto_cntct_id_cntct_addr_id_addr_' +e].length) {\n v.push(_this.data['cmhead_billto_cntct_id_cntct_addr_id_addr_' +e]);\n }\n });\n this.setValue(v.join(\"\\n\"));\n}\n",
584 "name": "cmhead_billto_addr_id",
589 "name": "cmhead_posted",
594 "name": "cmhead_cust_id",
599 "name": "taxzone_rate",
614 "deactivate": "function (_self)\n{\n if(_this.grid){\n _this.grid.stopEditing();\n }\n}",
615 "activate": "function (_self)\n{\n\n _this.panel = this;\n \n try { if (MODULE.isBuilder) {\n return;\n } } catch(e) { }\n \n var id = _this.form.findField('cmhead_id').getValue() * 1;\n if (id < 1) {\n Roo.MessageBox.alert(\"Save First\", \"Save the order first, before adding items\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return;\n }\n if (_this.grid) {\n _this.grid.ds.load({});\n }\n\n}"
618 "fitContainer": true,
621 "tableName": "coitem",
622 "title": "Credit Items",
623 "xtype": "GridPanel",
628 "|render": "function() \n{\n _this.grid = this; \n _this.hasQuery = 0;\n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.ds.load({});\n }\n}",
629 "afteredit": "function (e)\n{\n //Roo.log('afteredit');\n //Roo.log(e);\n \n if (e.field == 'item_number' || e.originalValue == e.value) {\n // afterselect handles this...\n return;\n }\n var r = e.record;\n \n if ( r && r.data.cmitem_id) {\n // as we disable update to the display on the ajax callback to \n // allow editing flow to continue, and not refresh - we can only update\n // these values after something has actually been edited.\n r.set('coitem_id', r.data.cmitem_id);\n }\n \n var rate = 0;\n if(r.data.cmitem_taxtype_id_taxtype_name == 'Taxable' ){\n rate = _this.form.findField('taxzone_rate').getValue();\n }\n if(e.field == 'cmitem_tax_unitprice'){\n r.set('cmitem_unitprice', r.data.cmitem_tax_unitprice * 1 / (1 + rate * 1));\n// fields.push('cmitem_unitprice');\n }\n if(e.field == 'cmitem_unitprice'){\n r.set('cmitem_tax_unitprice', r.data.cmitem_unitprice * (1 + rate * 1) );\n// fields.push('cmitem_tax_unitprice');\n }\n if(e.field == 'cmitem_taxtype_id'){\n r.set('cmitem_tax_unitprice', r.data.cmitem_unitprice * (1 + rate * 1) );\n// fields.push('cmitem_tax_unitprice');\n \n }\n r.set('cmitem_tax_listprice', r.data.cmitem_item_listprice * (1 + rate * 1) );\n// fields.push('cmitem_tax_listprice');\n r.set('cmitem_line_value', r.data.cmitem_qtycredit * r.data.cmitem_unitprice );\n// fields.push('cmitem_line_value');\n r.set('cmitem_line_tax_value', r.data.cmitem_qtycredit * r.data.cmitem_tax_unitprice );\n// fields.push('cmitem_line_tax_value'); \n \n// fields.push('cmitem_id');\n \n _this.hasQuery += 1;\n \n var doupdate = function() { \n if (!_this.itemsUpdating) {\n Roo.log('doupdate...');\n \n _this.hasQuery -= 1;\n r.commit();\n return;\n }\n doupdate.defer(1000);\n }\n \n doupdate();\n \n \n}",
630 "beforeedit": "function (e)\n{\n // we can only edit if nothing is assigned to shipping or invoices..\n if (_this.form.findField('cmhead_posted').getValue() == 'true') {\n Roo.MessageBox.alert(\"Error\", \"credit memo is already posted\");\n e.cancel = true;\n return;\n }\n \n return;\n \n // seems below logic is useless...!!!!\n var rec = e.record;\n\n if (rec.data.coitem_qtyshipped > 0 || rec.data.cobill_billed > 0) {\n Roo.MessageBox.alert(\"Error\", \"That item has been shipped or invoices - void the shipments/invoices first\");\n e.cancel = true;\n return;\n }\n \n if (rec.data.coitem_subnumber * 1 > 0) {\n Roo.log(\"Edit container event\");\n Roo.log(e); // if it's a tab.. \n\n \n switch(e.field) {\n // allow editing of source / destination..\n case 'coitem_shipto_id':\n case 'coitem_location_src': \n return;\n default : \n break;\n }\n Roo.MessageBox.alert(\"Error\", \"That is a kit item, edit the container.\");\n e.cancel = true;\n return;\n }\n // zero off values..\n //if (e.field == 'coitem_qtyord' && rec.data.coitem_qtyord == 0) {\n // e.value ='';\n // }\n // if (e.field == 'coitem_custprice' && rec.data.coitem_qtyord == 0.0) {\n // e.value ='';\n // }\n \n if (rec.data.item_type == 'K' && e.field == 'item_number') {\n // you can not change the product type on kits' as it messing things up..\n Roo.MessageBox.alert(\"Error\", \"That is a kit item,if you need to change it, delete it first.\");\n e.cancel = true;\n return;\n }\n \n}",
631 "celldblclick": "function (_self, rowIndex, columnIndex, e)\n{\n var rec = this.ds.getAt(rowIndex);\n var di = this.cm.getDataIndex(columnIndex);\n if (di != 'avail_qty') {\n return;\n }\n Pman.Dialog.XtupleInvHistory.show({\n itemsite_item_id_item_number : rec.data.item_number,\n // itemsite_item_id_item_descript1 : rec.data.item_descrip1,\n location_name : rec.data.coitem_location_src_location_name,\n location_descrip : rec.data.coitem_location_src_location_descrip,\n \n invhist_transdate : _this.form.findField('cohead_targetdate').getValue() \n }); \n \n}",
632 "rowclass": "function (gridview, rowcfg)\n{\n if (rowcfg.record.data.coitem_status == 'C' &&\n rowcfg.record.data.shipitem_shipped * 1 < 1) {\n \n rowcfg.rowClass = 'strikethrough';\n }\n if (rowcfg.record.data.coitem_status == 'X' ) {\n \n rowcfg.rowClass = 'strikethrough';\n }\n // Roo.log(rowcfg);\n// shipitem_shipped\n}"
635 "autoExpandColumn": "cmitem_comments",
638 "xtype": "EditorGrid",
639 "|loadAvail": "function() {\n \n return; //not used.\n \n var q = [];\n this.ds.each( function(r) {\n \n // only update if we do not have the details.\n if (r.data.avail_qty == 0) {\n \n }\n q.push( { \n item : r.data.item_number, \n loc: r.data.coitem_location_src_location_name,\n id: r.data.coitem_linenumber + (r.data.coitem_subnumber ? ('.' + r.data.coitem_subnumber) : '')\n } );\n });\n \n // needs to be a post to allow long lists of products..\n \n new Pman.Request({\n url : baseURL + '/Roo/itemloc',\n method : 'POST',\n mask : \"Loading available qty\",\n maskel : _this.grid.view.el,\n params : {\n _availqty : Roo.encode(q),\n curr_id : _this.form.findField('cohead_curr_id').getValue()\n },\n success : function(d) \n {\n _this.grid.ds.each(function(r) { \n var id = r.data.coitem_linenumber + (r.data.coitem_subnumber ? ('.' + r.data.coitem_subnumber) : '');\n \n \n if (typeof(d.data[id]) == 'undefined') {\n return;\n }\n r.set('avail_qty', d.data[id].qty);\n if (r.data.coitem_unitcost_in_order_cur * 1.0 < 0.1) {\n r.set('coitem_unitcost_in_order_cur', d.data[id].unitcost);\n }\n \n });\n \n }\n });\n \n \n \n}\n",
644 "tabend": "function (_self)\n{\n _this.addItemBtn.fireEvent('click', _this.addItemBtn);\n}",
645 "beforeeditnext": "function (eventdata)\n{\n return;\n // this does not work, as the reload effect cancels editng.\n var rec = _this.grid.ds.getAt(eventdata.cell[0]);\n if (rec.data.coitem_subnumber *1 < 0 ) {\n return;\n }\n var r = eventdata.cell[0] + 1;\n\n while (true) {\n if (r > _this.grid.ds.getCount()-1 ) {\n eventdata.cell = false;\n return;\n }\n rec = _this.grid.ds.getAt(r);\n if (rec.data.coitem_subnumber *1 < 0 ) {\n eventdata.cell = [ r, eventdata.cell[1] ];\n return;\n }\n r++;\n }\n \n \n \n\n}"
648 "enter_is_tab": true,
649 "xtype": "CellSelectionModel",
654 "|beforeload": "function (_self,o) {\n\n try {\n this.removeAll();\n } catch (e) { }\n \n Roo.log(_this.data);\n if (!_this.data || !_this.data.cmhead_id) {\n return false;\n }\n o.params = o.params || {};\n Roo.log(_this.data);\n o.params.cmitem_cmhead_id = _this.data.cmhead_id;\n o.params.limit = 999;\n \n}",
655 "update": "function (_self, rec, operation)\n{\n \n if (operation != Roo.data.Record.COMMIT) {\n return;\n }\n \n // row has been updated..\n // if the qty + item has been filled in, we should try and save it..\n if (!(rec.data.cmitem_itemsite_id * 1) || !(rec.data.cmitem_qtycredit*1) || !(rec.data.cmitem_unitprice*1)) {\n Roo.log('not saving - row not completed');\n return;\n }\n\n if (_this.itemsUpdating) {\n Roo.log('currently updating?');\n return;\n }\n _this.itemsUpdating = true;\n\n\n Roo.log('Running update'); \n \n new Pman.Request({\n url : baseURL+'/Roo/Cmitem',\n method : 'POST',\n \n params : rec.data,\n success: function(res)\n {\n Roo.log('GOT success');\n // update the data...\n if (rec.data.item_type == 'K') {\n _this.itemsUpdating = false; \n _this.grid.ds.load({});\n return;\n }\n if (_this.grid.activeEditor) {\n rec.editing = true;\n } \n rec.set('cmitem_id', res.data.cmitem_id);\n \n _this.itemsUpdating = false; \n \n if(_this.hasQuery != 0){\n \n return;\n }\n \n rec.dirty = false;\n delete rec.modified;\n \n _this.grid.loadAvail();\n \n },\n failure : function(res)\n {\n Roo.MessageBox.alert(res.message);\n _this.itemsUpdating = false;\n }\n \n \n });\n \n \n \n \n \n}",
656 "load": "function (_self, records, options)\n{\n // need to fetch availablity from master data..\n // build a list of what to ask..\n Roo.log(records);\n // query: ITEM CODE - LOCATION\n \n //_this.grid.loadAvail.defer(100, _this.grid);\n var rate = 0;\n \n Roo.each(records, function(r){\n rate = 0;\n if(r.data.cmitem_taxtype_id == r.data.cmitem_taxable_id ){\n rate = _this.form.findField('taxzone_rate').getValue();\n }\n r.set('cmitem_tax_unitprice', r.data.cmitem_unitprice * (1 + rate * 1));\n r.set('cmitem_tax_listprice', r.data.cmitem_item_listprice * (1 + rate * 1));\n r.set('cmitem_line_tax_value', r.data.cmitem_line_value * (1 + rate * 1));\n }) \n \n}"
658 "*prop": "dataSource",
659 ".builderCfg": "{\"cols\":[{\"table\":\"coitem\",\"column\":\"coitem_linenumber\",\"columnshort\":\"coitem_linenumber\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Item#\"},{\"table\":\"coitem\",\"column\":\"coitem_itemsite_id\",\"columnshort\":\"coitem_itemsite_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"itemsite_id\",\"deps\":[{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_item_id\",\"columnshort\":\"itemsite_item_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_warehous_id\",\"columnshort\":\"itemsite_warehous_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_qtyonhand\",\"columnshort\":\"itemsite_qtyonhand\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_reorderlevel\",\"columnshort\":\"itemsite_reorderlevel\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordertoqty\",\"columnshort\":\"itemsite_ordertoqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_cyclecountfreq\",\"columnshort\":\"itemsite_cyclecountfreq\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_datelastcount\",\"columnshort\":\"itemsite_datelastcount\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_datelastused\",\"columnshort\":\"itemsite_datelastused\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_loccntrl\",\"columnshort\":\"itemsite_loccntrl\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_safetystock\",\"columnshort\":\"itemsite_safetystock\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_minordqty\",\"columnshort\":\"itemsite_minordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_multordqty\",\"columnshort\":\"itemsite_multordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_leadtime\",\"columnshort\":\"itemsite_leadtime\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_abcclass\",\"columnshort\":\"itemsite_abcclass\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_issuemethod\",\"columnshort\":\"itemsite_issuemethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_controlmethod\",\"columnshort\":\"itemsite_controlmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_active\",\"columnshort\":\"itemsite_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_plancode_id\",\"columnshort\":\"itemsite_plancode_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_costcat_id\",\"columnshort\":\"itemsite_costcat_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_eventfence\",\"columnshort\":\"itemsite_eventfence\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_sold\",\"columnshort\":\"itemsite_sold\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_stocked\",\"columnshort\":\"itemsite_stocked\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_freeze\",\"columnshort\":\"itemsite_freeze\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location_id\",\"columnshort\":\"itemsite_location_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_useparams\",\"columnshort\":\"itemsite_useparams\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_useparamsmanual\",\"columnshort\":\"itemsite_useparamsmanual\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_soldranking\",\"columnshort\":\"itemsite_soldranking\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createpr\",\"columnshort\":\"itemsite_createpr\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location\",\"columnshort\":\"itemsite_location\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location_comments\",\"columnshort\":\"itemsite_location_comments\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_notes\",\"columnshort\":\"itemsite_notes\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_perishable\",\"columnshort\":\"itemsite_perishable\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_nnqoh\",\"columnshort\":\"itemsite_nnqoh\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_autoabcclass\",\"columnshort\":\"itemsite_autoabcclass\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordergroup\",\"columnshort\":\"itemsite_ordergroup\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_disallowblankwip\",\"columnshort\":\"itemsite_disallowblankwip\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_maxordqty\",\"columnshort\":\"itemsite_maxordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_mps_timefence\",\"columnshort\":\"itemsite_mps_timefence\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createwo\",\"columnshort\":\"itemsite_createwo\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_warrpurc\",\"columnshort\":\"itemsite_warrpurc\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_autoreg\",\"columnshort\":\"itemsite_autoreg\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_costmethod\",\"columnshort\":\"itemsite_costmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_value\",\"columnshort\":\"itemsite_value\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordergroup_first\",\"columnshort\":\"itemsite_ordergroup_first\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_supply_itemsite_id\",\"columnshort\":\"itemsite_supply_itemsite_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_planning_type\",\"columnshort\":\"itemsite_planning_type\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_wosupply\",\"columnshort\":\"itemsite_wosupply\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_posupply\",\"columnshort\":\"itemsite_posupply\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_lsseq_id\",\"columnshort\":\"itemsite_lsseq_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_cosdefault\",\"columnshort\":\"itemsite_cosdefault\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createsopr\",\"columnshort\":\"itemsite_createsopr\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createsopo\",\"columnshort\":\"itemsite_createsopo\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_dropship\",\"columnshort\":\"itemsite_dropship\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyord\",\"columnshort\":\"coitem_qtyord\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Qty\"},{\"table\":\"coitem\",\"column\":\"coitem_unitcost\",\"columnshort\":\"coitem_unitcost\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Unit Cost\"},{\"table\":\"coitem\",\"column\":\"coitem_price\",\"columnshort\":\"coitem_price\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Price\"},{\"table\":\"coitem\",\"column\":\"coitem_custprice\",\"columnshort\":\"coitem_custprice\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust Price\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyreturned\",\"columnshort\":\"coitem_qtyreturned\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#Returned\"},{\"table\":\"coitem\",\"column\":\"coitem_prcost\",\"columnshort\":\"coitem_prcost\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"prcost?\"},{\"table\":\"coitem\",\"column\":\"coitem_price_uom_id\",\"columnshort\":\"coitem_price_uom_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"uom_id\",\"deps\":[{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_name\",\"columnshort\":\"uom_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_descrip\",\"columnshort\":\"uom_descrip\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_item_weight\",\"columnshort\":\"uom_item_weight\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Unit of\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyreserved\",\"columnshort\":\"coitem_qtyreserved\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#reserved\"}],\"cols_ex\":[\"coitem_price_uom_id_uom_descrip\"],\"table\":\"coitem\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
662 "|sortInfo": "{ field : 'cmitem_linenumber', direction: 'ASC' }",
668 "xtype": "HttpProxy",
669 "|url": "baseURL + '/Roo/Cmitem.php'",
674 "xtype": "JsonReader",
675 "totalProperty": "total",
677 ".builderCfg": "{\"cols\":[{\"table\":\"coitem\",\"column\":\"coitem_linenumber\",\"columnshort\":\"coitem_linenumber\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Item#\"},{\"table\":\"coitem\",\"column\":\"coitem_itemsite_id\",\"columnshort\":\"coitem_itemsite_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"itemsite_id\",\"deps\":[{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_item_id\",\"columnshort\":\"itemsite_item_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_warehous_id\",\"columnshort\":\"itemsite_warehous_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_qtyonhand\",\"columnshort\":\"itemsite_qtyonhand\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_reorderlevel\",\"columnshort\":\"itemsite_reorderlevel\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordertoqty\",\"columnshort\":\"itemsite_ordertoqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_cyclecountfreq\",\"columnshort\":\"itemsite_cyclecountfreq\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_datelastcount\",\"columnshort\":\"itemsite_datelastcount\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_datelastused\",\"columnshort\":\"itemsite_datelastused\",\"ctype\":\"date\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_loccntrl\",\"columnshort\":\"itemsite_loccntrl\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_safetystock\",\"columnshort\":\"itemsite_safetystock\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_minordqty\",\"columnshort\":\"itemsite_minordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_multordqty\",\"columnshort\":\"itemsite_multordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_leadtime\",\"columnshort\":\"itemsite_leadtime\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_abcclass\",\"columnshort\":\"itemsite_abcclass\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_issuemethod\",\"columnshort\":\"itemsite_issuemethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_controlmethod\",\"columnshort\":\"itemsite_controlmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_active\",\"columnshort\":\"itemsite_active\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_plancode_id\",\"columnshort\":\"itemsite_plancode_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_costcat_id\",\"columnshort\":\"itemsite_costcat_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_eventfence\",\"columnshort\":\"itemsite_eventfence\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_sold\",\"columnshort\":\"itemsite_sold\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_stocked\",\"columnshort\":\"itemsite_stocked\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_freeze\",\"columnshort\":\"itemsite_freeze\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location_id\",\"columnshort\":\"itemsite_location_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_useparams\",\"columnshort\":\"itemsite_useparams\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_useparamsmanual\",\"columnshort\":\"itemsite_useparamsmanual\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_soldranking\",\"columnshort\":\"itemsite_soldranking\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createpr\",\"columnshort\":\"itemsite_createpr\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location\",\"columnshort\":\"itemsite_location\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_location_comments\",\"columnshort\":\"itemsite_location_comments\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_notes\",\"columnshort\":\"itemsite_notes\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_perishable\",\"columnshort\":\"itemsite_perishable\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_nnqoh\",\"columnshort\":\"itemsite_nnqoh\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_autoabcclass\",\"columnshort\":\"itemsite_autoabcclass\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordergroup\",\"columnshort\":\"itemsite_ordergroup\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_disallowblankwip\",\"columnshort\":\"itemsite_disallowblankwip\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_maxordqty\",\"columnshort\":\"itemsite_maxordqty\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_mps_timefence\",\"columnshort\":\"itemsite_mps_timefence\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createwo\",\"columnshort\":\"itemsite_createwo\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_warrpurc\",\"columnshort\":\"itemsite_warrpurc\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_autoreg\",\"columnshort\":\"itemsite_autoreg\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_costmethod\",\"columnshort\":\"itemsite_costmethod\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_value\",\"columnshort\":\"itemsite_value\",\"ctype\":\"numeric\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_ordergroup_first\",\"columnshort\":\"itemsite_ordergroup_first\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_supply_itemsite_id\",\"columnshort\":\"itemsite_supply_itemsite_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_planning_type\",\"columnshort\":\"itemsite_planning_type\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_wosupply\",\"columnshort\":\"itemsite_wosupply\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_posupply\",\"columnshort\":\"itemsite_posupply\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_lsseq_id\",\"columnshort\":\"itemsite_lsseq_id\",\"ctype\":\"int4\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_cosdefault\",\"columnshort\":\"itemsite_cosdefault\",\"ctype\":\"bpchar\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createsopr\",\"columnshort\":\"itemsite_createsopr\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_createsopo\",\"columnshort\":\"itemsite_createsopo\",\"ctype\":\"bool\",\"desc\":\"\"},{\"table\":\"itemsite\",\"column\":\"coitem_itemsite_id_itemsite_dropship\",\"columnshort\":\"itemsite_dropship\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyord\",\"columnshort\":\"coitem_qtyord\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Qty\"},{\"table\":\"coitem\",\"column\":\"coitem_unitcost\",\"columnshort\":\"coitem_unitcost\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Unit Cost\"},{\"table\":\"coitem\",\"column\":\"coitem_price\",\"columnshort\":\"coitem_price\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Price\"},{\"table\":\"coitem\",\"column\":\"coitem_custprice\",\"columnshort\":\"coitem_custprice\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Cust Price\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyreturned\",\"columnshort\":\"coitem_qtyreturned\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#Returned\"},{\"table\":\"coitem\",\"column\":\"coitem_prcost\",\"columnshort\":\"coitem_prcost\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"prcost?\"},{\"table\":\"coitem\",\"column\":\"coitem_price_uom_id\",\"columnshort\":\"coitem_price_uom_id\",\"ctype\":\"int4\",\"desc\":\"\",\"maps_to\":\"uom_id\",\"deps\":[{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_name\",\"columnshort\":\"uom_name\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_descrip\",\"columnshort\":\"uom_descrip\",\"ctype\":\"text\",\"desc\":\"\"},{\"table\":\"uom\",\"column\":\"coitem_price_uom_id_uom_item_weight\",\"columnshort\":\"uom_item_weight\",\"ctype\":\"bool\",\"desc\":\"\"}],\"use\":1,\"use_ex\":\"\",\"title\":\"Unit of\"},{\"table\":\"coitem\",\"column\":\"coitem_qtyreserved\",\"columnshort\":\"coitem_qtyreserved\",\"ctype\":\"numeric\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"#reserved\"}],\"cols_ex\":[\"coitem_price_uom_id_uom_descrip\"],\"table\":\"coitem\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
680 "|fields": "[\n {\n 'name': 'coitem_linenumber',\n 'type': 'int'\n },\n {\n 'name': 'coitem_itemsite_id',\n 'type': 'int'\n },\n {\n 'name': 'coitem_qtyord'\n },\n {\n 'name': 'coitem_unitcost'\n },\n {\n 'name': 'coitem_price'\n },\n {\n 'name': 'coitem_custprice'\n },\n {\n 'name': 'coitem_qtyreturned'\n },\n {\n 'name': 'coitem_prcost'\n },\n {\n 'name': 'coitem_price_uom_id',\n 'type': 'int'\n },\n {\n 'name': 'coitem_qtyreserved'\n }\n]"
691 "|click": "function()\n{\n \n \n if (_this.form.findField('cmhead_posted').getValue() == 'true') {\n Roo.MessageBox.alert(\"Error\", \"credit memo is already posted\");\n return;\n }\n // work out last \n // work out last \n var grid = _this.grid;\n var last = 0;\n \n _this.grid.ds.each(function(r) {\n last = r.data.cmitem_linenumber;\n });\n \n last++;\n grid.stopEditing();\n var nr = _this.grid.ds.reader.newRow({\n cmitem_linenumber : last,\n item_number : '',\n item_descrip1 : '',\n cmitem_cmhead_id : _this.form.findField('cmhead_id').getValue(),\n cmitem_comments : '',\n cmitem_taxtype_id : _this.data.default_taxtype_id,\n cmitem_taxtype_id_taxtype_name : 'Taxable'\n });\n grid.stopEditing();\n grid.ds.insert(grid.ds.getCount(), nr); \n grid.startEditing(grid.ds.getCount()-1, 1); // type..\n}\n",
692 "render": "function (_self)\n{\n _this.addItemBtn = _self;\n}"
694 "cls": "x-btn-text-icon",
697 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
698 "|xns": "Roo.Toolbar"
702 "click": "function (_self, e)\n{\n \n var last = 1; \n _this.grid.ds.each(function(r) {\n last = r.data.cmitem_linenumber +1;\n\n \n });\n \n var grid = _this.grid;\n var ct = _this.grid.ds.getCount();\r\n var lastrow = ct ? _this.grid.ds.getAt(ct-1) : false;\r\n \r\n var cmhead_cust_id = _this.form.findField('cmhead_cust_id').getValue();\n var cmhead_id = _this.form.findField('cmhead_id').getValue();\n \n Pman.Dialog.XtupleSalesProductList.show( {cohead_cust_id : cmhead_cust_id, cmhead_id : cmhead_id} , function(res) {\n \n Roo.log(res);\n grid.stopEditing();\n\n if (lastrow) {\n var lr = lastrow;\n if (!lr.data.cmitem_itemsite_id) {\n lr.set('cmitem_itemsite_id', res.item_itemsite_id_itemsite_id);\n lr.set('item_number', res.item_number);\n lr.set('item_descrip1', res.item_descrip1); \n lr.set('cmitem_comments', res.item_descrip1);\n lr.set('cmitem_cmhead_id', _this.form.findField('cmhead_id').getValue());\n return;\n }\n }\n var rate = _this.form.findField('taxzone_rate').getValue();\r\n var nr = grid.ds.reader.newRow({\n cmitem_linenumber : last,\n cmitem_itemsite_id : res.item_itemsite_id_itemsite_id,\n item_number : res.item_number,\n item_descrip1 : res.item_descrip1 ,\n cmitem_cmhead_id : _this.form.findField('cmhead_id').getValue(),\n cmitem_comments : res.item_descrip1,\n cmitem_tax_listprice : res.item_price * ( 1 + rate * 1),\n cmitem_item_listprice : res.item_price,\n cmitem_tax_unitprice : res.item_price * ( 1 + rate * 1),\n cmitem_unitprice : res.item_price,\n cmitem_qtycredit : 1,\n cmitem_line_value : res.item_price,\n cmitem_line_tax_value : res.item_price * ( 1 + rate * 1)\n \n });\n grid.ds.insert(grid.ds.getCount(), nr);\n \n var ar = grid.ds.getAt(grid.ds.getCount() - 1);\n ar.commit();\n \n }); \n}"
704 "cls": "x-btn-text-icon",
705 "text": "Find Products",
707 "|icon": "rootURL + '/Pman/templates/images/search.gif'",
708 "|xns": "Roo.Toolbar"
712 "click": "function ()\n{\n var cmhead_id = 1 * _this.form.findField('cmhead_id').getValue();\n if (!cmhead_id) {\n Roo.MessageBox.alert(\"Error\", \"Save credit memo first!\");\n return;\n \n }\n \n new Pman.Download({\n url : baseURL + '/Roo/Metasql',\n method : 'GET',\n timeout: 600000,\n params : {\n _group : 'cmhead',\n _name : 'items',\n 'cmhead_id:number' : cmhead_id,\n csvCols : '*',\n csvTitles : '*', \n limit : 9999 \n }\n }); \n \n \n}"
714 "cls": "x-btn-text-icon",
715 "text": "Download Excel",
717 "|icon": "rootURL + '/Pman/templates/images/spreadsheet.gif'",
718 "|xns": "Roo.Toolbar"
722 "|click": "function (_self, e)\n{\n \n if (_this.form.findField('cmhead_posted').getValue() == 'true') {\n Roo.MessageBox.alert(\"Error\", \"credit memo is already posted\");\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL + '/Xtuple/Import/CreditMemo',\n onid : _this.form.findField('cmhead_id').getValue()\n \n },\n function (res) {\n _this.grid.ds.load({});\r\n }\n );\n}",
723 "render": "function (_self)\n{\n _this.uploadBtn = _self;\n}"
725 "cls": "x-btn-text-icon",
726 "text": "Upload Excel",
728 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
729 "|xns": "Roo.Toolbar"
733 "|xns": "Roo.Toolbar"
737 "|click": "function()\n{\n _this.grid.stopEditing();\n // check that no shipments or invoices are done..\n if (_this.form.findField('cmhead_posted').getValue() == 'true') {\n Roo.MessageBox.alert(\"Error\", \"credit memo is already posted\");\n return;\n }\n // check that no shipments or invoices are done..\n var rc = _this.grid.getSelectionModel().getSelectedCell();\n \n var rec = _this.grid.ds.getAt(rc[0]);\n \n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete that line?\", function(r)\n {\n if (r != 'yes') {\n return;\n }\n remove();\n });\n \n if (!rec.data.cmitem_id) {\n _this.grid.ds.remove(rec);\n return;\n }\n function remove()\n {\n new Pman.Request({\n url : baseURL + '/Roo/cmitem',\n method : 'POST',\n params : {\n _delete : rec.data.cmitem_id\n \n },\n success : function() {\n if (rec.data.item_type == 'K') {\n _this.grid.ds.load({});\n return;\n }\n _this.grid.ds.remove(rec);\n }\n \n });\n }\n\n \n \n}\n "
739 "cls": "x-btn-text-icon",
742 "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
743 "|xns": "Roo.Toolbar"
748 "*prop": "colModel[]",
749 ".builderCfg": "{\"table\":\"coitem\",\"column\":\"coitem_linenumber\",\"columnshort\":\"coitem_linenumber\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Item#\"}",
750 "dataIndex": "cmitem_linenumber",
753 "xtype": "ColumnModel",
754 "|renderer": "function(v,x,r) {\n\n if (r.data.coitem_subnumber * 1 > 0) {\n return String.format('{0}.{1}', v,r.data.coitem_subnumber);\n }\n return String.format('{0}', v);\n }",
758 "*prop": "colModel[]",
759 "dataIndex": "item_number",
760 "header": "Item Code",
762 "xtype": "ColumnModel",
763 "|renderer": "function(v) { return String.format('{0}', v); }",
768 "xtype": "GridEditor",
773 "beforeselect": "function (combo, record, index)\n{\n // set _this.data values ..\n var ar = _this.grid.activeEditor.record;\n //Roo.log('beforeselect');\n \n var rate = _this.form.findField('taxzone_rate').getValue();\n \n (function() { \n \n ar.set('item_descrip1', record.data.itemsite_item_id_item_descrip1);\n ar.set('cmitem_comments', record.data.itemsite_item_id_item_descrip1); \n ar.set('cmitem_tax_listprice', record.data.item_listprice * ( 1 + rate * 1) );\n ar.set('cmitem_item_listprice', record.data.item_listprice * 1);\n ar.set('cmitem_tax_unitprice', record.data.item_price * ( 1 + rate * 1) );\n ar.set('cmitem_unitprice', record.data.item_price * 1);\n ar.set('cmitem_qtycredit', 1);\n ar.set('cmitem_line_value', record.data.item_price * ar.data.cmitem_qtycredit);\n ar.set('cmitem_line_tax_value', ar.data.cmitem_tax_unitprice * ar.data.cmitem_qtycredit);\n ar.set('cmitem_itemsite_id', record.data.itemsite_id);\n ar.set('item_number', record.data.itemsite_item_id_item_number);\n ar.set('item_type', record.data.itemsite_item_id_item_type);\n ar.set('avail_qty', 0);\n // ar.updateFields = ['All'];\n ar.commit();\n }).defer(100);\n \n}"
777 "displayField": "itemsite_item_id_item_number",
779 "emptyText": "Select item",
780 "forceSelection": true,
781 "hiddenName": "itemsite_item_id_item_number",
783 "loadingText": "Searching...",
785 "name": "item_number",
787 "qtip": "Select item",
788 "queryParam": "query[number]",
789 "selectOnFocus": true,
790 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{itemsite_item_id_item_number}</b> ${item_price:toFixed(2)}- {itemsite_item_id_item_descrip1} </div>",
791 "triggerAction": "all",
793 "valueField": "item_number",
799 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n o.params.customer_id = _this.form.findField('cmhead_cust_id').getValue();\n o.params['query[cmhead_id]'] = _this.form.findField('cmhead_id').getValue();\n //o.params.shipto_cust_id = _this.data.cohead_cust_id;\n // set more here\n}\n"
804 "|sortInfo": "{ direction : 'ASC', field: 'item_number' }",
810 "xtype": "HttpProxy",
811 "|url": "baseURL + '/Roo/itemsite.php'",
818 "totalProperty": "total",
819 "xtype": "JsonReader",
820 "|fields": "[{'name':'item_id','type':'int'},'item_number']",
832 "*prop": "colModel[]",
833 "dataIndex": "cmitem_comments",
834 "header": "Item Description",
836 "xtype": "ColumnModel",
837 "|renderer": "function(v,x,r) { \n\n if (!v.length) {\n r.set('cmitem_comments', r.data.item_descrip1);\n v = r.data.item_descrip1;\n }\n if (v && v.length > 49) {\n return String.format('<span style=\"color:orange\" qtip=\"line may be too long to print\">{0}</span>', v);\n }\n return String.format('{0}', v); \n \n}",
842 "xtype": "GridEditor",
848 "xtype": "TextField",
856 "*prop": "colModel[]",
858 "dataIndex": "cmitem_qtycredit",
861 "xtype": "ColumnModel",
862 "|renderer": "function(v)\n{\n return String.format('{0}', v ? parseInt(v) : '');\n}",
867 "xtype": "GridEditor",
872 "focus": "function (_self)\n{\n if (this.value == 0) {\n this.el.dom.value = '';\n }\n}"
875 "allowDecimals": false,
876 "decimalPrecision": 0,
878 "style": "text-align:right",
879 "xtype": "NumberField",
887 "*prop": "colModel[]",
888 ".builderCfg": "{\"table\":\"coitem\",\"column\":\"coitem_linenumber\",\"columnshort\":\"coitem_linenumber\",\"ctype\":\"int4\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"Item#\"}",
890 "dataIndex": "cmitem_tax_listprice",
891 "header": "List Price w. tax",
893 "xtype": "ColumnModel",
894 "|renderer": "function(v,x,r)\n{\n // var rate = _this.form.findField('taxzone_rate').getValue();\n // v = v * (1 + rate * 1);\n \n return String.format('{0}', v ? parseFloat(v).toFixed(2) : '');\n}",
898 "*prop": "colModel[]",
900 "dataIndex": "cmitem_taxtype_id",
903 "xtype": "ColumnModel",
904 "|renderer": "function(v,x,r) { return String.format('{0}', r.data.cmitem_taxtype_id_taxtype_name); }",
909 "xtype": "GridEditor",
915 "displayField": "taxtype_name",
917 "emptyText": "Select Tax Type",
918 "forceSelection": true,
919 "hiddenName": "cmitem_taxtype_id",
921 "loadingText": "Searching...",
923 "name": "cmitem_taxtype_id_taxtype_name",
925 "qtip": "Select taxtype",
926 "queryParam": "query[taxtype_id]",
927 "selectOnFocus": true,
928 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{taxtype_name}</b> </div>",
929 "triggerAction": "all",
931 "valueField": "taxtype_id",
938 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n \n/* o.params.with_date = _this.form.findField('cohead_orderdate').getValue().format('Y-m-d'); \n Roo.log(\"with date?\" + o.params.with_date);*/\n \n \n}\n"
943 "|sortInfo": "{ direction : 'ASC', field: 'taxtype_name' }",
949 "xtype": "HttpProxy",
950 "|url": "baseURL + '/Roo/taxtype.php'",
957 "totalProperty": "total",
958 "xtype": "JsonReader",
959 "|fields": "[{'name':'taxtype_id','type':'int'},'taxtype_name']",
971 "*prop": "colModel[]",
973 "dataIndex": "cmitem_tax_unitprice",
974 "header": "Unit Price w. tax",
976 "xtype": "ColumnModel",
977 "|renderer": "function(v,x,r)\n{\n return String.format('{0}', v ? parseFloat(v).toFixed(2) : '');\n}",
982 "xtype": "GridEditor",
987 "focus": "function (_self)\n{\n if (this.value == 0.0) {\n this.el.dom.value = '';\n }\n}"
990 "decimalPrecision": 2,
992 "style": "text-align:right",
993 "xtype": "NumberField",
1001 "*prop": "colModel[]",
1003 "dataIndex": "cmitem_unitprice",
1004 "header": "Unit Price",
1006 "xtype": "ColumnModel",
1007 "|renderer": "function(v)\n{\n return String.format('{0}', v ? parseFloat(v).toFixed(2) : '');\n}",
1012 "xtype": "GridEditor",
1017 "focus": "function (_self)\n{\n if (this.value == 0.0) {\n this.el.dom.value = '';\n }\n}"
1020 "decimalPrecision": 2,
1022 "style": "text-align:right",
1023 "xtype": "NumberField",
1031 "*prop": "colModel[]",
1033 "dataIndex": "cmitem_line_value",
1036 "xtype": "ColumnModel",
1037 "|renderer": "function(v)\n{\n return String.format('{0}', v ? parseFloat(v).toFixed(2) : '');\n}",
1041 "*prop": "colModel[]",
1043 "dataIndex": "cmitem_line_tax_value",
1044 "header": "Total w. tax",
1046 "|renderer": "function(v,x,r)\n{\n return String.format('{0}', v ? parseFloat(v).toFixed(2) : '');\n}",
1055 "|activate": "function() {\n _this.cpanel = this;\n \n var id = _this.form.findField('cmhead_id').getValue() * 1;\n if (id < 1) {\n Roo.MessageBox.alert(\"Error\", \"save the credit memo first!\");\n _this.dialog.layout.getRegion('center').showPanel(0);\n return;\n }\n \n if (_this.cgrid) {\n _this.cgrid.footer.onClick('first');\n }\n}"
1058 "fitContainer": true,
1061 "tableName": "checkitem",
1062 "title": "Miscellaneous Check",
1063 "xtype": "GridPanel",
1068 "|render": "function() \n{\n _this.cgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.cpanel.active) {\n this.footer.onClick('first');\n }\n}"
1071 "autoExpandColumn": "checkitem_checkhead_id_checkhead_notes",
1078 "beforeload": "function (_self, options)\n{\n options.params = options.params || {};\n options.params.checkitem_cmnumber = _this.form.findField('cmhead_number').getValue();\n}"
1080 "*prop": "dataSource",
1083 "|sortInfo": "{ field : 'checkitem_id', direction: 'DESC' }",
1089 "xtype": "HttpProxy",
1090 "|url": "baseURL + '/Roo/checkitem.php'",
1097 "totalProperty": "total",
1098 "xtype": "JsonReader",
1099 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'type',\n 'type': 'int'\n },\n {\n 'name': 'leader',\n 'type': 'int'\n },\n {\n 'name': 'leader_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_office_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_name',\n 'type': 'string'\n },\n {\n 'name': 'leader_phone',\n 'type': 'string'\n },\n {\n 'name': 'leader_fax',\n 'type': 'string'\n },\n {\n 'name': 'leader_email',\n 'type': 'string'\n },\n {\n 'name': 'leader_company_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_role',\n 'type': 'string'\n },\n {\n 'name': 'leader_active',\n 'type': 'int'\n },\n {\n 'name': 'leader_remarks',\n 'type': 'string'\n },\n {\n 'name': 'leader_passwd',\n 'type': 'string'\n },\n {\n 'name': 'leader_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_lang',\n 'type': 'string'\n },\n {\n 'name': 'leader_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'leader_action_type',\n 'type': 'string'\n },\n {\n 'name': 'leader_project_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'leader_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'leader_firstname',\n 'type': 'string'\n },\n {\n 'name': 'leader_lastname',\n 'type': 'string'\n },\n {\n 'name': 'leader_name_facebook',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_blog',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_twitter',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_linkedin',\n 'type': 'string'\n },\n {\n 'name': 'leader_crm_lead_percentage',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_industry_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_updated_action_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_created_action_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_type_id',\n 'type': 'int'\n }\n]",
1106 "displayInfo": true,
1107 "displayMsg": "Displaying check item{0} - {1} of {2}",
1108 "emptyMsg": "No check item found",
1110 "xtype": "PagingToolbar",
1114 "*prop": "colModel[]",
1115 "dataIndex": "checkitem_docdate",
1118 "xtype": "ColumnModel",
1119 "|renderer": "function(v) { return String.format('{0}', v ? v.format('Y-m-d') : ''); }",
1123 "*prop": "colModel[]",
1124 "dataIndex": "checkitem_bankaccnt_id_bankaccnt_name",
1125 "header": "Bank Account",
1127 "xtype": "ColumnModel",
1128 "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
1132 "*prop": "colModel[]",
1133 "dataIndex": "checkitem_checkhead_id_checkhead_for",
1136 "xtype": "ColumnModel",
1137 "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
1141 "*prop": "colModel[]",
1142 "dataIndex": "checkitem_checkhead_id_checkhead_notes",
1145 "xtype": "ColumnModel",
1146 "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
1150 "*prop": "colModel[]",
1152 "dataIndex": "checkitem_curr_id_curr_name",
1153 "header": "Currency",
1155 "xtype": "ColumnModel",
1156 "|renderer": "function(v) { return String.format('{0}', v ? v : ''); }",
1160 "*prop": "colModel[]",
1162 "dataIndex": "checkitem_amount",
1165 "xtype": "ColumnModel",
1166 "|renderer": "function(v) { return String.format('{0}', v ? parseFloat(v).toFixed(2) : ''); }",
1175 "|activate": "function() {\n _this.apanel = this;\n if (_this.agrid) {\n _this.agrid.footer.onClick('first');\n }\n}"
1177 "background": false,
1178 "fitContainer": true,
1181 "tableName": "invchead",
1182 "title": "Applications",
1183 "xtype": "GridPanel",
1188 "|render": "function() \n{\n _this.agrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.apanel.active) {\n this.footer.onClick('first');\n }\n}"
1191 "autoExpandColumn": "arapply_target_docnumber",
1198 "beforeload": "function (_self,o) {\n\n try {\n this.removeAll();\n } catch (e) { }\n\n if (!_this.data || !_this.data.cmhead_id) {\n return false;\n }\n o.params = o.params || {};\n \n o.params._application = _this.data.cmhead_id\n \n}"
1200 "*prop": "dataSource",
1203 "|sortInfo": "{ field : 'arapply_id', direction: 'ASC' }",
1209 "xtype": "HttpProxy",
1210 "|url": "baseURL + '/Roo/Arapply.php'",
1215 "xtype": "JsonReader",
1216 "totalProperty": "total",
1220 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'type',\n 'type': 'int'\n },\n {\n 'name': 'leader',\n 'type': 'int'\n },\n {\n 'name': 'leader_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_office_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_name',\n 'type': 'string'\n },\n {\n 'name': 'leader_phone',\n 'type': 'string'\n },\n {\n 'name': 'leader_fax',\n 'type': 'string'\n },\n {\n 'name': 'leader_email',\n 'type': 'string'\n },\n {\n 'name': 'leader_company_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_role',\n 'type': 'string'\n },\n {\n 'name': 'leader_active',\n 'type': 'int'\n },\n {\n 'name': 'leader_remarks',\n 'type': 'string'\n },\n {\n 'name': 'leader_passwd',\n 'type': 'string'\n },\n {\n 'name': 'leader_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_lang',\n 'type': 'string'\n },\n {\n 'name': 'leader_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'leader_action_type',\n 'type': 'string'\n },\n {\n 'name': 'leader_project_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'leader_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'leader_firstname',\n 'type': 'string'\n },\n {\n 'name': 'leader_lastname',\n 'type': 'string'\n },\n {\n 'name': 'leader_name_facebook',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_blog',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_twitter',\n 'type': 'string'\n },\n {\n 'name': 'leader_url_linkedin',\n 'type': 'string'\n },\n {\n 'name': 'leader_crm_lead_percentage',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_industry_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_updated_action_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_created_action_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_crm_type_id',\n 'type': 'int'\n }\n]"
1226 "displayInfo": true,
1227 "displayMsg": "Displaying application{0} - {1} of {2}",
1228 "emptyMsg": "No application found",
1230 "xtype": "PagingToolbar",
1234 "*prop": "colModel[]",
1235 "dataIndex": "arapply_id",
1238 "xtype": "ColumnModel",
1239 "|renderer": "function(v) { return String.format('{0}', v); }",
1243 "*prop": "colModel[]",
1244 "dataIndex": "arapply_distdate",
1247 "xtype": "ColumnModel",
1248 "|renderer": "function(v) { return String.format('{0}', v ? v.format('Y-m-d') : ''); }",
1252 "*prop": "colModel[]",
1253 "dataIndex": "arapply_target_doctype",
1254 "header": "Target Doctype",
1256 "xtype": "ColumnModel",
1257 "|renderer": "function(v) { return String.format('{0}', v); }",
1261 "*prop": "colModel[]",
1262 "dataIndex": "arapply_target_docnumber",
1263 "header": "Target Docnumber",
1265 "xtype": "ColumnModel",
1266 "|renderer": "function(v) { return String.format('{0}', v); }",
1270 "*prop": "colModel[]",
1271 "dataIndex": "arapply_curr_id_curr_name",
1272 "header": "Currency",
1274 "xtype": "ColumnModel",
1275 "|renderer": "function(v) { return String.format('{0}', v); }",
1279 "*prop": "colModel[]",
1280 "dataIndex": "arapply_applied",
1281 "header": "Applied",
1283 "xtype": "ColumnModel",
1284 "|renderer": "function(v) { return String.format('{0}', v); }",
1293 "|activate": "function() {\n _this.hpanel = this;\n if (_this.hgrid) {\n _this.hgrid.footer.onClick('first');\n }\n}"
1295 ".builderCfg": "{\"cols\":[{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}],\"cols_ex\":[\"remarks\"],\"table\":\"events\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
1297 "fitContainer": true,
1300 "tableName": "events",
1302 "xtype": "GridPanel",
1307 "|render": "function() \n{\n _this.hgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.hpanel.active) {\n this.footer.onClick('first');\n }\n}",
1308 "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
1311 ".builderCfg": "{\"cols\":[{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}],\"cols_ex\":[\"remarks\"],\"table\":\"events\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
1312 "autoExpandColumn": "remarks",
1319 "beforeload": "function (_self, options)\n{\n options.params._related_on_table = 'cmhead';\n options.params._related_on_id = _this.form.findField('cmhead_id').getValue();\n \n}"
1321 "*prop": "dataSource",
1324 "|sortInfo": "{ field : 'event_when', direction: 'DESC' }",
1330 "xtype": "HttpProxy",
1331 "|url": "baseURL + '/Roo/events.php'",
1336 "xtype": "JsonReader",
1337 "totalProperty": "total",
1339 ".builderCfg": "{\"cols\":[{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"},{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}],\"cols_ex\":[\"remarks\"],\"table\":\"events\",\"xtype\":\"GridPanel\",\"|xns\":\"Roo\"}",
1342 "|fields": "[\n {\n 'name': 'event_when',\n 'type': 'date'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n }\n]"
1348 "xtype": "PagingToolbar",
1350 "displayInfo": true,
1351 "displayMsg": "Displaying events{0} - {1} of {2}",
1352 "emptyMsg": "No events found",
1356 "*prop": "colModel[]",
1357 ".builderCfg": "{\"table\":\"events\",\"column\":\"event_when\",\"columnshort\":\"event_when\",\"ctype\":\"timestamp\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}",
1358 "dataIndex": "event_when",
1359 "header": "Changed",
1361 "xtype": "ColumnModel",
1362 "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y H:i:s') : ''); }",
1366 "*prop": "colModel[]",
1367 ".builderCfg": "{\"table\":\"events\",\"column\":\"action\",\"columnshort\":\"action\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}",
1368 "dataIndex": "action",
1371 "xtype": "ColumnModel",
1372 "|renderer": "function(v,x,r) { return String.format('{0} - {1}', v, r.data.on_table); }",
1376 "*prop": "colModel[]",
1377 ".builderCfg": "{\"table\":\"events\",\"column\":\"ipaddr\",\"columnshort\":\"ipaddr\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}",
1378 "dataIndex": "ipaddr",
1379 "header": "IP address",
1381 "xtype": "ColumnModel",
1382 "|renderer": "function(v) { return String.format('{0}', v); }",
1386 "*prop": "colModel[]",
1387 ".builderCfg": "{\"table\":\"person\",\"column\":\"person_id_name\",\"columnshort\":\"name\",\"ctype\":\"varchar\",\"desc\":\"\",\"use\":1,\"use_ex\":\"\",\"title\":\"\"}",
1388 "dataIndex": "person_id_name",
1391 "xtype": "ColumnModel",
1392 "|renderer": "function(v) { return String.format('{0}', v); }",
1396 "*prop": "colModel[]",
1397 ".builderCfg": "{\"table\":\"events\",\"column\":\"remarks\",\"columnshort\":\"remarks\",\"ctype\":\"text\",\"desc\":\"\",\"use\":1,\"use_ex\":1,\"title\":\"\"}",
1398 "dataIndex": "remarks",
1401 "xtype": "ColumnModel",
1402 "|renderer": "function(v) { return String.format('{0}', v); }",
1411 "click": "function (_self, e)\n{\n if (_this.grid) _this.grid.stopEditing();\n _this.dialog.hide();\n}"
1413 "*prop": "buttons[]",
1420 "click": "function (_self, e)\n{\n // do some checks?\n if (_this.grid) _this.grid.stopEditing();\n if (_this.form.findField('cmhead_posted').getValue() == 'true') {\n Roo.MessageBox.alert(\"Error\", \"credit memo is already posted\");\n return;\n }\n var loose = false;\n var ar = [];\n if (_this.grid && _this.grid.ds) {\n _this.grid.ds.each(function(rec) {\n if (!(rec.data.cmitem_itemsite_id * 1) || !(rec.data.cmitem_qtycredit*1) || !(rec.data.cmitem_unitprice*1)) {\n loose = true;\n return true;\n } \n ar.push(rec);\n \n });\n if (loose) {\n Roo.MessageBox.alert(\"Error\", \"Some lines do not have product/qty/price set\");\n return;\n } \n }\n if(ar.length){\n _this.form.findField('has_item').setValue(ar.length);\n } \n \n _this.form.doAction(\"submit\");\n}",
1421 "render": "function (_self)\n{\n_this.saveBtn = _self;\n}"
1423 "*prop": "buttons[]",