Cheque format customization

Hi,

We are adjusting our cheque printing format and need the debit and credit accounts to appear but these are contained within the “Journal Entry Account” child table.

How do we pull data from the journal entry accounts child table?

I tried this - frappe.db.get_value(“[doctype]”, “[name]”, “fieldname”) - but it hasn’t worked. What does [name] refer to?

thanks
Sofia

@sofia share what you have done so far.

Hi @rmehta, this is all the html in the format:

{%- from "templates/print_formats/standard_macros.html" import add_header -%}
<div class="page-break">
<div class="containererp">
		<div class="first">
			<div class="city-and-date">{{doc.ciudad}}, {{ frappe.utils.formatdate(doc.cheque_date) }}</div>
			<div class="total-amount">{{ doc.get_formatted("total_amount") }}</div>
		</div>
		<div class="second">
			<div class="payto">{{ doc.pay_to_recd_from }}</div>
		</div>
		<div class="third">
			<div class="in-words">{{ doc.total_amount_in_words }}</div>
		</div>
		<div class="signatures">
			<div class="signature-1"></div>
			<div class="signature-2"></div>
		</div>
		<div class="payment-description">
                    {{doc.remark}}
		</div>
		<div class="table">
			<div class="row-1">
				<div class="description">{{ doc.accounts }}</div>
				<div class="amount-1">{{ doc.total_debit }}</div>
				<div class="amount-2">{{ doc.difference }}</div>
			</div>
		</div>
	</div></div>
</div>

{%- for label, value in (
         (_("Account"), "<strong class='total-value'>" + doc.get_formatted("total_amount") + "</strong>
<br>" + (doc.total_amount_in_words or "") + "<br>"),
        (_("References"), doc.remark),
        (_("Name"), doc.accounts)
    ) -%}
    <div class="row" class="">
       <div class="col-xs-12">{{ value }}</div>
    </div>
    {%- endfor -%}


and the custom css:
.containererp{
			background: white;
			width: 100%;
			margin-top: 40px;
			padding: 20px;
                        font-size: 20px !important;
			box-sizing: border-box;
			-webkit-box-sizing: border-box;
		}
		.containererp .first,
		.containererp .second,
		.containererp .third
		{
			margin-bottom: 20px;
		}
		.containererp .first .city-and-date{
			width: 70%;     
			float: left;
                        margin-bottom: 10px;
		}
		.containererp .first .total-amount{
			font-weight: bold;
			text-align: center;
			font-size: 24px;
		}
		.containererp .signatures{
			text-align: right;
			width: 100%;
			float: right;
			overflow: hidden;
			margin-bottom: 120px;
		}
		.containererp .signatures div{
			text-align: center;
			padding-bottom: 10px;
			display: inline-block;
			width: 250px;
			margin: 0 10px;
		}
		.containererp .payment-description{
			margin: 50px 0 60px -50px;
		}
		.containererp .table{
			background: gray;
			
		}
		.containererp .table .row-1 .description{
			width: 59%;
			float:left;
		}
		.containererp .table .row-1 .amount-1{
			width: 20%;
			text-align: left;
			float: left;
			font-weight: 600;
		}
		.containererp .table .row-1 .amount-2{
			width: 20%;
			text-align: left;
			float: right;
			font-weight: 600;
		}

we just need to pull info from the journal entry account table. How do we pull data from this table to the cheque format?

thanks
Sofia

@sofia you need to format it better!

Which line is giving you trouble?