EAS bos单据方法记录

 

 

1、设置序时簿背景颜色

    @Override
    protected void afterTableFillData(KDTDataRequestEvent e) {
    	// TODO Auto-generated method stub
    	super.afterTableFillData(e);
    	
    	for(int i = e.getFirstRow();i<=e.getLastRow();i++){
    		 IRow row = tblMain.getRow(i);
    		 ICell cell = row.getCell("bizDate");
    	     Boolean fivouchered = (Boolean) row.getCell("Fivouchered").getValue();
    		 Date bizDate = (Date) cell.getValue();
    		 row.getCell("bizDate");
    		 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    		 try {
				Date parse = simpleDateFormat.parse("2021-01-30");
				if(bizDate.compareTo(parse)<=0){
					if(!fivouchered){
						row.getCell("Fivouchered").getStyleAttributes().setBackground(Color.gray);
					}
				}
			} catch (ParseException e1) {
				e1.printStackTrace();
			}
    		 
    	}
    	
    }

2、设置序时簿显示 不忽略0

	protected IQueryExecutor getQueryExecutor(IMetaDataPK pk,
			EntityViewInfo viewInfo) {
		IQueryExecutor queryExecutor = super.getQueryExecutor(pk, viewInfo);
		queryExecutor.option().isAutoIgnoreZero = false; // 不自动忽略数值零
		return queryExecutor;
	}

3、编辑界面分录表格点击事件

	@Override
	protected void kdtEntrys2_tableClicked(KDTMouseEvent e) throws Exception {
		 if(prmtcustomer.getValue() == null)throw new EASBizException(new NumericExceptionSubItem("0002","请先选择客户"));
	} 

 4、编辑界面页面全屏

super.onLoad();
		  Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		  setPreferredSize(new Dimension(screenSize.width-450,screenSize.height-300));

5、字段设置颜色

	 this.txtinvoicedAmt.setCustomForegroundColor( Color.red);

6、分录设置标题

this.kdtEntrys_detailPanel.setTitle("发票");  

7、刷新单据的序时簿界面

//		     disposeUIWindow();
		     Object uiObj = this.getUIContext().get(UIContext.OWNER); // 刷新序时薄界面
				if (uiObj != null && uiObj instanceof HWReqBillListUI) {
					((HWReqBillListUI) uiObj).refreshList();
				}

8、分录编辑F7  编辑结束事件

protected void kdtEntrys2_editStopped(KDTEditEvent e)

9、分录的f7过滤

	CustomerInfo customerInfo = (CustomerInfo) this.prmtcustomer.getValue();
		KDBizPromptBox prmtHfPerson = (KDBizPromptBox) kdtEntrys2.getColumn("TempInWarehsBill").getEditor().getComponent(); //获取表格特定列绑定的F7
		EntityViewInfo view = new EntityViewInfo();
		prmtHfPerson.setQueryInfo("com.kingdee.eas.wastedisposal.hwd.app.TempInWarehsBilChooseQuery");
		 FilterInfo filter = new FilterInfo(); //过滤条件
		filter.getFilterItems().add(new FilterItemInfo("customer.id", customerInfo.getId())); //条件1,#0
		//filter.getFilterItems().add(new FilterItemInfo("status", BizStatusEnum.NORMAL_VALUE)); //条件2,#1
		//filter.getFilterItems().add(new FilterItemInfo("status", BizStatusEnum.FROZEN_VALUE)); //条件3,#2
		//filter.setMaskString("#0 and (#1 or #2)"); //3个过滤条件设定关系
		view.setFilter(filter); 
		prmtHfPerson.setEntityViewInfo(view); //F7重新设定视图

10、分录字段设置小数显示位数、设置锁定

 	kdtEntrys.getColumn("price").getStyleAttributes().setNumberFormat("#,##0.##########"); 
		kdtEntrys.getColumn("taxPrice").getStyleAttributes().setNumberFormat("#,##0.##########"); 
  kdtEntrys.getColumn("amount").getStyleAttributes().setLocked(false);
			  kdtEntrys.getColumn("taxAmount").getStyleAttributes().setLocked(false);
			  kdtEntrys.getColumn("invoicedAmt").getStyleAttributes().setLocked(false);

