partial void OnCustomerPaymentJournalHeaderRelatedRoleChanging(global::Microsoft.Dynamics.DataEntities.CustomerPaymentJournalHeader value);
        public static PaymentJournalLineSettledInvoice CreatePaymentJournalLineSettledInvoice(string journalLineCompany,
                                                                                              string journalBatchNumber,
                                                                                              decimal journalLineNumber,
                                                                                              string invoiceNumber,
                                                                                              string invoiceCompany,
                                                                                              global::System.DateTimeOffset invoiceDueDate,
                                                                                              decimal invoiceToPaymentCrossRate,
                                                                                              decimal cashDiscountToTakeInInvoiceCurrency,
                                                                                              decimal settlementAmountInInvoiceCurrency,
                                                                                              global::Microsoft.Dynamics.DataEntities.CustomerPaymentJournalLine customerPaymentJournalLineRelatedRole,
                                                                                              global::Microsoft.Dynamics.DataEntities.CustomerPaymentJournalHeader customerPaymentJournalHeaderRelatedRole)
        {
            PaymentJournalLineSettledInvoice paymentJournalLineSettledInvoice = new PaymentJournalLineSettledInvoice();

            paymentJournalLineSettledInvoice.JournalLineCompany                  = journalLineCompany;
            paymentJournalLineSettledInvoice.JournalBatchNumber                  = journalBatchNumber;
            paymentJournalLineSettledInvoice.JournalLineNumber                   = journalLineNumber;
            paymentJournalLineSettledInvoice.InvoiceNumber                       = invoiceNumber;
            paymentJournalLineSettledInvoice.InvoiceCompany                      = invoiceCompany;
            paymentJournalLineSettledInvoice.InvoiceDueDate                      = invoiceDueDate;
            paymentJournalLineSettledInvoice.InvoiceToPaymentCrossRate           = invoiceToPaymentCrossRate;
            paymentJournalLineSettledInvoice.CashDiscountToTakeInInvoiceCurrency = cashDiscountToTakeInInvoiceCurrency;
            paymentJournalLineSettledInvoice.SettlementAmountInInvoiceCurrency   = settlementAmountInInvoiceCurrency;
            if ((customerPaymentJournalLineRelatedRole == null))
            {
                throw new global::System.ArgumentNullException("customerPaymentJournalLineRelatedRole");
            }
            paymentJournalLineSettledInvoice.CustomerPaymentJournalLineRelatedRole = customerPaymentJournalLineRelatedRole;
            if ((customerPaymentJournalHeaderRelatedRole == null))
            {
                throw new global::System.ArgumentNullException("customerPaymentJournalHeaderRelatedRole");
            }
            paymentJournalLineSettledInvoice.CustomerPaymentJournalHeaderRelatedRole = customerPaymentJournalHeaderRelatedRole;
            return(paymentJournalLineSettledInvoice);
        }