1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/Services/Template/TemplateMock.php

88 lines
332 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
2023-10-01 12:21:57 +02:00
public string $payment_data = '[{"status":"Refunded","badge":"<h6><span class=\"badge badge-primary\">Refunded<\/span><\/h6>","amount":"$6,077.51","applied":"$6,077.51","balance":"-$6,077.51","refunded":"$6,077.51","amount_raw":"6077.510000","applied_raw":"6077.510000","refunded_raw":"6077.510000","balance_raw":-6077.51,"date":"30\/Sep\/2023","method":"EuroCard","currency":"USD","exchange_rate":1,"transaction_reference":"Manual entry","is_manual":1,"number":"0001","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","client":{"name":"cypress","balance":"0.000000","payment_balance":"0.000000","credit_balance":"11661.820000"},"paymentables":[{"invoice":"0019","amount_raw":"6077.5100","refunded_raw":"6077.5100","net_raw":0,"amount":"$6,077.51","refunded":"$6,077.51","net":"$0.00","is_credit":false,"created_at":"01\/Oct\/2023","updated_at":"01\/Oct\/2023","timestamp":1696150843}]},{"status":"Refunded","badge":"<h6><span class=\"badge badge-primary\">Refunded<\/span><\/h6>","amount":"$4,090.64","applied":"$4,090.64","balance":"-$4,090.64","refunded":"$4,090.64","amount_raw":"4090.640000","applied_raw":"4090.640000","refunded_raw":"4090.640000","balance_raw":-4090.64,"date":"30\/Sep\/2023","method":"Discover Card","currency":"USD","exchange_rate":1,"transaction_reference":"Manual entry","is_manual":1,"number":"0002","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","client":{"name":"cypress","balance":"0.000000","payment_balance":"0.000000","credit_balance":"11661.820000"},"paymentables":[{"invoice":"0020","amount_raw":"4090.6400","refunded_raw":"4090.6400","net_raw":0,"amount":"$4,090.64","refunded":"$4,090.64","net":"$0.00","is_credit":false,"created_at":"01\/Oct\/2023","updated_at":"01\/Oct\/2023","timestamp":1696150843}]},{"status":"Refunded","badge":"<h6><span class=\"badge badge-primary\">Refunded<\/span><\/h6>","amount":"$2,197.26","applied":"$2,197.26","balance":"-$2,197.26","refunded":"$2,197.26","amount_raw":"2197.260000","applied_raw":"2197.260000","refunded_raw":"2197.260000","balance_raw":-2197.26,"date":"30\/Sep\/2023","method":"Diners Card","currency":"USD","exchange_rate":1,"transaction_reference":"Manual entry","is_manual":1,"number":"0003","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","client":{"name":"Jakubowski Group","balance":"28296.170000","payment_balance":"0.000000","credit_balance":"1084.840000"},"paymentables":[{"invoice":"0021","amount_raw":"2197.2600","refunded_raw":"2197.2600","net_raw":0,"amount":"$2,197.26","refunded":"$2,197.26","net":"$0.00","is_credit":false,"created_at":"01\/Oct\/2023","updated_at":"01\/Oct\/2023","timestamp":1696150843}]},{"status":"Partially Refunded","badge":"<h6><span class=\"badge badge-success\">Partially Refunded<\/span><\/h6>","amount":"$4,955.50","applied":"$4,955.50","balance":"-$66.00","refunded":"$66.00","amount_raw":"4955.500000","applied_raw":"4955.500000","refunded_raw":"66.000000","balance_raw":-66,"date":"30\/Sep\/2023","method":"Maestro","currency":"USD","exchange_rate":1,"transaction_reference":"Manual entry","is_manual":1,"number":"0004","custom_value1":"","custom_value2":"","custom_value3":"","custom_value4":"","client":{"name":"Jakubowski Group","balance":"28296.170000","payment_balance":"0.000000","credit_balance":"1084.840000"},"paymentables":[{"invoice":"0022","amount_raw":"4955.5000","refunded_raw":"66.0000","net_raw":4889.5,"amount":"$4,955.50","refunded":"$66.00","net":"$4,889.50","is_credit":false,"created_at":"01\/Oct\/2023","updated_at":"01\/Oct\/2023","timestamp":1696150843}]},{"status":"Partially Refunded","badge":"<h6><span class=\"badge badge-success\">Partially Refunded<\/span><\/h6>","amount":"$2,290.75","applied":"$2,290.75","balance":"-$34.00","refunded":"$34.00","amount_raw":"2290.750000","applied_raw":"2290.750000","refunded_raw":"34.000000","balance_raw":-34,"date":"30\/Sep\/2023","method":"Diners Card","currency":"USD","exchange_rate":1,"transaction_reference":"Manual entry","is_manual":1,"number":"0005","custom_value1":"","custom_value2":"","custom_
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-10-03 09:52:46 +02:00
public string $invoice_data = '[{"amount":"$6,054.13","balance":"$0.00","balance_raw":"0.000000","number":"0015","discount":1,"po_number":"","date":"20\/Sep\/2023","last_sent_date":"","next_send_date":"","due_date":"","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":"$444.13","total_taxes_raw":"444.130000","is_amount_discount":true,"footer":"","partial":"0.000000","partial_due_date":"","custom_value1":"1984-10-01","custom_value2":"no","custom_value3":"","custom_value4":"","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":"$935.00","product_key":"Et.","notes":"Illum similique.","discount":"$0.00","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":"$935.00","gross_line_total":"$981.75","custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"78","custom_value3":"Itaque laudantium.","custom_value4":"Qui voluptatem ea a.","type_id":"1","product_cost":"$0.00","tax_amount":"$46.75","date":"","tax_id":"","task_id":"","expense_id":"","cost_raw":935,"discount_raw":0,"line_total_raw":935,"gross_line_total_raw":981.75,"tax_amount_raw":46.75,"product_cost_raw":0},{"quantity":1,"cost":"$935.00","product_key":"Et.","notes":"Illum similique.","discount":"$0.00","is_amount_discount":true,"tax_name1":"","tax_rate1":0,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"$935.00","gross_line_total":"$935.00","custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"78","custom_value3":"Itaque laudantium.","custom_value4":"Qui voluptatem ea a.","type_id":"1","product_cost":"$0.00","tax_amount":"$0.00","date":"","tax_id":"","task_id":"","expense_id":"","cost_raw":935,"discount_raw":0,"line_total_raw":935,"gross_line_total_raw":935,"tax_amount_raw":0,"product_cost_raw":0},{"quantity":1,"cost":"$935.00","product_key":"Et.","notes":"Illum similique.","discount":"$0.00","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":"$935.00","gross_line_total":"$1,028.50","custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"78","custom_value3":"Itaque laudantium.","custom_value4":"Qui voluptatem ea a.","type_id":"1","product_cost":"$0.00","tax_amount":"$93.50","date":"","tax_id":"","task_id":"","expense_id":"","cost_raw":935,"discount_raw":0,"line_total_raw":935,"gross_line_total_raw":1028.5,"tax_amount_raw":93.5,"product_cost_raw":0},{"quantity":1,"cost":"$935.00","product_key":"Et.","notes":"Illum similique.","discount":"$0.00","is_amount_discount":true,"tax_name1":"VAT","tax_rate1":17.5,"tax_name2":"","tax_rate2":0,"tax_name3":"","tax_rate3":0,"sort_id":0,"line_total":"$935.00","gross_line_total":"$1,098.63","custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"78","custom_value3":"Itaque laudantium.","custom_value4":"Qui voluptatem ea a.","type_id":"1","product_cost":"$0.00","tax_amount":"$163.63","date":"","tax_id":"","task_id":"","expense_id":"","cost_raw":935,"discount_raw":0,"line_total_raw":935,"gross_line_total_raw":1098.63,"tax_amount_raw":163.63,"product_cost_raw":0},{"quantity":1,"cost":"$935.00","product_key":"Et.","notes":"Illum similique.","discount":"$0.00","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":"$935.00","gross_line_total":"$1,028.50","custom_value1":"https:\/\/picsum.photos\/200","custom_value2":"78","custom_value3":"Itaque laudantium.","custom_value4":"Qui voluptatem ea a.","type_id":"1","product_cost":"$0.00","tax_amount":"$93.50","date":"","tax_id":"","task_id":"","expense_id":"","cost_raw":935,"discount_raw":0,"line_total_raw":935,"gross_line_total
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);
2023-10-01 12:21:57 +02:00
// $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);
2023-09-27 13:44:09 +02:00
$this->engines['payments'] = json_decode($this->payment_data, true);
2023-10-01 12:21:57 +02:00
// $this->engines['purchase_orders'] = json_decode($this->purchase_order_data, true);
2023-09-27 13:44:09 +02:00
// 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
}