11、bean方法中处理凭证反写

   @Override
	   protected void _reverseSave(Context ctx, IObjectPK srcBillPK,
	   		IObjectValue srcBillVO, BOTBillOperStateEnum billOperStateEnum,
	   		IObjectValue relationInfo) throws BOSException, EASBizException {
	   	   reverseSave(ctx, srcBillPK, srcBillVO, billOperStateEnum, relationInfo);
	   	 super._reverseSave(ctx, srcBillPK, srcBillVO, billOperStateEnum, relationInfo);
	   }
	       
	      
	      
	      public static void reverseSave(Context ctx, IObjectPK srcBillPK, IObjectValue srcBillVO, BOTBillOperStateEnum bOTBillOperStateEnum, IObjectValue bOTRelationInfo) throws BOSException, EASBizException {
	   		BOTRelationInfo relation = (BOTRelationInfo) bOTRelationInfo;
	   		BOSObjectType bosType = BOSUuid.read(relation.getDestObjectID()).getType();
	   		if (bosType.equals((new VoucherInfo()).getBOSType())) {
	   			CoreBillBaseInfo model = (CoreBillBaseInfo) srcBillVO;
	   			// 删除凭证
	   			if (bOTBillOperStateEnum.equals(BOTBillOperStateEnum.DELETE)) {
	   				//model.put(FLD_FIVOUCHERED, new Integer(0));
	   				// 以下设置单据的凭证信息
	   				model.put("VOUCHERNUMBER", null);
	   				//model.put(FLD_VOUCHERDATE, null);
	   			}
	   			// 生成凭证
	   			else {
	   				String voucherID = relation.getDestObjectID();
	   				VoucherInfo voucherInfo = (VoucherInfo) VoucherFactory.getLocalInstance(ctx).getValue(new ObjectStringPK(voucherID));
	   				 //model.put(FLD_FIVOUCHERED, voucherInfo.getNumber() );
	   				// 以下设置单据的凭证信息
	   				  model.put("VOUCHERNUMBER", voucherInfo.getNumber());
	   				// model.put(FLD_VOUCHERDATE, voucherInfo.getBookedDate());
	   			}
	   			BOSObjectType bosObjectType = srcBillVO.getBOSType();
	   			ICoreBillBase iCoreBillBase = (ICoreBillBase) BOSObjectFactory.createBOSObject(ctx, bosObjectType);
	   			iCoreBillBase.reverseSave(srcBillPK, (CoreBillBaseInfo) srcBillVO);
	   		}
	   	}

12、序时簿设置字段精度显示

 	  this.tblMain.getColumn("entrys.noTaxPrice").getStyleAttributes().setNumberFormat("0.########"); 
this.tblMain.getColumn("entrys.noTaxPrice").setWidth(160);

13、标准F7 比如物料 客户 供应商 实现

职员两种效果

    HashMap map = new HashMap();
	    map.put(PersonF7UI.ALL_ADMIN, "YES");
	    map.put(PersonF7UI.DEFAULT_SHOW_ALL, "YES");
	    prmtbusinessManager.setSelector(new PersonPromptBox(null, map));
		
	//第二种    
	    prmtbusinessManager.setQueryInfo("com.kingdee.eas.basedata.person.app.F7PersonQuery");  
	    FIPersonPromptBox personf7 = new FIPersonPromptBox(this);  
	    prmtbusinessManager.setSelector(personf7); 

//第三种
 prmtfirstParty.setHasCUDefaultFilter(true);
 
  FIPersonPromptBox personf7 = new FIPersonPromptBox(this);  
   prmtbusinessManager.setSelector(personf7); 
