Jump to content

dkmarsh99

New Members
  • Posts

    4
  • Joined

  • Last visited

dkmarsh99's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi. I have the fokllowing xml response from an API and I am wanting to loop through the array(s) and get informaton for each of the rows below. For example I want to get the cells below for Consulting Income / 98e83040-fa3a-4185-9b9b-a49241e2bb76/150.32 then get each of the other items in the array. So the second iitem I want is Contract Income / 7d05a53d-613d-4eb2-a2fc-dcb6adb80b80 / 11748.96 and so on for each of the results returned I am having a mental block about best way to get this information. Please advise best approach. <Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Id>20f0b472-a63d-4c1f-a8de-d0fc4e860983</Id> <Status>OK</Status> <ProviderName>Xero API Previewer</ProviderName> <DateTimeUTC>2020-10-12T21:34:33.5492839Z</DateTimeUTC> <Reports> <Report> <ReportID>ProfitAndLoss</ReportID> <ReportName>Profit and Loss</ReportName> <ReportType>ProfitAndLoss</ReportType> <ReportTitles> <ReportTitle>Profit &amp; Loss</ReportTitle> <ReportTitle>Demo Company (NZ)</ReportTitle> <ReportTitle>1 October 2020 to 31 October 2020</ReportTitle> </ReportTitles> <ReportDate>12 October 2020</ReportDate> <UpdatedDateUTC>2020-10-12T21:34:33.5492839Z</UpdatedDateUTC> <Rows> <Row> <RowType>Header</RowType> <Cells> <Cell /> <Cell> <Value>31 Oct 20</Value> </Cell> </Cells> </Row> <Row> <RowType>Section</RowType> <Title>Income</Title> <Rows> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Consulting Income</Value> <Attributes> <Attribute> <Value>98e83040-fa3a-4185-9b9b-a49241e2bb76</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>150.32</Value> <Attributes> <Attribute> <Value>98e83040-fa3a-4185-9b9b-a49241e2bb76</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Contract Income</Value> <Attributes> <Attribute> <Value>7d05a53d-613d-4eb2-a2fc-dcb6adb80b80</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>11748.96</Value> <Attributes> <Attribute> <Value>7d05a53d-613d-4eb2-a2fc-dcb6adb80b80</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Engineering Income</Value> <Attributes> <Attribute> <Value>225d8c93-251d-4a0b-9093-201acf69fe50</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>7217.29</Value> <Attributes> <Attribute> <Value>225d8c93-251d-4a0b-9093-201acf69fe50</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Equipment Income</Value> <Attributes> <Attribute> <Value>43f518a6-558f-402a-b22d-317bd64b1566</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>7377.17</Value> <Attributes> <Attribute> <Value>43f518a6-558f-402a-b22d-317bd64b1566</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Licence Income</Value> <Attributes> <Attribute> <Value>1ff30343-7bb2-4402-bb8f-a0813a7fb59e</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>3047.68</Value> <Attributes> <Attribute> <Value>1ff30343-7bb2-4402-bb8f-a0813a7fb59e</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Other Income</Value> <Attributes> <Attribute> <Value>b447935a-4b37-4f38-a841-fb3ae3b491e0</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>331.06</Value> <Attributes> <Attribute> <Value>b447935a-4b37-4f38-a841-fb3ae3b491e0</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>SummaryRow</RowType> <Cells> <Cell> <Value>Total Income</Value> </Cell> <Cell> <Value>29872.48</Value> </Cell> </Cells> </Row> </Rows> </Row> <Row> <RowType>Section</RowType> <Title>Less Cost of Sales</Title> <Rows> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Other Direct Costs</Value> <Attributes> <Attribute> <Value>9e77a829-37ea-4976-a9a8-d754e0e62f44</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>333.72</Value> <Attributes> <Attribute> <Value>9e77a829-37ea-4976-a9a8-d754e0e62f44</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>SummaryRow</RowType> <Cells> <Cell> <Value>Total Cost of Sales</Value> </Cell> <Cell> <Value>333.72</Value> </Cell> </Cells> </Row> </Rows> </Row> <Row> <RowType>Section</RowType> <Rows> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Gross Profit</Value> </Cell> <Cell> <Value>29538.76</Value> </Cell> </Cells> </Row> </Rows> </Row> <Row> <RowType>Section</RowType> <Title>Less Operating Expenses</Title> <Rows> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Accounting</Value> <Attributes> <Attribute> <Value>5e312344-4123-4cac-bb69-ad2d72d2280b</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>60.00</Value> <Attributes> <Attribute> <Value>5e312344-4123-4cac-bb69-ad2d72d2280b</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Advertising &amp; Promotional</Value> <Attributes> <Attribute> <Value>61835d79-5a1c-4ab3-af82-af6930b38492</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>1112.21</Value> <Attributes> <Attribute> <Value>61835d79-5a1c-4ab3-af82-af6930b38492</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Bank Fees</Value> <Attributes> <Attribute> <Value>19828003-cea7-4920-b0fa-9223a2cdb0dc</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>28.75</Value> <Attributes> <Attribute> <Value>19828003-cea7-4920-b0fa-9223a2cdb0dc</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Cellphones</Value> <Attributes> <Attribute> <Value>ba533632-ac64-45c8-874e-b5a5aa6829f0</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>155.00</Value> <Attributes> <Attribute> <Value>ba533632-ac64-45c8-874e-b5a5aa6829f0</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Courier</Value> <Attributes> <Attribute> <Value>b70cadef-d8aa-46e6-b128-79e2c997fd2c</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>232.02</Value> <Attributes> <Attribute> <Value>b70cadef-d8aa-46e6-b128-79e2c997fd2c</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>EFTPOS Charges</Value> <Attributes> <Attribute> <Value>a164d99b-308e-4b2e-b3b4-a0c502214c77</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>40.00</Value> <Attributes> <Attribute> <Value>a164d99b-308e-4b2e-b3b4-a0c502214c77</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Engineering Resources</Value> <Attributes> <Attribute> <Value>53fdcc86-32ee-4fcb-b053-f449405bc7a5</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>1303.31</Value> <Attributes> <Attribute> <Value>53fdcc86-32ee-4fcb-b053-f449405bc7a5</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Entertainment - Partly Deductible</Value> <Attributes> <Attribute> <Value>d27cb87b-a3d2-4275-8948-95871fec4929</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>15.00</Value> <Attributes> <Attribute> <Value>d27cb87b-a3d2-4275-8948-95871fec4929</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Equipment Costs</Value> <Attributes> <Attribute> <Value>573a170b-6792-4cfa-b8ce-6f8fd27f5458</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>13746.93</Value> <Attributes> <Attribute> <Value>573a170b-6792-4cfa-b8ce-6f8fd27f5458</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>General Expenses</Value> <Attributes> <Attribute> <Value>11f618a8-f17e-4757-8b4a-6f24841bdb93</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>323.23</Value> <Attributes> <Attribute> <Value>11f618a8-f17e-4757-8b4a-6f24841bdb93</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Insurance</Value> <Attributes> <Attribute> <Value>92c673af-b2bc-45be-a888-a7e2c4bcc7f9</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>119.00</Value> <Attributes> <Attribute> <Value>92c673af-b2bc-45be-a888-a7e2c4bcc7f9</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>KiwiSaver Employer Contributions</Value> <Attributes> <Attribute> <Value>ab57eabe-5fa8-49d4-87dc-d5e7428323af</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>519.53</Value> <Attributes> <Attribute> <Value>ab57eabe-5fa8-49d4-87dc-d5e7428323af</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Licence Costs</Value> <Attributes> <Attribute> <Value>02dbaa55-95b9-464e-999c-c68e203cd67f</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>2176.91</Value> <Attributes> <Attribute> <Value>02dbaa55-95b9-464e-999c-c68e203cd67f</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Motor Vehicle Expenses</Value> <Attributes> <Attribute> <Value>b149780d-69bc-4f7c-a3ce-bd48f7a37de5</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>619.63</Value> <Attributes> <Attribute> <Value>b149780d-69bc-4f7c-a3ce-bd48f7a37de5</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Office Consumables &amp; Postage</Value> <Attributes> <Attribute> <Value>b1769b51-e98e-432c-9670-d5be3054b717</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>56.00</Value> <Attributes> <Attribute> <Value>b1769b51-e98e-432c-9670-d5be3054b717</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Office Expenses</Value> <Attributes> <Attribute> <Value>935e0fbe-6749-41c8-a024-11321e44dfac</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>113.23</Value> <Attributes> <Attribute> <Value>935e0fbe-6749-41c8-a024-11321e44dfac</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Payment Processing</Value> <Attributes> <Attribute> <Value>8cd42505-ad73-46e2-932f-67952fdc4e99</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>174.51</Value> <Attributes> <Attribute> <Value>8cd42505-ad73-46e2-932f-67952fdc4e99</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Rent</Value> <Attributes> <Attribute> <Value>28113b99-6df2-4123-a2d0-5f54dcf8017b</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>1935.00</Value> <Attributes> <Attribute> <Value>28113b99-6df2-4123-a2d0-5f54dcf8017b</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Salaries &amp; Wages</Value> <Attributes> <Attribute> <Value>be2e984a-17e1-4bf7-809c-b03a69325c90</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>17317.58</Value> <Attributes> <Attribute> <Value>be2e984a-17e1-4bf7-809c-b03a69325c90</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Security</Value> <Attributes> <Attribute> <Value>c814b08e-6558-4ac4-adce-ba76848a3a9f</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>45.00</Value> <Attributes> <Attribute> <Value>c814b08e-6558-4ac4-adce-ba76848a3a9f</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Subscriptions</Value> <Attributes> <Attribute> <Value>5ba8d64a-5b98-4bfd-a35e-7d0569e3446f</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>102.96</Value> <Attributes> <Attribute> <Value>5ba8d64a-5b98-4bfd-a35e-7d0569e3446f</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Telephone &amp; Internet</Value> <Attributes> <Attribute> <Value>230e4cfc-f4c4-4c15-aa0d-bab02b954622</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>89.95</Value> <Attributes> <Attribute> <Value>230e4cfc-f4c4-4c15-aa0d-bab02b954622</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Travel &amp; Accommodation - National</Value> <Attributes> <Attribute> <Value>36d33c5d-7dea-4911-9ed0-7fccc16f2b5f</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>210.43</Value> <Attributes> <Attribute> <Value>36d33c5d-7dea-4911-9ed0-7fccc16f2b5f</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Utilities</Value> <Attributes> <Attribute> <Value>2e277847-022c-48f3-8467-0207230004d6</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> <Cell> <Value>348.14</Value> <Attributes> <Attribute> <Value>2e277847-022c-48f3-8467-0207230004d6</Value> <Id>account</Id> </Attribute> </Attributes> </Cell> </Cells> </Row> <Row> <RowType>SummaryRow</RowType> <Cells> <Cell> <Value>Total Operating Expenses</Value> </Cell> <Cell> <Value>40844.32</Value> </Cell> </Cells> </Row> </Rows> </Row> <Row> <RowType>Section</RowType> <Rows> <Row> <RowType>Row</RowType> <Cells> <Cell> <Value>Net Profit</Value> </Cell> <Cell> <Value>-11305.56</Value> </Cell> </Cells> </Row> </Rows> </Row> </Rows> </Report> </Reports> </Response>
  2. HI. I have written a mysql database query to add up invoice totals. It seems to be automatilaly adding .01 to the result when I run a group by. Let me explain more .. When I do a select on the field that I am adding up the result is $132.25 - the query is as follows select ttl_invoice_due from 65_it where st_id = 96011; When I run the following query that uses sum and group by - the $132.25 becomes $132.26 - the sum query is SELECT 65_st.job_compid, 65_client.uid_client, 65_client.comp_name, Sum(65_it.ttl_invoice_due) AS SumOftotal_due, Sum(65_it.ttl_invoice) AS SumOftotal_invoice, Sum(65_it.ttl_invoice_payments) AS SumOftotal_amnt_paid FROM 65_client INNER JOIN (65_st INNER JOIN 65_it ON 65_st.st_id = 65_it.st_id) ON 65_client.uid_client = 65_st.uid_client WHERE 65_st.uid_client = 1905 and 65_st.job_compid = 1 and 65_st.sales_date<=curdate() GROUP BY 65_st.job_compid, 65_client.uid_client HAVING (((Sum(65_it.ttl_invoice_due))<>0)) order by 65_client.comp_name; The 65_it.ttl_invoice_due field is defined in the table as Double(12,2) I dont know why the sum is returing $132.26 where it should be $132.25 as in the simple query ?.
  3. Hi, I have some code in vba that I use to open a cash drawer. It writes a message to COM1 or LPT1 - depending on what port is specified. I want to know how to do the same function using PHP. w_message = "Open Sessame" w_freefile = FreeFile Open w_strportname For Output As #w_freefile Print #w_freefile, w_message Close #w_freefile Please help
  4. Hi. I have a scollable div that is populated based on an ajax xmlhttp request. the div is <div id="diarydetail" style="border-style: none; border-color: inherit; border-width: 0px; width: 794px; float: left; height: 580px; overflow: scroll;"> When I issue a new xmlhttp request to refresh the contents of the div - I want to position the scroll to the same place it was before the refresh was issues. For example the div contains a diary page that scrolls through hours of the day. At any point in time you can see 3 hours - so what I want is that if I have scrolled through to 3pm on the page, then issue a refresh - the scroll will again position itself at 3pm. Please help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.