Ejemplo n.º 1
0
        public static Boolean addorupdateClientFromUNMS(ClientReadOnly uclient)
        {
            // get latest client info
            uclient = getclientbyid(uclient.Id);
            string clientxeroid = "";

            foreach (ClientAttributeReadOnly ca in uclient.Attributes)
            {
                if (ca.name == "xeroIdclient")
                {
                    clientxeroid = ca.value;
                }
                ;
            }
            if (clientxeroid == "")
            {
                clientxeroid = XeroHelper.updateorcreatexerocontact(uclient, "");
            }
            else
            {
                clientxeroid = XeroHelper.updateorcreatexerocontact(uclient, clientxeroid);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public static Boolean addorupdatePaymentFromUNMS(PaymentReadOnly upayment)
        {
            ClientReadOnly uclient = getclientbyid(Convert.ToDouble(upayment.ClientId));

            string clientxeroid = "";

            foreach (ClientAttributeReadOnly ca in uclient.Attributes)
            {
                if (ca.name == "xeroIdclient")
                {
                    clientxeroid = ca.value;
                }
                ;
            }
            if (clientxeroid == "")
            {
                return(false);
            }

            string paymentxeroid = "";

            foreach (PaymentAttributeReadOnly ca in upayment.Attributes)
            {
                if (ca.Name == "xeroIdinvoice")
                {
                    paymentxeroid = ca.Value;
                }
                ;
            }
            if (paymentxeroid == "")
            {
                XeroHelper.updateorcreatexeropayment(upayment, clientxeroid);
            }
            return(true);
        }
Ejemplo n.º 3
0
        public static Boolean addorupdateInvoiceFromUNMS(InvoiceReadOnly uinvoice)
        {
            ClientReadOnly uclient = getclientbyid(Convert.ToDouble(uinvoice.ClientId));

            string clientxeroid = "";

            foreach (ClientAttributeReadOnly ca in uclient.Attributes)
            {
                if (ca.name == "xeroIdclient")
                {
                    clientxeroid = ca.value;
                }
                ;
            }
            if (clientxeroid == "")
            {
                clientxeroid = XeroHelper.updateorcreatexerocontact(uclient, "");
            }

            string invoicexeroid = "";

            foreach (InvoiceAttributeReadOnly ca in uinvoice.Attributes)
            {
                if (ca.Name == "xeroIdinvoice")
                {
                    invoicexeroid = ca.Value;
                }
                ;
            }
            if (invoicexeroid == "")
            {
                XeroHelper.updateorcreatexeroinvoice(uinvoice, clientxeroid);
            }
            return(true);
        }