1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00
invoiceninja/app/Services/Template/TemplateMock.php

90 lines
417 KiB
PHP
Raw Normal View History

2023-09-27 12:36:08 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Services\Template;
use App\Models\Company;
use App\Services\Pdf\PdfMock;
class TemplateMock
{
2023-09-27 13:11:47 +02:00
public array $engines = [];
public array $variables = [];
public string $credit_data = '[{"id":"mWZdPwbKgR","user_id":"wMvbmOeYAl","project_id":"","assigned_user_id":"","vendor_id":"","amount":881.03,"balance":548.03,"client_id":"QJ0dN6dLOv","status_id":"3","design_id":"Wpmbk5ezJn","created_at":1695796650,"updated_at":1695799160,"archived_at":0,"is_deleted":false,"number":"0001","discount":2,"po_number":"Quisquam.","date":"2023-06-30","last_sent_date":"","next_send_date":"","reminder1_sent":"","reminder2_sent":"","reminder3_sent":"","reminder_last_sent":"","due_date":"2007-03-30","terms":"Voluptatem et aliquid enim dolorem rerum voluptatem. Doloremque magni nesciunt unde nobis omnis quas. Aut totam adipisci voluptatum explicabo qui fugit assumenda. Soluta architecto sit exercitationem amet doloribus ad vel qui. Eos porro qui voluptatum sint. Consequatur voluptatem eveniet vitae illo ea. Rem enim sit impedit odit.","public_notes":"","private_notes":"","uses_inclusive_taxes":false,"tax_name1":"GST","tax_rate1":10,"tax_name2":"VAT","tax_rate2":17.5,"tax_name3":"","tax_rate3":0,"total_taxes":190.03,"is_amount_discount":true,"footer":"","partial":0,"partial_due_date":"","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","has_tasks":false,"has_expenses":false,"custom_surcharge1":0,"custom_surcharge2":0,"custom_surcharge3":0,"custom_surcharge4":0,"custom_surcharge_tax1":false,"custom_surcharge_tax2":false,"custom_surcharge_tax3":false,"custom_surcharge_tax4":false,"line_items":[{"quantity":1,"cost":693,"product_key":"Sed.","notes":"Est sequi.","discount":0,"is_amount_discount":true,"tax_name1":"","tax_rate1":0,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":693,"gross_line_total":693,"custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"56","custom_value3":"Dolores porro quia.","custom_value4":"Perferendis itaque.","type_id":"1","product_cost":0,"tax_amount":0,"date":"","tax_id":"","task_id":"","expense_id":""}],"entity_type":"credit","exchange_rate":1,"paid_to_date":333,"subscription_id":"","client":{"id":"QJ0dN6dLOv","user_id":"wMvbmOeYAl","assigned_user_id":"","name":"Paucek and Sons","website":"http:\/\/www.wiegand.com\/sit-repellendus-enim-porro-aut-voluptas-voluptates.html","private_notes":"In nihil non voluptas voluptatibus molestiae et. Nihil labore eligendi omnis id. Et cumque reiciendis blanditiis fugiat.","balance":19958.86,"group_settings_id":"","paid_to_date":18895.75,"payment_balance":0,"credit_balance":573.53,"last_login":0,"size_id":"","public_notes":"","client_hash":"ngQe8O6SInYp1D0SKacHE8f6nzr3Gc1UkkoyGMKI","address1":"873","address2":"220 Hand Glen","phone":"","city":"Lake Kallie","state":"Ohio","postal_code":"77890","country_id":"535","industry_id":"","custom_value1":"1974-10-02 21:56:55","custom_value2":"Aqua","custom_value3":"modi","custom_value4":"xhomenick@hotmail.com","shipping_address1":"89064","shipping_address2":"87854 Meda Junction","shipping_city":"South Aryanna","shipping_state":"Connecticut","shipping_postal_code":"52527-1873","shipping_country_id":"4","settings":{"entity":"App\\Models\\Client","industry_id":"","size_id":"","currency_id":"1"},"is_deleted":false,"vat_number":"881403416","id_number":"MU19IWUA7340242407223765691CMM","updated_at":1695811138,"archived_at":0,"created_at":1695796650,"display_name":"Paucek and Sons","number":"0005","has_valid_vat_number":false,"is_tax_exempt":false,"routing_id":"","tax_info":{},"contacts":[{"id":"yMYerkEaOB","first_name":"Bret","last_name":"Beatty","email":"user@example.com","created_at":1695796650,"updated_at":1695796650,"archived_at":0,"is_primary":true,"is_locked":false,"phone":"1-985-403-1242","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","contact_key":"juMXBqyvDashDUvoYXsdcbZV2SRrFf0BOUFjsc6G","send_email":true,"last_login":0,"password":"**********","link":"http:\/\/ninja.test:8000\/client\/key_login\/juMXBqyvDashDUvoYXsdcbZV2SRrFf0BOUFjsc6G"},{"id":"gl9av2maG1","first_name":"Sandra","last_name":"Daniel","email":"linnie.aufderhar@example.net","created_at":1695796650,"updated_at":1695796650,"archived_at"
2023-09-28 11:53:10 +02:00
public string $payment_data = '[{"amount":"$100.00","balance":"$75.00","balance_raw":"75.000000","number":"8651845192683","discount":6,"po_number":"Nihil.","date":"08\/Feb\/2008","last_sent_date":"","next_send_date":"","due_date":"13\/Apr\/2008","terms":"Repellat unde laboriosam optio minima pariatur odit voluptatum. Eum eum corrupti laboriosam beatae odit dicta. Quia possimus beatae commodi minima. Aut debitis ut rerum et voluptatem. Voluptates cumque quibusdam aut officiis est. Ea ullam enim fugit ut. Modi soluta porro et accusamus quae officia consequatur. Quia maxime adipisci atque ipsa consequatur sit. Eligendi sequi quod iste non fuga corporis ab. Quae autem eveniet provident voluptas tempora molestiae. Autem nulla unde recusandae qui.","public_notes":"","private_notes":"","uses_inclusive_taxes":false,"tax_name1":"GST","tax_rate1":10,"tax_name2":"VAT","tax_rate2":17.5,"tax_name3":"","tax_rate3":0,"total_taxes":"$0.00","total_taxes_raw":"0.000000","is_amount_discount":true,"footer":"","partial":0,"partial_due_date":"","custom_value1":"2022-05-14","custom_value2":"yes","custom_value3":"2","custom_value4":"2","custom_surcharge1":0,"custom_surcharge2":0,"custom_surcharge3":0,"custom_surcharge4":0,"exchange_rate":1,"custom_surcharge_tax1":false,"custom_surcharge_tax2":false,"custom_surcharge_tax3":false,"custom_surcharge_tax4":false,"line_items":[{"quantity":2,"cost":967.46,"product_key":"autem","notes":"Elsie, Lacie, and.","discount":1,"is_amount_discount":true,"tax_name1":"GST","tax_rate1":10,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":1934.92,"gross_line_total":0,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","type_id":"1"},{"quantity":10,"cost":740.14,"product_key":"ipsum","notes":"Hatter opened his.","discount":10,"is_amount_discount":true,"tax_name1":"GST","tax_rate1":10,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":7401.4,"gross_line_total":0,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","type_id":"1"},{"quantity":3,"cost":496.59,"product_key":"ducimus","notes":"How neatly spread.","discount":2,"is_amount_discount":true,"tax_name1":"GST","tax_rate1":10,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":1489.77,"gross_line_total":0,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","type_id":"1"},{"quantity":3,"cost":332.12,"product_key":"aspernatur","notes":"I hadnt begun my.","discount":8,"is_amount_discount":true,"tax_name1":"GST","tax_rate1":10,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":996.36,"gross_line_total":0,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","type_id":"1"},{"quantity":10,"cost":803.47,"product_key":"debitis","notes":"Rabbit coming to.","discount":4,"is_amount_discount":true,"tax_name1":"GST","tax_rate1":10,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":8034.700000000001,"gross_line_total":0,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","type_id":"1"}],"reminder1_sent":"","reminder2_sent":"","reminder3_sent":"","reminder_last_sent":"","paid_to_date":"$25.00","auto_bill_enabled":false,"client":{"name":"Champlin, Dooley and Jacobi","balance":"-420.000000","payment_balance":"0.000000","credit_balance":"-37.000000"},"payments":[{"status":"Completed","badge":"<h6><span class=\"badge badge-info\">Completed<\/span><\/h6>","amount":"$383.00","applied":"$383.00","balance":"$0.00","refunded":"$0.00","amount_raw":"383.000000","applied_raw":"383.000000","refunded_raw":"0.000000","balance_raw":0,"date":"01\/Oct\/2023","method":"Visa Card","currency":"USD","exchange_rate":1,"transaction_reference":"My Batch Payment","is_manual":1,"number":"0001","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","client":{"name":"Champlin, Dooley and Jacobi","balance":"-420.000000","payment_balance":"0.000000","credit_balance":"-37.000000"},"paymentables":[{"invoice":"8651
public string $payment_data2 = '[{ "id": "oBDbDxbl2E", "user_id": "wMvbmOeYAl", "assigned_user_id": "", "amount": 0, "refunded": 0, "applied": 0, "transaction_reference": "Manual entry", "transaction_id": "", "date": "2023-09-26", "is_manual": true, "created_at": 1695798370, "updated_at": 1695798370, "archived_at": 0, "is_deleted": false, "type_id": "", "invitation_id": "", "private_notes": "", "number": "0001", "custom_value1": "", "custom_value2": "", "custom_value3": "", "custom_value4": "", "client_id": "QJ0dN6dLOv", "client_contact_id": "", "company_gateway_id": "", "gateway_type_id": "", "status_id": "4", "project_id": "", "vendor_id": "", "currency_id": "1", "exchange_rate": 1, "exchange_currency_id": "", "client": { "id": "QJ0dN6dLOv", "user_id": "wMvbmOeYAl", "assigned_user_id": "", "name": "Paucek and Sons", "website": "http:\/\/www.wiegand.com\/sit-repellendus-enim-porro-aut-voluptas-voluptates.html", "private_notes": "In nihil non voluptas voluptatibus molestiae et. Nihil labore eligendi omnis id. Et cumque reiciendis blanditiis fugiat.", "balance": 19958.86, "group_settings_id": "", "paid_to_date": 18895.75, "payment_balance": 0, "credit_balance": 573.53, "last_login": 0, "size_id": "", "public_notes": "", "client_hash": "ngQe8O6SInYp1D0SKacHE8f6nzr3Gc1UkkoyGMKI", "address1": "873", "address2": "220 Hand Glen", "phone": "", "city": "Lake Kallie", "state": "Ohio", "postal_code": "77890", "country_id": "535", "industry_id": "", "custom_value1": "1974-10-02 21:56:55", "custom_value2": "Aqua", "custom_value3": "modi", "custom_value4": "xhomenick@hotmail.com", "shipping_address1": "89064", "shipping_address2": "87854 Meda Junction", "shipping_city": "South Aryanna", "shipping_state": "Connecticut", "shipping_postal_code": "52527-1873", "shipping_country_id": "4", "is_deleted": false, "vat_number": "881403416", "id_number": "MU19IWUA7340242407223765691CMM", "updated_at": 1695811138, "archived_at": 0, "created_at": 1695796650, "display_name": "Paucek and Sons", "number": "0005", "has_valid_vat_number": false, "is_tax_exempt": false, "routing_id": "", "tax_info": {}, "contacts": [{ "id": "yMYerkEaOB", "first_name": "Bret", "last_name": "Beatty", "email": "user@example.com", "created_at": 1695796650, "updated_at": 1695796650, "archived_at": 0, "is_primary": true, "is_locked": false, "phone": "1-985-403-1242", "custom_value1": "", "custom_value2": "", "custom_value3": "", "custom_value4": "", "contact_key": "juMXBqyvDashDUvoYXsdcbZV2SRrFf0BOUFjsc6G", "send_email": true, "last_login": 0, "password": "**********", "link": "http:\/\/ninja.test:8000\/client\/key_login\/juMXBqyvDashDUvoYXsdcbZV2SRrFf0BOUFjsc6G" }, { "id": "gl9av2maG1", "first_name": "Sandra", "last_name": "Daniel", "email": "linnie.aufderhar@example.net", "created_at": 1695796650, "updated_at": 1695796650, "archived_at": 0, "is_primary": false, "is_locked": false, "phone": "+17319151379", "custom_value1": "", "custom_value2": "", "custom_value3": "", "custom_value4": "", "contact_key": "sm53aNvvsGUmLXFku0RLPUrP0zLj3rzBcTaGMjHd", "send_email": true, "last_login": 0, "password": "**********", "link": "http:\/\/ninja.test:8000\/client\/key_login\/sm53aNvvsGUmLXFku0RLPUrP0zLj3rzBcTaGMjHd" }, { "id": "7LDdwpRe1Y", "first_name": "Leone", "last_name": "Bode", "email": "ipollich@example.org", "created_at": 1695796650, "updated_at": 1695796650, "archived_at": 0, "is_primary": false, "is_locked": false, "phone": "(424) 789-3412", "custom_value1": "", "custom_value2": "", "custom_value3": "", "custom_value4": "", "contact_key": "gDUwiOqRehgCHWbbctW8qgKiLmma3xvsZi10a5Ma", "send_email": true, "last_login": 0, "password": "**********", "link": "http:\/\/ninja.test:8000\/client\/key_login\/gDUwiOqRehgCHWbbctW8qgKiLmma3xvsZi10a5Ma" }], "documents": { "data": [] }, "gateway_tokens": { "data": [] } }, "invoices": [], "paymentables": [{ "id": "xYRdG7dDzO", "invoice_id": "mxkazm8eJ0", "amount": 0, "refunded": 0, "created_at": 1695798370, "updated_at": 1695798370, "archived_at": 0 }] }, { "id": "K4oeEva0By", "user_id": "wMvbmOeYAl", "assigned_user_id": "", "amount": 444,
2023-09-28 11:53:10 +02:00
2023-09-27 13:11:47 +02:00
public string $purchase_order_data = '[{"id":"l4zbq2dprO","user_id":"wMvbmOeYAl","project_id":"","assigned_user_id":"","vendor_id":"xYRdG7dDzO","amount":14,"balance":0,"client_id":"","status_id":"1","design_id":"Wpmbk5ezJn","created_at":1695799265,"updated_at":1695799268,"archived_at":0,"is_deleted":false,"number":"0001","discount":0,"po_number":"","date":"2023-09-27","last_sent_date":"","next_send_date":"","reminder1_sent":"","reminder2_sent":"","reminder3_sent":"","reminder_last_sent":"","due_date":"2023-09-28","terms":"","public_notes":"","private_notes":"","uses_inclusive_taxes":false,"tax_name1":"","tax_rate1":0,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"total_taxes":0,"is_amount_discount":true,"footer":"","partial":0,"partial_due_date":"","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","has_tasks":false,"has_expenses":false,"custom_surcharge1":0,"custom_surcharge2":0,"custom_surcharge3":0,"custom_surcharge4":0,"custom_surcharge_tax1":false,"custom_surcharge_tax2":false,"custom_surcharge_tax3":false,"custom_surcharge_tax4":false,"line_items":[{"_id":"16ae59d4-60a8-4edf-b3a3-58882df1c5bf","quantity":1,"cost":14,"product_key":"enterprise_plan","product_cost":0,"notes":"The Enterprise Plan","discount":0,"is_amount_discount":true,"tax_name1":"","tax_rate1":0,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":"0","line_total":14,"gross_line_total":14,"date":"","custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"73","custom_value3":"Nesciunt sequi.","custom_value4":"Ratione inventore.","type_id":"1","tax_id":"1","tax_amount":0,"task_id":"","expense_id":""},{"_id":"c7ef7af8-2713-4376-89c5-6f2c9c148ea7","quantity":0,"cost":0,"product_key":"","product_cost":0,"notes":"","discount":0,"is_amount_discount":true,"tax_name1":"","tax_rate1":0,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":"0","line_total":0,"gross_line_total":0,"date":"","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","type_id":"1","tax_id":"1","tax_amount":0,"task_id":"","expense_id":""}],"entity_type":"purchaseOrder","exchange_rate":1,"paid_to_date":0,"subscription_id":"","expense_id":"","currency_id":"","vendor":{"id":"xYRdG7dDzO","user_id":"wMvbmOeYAl","assigned_user_id":"","name":"Dr. Ottilie Gorczany PhD","website":"http:\/\/www.kihn.biz\/","private_notes":"Ullam ullam aut sed accusantium. Et amet ut et cumque. Dolorem rem doloremque eius aut laudantium soluta nihil.","public_notes":"","last_login":0,"address1":"93105","address2":"797 Medhurst Radial Suite 030","phone":"","city":"Lamberttown","state":"Kentucky","postal_code":"86694-1500","country_id":"4","currency_id":"1","custom_value1":"Et similique.","custom_value2":"Ducimus est.","custom_value3":"Ut unde aut quia.","custom_value4":"Rerum odio maxime.","is_deleted":false,"vat_number":"Hic sed vel sint eos et.","id_number":"Quod aut autem.","updated_at":1695796653,"archived_at":0,"created_at":1695796652,"number":"0004","language_id":"","contacts":{"App\\Models\\VendorContact":[{"id":"VolejRRejN","first_name":"Aisha","last_name":"Jerde","send_email":true,"email":"mariam40@example.com","created_at":1695796652,"updated_at":1695796652,"archived_at":0,"is_primary":true,"phone":"+1-828-839-4171","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","link":"http:\/\/ninja.test:8000\/vendor\/key_login\/vqQKXcwO2WsvkN4MPOAS6fpirMZP7gfc","last_login":0},{"id":"WpmbkR5azJ","first_name":"Willy","last_name":"Jacobs","send_email":true,"email":"qwolff@example.org","created_at":1695796652,"updated_at":1695796652,"archived_at":0,"is_primary":false,"phone":"979.822.6527","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","link":"http:\/\/ninja.test:8000\/vendor\/key_login\/A8g2xp3OLbNzpWlfPGIML2lk1LYNFJpx","last_login":0}]},"documents":{"App\\Models\\Document":[]}}},{"id":"kzPdy7aQro","user_id":"wMvbmOeYAl","project_id":"","assigned_user_id":"","vendor_id":"xYRdG7dDzO","amount":24,"balance":24,"client_id":"","status_id":"2","design_id":"Wpmbk5ezJn","cre
2023-09-27 12:36:08 +02:00
2023-09-27 13:11:47 +02:00
public string $project_data = '[{"id":"qM7e5Ba2vp","user_id":"wMvbmOeYAl","assigned_user_id":"","client_id":"QJ0dN6dLOv","name":"Jace Windler DVM","number":"0002","created_at":1695797958,"updated_at":1695798905,"archived_at":0,"is_deleted":false,"task_rate":38,"due_date":"","private_notes":"Private Project Notes","public_notes":"Rerum voluptas incidunt velit.","budgeted_hours":826,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","color":"#fff","current_hours":0,"client":{"id":"QJ0dN6dLOv","user_id":"wMvbmOeYAl","assigned_user_id":"","name":"Paucek and Sons","website":"http:\/\/www.wiegand.com\/sit-repellendus-enim-porro-aut-voluptas-voluptates.html","private_notes":"In nihil non voluptas voluptatibus molestiae et. Nihil labore eligendi omnis id. Et cumque reiciendis blanditiis fugiat.","balance":19958.86,"group_settings_id":"","paid_to_date":18895.75,"payment_balance":0,"credit_balance":573.53,"last_login":0,"size_id":"","public_notes":"","client_hash":"ngQe8O6SInYp1D0SKacHE8f6nzr3Gc1UkkoyGMKI","address1":"873","address2":"220 Hand Glen","phone":"","city":"Lake Kallie","state":"Ohio","postal_code":"77890","country_id":"535","industry_id":"","custom_value1":"1974-10-02 21:56:55","custom_value2":"Aqua","custom_value3":"modi","custom_value4":"xhomenick@hotmail.com","shipping_address1":"89064","shipping_address2":"87854 Meda Junction","shipping_city":"South Aryanna","shipping_state":"Connecticut","shipping_postal_code":"52527-1873","shipping_country_id":"4","settings":{"entity":"App\\Models\\Client","industry_id":"","size_id":"","currency_id":"1"},"is_deleted":false,"vat_number":"881403416","id_number":"MU19IWUA7340242407223765691CMM","updated_at":1695811138,"archived_at":0,"created_at":1695796650,"display_name":"Paucek and Sons","number":"0005","has_valid_vat_number":false,"is_tax_exempt":false,"routing_id":"","tax_info":{},"contacts":{"App\\Models\\ClientContact":[{"id":"yMYerkEaOB","first_name":"Bret","last_name":"Beatty","email":"user@example.com","created_at":1695796650,"updated_at":1695796650,"archived_at":0,"is_primary":true,"is_locked":false,"phone":"1-985-403-1242","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","contact_key":"juMXBqyvDashDUvoYXsdcbZV2SRrFf0BOUFjsc6G","send_email":true,"last_login":0,"password":"**********","link":"http:\/\/ninja.test:8000\/client\/key_login\/juMXBqyvDashDUvoYXsdcbZV2SRrFf0BOUFjsc6G"},{"id":"gl9av2maG1","first_name":"Sandra","last_name":"Daniel","email":"linnie.aufderhar@example.net","created_at":1695796650,"updated_at":1695796650,"archived_at":0,"is_primary":false,"is_locked":false,"phone":"+17319151379","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","contact_key":"sm53aNvvsGUmLXFku0RLPUrP0zLj3rzBcTaGMjHd","send_email":true,"last_login":0,"password":"**********","link":"http:\/\/ninja.test:8000\/client\/key_login\/sm53aNvvsGUmLXFku0RLPUrP0zLj3rzBcTaGMjHd"},{"id":"7LDdwpRe1Y","first_name":"Leone","last_name":"Bode","email":"ipollich@example.org","created_at":1695796650,"updated_at":1695796650,"archived_at":0,"is_primary":false,"is_locked":false,"phone":"(424) 789-3412","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","contact_key":"gDUwiOqRehgCHWbbctW8qgKiLmma3xvsZi10a5Ma","send_email":true,"last_login":0,"password":"**********","link":"http:\/\/ninja.test:8000\/client\/key_login\/gDUwiOqRehgCHWbbctW8qgKiLmma3xvsZi10a5Ma"}]},"documents":{"App\\Models\\Document":[]},"gateway_tokens":{"App\\Models\\ClientGatewayToken":[]}},"tasks":{"App\\Models\\Task":[{"id":"k8mepZ1bMy","user_id":"wMvbmOeYAl","assigned_user_id":"","number":"0009","description":"Tenetur molestiae voluptatem voluptate nostrum.","duration":0,"rate":0,"created_at":1695797958,"updated_at":1695798883,"archived_at":0,"invoice_id":"","client_id":"QJ0dN6dLOv","project_id":"qM7e5Ba2vp","is_deleted":false,"time_log":"[[1694933958,1695365958,\"description\",false]]","is_running":false,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","status_id":"","status_sort_order":0,"is_date_based":fal
2023-09-27 12:36:08 +02:00
2023-09-27 13:11:47 +02:00
public string $task_data = '[{"id":"k8mepZ1bMy","user_id":"wMvbmOeYAl","assigned_user_id":"","number":"0009","description":"Tenetur molestiae voluptatem voluptate nostrum.","duration":0,"rate":0,"created_at":1695797958,"updated_at":1695798883,"archived_at":0,"invoice_id":"","client_id":"QJ0dN6dLOv","project_id":"qM7e5Ba2vp","is_deleted":false,"time_log":"[[1694933958,1695365958,\"description\",false]]","is_running":false,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","status_id":"","status_sort_order":0,"is_date_based":false,"status_order":null,"date":"2023-09-16","client":{"id":"QJ0dN6dLOv","user_id":"wMvbmOeYAl","assigned_user_id":"","name":"Paucek and Sons","website":"http:\/\/www.wiegand.com\/sit-repellendus-enim-porro-aut-voluptas-voluptates.html","private_notes":"In nihil non voluptas voluptatibus molestiae et. Nihil labore eligendi omnis id. Et cumque reiciendis blanditiis fugiat.","balance":19958.86,"group_settings_id":"","paid_to_date":18895.75,"payment_balance":0,"credit_balance":573.53,"last_login":0,"size_id":"","public_notes":"","client_hash":"ngQe8O6SInYp1D0SKacHE8f6nzr3Gc1UkkoyGMKI","address1":"873","address2":"220 Hand Glen","phone":"","city":"Lake Kallie","state":"Ohio","postal_code":"77890","country_id":"535","industry_id":"","custom_value1":"1974-10-02 21:56:55","custom_value2":"Aqua","custom_value3":"modi","custom_value4":"xhomenick@hotmail.com","shipping_address1":"89064","shipping_address2":"87854 Meda Junction","shipping_city":"South Aryanna","shipping_state":"Connecticut","shipping_postal_code":"52527-1873","shipping_country_id":"4","settings":{"entity":"App\\Models\\Client","industry_id":"","size_id":"","currency_id":"1"},"is_deleted":false,"vat_number":"881403416","id_number":"MU19IWUA7340242407223765691CMM","updated_at":1695811138,"archived_at":0,"created_at":1695796650,"display_name":"Paucek and Sons","number":"0005","has_valid_vat_number":false,"is_tax_exempt":false,"routing_id":"","tax_info":{},"contacts":[{"id":"yMYerkEaOB","first_name":"Bret","last_name":"Beatty","email":"user@example.com","created_at":1695796650,"updated_at":1695796650,"archived_at":0,"is_primary":true,"is_locked":false,"phone":"1-985-403-1242","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","contact_key":"juMXBqyvDashDUvoYXsdcbZV2SRrFf0BOUFjsc6G","send_email":true,"last_login":0,"password":"**********","link":"http:\/\/ninja.test:8000\/client\/key_login\/juMXBqyvDashDUvoYXsdcbZV2SRrFf0BOUFjsc6G"},{"id":"gl9av2maG1","first_name":"Sandra","last_name":"Daniel","email":"linnie.aufderhar@example.net","created_at":1695796650,"updated_at":1695796650,"archived_at":0,"is_primary":false,"is_locked":false,"phone":"+17319151379","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","contact_key":"sm53aNvvsGUmLXFku0RLPUrP0zLj3rzBcTaGMjHd","send_email":true,"last_login":0,"password":"**********","link":"http:\/\/ninja.test:8000\/client\/key_login\/sm53aNvvsGUmLXFku0RLPUrP0zLj3rzBcTaGMjHd"},{"id":"7LDdwpRe1Y","first_name":"Leone","last_name":"Bode","email":"ipollich@example.org","created_at":1695796650,"updated_at":1695796650,"archived_at":0,"is_primary":false,"is_locked":false,"phone":"(424) 789-3412","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","contact_key":"gDUwiOqRehgCHWbbctW8qgKiLmma3xvsZi10a5Ma","send_email":true,"last_login":0,"password":"**********","link":"http:\/\/ninja.test:8000\/client\/key_login\/gDUwiOqRehgCHWbbctW8qgKiLmma3xvsZi10a5Ma"}],"documents":{"data":[]},"gateway_tokens":{"data":[]}},"project":{"id":"qM7e5Ba2vp","user_id":"wMvbmOeYAl","assigned_user_id":"","client_id":"QJ0dN6dLOv","name":"Jace Windler DVM","number":"0002","created_at":1695797958,"updated_at":1695798905,"archived_at":0,"is_deleted":false,"task_rate":38,"due_date":"","private_notes":"Private Project Notes","public_notes":"Rerum voluptas incidunt velit.","budgeted_hours":826,"custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","color":"#fff","current_hours":0,"documents":{"data":[]}},"invoice":[]},{"id":"l4zbqQ3bp
2023-09-28 11:53:10 +02:00
public string $invoice_data = '[{ "id": "VWPe9rxaLy", "user_id": "wMvbmOeYAl", "project_id": "", "assigned_user_id": "", "amount": 9199.58, "balance": 9199.58, "client_id": "QJ0dN6dLOv", "vendor_id": "", "status_id": "2", "design_id": "Wpmbk5ezJn", "recurring_id": "", "created_at": 1695796650, "updated_at": 1695796654, "archived_at": 0, "is_deleted": false, "number": "0001", "discount": 0, "po_number": "", "date": "2023-08-01", "last_sent_date": "", "next_send_date": "", "due_date": "", "terms": "", "public_notes": "", "private_notes": "", "uses_inclusive_taxes": false, "tax_name1": "GST", "tax_rate1": 10, "tax_name2": "VAT", "tax_rate2": 17.5, "tax_name3": "", "tax_rate3": 0, "total_taxes": 2269.58, "is_amount_discount": true, "footer": "", "partial": 0, "partial_due_date": "", "custom_value1": "1991-04-30", "custom_value2": "yes", "custom_value3": "", "custom_value4": "", "has_tasks": false, "has_expenses": false, "custom_surcharge1": 0, "custom_surcharge2": 0, "custom_surcharge3": 0, "custom_surcharge4": 0, "exchange_rate": 1, "custom_surcharge_tax1": false, "custom_surcharge_tax2": false, "custom_surcharge_tax3": false, "custom_surcharge_tax4": false, "line_items": [{ "quantity": 1, "cost": 693, "product_key": "Sed.", "notes": "Est sequi.", "discount": 0, "is_amount_discount": true, "tax_name1": "Sales Tax", "tax_rate1": 5, "tax_name2": "", "tax_rate2": 0, "tax_name3": "", "tax_rate3": 0, "sort_id": 0, "line_total": 693, "gross_line_total": 727.65, "custom_value1": "https:\/\/picsum.photos\/200", "custom_value2": "56", "custom_value3": "Dolores porro quia.", "custom_value4": "Perferendis itaque.", "type_id": "1", "product_cost": 0, "tax_amount": 34.65, "date": "", "tax_id": "", "task_id": "", "expense_id": "" }, { "quantity": 1, "cost": 693, "product_key": "Sed.", "notes": "Est sequi.", "discount": 0, "is_amount_discount": true, "tax_name1": "Sales Tax", "tax_rate1": 5, "tax_name2": "", "tax_rate2": 0, "tax_name3": "", "tax_rate3": 0, "sort_id": 0, "line_total": 693, "gross_line_total": 727.65, "custom_value1": "https:\/\/picsum.photos\/200", "custom_value2": "56", "custom_value3": "Dolores porro quia.", "custom_value4": "Perferendis itaque.", "type_id": "1", "product_cost": 0, "tax_amount": 34.65, "date": "", "tax_id": "", "task_id": "", "expense_id": "" }, { "quantity": 1, "cost": 693, "product_key": "Sed.", "notes": "Est sequi.", "discount": 0, "is_amount_discount": true, "tax_name1": "", "tax_rate1": 0, "tax_name2": "", "tax_rate2": 0, "tax_name3": "", "tax_rate3": 0, "sort_id": 0, "line_total": 693, "gross_line_total": 693, "custom_value1": "https:\/\/picsum.photos\/200", "custom_value2": "56", "custom_value3": "Dolores porro quia.", "custom_value4": "Perferendis itaque.", "type_id": "1", "product_cost": 0, "tax_amount": 0, "date": "", "tax_id": "", "task_id": "", "expense_id": "" }, { "quantity": 1, "cost": 693, "product_key": "Sed.", "notes": "Est sequi.", "discount": 0, "is_amount_discount": true, "tax_name1": "Sales Tax", "tax_rate1": 5, "tax_name2": "", "tax_rate2": 0, "tax_name3": "", "tax_rate3": 0, "sort_id": 0, "line_total": 693, "gross_line_total": 727.65, "custom_value1": "https:\/\/picsum.photos\/200", "custom_value2": "56", "custom_value3": "Dolores porro quia.", "custom_value4": "Perferendis itaque.", "type_id": "1", "product_cost": 0, "tax_amount": 34.65, "date": "", "tax_id": "", "task_id": "", "expense_id": "" }, { "quantity": 1, "cost": 693, "product_key": "Sed.", "notes": "Est sequi.", "discount": 0, "is_amount_discount": true, "tax_name1": "Sales Tax", "tax_rate1": 5, "tax_name2": "", "tax_rate2": 0, "tax_name3": "", "tax_rate3": 0, "sort_id": 0, "line_total": 693, "gross_line_total": 727.65, "custom_value1": "https:\/\/picsum.photos\/200", "custom_value2": "56", "custom_value3": "Dolores porro quia.", "custom_value4": "Perferendis itaque.", "type_id": "1", "product_cost": 0, "tax_amount": 34.65, "date": "", "tax_id": "", "task_id": "", "expense_id": "" }, { "quantity": 1, "cost": 693, "product_key": "Sed.", "notes": "Est sequi.", "discount": 0, "is_amount_discount": true, "tax_name1": "
2023-09-27 12:36:08 +02:00
public string $quote_data = '[{"id":1,"client_id":1,"user_id":1,"assigned_user_id":null,"company_id":1,"status_id":2,"project_id":null,"vendor_id":null,"recurring_id":null,"design_id":2,"invoice_id":null,"number":"0001","discount":1,"is_amount_discount":false,"po_number":"Molestias.","date":"1986-08-02","last_sent_date":null,"due_date":null,"next_send_date":null,"is_deleted":false,"line_items":[{"quantity":1,"cost":637,"product_key":"Nisi.","notes":"Ut ipsa rerum.","discount":0,"is_amount_discount":false,"tax_name1":"VAT","tax_rate1":17.5,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"637.00","gross_line_total":747.36,"custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"42","custom_value3":"Maxime dolores.","custom_value4":"Odio consequatur.","type_id":"1","product_cost":0,"tax_amount":110.36,"date":"","tax_id":"","task_id":"","expense_id":""},{"quantity":1,"cost":637,"product_key":"Nisi.","notes":"Ut ipsa rerum.","discount":0,"is_amount_discount":false,"tax_name1":"GST","tax_rate1":10,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"637.00","gross_line_total":700.06,"custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"42","custom_value3":"Maxime dolores.","custom_value4":"Odio consequatur.","type_id":"1","product_cost":0,"tax_amount":63.06,"date":"","tax_id":"","task_id":"","expense_id":""},{"quantity":1,"cost":637,"product_key":"Nisi.","notes":"Ut ipsa rerum.","discount":0,"is_amount_discount":false,"tax_name1":"","tax_rate1":0,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"637.00","gross_line_total":637,"custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"42","custom_value3":"Maxime dolores.","custom_value4":"Odio consequatur.","type_id":"1","product_cost":0,"tax_amount":0,"date":"","tax_id":"","task_id":"","expense_id":""},{"quantity":1,"cost":637,"product_key":"Nisi.","notes":"Ut ipsa rerum.","discount":0,"is_amount_discount":false,"tax_name1":"GST","tax_rate1":10,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"637.00","gross_line_total":700.06,"custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"42","custom_value3":"Maxime dolores.","custom_value4":"Odio consequatur.","type_id":"1","product_cost":0,"tax_amount":63.06,"date":"","tax_id":"","task_id":"","expense_id":""},{"quantity":1,"cost":637,"product_key":"Nisi.","notes":"Ut ipsa rerum.","discount":0,"is_amount_discount":false,"tax_name1":"Sales Tax","tax_rate1":5,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"637.00","gross_line_total":668.53,"custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"42","custom_value3":"Maxime dolores.","custom_value4":"Odio consequatur.","type_id":"1","product_cost":0,"tax_amount":31.53,"date":"","tax_id":"","task_id":"","expense_id":""},{"quantity":1,"cost":637,"product_key":"Nisi.","notes":"Ut ipsa rerum.","discount":0,"is_amount_discount":false,"tax_name1":"GST","tax_rate1":10,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"637.00","gross_line_total":700.06,"custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"42","custom_value3":"Maxime dolores.","custom_value4":"Odio consequatur.","type_id":"1","product_cost":0,"tax_amount":63.06,"date":"","tax_id":"","task_id":"","expense_id":""},{"quantity":1,"cost":637,"product_key":"Nisi.","notes":"Ut ipsa rerum.","discount":0,"is_amount_discount":false,"tax_name1":"Sales Tax","tax_rate1":5,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"637.00","gross_line_total":668.53,"custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"42","custom_value3":"Maxime dolores.","custom_value4":"Odio consequatur.","type_id":"1","product_cost":0,"tax_amount":31.53,"date":"","tax_id":"","task_id":"","expense_id":""}],"backup":null,"footer":null,"public_notes":null,"private_notes":null,"terms":null,"tax_name1":"GST","tax_rate1":"10.000000","tax_name2":"VAT","tax_rate2":"17.500000","ta
2023-09-27 13:11:47 +02:00
2023-09-27 13:32:17 +02:00
public function __construct(public Company $company)
2023-09-27 13:11:47 +02:00
{
}
public function init(): self
{
2023-09-27 12:36:08 +02:00
2023-09-27 13:11:47 +02:00
$this->variables = collect(['invoices', 'quotes', 'credits', 'purchase_orders'])->map(function ($type) {
return $this->createVariables($type);
2023-09-27 12:36:08 +02:00
})->toArray();
2023-09-27 13:44:09 +02:00
$this->engines['invoices'] = json_decode($this->invoice_data, true);
$this->engines['quotes'] = json_decode($this->quote_data, true);
$this->engines['credits'] = json_decode($this->credit_data, true);
$this->engines['tasks'] = json_decode($this->task_data, true);
$this->engines['projects'] = json_decode($this->project_data, true);
$this->engines['payments'] = json_decode($this->payment_data, true);
$this->engines['purchase_orders'] = json_decode($this->purchase_order_data, true);
// nlog("engines");
// nlog($this->engines);
2023-09-27 13:11:47 +02:00
return $this;
2023-09-27 12:36:08 +02:00
}
/**
* ['entity_type','design','settings_type','settings']
*
* @param string $type
* @return array
*/
private function createVariables(string $type): array
{
$data = [
'entity_type' => rtrim($type,"s"),
'design' => '',
'settings_type' => 'company',
'settings' => $this->company->settings,
];
2023-09-27 13:11:47 +02:00
$mock = (new PdfMock($data, $this->company));
$mock->settings = $this->company->settings;
$mock->build();
2023-09-27 12:36:08 +02:00
return [$type => $mock->getStubVariables()];
}
2023-09-27 13:11:47 +02:00
2023-09-27 12:36:08 +02:00
}