947c9bb4-4129-44b6-bbe2-aa0ab6787a40](2025-07-21 17:11:22) - Error al guardar imagen localmente
[46ae9520-bec4-4029-b7d0-87d6c43e2f68](2025-07-21 17:11:22) - Error al guardar imagen localmente
[c2d2ce1d-36e0-4272-9357-8ecb215eff21](2025-07-21 17:11:22) - Error al guardar imagen localmente
[4e605981-8099-4dc4-b141-93b83d309104](2025-07-21 17:11:22) - Error al guardar imagen localmente
[d5207ff8-ce5d-4b8f-a775-f9606db3599a](2025-07-21 17:11:22) - Error al guardar imagen localmente
[25acc7cb-a177-438f-aab4-0f5931574fa3](2025-07-21 17:11:22) - Error al guardar imagen localmente
[1420098f-7c6e-45e2-bef7-7d5bdcc635ce](2025-07-21 17:11:22) - Error al guardar imagen localmente
[a850bd11-0323-4ee6-9b9b-caff24b9c0d3](2025-07-21 17:11:22) - Error al guardar imagen localmente
[dd1b1361-7c29-455c-8b17-62fbd84dc9f9](2025-07-21 17:11:22) - Error al guardar imagen localmente
[2a3956e0-1157-4767-93cc-b74c920d8b22](2025-07-21 17:11:22) - Error al guardar imagen localmente
[a76f7e2c-3402-4a31-9159-113caf79e74a](2025-07-21 17:11:22) - Error al guardar imagen localmente
[cd2abea0-1753-4af2-8b0e-e804d76d80c4](2025-07-21 17:11:22) - Error al guardar imagen localmente
[33875973-46e6-47d9-82f3-2e7f15a0100d](2025-07-21 17:11:22) - Error al guardar imagen localmente
[d679c8d0-51d7-4364-ab0f-dd9afb22c86b](2025-07-21 17:11:22) - Error al guardar imagen localmente
[7a1308ca-d8ca-4b5d-a5f6-1bdfdec227af](2025-07-21 17:11:22) - Error al guardar imagen localmente
[c843d5ee-c72a-4bc1-8475-5441b6bcd252](2025-07-21 17:11:22) - Error al guardar imagen localmente
[3e413fd5-a509-4cfc-a85c-10770e6336d8](2025-07-21 17:11:22) - Error al guardar imagen localmente
[30389993-7b9f-4de6-ac7a-44abd33129a7](2025-07-21 17:11:22) - Error al guardar imagen localmente
[61986b90-0678-4584-b6a1-006d2ab163ac](2025-07-21 17:11:22) - Error al guardar imagen localmente
[52569634-b01c-4a94-8732-4a86bc217515](2025-07-21 17:11:22) - Error al guardar imagen localmente
[de3c9fa2-e498-41d2-9dd8-8d52da0652c7](2025-07-21 17:11:22) - Error al guardar imagen localmente
[a885505a-8391-4017-999c-0ba4461cf884](2025-07-21 17:11:22) - Error al guardar imagen localmente
[4a97f8a1-31ad-44d1-8d6b-0afdd73c7f16](2025-07-21 17:11:22) - Error al guardar imagen localmente
[30dc3b5f-79d8-4697-8bba-4b6d46ca4455](2025-07-21 17:11:23) - Error al guardar imagen localmente
[c9ee19b1-8d22-4287-8a4b-8b2871a025f8](2025-07-21 17:11:24) - Error al guardar imagen localmente
[80ffadb9-f0ab-4097-ae33-d6410ea8db02](2025-07-21 17:11:24) - Error al guardar imagen localmente
[f35a3267-552b-473f-809b-9bf14f7ce90f](2025-07-21 17:11:24) - Error al guardar imagen localmente
[46ae9520-bec4-4029-b7d0-87d6c43e2f68](2025-07-21 17:11:24) - Error al guardar imagen localmente
[c2d2ce1d-36e0-4272-9357-8ecb215eff21](2025-07-21 17:11:24) - Error al guardar imagen localmente
[947c9bb4-4129-44b6-bbe2-aa0ab6787a40](2025-07-21 17:11:24) - Error al guardar imagen localmente
[1420098f-7c6e-45e2-bef7-7d5bdcc635ce](2025-07-21 17:11:24) - Error al guardar imagen localmente
[d5207ff8-ce5d-4b8f-a775-f9606db3599a](2025-07-21 17:11:24) - Error al guardar imagen localmente
[25acc7cb-a177-438f-aab4-0f5931574fa3](2025-07-21 17:11:24) - Error al guardar imagen localmente
[dd1b1361-7c29-455c-8b17-62fbd84dc9f9](2025-07-21 17:11:24) - Error al guardar imagen localmente
[2a3956e0-1157-4767-93cc-b74c920d8b22](2025-07-21 17:11:24) - Error al guardar imagen localmente
[33875973-46e6-47d9-82f3-2e7f15a0100d](2025-07-21 17:11:24) - Error al guardar imagen localmente
[cccf617a-2597-4ad9-8777-75837142678f](2025-07-21 17:11:24) - Error al guardar imagen localmente
[cd2abea0-1753-4af2-8b0e-e804d76d80c4](2025-07-21 17:11:24) - Error al guardar imagen localmente
[3e413fd5-a509-4cfc-a85c-10770e6336d8](2025-07-21 17:11:24) - Error al guardar imagen localmente
[d679c8d0-51d7-4364-ab0f-dd9afb22c86b](2025-07-21 17:11:24) - Error al guardar imagen localmente
[a76f7e2c-3402-4a31-9159-113caf79e74a](2025-07-21 17:11:24) - Error al guardar imagen localmente
[c843d5ee-c72a-4bc1-8475-5441b6bcd252](2025-07-21 17:11:24) - Error al guardar imagen localmente
[30389993-7b9f-4de6-ac7a-44abd33129a7](2025-07-21 17:11:24) - Error al guardar imagen localmente
[3a762715-e8fd-4dc7-9dba-5ad78812b938](2025-07-21 17:11:24) - Error al guardar imagen localmente
[52569634-b01c-4a94-8732-4a86bc217515](2025-07-21 17:11:24) - Error al guardar imagen localmente
[a850bd11-0323-4ee6-9b9b-caff24b9c0d3](2025-07-21 17:11:24) - Error al guardar imagen localmente
[7a1308ca-d8ca-4b5d-a5f6-1bdfdec227af](2025-07-21 17:11:24) - Error al guardar imagen localmente
[61986b90-0678-4584-b6a1-006d2ab163ac](2025-07-21 17:11:24) - Error al guardar imagen localmente
[4e605981-8099-4dc4-b141-93b83d309104](2025-07-21 17:11:24) - Error al guardar imagen localmente
[de3c9fa2-e498-41d2-9dd8-8d52da0652c7](2025-07-21 17:11:24) - Error al guardar imagen localmente
[a885505a-8391-4017-999c-0ba4461cf884](2025-07-21 17:11:24) - Error al guardar imagen localmente
[4a97f8a1-31ad-44d1-8d6b-0afdd73c7f16](2025-07-21 17:11:24) - Error al guardar imagen localmente
[30dc3b5f-79d8-4697-8bba-4b6d46ca4455](2025-07-21 17:11:25) - Error al guardar imagen localmente
[f35a3267-552b-473f-809b-9bf14f7ce90f](2025-07-21 17:11:26) - Error al guardar imagen localmente
[80ffadb9-f0ab-4097-ae33-d6410ea8db02](2025-07-21 17:11:26) - Error al guardar imagen localmente
[c9ee19b1-8d22-4287-8a4b-8b2871a025f8](2025-07-21 17:11:26) - Error al guardar imagen localmente
[46ae9520-bec4-4029-b7d0-87d6c43e2f68](2025-07-21 17:11:26) - Error al guardar imagen localmente
[1420098f-7c6e-45e2-bef7-7d5bdcc635ce](2025-07-21 17:11:26) - Error al guardar imagen localmente
[25acc7cb-a177-438f-aab4-0f5931574fa3](2025-07-21 17:11:26) - Error al guardar imagen localmente
[c2d2ce1d-36e0-4272-9357-8ecb215eff21](2025-07-21 17:11:26) - Error al guardar imagen localmente
[947c9bb4-4129-44b6-bbe2-aa0ab6787a40](2025-07-21 17:11:26) - Error al guardar imagen localmente
[d5207ff8-ce5d-4b8f-a775-f9606db3599a](2025-07-21 17:11:26) - Error al guardar imagen localmente
[33875973-46e6-47d9-82f3-2e7f15a0100d](2025-07-21 17:11:26) - Error al guardar imagen localmente
[2a3956e0-1157-4767-93cc-b74c920d8b22](2025-07-21 17:11:26) - Error al guardar imagen localmente
[cccf617a-2597-4ad9-8777-75837142678f](2025-07-21 17:11:26) - Error al guardar imagen localmente
[dd1b1361-7c29-455c-8b17-62fbd84dc9f9](2025-07-21 17:11:26) - Error al guardar imagen localmente
[3e413fd5-a509-4cfc-a85c-10770e6336d8](2025-07-21 17:11:26) - Error al guardar imagen localmente
[d679c8d0-51d7-4364-ab0f-dd9afb22c86b](2025-07-21 17:11:26) - Error al guardar imagen localmente
[a76f7e2c-3402-4a31-9159-113caf79e74a](2025-07-21 17:11:26) - Error al guardar imagen localmente
[cd2abea0-1753-4af2-8b0e-e804d76d80c4](2025-07-21 17:11:26) - Error al guardar imagen localmente
[30389993-7b9f-4de6-ac7a-44abd33129a7](2025-07-21 17:11:26) - Error al guardar imagen localmente
[52569634-b01c-4a94-8732-4a86bc217515](2025-07-21 17:11:26) - Error al guardar imagen localmente
[3a762715-e8fd-4dc7-9dba-5ad78812b938](2025-07-21 17:11:26) - Error al guardar imagen localmente
[7a1308ca-d8ca-4b5d-a5f6-1bdfdec227af](2025-07-21 17:11:26) - Error al guardar imagen localmente
[a850bd11-0323-4ee6-9b9b-caff24b9c0d3](2025-07-21 17:11:26) - Error al guardar imagen localmente
[de3c9fa2-e498-41d2-9dd8-8d52da0652c7](2025-07-21 17:11:26) - Error al guardar imagen localmente
[4e605981-8099-4dc4-b141-93b83d309104](2025-07-21 17:11:26) - Error al guardar imagen localmente
[61986b90-0678-4584-b6a1-006d2ab163ac](2025-07-21 17:11:26) - Error al guardar imagen localmente
[c843d5ee-c72a-4bc1-8475-5441b6bcd252](2025-07-21 17:11:26) - Error al guardar imagen localmente
[a885505a-8391-4017-999c-0ba4461cf884](2025-07-21 17:11:26) - Error al guardar imagen localmente
[4a97f8a1-31ad-44d1-8d6b-0afdd73c7f16](2025-07-21 17:11:26) - Error al guardar imagen localmente
[30dc3b5f-79d8-4697-8bba-4b6d46ca4455](2025-07-21 17:11:27) - Error al guardar imagen localmente
[46ae9520-bec4-4029-b7d0-87d6c43e2f68](2025-07-21 17:11:28) - Error al guardar imagen localmente
[c9ee19b1-8d22-4287-8a4b-8b2871a025f8](2025-07-21 17:11:28) - Error al guardar imagen localmente
[f35a3267-552b-473f-809b-9bf14f7ce90f](2025-07-21 17:11:28) - Error al guardar imagen localmente
[80ffadb9-f0ab-4097-ae33-d6410ea8db02](2025-07-21 17:11:28) - Error al guardar imagen localmente
[33875973-46e6-47d9-82f3-2e7f15a0100d](2025-07-21 17:11:28) - Error al guardar imagen localmente
[c2d2ce1d-36e0-4272-9357-8ecb215eff21](2025-07-21 17:11:28) - Error al guardar imagen localmente
[2a3956e0-1157-4767-93cc-b74c920d8b22](2025-07-21 17:11:28) - Error al guardar imagen localmente
[cccf617a-2597-4ad9-8777-75837142678f](2025-07-21 17:11:28) - Error al guardar imagen localmente
[3e413fd5-a509-4cfc-a85c-10770e6336d8](2025-07-21 17:11:28) - Error al guardar imagen localmente
[d5207ff8-ce5d-4b8f-a775-f9606db3599a](2025-07-21 17:11:28) - Error al guardar imagen localmente
[25acc7cb-a177-438f-aab4-0f5931574fa3](2025-07-21 17:11:28) - Error al guardar imagen localmente
[a76f7e2c-3402-4a31-9159-113caf79e74a](2025-07-21 17:11:28) - Error al guardar imagen localmente
[52569634-b01c-4a94-8732-4a86bc217515](2025-07-21 17:11:28) - Error al guardar imagen localmente
[dd1b1361-7c29-455c-8b17-62fbd84dc9f9](2025-07-21 17:11:28) - Error al guardar imagen localmente
[7a1308ca-d8ca-4b5d-a5f6-1bdfdec227af](2025-07-21 17:11:28) - Error al guardar imagen localmente
[3a762715-e8fd-4dc7-9dba-5ad78812b938](2025-07-21 17:11:28) - Error al guardar imagen localmente
[a850bd11-0323-4ee6-9b9b-caff24b9c0d3](2025-07-21 17:11:28) - Error al guardar imagen localmente
[30389993-7b9f-4de6-ac7a-44abd33129a7](2025-07-21 17:11:28) - Error al guardar imagen localmente
[61986b90-0678-4584-b6a1-006d2ab163ac](2025-07-21 17:11:28) - Error al guardar imagen localmente
[c843d5ee-c72a-4bc1-8475-5441b6bcd252](2025-07-21 17:11:28) - Error al guardar imagen localmente
[4e605981-8099-4dc4-b141-93b83d309104](2025-07-21 17:11:28) - Error al guardar imagen localmente
[1420098f-7c6e-45e2-bef7-7d5bdcc635ce](2025-07-21 17:11:28) - Error al guardar imagen localmente
[947c9bb4-4129-44b6-bbe2-aa0ab6787a40](2025-07-21 17:11:28) - Error al guardar imagen localmente
[cd2abea0-1753-4af2-8b0e-e804d76d80c4](2025-07-21 17:11:28) - Error al guardar imagen localmente
[d679c8d0-51d7-4364-ab0f-dd9afb22c86b](2025-07-21 17:11:28) - Error al guardar imagen localmente
[de3c9fa2-e498-41d2-9dd8-8d52da0652c7](2025-07-21 17:11:28) - Error al guardar imagen localmente
[a885505a-8391-4017-999c-0ba4461cf884](2025-07-21 17:11:28) - Error al guardar imagen localmente
[4a97f8a1-31ad-44d1-8d6b-0afdd73c7f16](2025-07-21 17:11:28) - Error al guardar imagen localmente
[30dc3b5f-79d8-4697-8bba-4b6d46ca4455](2025-07-21 17:11:29) - Error al guardar imagen localmente
[f35a3267-552b-473f-809b-9bf14f7ce90f](2025-07-21 17:11:30) - Error al guardar imagen localmente
[80ffadb9-f0ab-4097-ae33-d6410ea8db02](2025-07-21 17:11:30) - Error al guardar imagen localmente
[c9ee19b1-8d22-4287-8a4b-8b2871a025f8](2025-07-21 17:11:30) - Error al guardar imagen localmente
[2a3956e0-1157-4767-93cc-b74c920d8b22](2025-07-21 17:11:30) - Error al guardar imagen localmente
[c2d2ce1d-36e0-4272-9357-8ecb215eff21](2025-07-21 17:11:30) - Error al guardar imagen localmente
[3e413fd5-a509-4cfc-a85c-10770e6336d8](2025-07-21 17:11:30) - Error al guardar imagen localmente
[25acc7cb-a177-438f-aab4-0f5931574fa3](2025-07-21 17:11:30) - Error al guardar imagen localmente
[d5207ff8-ce5d-4b8f-a775-f9606db3599a](2025-07-21 17:11:30) - Error al guardar imagen localmente
[52569634-b01c-4a94-8732-4a86bc217515](2025-07-21 17:11:30) - Error al guardar imagen localmente
[7a1308ca-d8ca-4b5d-a5f6-1bdfdec227af](2025-07-21 17:11:30) - Error al guardar imagen localmente
[a850bd11-0323-4ee6-9b9b-caff24b9c0d3](2025-07-21 17:11:30) - Error al guardar imagen localmente
[cccf617a-2597-4ad9-8777-75837142678f](2025-07-21 17:11:30) - Error al guardar imagen localmente
[30389993-7b9f-4de6-ac7a-44abd33129a7](2025-07-21 17:11:30) - Error al guardar imagen localmente
[dd1b1361-7c29-455c-8b17-62fbd84dc9f9](2025-07-21 17:11:30) - Error al guardar imagen localmente
[a76f7e2c-3402-4a31-9159-113caf79e74a](2025-07-21 17:11:30) - Error al guardar imagen localmente
[1420098f-7c6e-45e2-bef7-7d5bdcc635ce](2025-07-21 17:11:30) - Error al guardar imagen localmente
[4e605981-8099-4dc4-b141-93b83d309104](2025-07-21 17:11:30) - Error al guardar imagen localmente
[c843d5ee-c72a-4bc1-8475-5441b6bcd252](2025-07-21 17:11:30) - Error al guardar imagen localmente
[3a762715-e8fd-4dc7-9dba-5ad78812b938](2025-07-21 17:11:30) - Error al guardar imagen localmente
[de3c9fa2-e498-41d2-9dd8-8d52da0652c7](2025-07-21 17:11:30) - Error al guardar imagen localmente
[46ae9520-bec4-4029-b7d0-87d6c43e2f68](2025-07-21 17:11:30) - Error al guardar imagen localmente
[61986b90-0678-4584-b6a1-006d2ab163ac](2025-07-21 17:11:30) - Error al guardar imagen localmente
[33875973-46e6-47d9-82f3-2e7f15a0100d](2025-07-21 17:11:30) - Error al guardar imagen localmente
[cd2abea0-1753-4af2-8b0e-e804d76d80c4](2025-07-21 17:11:30) - Error al guardar imagen localmente
[947c9bb4-4129-44b6-bbe2-aa0ab6787a40](2025-07-21 17:11:30) - Error al guardar imagen localmente
[a885505a-8391-4017-999c-0ba4461cf884](2025-07-21 17:11:30) - Error al guardar imagen localmente
[d679c8d0-51d7-4364-ab0f-dd9afb22c86b](2025-07-21 17:11:30) - Error al guardar imagen localmente
[4a97f8a1-31ad-44d1-8d6b-0afdd73c7f16](2025-07-21 17:11:30) - Error al guardar imagen localmente
[30dc3b5f-79d8-4697-8bba-4b6d46ca4455](2025-07-21 17:11:31) - Error al guardar imagen localmente
[f35a3267-552b-473f-809b-9bf14f7ce90f](2025-07-21 17:11:32) - Error al guardar imagen localmente
[c9ee19b1-8d22-4287-8a4b-8b2871a025f8](2025-07-21 17:11:32) - Error al guardar imagen localmente
[d5207ff8-ce5d-4b8f-a775-f9606db3599a](2025-07-21 17:11:32) - Error al guardar imagen localmente
[a850bd11-0323-4ee6-9b9b-caff24b9c0d3](2025-07-21 17:11:32) - Error al guardar imagen localmente
[52569634-b01c-4a94-8732-4a86bc217515](2025-07-21 17:11:32) - Error al guardar imagen localmente
[dd1b1361-7c29-455c-8b17-62fbd84dc9f9](2025-07-21 17:11:32) - Error al guardar imagen localmente
[80ffadb9-f0ab-4097-ae33-d6410ea8db02](2025-07-21 17:11:32) - Error al guardar imagen localmente
[cccf617a-2597-4ad9-8777-75837142678f](2025-07-21 17:11:32) - Error al guardar imagen localmente
[4e605981-8099-4dc4-b141-93b83d309104](2025-07-21 17:11:32) - Error al guardar imagen localmente
[2a3956e0-1157-4767-93cc-b74c920d8b22](2025-07-21 17:11:32) - Error al guardar imagen localmente
[a76f7e2c-3402-4a31-9159-113caf79e74a](2025-07-21 17:11:32) - Error al guardar imagen localmente
[7a1308ca-d8ca-4b5d-a5f6-1bdfdec227af](2025-07-21 17:11:32) - Error al guardar imagen localmente
[c2d2ce1d-36e0-4272-9357-8ecb215eff21](2025-07-21 17:11:32) - Error al guardar imagen localmente
[3e413fd5-a509-4cfc-a85c-10770e6336d8](2025-07-21 17:11:32) - Error al guardar imagen localmente
[30389993-7b9f-4de6-ac7a-44abd33129a7](2025-07-21 17:11:32) - Error al guardar imagen localmente
[1420098f-7c6e-45e2-bef7-7d5bdcc635ce](2025-07-21 17:11:32) - Error al guardar imagen localmente
[46ae9520-bec4-4029-b7d0-87d6c43e2f68](2025-07-21 17:11:32) - Error al guardar imagen localmente
[de3c9fa2-e498-41d2-9dd8-8d52da0652c7](2025-07-21 17:11:32) - Error al guardar imagen localmente
[3a762715-e8fd-4dc7-9dba-5ad78812b938](2025-07-21 17:11:32) - Error al guardar imagen localmente
[61986b90-0678-4584-b6a1-006d2ab163ac](2025-07-21 17:11:32) - Error al guardar imagen localmente
[a885505a-8391-4017-999c-0ba4461cf884](2025-07-21 17:11:32) - Error al guardar imagen localmente
[25acc7cb-a177-438f-aab4-0f5931574fa3](2025-07-21 17:11:32) - Error al guardar imagen localmente
[c843d5ee-c72a-4bc1-8475-5441b6bcd252](2025-07-21 17:11:32) - Error al guardar imagen localmente
[cd2abea0-1753-4af2-8b0e-e804d76d80c4](2025-07-21 17:11:32) - Error al guardar imagen localmente
[33875973-46e6-47d9-82f3-2e7f15a0100d](2025-07-21 17:11:32) - Error al guardar imagen localmente
[947c9bb4-4129-44b6-bbe2-aa0ab6787a40](2025-07-21 17:11:32) - Error al guardar imagen localmente
[d679c8d0-51d7-4364-ab0f-dd9afb22c86b](2025-07-21 17:11:32) - Error al guardar imagen localmente
[4a97f8a1-31ad-44d1-8d6b-0afdd73c7f16](2025-07-21 17:11:32) - Error al guardar imagen localmente
[30dc3b5f-79d8-4697-8bba-4b6d46ca4455](2025-07-21 17:11:33) - Error al guardar imagen loclonia = "";
$prebill_ciudad = "";
$prebill_estado = "";
$prebill_pais = "";
$prebill_codigo = "";
$prebill_attention = "";
foreach ( $bdDatBill[0] as $nombre => $hexa ) {
if($nombre == "Client.Domicilio_fiscal")
{
$prebill_domicilio = $hexa;
}
if($nombre == "Client.Colonia_fiscal")
{
$prebill_colonia = $hexa;
}
if($nombre == "Client.Ciudad_fiscal")
{
$prebill_ciudad = $hexa;
}
if($nombre == "Client.Estado_fiscal")
{
$prebill_estado = $hexa;
}
if($nombre == "Client.Pais_fiscal")
{
$prebill_pais = $hexa;
}
if($nombre == "Client.Codigo_fiscal")
{
$prebill_codigo = $hexa;
}
if($nombre == "Client.Atencion_de_facturacion")
{
$prebill_attention = $hexa;
}
}
$sFecha = "";
$sMes = substr($prebill_date,3,3);
switch($sMes){
case "Jan": $sFecha = $sFecha . "January "; break;
case "Ene": $sFecha = $sFecha . "January "; break;
case "Feb": $sFecha = $sFecha . "February "; break;
case "Mar": $sFecha = $sFecha . "March "; break;
case "Apr": $sFecha = $sFecha . "April "; break;
case "Abr": $sFecha = $sFecha . "April "; break;
case "May": $sFecha = $sFecha . "May "; break;
case "Jun": $sFecha = $sFecha . "June "; break;
case "Jul": $sFecha = $sFecha . "July "; break;
case "Aug": $sFecha = $sFecha . "August "; break;
case "Ago": $sFecha = $sFecha . "August "; break;
case "Sep": $sFecha = $sFecha . "September "; break;
case "Oct": $sFecha = $sFecha . "October "; break;
case "Nov": $sFecha = $sFecha . "November "; break;
case "Dec": $sFecha = $sFecha . "December "; break;
case "Dic": $sFecha = $sFecha . "December "; break;
}
$sFecha = $sFecha . substr($prebill_date,0,2).", ";
$sFecha = $sFecha . substr($prebill_date,7,4);
#== Conexión a Zoho Creator para obtener los registros de tiempos asociados a la Orden de Cobro
//$request_url = 'https://creator.zoho.com/api/json/'.$app_name_ZC.'/view/For_Sincronize_Times?scope=creatorapi&raw=true&authtoken='.$authtoken_ZC.'&criteria=(Prebills='.$bRecId.')';
$request_url = 'https://creator.zoho.com/api/v2/'.$appOwner.'/'.$app_name_ZC.'/report/For_Sincronize_Times?criteria=(Prebills='.$bRecId.')';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Zoho-oauthtoken ' . $coa_access_token));
$r = curl_exec($ch);
$array = json_decode($r);
//$bdDatTime = $array->TimeEntry;
$bdDatTime = $array->data;
#== Conexión a Zoho Creator para obtener los registros de tiempos asociados a la Orden de Cobro ordenados por fecha
//$request_url = 'https://creator.zoho.com/api/json/'.$app_name_ZC.'/view/Times_Order_for_Date?scope=creatorapi&raw=true&authtoken='.$authtoken_ZC.'&criteria=(Prebills='.$bRecId.')';
$request_url = 'https://creator.zoho.com/api/v2/'.$appOwner.'/'.$app_name_ZC.'/report/Times_Order_for_Date?criteria=(Prebills='.$bRecId.')';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Zoho-oauthtoken ' . $coa_access_token));
$r = curl_exec($ch);
$array = json_decode($r);
//$bdTimeOrdered = $array->TimeEntry;
$bdTimeOrdered = $array->data;
// SRL $prebill_prestserv = "Del ";
$prebill_prestserv = "";
$TotRegsTie = count($bdTimeOrdered);
if($TotRegsTie > 0){
for ($i = 0; $i < $TotRegsTie; $i++){
if($i == 0)
{
$prebill_prestserv = $prebill_prestserv . substr($bdTimeOrdered[$i]->WorkDate,0,2);
}
if($i == $TotRegsTie-1)
{
$sMes = substr($bdTimeOrdered[$i]->WorkDate,3,3);
switch($sMes){
case "Jan": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "january, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Ene": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "january, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Feb": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "february, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Mar": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "march, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Apr": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "april, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Abr": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "april, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "May": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "may, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Jun": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "june, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Jul": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "july, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Aug": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "august, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Ago": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "august, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Sep": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "september, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Oct": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "october, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Nov": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "november, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Dec": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "december, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
case "Dic": $prebill_prestserv = $prebill_prestserv . " to " . substr($bdTimeOrdered[$i]->WorkDate,0,2) . " " . "december, " . substr($bdTimeOrdered[$i]->WorkDate,7,4); break;
}
}
}
}
#== Conexión a Zoho Creator para obtener los registros de gastos asociados a la Orden de Cobro
//$request_url = 'https://creator.zoho.com/api/json/'.$app_name_ZC.'/view/Disbursements_Query?scope=creatorapi&raw=true&authtoken='.$authtoken_ZC.'&criteria=(Prebills='.$bRecId.')';
$request_url = 'https://creator.zoho.com/api/v2/'.$appOwner.'/'.$app_name_ZC.'/report/Disbursements_Query?criteria=(Prebills='.$bRecId.')';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Zoho-oauthtoken ' . $coa_access_token));
$r = curl_exec($ch);
$array = json_decode($r);
//$bdDatDisb = $array->Disbursements;
$bdDatDisb = $array->data;
/* SRL
#== Conexión a Zoho Creator para obtener los registros de honorarios fijos asociados a la Orden de Cobro
//$request_url = 'https://creator.zoho.com/api/json/'.$app_name_ZC.'/view/Fixed_Fees_Query?scope=creatorapi&raw=true&authtoken='.$authtoken_ZC.'&criteria=(Prebills='.$bRecId.')';
$request_url = 'https://creator.zoho.com/api/v2/'.$appOwner.'/'.$app_name_ZC.'/report/Fixed_Fees_Query?criteria=(Prebills='.$bRecId.')';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Zoho-oauthtoken ' . $coa_access_token));
$r = curl_exec($ch);
$array = json_decode($r);
//$bdDatHonF = $array->Fixed_Fees;
$bdDatHonF = $array->data;
*/
$SendaArchsGraf = "archs_graf/";
$SendaArchsCFDI = "archs_cfdi/";
$NomArchPDF = "OC_SEPLAW_".$prebill_number.".PDF";
$GLOBALS['footOne'] = "Av. Santa Fe 505, P. 3-303, Col. Cruz Manca, Cuajimalpa, Ciudad de México, C.P. 05349";
$GLOBALS['footTwo'] = "www.seplaw.com.mx";
$SendaArchsCFDI = "archs_cfdi/";
$SendaArchsGraf = "archs_graf/";
#============================================================================================================
#== 1. CREAMOS LA CLASE Y OBTENEMOS LOS DATOS BASICOS DEL REPORTE
#============================================================================================================
class PDF extends FPDF
{
function SetDash($black=null, $white=null)
{
if($black!==null)
$s=sprintf('[%.3F %.3F] 0 d',$black*$this->k,$white*$this->k);
else
$s='[] 0 d';
$this->_out($s);
}
function Header()
{
}
function Footer()
{
if( $this->PageNo() == 1)
{
$this->SetTextColor(81,81,81);
$this->SetFont('arial','',8.5);
$this->SetXY(1.0,26.7);
$this->MultiCell(19.0, 0.25, utf8_decode($GLOBALS['footOne']), 0, 'C', 0);
$this->SetTextColor(81,81,81);
$this->SetFont('arial','',8.5);
$this->SetXY(1.0,$this->GetY());
$this->Cell(19, 0.25, utf8_decode($GLOBALS['footTwo']), 0, 1,'C', 0);
}
else
{
$this->SetTextColor(0,0,0);
$this->SetFont('arial','',10);
$this->SetXY(19.4,26.9);
$this->Cell(1.5, 0.25, $this->PageNo().'/{nb}', 0, 1,'R', 0);
}
}
}
#============================================================================================================
#== 2. CONSTRUYENDO EL DOCUMENTOS CON LA LIBRERÍA FPDF
#============================================================================================================
$pdf=new PDF('P','cm','Letter');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->AddFont('IDAutomationHC39M','','IDAutomationHC39M.php');
$pdf->AddFont('verdana','','verdana.php');
$pdf->SetAutoPageBreak(true);
$pdf->SetMargins(0, 0, 0);
$pdf->SetLineWidth(0.02);
$pdf->SetFillColor(0,0,0);
#============================================================================================================
#== 2.1 ENCABEZADO DE LA FACTURA
#============================================================================================================
$X = 0;
$Y = 0;
$pdf->image("archs_graf/Logo_Prebills_Main.png",$X+5.08, $Y+1 , 11.32, 4.55);
$pdf->image("archs_graf/Firma_Seplaw.png",$X+7.15, $Y+16.0 , 7.25, 1.43);
//SRL Febrero 2, 2021
//Cambio de etiquetas a ingles
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','',8);
$pdf->SetXY($X+2,$Y+5.30);
$pdf->Cell(3.5, 0.25, utf8_decode("FEES AND EXPENSES STATEMENT"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+15,$Y+6.0);
$pdf->Cell(4.0, 0.25, utf8_decode(" ".$sFecha), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+7.00);
$pdf->Cell(2.5, 0.25, utf8_decode("Client:"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+4.0,$Y+7.00);
$pdf->Cell(4.0, 0.25, utf8_decode($prebill_client), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+4.00,$Y+7.5);
//$pdf->MultiCell(14, 0.45, utf8_decode($prebill_domicilio), 0, 'J', 0);
$pdf->Cell(14.0, 0.25, utf8_decode($prebill_domicilio), 0, 1,'L', 0);
$pdf->SetXY($X+4.00,$Y+7.9);
$pdf->Cell(14.0, 0.25, utf8_decode($prebill_colonia)." ".utf8_decode($prebill_ciudad), 0, 1,'L', 0);
$pdf->SetXY($X+4.00,$Y+8.3);
$pdf->Cell(14.0, 0.25, utf8_decode($prebill_codigo)." ".utf8_decode($prebill_estado), 0, 1,'L', 0);
$pdf->SetXY($X+4.00,$Y+8.7);
$pdf->Cell(14.0, 0.25, utf8_decode($prebill_pais), 0, 1,'L', 0);
/*
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+4.00,$Y+7.5);
$pdf->Cell(2.5, 0.25, utf8_decode("Boulevard Presidente Adolfo Ruiz Cortines No. 3433"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+4.00,$Y+8.0);
$pdf->Cell(2.5, 0.25, utf8_decode("Col. San Jerónimo Lídice, alcaldía La Magdalena Contreras"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+4.00,$Y+8.5);
$pdf->Cell(2.5, 0.25, utf8_decode("10200, Ciudad de México"), 0, 1,'L', 0);
*/
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+10.00);
$pdf->Cell(2.5, 0.25, utf8_decode("Att'n:"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+4.0,$Y+10.00);
$pdf->Cell(4.0, 0.25, utf8_decode($$prebill_attention), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+11.00);
$pdf->Cell(2.5, 0.25, utf8_decode("I. Fees for professional services described in enclosed exhibit"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+14,$Y+11.00);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+15.0,$Y+11.00);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+16.0,$Y+11.00);
$pdf->Cell(3.0, 0.25, number_format($prebill_Fees,2), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+11.50);
$pdf->Cell(2.5, 0.25, utf8_decode("II. Expenses incurred in connection with professional services"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+14,$Y+11.50);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+15.0,$Y+11.50);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+16.0,$Y+11.50);
$pdf->Cell(3.0, 0.25, number_format($prebill_Disbur,2), 0, 1,'R', 0);
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.05);
$pdf->line(16.0, 12.0, 19.0, 12.0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+10,$Y+12.250);
$pdf->Cell(3.0, 0.25, utf8_decode("Subtotal:"), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+14,$Y+12.250);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+15,$Y+12.250);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+16.0,$Y+12.250);
$pdf->Cell(3.0, 0.25, number_format($prebill_SubTot,2), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+10,$Y+13.0);
$pdf->Cell(3.0, 0.25, utf8_decode("V.A.T. (".number_format($prebill_PorIva,0)." %)"), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+14,$Y+13.0);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+15,$Y+13.0);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+16.0,$Y+13.0);
$pdf->Cell(3.0, 0.25, number_format($prebill_ImpIva,2), 0, 1,'R', 0);
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.05);
$pdf->line(16.0, 13.5, 19.0, 13.5);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+10,$Y+13.75);
$pdf->Cell(3.0, 0.25, utf8_decode("Total:"), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+14,$Y+13.75);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+15,$Y+13.75);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+16.0,$Y+13.75);
$pdf->Cell(3.0, 0.25, number_format($prebill_Import,2), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+2.0,$Y+15.0);
// $pdf->MultiCell(17, 0.45, utf8_decode(convert_number_to_words($strTotal,$prebill_currency) ), 0, 'C', 0);
$pdf->MultiCell(17, 0.45, utf8_decode(strtolower($sNumToLet)), 0, 'C', 0);
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.03);
$pdf->line(7.0, 17.5, 15.0, 17.5);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+8,$Y+17.7);
$pdf->Cell(1.0, 0.25, utf8_decode("SEPÚLVEDA Y DÍAZ NORIEGA, S.C."), 0, 1,'L', 0);
// SRL Febrero 2, 2021 Cambio fuente para poner negritas y cortar el renglon
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY($X+2,$Y+18.5);
$pdf->Cell(1.0, 0.25, utf8_decode("Below is the information to make payment by wire transfer to our Mexican Bank account in US Dollars,"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY($X+2,$Y+19.0);
$pdf->Cell(1.0, 0.25, utf8_decode("through its correspondent US Bank:"), 0, 1,'L', 0);
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.03);
$pdf->line(2.0, 19.5, 19.0, 19.5);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+20.50);
$pdf->Cell(1.0, 0.25, utf8_decode("Correspondent US Bank:"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+7.5,$Y+20.50);
$pdf->Cell(5.0, 0.25, utf8_decode("JP MORGAN CHASE BANK"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+21.00);
$pdf->Cell(1.0, 0.25, utf8_decode("Mexican Bank:"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+7.5,$Y+21.00);
$pdf->Cell(5.0, 0.25, utf8_decode("Banco Santander, (México) S.A."), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+21.50);
$pdf->Cell(1.0, 0.25, utf8_decode("Account holder/beneficiary:"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+7.5,$Y+21.50);
$pdf->Cell(5.0, 0.25, utf8_decode("Sepúlveda y Díaz Noriega, S.C."), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+22.00);
$pdf->Cell(1.0, 0.25, utf8_decode("Swift Code:"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+7.5,$Y+22.00);
$pdf->Cell(5.0, 0.25, utf8_decode("BMSXMXMMXXX"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+22.50);
$pdf->Cell(1.0, 0.25, utf8_decode("Account No.:"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+7.5,$Y+22.50);
$pdf->Cell(5.0, 0.25, utf8_decode("82-50065878-9"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY($X+2,$Y+23.00);
$pdf->Cell(1.0, 0.25, utf8_decode("Clabe number:"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+7.5,$Y+23.00);
$pdf->Cell(5.0, 0.25, utf8_decode("014180825006587896"), 0, 1,'L', 0);
$pdf->AddPage();
TitulosPag($pdf);
$X = 0;
$Y = 0;
// SRL 2021/02/03 Modificar la fuente para poner negritas.
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',10);
$pdf->SetXY($X+2,$Y+6.50);
$pdf->Cell(2.5, 0.25, utf8_decode("Services provided to:"), 0, 1,'L', 0);
/* SRL
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+4.5,$Y+6.50);
$pdf->Cell(4.0, 0.25, utf8_decode($prebill_client), 0, 1,'L', 0);
*/
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+6.0,$Y+6.50);
$pdf->Cell(4.0, 0.25, utf8_decode($prebill_client), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY($X+6.0,$Y+7.00);
$pdf->Cell(4.0, 0.25, utf8_decode($prebill_matter), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',10);
$pdf->SetXY($X+2,$Y+7.75);
$pdf->Cell(2.5, 0.25, utf8_decode("During: ".strtolower($prebill_prestserv)), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',10);
$pdf->SetXY($X+2,$Y+8.50);
$pdf->Cell(2.5, 0.25, utf8_decode("Description of Services:"), 0, 1,'L', 0);
TitulosTie($pdf,8.0);
$X = 0;
$Y = 10.0;
#============================================================================================================
#== 2.2 REGISTROS DE TIEMPOS
#============================================================================================================
$Puntero = $pdf->GetY();
$TotRegsTie = count($bdDatTime);
if($TotRegsTie > 0){
$Y = $pdf->GetY()+0.20;
$Y = $Y+0.5;
$Puntero = $Y;
for ($i = 0; $i < $TotRegsTie; $i++){
if ($Puntero > 24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
TitulosTie($pdf,5.0);
$Y = 7.0;
}
$time_timekeeper = "";
foreach ( $bdDatTime[$i] as $nombre => $hexa ) {
if($nombre == "Timekeeper.Identity")
{
$time_timekeeper = $hexa;
}
}
//srl mm/dd/yy
$sMesWork = substr($bdDatTime[$i]->WorkDate,3,3);
switch($sMesWork){
case "Jan": $sDateWork = "01/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Ene": $sDateWork = "01/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Feb": $sDateWork = "02/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Mar": $sDateWork = "03/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Apr": $sDateWork = "04/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Abr": $sDateWork = "04/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "May": $sDateWork = "05/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Jun": $sDateWork = "06/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Jul": $sDateWork = "07/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Aug": $sDateWork = "08/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Ago": $sDateWork = "08/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Sep": $sDateWork = "09/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Oct": $sDateWork = "10/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Nov": $sDateWork = "11/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Dec": $sDateWork = "12/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
case "Dic": $sDateWork = "12/".substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,9,2); break;
}
//$sDateWork = strtolower(substr($bdDatTime[$i]->WorkDate,0,2)."/".substr($bdDatTime[$i]->WorkDate,3,3)."/".substr($bdDatTime[$i]->WorkDate,9,2));
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',9);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(3.5, 0.25, utf8_decode($sDateWork), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',9);
$pdf->SetXY(3.9,$Y);
$pdf->Cell(1.3, 0.25, utf8_decode($time_timekeeper), 0, 1,'C', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',9);
$pdf->SetXY(17.0,$Y);
$pdf->Cell(2.0, 0.25, number_format($bdDatTime[$i]->dHours,2), 0, 1,'C', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',9);
$pdf->SetXY(5.5,$Y);
$pdf->MultiCell(11.5, 0.30, utf8_decode(trim($bdDatTime[$i]->Description)), 0, 'J', 0);
$YY = $pdf->GetY()+0.50;
$Puntero = $pdf->GetY();
$Y = $YY;
}
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.02);
$pdf->line(2.0, $Y-0.1, 19.0, $Y-0.1);
$pdf->SetFont('arial','B',10);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(3.5, 0.25, "Total Fees", 0, 1,'L', 0);
$pdf->SetXY(17.0,$Y);
$pdf->Cell(2.0, 0.25, number_format($prebill_Factur,2), 0, 1,'C', 0);
$Puntero = $pdf->GetY();
}
if ($Puntero > 24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 5.0;
}
$Y = $Y + 1.0;
#============================================================================================================
#== 2.2 RESUMEN DE HONORARIOS
#============================================================================================================
$pdf->SetFont('arial','B',12);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(18, 0.25, "FEES SUMMARY", 0, 1,'C', 0);
$X = $X;
$Y = $Y+0.5;
$Puntero = $Y;
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 5.0;
}
$TotRegsTie = count($prebill_SummTks);
if($TotRegsTie > 0){
$Regs = 0;
$Y = $pdf->GetY()+0.20;
$Y = $Y+0.5;
$pdf->SetFont('arial','B',10);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(6.35, 0.60, utf8_decode("Professional"), 0, 1,'L', 0);
$pdf->SetXY(10.5,$Y);
$pdf->SetTextColor(0,0,0);
$pdf->Cell(3.5, 0.60, utf8_decode("Rate per Hr."), 0, 1,'L', 0);
$pdf->SetFont('arial','B',10);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(13.80,$Y);
$pdf->Cell(2.00, 0.60, utf8_decode("Work Hours"), 0, 1,'R', 0);
$pdf->SetFont('arial','B',10);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(17.0,$Y);
$pdf->Cell(2.50, 0.60, utf8_decode("Total Fees"), 0, 1,'R', 0);
$Y = $Y+0.7;
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.02);
$pdf->line(2.0, $Y-0.2, 19.50, $Y-0.2);
for ($i = 0; $i < $TotRegsTie; $i++){
$pdf->SetFont('arial','B',10);
$pdf->SetTextColor(0,0,0);
if($prebill_SummTks[$i]->TotImp > 0)
{
$pdf->SetXY(2.00,$Y);
$pdf->Cell(6.25, 0.30, utf8_decode($prebill_SummTks[$i]->Name), 0, 1,'L', 0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY(8.2,$Y);
$pdf->Cell(3.5, 0.30, utf8_decode("[".$prebill_SummTks[$i]->Clave."]"), 0, 1,'L', 0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY(10.00, $Y);
$pdf->Cell(3.5, 0.30, utf8_decode($prebill_currency." $"), 0, 1,'L', 0);
$pdf->SetFont('arial','B',10);
$pdf->SetXY(10.70,$Y);
$pdf->Cell(2.00, 0.30, number_format($prebill_SummTks[$i]->Rate,2), 0, 1,'R', 0);
$pdf->SetFont('arial','B',10);
$pdf->SetXY(13.8,$Y);
$pdf->Cell(2.00, 0.30, number_format($prebill_SummTks[$i]->TotHrs,2), 0, 1,'R', 0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY(16.20,$Y);
$pdf->Cell(3.5, 0.30, utf8_decode($prebill_currency." $"), 0, 1,'L', 0);
$pdf->SetFont('arial','B',10);
$pdf->SetXY(17.0,$Y);
$pdf->Cell(2.50, 0.30, number_format($prebill_SummTks[$i]->TotImp,2), 0, 1,'R', 0);
//$pdf->SetDrawColor(140,133,169);
//$pdf->line(1.0, $Y-0.1, 20.45, $Y-0.1);
$YY = $pdf->GetY()+0.18;
$Puntero = $pdf->GetY();
$Y = $YY;
$Regs++;
if ($Puntero>25.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 5.0;
}
}
}
$Y = $pdf->GetY()+0.50;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',12);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(10.0, 0.60, "Total Fees Sum: " . utf8_decode($prebill_currency) . " $ " . number_format($prebill_Fees,2), 0, 1,'L', 0);
}
if ($Puntero > 24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 5.0;
}
$Y = $Y + 2.0;
#============================================================================================================
#== 2.2 DETALLE DE GASTOS
#============================================================================================================
if($TotRegsGas > 0)
{
$pdf->SetFont('arial','B',12);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(18, 0.25, "EXPENSES", 0, 1,'C', 0);
$X = $X;
$Y = $Y+0.5;
$Puntero = $Y;
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
}
$TotRegsGas = count($bdDatDisb);
if($TotRegsGas > 0){
$Regs = 0;
$Y = $pdf->GetY()+0.20;
$Y = $Y+0.5;
$pdf->SetFont('arial','B',10);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(2.00, 0.60, utf8_decode("Date"), 0, 1,'L', 0);
$pdf->SetXY(5.0,$Y);
$pdf->SetTextColor(0,0,0);
$pdf->Cell(10.0, 0.60, utf8_decode("Description"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(16.00,$Y);
$pdf->Cell(3.00, 0.60, utf8_decode("Amount (".$prebill_currency.")"), 0, 1,'R', 0);
$Y = $Y+0.7;
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.02);
$pdf->line(2.0, $Y-0.2, 19.50, $Y-0.2);
for ($i = 0; $i < $TotRegsGas; $i++){
$sDateWork = strtolower(substr($bdDatDisb[$i]->WorkDate,0,2)."/".substr($bdDatDisb[$i]->WorkDate,3,3)."/".substr($bdDatDisb[$i]->WorkDate,9,2));
$pdf->SetFont('verdana','',10);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(2.10,$Y);
$pdf->Cell(2.0, 0.30, utf8_decode($sDateWork), 0, 1,'L', 0);
$pdf->SetFont('verdana','',9);
$pdf->SetXY(16.20,$Y);
$pdf->Cell(1.5, 0.30, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(17.0,$Y);
$pdf->Cell(2.45, 0.30, number_format($bdDatDisb[$i]->Import,2), 0, 1,'R', 0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(5.0,$Y);
$pdf->MultiCell(10.0, 0.30, utf8_decode(trim($bdDatDisb[$i]->Description)), 0, 'J', 0);
$YY = $pdf->GetY()+0.20;
$Puntero = $pdf->GetY();
$Y = $YY;
$Regs++;
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
}
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.02);
$pdf->line(2.0, $Y, 19.50, $Y);
$Y = $Y + 0.20;
$pdf->SetFont('arial','B',10);
$pdf->SetXY(16.20,$Y);
$pdf->Cell(1.5, 0.30, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetXY(17.0,$Y);
$pdf->Cell(2.45, 0.30, number_format($prebill_Disbur,2), 0, 1,'R', 0);
$Y = $Y + 1.0;
}
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
/*
//SRL 2021/02/12 No se despliega el resumen de gastos a solicitud del cliente
#============================================================================================================
#== 2.2 RESUMEN DE GASTOS
#============================================================================================================
$pdf->SetFont('arial','B',12);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(18, 0.25, "EXPENSES SUMMARY", 0, 1,'C', 0);
$X = $X;
//SRL De 0.5 a 1.0
$Y = $Y+1.0;
$Puntero = $Y;
//SRL 2021/02/04 Agregar linea
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.02);
$pdf->line(2.0, $Y-0.2, 19.50, $Y-0.2);
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 5.0;
}
$TotRegsTie = count($prebill_SummCha);
if($TotRegsTie > 0){
$Regs = 0;
$Y = $pdf->GetY()+0.20;
$Y = $Y+0.5;
for ($i = 0; $i < $TotRegsTie; $i++){
$pdf->SetFont('verdana','',10);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',9);
$pdf->SetXY(16.20,$Y);
$pdf->Cell(1.5, 0.30, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(17.00,$Y);
$pdf->Cell(2.45, 0.30, number_format($prebill_SummCha[$i]->TotDis,2), 0, 1,'R', 0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(2.10,$Y);
$pdf->MultiCell(14.0, 0.30, utf8_decode($prebill_SummCha[$i]->Name), 0, 'L', 0);
$YY = $pdf->GetY()+0.18;
$Puntero = $pdf->GetY();
$Y = $YY;
$Regs++;
if ($Puntero>25.5)
{
$pdf->AddPage();
TitulosPag($pdf);
}
}
//SRL Agregar linea
$Y = $Y+0.5;
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.02);
$pdf->line(2.0, $Y-0.2, 19.50, $Y-0.2);
$Y = $pdf->GetY()+0.50;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',12);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(10.0, 0.60, "Total Expense Sum: " . utf8_decode($prebill_currency) . " $ " . number_format($prebill_Disbur,2), 0, 1,'L', 0);
$Y = $Y + 1.0;
}
$Y = $Y + 1.0;
$Puntero = $pdf->GetY();
// SRL De 23.5 a 24.5
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 5.0;
}
*/
#============================================================================================================
#== 2.2 TOTALES GENERALES
#============================================================================================================
/*
$pdf->SetFont('arial','B',12);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(18, 0.25, "Grand Total:", 0, 1,'L', 0);
*/
$Y = $Y + 1.0;
$Puntero = $pdf->GetY();
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
$pdf->SetFont('arial','B',12);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(18, 0.25, "Grand Total:", 0, 1,'L', 0);
$Y = $Y + 1.0;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(5.5, 0.25, utf8_decode("I. Fees for professional services described in enclosed exhibit"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(14,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(15.0,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(16.0,$Y);
$pdf->Cell(3.0, 0.25, number_format($prebill_Fees,2), 0, 1,'R', 0);
$Y = $Y + 0.50;
$Puntero = $pdf->GetY();
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(2,$Y);
$pdf->Cell(2.5, 0.25, utf8_decode("II. Expenses incurred in connection with professional services"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(14,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(15.0,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(16.0,$Y);
$pdf->Cell(3.0, 0.25, number_format($prebill_Disbur,2), 0, 1,'R', 0);
$Y = $Y + 0.50;
$Puntero = $pdf->GetY();
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.05);
$pdf->line(16.0, $Y, 19.0, $Y);
$Y = $Y + 0.25;
$Puntero = $pdf->GetY();
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(10,$Y);
$pdf->Cell(3.0, 0.25, utf8_decode("Subtotal:"), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(14,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(15,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(16.0,$Y);
$pdf->Cell(3.0, 0.25, number_format($prebill_SubTot,2), 0, 1,'R', 0);
$Y = $Y + 0.50;
$Puntero = $pdf->GetY();
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(10,$Y);
$pdf->Cell(3.0, 0.25, utf8_decode("V.A.T. (".number_format($prebill_PorIva,0)." %)"), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(14,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(15,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('verdana','',10);
$pdf->SetXY(16.0,$Y);
$pdf->Cell(3.0, 0.25, number_format($prebill_ImpIva,2), 0, 1,'R', 0);
$Y = $Y + 0.50;
$Puntero = $pdf->GetY();
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.05);
$pdf->line(16.0, $Y, 19.0, $Y);
$Y = $Y + 0.25;
$Puntero = $pdf->GetY();
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(10,$Y);
$pdf->Cell(3.0, 0.25, utf8_decode("Total:"), 0, 1,'R', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(14,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode($prebill_currency), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(15,$Y);
$pdf->Cell(1.0, 0.25, utf8_decode("$"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(16.0,$Y);
$pdf->Cell(3.0, 0.25, number_format($prebill_Import,2), 0, 1,'R', 0);
$Y = $Y + 1.00;
$Puntero = $pdf->GetY();
if ($Puntero>24.5)
{
$pdf->AddPage();
TitulosPag($pdf);
$Y = 6.0;
}
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',11);
$pdf->SetXY(2.0,$Y);
// $pdf->MultiCell(17, 0.45, utf8_decode(convert_number_to_words($strTotal,$prebill_currency) ), 0, 'C', 0);
$pdf->MultiCell(17, 0.45, utf8_decode(strtolower($sNumToLet)), 0, 'C', 0);
$Y = $pdf->GetY()+0.50;
$pdf->SetFont('verdana','',10);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(2.0,$Y);
$pdf->Cell(19, 0.25, "-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.", 0, 1,'C', 0);
#============================================================================================================
#== 2.6 SE GRABA EL DOCUMENTO .PDF EN EL DISCO DURO
#============================================================================================================
$pdf->Output($SendaArchsCFDI.$NomArchPDF, 'F');
#============================================================================================================
#== 2.7 DESCOMENTAR SI ESTÁ UTILIZANDO EL SISTEMA OPERATIVO LINUX.
#============================================================================================================
chmod ($SendaArchsCFDI.$NomArchPDF,0777);
#============================================================================================================
#== 2.8 SE MUESTRA EL DOCUMENTO .PDF EN EL NAVEGADOR.
#============================================================================================================
// $pdf->Output($SendaArchsCFDI.$NomArchPDF, 'I');
#============================================================================================================
# 2.9 Envio del Archivos a Zoho Creator
#============================================================================================================
if($organi_id_ZB == "" && $invoiceID == "")
{
$file_name_with_full_path = '/var/www/html/aptusCFDIRF/archs_cfdi/'.$NomArchPDF;
//$request_url = 'https://creator.zoho.com/api/xml/fileupload/scope=creatorapi';
$request_url = 'https://creator.zoho.com/api/v2/'.$appOwner.'/'.$app_name_ZC.'/report/Prebills_Report/' . $bRecId . '/File_PDF_OC/upload';
if (function_exists('curl_file_create')) { // php 5.6+
$cFile = curl_file_create($file_name_with_full_path);
}
else
{
$cFile = '@' . realpath($file_name_with_full_path);
}
$post = array(
// 'authtoken' => $authtoken_ZC,
// 'applinkname' => $app_name_ZC,
// 'formname' => 'Prebills',
// 'fieldname' => 'File_PDF_OC',
// 'recordId' => $bRecId,
// 'filename' => $NomArchPDF,
'file'=> $cFile);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Zoho-oauthtoken ' . $coa_access_token));
$r = curl_exec($ch);
curl_close ($ch);
}
#============================================================================================================
# 2.10 Envio del Archivos a Zoho Books
#============================================================================================================
if($organi_id_ZB <> "" && $invoiceID <> "")
{
//echo $organi_id_ZB."test".$invoiceID;
# Obtenemos el access token de Zoho Books
$bRefreshToken = $aDatPac["B_OAuth_refresh_token"];
$bClientId = $aDatPac["B_OAuth_client_id"];
$bClientSecret = $aDatPac["B_OAuth_client_secret"];
$bRedirectUri = $aDatPac["B_OAuth_redirect_uri"];
$bGrantType = $aDatPac["B_OAuth_grant_type"];
$bAuthUrl = "https://accounts.zoho.com/oauth/v2/token";
//echo $bRefreshToken."
".$bClientId."
".$bClientSecret."
".$bRedirectUri."
".$bGrantType;
// $bParams = array(
// "refresh_token" => $bRefreshToken,
// "client_id" => $bClientId,
// "client_secret" => $bClientSecret,
// "redirect_uri" => $bRedirectUri,
// "grant_type" => $bGrantType
// );
// $curl = curl_init();
// curl_setopt($curl, CURLOPT_URL, $bAuthUrl);
// curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
// curl_setopt($curl, CURLOPT_POSTFIELDS, $bParams);
// curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
// $response = curl_exec($curl);
// $array = json_decode($response);
// $boa_access_token = $array->access_token;
$boa_access_token = oauth('Seplaw', 'ZBooks', $bRefreshToken, $bClientId, $bClientSecret, $bRedirectUri, $bGrantType, $bAuthUrl);
//$boa_access_token = oauth($appOwner, 'ZBooks', $bRefreshToken, $bClientId, $bClientSecret, $bRedirectUri, $bGrantType, $bAuthUrl);
$file_name_with_full_path = '/var/www/html/aptusCFDIRF/archs_cfdi/'.$NomArchPDF;
echo $file_name_with_full_path;
$request_url = 'https://www.zohoapis.com/books/v3/invoices/'.$invoiceID.'/attachment';
if (function_exists('curl_file_create')) { // php 5.6+
$cFile = curl_file_create($file_name_with_full_path);
}
else
{
$cFile = '@' . realpath($file_name_with_full_path);
}
$post = array(
// 'authtoken' => $authtoken_ZB,
'organization_id' => $organi_id_ZB,
// 'can_send_in_mail' => 'true',
'attachment'=> $cFile);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Zoho-oauthtoken ' . $boa_access_token));
$r = curl_exec($ch);
# Usamos la funcion curl_errno() para atrapar cualquier error relacionado con la llamada.
if (curl_errno($ch))
{
$error_msg = curl_error($ch);
}
curl_close ($ch);
if (isset($error_msg))
{
$j_array = array('code' => '666', 'message' => "Error en la llamada curl " . $error_msg);
$Resultado = json_encode($j_array);
echo $Resultado;
return;
}
else
{
$ra = json_decode($r);
$resultPDF = $ra->code.' - '.$ra->message;
$code = (int)$ra->code;
if ($code != 0)
{
$j_array = array('code' => $ra->code, 'message' => "No se pudo adjuntar el archivo a Books, contacte al administrador " . $ra->message);
$Resultado = json_encode($j_array);
echo $Resultado;
return;
}
}
}
$j_array = array('code' => "200", 'message' => "Proceso de creacion de Orden de Cobro fue exitoso");
$Resultado = json_encode($j_array);
echo $Resultado;
return;
#============================================================================================================
#== FUNCIONES GENERALES
#============================================================================================================
function TitulosPag($pdf){
$pdf->image("archs_graf/Logo_Prebills_Second.png",9.0, 1 , 11.32, 4.55);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','',8);
$pdf->SetXY(2,5.30);
$pdf->Cell(3.5, 0.25, utf8_decode("DESCRIPTION OF SERVICES"), 0, 1,'L', 0);
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.03);
$pdf->line(2.0, 5.6, 19.0, 5.6);
}
function TitulosTie($pdf, $Y){
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY(17.5,$Y+1.00);
$pdf->Cell(3.5, 0.25, utf8_decode("Work"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY(2.0,$Y+1.50);
$pdf->Cell(3.5, 0.25, utf8_decode("Date"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY(3.5,$Y+1.50);
$pdf->Cell(3.5, 0.25, utf8_decode("Professional"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY(10.0,$Y+1.50);
$pdf->Cell(3.5, 0.25, utf8_decode("Description"), 0, 1,'L', 0);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('arial','B',9);
$pdf->SetXY(17.5,$Y+1.50);
$pdf->Cell(3.5, 0.25, utf8_decode("Hours"), 0, 1,'L', 0);
$pdf->SetDrawColor(0,0,0);
$pdf->SetLineWidth(0.02);
$pdf->line(2.0, $Y+1.80, 19.0, $Y+1.80);
}
function TitulosGas($pdf, $Y ){
$Y = $Y + 0.24;
$pdf->SetFont('arial','',10);
$pdf->SetXY(1.0,$Y);
$pdf->SetFillColor(60,61,58);
$pdf->Cell(12.5, 0.60, "", 0, 1,'L', 1);
$pdf->SetTextColor(255,255,255);
$pdf->SetXY(1.25,$Y);
$pdf->Cell(12.5, 0.60, utf8_decode($lblAboFec), 0, 1,'L', 1);
$pdf->SetFont('arial','',10);
$pdf->SetXY(13.5,$Y);
$pdf->SetFillColor(60,61,58);
$pdf->SetTextColor(255,255,255);
$pdf->Cell(2.00, 0.60, $lblCantid, 0, 1,'R', 1);
$pdf->SetFont('arial','',10);
$pdf->SetXY(15.5,$Y);
$pdf->SetFillColor(60,61,58);
$pdf->SetTextColor(255,255,255);
$pdf->Cell(2.50, 0.60, $lblTarifa, 0, 1,'R', 1);
$pdf->SetFont('arial','',10);
$pdf->SetXY(18.0,$Y);
$pdf->SetFillColor(60,61,58);
$pdf->SetTextColor(255,255,255);
$pdf->Cell(2.45, 0.60, $lblImport, 0, 1,'R', 1);
}