|
|
@@ -55,7 +55,7 @@ public class ficashbill extends PaoCust {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- setValue("FUNWRITEOFFAMOUNT",getDouble("FAMOUNT")-getDouble("FWRITEOFFAMOUNT"),11l);
|
|
|
+ setValue("FUNWRITEOFFAMOUNT", getDouble("FAMOUNT") - getDouble("FWRITEOFFAMOUNT"), 11l);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -526,4 +526,26 @@ public class ficashbill extends PaoCust {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void writeoffValidate() throws P2Exception {
|
|
|
+ if (!"审核".equals(getString("fstatus"))) {
|
|
|
+ throw new P2AppException("", "非审核状态不可进行核销操作");
|
|
|
+ }
|
|
|
+ if (!"收入".equals(getString("ftype"))) {
|
|
|
+ throw new P2AppException("", "非收入凭证不可进行核销操作");
|
|
|
+ }
|
|
|
+ if (getDouble("funwriteoffamount") == 0) {
|
|
|
+ throw new P2AppException("", "未核销金额为0!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public long writeoff() throws P2Exception {
|
|
|
+ PaoSetRemote twriteoffbillSet = getPaoSet("twriteoffbill");
|
|
|
+ twriteoffbillSet.setApp("WRITEOFF");
|
|
|
+ PaoRemote pao = twriteoffbillSet.addAtEnd();
|
|
|
+ pao.setValue("fdate", getDate());
|
|
|
+ pao.setValue("fagentnum", getString("fagentnum"));
|
|
|
+ pao.setValue("ficashbillnum", getString("fbillnum"));
|
|
|
+ return pao.getUniqueIDValue();
|
|
|
+ }
|
|
|
}
|