- action: 'show_sales_purchase_email_dialog',
- cp_id: $('#cp_id').val(),
- donumber: $('#donumber').val(),
- format: $('#format').val(),
- formname: $('#formname').val(),
- id: $('#id').val(),
- invnumber: $('#invnumber').val(),
- language_id: $('#language_id').val(),
- media: 'email',
- ordnumber: $('#ordnumber').val(),
- rowcount: $('#rowcount').val(),
- quonumber: $('#quonumber').val(),
- type: $('#type').val(),
- vc: vc,
- vc_id: $('#' + vc + '_id').val(),
+ action: 'show_sales_purchase_email_dialog',
+ cp_id: $('#cp_id').val(),
+ direct_debit: $('#direct_debit').prop('checked') ? 1 : 0,
+ donumber: $('#donumber').val(),
+ format: $('#format').val(),
+ formname: $('#formname').val(),
+ id: $('#id').val(),
+ invnumber: $('#invnumber').val(),
+ language_id: $('#language_id').val(),
+ media: 'email',
+ ordnumber: $('#ordnumber').val(),
+ cusordnumber: $('#cusordnumber').val(),
+ rowcount: $('#rowcount').val(),
+ quonumber: $('#quonumber').val(),
+ type: $('#type').val(),
+ vc: vc,
+ vc_id: vc_id,
+ project_id: $('#globalproject_id').val(),