package nc.ui.pu.m25.action;

import nc.ui.pubapp.uif2app.actions.CopyAction;
import nc.vo.pu.m25.entity.InvoiceItemVO;
import nc.vo.pu.m25.entity.InvoiceVO;

public class InvoiceCopyAction extends CopyAction {
	private static final long serialVersionUID = 5294690646619221536L;
	
	/**
	 * 有发票参照的单据不允许复制
	 */
	@Override
	protected boolean isActionEnable() {
		boolean isEnable = super.isActionEnable();
		if (isEnable) {
			InvoiceVO vo = (InvoiceVO) this.getModel().getSelectedData();
			InvoiceItemVO[] invoiceItemVO = vo.getChildrenVO();
			if(invoiceItemVO != null) {
				for (int i = 0; i < invoiceItemVO.length; i++) {
					
					if(invoiceItemVO[i].getVbdef20() != null) {
						isEnable = false;
					}
				}
			}
		}
		return isEnable;
	}
}