Description
Ivan Dziuba
2020-09-01 14:20:58 UTC
Created attachment 109441 [details] [review] Bug 26340: Printing labels without zero(s) in the start of labels Created attachment 109442 [details] [review] Bug 26340: Printing labels without zero(s) in the start of labels TO TEST: 1. Go Tools > Label creator 2. Click +New -> Barcode range 3. Print barcode range with zero(s) in the start (Ex. from 00011881 to 00012000 ) 4. Select a template to be applied:: Code à barre 48467 Select a layout to be applied: Code à barres 5. Export 6. Open PDF The prefix is not displayed. We should see 00011881 on the labels, but we see 11881, 11882, ... without zeros in the start of labels. This patch fix it. Created attachment 111190 [details] [review] Bug 26340: Printing labels without zero(s) in the start of labels Signed-off-by: David Nind <david@davidnind.com> Hi Ivan, I think this might be your first patch for Koha, so some hints about bugzilla and our tools: 1) Please make sure you set yourself as "Assignee" once you plan on submitting a patch to a bug. 2) When using git bz -e or git bz edit it might seem like you can edit the commit message, but while this will post here, it's not changing the patch file. In order to include the test plan and patch description in your patch, you will have to do so in the git commit step. I will upload an updated patch and have already updated bugzilla :) Created attachment 111653 [details] [review] Bug 26340: Keep zero padding when printing barcodes from a range When creating barcode labels from a range, the leading zeros of padded barcodes will be removed. They should be kept instead. TO TEST: 1. Go to Tools > Label creator 2. Click +New -> Barcode range 3. Print barcode range with zero(s) in the start (Ex. from 00011881 to 00012000 ) 4. Select a template to be applied:: Code à barre 48467 Select a layout to be applied: Code à barres 5. Export 6. Open PDF The prefix is not displayed. We should see 00011881 on the labels, but we see 11881, 11882, ... without zeros in the start of labels. 7. Apply patch and retest - the zeros should be kept now. Signed-off-by: David Nind <david@davidnind.com> Created attachment 111654 [details] [review] Bug 26340: (QA follow-up) Rephrase hint on to and from values Ok, I have a bit of bad news here too - with the patch set it's no longer possible to print unpadded barcodes as it requires the barcodes entered to be of the same length. Example: from 1 to 33 will no longer print. I am not sure what the best fix here would be - maybe check for the numbers to start with zero and only output the hint if they do? (In reply to Katrin Fischer from comment #7) > Ok, I have a bit of bad news here too - with the patch set it's no longer > possible to print unpadded barcodes as it requires the barcodes entered to > be of the same length. Example: from 1 to 33 will no longer print. > > I am not sure what the best fix here would be - maybe check for the numbers > to start with zero and only output the hint if they do? Hi Katrin. Yes, it's my first patch for Koha. I understood your recommendations about 'commit -e' and 'Assignee'. In relation to the same length from and to values. Example from = 0005 and to=10. What we must do? Printing 0005, 0006,...,0010 or 05, 06, ...,10. Thanks! I think these should be invalid: 001 to 33 22 to 0044 But these should work: 001 to 020 00001 to 00010 1 to 44 4 to 100 Make sense? Either enter them zero padded or not... print according to what was entered. (In reply to Katrin Fischer from comment #9) > I think these should be invalid: > > 001 to 33 > 22 to 0044 > > But these should work: > > 001 to 020 > 00001 to 00010 > 1 to 44 > 4 to 100 > > Make sense? > > Either enter them zero padded or not... print according to what was entered. Are you saying that the system should give an error if some field(input from or to) does not contain 0* in the start of number, then the other field must not have 0* in the start of number? Did I understand correctly?
> Are you saying that the system should give an error if some field(input from
> or to) does not contain 0* in the start of number, then the other field must
> not have 0* in the start of number? Did I understand correctly?
Hi Ivan, I think that could work. Basically what we want to do is support 2 use cases:
- Printing numbers without zero padding
- Printing numbers with zero padding
So the validation needs to work for both cases.
Created attachment 121496 [details] [review] Bug 26340: Keep zero padding when printing barcodes from a range When creating barcode labels from a range, the leading zeros of padded barcodes will be removed. They should be kept instead. TO TEST: 1. Go to Tools > Label creator 2. Click +New -> Barcode range 3. Print barcode range with zero(s) in the start (Ex. from 00011881 to 00012000 ) 4. Select a template to be applied:: Code à barre 48467 Select a layout to be applied: Code à barres 5. Export 6. Open PDF The prefix is not displayed. We should see 00011881 on the labels, but we see 11881, 11882, ... without zeros in the start of labels. 7. Apply patch and retest - the zeros should be kept now. Signed-off-by: David Nind <david@davidnind.com> Bug 26340: (QA follow-up) Rephrase hint on to and from values Bug 26340: Keep zero padding when printing barcodes from a range Created attachment 121923 [details] [review] Bug 26340: When printing labels from a barcode range, keep zero padding TEST PLAN: 1. Go Tools > Label creator 2. Click +New -> Barcode range 3. Print barcode range with zero(s) in the start (Ex. from 00011881 to 00012000 ) 4. Select a template to be applied:: Code à barre 48467 Select a layout to be applied: Code à barres 5. Export 6. Open PDF The prefix is not displayed. We should see 00011881 on the labels, but we see 11881, 11882, ... without zeros in the start of labels. This patch fix it. Created attachment 122305 [details] [review] Bug 26340: When printing labels from a barcode range, keep zero padding TEST PLAN: 1. Go Tools > Label creator 2. Click +New -> Barcode range 3. Print barcode range with zero(s) in the start (Ex. from 00011881 to 00012000 ) 4. Select a template to be applied:: Code à barre 48467 Select a layout to be applied: Code à barres 5. Export 6. Open PDF The prefix is not displayed. We should see 00011881 on the labels, but we see 11881, 11882, ... without zeros in the start of labels. This patch fix it. Signed-off-by: hakam <hakam@inlibro.com> Created attachment 122575 [details] [review] Bug 26340: When printing labels from a barcode range, keep zero padding TEST PLAN: 1. Go Tools > Label creator 2. Click +New -> Barcode range 3. Print barcode range with zero(s) in the start (Ex. from 00011881 to 00012000 ) 4. Select a template to be applied:: Code à barre 48467 Select a layout to be applied: Code à barres 5. Export 6. Open PDF The prefix is not displayed. We should see 00011881 on the labels, but we see 11881, 11882, ... without zeros in the start of labels. This patch fix it. Signed-off-by: hakam <hakam@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 122576 [details] [review] Bug 26340: (QA follow-up) Remove warns and set input fields hidden again Removes traces of debugging. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Hi Ivan and Hakam, it appears to be working now for both use cases - zero padded or not. So this is good :) I noticed some code changes made, I assume, when debugging. Please be careful about removing those from your patches before submitting! Created attachment 122777 [details] [review] Bug 26340: Code simplification And rename $range with $barcode_length Created attachment 122779 [details] [review] Bug 26340: Code simplification And rename $range with $barcode_length Pushed to master for 21.11, thanks to everybody involved! Congratulations, Ivan, for your first patch pushed! Enhancement not backported to 21.05 |