1 14 package org.compiere.model; 15 16 import java.sql.ResultSet ; 17 import java.util.Properties ; 18 19 25 public class MSerNoCtl extends X_M_SerNoCtl 26 { 27 32 public MSerNoCtl(Properties ctx, int M_SerNoCtl_ID) 33 { 34 super(ctx, M_SerNoCtl_ID); 35 if (M_SerNoCtl_ID == 0) 36 { 37 setStartNo (1); 39 setCurrentNext (1); 40 setIncrementNo (1); 41 } 43 } 45 50 public MSerNoCtl(Properties ctx, ResultSet rs) 51 { 52 super(ctx, rs); 53 } 55 61 public String createSerNo () 62 { 63 StringBuffer name = new StringBuffer (); 64 if (getPrefix() != null) 65 name.append(getPrefix()); 66 int no = getCurrentNext(); 67 name.append(no); 68 if (getSuffix() != null) 69 name.append(getSuffix()); 70 no += getIncrementNo(); 72 setCurrentNext(no); 73 save(); 74 return name.toString(); 75 } 77 } | Popular Tags |