====== Materialstamm History ====== My first productive task by W & G for [[efc ERP]]. * Implement the History functionality for "Materialstamm" in [[efc ERP]] (Klaus: Anzeige einer Änderungshistorie für MATBAS, MATSAL, MATPUR, MATFIN (diese HIST-Repositories gibt es schon)) * ***** MATBAS (Materialbasisdaten) * the solution already exists => I can copy it for others * **-** MATSAL (Materialvertriebsdaten) * is the repository existing? * **-** MATPUR (Einkaufsdaten) * is the repository existing? * **-** MATFIN (Finanzdaten) * is the repository existing? * This functionality exists now for : * Materialstamm "Historie Basisdaten" (can I can "copy" it from there?) * "Vertrieb / Aufträge" (can I "copy" it from there?) ===== Materialstamm ===== At the moment Materialstamm contains the History functionality for "Materialstamm Basisdaten". * Business Object: ''app.mat.BoMat'' contained in ''appBoMat.efcbl'' * ''MdMatBas'' contained in ''mat.efcbl'' * The layout is contained in ''efc_client_java\efc_runner\src\resources\forms\mat\BoMat.xml'' ===== Materialstammbasisdaten (MatBas) ===== * Database tables: * EFC_MATBAS * EFC_MATBAS_HIST * Repository * ''SoLiMatBasHistRepository'' declared in ''appSstMat.efcbl'' * The implementation is in ''SoLiMatBasHistRepositoryImpl'' * Service * ''SvSoMatHist'' declared in ''appSstMat.efcbl'' * contains * ''SoLiMatBasRepository'' * ''SoLiMatBasHistRepository'' * method ''getDcMatBasHist'' ===== Vertriebsdaten (MatSal) ===== ==== Code ==== * Database tables: * EFC_MATSAL * EFC_MATSAL_HIST * efcbl * ''/efc_server/src/efcbl/sst/appSstMat.efcbl'' * Data structures * ''ValueObject SoLiMatSal'' * Listenelement für verdichtete Vertriebs-Stammdaten * ''ValueObject SoLiMatSalHist'' * ''extends SoLiMatSal'' * Listenelement Material-Vertriebsdaten * Anzeige von Daten aus HIST-Tabelle. * ''ValueObject DcMatSalHist'' (added by me) * Data container(?) for the history view(window?) * ''SfDcMatSalHist'' (added by me) * SuBdata-frame to show ''DcMatSalHist'' * ''/efc_runner/src/resources/forms/mat/DcMatSalHist.xml'' * XML description to show table with ''DcMatSalHist'' object ==== ToDo ==== * Service ''SvSoMatHist'' should contain all necessary Repositories and methods for history implementation * **-** add repositories to ''Service SvSoMatHist'' in ''appSstMat.efcbl'' * **+** ''SoLiMatSalRepository'' * **+** ''SoLiMatSalHistRepository'' * **-** add methods * add the menu point * Menus for "Materialstamm" window are declared in ''FrBoMat.groovy'' private EFCAdditionalAction aaInfoMatSalHist //... initialize the action aaInfoMatSalHist = new EFCAdditionalAction(tr("AA_MAT_INFOMATSALHIST"), "aaInfoMatSalHist", tr("AA_MAT_INFOMATSALHIST_DESC")) //... add action to the menu viewManager.addToMenuInfo(tr("AM_MAT_HISTINFO"), (ArrayList) [aaInfoMatBasHist, aaInfoMatSalHist]) //... do something if the action was selected public void handleAction(String ident, Object param) { //... switch (ident.toString()) { //... case aaInfoMatSalHist.getIdent(): // do something... (at the moment it is the copy from aaInfoMatBasHist) setSysParamBaseKey() openChildWindow(SfDcMatBasHist.class) break //... * **-** translate wordings -> should be done by Klaus ===== Einkaufsdaten (MatPur) ===== ==== Code ==== * Database tables: * EFC_MATPUR * EFC_MATPUR_HIST * efcbl * ''/efc_server/src/efcbl/sst/appSstMat.efcbl'' * Data structures * data structures are declared in * ''appBoMat.efcbl'' -> data structures for material data objects * ''sst/appSstMat.efcbl'' -> material history data structures and data containers for UI * ''ValueObject SoLiMatPur'' * Listenelement Material-Einkaufsdaten * ''ValueObject SoLiMatPurHist'' * ''extends SoLiMatPur'' * Listenelement Material-Einkaufsdaten * Anzeige von Daten aus HIST-Tabelle. * ''ValueObject DcMatPurHist'' (added by me) * Data container(?) for the history view(window?) * ''SfDcMatPurHist'' (added by me) * SuBdata-frame to show ''DcMatPurHist'' * ''/efc_runner/src/resources/forms/mat/DcMatPurHist.xml'' * XML description to show table with ''DcMatPurHist'' object ===== Finanzdaten (MatFin) ===== * Database tables: * EFC_MATFIN * EFC_MATFIN_HIST ---- ===== Samples ===== ==== Vertrieb/Aufträge ==== Sample data containing history: * Belegnr.: 00189448 (Belegart: AB, Belegnr.: 00189448, Kunde: 5010000) Here is described how this functionality is implemented for "Vertrieb/Aufträge": * SoLiDocHist * **-** Data objects (in ''appSstDoc.efcbl'') * ''ValueObject DcDocHistForQty'' -> ''ValueObject DcMatSalHist'' * contains: * key fields * company * docKey * docNum * ''List<#DcLiDocItemHistForQty> qtydocitemList'' * ''ValueObject DcLiDocItemHistForQty'' -> at the moment ''SoLiMatSalHist'' (maybe I should create a new data container explicitely used for displaying) * is a data container object representing one position in the LEFT table "aktuelle Positionen" * contains: * position key fields * dockey * docnum * docitem * docitemkey * ... * ''ref List<#DcLiQtyHist> qtyhistList;'' * ''ValueObject DcLiQtyHist'' -> ''...'' * is a data container representing one item in the RIGHT table "Änderungshistorie Positionen" * contains: * quantity * createdBy * createdAt * editedBy * editedAt * **-** Important methods * ''SoLiDocItemHistRepositoryImpl.getListDocItemHistForDocObj()'' -> ''SoLiMatSalHistRepositoryImpl.getListMatSalHistForMatObj()'' * fetches the complete history for DocObj * this means the history of all positions * **-** Database * DB table: [EFCOZ].[dbo].[EFC_DOCITEM_HIST] * **-** Service * ''SvSoDocHist'' is declared in ''appSstDoc.efcbl'' * The implementation is in ''SvSoDocHistImpl'' * **-** Repository ==== Materialstammdaten ==== * Sample data containing history: * Mat.-Nr.: 110.2207.20 * At the moment it is important to have the proper "Mat.-Status" (NOT 'X', but '*'!) ==== Vertrieb/Lieferscheine ==== * Sample data containing history: * Belegnummer: 00252275 * the functionality can be seen at "Vertrieb / Lieferscheine" * choose "Positionen" tab, then select menu "Info / Historie / Historie Mengenänderung" * fetching data for compare can be viewed at: ''SvSoDocHistImpl.getDcDocHistForQty()'' ===== Misc ===== ==== ''@CompileStatic'' in ''SvSoMatHistImpl'' ==== * After adding of ''@CompileStatic'' to ''SvSoMatHistImpl'' the line 33 in ''SvSoMatHistImpl'' does not work any more: matHist.matbashistList = soLiMatBasHistRepository.getListMatBasHistForMat(company, matnum) * the cause is the method delivers ''EFCList'' instead of ''EFCList'' * to fix it: copy the objects