Table of Contents
Kommissionierungsläufe Anbieten
Auf dem mobilen Client sollen abhängig von dem jeweiligen Mitarbeiter bei der Kommissionierung nur die Kommissionierungsläufe angeboten werden, die der Mitarbeiter machen darf.
Client mobile should offer only such “Kommissionierläufe” which are relevant for current user. But manually entry should be also possible (the current functionality should exist as previously).
Implementierung
Add a new method to the service which should call the XCI-Event.
The method name is getListDcLiDocCooForPostingOpenXCI
This method is called in SvDcInvPostingEditImpl.getTraCooFrom(). There we check if the mask do not have any text in the field dcInvPosting.cooinput. If the field has no input, the fetch only such “Kommissionierungsbelege”, that the current user may see. (But this means also he is free to entry the numbers in the field.)
In the SvDcInvPostingEditImpl.getListDcLiDocCooForPostingOpenXCI() method we simply delegate the functionality to an XCI-Event:
svXci.executeCodeWithCache("SvDcInvPostingEdit", "getListDcLiDocCooForPostingOpenXCI", [context : this, company : company, dcLiDocCooForPostingList: ret])))
So the real functionality is programmed in the XCI-Event : SvDcInvPostingEdit.getListDcLiDocCooForPostingOpenXCI
The following places are affected:
- appBoInv.efcbl
- declare the new method
getListDcLiDocCooForPostingOpenXCI(String company)in the serviceSvDcInvPostingEdit
- appSstDoc.efcbl
- declare the new method
getListDocForCooForPersnum(String company, String persnum)in the repositorySoLiDocForCooRepository
- SvDcInvPostingEditImpl.groovy
- the new method
public EFCList<DcLiDocCooForPosting> getListDcLiDocCooForPostingOpenXCI(EFCString company)will be generated → implement it. It should call our XCI event - change some details in the method
getTraCooFrom()- it should now call our new method
getListDcLiDocCooForPostingOpenXCI()
- SoLiDocForCooRepositoryImpl.groovy
- implement method
getListDocForCooForPersnum()here
XCI-Event
Hier werden die offenen und ungelöschten SoLiDocForCoo Einträge geholt.
Gefiltert nach Personalnummer.
To see the XCI-Event implementation start the Java-Client and open “System / XCI-Events”. Then search for getListDcLiDocCooForPostingOpenXCI.
This is the current version from 16.02.2023 (edited by Klaus):
import de.effectivecompany.app.sst.SoLiDocForCoo
import de.effectivecompany.app.inv.DcLiDocCooForPosting
import de.effectivecompany.base.datatypes.EFCList
import de.effectivecompany.base.datatypes.EFCString
import de.effectivecompany.util.StringTools
String helptext
DcLiDocCooForPosting dcDoc
EFCList<SoLiDocForCoo> boList
EFCString persNum
// BEGIN get persNum of current user
persNum = context.svSysUser.getMdSysUsrBas()?.getPersnum()?.getPersnum()
// END
if (persNum?.data) {
boList = context.soLiDocForCooRepository.getListDocForCooForPersnum(company, persNum)
boList.each { SoLiDocForCoo soLiDoc ->
dcDoc = new DcLiDocCooForPosting()
dcDoc.map(soLiDoc)
helptext = soLiDoc.dockey.data + soLiDoc.docnum.data + " - " + soLiDoc.info_bupmatchcode
if (soLiDoc.v_stextfromdocdet.data) {
helptext = helptext + " - " + soLiDoc.v_stextfromdocdet.data
}
helptext = StringTools.left(helptext, 40)
dcDoc.setStext(helptext)
dcDoc.setCoo_docsubitem(0) // keine Unterteilung KL
if (soLiDoc.v_refdocitemfromdocdet.data) {
dcDoc.setCoo_docsubitem(soLiDoc.v_refdocitemfromdocdet)
}
dcLiDocCooForPostingList.add(dcDoc)
}
}
return dcLiDocCooForPostingList
Backup: A copy of it I've saved in the method XciEventEditorHelper.getListDcLiDocCooForPostingOpenXCI() (in ther project xci_events). I saved the copy because the editor of Eclipse is more convenient to edit groovy (Code completion etc.).
Tests
Test data
Lokal: Use data record for 00075183
Zimmermann: Use data record for 00100583
Tests to do
- The user should receive only such entries, which are configured for him
- User 'vk' should receive only 2 entries:
KL00075183 - schmettau - BlaKL00075183 - schmettau - etwasneues
- If the user enter some data in the field
Kommission, the system should deliver all entries which contains the entered data
- The user 'tz' should receive nothing
Misc
Beispiel SoLiDocRepository verwenden (aus dem XCI-Event SvBoDoc.save()):
SoLiDocRepository soLiDocRepository = SpringHelper.getService(SoLiDocRepository) ... ex = new DBV_sst_docEx() ex.createCriteria() .andCompanyEqualTo(boDoc.company.company.data) .andExtpcknumEqualTo(docItem.stext.data) .andDoctypeBetween(OptionTools.DOCTYPE_SAL_DLN_MIN, OptionTools.DOCTYPE_SAL_DLN_MAX) .andIsdeletedEqualTo(false) dlnList = soLiDocRepository.getListDocByExample(ex)
SoLiDocRepository soLiDocRepository = SpringHelper.getService(SoLiDocRepository)
DocDetType für Kommissionierung Belegdetails: OpDocdettypeType.INV_COOSUBITEM
