Esempio n. 1
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("create_ictransaction");

            xml.WriteElement("transactiontype", TransactionDefinition, true);

            xml.WriteStartElement("datecreated");
            xml.WriteDateSplitElements(TransactionDate.Value, true);
            xml.WriteEndElement(); //datecreated

            xml.WriteElement("createdfrom", CreatedFrom);
            xml.WriteElement("documentno", DocumentNumber);
            xml.WriteElement("referenceno", ReferenceNumber);
            xml.WriteElement("message", Message);
            xml.WriteElement("externalid", ExternalId);
            xml.WriteElement("basecurr", BaseCurrency);

            xml.WriteCustomFieldsExplicit(CustomFields);

            xml.WriteElement("state", State);

            xml.WriteStartElement("ictransitems");
            if (Lines.Count > 0)
            {
                foreach (InventoryTransactionLineCreate Line in Lines)
                {
                    Line.WriteXml(ref xml);
                }
            }
            xml.WriteEndElement(); //ictransitems

            if (Subtotals.Count > 0)
            {
                xml.WriteStartElement("subtotals");
                foreach (TransactionSubtotalCreate Subtotal in Subtotals)
                {
                    Subtotal.WriteXml(ref xml);
                }
                xml.WriteEndElement(); //subtotals
            }

            xml.WriteEndElement(); //create_ictransaction

            xml.WriteEndElement(); //function
        }
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("create_sotransaction");

            xml.WriteElement("transactiontype", TransactionDefinition, true);

            xml.WriteStartElement("datecreated");
            xml.WriteDateSplitElements(TransactionDate.Value, true);
            xml.WriteEndElement(); //datecreated

            if (GlPostingDate.HasValue)
            {
                xml.WriteStartElement("dateposted");
                xml.WriteDateSplitElements(GlPostingDate.Value);
                xml.WriteEndElement(); //dateposted
            }

            xml.WriteElement("createdfrom", CreatedFrom);
            xml.WriteElement("customerid", CustomerId, true);
            xml.WriteElement("documentno", DocumentNumber);

            if (OriginalDocumentDate.HasValue)
            {
                xml.WriteStartElement("origdocdate");
                xml.WriteDateSplitElements(OriginalDocumentDate.Value);
                xml.WriteEndElement(); //origdocdate
            }

            xml.WriteElement("referenceno", ReferenceNumber);
            xml.WriteElement("termname", PaymentTerm);

            if (DueDate.HasValue)
            {
                xml.WriteStartElement("datedue");
                xml.WriteDateSplitElements(DueDate.Value, true);
                xml.WriteEndElement(); //datedue
            }

            xml.WriteElement("message", Message);
            xml.WriteElement("shippingmethod", ShippingMethod);

            if (!String.IsNullOrWhiteSpace(ShipToContactName))
            {
                xml.WriteStartElement("shipto");
                xml.WriteElement("contactname", ShipToContactName, true);
                xml.WriteEndElement(); //shipto
            }

            if (!String.IsNullOrWhiteSpace(BillToContactName))
            {
                xml.WriteStartElement("billto");
                xml.WriteElement("contactname", BillToContactName, true);
                xml.WriteEndElement(); //billto
            }

            xml.WriteElement("supdocid", AttachmentsId);
            xml.WriteElement("externalid", ExternalId);

            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("vsoepricelist", VsoePriceList);

            xml.WriteCustomFieldsExplicit(CustomFields);

            xml.WriteElement("state", State);
            xml.WriteElement("projectid", ProjectId);

            xml.WriteStartElement("sotransitems");
            if (Lines.Count > 0)
            {
                foreach (OrderEntryTransactionLineCreate Line in Lines)
                {
                    Line.WriteXml(ref xml);
                }
            }
            xml.WriteEndElement(); //sotransitems

            if (Subtotals.Count > 0)
            {
                xml.WriteStartElement("subtotals");
                foreach (TransactionSubtotalCreate Subtotal in Subtotals)
                {
                    Subtotal.WriteXml(ref xml);
                }
                xml.WriteEndElement(); //subtotals
            }

            xml.WriteEndElement(); //create_sotransaction

            xml.WriteEndElement(); //function
        }
Esempio n. 3
0
        public override void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("function");
            xml.WriteAttribute("controlid", ControlId, true);

            xml.WriteStartElement("create_potransaction");

            xml.WriteElement("transactiontype", TransactionDefinition, true);

            xml.WriteStartElement("datecreated");
            xml.WriteDateSplitElements(TransactionDate.Value, true);
            xml.WriteEndElement(); //datecreated

            if (GlPostingDate.HasValue)
            {
                xml.WriteStartElement("dateposted");
                xml.WriteDateSplitElements(GlPostingDate.Value);
                xml.WriteEndElement(); //dateposted
            }

            xml.WriteElement("createdfrom", CreatedFrom);
            xml.WriteElement("vendorid", VendorId, true);
            xml.WriteElement("documentno", DocumentNumber);

            xml.WriteElement("referenceno", ReferenceNumber);
            xml.WriteElement("vendordocno", VendorDocNumber);
            xml.WriteElement("termname", PaymentTerm);

            xml.WriteStartElement("datedue");
            xml.WriteDateSplitElements(DueDate.Value, true);
            xml.WriteEndElement(); //datedue

            xml.WriteElement("message", Message);
            xml.WriteElement("shippingmethod", ShippingMethod);

            xml.WriteStartElement("returnto");
            xml.WriteElement("contactname", ReturnToContactName, true);
            xml.WriteEndElement(); //returnto

            xml.WriteStartElement("payto");
            xml.WriteElement("contactname", PayToContactName, true);
            xml.WriteEndElement(); //payto

            xml.WriteElement("supdocid", AttachmentsId);
            xml.WriteElement("externalid", ExternalId);

            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.WriteCustomFieldsExplicit(CustomFields);

            xml.WriteElement("state", State);

            xml.WriteStartElement("potransitems");
            if (Lines.Count > 0)
            {
                foreach (PurchasingTransactionLineCreate Line in Lines)
                {
                    Line.WriteXml(ref xml);
                }
            }
            xml.WriteEndElement(); //potransitems

            if (Subtotals.Count > 0)
            {
                xml.WriteStartElement("subtotals");
                foreach (TransactionSubtotalCreate Subtotal in Subtotals)
                {
                    Subtotal.WriteXml(ref xml);
                }
                xml.WriteEndElement(); //subtotals
            }

            xml.WriteEndElement(); //create_potransaction

            xml.WriteEndElement(); //function
        }