[% USE LxERP %]
[% USE T8 %]
+[% USE L %][%- USE P -%]
[% IF ( follow_up_length && follow_up_due_length ) %]
[% LxERP.t8('There are #1 unfinished follow-ups of which #2 are due.', follow_up_length , follow_up_due_length) %]
<input type="hidden" name="gldate" value="[% gldate | html %]">
<input type="hidden" name="callback" value="[% callback | html %]">
- <input type="hidden" name="draft_id" value="[% draft_id | html %]">
- <input type="hidden" name="draft_description" value="[% draft_description | html %]">
-
- <br>
-
- [% IF ( !id && draft_id ) %]
- <input type="checkbox" name="remove_draft" id="remove_draft" value="1" [% IF ( remove_draft ) %]checked[% END %]>
- <label for="remove_draft">[% 'Remove draft when posting' | $T8 %]</label>
- [% END %]
+ [% P.hidden_tag('draft_id', draft_id) %]
+ [% P.hidden_tag('draft_description', draft_description) %]
<br>
[% ELSE %]
[% IF ( !is_closed ) %]
<input class="submit" type="submit" name="action" value="[% 'Post' | $T8 %]">
- <input class="submit" type="submit" name="action" value="[% 'Save draft' | $T8 %]">
+ [% L.button_tag('kivi.Draft.popup("ar", "invoice", "' _ draft_id _ '", "' _ draft_description _ '")', LxERP.t8('Drafts')) %]
[% END %]
[% END %]
[% IF ( show_mark_as_paid_button ) %]
- <input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]">
+ [% L.submit_tag("action", LxERP.t8('mark as paid'), confirm=LxERP.t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?')) %]
[% END %]
+ [% L.button_tag("kivi.RecordTemplate.popup('ar_transaction')", LxERP.t8("Record templates")) %]
+
</form>
+
+<script type="text/javascript">
+ <!--
+$(document).ready(function() {
+ [%- SET row=0 %]
+ [%- WHILE row < rowcount %]
+ [%- SET row=row + 1 %]
+ $('#AR_amount_chart_id_[% row %]').on('set_item:ChartPicker', function(e, item) {
+ kivi.GL.update_taxes(this);
+ });
+ [%- END %]
+});
+-->
+</script>