F7 专用选择界面的设置
public void setF7Selector() throws Exception 
{ 
KDBizPromptBox bizPromptBox = new KDBizPromptBox();// 
CoreUIObject ui = null;// 父界面对象
CompanyOrgUnitInfo companyInfo = null; // 当前财务组织
// 客户
bizPromptBox.setSelector(new GeneralKDPromptSelectorAdaptor(bizPromptBox, new 
F7CustomerTreeDetailListUI(), ui)); 
// 供应商
bizPromptBox.setSelector(new GeneralKDPromptSelectorAdaptor(bizPromptBox, new 
F7SupplierTreeDetailListUI(), ui)); 
// 物料
bizPromptBox.setSelector(new GeneralKDPromptSelectorAdaptor(bizPromptBox, new 
F7MaterialTreeListUI(), ui)); 
// 职员
HashMap map = new HashMap(); 
map.put(PersonF7UI.ALL_ADMIN, "YES"); 
bizPromptBox.setSelector(new PersonPromptBox(ui, map)); 
// 公司
CompanyF7 org = new CompanyF7(ui); 
org.setRootUnitID(""); 
bizPromptBox.setSelector(new CompanyF7(ui)); 
// 成本中心
bizPromptBox.setSelector(new CostCenterF7(ui)); 
// 行政组织
bizPromptBox.setSelector(new AdminF7(ui)); 
// 采购组织
bizPromptBox.setSelector(new PurchaseF7(ui)); 
// 库存组织
bizPromptBox.setSelector(new StorageF7(ui)); 
// 销售组织
bizPromptBox.setSelector(new SaleF7(ui)); 
// 利润中心组织
bizPromptBox.setSelector(new ProfitCenterF7(ui)); 
final KDBizPromptBox objPrmt = new KDBizPromptBox();  
 F7BaseSelector selector = null;//new F7BaseSelector(this, null, objPrmt);  
 objPrmt.setVisible(true);  
 objPrmt.setEditable(true);  
         objPrmt.setEditFormat("$number$");  
         objPrmt.setCommitFormat("$number$;$name$");  
         objPrmt.setDisplayFormat("$name$");            
 if(tblName.equalsIgnoreCase("T_BD_Customer")){//客户  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.master.cssp.app.F7CustomerQuery");  
 selector = new F7CustomerSimpleSelector(this, objPrmt);  
 objPrmt.setSelector(selector);  
 }else if(tblName.equalsIgnoreCase("T_BD_Supplier")){//供应商  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.master.cssp.app.F7SupplierQuery");  
 selector = new F7SupplierSimpleSelector(this, objPrmt);    
 objPrmt.setSelector(selector);  
 }else if(tblName.equalsIgnoreCase("T_BD_AccountBanks")){//银行帐户  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.assistant.app.F7AccountBankQuery");  
 }else if(tblName.equalsIgnoreCase("T_ORG_Company")){//公司  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.org.app.CompanyQuery");  
 }else if(tblName.equalsIgnoreCase("T_BD_Material")){//物料  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.master.material.app.F7MaterialBaseInfoQuery");  
 }else if(tblName.equalsIgnoreCase("T_BD_Person")){//职员  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.person.app.F7PersonQuery");  
 FIPersonPromptBox personf7 = new FIPersonPromptBox(this);  
 objPrmt.setSelector(personf7);  
 }else if(tblName.equalsIgnoreCase("T_ORG_CostCenter")){//成本中心  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.org.app.CostCenterOrgUnitQuery4AsstAcct");  
 }else if(tblName.equalsIgnoreCase("T_BD_Project")){//项目  
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.assistant.app.F7ProjectQuery");  
 }else if(tblName.equalsIgnoreCase("T_BD_GeneralAsstActType")){//自定义核算项     
 objPrmt.setQueryInfo("com.kingdee.eas.basedata.master.auxacct.app.F7GeneralAsstActTypeQuery");  
 AuxAccountUtils.assignGeneralBizPromptBox(objPrmt, grp.getId().toString(), true, this);  
 //GLf7Utils.assignSelector(objPrmt, grp, aat.getHgAttribute(), at.isForCompany(), false, null, this, at.isUseLongNumber());  
 }else {//其他  
   
 }

14、F7控件设置cu过滤

	 prmtfirstParty.setHasCUDefaultFilter(true);

15、获取分录合计

	IRow footRow = kdtEntrys.getFootManager().getFootRow(0);
		BigDecimal amount = new BigDecimal(footRow.getCell("amount").getValue().toString());
		BigDecimal qty = new BigDecimal(footRow.getCell("qty").getValue().toString());

16、查询扩展报表的发布路径


select * from t_bas_definereport where fname_l2 like '%低%'

17、数据库插入web菜单

  // 客户话菜单
      geninsert  select * from T_PM_MainMenuItem where  FName_L2='自定义项目'
     
     //web菜单
      geninsert select  * from T_JP_Page   where  FID='18581f64-696f-4975-81cd-410991d6c5d1'

18、F7弹框界面 银行账号脱敏实现  复制标准query修改

( SELECT CONCAT ( CONCAT ( LEFT ( CFBANKACCOUNT , 4 ) , '*******' ) , CONCAT ( '*******' , right ( CFBANKACCOUNT , 4 ) ) ) as bankAccount FROM T_BC_CollectionAccount where CFBANKACCOUNT = #0 )

19、下拉框监听

 @Override
public void onLoad() throws Exception {
	super.onLoad();
    bizTypeListener();
}


/**
  * 下拉列表监听
  * 该方法需放入 onLoad() 方法中
  */
 public void bizTypeListener() {
	bizType.addItemListener(new ItemListener(){
		@Override
		public void itemStateChanged(ItemEvent e) {
			/**
			 * bizType 单据界面下拉列表控件名称
			 * getSelectedItem() 获取下拉列表选中的值
			 * AcpBizType 自定义的枚举类
			 */
			AcpBizType type = (AcpBizType) bizType.getSelectedItem();
		}
	 });
 }

20、EAS BOS 代码隐藏分录列、锁定列、锁定单元格 

kdtEntry.getColumn("unit").getStyleAttributes().setHided(true);//隐藏列
kdtEntry.getColumn("unit").getStyleAttributes().setLocked(true);//锁定列使不可编辑
 
kdtEntry.getCell(rowIndex, "unit").getStyleAttributes().setLocked(true);//锁定单元格
 

21、设置字段必填 及必填背景色

	 txtsettlementAmount.setBackground(new Color(255,255,220)); 
	    	 txtsettlementedAmount.setRequired(true);

22、分录设置必填  及 背景色

	kdtEntrys.getColumn("price").setRequired(true);
			kdtEntrys.getColumn("price").getStyleAttributes().setBackground(new Color(255,255,220));

23、 含税金额  不含税金额  税率计算逻辑


	    //数量  不含税单价    税率   监听
	    if ("qty".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey())|| "price".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey())|| "tax".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey()) ) {
	    	BigDecimal price = kdtEntrys.getCell(rowIndex, "price").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "price").getValue();
	    	BigDecimal qty = kdtEntrys.getCell(rowIndex, "qty").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "qty").getValue();
	    	
	    	//含税单价=不含税价格*(1+税率)
	    	BigDecimal tax = kdtEntrys.getCell(rowIndex, "tax").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "tax").getValue();
	        BigDecimal taxrate = tax.divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP);
	    	BigDecimal taxPrice = price.multiply(new BigDecimal("1").add(taxrate)).setScale(10,BigDecimal.ROUND_HALF_UP);
	    	
	    	//税额=不含税价格*税率*数量
			BigDecimal taxAmt = price.multiply(taxrate).multiply(qty).setScale(2,BigDecimal.ROUND_HALF_UP); 
			
			//含税金额=含税单价*数量
			BigDecimal payment = taxPrice.multiply(qty).setScale(2,BigDecimal.ROUND_HALF_UP);
			
			//不含税金额 =金额-税额
			BigDecimal amt = payment.subtract(taxAmt);
			
			kdtEntrys.getCell(rowIndex, "taxPrice").setValue(taxPrice);
			kdtEntrys.getCell(rowIndex, "taxAmt").setValue(taxAmt);
			kdtEntrys.getCell(rowIndex, "amt").setValue(amt);
			kdtEntrys.getCell(rowIndex, "payment").setValue(payment);
	    }
		
		//数量  含税单价   监听
	    if ("qty".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey())|| "taxPrice".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey()) ) {
	    	BigDecimal taxPrice = kdtEntrys.getCell(rowIndex, "taxPrice").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "taxPrice").getValue();
	    	BigDecimal qty = kdtEntrys.getCell(rowIndex, "qty").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "qty").getValue();
			BigDecimal payment=qty.multiply(taxPrice).setScale(2, BigDecimal.ROUND_HALF_UP);  //开票金额  开票金额=含税单价*数量
			  
			//不含税价格=含税单价/(1+税率)
	    	BigDecimal tax = kdtEntrys.getCell(rowIndex, "tax").getValue() == null ?BigDecimal.ZERO:(BigDecimal)kdtEntrys.getCell(rowIndex, "tax").getValue();
		    BigDecimal taxrate = tax.divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP);
			BigDecimal price=taxPrice.divide (new BigDecimal("1").add(taxrate),10,BigDecimal.ROUND_HALF_UP);
			
			//税额=含税单价/(1+税率)*税率*数量
			//税额=不含税价格*税率*数量
			BigDecimal taxAmt = price.multiply(taxrate).multiply(qty).setScale(2,BigDecimal.ROUND_HALF_UP);
			
			//不含税金额 =金额-税额
			BigDecimal amt = payment.subtract(taxAmt);
		    
			kdtEntrys.getCell(rowIndex, "price").setValue(price);
			kdtEntrys.getCell(rowIndex, "taxAmt").setValue(taxAmt);
			kdtEntrys.getCell(rowIndex, "amt").setValue(amt);
			kdtEntrys.getCell(rowIndex, "payment").setValue(payment);
		 }
		

