Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secondary Print Format #209

Merged
merged 24 commits into from
Jun 29, 2024
Merged

Conversation

viralkansodiya
Copy link
Contributor

@viralkansodiya viralkansodiya commented Feb 12, 2024

@agritheory
New field in Check Run Settings : Secondary Print Format

if Secondary Print Format is selected : payment entry will not be split by Number of Invoices per voucher. If in setting Split Invoices by Address is enable then payment entry will split by address

@viralkansodiya viralkansodiya changed the title fix: customization on split payment entry feat: customization on split payment entry Feb 12, 2024
@agritheory agritheory self-requested a review February 20, 2024 16:14
@agritheory agritheory linked an issue Feb 20, 2024 that may be closed by this pull request
@viralkansodiya
Copy link
Contributor Author

@agritheory can you help me to sort-out this pre-commit problem
when I am pushing a code it's not show any error in pre-commit but on git repo it is showing a linters fail

agri

@agritheory agritheory changed the title feat: customization on split payment entry feat: Secondary Print Format Mar 1, 2024
@agritheory
Copy link
Owner

@viralkansodiya This looks good, but I think we need to include a sample secondary print format. I think we can extract the existing sample format but just this section:
image

https://github.com/agritheory/check_run/tree/version-14/check_run/check_run/print_format/example_voucher

<table class="table table-responsive-sm">
				<tr><td colspan="2">{{doc.party_name}}</td>
						<td> {{ frappe.utils.formatdate(doc.reference_date) or '' }} </td>
						<td style="text-align:right;" colspan="2"> {{doc.get_formatted("base_paid_amount")}} </td>
						<tr>
							<th> Date </th>
							<th style="text-align:left;"> Reference </th>
							<th style="text-align:center;"> Amount </th>
							<th style="text-align:right;"> Payment </th>
						</tr>
					{% for reference in doc.references %}
						<tr>
						    {% if reference.reference_doctype == 'Purchase Invoice' %}
						    <td>{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_date")) or ""}}</td>
						    <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_no") or "" }}</td>
							{% elif reference.reference_doctype == 'Sales Invoice' %}
							<td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_date")) or ""}}</td>
						    <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_no") or "" }}</td>
						    {% elif reference.reference_doctype == 'Expense Claim' %}
							<td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "expense_report_date")) or "&#160;"}}</td>
						    <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or "&#160;" }}</td>
						    {% elif reference.reference_doctype == 'Journal Entry' %}
							<td style="text-align:left;"> {{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "posting_date")) or "&#160;"}}</td>
						    <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or "&#160;" }}</td>
							{% endif %}
							<td style="text-align:center;"> {{ frappe.utils.fmt_money(reference.get_formatted('total_amount'), 2, 'USD')}}</td>
							<td style="text-align:right;"> {{ reference.get_formatted('allocated_amount')}}</td>
						</tr>
					{% endfor %}
				</table>

@viralkansodiya
Copy link
Contributor Author

@viralkansodiya This looks good, but I think we need to include a sample secondary print format. I think we can extract the existing sample format but just this section: image

https://github.com/agritheory/check_run/tree/version-14/check_run/check_run/print_format/example_voucher

<table class="table table-responsive-sm">
				<tr><td colspan="2">{{doc.party_name}}</td>
						<td> {{ frappe.utils.formatdate(doc.reference_date) or '' }} </td>
						<td style="text-align:right;" colspan="2"> {{doc.get_formatted("base_paid_amount")}} </td>
						<tr>
							<th> Date </th>
							<th style="text-align:left;"> Reference </th>
							<th style="text-align:center;"> Amount </th>
							<th style="text-align:right;"> Payment </th>
						</tr>
					{% for reference in doc.references %}
						<tr>
						    {% if reference.reference_doctype == 'Purchase Invoice' %}
						    <td>{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_date")) or ""}}</td>
						    <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "bill_no") or "" }}</td>
							{% elif reference.reference_doctype == 'Sales Invoice' %}
							<td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_date")) or ""}}</td>
						    <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "po_no") or "" }}</td>
						    {% elif reference.reference_doctype == 'Expense Claim' %}
							<td style="text-align:left;">{{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "expense_report_date")) or "&#160;"}}</td>
						    <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or "&#160;" }}</td>
						    {% elif reference.reference_doctype == 'Journal Entry' %}
							<td style="text-align:left;"> {{ frappe.utils.formatdate(frappe.db.get_value(reference.reference_doctype, reference.reference_name, "posting_date")) or "&#160;"}}</td>
						    <td style="text-align:left;"> {{ frappe.db.get_value(reference.reference_doctype, reference.reference_name, "name") or "&#160;" }}</td>
							{% endif %}
							<td style="text-align:center;"> {{ frappe.utils.fmt_money(reference.get_formatted('total_amount'), 2, 'USD')}}</td>
							<td style="text-align:right;"> {{ reference.get_formatted('allocated_amount')}}</td>
						</tr>
					{% endfor %}
				</table>

@agritheory

"Do you mean that in the new print format (secondary print), I should place this code as mentioned above? Or should I duplicate the existing format (example) as the secondary print and remove this code as mentioned above?"

@viralkansodiya
Copy link
Contributor Author

@agritheory
are you planning to use secondary print format from Download Checks button
agrith

@viralkansodiya
Copy link
Contributor Author

@agritheory Missing fields in print format

tempsnip

@agritheory agritheory changed the title feat: Secondary Print Format Secondary Print Format Mar 22, 2024
@agritheory agritheory marked this pull request as draft March 22, 2024 00:18
@agritheory
Copy link
Owner

@viralkansodiya Please review the attach PDF.
image

Both voucher sections should use the (new) comma separated approach, which looks great. Just copy paste that please.

I don't see the secondary voucher format being generated along with this PDF (attached).
ACC-CR-2024-0000105f9ca05f9ca.pdf

Please rebase this branch to pick up the latest changes on branch version-14.

@viralkansodiya
Copy link
Contributor Author

@agritheory

ACC-CR-2024-00002b09716.pdf

please review this attachment

I have added secondary print format

@viralkansodiya
Copy link
Contributor Author

Code Changes in this PR

  1. New field in Check Run Settings : Secondary Print Format
    if Secondary Print Format is selected : payment entry will not be split by Number of Invoices per voucher. If in setting Split
    Invoices by Address is enable then payment entry will split by address
  2. New Secondary print format
  3. secondary print format attachment with existing attachment

@agritheory
Copy link
Owner

The latest on this combines the two formats into a single PDF, we want two PDFs, one with each format, both attached to the Check Run. The formats themselves look good, though I'm not sure if there's an extra page per-check here. That would throw off the check numbering on pre-numbered checks.

image

ACC-CR-2024-00001b235deb235de.pdf

@viralkansodiya
Copy link
Contributor Author

@agritheory
checkrun

@viralkansodiya
Copy link
Contributor Author

@agritheory
All changes has been done. process to merge

@agritheory agritheory marked this pull request as ready for review April 29, 2024 13:13
@viralkansodiya
Copy link
Contributor Author

@agritheory checkrun

@agritheory Name of check format, which is a cheque format (Secondary Print Format)

Capture

@viralkansodiya viralkansodiya deleted the splitunsp branch June 20, 2024 09:53
@viralkansodiya viralkansodiya restored the splitunsp branch June 20, 2024 09:57
@agritheory agritheory merged commit 9eda182 into agritheory:version-14 Jun 29, 2024
5 checks passed
@HKuz HKuz mentioned this pull request Sep 18, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Secondary Print Format
3 participants