Bugzilla – Attachment 156552 Details for
Bug 34985
Add a quantity field to the manual invoice form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34985: Add a quantity field to the manual invoice form
Bug-34985-Add-a-quantity-field-to-the-manual-invoi.patch (text/plain), 4.19 KB, created by
Hammat wele
on 2023-10-04 17:38:07 UTC
(
hide
)
Description:
Bug 34985: Add a quantity field to the manual invoice form
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2023-10-04 17:38:07 UTC
Size:
4.19 KB
patch
obsolete
>From 71c08215e916acfa432eeeaa572f6e413a54a8eb Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 4 Oct 2023 17:36:05 +0000 >Subject: [PATCH] Bug 34985: Add a quantity field to the manual invoice form > >This patch add a Quantity field and a Cost field to the manual invoice form this will allow to automatically multiply the amount when it has a default amount. > >Test plan: > >1) Apply the patch >2) Create multiple charge types some with default amount and some without default amount > 1-1) Go to Administraion -> Debit types > 1-2) Click on New Debit types > 1-3) Fill the form check the "Can be manually invoiced?" field > 1-5) Click on save >3) Create a manual invoice > 2-1) Find a patrons > 2-2) Click on Accounting tab > 2-3) Click on Create manual invoice tab > 2-4) Select a type with default amount set > ->Cost field and Quantity field should be added to the form > 2-5) Edit the Cost field or Quantity field > ->The amount will be automatically calculate > 2-6) Select a type with no default amount set > ->Cost field and Quantity field should not be added to the form >--- > .../prog/en/modules/members/maninvoice.tt | 20 +++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >index 8113199b46..c278c7596b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -94,6 +94,8 @@ > <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" value="[% barcode | html %]" /></li> > <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" value="[% desc | html %]" /></li> > <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" value="[% note | html %]" /></li> >+ <li class="additional_field"><label for="cost">Cost: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="cost" id="cost" min="0" value="[% amount | $Price on_editing => 1 %]" /></li> >+ <li class="additional_field"><label for="quantity">Quantity: </label><input type="text" name="quantity" id="quantity" value="1" /></li> > <li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value="[% amount | $Price on_editing => 1 %]" /> Example: 5.00</li> > </ol> > </fieldset> >@@ -141,11 +143,29 @@ > [% UNLESS amount.defined %] > $("#maninvoice #desc").val($("#maninvoice #type option:selected").text()); > $("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]); >+ $("#maninvoice #cost").val(type_fees[$("#maninvoice #type option:selected").val()]); >+ if(!type_fees[$("#maninvoice #type option:selected").val()]){ >+ $("#maninvoice li.additional_field").hide(); >+ } > [% END %] > $("#maninvoice #type").change(function(){ > $("#maninvoice #desc").val($(this).find("option:selected").text()); > $("#maninvoice #amount").val(type_fees[$(this).val()]); >+ $("#maninvoice #cost").val(type_fees[$(this).val()]); >+ $("#maninvoice #quantity").val('1'); >+ if(type_fees[$(this).val()]){ >+ $("#maninvoice li.additional_field").show(); >+ } >+ else{ >+ $("#maninvoice li.additional_field").hide(); >+ } > }); >+ $("#maninvoice #quantity").blur(function(){ >+ $("#maninvoice #amount").val(($("#maninvoice #cost").val() * $(this).val()).toFixed(2)); >+ }) >+ $("#maninvoice #cost").blur(function(){ >+ $("#maninvoice #amount").val(($("#maninvoice #quantity").val() * $(this).val()).toFixed(2)); >+ }) > }); > </script> > [% END %] >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34985
:
156552
|
156559
|
156560
|
156561
|
158365