@Test public void testScroll() throws Exception { POResultSet<MTable> rs = new Query(getCtx(), "AD_Table", "TableName IN (?,?)", getTrxName()) .setParameters(new Object[] {"C_Invoice", "M_InOut"}) .setOrderBy("TableName") .scroll(); try { int i = 0; while (rs.hasNext()) { MTable t = rs.next(); if (i == 0) { assertEquals("Invalid object " + i, "C_Invoice", t.getTableName()); } else if (i == 1) { assertEquals("Invalid object " + i, "M_InOut", t.getTableName()); } else { assertFalse("More objects retrived than expected", true); } i++; } } finally { DB.close(rs); rs = null; } }
@Test public void testFirstOnly() throws Exception { MTable t = new Query(getCtx(), "AD_Table", "AD_Table_ID=?", getTrxName()) .setParameters(new Object[] {318}) .firstOnly(); assertEquals("Invalid table ID", 318, t.get_ID()); }
/** Print result generate for this report */ void print() throws Exception { Language language = Language.getLoginLanguage(); // Base Language MPrintFormat pf = null; int pfid = 0; // get print format for client, else copy system to client RowSet pfrs = MPrintFormat.getAccessiblePrintFormats( MTable.getTable_ID(X_RV_PP_Product_BOMLine_Storage_TableName), -1, null); pfrs.next(); pfid = pfrs.getInt("AD_PrintFormat_ID"); if (pfrs.getInt("AD_Client_ID") != 0) pf = MPrintFormat.get(getCtx(), pfid, false); else pf = MPrintFormat.copyToClient(getCtx(), pfid, getAD_Client_ID()); pfrs.close(); if (pf == null) raiseError("Error: ", "No Print Format"); pf.setLanguage(language); pf.setTranslationLanguage(language); // query MQuery query = new MQuery(X_RV_PP_Product_BOMLine_Storage_TableName); query.addRestriction( X_T_BOMLine.COLUMNNAME_AD_PInstance_ID, MQuery.EQUAL, AD_PInstance_ID, getParamenterName(X_T_BOMLine.COLUMNNAME_AD_PInstance_ID), getParamenterInfo(X_T_BOMLine.COLUMNNAME_AD_PInstance_ID)); query.addRestriction( X_T_BOMLine.COLUMNNAME_M_Warehouse_ID, MQuery.EQUAL, p_M_Warehouse_ID, getParamenterName(X_T_BOMLine.COLUMNNAME_M_Warehouse_ID), getParamenterInfo(X_T_BOMLine.COLUMNNAME_M_Warehouse_ID)); query.addRestriction( X_T_BOMLine.COLUMNNAME_M_Warehouse_ID, MQuery.EQUAL, p_M_Warehouse_ID, getParamenterName("DateTrx"), getParamenterInfo("DateTrx")); PrintInfo info = new PrintInfo( X_RV_PP_Product_BOMLine_Storage_TableName, MTable.getTable_ID(X_RV_PP_Product_BOMLine_Storage_TableName), getRecord_ID()); ReportEngine re = new ReportEngine(getCtx(), pf, query, info); ReportCtl.preview(re); // wait for report window to be closed as t_bomline // records are deleted when process ends while (re.getView().isDisplayable()) { Env.sleep(1); } }
@Test public void testFirst() throws Exception { MTable t = new Query(getCtx(), "AD_Table", "TableName IN (?,?)", getTrxName()) .setParameters(new Object[] {"C_Invoice", "M_InOut"}) .setOrderBy("TableName") .first(); assertEquals("Invalid object", "C_Invoice", t.getTableName()); }
private void createSequence(MTable table, String trxName) { if (!table.isView()) { if (!MSequence.createTableSequence(getCtx(), table.getTableName(), trxName)) { throw new AdempiereException( "Can not create Native Sequence for table " + table.getTableName()); } else { this.addLog("Create Native Sequence for : " + table.getTableName()); } } }
protected void updateHelpWidthPreference(String width) { if (width != null) { Query query = new Query( Env.getCtx(), MTable.get(Env.getCtx(), I_AD_Preference.Table_ID), " Attribute=? AND AD_User_ID=? AND AD_Process_ID IS NULL AND PreferenceFor = 'W'", null); int userId = Env.getAD_User_ID(Env.getCtx()); MPreference preference = query .setOnlyActiveRecords(true) .setApplyAccessFilter(true) .setParameters("HelpController.Width", userId) .first(); if (preference == null || preference.getAD_Preference_ID() <= 0) { preference = new MPreference(Env.getCtx(), 0, null); preference.set_ValueOfColumn("AD_User_ID", userId); // required set_Value for System=0 user preference.setAttribute("HelpController.Width"); } preference.setValue(width); preference.saveEx(); } }
/** * Execute Drill to Query * * @param query query */ private void executeDrill(MQuery query) { int AD_Table_ID = MTable.getTable_ID(query.getTableName()); if (!MRole.getDefault().isCanReport(AD_Table_ID)) { FDialog.error(0, null, "AccessCannotReport", query.getTableName()); return; } if (AD_Table_ID != 0) new WReport(AD_Table_ID, query); } // executeDrill
@Test public void testIterate() throws Exception { final Iterator<MTable> it = new Query(getCtx(), "AD_Table", "TableName IN (?,?)", getTrxName()) .setParameters(new Object[] {"C_Invoice", "M_InOut"}) .setOrderBy("TableName") .iterate(null, false); // guaranteed=false int i = 0; while (it.hasNext()) { MTable t = it.next(); if (i == 0) { assertEquals("Invalid object " + i, "C_Invoice", t.getTableName()); } else if (i == 1) { assertEquals("Invalid object " + i, "M_InOut", t.getTableName()); } else { assertFalse("More objects retrived than expected", true); } i++; } }
@Override public int retrieveTableId(final String tableName) { // NOTE: make sure we are returning -1 in case tableName was not found (and NOT throw // exception), // because there is business logic which depends on this @SuppressWarnings("deprecation") // TODO move getTable_ID out of MTable final int tableId = MTable.getTable_ID(tableName); return tableId; }
public void actionZoom() { int AD_Window_ID = MTable.get(Env.getCtx(), MLocator.Table_ID).getAD_Window_ID(); if (AD_Window_ID <= 0) AD_Window_ID = 139; // hardcoded window Warehouse & Locators log.info(""); // MQuery zoomQuery = new MQuery(); zoomQuery.addRestriction(MLocator.COLUMNNAME_M_Locator_ID, MQuery.EQUAL, getValue()); zoomQuery.setRecordCount(1); // guess AEnv.zoom(AD_Window_ID, zoomQuery); }
@Override public String retrieveTableName(final int adTableId) { final Properties ctx = Env.getCtx(); // guard against 0 AD_Table_ID if (adTableId <= 0) { return null; } @SuppressWarnings("deprecation") final String tableName = MTable.getTableName(ctx, adTableId); return tableName; }
@Override public String retrieveWindowName(final Properties ctx, final String tableName) { // NOTE: atm we use MTable.get because that's the only place where we have the table cached. // In future we shall replace it with something which is database independent. final I_AD_Table adTable = MTable.get(ctx, tableName); if (adTable == null) { return ""; } final I_AD_Window adWindow = adTable.getAD_Window(); if (adWindow == null) { return ""; } final I_AD_Window adWindowTrl = InterfaceWrapperHelper.translate(adWindow, I_AD_Window.class); return adWindowTrl.getName(); }
public org.eevolution.model.I_WM_InOutBound getWM_InOutBound() throws RuntimeException { Class<?> clazz = MTable.getClass(org.eevolution.model.I_WM_InOutBound.Table_Name); org.eevolution.model.I_WM_InOutBound result = null; try { Constructor<?> constructor = null; constructor = clazz.getDeclaredConstructor(new Class[] {Properties.class, int.class, String.class}); result = (org.eevolution.model.I_WM_InOutBound) constructor.newInstance( new Object[] {getCtx(), new Integer(getWM_InOutBound_ID()), get_TrxName()}); } catch (Exception e) { log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); throw new RuntimeException(e); } return result; }
public I_M_Warehouse getM_Warehouse() throws RuntimeException { Class<?> clazz = MTable.getClass(I_M_Warehouse.Table_Name); I_M_Warehouse result = null; try { Constructor<?> constructor = null; constructor = clazz.getDeclaredConstructor(new Class[] {Properties.class, int.class, String.class}); result = (I_M_Warehouse) constructor.newInstance( new Object[] {getCtx(), new Integer(getM_Warehouse_ID()), get_TrxName()}); } catch (Exception e) { log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e); log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz); throw new RuntimeException(e); } return result; }
/** Action - Zoom */ @Override public void actionZoom() { int AD_Window_ID = MTable.get(Env.getCtx(), MLocator.Table_ID).getAD_Window_ID(); if (AD_Window_ID <= 0) AD_Window_ID = 139; // hardcoded window Warehouse & Locators log.info(""); // setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); AWindow frame = new AWindow(); MQuery zoomQuery = new MQuery(); zoomQuery.addRestriction(MLocator.COLUMNNAME_M_Locator_ID, Operator.EQUAL, getValue()); zoomQuery.setRecordCount(1); // guess if (!frame.initWindow(AD_Window_ID, zoomQuery)) return; AEnv.addToWindowManager(frame); AEnv.showCenterScreen(frame); frame = null; setCursor(Cursor.getDefaultCursor()); } // actionZoom
@Override protected String doIt() throws Exception { final ISubscriptionBL subscriptionBL = Services.get(ISubscriptionBL.class); if (getRecord_ID() > 0) { Check.assume( getTable_ID() == MTable.getTable_ID(I_C_OLCand.Table_Name), "Process is called for C_OLCands"); final I_C_OLCand olCand = InterfaceWrapperHelper.create(getCtx(), getRecord_ID(), I_C_OLCand.class, get_TrxName()); subscriptionBL.createTermForOLCand( getCtx(), olCand, getAD_PInstance_ID(), true, get_TrxName()); addLog("@C_OLCand_ID@ " + olCand.getC_OLCand_ID() + " @Processed@"); } else { final int counter = subscriptionBL.createMissingTermsForOLCands( getCtx(), true, getAD_PInstance_ID(), get_TrxName()); addLog("@Processed@ " + counter + " @C_OLCand_ID@"); } return "@Success@"; }
/** * Perform process. * * @return Message * @throws Exception if not successful */ protected String doIt() throws Exception { String where = " Password IS NOT NULL AND Salt IS NULL "; int count = 0; boolean isEncrypted = MColumn.isEncrypted(417); List<MUser> users = MTable.get(getCtx(), MUser.Table_ID).createQuery(where, get_TrxName()).list(); for (MUser user : users) { if (user.getAD_User_ID() == 0) { String password = DB.getSQLValueString( get_TrxName(), "SELECT Password FROM AD_User WHERE AD_User_ID=?", 0); if (isEncrypted) password = SecureEngine.decrypt(password); user.setPassword(password); String sql = "UPDATE AD_User SET Updated=SysDate, UpdatedBy=" + getAD_User_ID(); if (!Util.isEmpty(password)) { sql += ", Password="******", Salt=" + DB.TO_STRING(user.getSalt()); } sql += " WHERE AD_User_ID=0"; DB.executeUpdateEx(sql, get_TrxName()); count++; } else { user.setPassword(user.getPassword()); count++; user.saveEx(); } } return "@Updated@ " + count; } // doIt
public org.compiere.model.I_C_DocType getC_DocType() throws RuntimeException { return (org.compiere.model.I_C_DocType) MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name) .getPO(getC_DocType_ID(), get_TrxName()); }
public org.eevolution.model.I_HR_Payroll getHR_Payroll() throws RuntimeException { return (org.eevolution.model.I_HR_Payroll) MTable.get(getCtx(), org.eevolution.model.I_HR_Payroll.Table_Name) .getPO(getHR_Payroll_ID(), get_TrxName()); }
public org.eevolution.LMX.model.I_LMX_Certificate getLMX_Certificate() throws RuntimeException { return (org.eevolution.LMX.model.I_LMX_Certificate) MTable.get(getCtx(), org.eevolution.LMX.model.I_LMX_Certificate.Table_Name) .getPO(getLMX_Certificate_ID(), get_TrxName()); }
public org.compiere.model.I_AD_Sequence getAD_Sequence() throws RuntimeException { return (org.compiere.model.I_AD_Sequence) MTable.get(getCtx(), org.compiere.model.I_AD_Sequence.Table_Name) .getPO(getAD_Sequence_ID(), get_TrxName()); }
public I_M_Product getM_Product() throws RuntimeException { return (I_M_Product) MTable.get(getCtx(), I_M_Product.Table_Name).getPO(getM_Product_ID(), get_TrxName()); }
public I_M_ChangeNotice getM_ChangeNotice() throws RuntimeException { return (I_M_ChangeNotice) MTable.get(getCtx(), I_M_ChangeNotice.Table_Name) .getPO(getM_ChangeNotice_ID(), get_TrxName()); }
public I_M_AttributeSetInstance getM_AttributeSetInstance() throws RuntimeException { return (I_M_AttributeSetInstance) MTable.get(getCtx(), I_M_AttributeSetInstance.Table_Name) .getPO(getM_AttributeSetInstance_ID(), get_TrxName()); }
/** * Generated Interface for HR_SalaryStructure * * @author Adempiere (generated) * @version Release 3.8.0 */ public interface I_HR_SalaryStructure { /** TableName=HR_SalaryStructure */ public static final String Table_Name = "HR_SalaryStructure"; /** AD_Table_ID=53689 */ public static final int Table_ID = MTable.getTable_ID(Table_Name); KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); /** AccessLevel = 3 - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(3); /** Load Meta Data */ /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; /** Get Client. Client/Tenant for this installation. */ public int getAD_Client_ID(); /** Column name AD_Org_ID */ public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; /** Set Organization. Organizational entity within client */ public void setAD_Org_ID(int AD_Org_ID); /** Get Organization. Organizational entity within client */ public int getAD_Org_ID(); /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; /** Get Created. Date this record was created */ public Timestamp getCreated(); /** Column name CreatedBy */ public static final String COLUMNNAME_CreatedBy = "CreatedBy"; /** Get Created By. User who created this records */ public int getCreatedBy(); /** Column name Description */ public static final String COLUMNNAME_Description = "Description"; /** Set Description. Optional short description of the record */ public void setDescription(String Description); /** Get Description. Optional short description of the record */ public String getDescription(); /** Column name HR_SalaryStructure_ID */ public static final String COLUMNNAME_HR_SalaryStructure_ID = "HR_SalaryStructure_ID"; /** Set Salary Structure. Salary Structure of an Employee */ public void setHR_SalaryStructure_ID(int HR_SalaryStructure_ID); /** Get Salary Structure. Salary Structure of an Employee */ public int getHR_SalaryStructure_ID(); /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; /** Set Active. The record is active in the system */ public void setIsActive(boolean IsActive); /** Get Active. The record is active in the system */ public boolean isActive(); /** Column name Name */ public static final String COLUMNNAME_Name = "Name"; /** Set Name. Alphanumeric identifier of the entity */ public void setName(String Name); /** Get Name. Alphanumeric identifier of the entity */ public String getName(); /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; /** Get Updated. Date this record was updated */ public Timestamp getUpdated(); /** Column name UpdatedBy */ public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; /** Get Updated By. User who updated this records */ public int getUpdatedBy(); /** Column name ValidTo */ public static final String COLUMNNAME_ValidTo = "ValidTo"; /** Set Valid to. Valid to including this date (last day) */ public void setValidTo(Timestamp ValidTo); /** Get Valid to. Valid to including this date (last day) */ public Timestamp getValidTo(); /** Column name Value */ public static final String COLUMNNAME_Value = "Value"; /** Set Search Key. Search key for the record in the format required - must be unique */ public void setValue(String Value); /** Get Search Key. Search key for the record in the format required - must be unique */ public String getValue(); }
/** * Generated Interface for C_AdvComDoc * * @author Adempiere (generated) * @version Release 3.5.4a */ public interface I_C_AdvComDoc { /** TableName=C_AdvComDoc */ public static final String Table_Name = "C_AdvComDoc"; /** AD_Table_ID=540288 */ public static final int Table_ID = MTable.getTable_ID(Table_Name); KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); /** AccessLevel = 1 - Org */ BigDecimal accessLevel = BigDecimal.valueOf(1); /** Load Meta Data */ /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; /** Get Mandant. Mandant für diese Installation. */ public int getAD_Client_ID(); /** Column name AD_Org_ID */ public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; /** Set Organisation. Organisatorische Einheit des Mandanten */ public void setAD_Org_ID(int AD_Org_ID); /** Get Organisation. Organisatorische Einheit des Mandanten */ public int getAD_Org_ID(); /** Column name AD_Table_ID */ public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID"; /** Set DB-Tabelle. Database Table information */ public void setAD_Table_ID(int AD_Table_ID); /** Get DB-Tabelle. Database Table information */ public int getAD_Table_ID(); public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException; /** Column name C_AdvComDoc_ID */ public static final String COLUMNNAME_C_AdvComDoc_ID = "C_AdvComDoc_ID"; /** Set Provisionsauslöser */ public void setC_AdvComDoc_ID(int C_AdvComDoc_ID); /** Get Provisionsauslöser */ public int getC_AdvComDoc_ID(); /** Column name C_AllocationLine_ID */ public static final String COLUMNNAME_C_AllocationLine_ID = "C_AllocationLine_ID"; /** Set Zuordnungs-Position. Zuordnungs-Position */ public void setC_AllocationLine_ID(int C_AllocationLine_ID); /** Get Zuordnungs-Position. Zuordnungs-Position */ public int getC_AllocationLine_ID(); public org.compiere.model.I_C_AllocationLine getC_AllocationLine() throws RuntimeException; /** Column name C_DocType_Ref_ID */ public static final String COLUMNNAME_C_DocType_Ref_ID = "C_DocType_Ref_ID"; /** Set Belegart */ public void setC_DocType_Ref_ID(int C_DocType_Ref_ID); /** Get Belegart */ public int getC_DocType_Ref_ID(); public org.compiere.model.I_C_DocType getC_DocType_Ref() throws RuntimeException; /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; /** Get Erstellt. Datum, an dem dieser Eintrag erstellt wurde */ public Timestamp getCreated(); /** Column name CreatedBy */ public static final String COLUMNNAME_CreatedBy = "CreatedBy"; /** Get Erstellt durch. Nutzer, der diesen Eintrag erstellt hat */ public int getCreatedBy(); /** Column name DateDoc_Ref */ public static final String COLUMNNAME_DateDoc_Ref = "DateDoc_Ref"; /** Set Belegdatum */ public void setDateDoc_Ref(Timestamp DateDoc_Ref); /** Get Belegdatum */ public Timestamp getDateDoc_Ref(); /** Column name DateFact */ public static final String COLUMNNAME_DateFact = "DateFact"; /** Set Valuta-Datum */ public void setDateFact(Timestamp DateFact); /** Get Valuta-Datum */ public Timestamp getDateFact(); /** Column name DateFact_Override */ public static final String COLUMNNAME_DateFact_Override = "DateFact_Override"; /** Set Abw. Valutadatum */ public void setDateFact_Override(Timestamp DateFact_Override); /** Get Abw. Valutadatum */ public Timestamp getDateFact_Override(); /** Column name DocAction */ public static final String COLUMNNAME_DocAction = "DocAction"; /** Set Belegverarbeitung. Der zukünftige Status des Belegs */ public void setDocAction(String DocAction); /** Get Belegverarbeitung. Der zukünftige Status des Belegs */ public String getDocAction(); /** Column name DocStatus */ public static final String COLUMNNAME_DocStatus = "DocStatus"; /** Set Belegstatus. The current status of the document */ public void setDocStatus(String DocStatus); /** Get Belegstatus. The current status of the document */ public String getDocStatus(); /** Column name DocumentNo_Ref */ public static final String COLUMNNAME_DocumentNo_Ref = "DocumentNo_Ref"; /** Set Belegnummer */ public void setDocumentNo_Ref(String DocumentNo_Ref); /** Get Belegnummer */ public String getDocumentNo_Ref(); /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; /** Set Aktiv. Der Eintrag ist im System aktiv */ public void setIsActive(boolean IsActive); /** Get Aktiv. Der Eintrag ist im System aktiv */ public boolean isActive(); /** Column name IsApproved */ public static final String COLUMNNAME_IsApproved = "IsApproved"; /** Set Freigegeben. Zeigt an, ob dieser Beleg eine Freigabe braucht */ public void setIsApproved(boolean IsApproved); /** Get Freigegeben. Zeigt an, ob dieser Beleg eine Freigabe braucht */ public boolean isApproved(); /** Column name IsDateFactOverridable */ public static final String COLUMNNAME_IsDateFactOverridable = "IsDateFactOverridable"; /** Set Valutadatum Änderbar */ public void setIsDateFactOverridable(boolean IsDateFactOverridable); /** Get Valutadatum Änderbar */ public boolean isDateFactOverridable(); /** Column name IsProcessedByComSystem */ public static final String COLUMNNAME_IsProcessedByComSystem = "IsProcessedByComSystem"; /** Set In Buchauszug verbucht. Änderung wurde in den Buchauszug aufgenommen */ public void setIsProcessedByComSystem(boolean IsProcessedByComSystem); /** Get In Buchauszug verbucht. Änderung wurde in den Buchauszug aufgenommen */ public boolean isProcessedByComSystem(); /** Column name Processed */ public static final String COLUMNNAME_Processed = "Processed"; /** Set Verarbeitet. The document has been processed */ public void setProcessed(boolean Processed); /** Get Verarbeitet. The document has been processed */ public boolean isProcessed(); /** Column name Processing */ public static final String COLUMNNAME_Processing = "Processing"; /** Set Process Now */ public void setProcessing(boolean Processing); /** Get Process Now */ public boolean isProcessing(); /** Column name Record_ID */ public static final String COLUMNNAME_Record_ID = "Record_ID"; /** Set Datensatz-ID. Direct internal record ID */ public void setRecord_ID(int Record_ID); /** Get Datensatz-ID. Direct internal record ID */ public int getRecord_ID(); /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; /** Get Aktualisiert. Datum, an dem dieser Eintrag aktualisiert wurde */ public Timestamp getUpdated(); /** Column name UpdatedBy */ public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; /** Get Aktualisiert durch. Nutzer, der diesen Eintrag aktualisiert hat */ public int getUpdatedBy(); }
public org.eevolution.LMX.model.I_LMX_Vendor getLMX_Vendor() throws RuntimeException { return (org.eevolution.LMX.model.I_LMX_Vendor) MTable.get(getCtx(), org.eevolution.LMX.model.I_LMX_Vendor.Table_Name) .getPO(getLMX_Vendor_ID(), get_TrxName()); }
public void startElement(Properties ctx, Element element) throws SAXException { String elementValue = element.getElementValue(); int AD_Backup_ID = -1; String Object_Status = null; Attributes atts = element.attributes; log.info(elementValue + " " + atts.getValue("Name")); String name = atts.getValue("Name"); int id = get_IDWithColumn(ctx, "AD_PrintFormat", "Name", name); X_AD_PrintFormat m_PrintFormat = new X_AD_PrintFormat(ctx, id, getTrxName(ctx)); if (id <= 0 && atts.getValue("AD_PrintFormat_ID") != null && Integer.parseInt(atts.getValue("AD_PrintFormat_ID")) <= PackOut.MAX_OFFICIAL_ID) m_PrintFormat.setAD_PrintFormat_ID(Integer.parseInt(atts.getValue("AD_PrintFormat_ID"))); if (id > 0) { AD_Backup_ID = copyRecord(ctx, "AD_PrintFormat", m_PrintFormat); Object_Status = "Update"; } else { Object_Status = "New"; AD_Backup_ID = 0; } name = atts.getValue("ADReportviewnameID"); if (name != null && name.trim().length() > 0) { id = get_IDWithColumn(ctx, "AD_ReportView", "Name", name); if (id <= 0) { element.defer = true; return; } m_PrintFormat.setAD_ReportView_ID(id); } name = atts.getValue("ADTableNameID"); id = get_IDWithColumn(ctx, "AD_Table", "TableName", name); if (id == 0) { MTable m_Table = new MTable(ctx, 0, getTrxName(ctx)); m_Table.setAccessLevel("3"); m_Table.setName(name); m_Table.setTableName(name); if (m_Table.save(getTrxName(ctx)) == true) { record_log( ctx, 1, m_Table.getName(), "Table", m_Table.get_ID(), 0, "New", "AD_Table", get_IDWithColumn(ctx, "AD_Table", "TableName", "AD_Table")); } else { record_log( ctx, 0, m_Table.getName(), "Table", m_Table.get_ID(), 0, "New", "AD_Table", get_IDWithColumn(ctx, "AD_Table", "TableName", "AD_Table")); } id = get_IDWithColumn(ctx, "AD_Table", "TableName", name); } m_PrintFormat.setAD_Table_ID(id); name = atts.getValue("ADPrintTableFormatID"); if (name != null && name.trim().length() > 0) { id = get_IDWithColumn(ctx, "AD_PrintTableFormat", "Name", name); if (id <= 0) { element.defer = true; return; } m_PrintFormat.setAD_PrintTableFormat_ID(id); } name = atts.getValue("ADPrintColorID"); if (name != null && name.trim().length() > 0) { id = get_IDWithColumn(ctx, "AD_PrintColor", "Name", name); if (id <= 0) { element.defer = true; return; } m_PrintFormat.setAD_PrintColor_ID(id); } name = atts.getValue("ADPrintFontID"); if (name != null && name.trim().length() > 0) { id = get_IDWithColumn(ctx, "AD_PrintFont", "Name", name); if (id <= 0) { element.defer = true; return; } m_PrintFormat.setAD_PrintFont_ID(id); } name = atts.getValue("ADPrintPaperID"); if (name != null && name.trim().length() > 0) { id = get_IDWithColumn(ctx, "AD_PrintPaper", "Name", name); if (id <= 0) { element.defer = true; return; } m_PrintFormat.setAD_PrintPaper_ID(id); } m_PrintFormat.setDescription(getStringValue(atts, "Description")); m_PrintFormat.setName(atts.getValue("Name")); m_PrintFormat.setPrinterName(getStringValue(atts, "PrinterName")); m_PrintFormat.setFooterMargin(Integer.parseInt(atts.getValue("FooterMargin"))); m_PrintFormat.setHeaderMargin(Integer.parseInt(atts.getValue("HeaderMargin"))); m_PrintFormat.setCreateCopy(atts.getValue("CreateCopy")); m_PrintFormat.setIsActive( atts.getValue("isActive") != null ? Boolean.valueOf(atts.getValue("isActive")).booleanValue() : true); m_PrintFormat.setIsTableBased(Boolean.valueOf(atts.getValue("isTableBased")).booleanValue()); m_PrintFormat.setIsForm(Boolean.valueOf(atts.getValue("isForm")).booleanValue()); m_PrintFormat.setIsStandardHeaderFooter( Boolean.valueOf(atts.getValue("isStandardHeader")).booleanValue()); m_PrintFormat.setIsDefault(Boolean.valueOf(atts.getValue("isDefault")).booleanValue()); if (m_PrintFormat.save(getTrxName(ctx)) == true) { record_log( ctx, 1, m_PrintFormat.getName(), "PrintFormat", m_PrintFormat.get_ID(), AD_Backup_ID, Object_Status, "AD_PrintFormat", get_IDWithColumn(ctx, "AD_Table", "TableName", "AD_PrintFormat")); element.recordId = m_PrintFormat.getAD_PrintFormat_ID(); } else { record_log( ctx, 0, m_PrintFormat.getName(), "PrintFormat", m_PrintFormat.get_ID(), AD_Backup_ID, Object_Status, "AD_PrintFormat", get_IDWithColumn(ctx, "AD_Table", "TableName", "AD_PrintFormat")); throw new POSaveFailedException("Failed to save Print Format"); } }
/** * Generated Interface for HR_Concept * * @author Adempiere (generated) * @version Release 3.6.0LTS */ public interface I_HR_Concept { /** TableName=HR_Concept */ public static final String Table_Name = "HR_Concept"; /** AD_Table_ID=53090 */ public static final int Table_ID = MTable.getTable_ID(Table_Name); KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); /** AccessLevel = 7 - System - Client - Org */ BigDecimal accessLevel = BigDecimal.valueOf(7); /** Load Meta Data */ /** Column name AD_Client_ID */ public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID"; /** Get Client. Client/Tenant for this installation. */ public int getAD_Client_ID(); /** Column name AD_Org_ID */ public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; /** Set Organization. Organizational entity within client */ public void setAD_Org_ID(int AD_Org_ID); /** Get Organization. Organizational entity within client */ public int getAD_Org_ID(); /** Column name AD_Reference_ID */ public static final String COLUMNNAME_AD_Reference_ID = "AD_Reference_ID"; /** Set Reference. System Reference and Validation */ public void setAD_Reference_ID(int AD_Reference_ID); /** Get Reference. System Reference and Validation */ public int getAD_Reference_ID(); public org.compiere.model.I_AD_Reference getAD_Reference() throws RuntimeException; /** Column name AccountSign */ public static final String COLUMNNAME_AccountSign = "AccountSign"; /** Set Account Sign. Indicates the Natural Sign of the Account as a Debit or Credit */ public void setAccountSign(String AccountSign); /** Get Account Sign. Indicates the Natural Sign of the Account as a Debit or Credit */ public String getAccountSign(); /** Column name ColumnType */ public static final String COLUMNNAME_ColumnType = "ColumnType"; /** Set Column Type */ public void setColumnType(String ColumnType); /** Get Column Type */ public String getColumnType(); /** Column name Created */ public static final String COLUMNNAME_Created = "Created"; /** Get Created. Date this record was created */ public Timestamp getCreated(); /** Column name CreatedBy */ public static final String COLUMNNAME_CreatedBy = "CreatedBy"; /** Get Created By. User who created this records */ public int getCreatedBy(); /** Column name Description */ public static final String COLUMNNAME_Description = "Description"; /** Set Description. Optional short description of the record */ public void setDescription(String Description); /** Get Description. Optional short description of the record */ public String getDescription(); /** Column name HR_Concept_Category_ID */ public static final String COLUMNNAME_HR_Concept_Category_ID = "HR_Concept_Category_ID"; /** Set Payroll Concept Category */ public void setHR_Concept_Category_ID(int HR_Concept_Category_ID); /** Get Payroll Concept Category */ public int getHR_Concept_Category_ID(); public org.eevolution.model.I_HR_Concept_Category getHR_Concept_Category() throws RuntimeException; /** Column name HR_Concept_ID */ public static final String COLUMNNAME_HR_Concept_ID = "HR_Concept_ID"; /** Set Payroll Concept */ public void setHR_Concept_ID(int HR_Concept_ID); /** Get Payroll Concept */ public int getHR_Concept_ID(); /** Column name HR_Department_ID */ public static final String COLUMNNAME_HR_Department_ID = "HR_Department_ID"; /** Set Payroll Department */ public void setHR_Department_ID(int HR_Department_ID); /** Get Payroll Department */ public int getHR_Department_ID(); public org.eevolution.model.I_HR_Department getHR_Department() throws RuntimeException; /** Column name HR_Job_ID */ public static final String COLUMNNAME_HR_Job_ID = "HR_Job_ID"; /** Set Payroll Job */ public void setHR_Job_ID(int HR_Job_ID); /** Get Payroll Job */ public int getHR_Job_ID(); public org.eevolution.model.I_HR_Job getHR_Job() throws RuntimeException; /** Column name HR_Payroll_ID */ public static final String COLUMNNAME_HR_Payroll_ID = "HR_Payroll_ID"; /** Set Payroll */ public void setHR_Payroll_ID(int HR_Payroll_ID); /** Get Payroll */ public int getHR_Payroll_ID(); public org.eevolution.model.I_HR_Payroll getHR_Payroll() throws RuntimeException; /** Column name IsActive */ public static final String COLUMNNAME_IsActive = "IsActive"; /** Set Active. The record is active in the system */ public void setIsActive(boolean IsActive); /** Get Active. The record is active in the system */ public boolean isActive(); /** Column name IsDefault */ public static final String COLUMNNAME_IsDefault = "IsDefault"; /** Set Default. Default value */ public void setIsDefault(boolean IsDefault); /** Get Default. Default value */ public boolean isDefault(); /** Column name IsEmployee */ public static final String COLUMNNAME_IsEmployee = "IsEmployee"; /** Set Employee. Indicates if this Business Partner is an employee */ public void setIsEmployee(boolean IsEmployee); /** Get Employee. Indicates if this Business Partner is an employee */ public boolean isEmployee(); /** Column name IsManual */ public static final String COLUMNNAME_IsManual = "IsManual"; /** Set Manual. This is a manual process */ public void setIsManual(boolean IsManual); /** Get Manual. This is a manual process */ public boolean isManual(); /** Column name IsPaid */ public static final String COLUMNNAME_IsPaid = "IsPaid"; /** Set Paid. The document is paid */ public void setIsPaid(boolean IsPaid); /** Get Paid. The document is paid */ public boolean isPaid(); /** Column name IsPrinted */ public static final String COLUMNNAME_IsPrinted = "IsPrinted"; /** Set Printed. Indicates if this document / line is printed */ public void setIsPrinted(boolean IsPrinted); /** Get Printed. Indicates if this document / line is printed */ public boolean isPrinted(); /** Column name IsReceipt */ public static final String COLUMNNAME_IsReceipt = "IsReceipt"; /** Set Receipt. This is a sales transaction (receipt) */ public void setIsReceipt(boolean IsReceipt); /** Get Receipt. This is a sales transaction (receipt) */ public boolean isReceipt(); /** Column name IsSaveInHistoric */ public static final String COLUMNNAME_IsSaveInHistoric = "IsSaveInHistoric"; /** Set Save In Historic */ public void setIsSaveInHistoric(boolean IsSaveInHistoric); /** Get Save In Historic */ public boolean isSaveInHistoric(); /** Column name Name */ public static final String COLUMNNAME_Name = "Name"; /** Set Name. Alphanumeric identifier of the entity */ public void setName(String Name); /** Get Name. Alphanumeric identifier of the entity */ public String getName(); /** Column name SeqNo */ public static final String COLUMNNAME_SeqNo = "SeqNo"; /** Set Sequence. Method of ordering records; lowest number comes first */ public void setSeqNo(int SeqNo); /** Get Sequence. Method of ordering records; lowest number comes first */ public int getSeqNo(); /** Column name Type */ public static final String COLUMNNAME_Type = "Type"; /** Set Type. Type of Validation (SQL, Java Script, Java Language) */ public void setType(String Type); /** Get Type. Type of Validation (SQL, Java Script, Java Language) */ public String getType(); /** Column name Updated */ public static final String COLUMNNAME_Updated = "Updated"; /** Get Updated. Date this record was updated */ public Timestamp getUpdated(); /** Column name UpdatedBy */ public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; /** Get Updated By. User who updated this records */ public int getUpdatedBy(); /** Column name ValidFrom */ public static final String COLUMNNAME_ValidFrom = "ValidFrom"; /** Set Valid from. Valid from including this date (first day) */ public void setValidFrom(Timestamp ValidFrom); /** Get Valid from. Valid from including this date (first day) */ public Timestamp getValidFrom(); /** Column name ValidTo */ public static final String COLUMNNAME_ValidTo = "ValidTo"; /** Set Valid to. Valid to including this date (last day) */ public void setValidTo(Timestamp ValidTo); /** Get Valid to. Valid to including this date (last day) */ public Timestamp getValidTo(); /** Column name Value */ public static final String COLUMNNAME_Value = "Value"; /** Set Search Key. Search key for the record in the format required - must be unique */ public void setValue(String Value); /** Get Search Key. Search key for the record in the format required - must be unique */ public String getValue(); }
public I_C_UOM getC_UOM() throws RuntimeException { return (I_C_UOM) MTable.get(getCtx(), I_C_UOM.Table_Name).getPO(getC_UOM_ID(), get_TrxName()); }