24、eas里客户端保存,提交里增加校验规则和必填

protected void verifyInput(ActionEvent e) 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: EAS(企业应用软件)和BOS(业务操作平台)是一种企业级应用软件,用于管理企业内部的各种业务流程和数据。单据开发是指在EASBOS系统中,根据企业的具体业务需求,开发和定制各种业务单据模板和流程。 在EASBOS系统中,单据是一种重要的业务文档,用于记录和处理企业的业务活动。例如,销售订单、采购申请、合同、报销单等都属于常见的业务单据。通过定制化开发,可以根据企业的实际需求,创建适合企业业务特点的单据模板,并设计相应的工作流程用于处理和审批这些单据单据开发一般包含以下几个步骤: 1. 需求分析:与企业相关部门沟通,了解业务需求,明确单据开发的目标和范围。 2. 设计单据模板:根据需求分析的结果,设计单据模板,包括单据的样式、字段和布局等,确保单据能够满足业务需求。 3. 编码开发:根据设计的单据模板,进行编码开发工作,实现单据EASBOS系统中的呈现和功能。 4. 测试和调试:进行单据开发的测试和调试工作,确保单据的正常运行,并满足企业的需求。 5. 部署和上线:将开发好的单据模板和应用程序部署到EASBOS系统中,并让相关人员开始使用。 6. 维护和优化:持续跟踪和维护开发的单据,在实际使用中及时进行修复和优化,以保证系统的稳定性和性能。 通过EASBOS系统的单据开发,企业可以更加高效地管理和处理各种业务单据,提高工作效率和准确性。同时,定制化的单据开发也使企业能够适应特定行业或业务的需求,提供更加个性化和专业化的管理解决方案。 ### 回答2: EAS (企业应用系统) 和 BOS (业务操作系统) 是一种常用于企业管理的软件平台。它们可以帮助企业管理各种业务流程和数据,提高工作效率和准确性。 EAS 是一个综合性的企业管理软件平台,它集成了各种功能模块,涵盖了企业的各个领域,包括财务、人力资源、采购、销售、供应链等。通过EAS,企业可以实现业务流程的标准化和自动化,提高工作效率,减少人工错误。EAS可以提供全面的数据分析和报表功能,供企业管理者进行决策分析。 BOS 是建立在EAS平台上的具体业务应用系统。通过BOS,企业可以实现各种业务单据的开发和管理。比如,采购订单、销售订单、合同、报价单等。BOS可以根据企业的实际需求,定制各种业务单据,并与其他系统进行数据交互。BOS可以实现单据的自动流转和审批,减少了人工处理的时间和成本。 在进行EASBOS单据开发时,需要考虑企业的实际需求和业务流程。首先,需要对业务流程进行分析,确定需要开发的单据类型和数据字段。然后,可以使用EAS平台自带的开发工具,或者使用其他开发工具进行单据开发。开发过程中,需要进行系统测试和调试,确保单据的准确性和稳定性。 总之,EASBOS单据开发是企业管理的重要组成部分。通过合理的单据开发和管理,可以提高企业的工作效率和管理水平,实现企业的可持续发展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值