Bug 447224

Summary: Import Filter creates output file but does not import it. Manually importing created file works fine.
Product: [Applications] kmymoney Reporter: AgentX_NZ <marten.nz>
Component: importerAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 5.1.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: Powershell script before being compiled.
Powershell script as an executable

Description AgentX_NZ 2021-12-19 11:27:46 UTC
Created attachment 144674 [details]
Powershell script before being compiled.

SUMMARY
***
When importing banks OFX file, it causes kMyMoney to close. To difficult to diagnose so chose to import QIF format instead. Unfortunately banks qif has Payees as Memos so an import filter was required to change M to P. 

Initially thought Import Filter parsed the file as an argument to the filter application but learnt the contents were actually piped in.  Being on Windows platform prefer to use Powershell and compile to executable. 
Script tests fine and works in KMM, KMM waits for script to finish however no transactions are imported on completion.
The stdin is receiveived, processed and saved to output file. KMM is not picking up the file after the filter.

I read the documentation multiple times and tried the source code but it was above my head. 
I also tried writing to stdout instead of a file. No file and still no transaction.
What is KMM expecting if not the file created in the import filter?

***
STEPS TO REPRODUCE
1. Create powershell app to receive stdin and output new file
   Compile script to exe. (used PS2EXE)
3. Create Filter Profile
   Set "Input filter location" to path/myFilter.exe
   Set "Output filter location to same path and file outputted by powershell script
5. File >> Import QIF using created filter profile.

OBSERVED RESULT
Import filter invoked, qif contents pushed to executable, output.qif file created with corrections applied
Import waits for executable to finish then reports No transactions imported.
"Output.qif" file remains intact and can be manually imported without issue.

EXPECTED RESULT
After selecting qif file to import, expect script to write to stdout or file and for KMM to import the newly created file.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 AgentX_NZ 2021-12-19 11:30:21 UTC
Created attachment 144675 [details]
Powershell script as an executable