I just a wrote a tiny script to help me preview a letter content. I'm not sure if it should go in Koha sources but I don't know where to put it and I think it may help other people
Created attachment 98448 [details] [review] Bug 24591: Add developer script to preview a letter The script is very simple, it just calls GetPreparedLetter with arguments given on command line and print the resulting letter content Usage example: misc/devel/get-prepared-letter.pl --module circulation \ --letter_code ODUE --tables '{"borrowers":1,"branches":"CPL"}' \ --repeat '{"item":[{"biblio":1,"items":1}]}' \ --loops '{"overdues":[1]}'
Hi, could you add a copyright message?
Created attachment 101389 [details] [review] Bug 24591: Add developer script to preview a letter The script is very simple, it just calls GetPreparedLetter with arguments given on command line and print the resulting letter content Usage example: misc/devel/get-prepared-letter.pl --module circulation \ --letter_code ODUE --tables '{"borrowers":1,"branches":"CPL"}' \ --repeat '{"item":[{"biblio":1,"items":1}]}' \ --loops '{"overdues":[1]}'
(In reply to Bernardo Gonzalez Kriegel from comment #2) > Hi, could you add a copyright message? Done ;)
Created attachment 101390 [details] [review] Bug 24591: Add developer script to preview a letter The script is very simple, it just calls GetPreparedLetter with arguments given on command line and print the resulting letter content Usage example: misc/devel/get-prepared-letter.pl --module circulation \ --letter_code ODUE --tables '{"borrowers":1,"branches":"CPL"}' \ --repeat '{"item":[{"biblio":1,"items":1}]}' \ --loops '{"overdues":[1]}' Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Works for the example and other cases. Correct option is 'letter-code', with dash, not underscore. An usage message would be nice. No errors
Julian, please add usage (Pod::Usage) and perltidy the script.
Created attachment 102685 [details] [review] Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl Also fix code style with perltidy
Created attachment 107935 [details] [review] Bug 24591: Add developer script to preview a letter The script is very simple, it just calls GetPreparedLetter with arguments given on command line and print the resulting letter content Usage example: misc/devel/get-prepared-letter.pl --module circulation \ --letter_code ODUE --tables '{"borrowers":1,"branches":"CPL"}' \ --repeat '{"item":[{"biblio":1,"items":1}]}' \ --loops '{"overdues":[1]}' Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Works for the example and other cases. Correct option is 'letter-code', with dash, not underscore. An usage message would be nice. No errors Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 107936 [details] [review] Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl Also fix code style with perltidy Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 107942 [details] [review] Bug 24591: Add developer script to preview a letter The script is very simple, it just calls GetPreparedLetter with arguments given on command line and print the resulting letter content Usage example: misc/devel/get-prepared-letter.pl --module circulation \ --letter_code ODUE --tables '{"borrowers":1,"branches":"CPL"}' \ --repeat '{"item":[{"biblio":1,"items":1}]}' \ --loops '{"overdues":[1]}' Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Works for the example and other cases. Correct option is 'letter-code', with dash, not underscore. An usage message would be nice. No errors Signed-off-by: Nick Clemens <nick@bywatersolutions.com> JD amended patch: tidy the new file and rename it matching the other scripts' names in this directory
Created attachment 107943 [details] [review] Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl Also fix code style with perltidy Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 20.11, thanks to everybody involved!
small and very. useful enhancement, choosing to backport backported to 20.05.x for 20.05.03
enhancement, not backported to 19.11.x