+ this.show_email_dialog = function(send_action) {
+ $('#form').data('send-email-action', send_action || 'send_sales_purchase_email');
+
+ var vc = $('#vc').val();
+ var data = {
+ 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').val(),
+ project_id: $('#globalproject_id').val(),
+ };
+
+ $('[name^=id_],[name^=partnumber_]').each(function(idx, elt) {
+ var val = $(elt).val() || '';
+ if (val !== '')
+ data[ $(elt).attr('name') ] = val;
+ });
+