Пример #1
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("apply_arpayment");

            xml.WriteElement("arpaymentkey", RecordNo, true);

            xml.WriteStartElement("paymentdate");
            xml.WriteDateSplitElements(ReceivedDate.Value, true);
            xml.WriteEndElement(); //paymentdate

            xml.WriteElement("batchkey", SummaryRecordNo);
            xml.WriteElement("overpaylocid", OverpaymentLocationId);
            xml.WriteElement("overpaydeptid", OverpaymentDepartmentId);

            if (ApplyToTransactions.Count > 0)
            {
                foreach (ArPaymentItem ApplyToTransaction in ApplyToTransactions)
                {
                    ApplyToTransaction.WriteXml(ref xml);
                }
            }

            xml.WriteEndElement(); //apply_arpayment

            xml.WriteEndElement(); //function
        }
Пример #2
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("create_paymentrequest");

            if (!String.IsNullOrWhiteSpace(ChargeCardId))
            {
                xml.WriteElement("chargecardid", ChargeCardId);
            }
            else
            {
                xml.WriteElement("bankaccountid", BankAccountId);
            }

            xml.WriteElement("vendorid", VendorId, true);

            xml.WriteElement("memo", Memo);

            xml.WriteElement("paymentmethod", PaymentMethod, true);

            xml.WriteElement("grouppayments", GroupPayments);

            xml.WriteStartElement("paymentdate");
            xml.WriteDateSplitElements(PaymentDate, true);
            xml.WriteEndElement(); //paymentdate

            xml.WriteElement("paymentoption", MergeOption);

            if (ApplyToTransactions.Count > 0)
            {
                xml.WriteStartElement("paymentrequestitems");
                foreach (ApPaymentRequestItem ApplyToTransaction in ApplyToTransactions)
                {
                    ApplyToTransaction.WriteXml(ref xml);
                }
                xml.WriteEndElement(); //paymentrequestitems
            }

            // TODO: what about paymentamount element? only in v3.0 schema - was removed from v2.1 schema

            xml.WriteElement("documentnumber", DocumentNo);

            // TODO: review paymentdescription vs memo
            xml.WriteElement("paymentdescription", Memo);

            xml.WriteElement("paymentcontact", NotificationContactName);

            xml.WriteEndElement(); //create_paymentrequest

            xml.WriteEndElement(); //function
        }
Пример #3
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("create_arpayment");

            xml.WriteElement("customerid", CustomerId, true);
            xml.WriteElement("paymentamount", TransactionPaymentAmount, true);
            xml.WriteElement("translatedamount", BasePaymentAmount);

            if (!String.IsNullOrWhiteSpace(UndepositedFundsGlAccountNo))
            {
                xml.WriteElement("undepfundsacct", UndepositedFundsGlAccountNo);
            }
            else
            {
                xml.WriteElement("bankaccountid", BankAccountId);
            }

            xml.WriteStartElement("datereceived");
            xml.WriteDateSplitElements(ReceivedDate.Value, true);
            xml.WriteEndElement(); //datereceived

            xml.WriteElement("paymentmethod", PaymentMethod, true);

            xml.WriteElement("basecurr", BaseCurrency);
            xml.WriteElement("currency", TransactionCurrency);

            if (ExchangeRateDate.HasValue)
            {
                xml.WriteStartElement("exchratedate");
                xml.WriteDateSplitElements(ExchangeRateDate.Value);
                xml.WriteEndElement(); //exchratedate
            }

            if (!String.IsNullOrWhiteSpace(ExchangeRateType))
            {
                xml.WriteElement("exchratetype", ExchangeRateType);
            }
            else if (ExchangeRateValue.HasValue)
            {
                xml.WriteElement("exchrate", ExchangeRateValue);
            }
            else if (!String.IsNullOrWhiteSpace(BaseCurrency) || !String.IsNullOrWhiteSpace(TransactionCurrency))
            {
                xml.WriteElement("exchratetype", ExchangeRateType, true);
            }

            xml.WriteElement("cctype", CreditCardType);
            xml.WriteElement("authcode", AuthorizationCode);

            if (ApplyToTransactions.Count > 0)
            {
                foreach (ArPaymentItem ApplyToTransaction in ApplyToTransactions)
                {
                    ApplyToTransaction.WriteXml(ref xml);
                }
            }

            // TODO online payment methods

            xml.WriteEndElement(); //create_arpayment

            xml.WriteEndElement(); //function
        }