Example #1
0
        public string toXmlAdd()
        {
            string xml = "<InvoiceLineAdd>";

            if (ItemRef != null)
            {
                xml += ItemRef.toXmlRef();
            }
            if (Desc != "")
            {
                xml += "<Desc>" + Desc + "</Desc>";
            }
            if (Quantity != null)
            {
                xml += "<Quantity>" + Functions.FloatToString((float)Quantity) + "</Quantity>";
            }
            if (UnitOfMeasure != "")
            {
                xml += "<UnitOfMeasure>" + UnitOfMeasure + "</UnitOfMeasure>";
            }

            if (Rate != null)
            {
                xml += "<Rate>" + Functions.FloatToString((float)Rate) + "</Rate>";
            }
            else if (RatePercent != null)
            {
                xml += "<RatePercent>" + Functions.FloatToString((float)RatePercent) + "</RatePercent>";
            }
            else if (PriceLevelRef != null)
            {
                xml += PriceLevelRef.toXmlRef();
            }
            if (ClassRef != null)
            {
                xml += ClassRef.toXmlRef();
            }
            if (Amount != null)
            {
                xml += "<Amount>" + Functions.FloatToString((float)Amount) + "</Amount>";
            }

            if (InventorySiteRef != null)
            {
                xml += InventorySiteRef.toXmlRef();
            }
            //OptionForPriceRuleConflict
            xml += "</InvoiceLineAdd>";
            return(xml);
        }
Example #2
0
        public string toXmlAdd()
        {
            if (Amount > 0)
            {
                string xml = Environment.NewLine + "<ExpenseLineAdd>";
                if (AccountRef != null)
                {
                    xml += Environment.NewLine + AccountRef.toXmlRef();
                }

                System.Globalization.CultureInfo myInfo = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB");

                xml += Environment.NewLine + "<Amount>" + Amount.ToString("0.00", myInfo) + "</Amount>";
                if (Memo != string.Empty)
                {
                    xml += Environment.NewLine + "<Memo>" + Memo + "</Memo>";
                }

                if (CustomerRef != null)
                {
                    xml += CustomerRef.toXmlRef();
                }
                if (ClassRef != null)
                {
                    xml += ClassRef.toXmlRef();
                }

                if (BillableStatus != null && BillableStatus != string.Empty)
                {
                    xml += Environment.NewLine + "<BillableStatus>" + BillableStatus + "</BillableStatus> ";
                }


                xml += Environment.NewLine + "</ExpenseLineAdd>";
                return(xml);
            }
            else
            {
                return(string.Empty);
            }
        }