Credit and debit values are not getting inserted

I am trying to insert a document using frappe.get_doc(), the script inserting the document but the credit and debit values are becoming zeros after inserted.

This is the code I am using:

journal_entry={
“doctype”:“Journal Entry”,
“title”:“Discount”,
“company”:“Company”,
“entry_type”:“Journal Entry”,
“posting_date”:datetime.date.today(),
“total_debit”:float(400),
“total_credit”:float(400),
}
doc = frappe.get_doc(journal_entry)
doc.append(“accounts”, {“party_type”:“Customer”,“party”:party,“account”: “Cash - JPS”,“debit”:float( 400)})
doc.append(“accounts”, {“party_type”:“Customer”,“party”:party,“account”: “Quantity Discount - JPS”,“credit”: float(200)})
doc.append(“accounts”, {“party_type”:“Customer”,“party”:party,“account”: “Early Payment Discount - JPS”,“credit”: float(200)})
doc.save()
doc.submit()
frappe.db.commit()