|
@@ -1,11 +1,38 @@
|
|
|
package twriteoffbill;
|
|
package twriteoffbill;
|
|
|
|
|
|
|
|
|
|
+import java.util.Calendar;
|
|
|
|
|
+import baseclass.PaoCust;
|
|
|
import baseclass.AppBeanCust;
|
|
import baseclass.AppBeanCust;
|
|
|
import p2.util.P2Exception;
|
|
import p2.util.P2Exception;
|
|
|
|
|
+import p2.webclient.system.beans.DataBean;
|
|
|
import tsafeqtyadj.tsafeqtyadj;
|
|
import tsafeqtyadj.tsafeqtyadj;
|
|
|
|
|
|
|
|
public class twriteoffbillAppBean extends AppBeanCust {
|
|
public class twriteoffbillAppBean extends AppBeanCust {
|
|
|
|
|
+ @Override
|
|
|
|
|
+public void initializeApp() throws P2Exception {
|
|
|
|
|
+ if (!(this.app.inAppLinkMode())) {
|
|
|
|
|
+ DataBean databean = this.app.getGridBean();
|
|
|
|
|
+ if (getPao() == null) {
|
|
|
|
|
+ super.initializeApp();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (getPao().getThisPaoSet().getApp() == null) {
|
|
|
|
|
+ super.initializeApp();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String appname = getPao().getThisPaoSet().getApp();
|
|
|
|
|
+ String hrid = getPao().getUserName();
|
|
|
|
|
+ String salenum = ((PaoCust) getPao()).getSalenumByHrid(getPao().getUserName());
|
|
|
|
|
+ if("WRITEOFF".equalsIgnoreCase(appname) && salenum!=null && salenum.equals("ÏúÊÛÖúÀí")){
|
|
|
|
|
+ databean.setAppWhere("fagentnum in (select fagentnum from tagents where siteid='HY' and fsalenum='"+hrid+"') and siteid ='HY'");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ int year = Calendar.getInstance().get(Calendar.YEAR);
|
|
|
|
|
+ databean.setDefaultQbe("createdate", ">=" + (year - 1) + "-01-01");
|
|
|
|
|
+ databean.reset();
|
|
|
|
|
+ super.initializeApp();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
@Override
|
|
@Override
|
|
|
public int CHECK() throws P2Exception {
|
|
public int CHECK() throws P2Exception {
|
|
|
this.SAVE();
|
|
this.SAVE();
|