Plugin Directory

Changeset 3355121


Ignore:
Timestamp:
09/03/2025 07:10:39 AM (7 months ago)
Author:
them.es
Message:

updated trunk

Location:
billy/trunk
Files:
2 added
26 edited

Legend:

Unmodified
Added
Removed
  • billy/trunk/billy.php

    r3266011 r3355121  
    44 * Plugin URI: https://wordpress.org/plugins/billy
    55 * Description: A business-oriented billing suite powered by WordPress.
    6  * Version: 1.11.0
     6 * Version: 1.11.1
    77 * Author: them.es
    88 * Author URI: https://them.es/plugins/billy
     
    164164 *
    165165 * @param int     $new_post_id The newly created post's ID.
    166  * @param WP_Post $post The original post's object.
    167  * @param string  $status The destination status as set by the calling method: e.g. ‘draft’ if the function has been called using the “New Draft” links. Empty otherwise.
     166 * @param WP_Post $post        The original post's object.
     167 * @param string  $status      The destination status as set by the calling method: e.g. ‘draft’ if the function has been called using the “New Draft” links. Empty otherwise.
    168168 */
    169169function billy_custom_dp_duplicate_post( $new_post_id, $post, $status ) {
  • billy/trunk/blocks/build/index.asset.php

    r3266011 r3355121  
    1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-server-side-render'), 'version' => '752a98353a41fac1f7d2');
     1<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-server-side-render'), 'version' => '8fa277e056564a026ca5');
  • billy/trunk/blocks/build/index.js

    r3266011 r3355121  
    1 (()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var a in l)e.o(l,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:l[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,l=window.wp.blocks,a=window.wp.i18n,n=window.wp.blockEditor,s=window.wp.components,r=window.wp.serverSideRender;var c=e.n(r);(0,l.registerBlockType)("billy-blocks/header",{title:(0,a.__)("Header","billy"),icon:"editor-table",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Info","billy")},(0,t.createElement)("div",{className:"components-notice"},(0,t.createElement)("div",{className:"components-notice__content"},(0,t.createElement)("a",{href:globalDataBilly.wpAdmin+"edit.php?post_type=wp_block"},(0,a.sprintf)((0,a.__)("Edit the %s layout","billy"),(0,a.__)("Header","billy"))))),(0,t.createElement)("div",{className:"components-notice"},(0,t.createElement)("div",{className:"components-notice__content"},(0,a.sprintf)((0,a.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,a.__)("Header","billy")))))),(0,t.createElement)(s.Disabled,null,(0,t.createElement)(c(),{block:"billy-blocks/header"}))),save:e=>null});const o=window.wp.data;(0,l.registerBlockType)("billy-blocks/invoice-actions",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Invoice","billy"),(0,a.__)("Actions","billy")),icon:"menu-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)((e=>({postModifiedDate:e("core/editor").getEditedPostAttribute("modified")})))((e=>{const{postModifiedDate:l}=e,s=(0,n.useBlockProps)({className:"components-placeholder",style:{minHeight:"auto"}});return(0,t.createElement)("div",{...s},(0,t.createElement)("small",null,(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Last modified","billy"),new Date(l).toLocaleString())))})),save:()=>null});const i=window.wp.element;(0,l.registerBlockType)("billy-blocks/invoice-meta",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Invoice","billy"),(0,a.__)("Meta","billy")),icon:"editor-textcolor",category:"billy-blocks",attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},supports:{inserter:!1,reusable:!1,html:!1,className:!0},edit:e=>{const{className:l,attributes:{label:r,text:c},setAttributes:o}=e,m=(0,n.useBlockProps)({className:l?" "+l:""});return(0,t.createElement)("div",{...m},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Label","billy")},(0,t.createElement)(s.TextControl,{type:"text",className:"label",value:null!=r?r:"",onChange:e=>{o({label:e})}})),(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Text","billy")},(0,t.createElement)(s.TextControl,{type:"text",className:"text",value:null!=c?c:"",onChange:e=>{o({text:e})}}))),(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),r||"",c||(0,a.__)("N/A","billy"))))},save:e=>{const{className:l,attributes:{label:s,text:r}}=e,c=n.useBlockProps.save({className:l?" "+l:""});return r&&(0,t.createElement)("div",{...c},(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),s||"",r||(0,a.__)("N/A","billy"))))},deprecated:[{attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},save:e=>{const{className:l,attributes:{label:n,text:s}}=e;return s&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),n||"",s||(0,a.__)("N/A","billy"))))}},{attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},save:e=>{const{className:l,attributes:{label:n,text:s}}=e;return s&&(0,t.createElement)("p",null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)("<p>"+(0,a.__)("<strong>%1$s</strong> <span>%2$s</span>","billy")+"</p>",n||"",s||(0,a.__)("N/A","billy"))))}}]}),(0,l.registerBlockType)("billy-blocks/invoice-date",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Invoice","billy"),(0,a.__)("Date","billy")),icon:"calendar-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,n.useBlockProps)();return(0,t.createElement)("div",{...e},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Info","billy")},(0,t.createElement)("div",{className:"components-notice is-warning"},(0,t.createElement)("div",{className:"components-notice__content"},(0,a.sprintf)((0,a.__)("Due to legal requirements in some countries, autogenerated data like %s can't be modified anymore after an invoice has been created in the system!","billy"),(0,a.__)("Date","billy")))))),(0,t.createElement)(s.Disabled,null,(0,t.createElement)(c(),{block:"billy-blocks/invoice-date"})))},save:()=>null}),(0,l.registerBlockType)("billy-blocks/invoice-duedate",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Invoice","billy"),(0,a.__)("Due Date","billy")),icon:"calendar-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,n.useBlockProps)();return(0,t.createElement)("div",{...e},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Info","billy")},(0,t.createElement)("div",{className:"components-notice"},(0,t.createElement)("div",{className:"components-notice__content"},(0,a.sprintf)((0,a.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,a.__)("Payment due days","billy")))))),(0,t.createElement)(s.Disabled,null,(0,t.createElement)(c(),{block:"billy-blocks/invoice-duedate"})))},save:()=>null}),(0,l.registerBlockType)("billy-blocks/invoice-number",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Invoice","billy"),(0,a.__)("Number","billy")),icon:"editor-ol",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,n.useBlockProps)();return(0,t.createElement)("div",{...e},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Info","billy")},(0,t.createElement)("div",{className:"components-notice"},(0,t.createElement)("div",{className:"components-notice__content"},(0,a.sprintf)((0,a.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,a.__)("Invoice number: Prefix","billy")))),(0,t.createElement)("div",{className:"components-notice is-warning"},(0,t.createElement)("div",{className:"components-notice__content"},(0,a.sprintf)((0,a.__)("Due to legal requirements in some countries, autogenerated data like %s can't be modified anymore after an invoice has been created in the system!","billy"),(0,a.__)("Invoice number","billy")))))),(0,t.createElement)(s.Disabled,null,(0,t.createElement)(c(),{block:"billy-blocks/invoice-number"})))},save:()=>null}),(0,l.registerBlockType)("billy-blocks/invoice-paymentinformation",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Invoice","billy"),(0,a.__)("Payment Information","billy")),icon:"info",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,n.useBlockProps)();return(0,t.createElement)("div",{...e},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Info","billy")},(0,t.createElement)("div",{className:"components-notice"},(0,t.createElement)("div",{className:"components-notice__content"},(0,a.sprintf)((0,a.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,a.__)("Payment Information","billy")))))),(0,t.createElement)(s.Disabled,null,(0,t.createElement)(c(),{block:"billy-blocks/invoice-paymentinformation"})))},save:()=>null});const m=(e,t=void 0)=>e.toLocaleString(t,{minimumFractionDigits:2,maximumFractionDigits:2}),u=e=>parseFloat(e)/100,b=e=>(e=new Date(e)||new Date,[1,2,3,4][Math.floor(e.getMonth()/3)]),p=[{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountSubtotal:c,amountTotal:o,taxRates:b,taxRatesTotal:p}}=e,d=n.useBlockProps.save({className:"invoicetable-block alignwide"+(l?" "+l:"")});return(0,t.createElement)("div",{...d},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Amount","billy")),b&&p>0&&(0,t.createElement)("th",{scope:"col"},(0,a.__)("Tax","billy")))),(0,t.createElement)("tbody",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,c>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("th",{colSpan:"2"},o>c?(0,a.__)("Subtotal","billy"):(0,a.__)("Total","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r)))),b&&p>0&&(0,t.createElement)("tr",{className:"taxrates"},(0,t.createElement)("th",{colSpan:"2"},(0,a.__)("Tax","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},JSON.parse(b).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),s,m(e.amount,r),"<small>("+e.taxRate+")</small><br>"))})))),o>c&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("th",{colSpan:"2"},(0,a.__)("Total","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))))))}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountSubtotal:c,amountTotal:o,taxRates:b,taxRatesTotal:p}}=e;return(0,t.createElement)("div",{className:"invoicetable-block alignwide"+(l?" "+l:"")},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Amount","billy")),b&&p>0&&(0,t.createElement)("th",{scope:"col"},(0,a.__)("Tax","billy")))),(0,t.createElement)("tbody",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,c>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("td",{colSpan:"2",className:"align-right"},o>c?(0,a.__)("Subtotal","billy"):(0,a.__)("Total","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r)))),b&&p>0&&(0,t.createElement)("tr",{className:"taxrates"},(0,t.createElement)("td",{colSpan:"2",className:"align-right"},(0,a.__)("Tax","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},JSON.parse(b).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),s,m(e.amount,r),"<small>("+e.taxRate+")</small><br>"))})))),o>c&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("td",{colSpan:"2",className:"align-right"},(0,a.__)("Total","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))))))}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountSubtotal:c,amountTotal:o,taxRates:b,taxRatesTotal:p}}=e;return(0,t.createElement)("div",{className:"invoicetable-block alignwide"+(l?" "+l:"")},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Amount","billy")),b&&p>0&&(0,t.createElement)("th",{scope:"col"},(0,a.__)("Tax","billy")))),(0,t.createElement)("tbody",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,c>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("td",{colSpan:"2",align:"right"},o>c?(0,a.__)("Subtotal","billy"):(0,a.__)("Total","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r)))),b&&p>0&&(0,t.createElement)("tr",{className:"taxrates"},(0,t.createElement)("td",{colSpan:"2",align:"right"},(0,a.__)("Tax","billy")),(0,t.createElement)("td",null,JSON.parse(b).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),s,m(e.amount,r),"<small>("+e.taxRate+")</small><br>"))})))),o>c&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("td",{colSpan:"2",align:"right"},(0,a.__)("Total","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))))))}}],d=[{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},description:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},save:e=>{const{className:l,attributes:{index:s,locale:r,taxRate:c,amount:o}}=e;return(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row"},s&&s),(0,t.createElement)("td",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("td",null,o&&m(o,r)),c&&u(c)*o>0&&(0,t.createElement)("td",null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),m(u(c)*o,r),"<small>("+c+")</small>"))))}},{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},description:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},save:e=>{const{className:l,attributes:{index:n,locale:s,description:r,taxRate:c,amount:o}}=e;return(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row"},n&&n),(0,t.createElement)("td",null,r&&(0,t.createElement)(i.RawHTML,null,r)),(0,t.createElement)("td",null,o&&m(o,s)),c&&u(c)*o>0&&(0,t.createElement)("td",null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),m(u(c)*o,s),"<small>("+c+")</small>"))))}}];let y;(0,l.registerBlockType)("billy-blocks/invoice-table",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Invoice","billy"),(0,a.__)("Table","billy")),icon:"menu-alt",category:"billy-blocks",attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)(((e,{clientId:t})=>{const{getBlocksByClientId:l}=e("core/block-editor");return{childBlocks:l(t)[0].innerBlocks}}))((e=>{const{className:l,childBlocks:r,attributes:{currency:c,locale:o,amountSubtotal:b,amountTotal:p,taxRates:d,taxRatesTotal:_},setAttributes:E}=e,f=(0,n.useBlockProps)({className:"invoicetable-block"+(l?" "+l:"")});return y=()=>{let e=0,t=0,l=0,a=[],n=[];E({currency:globalDataBilly.currency,locale:globalDataBilly.locale}),r&&r.length>0&&(r.forEach((l=>{const n=Number(l.attributes.amount),s=u(l.attributes.taxRate);e+=n,t+=n+s*n,a.push({taxRate:l.attributes.taxRate,amount:s*n})})),a.length>0&&(l=a.reduce(((e,t)=>e+t.amount),0),l=Number(l.toFixed(2)),a.reduce(((e,t)=>(e[t.taxRate]||(e[t.taxRate]={taxRate:t.taxRate,amount:0},n.push(e[t.taxRate])),e[t.taxRate].amount+=t.amount,e)),{})),E({taxRatesTotal:l,taxRates:JSON.stringify(n),amountSubtotal:e,amountTotal:t}))},(0,i.useEffect)((()=>{y()}),[r]),(0,t.createElement)("div",{...f},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Actions","billy")},(0,t.createElement)("button",{id:"updatetotals",className:"components-button is-secondary is-button",onClick:y},(0,a.__)("Update Totals","billy")))),(0,t.createElement)(n.InnerBlocks,{templateLock:!1,template:[["billy-blocks/invoice-tablerow"]],allowedBlocks:["billy-blocks/invoice-tablerow"],renderAppender:()=>(0,t.createElement)(n.InnerBlocks.ButtonBlockAppender,null)}),b>0&&(0,t.createElement)("table",{className:"totals"},(0,t.createElement)("tbody",null,b>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("th",{style:{width:"50%"}},p>b?(0,a.__)("Subtotal","billy"):(0,a.__)("Total","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(b,o)))),d&&_>0&&(0,t.createElement)("tr",{className:"taxRates"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.__)("Tax","billy")),(0,t.createElement)("td",null,JSON.parse(d).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),c,m(e.amount,o),"<small>("+e.taxRate+")</small><br>"))})))),p>b&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.__)("Total","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(p,o)))))))})),save:e=>{const{className:l,attributes:{currency:s,locale:r,amountSubtotal:c,amountTotal:o,taxRates:b,taxRatesTotal:p}}=e,d=n.useBlockProps.save({className:"invoicetable-block alignwide"+(l?" "+l:"")});return(0,t.createElement)("div",{...d},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col","data-label":"title"}),(0,t.createElement)("th",{scope:"col","data-label":"description"}),(0,t.createElement)("th",{scope:"col","data-label":"amount"}),b&&p>0&&(0,t.createElement)("th",{scope:"col","data-label":"tax"}))),(0,t.createElement)("tbody",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,c>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("th",{colSpan:"2","data-label":o>c?"subtotal":"total"}),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r)))),b&&p>0&&(0,t.createElement)("tr",{className:"taxrates"},(0,t.createElement)("th",{colSpan:"2","data-label":"tax"}),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},JSON.parse(b).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),s,m(e.amount,r),"<small>("+e.taxRate+")</small><br>"))})))),o>c&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("th",{colSpan:"2","data-label":"total"}),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))))))},deprecated:p}),(0,l.registerBlockType)("billy-blocks/invoice-tablerow",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Invoice","billy"),(0,a.__)("Table Row","billy")),icon:"menu-alt",category:"billy-blocks",parent:["billy-blocks/invoice-table"],attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)(((e,{clientId:t})=>{const{getBlockRootClientId:l,getBlockIndex:a}=e("core/block-editor");return{i:a(t,l(t))+1}}))((e=>{const{i:l,attributes:{index:r,currency:c,locale:o,description:m,taxRate:b,amount:p,amountIncl:d,quantity:_,quantityRate:E},setAttributes:f}=e,g=(0,n.useBlockProps)();(0,i.useEffect)((()=>{f({index:l,currency:globalDataBilly.currency,locale:globalDataBilly.locale}),""===b&&f({taxRate:0===globalDataBilly.taxOptions.length?"0%":globalDataBilly.taxOptions[0].value})}),[b]);const x=e=>{f({amountIncl:e>0?Number(e):""}),y()},h=e=>{f({amount:e>0?Number(e):""}),x(Number(e)+Number(e)*u(b))};return(0,t.createElement)("div",{...g},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Quantity/Rate Calculator","billy")},(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.__)("Quantity","billy"),placeholder:(0,a.__)("0","billy"),value:null!=_?_:"",onChange:e=>{f({quantity:e>0?Number(e):""}),h(Number(e)*Number(E))}}),(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Rate","billy"),c),placeholder:(0,a.__)("0","billy"),value:null!=E?E:"",onChange:e=>{f({quantityRate:e>0?Number(e):""}),h(Number(_)*Number(e))}}))),(0,t.createElement)("table",null,(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{className:"index"},r&&r),(0,t.createElement)("td",{style:{width:"30vw",minWidth:"200px"}},(0,t.createElement)(n.InnerBlocks,{template:[["core/paragraph",{content:m||""}]],allowedBlocks:["core/block","core/heading","core/paragraph","core/list","core/html"]})),(0,t.createElement)("td",null,(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Amount","billy"),c),className:"amount",placeholder:(0,a.__)("0","billy"),value:null!=p?p:"",onChange:h})),(0,t.createElement)("td",null,(0,t.createElement)(s.SelectControl,{className:"taxrate",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Tax","billy"),"%"),value:null!=b?b:"",options:0!==globalDataBilly.taxOptions.length?globalDataBilly.taxOptions:"0%"!==b&&0===globalDataBilly.taxOptions.length?[{label:b,value:b},{label:"0%",value:"0%"}]:"",onChange:e=>{f({taxRate:e}),x(Number(p)+Number(p)*u(e))}})),(0,t.createElement)("td",null,(0,t.createElement)(s.TextControl,{type:"number",disabled:"disabled",label:c,className:"amount-tax",placeholder:(0,a.__)("0","billy"),value:null!=d?d:""}))))))})),save:e=>{const{attributes:{index:l,locale:s,taxRate:r,amount:c}}=e;return(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row"},l&&l),(0,t.createElement)("td",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("td",null,c&&m(c,s)),r&&u(r)*c>0&&(0,t.createElement)("td",null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),m(u(r)*c,s),"<small>("+r+")</small>"))))},deprecated:d}),(0,l.registerBlockType)("billy-blocks/quote-actions",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Quote","billy"),(0,a.__)("Actions","billy")),icon:"menu-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)((e=>({postModifiedDate:e("core/editor").getEditedPostAttribute("modified")})))((e=>{const{postModifiedDate:l}=e,s=(0,n.useBlockProps)({className:"components-placeholder",style:{minHeight:"auto"}});return(0,t.createElement)("div",{...s},(0,t.createElement)("small",null,(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Last modified","billy"),new Date(l).toLocaleString())))})),save:()=>null}),(0,l.registerBlockType)("billy-blocks/quote-meta",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Quote","billy"),(0,a.__)("Meta","billy")),icon:"editor-textcolor",category:"billy-blocks",attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},supports:{inserter:!1,reusable:!1,html:!1,className:!0},edit:e=>{const{className:l,attributes:{label:r,text:c},setAttributes:o}=e,m=(0,n.useBlockProps)({className:l?" "+l:""});return(0,t.createElement)("div",{...m},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Label","billy")},(0,t.createElement)(s.TextControl,{type:"text",className:"label",value:null!=r?r:"",onChange:e=>{o({label:e})}})),(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Text","billy")},(0,t.createElement)(s.TextControl,{type:"text",className:"text",value:null!=c?c:"",onChange:e=>{o({text:e})}}))),(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),r||"",c||(0,a.__)("N/A","billy"))))},save:e=>{const{className:l,attributes:{label:s,text:r}}=e,c=n.useBlockProps.save({className:l?" "+l:""});return r&&(0,t.createElement)("div",{...c},(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),s||"",r||(0,a.__)("N/A","billy"))))},deprecated:[{attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},save:e=>{const{attributes:{label:l,text:n}}=e;return n&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),l||"",n||(0,a.__)("N/A","billy"))))}},{attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},save:e=>{const{attributes:{label:l,text:n}}=e;return n&&(0,t.createElement)("p",null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)("<p>"+(0,a.__)("<strong>%1$s</strong> <span>%2$s</span>","billy")+"</p>",l||"",n||(0,a.__)("N/A","billy"))))}}]}),(0,l.registerBlockType)("billy-blocks/quote-date",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Quote","billy"),(0,a.__)("Date","billy")),icon:"calendar-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,n.useBlockProps)();return(0,t.createElement)("div",{...e},(0,t.createElement)(s.Disabled,null,(0,t.createElement)(c(),{block:"billy-blocks/quote-date"})))},save:()=>null}),(0,l.registerBlockType)("billy-blocks/quote-information",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Quote","billy"),(0,a.__)("Information","billy")),icon:"info",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,n.useBlockProps)();return(0,t.createElement)("div",{...e},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Info","billy")},(0,t.createElement)("div",{className:"components-notice"},(0,t.createElement)("div",{className:"components-notice__content"},(0,a.sprintf)((0,a.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,a.__)("Quote Information","billy")))))),(0,t.createElement)(c(),{block:"billy-blocks/quote-information"}))},save:()=>null});const _=[{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountSubtotal:c,amountTotal:o,taxRates:b,taxRatesTotal:p}}=e,d=n.useBlockProps.save({className:"quotetable-block alignwide"+(l?" "+l:"")});return(0,t.createElement)("div",{...d},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Amount","billy")),b&&p>0&&(0,t.createElement)("th",{scope:"col"},(0,a.__)("Tax","billy")))),(0,t.createElement)("tbody",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,c>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("th",{colSpan:"2"},o>c?(0,a.__)("Subtotal","billy"):(0,a.__)("Total","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r)))),b&&p>0&&(0,t.createElement)("tr",{className:"taxrates"},(0,t.createElement)("th",{colSpan:"2"},(0,a.__)("Tax","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},JSON.parse(b).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),s,m(e.amount,r),"<small>("+e.taxRate+")</small><br>"))})))),o>c&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("th",{colSpan:"2"},(0,a.__)("Total","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))))))}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountSubtotal:c,amountTotal:o,taxRates:b,taxRatesTotal:p}}=e;return(0,t.createElement)("div",{className:"quotetable-block alignwide"+(l?" "+l:"")},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Amount","billy")),b&&p>0&&(0,t.createElement)("th",{scope:"col"},(0,a.__)("Tax","billy")))),(0,t.createElement)("tbody",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,c>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("td",{colSpan:"2",className:"align-right"},o>c?(0,a.__)("Subtotal","billy"):(0,a.__)("Total","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r)))),b&&p>0&&(0,t.createElement)("tr",{className:"taxrates"},(0,t.createElement)("td",{colSpan:"2",className:"align-right"},(0,a.__)("Tax","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},JSON.parse(b).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),s,m(e.amount,r),"<small>("+e.taxRate+")</small><br>"))})))),o>c&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("td",{colSpan:"2",className:"align-right"},(0,a.__)("Total","billy")),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))))))}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountSubtotal:c,amountTotal:o,taxRates:b,taxRatesTotal:p}}=e;return(0,t.createElement)("div",{className:"quotetable-block alignwide"+(l?" "+l:"")},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col"},(0,a.__)("Amount","billy")),b&&p>0&&(0,t.createElement)("th",{scope:"col"},(0,a.__)("Tax","billy")))),(0,t.createElement)("tbody",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,c>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("td",{colSpan:"2",align:"right"},o>c?(0,a.__)("Subtotal","billy"):(0,a.__)("Total","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r)))),b&&p>0&&(0,t.createElement)("tr",{className:"taxrates"},(0,t.createElement)("td",{colSpan:"2",align:"right"},(0,a.__)("Tax","billy")),(0,t.createElement)("td",null,JSON.parse(b).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),s,m(e.amount,r),"<small>("+e.taxRate+")</small><br>"))})))),o>c&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("td",{colSpan:"2",align:"right"},(0,a.__)("Total","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))))))}}],E=[{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},description:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},save:e=>{const{className:l,attributes:{index:s,locale:r,taxRate:c,amount:o}}=e;return(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row"},s&&s),(0,t.createElement)("td",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("td",null,o&&m(o,r)),c&&u(c)*o>0&&(0,t.createElement)("td",null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),m(u(c)*o,r),"<small>("+c+")</small>"))))}},{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},description:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},save:e=>{const{className:l,attributes:{index:n,locale:s,description:r,taxRate:c,amount:o}}=e;return(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row"},n&&n),(0,t.createElement)("td",null,r&&(0,t.createElement)(i.RawHTML,null,r)),(0,t.createElement)("td",null,o&&m(o,s)),c&&u(c)*o>0&&(0,t.createElement)("td",null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),m(u(c)*o,s),"<small>("+c+")</small>"))))}}];let f;(0,l.registerBlockType)("billy-blocks/quote-table",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Quote","billy"),(0,a.__)("Table","billy")),icon:"menu-alt",category:"billy-blocks",attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)(((e,{clientId:t})=>{const{getBlocksByClientId:l}=e("core/block-editor");return{childBlocks:l(t)[0].innerBlocks}}))((e=>{const{className:l,childBlocks:r,attributes:{currency:c,locale:o,amountSubtotal:b,amountTotal:p,taxRates:d,taxRatesTotal:y},setAttributes:_}=e,E=(0,n.useBlockProps)({className:"quotetable-block"+(l?" "+l:"")});return f=()=>{let e=0,t=0,l=0,a=[],n=[];_({currency:globalDataBilly.currency,locale:globalDataBilly.locale}),r&&r.length>0&&(r.forEach((l=>{const n=Number(l.attributes.amount),s=u(l.attributes.taxRate);e+=n,t+=n+s*n,a.push({taxRate:l.attributes.taxRate,amount:s*n})})),a.length>0&&(l=a.reduce(((e,t)=>e+t.amount),0),l=Number(l.toFixed(2)),a.reduce(((e,t)=>(e[t.taxRate]||(e[t.taxRate]={taxRate:t.taxRate,amount:0},n.push(e[t.taxRate])),e[t.taxRate].amount+=t.amount,e)),{})),_({taxRatesTotal:l,taxRates:JSON.stringify(n),amountSubtotal:e,amountTotal:t}))},(0,i.useEffect)((()=>{f()}),[r]),(0,t.createElement)("div",{...E},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Actions","billy")},(0,t.createElement)("button",{id:"updatetotals",className:"components-button is-secondary is-button",onClick:f},(0,a.__)("Update Totals","billy")))),(0,t.createElement)(n.InnerBlocks,{templateLock:!1,template:[["billy-blocks/quote-tablerow"]],allowedBlocks:["billy-blocks/quote-tablerow"],renderAppender:()=>(0,t.createElement)(n.InnerBlocks.ButtonBlockAppender,null)}),b>0&&(0,t.createElement)("table",{className:"totals"},(0,t.createElement)("tbody",null,b>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("th",{style:{width:"50%"}},p>b?(0,a.__)("Subtotal","billy"):(0,a.__)("Total","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(b,o)))),d&&y>0&&(0,t.createElement)("tr",{className:"taxRates"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.__)("Tax","billy")),(0,t.createElement)("td",null,JSON.parse(d).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),c,m(e.amount,o),"<small>("+e.taxRate+")</small><br>"))})))),p>b&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.__)("Total","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(p,o)))))))})),save:e=>{const{className:l,attributes:{currency:s,locale:r,amountSubtotal:c,amountTotal:o,taxRates:b,taxRatesTotal:p}}=e,d=n.useBlockProps.save({className:"quotetable-block alignwide"+(l?" "+l:"")});return(0,t.createElement)("div",{...d},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col","data-label":"title"}),(0,t.createElement)("th",{scope:"col","data-label":"description"}),(0,t.createElement)("th",{scope:"col","data-label":"amount"}),b&&p>0&&(0,t.createElement)("th",{scope:"col","data-label":"tax"}))),(0,t.createElement)("tbody",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,c>0&&(0,t.createElement)("tr",{className:"subtotal"},(0,t.createElement)("th",{colSpan:"2","data-label":o>c?"subtotal":"total"}),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r)))),b&&p>0&&(0,t.createElement)("tr",{className:"taxrates"},(0,t.createElement)("th",{colSpan:"2","data-label":"tax"}),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},JSON.parse(b).sort(((e,t)=>u(e.taxRate)-u(t.taxRate))).map(((e,l)=>{if(e.amount>0)return(0,t.createElement)(i.RawHTML,{key:l},(0,a.sprintf)((0,a.__)("%1$s %2$s %3$s","billy"),s,m(e.amount,r),"<small>("+e.taxRate+")</small><br>"))})))),o>c&&(0,t.createElement)("tr",{className:"total"},(0,t.createElement)("th",{colSpan:"2","data-label":"total"}),(0,t.createElement)("td",{colSpan:b&&p>0?"2":null},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))))))},deprecated:_}),(0,l.registerBlockType)("billy-blocks/quote-tablerow",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Quote","billy"),(0,a.__)("Table Row","billy")),icon:"menu-alt",category:"billy-blocks",parent:["billy-blocks/quote-table"],attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)(((e,{clientId:t})=>{const{getBlockRootClientId:l,getBlockIndex:a}=e("core/block-editor");return{i:a(t,l(t))+1}}))((e=>{const{i:l,attributes:{index:r,currency:c,locale:o,description:m,taxRate:b,amount:p,amountIncl:d,quantity:y,quantityRate:_},setAttributes:E}=e,g=(0,n.useBlockProps)();(0,i.useEffect)((()=>{E({index:l,currency:globalDataBilly.currency,locale:globalDataBilly.locale}),""===b&&E({taxRate:0===globalDataBilly.taxOptions.length?"0%":globalDataBilly.taxOptions[0].value})}),[b]);const x=e=>{E({amountIncl:e>0?Number(e):""}),f()},h=e=>{E({amount:e>0?Number(e):""}),x(Number(e)+Number(e)*u(b))};return(0,t.createElement)("div",{...g},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Quantity/Rate Calculator","billy")},(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.__)("Quantity","billy"),placeholder:(0,a.__)("0","billy"),value:null!=y?y:"",onChange:e=>{E({quantity:e>0?Number(e):""}),h(Number(e)*Number(_))}}),(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Rate","billy"),c),placeholder:(0,a.__)("0","billy"),value:null!=_?_:"",onChange:e=>{E({quantityRate:e>0?Number(e):""}),h(Number(y)*Number(e))}}))),(0,t.createElement)("table",null,(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{className:"index"},r&&r),(0,t.createElement)("td",{style:{width:"30vw",minWidth:"200px"}},(0,t.createElement)(n.InnerBlocks,{template:[["core/paragraph",{content:m||""}]],allowedBlocks:["core/block","core/heading","core/paragraph","core/list","core/html"]})),(0,t.createElement)("td",null,(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Amount","billy"),c),className:"amount",placeholder:(0,a.__)("0","billy"),value:null!=p?p:"",onChange:h})),(0,t.createElement)("td",null,(0,t.createElement)(s.SelectControl,{className:"taxrate",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Tax","billy"),"%"),value:null!=b?b:"",options:0!==globalDataBilly.taxOptions.length?globalDataBilly.taxOptions:"0%"!==b&&0===globalDataBilly.taxOptions.length?[{label:b,value:b},{label:"0%",value:"0%"}]:"",onChange:e=>{E({taxRate:e}),x(Number(p)+Number(p)*u(e))}})),(0,t.createElement)("td",null,(0,t.createElement)(s.TextControl,{type:"number",disabled:"disabled",label:c,className:"amount-tax",placeholder:(0,a.__)("0","billy"),value:null!=d?d:""}))))))})),save:e=>{const{attributes:{index:l,locale:s,taxRate:r,amount:c}}=e;return(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"row"},l&&l),(0,t.createElement)("td",null,(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("td",null,c&&m(c,s)),r&&u(r)*c>0&&(0,t.createElement)("td",null,(0,t.createElement)(i.RawHTML,null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),m(u(r)*c,s),"<small>("+r+")</small>"))))},deprecated:E}),(0,l.registerBlockType)("billy-blocks/quote-validuntildate",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Quote","billy"),(0,a.__)("Valid Until","billy")),icon:"calendar-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,n.useBlockProps)();return(0,t.createElement)("div",{...e},(0,t.createElement)(s.Disabled,null,(0,t.createElement)(c(),{block:"billy-blocks/quote-validuntildate"})))},save:()=>null});const g=[{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountTotalEarnings:c,amountTotalExpenses:o,amountTaxEarnings:i,amountTaxExpenses:u}}=e;return(0,t.createElement)("div",{className:"alignwide"+(l?" "+l:"")},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"index"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"date"},(0,a.__)("Date","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"description"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"reference"},(0,a.__)("Reference","billy")),(0,t.createElement)("th",{scope:"col",className:"sort earnings","data-sort":"earning"},(0,a.__)("Earnings","billy")),(0,t.createElement)("th",{scope:"col",className:"sort expenses","data-sort":"expense"},(0,a.__)("Expenses","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"tax"},(0,a.__)("Taxes","billy")))),(0,t.createElement)("tbody",{className:"list"},(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("th",{colSpan:"5"},(0,a.sprintf)((0,a.__)("%1$s / %2$s","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r))),(0,t.createElement)("td",{className:"sum expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))),(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("th",{colSpan:"5"},(0,a.__)("Profit","billy")),(0,t.createElement)("td",{colSpan:"2",className:"profit"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c-o,r)))),(i>0||u>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("th",{colSpan:"5"},(0,a.sprintf)((0,a.__)("%1$s (%2$s / %3$s)","billy"),(0,a.__)("Taxes","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum tax-earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(i,r))),(0,t.createElement)("td",{className:"sum tax-expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(u,r)))))))}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountTotalEarnings:c,amountTotalExpenses:o,amountTaxEarnings:i,amountTaxExpenses:u}}=e;return(0,t.createElement)("div",{className:"alignwide"+(l?" "+l:"")},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"index"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"date"},(0,a.__)("Date","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"description"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"reference"},(0,a.__)("Reference","billy")),(0,t.createElement)("th",{scope:"col",className:"sort earnings","data-sort":"earning"},(0,a.__)("Earnings","billy")),(0,t.createElement)("th",{scope:"col",className:"sort expenses","data-sort":"expense"},(0,a.__)("Expenses","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"tax"},(0,a.__)("Taxes","billy")))),(0,t.createElement)("tbody",{className:"list"},(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"5",className:"alignright"},(0,a.sprintf)((0,a.__)("%1$s / %2$s","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r))),(0,t.createElement)("td",{className:"sum expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))),(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"5",className:"alignright"},(0,a.__)("Profit","billy")),(0,t.createElement)("td",{colSpan:"2",className:"profit"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c-o,r)))),(i>0||u>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"5",className:"alignright"},(0,a.sprintf)((0,a.__)("%1$s (%2$s / %3$s)","billy"),(0,a.__)("Taxes","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum tax-earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(i,r))),(0,t.createElement)("td",{className:"sum tax-expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(u,r)))))))}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountTotalEarnings:c,amountTotalExpenses:o,amountTaxEarnings:i,amountTaxExpenses:u}}=e;return(0,t.createElement)("div",{className:"alignwide"+(l?" "+l:"")},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"index"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"date"},(0,a.__)("Date","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"description"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"reference"},(0,a.__)("Reference","billy")),(0,t.createElement)("th",{scope:"col",className:"sort earnings","data-sort":"earning"},(0,a.__)("Earnings","billy")),(0,t.createElement)("th",{scope:"col",className:"sort expenses","data-sort":"expense"},(0,a.__)("Expenses","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"tax"},(0,a.__)("Tax","billy")))),(0,t.createElement)("tbody",{className:"list"},(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"4",align:"right"},(0,a.sprintf)((0,a.__)("%1$s / %2$s","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r))),(0,t.createElement)("td",{className:"sum expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))),(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"4",align:"right"},(0,a.__)("Profit","billy")),(0,t.createElement)("td",{colSpan:"2",className:"profit"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c-o,r)))),(i>0||u>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"4",align:"right"},(0,a.sprintf)((0,a.__)("%1$s (%2$s / %3$s)","billy"),(0,a.__)("Taxes","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum tax-earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(i,r))),(0,t.createElement)("td",{className:"sum tax-expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(u,r)))))))}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},save:e=>{const{className:l,attributes:{currency:s,locale:r,amountTotalEarnings:c,amountTotalExpenses:o,amountTaxEarnings:i,amountTaxExpenses:u}}=e;return(0,t.createElement)("div",{className:"alignwide"+(l?" "+l:"")},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"index"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"date"},(0,a.__)("Date","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"description"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"reference"},(0,a.__)("Reference","billy")),(0,t.createElement)("th",{scope:"col",className:"sort earnings","data-sort":"earning"},(0,a.__)("Earning","billy")),(0,t.createElement)("th",{scope:"col",className:"sort expenses","data-sort":"expense"},(0,a.__)("Expense","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"tax"},(0,a.__)("Tax","billy")))),(0,t.createElement)("tbody",{className:"list"},(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"4",align:"right"},(0,a.sprintf)((0,a.__)("%1$s / %2$s","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r))),(0,t.createElement)("td",{className:"sum expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))),(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"4",align:"right"},(0,a.__)("Profit","billy")),(0,t.createElement)("td",{colSpan:"2",className:"profit"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c-o,r)))),(i>0||u>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"4",align:"right"},(0,a.sprintf)((0,a.__)("%1$s (%2$s / %3$s)","billy"),(0,a.__)("Taxes","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum tax-earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(i,r))),(0,t.createElement)("td",{className:"sum tax-expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(u,r)))))))}}],x=[{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},date:{type:"string",default:""},quarter:{type:"number",default:""},reference:{type:"string",default:""},earning:{type:"number",default:""},expense:{type:"number",default:""},tax:{type:"number",default:""},postUUID:{type:"string",default:""},postTitle:{type:"string",default:""},postLink:{type:"string",default:""},postType:{type:"string",default:""}},save:e=>{const{className:l,attributes:{index:s,locale:r,date:c,quarter:o,earning:i,expense:u,tax:b,reference:p,postLink:d}}=e;return(0,t.createElement)("tr",{"data-date":c&&new Date(c).toISOString().substring(0,10),"data-quarter":o&&(0,a.sprintf)((0,a.__)("Q%s","billy"),o),"data-reference":p&&p,"data-earning":i>0?i:null,"data-expense":u>0?u:null,"data-tax":b>0?b:null},(0,t.createElement)("th",{className:"index",scope:"row"},s&&s),(0,t.createElement)("td",{className:"date","data-value":c&&new Date(c).toISOString().substring(0,10)},c&&new Date(c).toISOString().substring(0,10),(0,t.createElement)("sub",null,o&&(0,a.sprintf)((0,a.__)("Q%s","billy"),o))),(0,t.createElement)("td",{className:"description"},(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("td",{className:"reference"},p&&!d&&p,p&&d&&(0,t.createElement)("a",{href:d},p)),(0,t.createElement)("td",{className:"amount earning","data-value":i>0?i:null},i&&i>0&&m(i,r)),(0,t.createElement)("td",{className:"amount expense","data-value":u>0?u:null},u&&u>0&&m(u,r)),b&&b>0&&(0,t.createElement)("td",{className:"amount tax","data-value":b},m(b,r)))}},{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},date:{type:"string",default:""},quarter:{type:"number",default:""},reference:{type:"string",default:""},earning:{type:"number",default:""},expense:{type:"number",default:""},tax:{type:"number",default:""},postUUID:{type:"string",default:""},postTitle:{type:"string",default:""},postLink:{type:"string",default:""},postType:{type:"string",default:""}},save:e=>{const{className:l,attributes:{index:s,locale:r,date:c,quarter:o,earning:i,expense:u,tax:b,reference:p,postLink:d}}=e;return(0,t.createElement)("tr",{"data-date":c&&new Date(c).toISOString().substring(0,10),"data-quarter":o&&(0,a.sprintf)((0,a.__)("Q%s","billy"),o),"data-reference":p&&p,"data-earning":i>0?i:null,"data-expense":u>0?u:null,"data-tax":b>0?b:null},(0,t.createElement)("th",{className:"index",scope:"row"},s&&s),(0,t.createElement)("td",{className:"date","data-value":c&&new Date(c).toISOString().substring(0,10)},c&&new Date(c).toISOString().substring(0,10),(0,t.createElement)("sub",null,o&&(0,a.sprintf)((0,a.__)("Q%s","billy"),o))),(0,t.createElement)("td",{className:"description"},(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("td",{className:"reference"},p&&!d&&p,p&&d&&(0,t.createElement)("a",{href:d},p)),(0,t.createElement)("td",{className:"amount earning","data-value":i>0?i:null},i&&i>0&&m(i,r)),(0,t.createElement)("td",{className:"amount expense","data-value":u>0?u:null},u&&u>0&&m(u,r)),(0,t.createElement)("td",{className:"amount tax","data-value":b>0?b:null},b&&b>0&&m(b,r)))}},{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},date:{type:"string",default:""},quarter:{type:"number",default:""},reference:{type:"string",default:""},description:{type:"string",default:""},earning:{type:"number",default:""},expense:{type:"number",default:""},tax:{type:"number",default:""},postUUID:{type:"string",default:""},postTitle:{type:"string",default:""},postLink:{type:"string",default:""},postType:{type:"string",default:""}},save:e=>{const{className:l,attributes:{index:n,locale:s,date:r,quarter:c,description:o,earning:i,expense:u,tax:b,reference:p,postLink:d}}=e;return(0,t.createElement)("tr",{"data-date":r&&new Date(r).toISOString().substring(0,10),"data-quarter":c&&(0,a.sprintf)((0,a.__)("Q%s","billy"),c),"data-reference":p&&p,"data-earning":i>0?i:null,"data-expense":u>0?u:null,"data-tax":b>0?b:null},(0,t.createElement)("th",{className:"index",scope:"row"},n&&n),(0,t.createElement)("td",{className:"date","data-value":r&&new Date(r).toISOString().substring(0,10)},r&&new Date(r).toISOString().substring(0,10),(0,t.createElement)("sub",null,c&&(0,a.sprintf)((0,a.__)("Q%s","billy"),c))),(0,t.createElement)("td",{className:"description"},o&&o),(0,t.createElement)("td",{className:"reference"},p&&!d&&p,p&&d&&(0,t.createElement)("a",{href:d},p)),(0,t.createElement)("td",{className:"amount earning","data-value":i>0?i:null},i&&i>0&&m(i,s)),(0,t.createElement)("td",{className:"amount expense","data-value":u>0?u:null},u&&u>0&&m(u,s)),(0,t.createElement)("td",{className:"amount tax","data-value":b>0?b:null},b&&b>0&&m(b,s)))}}];let h;(0,l.registerBlockType)("billy-blocks/accounting-table",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Accounting","billy"),(0,a.__)("Table","billy")),icon:"menu-alt",category:"billy-blocks",attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)(((e,{clientId:t})=>{const{getBlocksByClientId:l}=e("core/block-editor"),a=l(t)[0].innerBlocks;return a.sort(((e,t)=>new Date(e.attributes.date)-new Date(t.attributes.date))),{childBlocks:a}}))((e=>{const{className:l,childBlocks:r,attributes:{currency:c,locale:o,amountTotalEarnings:u,amountTotalExpenses:b,amountTaxEarnings:p,amountTaxExpenses:d},setAttributes:y}=e,_=(0,n.useBlockProps)({className:"accountingtable-block"+(l?" "+l:"")});return h=()=>{let e=0,t=0,l=0,a=0;y({currency:globalDataBilly.currency,locale:globalDataBilly.locale}),r&&r.length>0&&r.forEach((n=>{const s=Number(n.attributes.tax);e+=Number(n.attributes.earning),t+=Number(n.attributes.expense),n.attributes.earning&&(l+=s),n.attributes.expense&&(a+=s)})),y({amountTotalEarnings:e,amountTotalExpenses:t,amountTaxEarnings:l,amountTaxExpenses:a})},(0,i.useEffect)((()=>{h()}),[r]),(0,t.createElement)("div",{..._},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Actions","billy")},(0,t.createElement)("button",{id:"updatetotals",className:"components-button is-secondary is-button",onClick:h},(0,a.__)("Update Totals","billy")))),(0,t.createElement)(n.InnerBlocks,{templateLock:!1,template:[["billy-blocks/accounting-tablerow"]],allowedBlocks:["billy-blocks/accounting-tablerow"],renderAppender:()=>(0,t.createElement)(n.InnerBlocks.ButtonBlockAppender,null)}),(0,t.createElement)("table",{className:"totals"},(0,t.createElement)("tbody",null,u>0&&(0,t.createElement)("tr",{className:"earnings"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.__)("Earnings","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(u,o)))),b>0&&(0,t.createElement)("tr",{className:"expenses"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.__)("Expenses","billy")),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(b,o)))),(u>0||b>0)&&(0,t.createElement)("tr",{className:"profit"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.__)("Profit","billy")),(0,t.createElement)("td",{style:{borderTop:"2px solid"}},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(u-b,o)))),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("tr",{className:"taxes-earnings"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.sprintf)((0,a.__)("Taxes (%s)","billy"),(0,a.__)("Earnings","billy"))),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(p,o)))),(0,t.createElement)("tr",{className:"taxes-expenses"},(0,t.createElement)("th",{style:{width:"50%"}},(0,a.sprintf)((0,a.__)("Taxes (%s)","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",null,(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),c,m(d,o))))))))})),save:e=>{const{className:l,attributes:{currency:s,locale:r,amountTotalEarnings:c,amountTotalExpenses:o,amountTaxEarnings:i,amountTaxExpenses:u}}=e,b=n.useBlockProps.save({className:"alignwide"+(l?" "+l:"")});return(0,t.createElement)("div",{...b},(0,t.createElement)("table",{className:"table wp-block-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"index"},(0,a.__)("#","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"date"},(0,a.__)("Date","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"description"},(0,a.__)("Description","billy")),(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"reference"},(0,a.__)("Reference","billy")),(0,t.createElement)("th",{scope:"col",className:"sort earnings","data-sort":"earning"},(0,a.__)("Earnings","billy")),(0,t.createElement)("th",{scope:"col",className:"sort expenses","data-sort":"expense"},(0,a.__)("Expenses","billy")),(i>0||u>0)&&(0,t.createElement)("th",{scope:"col",className:"sort","data-sort":"tax"},(0,a.__)("Taxes","billy")))),(0,t.createElement)("tbody",{className:"list"},(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("tfoot",null,(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("th",{colSpan:"4"},(0,a.sprintf)((0,a.__)("%1$s / %2$s","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c,r))),(0,t.createElement)("td",{className:"sum expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(o,r)))),(c>0||o>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("th",{colSpan:"4"},(0,a.__)("Profit","billy")),(0,t.createElement)("td",{colSpan:"2",className:"profit"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(c-o,r)))),(i>0||u>0)&&(0,t.createElement)("tr",null,(0,t.createElement)("th",{colSpan:"4"},(0,a.sprintf)((0,a.__)("%1$s (%2$s / %3$s)","billy"),(0,a.__)("Taxes","billy"),(0,a.__)("Earnings","billy"),(0,a.__)("Expenses","billy"))),(0,t.createElement)("td",{className:"sum tax-earnings"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(i,r))),(0,t.createElement)("td",{className:"sum tax-expenses"},(0,a.sprintf)((0,a.__)("%1$s %2$s","billy"),s,m(u,r)))))))},deprecated:g}),(0,l.registerBlockType)("billy-blocks/accounting-tablerow",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Accounting","billy"),(0,a.__)("Table Row","billy")),icon:"menu-alt",category:"billy-blocks",parent:["billy-blocks/accounting-table"],attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},date:{type:"string",default:""},quarter:{type:"number",default:""},reference:{type:"string",default:""},earning:{type:"number",default:""},expense:{type:"number",default:""},tax:{type:"number",default:""},postUUID:{type:"string",default:""},postTitle:{type:"string",default:""},postLink:{type:"string",default:""},postType:{type:"string",default:""}},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)(((e,{clientId:t})=>{const{getBlockRootClientId:l,getBlockIndex:a}=e("core/block-editor");return{clientId:t,rootClientId:l(t),i:a(t,l(t))+1}}))((e=>{const{clientId:l,rootClientId:r,i:c,attributes:{index:m,currency:u,locale:p,description:d,date:y,quarter:_,earning:E,expense:f,tax:g,reference:x,postUUID:N,postTitle:k,postLink:$,postType:T},setAttributes:v}=e,w=(0,n.useBlockProps)();return(0,i.useEffect)((()=>{v({index:c,currency:globalDataBilly.currency,locale:globalDataBilly.locale}),""===y&&v({date:(new Date).toISOString().substring(0,10),quarter:b((new Date).toISOString().substring(0,10))})}),[]),(0,t.createElement)("div",{...w},(0,t.createElement)(n.InspectorControls,null,!N&&(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Date","billy")},(0,t.createElement)(s.DatePicker,{currentDate:y,onChange:e=>{v({date:e}),(e=>{v({quarter:Number(b(e))})})(e),(0,o.dispatch)("core/block-editor").moveBlockToPosition(l,r,r,c)}})),N&&$&&(0,t.createElement)(s.PanelBody,{title:(0,a.sprintf)((0,a.__)("Reference: %s","billy"),T?T.charAt(0).toUpperCase()+T.substring(1):(0,a.__)("Post","billy"))},(0,t.createElement)("p",null,(0,t.createElement)("a",{href:$},k||$)))),(0,t.createElement)("table",null,(0,t.createElement)("tbody",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{className:"index"},m&&m),(0,t.createElement)("td",{className:"date"},y&&new Date(y).toISOString().substring(0,10),(0,t.createElement)("sub",null,_&&(0,a.sprintf)((0,a.__)("Q%s","billy"),_))),(0,t.createElement)("td",{className:"description",style:{minWidth:"200px"}},(0,t.createElement)(n.InnerBlocks,{template:[["core/paragraph",{content:d||""}]],allowedBlocks:["core/block","core/heading","core/paragraph","core/list","core/html"]})),(0,t.createElement)("td",{className:"reference"},(0,t.createElement)(s.TextControl,{type:"text",label:(0,a.__)("Reference","billy"),placeholder:"",value:null!=x?x:"",onChange:e=>{v({reference:e})}})),(0,t.createElement)("td",{className:"amount earning"},(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Earning","billy"),u),placeholder:(0,a.__)("0","billy"),value:null!=E?E:"",onChange:e=>{v({expense:"",earning:e>0?Number(e):""}),h()}})),(0,t.createElement)("td",{className:"amount expense"},(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Expense","billy"),u),placeholder:(0,a.__)("0","billy"),value:null!=f?f:"",onChange:e=>{v({earning:"",expense:e>0?Number(e):""}),h()}})),(0,t.createElement)("td",{className:"amount tax"},(0,t.createElement)(s.TextControl,{type:"number",label:(0,a.sprintf)((0,a.__)("%1$s in %2$s","billy"),(0,a.__)("Tax","billy"),u),placeholder:(0,a.__)("0","billy"),value:null!=g?g:"",onChange:e=>{v({tax:e>0?Number(e):""}),h()}}))))))})),save:e=>{const{attributes:{index:l,locale:s,date:r,quarter:c,earning:o,expense:i,tax:u,reference:b,postLink:p}}=e;return(0,t.createElement)("tr",{"data-date":r&&new Date(r).toISOString().substring(0,10),"data-quarter":c&&(0,a.sprintf)((0,a.__)("Q%s","billy"),c),"data-reference":b&&b,"data-earning":o>0?o:null,"data-expense":i>0?i:null,"data-tax":u>0?u:null},(0,t.createElement)("th",{className:"index",scope:"row"},l&&l),(0,t.createElement)("td",{className:"date","data-value":r&&new Date(r).toISOString().substring(0,10)},r&&new Date(r).toISOString().substring(0,10),(0,t.createElement)("sub",null,c&&(0,a.sprintf)((0,a.__)("Q%s","billy"),c))),(0,t.createElement)("td",{className:"description"},(0,t.createElement)(n.InnerBlocks.Content,null)),(0,t.createElement)("td",{className:"reference"},b&&!p&&b,b&&p&&(0,t.createElement)("a",{href:p},b)),(0,t.createElement)("td",{className:"amount earning","data-value":o>0?o:null},o&&o>0&&m(o,s)),(0,t.createElement)("td",{className:"amount expense","data-value":i>0?i:null},i&&i>0&&m(i,s)),u&&u>0&&(0,t.createElement)("td",{className:"amount tax","data-value":u},m(u,s)))},deprecated:x}),(0,l.registerBlockType)("billy-blocks/accounting-actions",{apiVersion:2,title:(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Accounting","billy"),(0,a.__)("Actions","billy")),icon:"menu-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,o.withSelect)((e=>({postModifiedDate:e("core/editor").getEditedPostAttribute("modified")})))((e=>{const{postModifiedDate:l}=e,s=(0,n.useBlockProps)({className:"components-placeholder",style:{minHeight:"auto"}});return(0,t.createElement)("div",{...s},(0,t.createElement)("small",null,(0,a.sprintf)((0,a.__)("%1$s: %2$s","billy"),(0,a.__)("Last modified","billy"),new Date(l).toLocaleString())))})),save:()=>null});const N=window.wp.plugins,k=window.wp.editor;(0,N.registerPlugin)("billy-setup",{render:()=>(0,t.createElement)(k.PluginDocumentSettingPanel,{name:"billy-setup",title:(0,a.__)("Billy Setup","billy"),className:"my-document-setting-plugin"},(0,t.createElement)("p",null,(0,t.createElement)("a",{href:globalDataBilly.wpAdmin+"customize.php?autofocus[panel]=billy_setup_panel"},(0,a.__)("Settings (Theme Customizer)","billy"))),(0,t.createElement)("ul",{className:"ul code"},(0,t.createElement)("li",{title:(0,a.__)("Invoice number","billy")},(0,t.createElement)(c(),{block:"billy-blocks/invoice-number"})),(0,t.createElement)("li",{title:(0,a.__)("Quote number","billy")},(0,t.createElement)(c(),{block:"billy-blocks/quote-number"})),(0,t.createElement)("li",{title:(0,a.__)("Name","billy")},(0,t.createElement)(c(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"name"}})),(0,t.createElement)("li",{title:(0,a.__)("Address","billy")},(0,t.createElement)(c(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"address"}})),(0,t.createElement)("li",{title:(0,a.__)("VAT","billy")},(0,t.createElement)(c(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"vat"}})),(0,t.createElement)("li",{title:(0,a.__)("Currency","billy")},(0,t.createElement)(c(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"currency"}})),(0,t.createElement)("li",{title:(0,a.__)("Taxes","billy")},(0,t.createElement)(c(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"taxrates"}}))))}),(0,l.registerBlockType)("billy-blocks/theme-mod",{apiVersion:2,title:(0,a.__)("Theme Mod","billy"),icon:"admin-generic",category:"billy-blocks",attributes:{themeMod:{type:"string",default:""}},supports:{inserter:!1,reusable:!1,html:!1},edit:e=>{const{attributes:{themeMod:l},setAttributes:r}=e,o=(0,n.useBlockProps)();return(0,t.createElement)("div",{...o},(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,a.__)("Theme Mod","billy")},(0,t.createElement)(s.SelectControl,{label:(0,a.__)("Setting","billy"),help:(0,a.__)("Modify the value in the Theme Customizer.","billy"),options:globalDataBilly.themeModOptions,value:null!=l?l:"",onChange:e=>{r({themeMod:e})}}))),(0,t.createElement)(s.Disabled,null,(0,t.createElement)(c(),{block:"billy-blocks/theme-mod",attributes:e.attributes})))},save:()=>null})})();
     1(()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var s in l)e.o(l,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:l[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,l=window.wp.i18n,s=window.wp.blockEditor,a=window.wp.components,n=window.wp.serverSideRender;var i=e.n(n);const r=window.ReactJSXRuntime;(0,t.registerBlockType)("billy-blocks/header",{title:(0,l.__)("Header","billy"),icon:"editor-table",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Info","billy"),children:[(0,r.jsx)("div",{className:"components-notice",children:(0,r.jsx)("div",{className:"components-notice__content",children:(0,r.jsx)("a",{href:globalDataBilly.wpAdmin+"edit.php?post_type=wp_block",children:(0,l.sprintf)((0,l.__)("Edit the %s layout","billy"),(0,l.__)("Header","billy"))})})}),(0,r.jsx)("div",{className:"components-notice",children:(0,r.jsx)("div",{className:"components-notice__content",children:(0,l.sprintf)((0,l.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,l.__)("Header","billy"))})})]})}),(0,r.jsx)(a.Disabled,{children:(0,r.jsx)(i(),{block:"billy-blocks/header"})})]}),save:e=>null});const c=window.wp.data;(0,t.registerBlockType)("billy-blocks/invoice-actions",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Invoice","billy"),(0,l.__)("Actions","billy")),icon:"menu-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)(e=>({postModifiedDate:e("core/editor").getEditedPostAttribute("modified")}))(e=>{const{postModifiedDate:t}=e,a=(0,s.useBlockProps)({className:"components-placeholder",style:{minHeight:"auto"}});return(0,r.jsx)("div",{...a,children:(0,r.jsx)("small",{children:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Last modified","billy"),new Date(t).toLocaleString())})})}),save:()=>null});const o=window.wp.element;(0,t.registerBlockType)("billy-blocks/invoice-meta",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Invoice","billy"),(0,l.__)("Meta","billy")),icon:"editor-textcolor",category:"billy-blocks",attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},supports:{inserter:!1,reusable:!1,html:!1,className:!0},edit:e=>{const{className:t,attributes:{label:n,text:i},setAttributes:c}=e,d=(0,s.useBlockProps)({className:t?" "+t:""});return(0,r.jsxs)("div",{...d,children:[(0,r.jsxs)(s.InspectorControls,{children:[(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Label","billy"),children:(0,r.jsx)(a.TextControl,{type:"text",className:"label",value:null!=n?n:"",onChange:e=>{c({label:e})}})}),(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Text","billy"),children:(0,r.jsx)(a.TextControl,{type:"text",className:"text",value:null!=i?i:"",onChange:e=>{c({text:e})}})})]}),(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),n||"",i||(0,l.__)("N/A","billy"))})]})},save:e=>{const{className:t,attributes:{label:a,text:n}}=e,i=s.useBlockProps.save({className:t?" "+t:""});return n&&(0,r.jsx)("div",{...i,children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),a||"",n||(0,l.__)("N/A","billy"))})})},deprecated:[{attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},save:e=>{const{className:t,attributes:{label:s,text:a}}=e;return a&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),s||"",a||(0,l.__)("N/A","billy"))})})}},{attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},save:e=>{const{className:t,attributes:{label:s,text:a}}=e;return a&&(0,r.jsx)("p",{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)("<p>"+(0,l.__)("<strong>%1$s</strong> <span>%2$s</span>","billy")+"</p>",s||"",a||(0,l.__)("N/A","billy"))})})}}]}),(0,t.registerBlockType)("billy-blocks/invoice-date",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Invoice","billy"),(0,l.__)("Date","billy")),icon:"calendar-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,s.useBlockProps)();return(0,r.jsxs)("div",{...e,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Info","billy"),children:(0,r.jsx)("div",{className:"components-notice is-warning",children:(0,r.jsx)("div",{className:"components-notice__content",children:(0,l.sprintf)((0,l.__)("Due to legal requirements in some countries, autogenerated data like %s can't be modified anymore after an invoice has been created in the system!","billy"),(0,l.__)("Date","billy"))})})})}),(0,r.jsx)(a.Disabled,{children:(0,r.jsx)(i(),{block:"billy-blocks/invoice-date"})})]})},save:()=>null}),(0,t.registerBlockType)("billy-blocks/invoice-duedate",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Invoice","billy"),(0,l.__)("Due Date","billy")),icon:"calendar-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,s.useBlockProps)();return(0,r.jsxs)("div",{...e,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Info","billy"),children:(0,r.jsx)("div",{className:"components-notice",children:(0,r.jsx)("div",{className:"components-notice__content",children:(0,l.sprintf)((0,l.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,l.__)("Payment due days","billy"))})})})}),(0,r.jsx)(a.Disabled,{children:(0,r.jsx)(i(),{block:"billy-blocks/invoice-duedate"})})]})},save:()=>null}),(0,t.registerBlockType)("billy-blocks/invoice-number",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Invoice","billy"),(0,l.__)("Number","billy")),icon:"editor-ol",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,s.useBlockProps)();return(0,r.jsxs)("div",{...e,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Info","billy"),children:[(0,r.jsx)("div",{className:"components-notice",children:(0,r.jsx)("div",{className:"components-notice__content",children:(0,l.sprintf)((0,l.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,l.__)("Invoice number: Prefix","billy"))})}),(0,r.jsx)("div",{className:"components-notice is-warning",children:(0,r.jsx)("div",{className:"components-notice__content",children:(0,l.sprintf)((0,l.__)("Due to legal requirements in some countries, autogenerated data like %s can't be modified anymore after an invoice has been created in the system!","billy"),(0,l.__)("Invoice number","billy"))})})]})}),(0,r.jsx)(a.Disabled,{children:(0,r.jsx)(i(),{block:"billy-blocks/invoice-number"})})]})},save:()=>null}),(0,t.registerBlockType)("billy-blocks/invoice-paymentinformation",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Invoice","billy"),(0,l.__)("Payment Information","billy")),icon:"info",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,s.useBlockProps)();return(0,r.jsxs)("div",{...e,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Info","billy"),children:(0,r.jsx)("div",{className:"components-notice",children:(0,r.jsx)("div",{className:"components-notice__content",children:(0,l.sprintf)((0,l.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,l.__)("Payment Information","billy"))})})})}),(0,r.jsx)(a.Disabled,{children:(0,r.jsx)(i(),{block:"billy-blocks/invoice-paymentinformation"})})]})},save:()=>null});const d=(e,t=void 0)=>e.toLocaleString(t,{minimumFractionDigits:2,maximumFractionDigits:2}),u=e=>parseFloat(e)/100,b=e=>(e=new Date(e)||new Date,[1,2,3,4][Math.floor(e.getMonth()/3)]),x=[{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountSubtotal:i,amountTotal:c,taxRates:b,taxRatesTotal:x}}=e,p=s.useBlockProps.save({className:"invoicetable-block alignwide"+(t?" "+t:"")});return(0,r.jsx)("div",{...p,children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Amount","billy")}),b&&x>0&&(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Tax","billy")})]})}),(0,r.jsx)("tbody",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[i>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("th",{colSpan:"2",children:c>i?(0,l.__)("Subtotal","billy"):(0,l.__)("Total","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))})]}),b&&x>0&&(0,r.jsxs)("tr",{className:"taxrates",children:[(0,r.jsx)("th",{colSpan:"2",children:(0,l.__)("Tax","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:JSON.parse(b).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),a,d(e.amount,n),"<small>("+e.taxRate+")</small><br>")},t)})})]}),c>i&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("th",{colSpan:"2",children:(0,l.__)("Total","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]})]})]})})}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountSubtotal:i,amountTotal:c,taxRates:b,taxRatesTotal:x}}=e;return(0,r.jsx)("div",{className:"invoicetable-block alignwide"+(t?" "+t:""),children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Amount","billy")}),b&&x>0&&(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Tax","billy")})]})}),(0,r.jsx)("tbody",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[i>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("td",{colSpan:"2",className:"align-right",children:c>i?(0,l.__)("Subtotal","billy"):(0,l.__)("Total","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))})]}),b&&x>0&&(0,r.jsxs)("tr",{className:"taxrates",children:[(0,r.jsx)("td",{colSpan:"2",className:"align-right",children:(0,l.__)("Tax","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:JSON.parse(b).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),a,d(e.amount,n),"<small>("+e.taxRate+")</small><br>")},t)})})]}),c>i&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("td",{colSpan:"2",className:"align-right",children:(0,l.__)("Total","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]})]})]})})}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountSubtotal:i,amountTotal:c,taxRates:b,taxRatesTotal:x}}=e;return(0,r.jsx)("div",{className:"invoicetable-block alignwide"+(t?" "+t:""),children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Amount","billy")}),b&&x>0&&(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Tax","billy")})]})}),(0,r.jsx)("tbody",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[i>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("td",{colSpan:"2",align:"right",children:c>i?(0,l.__)("Subtotal","billy"):(0,l.__)("Total","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))})]}),b&&x>0&&(0,r.jsxs)("tr",{className:"taxrates",children:[(0,r.jsx)("td",{colSpan:"2",align:"right",children:(0,l.__)("Tax","billy")}),(0,r.jsx)("td",{children:JSON.parse(b).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),a,d(e.amount,n),"<small>("+e.taxRate+")</small><br>")},t)})})]}),c>i&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("td",{colSpan:"2",align:"right",children:(0,l.__)("Total","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]})]})]})})}}],p=[{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},description:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},save:e=>{const{className:t,attributes:{index:a,locale:n,taxRate:i,amount:c}}=e;return(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"row",children:a&&a}),(0,r.jsx)("td",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsx)("td",{children:c&&d(c,n)}),i&&u(i)*c>0&&(0,r.jsx)("td",{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),d(u(i)*c,n),"<small>("+i+")</small>")})})]})}},{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},description:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},save:e=>{const{className:t,attributes:{index:s,locale:a,description:n,taxRate:i,amount:c}}=e;return(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"row",children:s&&s}),(0,r.jsx)("td",{children:n&&(0,r.jsx)(o.RawHTML,{children:n})}),(0,r.jsx)("td",{children:c&&d(c,a)}),i&&u(i)*c>0&&(0,r.jsx)("td",{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),d(u(i)*c,a),"<small>("+i+")</small>")})})]})}}];let y;(0,t.registerBlockType)("billy-blocks/invoice-table",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Invoice","billy"),(0,l.__)("Table","billy")),icon:"menu-alt",category:"billy-blocks",attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)((e,{clientId:t})=>{const{getBlocksByClientId:l}=e("core/block-editor");return{childBlocks:l(t)[0].innerBlocks}})(e=>{const{className:t,childBlocks:n,attributes:{currency:i,locale:c,amountSubtotal:b,amountTotal:x,taxRates:p,taxRatesTotal:h},setAttributes:m}=e,_=(0,s.useBlockProps)({className:"invoicetable-block"+(t?" "+t:"")});return y=()=>{let e=0,t=0,l=0,s=[],a=[];m({currency:globalDataBilly.currency,locale:globalDataBilly.locale}),n&&n.length>0&&(n.forEach(l=>{const a=Number(l.attributes.amount),n=u(l.attributes.taxRate);e+=a,t+=a+n*a,s.push({taxRate:l.attributes.taxRate,amount:n*a})}),s.length>0&&(l=s.reduce((e,t)=>e+t.amount,0),l=Number(l.toFixed(2)),s.reduce((e,t)=>(e[t.taxRate]||(e[t.taxRate]={taxRate:t.taxRate,amount:0},a.push(e[t.taxRate])),e[t.taxRate].amount+=t.amount,e),{})),m({taxRatesTotal:l,taxRates:JSON.stringify(a),amountSubtotal:e,amountTotal:t}))},(0,o.useEffect)(()=>{y()},[n]),(0,r.jsxs)("div",{..._,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Actions","billy"),children:(0,r.jsx)("button",{id:"updatetotals",className:"components-button is-secondary is-button",onClick:y,children:(0,l.__)("Update Totals","billy")})})}),(0,r.jsx)(s.InnerBlocks,{templateLock:!1,template:[["billy-blocks/invoice-tablerow"]],allowedBlocks:["billy-blocks/invoice-tablerow"],renderAppender:()=>(0,r.jsx)(s.InnerBlocks.ButtonBlockAppender,{})}),b>0&&(0,r.jsx)("table",{className:"totals",children:(0,r.jsxs)("tbody",{children:[b>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("th",{style:{width:"50%"},children:x>b?(0,l.__)("Subtotal","billy"):(0,l.__)("Total","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(b,c))})]}),p&&h>0&&(0,r.jsxs)("tr",{className:"taxRates",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.__)("Tax","billy")}),(0,r.jsx)("td",{children:JSON.parse(p).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),i,d(e.amount,c),"<small>("+e.taxRate+")</small><br>")},t)})})]}),x>b&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.__)("Total","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(x,c))})]})]})})]})}),save:e=>{const{className:t,attributes:{currency:a,locale:n,amountSubtotal:i,amountTotal:c,taxRates:b,taxRatesTotal:x}}=e,p=s.useBlockProps.save({className:"invoicetable-block alignwide"+(t?" "+t:"")});return(0,r.jsx)("div",{...p,children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col","data-label":"title"}),(0,r.jsx)("th",{scope:"col","data-label":"description"}),(0,r.jsx)("th",{scope:"col","data-label":"amount"}),b&&x>0&&(0,r.jsx)("th",{scope:"col","data-label":"tax"})]})}),(0,r.jsx)("tbody",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[i>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("th",{colSpan:"2","data-label":c>i?"subtotal":"total"}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))})]}),b&&x>0&&(0,r.jsxs)("tr",{className:"taxrates",children:[(0,r.jsx)("th",{colSpan:"2","data-label":"tax"}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:JSON.parse(b).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),a,d(e.amount,n),"<small>("+e.taxRate+")</small><br>")},t)})})]}),c>i&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("th",{colSpan:"2","data-label":"total"}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]})]})]})})},deprecated:x}),(0,t.registerBlockType)("billy-blocks/invoice-tablerow",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Invoice","billy"),(0,l.__)("Table Row","billy")),icon:"menu-alt",category:"billy-blocks",parent:["billy-blocks/invoice-table"],attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)((e,{clientId:t})=>{const{getBlockRootClientId:l,getBlockIndex:s}=e("core/block-editor");return{i:s(t,l(t))+1}})(e=>{const{i:t,attributes:{index:n,currency:i,locale:c,description:d,taxRate:b,amount:x,amountIncl:p,quantity:h,quantityRate:m},setAttributes:_}=e,j=(0,s.useBlockProps)();(0,o.useEffect)(()=>{_({index:t,currency:globalDataBilly.currency,locale:globalDataBilly.locale}),""===b&&_({taxRate:0===globalDataBilly.taxOptions.length?"0%":globalDataBilly.taxOptions[0].value})},[b]);const f=e=>{_({amountIncl:e>0?Number(e):""}),y()},g=e=>{_({amount:e>0?Number(e):""}),f(Number(e)+Number(e)*u(b))};return(0,r.jsxs)("div",{...j,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Quantity/Rate Calculator","billy"),children:[(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.__)("Quantity","billy"),placeholder:(0,l.__)("0","billy"),value:null!=h?h:"",onChange:e=>{_({quantity:e>0?Number(e):""}),g(Number(e)*Number(m))}}),(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Rate","billy"),i),placeholder:(0,l.__)("0","billy"),value:null!=m?m:"",onChange:e=>{_({quantityRate:e>0?Number(e):""}),g(Number(h)*Number(e))}})]})}),(0,r.jsx)("table",{children:(0,r.jsx)("tbody",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"index",children:n&&n}),(0,r.jsx)("td",{style:{width:"30vw",minWidth:"200px"},children:(0,r.jsx)(s.InnerBlocks,{template:[["core/paragraph",{content:d||""}]],allowedBlocks:["core/block","core/heading","core/paragraph","core/list","core/html"]})}),(0,r.jsx)("td",{children:(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Amount","billy"),i),className:"amount",placeholder:(0,l.__)("0","billy"),value:null!=x?x:"",onChange:g})}),(0,r.jsx)("td",{children:(0,r.jsx)(a.SelectControl,{className:"taxrate",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Tax","billy"),"%"),value:null!=b?b:"",options:0!==globalDataBilly.taxOptions.length?globalDataBilly.taxOptions:"0%"!==b&&0===globalDataBilly.taxOptions.length?[{label:b,value:b},{label:"0%",value:"0%"}]:"",onChange:e=>{_({taxRate:e}),f(Number(x)+Number(x)*u(e))}})}),(0,r.jsx)("td",{children:(0,r.jsx)(a.TextControl,{type:"number",disabled:"disabled",label:i,className:"amount-tax",placeholder:(0,l.__)("0","billy"),value:null!=p?p:""})})]})})})]})}),save:e=>{const{attributes:{index:t,locale:a,taxRate:n,amount:i}}=e;return(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"row",children:t&&t}),(0,r.jsx)("td",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsx)("td",{children:i&&d(i,a)}),n&&u(n)*i>0&&(0,r.jsx)("td",{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),d(u(n)*i,a),"<small>("+n+")</small>")})})]})},deprecated:p}),(0,t.registerBlockType)("billy-blocks/quote-actions",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Quote","billy"),(0,l.__)("Actions","billy")),icon:"menu-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)(e=>({postModifiedDate:e("core/editor").getEditedPostAttribute("modified")}))(e=>{const{postModifiedDate:t}=e,a=(0,s.useBlockProps)({className:"components-placeholder",style:{minHeight:"auto"}});return(0,r.jsx)("div",{...a,children:(0,r.jsx)("small",{children:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Last modified","billy"),new Date(t).toLocaleString())})})}),save:()=>null}),(0,t.registerBlockType)("billy-blocks/quote-meta",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Quote","billy"),(0,l.__)("Meta","billy")),icon:"editor-textcolor",category:"billy-blocks",attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},supports:{inserter:!1,reusable:!1,html:!1,className:!0},edit:e=>{const{className:t,attributes:{label:n,text:i},setAttributes:c}=e,d=(0,s.useBlockProps)({className:t?" "+t:""});return(0,r.jsxs)("div",{...d,children:[(0,r.jsxs)(s.InspectorControls,{children:[(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Label","billy"),children:(0,r.jsx)(a.TextControl,{type:"text",className:"label",value:null!=n?n:"",onChange:e=>{c({label:e})}})}),(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Text","billy"),children:(0,r.jsx)(a.TextControl,{type:"text",className:"text",value:null!=i?i:"",onChange:e=>{c({text:e})}})})]}),(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),n||"",i||(0,l.__)("N/A","billy"))})]})},save:e=>{const{className:t,attributes:{label:a,text:n}}=e,i=s.useBlockProps.save({className:t?" "+t:""});return n&&(0,r.jsx)("div",{...i,children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),a||"",n||(0,l.__)("N/A","billy"))})})},deprecated:[{attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},save:e=>{const{attributes:{label:t,text:s}}=e;return s&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)('<div class="label">%1$s</div> <div class="text">%2$s</div>',"billy"),t||"",s||(0,l.__)("N/A","billy"))})})}},{attributes:{label:{type:"string",default:""},text:{type:"string",default:""}},save:e=>{const{attributes:{label:t,text:s}}=e;return s&&(0,r.jsx)("p",{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)("<p>"+(0,l.__)("<strong>%1$s</strong> <span>%2$s</span>","billy")+"</p>",t||"",s||(0,l.__)("N/A","billy"))})})}}]}),(0,t.registerBlockType)("billy-blocks/quote-date",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Quote","billy"),(0,l.__)("Date","billy")),icon:"calendar-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,s.useBlockProps)();return(0,r.jsx)("div",{...e,children:(0,r.jsx)(a.Disabled,{children:(0,r.jsx)(i(),{block:"billy-blocks/quote-date"})})})},save:()=>null}),(0,t.registerBlockType)("billy-blocks/quote-information",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Quote","billy"),(0,l.__)("Information","billy")),icon:"info",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,s.useBlockProps)();return(0,r.jsxs)("div",{...e,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Info","billy"),children:(0,r.jsx)("div",{className:"components-notice",children:(0,r.jsx)("div",{className:"components-notice__content",children:(0,l.sprintf)((0,l.__)("The %s values can be modified in the Theme Customizer.","billy"),(0,l.__)("Quote Information","billy"))})})})}),(0,r.jsx)(i(),{block:"billy-blocks/quote-information"})]})},save:()=>null});const h=[{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountSubtotal:i,amountTotal:c,taxRates:b,taxRatesTotal:x}}=e,p=s.useBlockProps.save({className:"quotetable-block alignwide"+(t?" "+t:"")});return(0,r.jsx)("div",{...p,children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Amount","billy")}),b&&x>0&&(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Tax","billy")})]})}),(0,r.jsx)("tbody",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[i>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("th",{colSpan:"2",children:c>i?(0,l.__)("Subtotal","billy"):(0,l.__)("Total","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))})]}),b&&x>0&&(0,r.jsxs)("tr",{className:"taxrates",children:[(0,r.jsx)("th",{colSpan:"2",children:(0,l.__)("Tax","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:JSON.parse(b).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),a,d(e.amount,n),"<small>("+e.taxRate+")</small><br>")},t)})})]}),c>i&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("th",{colSpan:"2",children:(0,l.__)("Total","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]})]})]})})}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountSubtotal:i,amountTotal:c,taxRates:b,taxRatesTotal:x}}=e;return(0,r.jsx)("div",{className:"quotetable-block alignwide"+(t?" "+t:""),children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Amount","billy")}),b&&x>0&&(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Tax","billy")})]})}),(0,r.jsx)("tbody",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[i>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("td",{colSpan:"2",className:"align-right",children:c>i?(0,l.__)("Subtotal","billy"):(0,l.__)("Total","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))})]}),b&&x>0&&(0,r.jsxs)("tr",{className:"taxrates",children:[(0,r.jsx)("td",{colSpan:"2",className:"align-right",children:(0,l.__)("Tax","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:JSON.parse(b).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),a,d(e.amount,n),"<small>("+e.taxRate+")</small><br>")},t)})})]}),c>i&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("td",{colSpan:"2",className:"align-right",children:(0,l.__)("Total","billy")}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]})]})]})})}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountSubtotal:i,amountTotal:c,taxRates:b,taxRatesTotal:x}}=e;return(0,r.jsx)("div",{className:"quotetable-block alignwide"+(t?" "+t:""),children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Amount","billy")}),b&&x>0&&(0,r.jsx)("th",{scope:"col",children:(0,l.__)("Tax","billy")})]})}),(0,r.jsx)("tbody",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[i>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("td",{colSpan:"2",align:"right",children:c>i?(0,l.__)("Subtotal","billy"):(0,l.__)("Total","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))})]}),b&&x>0&&(0,r.jsxs)("tr",{className:"taxrates",children:[(0,r.jsx)("td",{colSpan:"2",align:"right",children:(0,l.__)("Tax","billy")}),(0,r.jsx)("td",{children:JSON.parse(b).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),a,d(e.amount,n),"<small>("+e.taxRate+")</small><br>")},t)})})]}),c>i&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("td",{colSpan:"2",align:"right",children:(0,l.__)("Total","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]})]})]})})}}],m=[{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},description:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},save:e=>{const{className:t,attributes:{index:a,locale:n,taxRate:i,amount:c}}=e;return(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"row",children:a&&a}),(0,r.jsx)("td",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsx)("td",{children:c&&d(c,n)}),i&&u(i)*c>0&&(0,r.jsx)("td",{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),d(u(i)*c,n),"<small>("+i+")</small>")})})]})}},{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},description:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},save:e=>{const{className:t,attributes:{index:s,locale:a,description:n,taxRate:i,amount:c}}=e;return(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"row",children:s&&s}),(0,r.jsx)("td",{children:n&&(0,r.jsx)(o.RawHTML,{children:n})}),(0,r.jsx)("td",{children:c&&d(c,a)}),i&&u(i)*c>0&&(0,r.jsx)("td",{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),d(u(i)*c,a),"<small>("+i+")</small>")})})]})}}];let _;(0,t.registerBlockType)("billy-blocks/quote-table",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Quote","billy"),(0,l.__)("Table","billy")),icon:"menu-alt",category:"billy-blocks",attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountSubtotal:{type:"number",default:""},amountTotal:{type:"number",default:""},taxRates:{type:"string",default:""},taxRatesTotal:{type:"number",default:""}},supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)((e,{clientId:t})=>{const{getBlocksByClientId:l}=e("core/block-editor");return{childBlocks:l(t)[0].innerBlocks}})(e=>{const{className:t,childBlocks:n,attributes:{currency:i,locale:c,amountSubtotal:b,amountTotal:x,taxRates:p,taxRatesTotal:y},setAttributes:h}=e,m=(0,s.useBlockProps)({className:"quotetable-block"+(t?" "+t:"")});return _=()=>{let e=0,t=0,l=0,s=[],a=[];h({currency:globalDataBilly.currency,locale:globalDataBilly.locale}),n&&n.length>0&&(n.forEach(l=>{const a=Number(l.attributes.amount),n=u(l.attributes.taxRate);e+=a,t+=a+n*a,s.push({taxRate:l.attributes.taxRate,amount:n*a})}),s.length>0&&(l=s.reduce((e,t)=>e+t.amount,0),l=Number(l.toFixed(2)),s.reduce((e,t)=>(e[t.taxRate]||(e[t.taxRate]={taxRate:t.taxRate,amount:0},a.push(e[t.taxRate])),e[t.taxRate].amount+=t.amount,e),{})),h({taxRatesTotal:l,taxRates:JSON.stringify(a),amountSubtotal:e,amountTotal:t}))},(0,o.useEffect)(()=>{_()},[n]),(0,r.jsxs)("div",{...m,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Actions","billy"),children:(0,r.jsx)("button",{id:"updatetotals",className:"components-button is-secondary is-button",onClick:_,children:(0,l.__)("Update Totals","billy")})})}),(0,r.jsx)(s.InnerBlocks,{templateLock:!1,template:[["billy-blocks/quote-tablerow"]],allowedBlocks:["billy-blocks/quote-tablerow"],renderAppender:()=>(0,r.jsx)(s.InnerBlocks.ButtonBlockAppender,{})}),b>0&&(0,r.jsx)("table",{className:"totals",children:(0,r.jsxs)("tbody",{children:[b>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("th",{style:{width:"50%"},children:x>b?(0,l.__)("Subtotal","billy"):(0,l.__)("Total","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(b,c))})]}),p&&y>0&&(0,r.jsxs)("tr",{className:"taxRates",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.__)("Tax","billy")}),(0,r.jsx)("td",{children:JSON.parse(p).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),i,d(e.amount,c),"<small>("+e.taxRate+")</small><br>")},t)})})]}),x>b&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.__)("Total","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(x,c))})]})]})})]})}),save:e=>{const{className:t,attributes:{currency:a,locale:n,amountSubtotal:i,amountTotal:c,taxRates:b,taxRatesTotal:x}}=e,p=s.useBlockProps.save({className:"quotetable-block alignwide"+(t?" "+t:"")});return(0,r.jsx)("div",{...p,children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col","data-label":"title"}),(0,r.jsx)("th",{scope:"col","data-label":"description"}),(0,r.jsx)("th",{scope:"col","data-label":"amount"}),b&&x>0&&(0,r.jsx)("th",{scope:"col","data-label":"tax"})]})}),(0,r.jsx)("tbody",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[i>0&&(0,r.jsxs)("tr",{className:"subtotal",children:[(0,r.jsx)("th",{colSpan:"2","data-label":c>i?"subtotal":"total"}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))})]}),b&&x>0&&(0,r.jsxs)("tr",{className:"taxrates",children:[(0,r.jsx)("th",{colSpan:"2","data-label":"tax"}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:JSON.parse(b).sort((e,t)=>u(e.taxRate)-u(t.taxRate)).map((e,t)=>{if(e.amount>0)return(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s %3$s","billy"),a,d(e.amount,n),"<small>("+e.taxRate+")</small><br>")},t)})})]}),c>i&&(0,r.jsxs)("tr",{className:"total",children:[(0,r.jsx)("th",{colSpan:"2","data-label":"total"}),(0,r.jsx)("td",{colSpan:b&&x>0?"2":null,children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]})]})]})})},deprecated:h}),(0,t.registerBlockType)("billy-blocks/quote-tablerow",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Quote","billy"),(0,l.__)("Table Row","billy")),icon:"menu-alt",category:"billy-blocks",parent:["billy-blocks/quote-table"],attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},taxRate:{type:"string",default:""},amount:{type:"number",default:""},amountIncl:{type:"number",default:""},quantity:{type:"number",default:""},quantityRate:{type:"number",default:""}},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)((e,{clientId:t})=>{const{getBlockRootClientId:l,getBlockIndex:s}=e("core/block-editor");return{i:s(t,l(t))+1}})(e=>{const{i:t,attributes:{index:n,currency:i,locale:c,description:d,taxRate:b,amount:x,amountIncl:p,quantity:y,quantityRate:h},setAttributes:m}=e,j=(0,s.useBlockProps)();(0,o.useEffect)(()=>{m({index:t,currency:globalDataBilly.currency,locale:globalDataBilly.locale}),""===b&&m({taxRate:0===globalDataBilly.taxOptions.length?"0%":globalDataBilly.taxOptions[0].value})},[b]);const f=e=>{m({amountIncl:e>0?Number(e):""}),_()},g=e=>{m({amount:e>0?Number(e):""}),f(Number(e)+Number(e)*u(b))};return(0,r.jsxs)("div",{...j,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsxs)(a.PanelBody,{title:(0,l.__)("Quantity/Rate Calculator","billy"),children:[(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.__)("Quantity","billy"),placeholder:(0,l.__)("0","billy"),value:null!=y?y:"",onChange:e=>{m({quantity:e>0?Number(e):""}),g(Number(e)*Number(h))}}),(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Rate","billy"),i),placeholder:(0,l.__)("0","billy"),value:null!=h?h:"",onChange:e=>{m({quantityRate:e>0?Number(e):""}),g(Number(y)*Number(e))}})]})}),(0,r.jsx)("table",{children:(0,r.jsx)("tbody",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"index",children:n&&n}),(0,r.jsx)("td",{style:{width:"30vw",minWidth:"200px"},children:(0,r.jsx)(s.InnerBlocks,{template:[["core/paragraph",{content:d||""}]],allowedBlocks:["core/block","core/heading","core/paragraph","core/list","core/html"]})}),(0,r.jsx)("td",{children:(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Amount","billy"),i),className:"amount",placeholder:(0,l.__)("0","billy"),value:null!=x?x:"",onChange:g})}),(0,r.jsx)("td",{children:(0,r.jsx)(a.SelectControl,{className:"taxrate",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Tax","billy"),"%"),value:null!=b?b:"",options:0!==globalDataBilly.taxOptions.length?globalDataBilly.taxOptions:"0%"!==b&&0===globalDataBilly.taxOptions.length?[{label:b,value:b},{label:"0%",value:"0%"}]:"",onChange:e=>{m({taxRate:e}),f(Number(x)+Number(x)*u(e))}})}),(0,r.jsx)("td",{children:(0,r.jsx)(a.TextControl,{type:"number",disabled:"disabled",label:i,className:"amount-tax",placeholder:(0,l.__)("0","billy"),value:null!=p?p:""})})]})})})]})}),save:e=>{const{attributes:{index:t,locale:a,taxRate:n,amount:i}}=e;return(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"row",children:t&&t}),(0,r.jsx)("td",{children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsx)("td",{children:i&&d(i,a)}),n&&u(n)*i>0&&(0,r.jsx)("td",{children:(0,r.jsx)(o.RawHTML,{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),d(u(n)*i,a),"<small>("+n+")</small>")})})]})},deprecated:m}),(0,t.registerBlockType)("billy-blocks/quote-validuntildate",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Quote","billy"),(0,l.__)("Valid Until","billy")),icon:"calendar-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},edit:()=>{const e=(0,s.useBlockProps)();return(0,r.jsx)("div",{...e,children:(0,r.jsx)(a.Disabled,{children:(0,r.jsx)(i(),{block:"billy-blocks/quote-validuntildate"})})})},save:()=>null});const j=[{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountTotalEarnings:i,amountTotalExpenses:c,amountTaxEarnings:o,amountTaxExpenses:u}}=e;return(0,r.jsx)("div",{className:"alignwide"+(t?" "+t:""),children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"index",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"date",children:(0,l.__)("Date","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"description",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"reference",children:(0,l.__)("Reference","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort earnings","data-sort":"earning",children:(0,l.__)("Earnings","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort expenses","data-sort":"expense",children:(0,l.__)("Expenses","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"tax",children:(0,l.__)("Taxes","billy")})]})}),(0,r.jsx)("tbody",{className:"list",children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{colSpan:"5",children:(0,l.sprintf)((0,l.__)("%1$s / %2$s","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))}),(0,r.jsx)("td",{className:"sum expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]}),(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{colSpan:"5",children:(0,l.__)("Profit","billy")}),(0,r.jsx)("td",{colSpan:"2",className:"profit",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i-c,n))})]}),(o>0||u>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{colSpan:"5",children:(0,l.sprintf)((0,l.__)("%1$s (%2$s / %3$s)","billy"),(0,l.__)("Taxes","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum tax-earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(o,n))}),(0,r.jsx)("td",{className:"sum tax-expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(u,n))})]})]})]})})}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountTotalEarnings:i,amountTotalExpenses:c,amountTaxEarnings:o,amountTaxExpenses:u}}=e;return(0,r.jsx)("div",{className:"alignwide"+(t?" "+t:""),children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"index",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"date",children:(0,l.__)("Date","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"description",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"reference",children:(0,l.__)("Reference","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort earnings","data-sort":"earning",children:(0,l.__)("Earnings","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort expenses","data-sort":"expense",children:(0,l.__)("Expenses","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"tax",children:(0,l.__)("Taxes","billy")})]})}),(0,r.jsx)("tbody",{className:"list",children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"5",className:"alignright",children:(0,l.sprintf)((0,l.__)("%1$s / %2$s","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))}),(0,r.jsx)("td",{className:"sum expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]}),(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"5",className:"alignright",children:(0,l.__)("Profit","billy")}),(0,r.jsx)("td",{colSpan:"2",className:"profit",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i-c,n))})]}),(o>0||u>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"5",className:"alignright",children:(0,l.sprintf)((0,l.__)("%1$s (%2$s / %3$s)","billy"),(0,l.__)("Taxes","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum tax-earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(o,n))}),(0,r.jsx)("td",{className:"sum tax-expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(u,n))})]})]})]})})}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountTotalEarnings:i,amountTotalExpenses:c,amountTaxEarnings:o,amountTaxExpenses:u}}=e;return(0,r.jsx)("div",{className:"alignwide"+(t?" "+t:""),children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"index",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"date",children:(0,l.__)("Date","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"description",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"reference",children:(0,l.__)("Reference","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort earnings","data-sort":"earning",children:(0,l.__)("Earnings","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort expenses","data-sort":"expense",children:(0,l.__)("Expenses","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"tax",children:(0,l.__)("Tax","billy")})]})}),(0,r.jsx)("tbody",{className:"list",children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"4",align:"right",children:(0,l.sprintf)((0,l.__)("%1$s / %2$s","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))}),(0,r.jsx)("td",{className:"sum expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]}),(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"4",align:"right",children:(0,l.__)("Profit","billy")}),(0,r.jsx)("td",{colSpan:"2",className:"profit",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i-c,n))})]}),(o>0||u>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"4",align:"right",children:(0,l.sprintf)((0,l.__)("%1$s (%2$s / %3$s)","billy"),(0,l.__)("Taxes","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum tax-earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(o,n))}),(0,r.jsx)("td",{className:"sum tax-expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(u,n))})]})]})]})})}},{attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},save:e=>{const{className:t,attributes:{currency:a,locale:n,amountTotalEarnings:i,amountTotalExpenses:c,amountTaxEarnings:o,amountTaxExpenses:u}}=e;return(0,r.jsx)("div",{className:"alignwide"+(t?" "+t:""),children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"index",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"date",children:(0,l.__)("Date","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"description",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"reference",children:(0,l.__)("Reference","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort earnings","data-sort":"earning",children:(0,l.__)("Earning","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort expenses","data-sort":"expense",children:(0,l.__)("Expense","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"tax",children:(0,l.__)("Tax","billy")})]})}),(0,r.jsx)("tbody",{className:"list",children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"4",align:"right",children:(0,l.sprintf)((0,l.__)("%1$s / %2$s","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))}),(0,r.jsx)("td",{className:"sum expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]}),(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"4",align:"right",children:(0,l.__)("Profit","billy")}),(0,r.jsx)("td",{colSpan:"2",className:"profit",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i-c,n))})]}),(o>0||u>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{colSpan:"4",align:"right",children:(0,l.sprintf)((0,l.__)("%1$s (%2$s / %3$s)","billy"),(0,l.__)("Taxes","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum tax-earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(o,n))}),(0,r.jsx)("td",{className:"sum tax-expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(u,n))})]})]})]})})}}],f=[{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},date:{type:"string",default:""},quarter:{type:"number",default:""},reference:{type:"string",default:""},earning:{type:"number",default:""},expense:{type:"number",default:""},tax:{type:"number",default:""},postUUID:{type:"string",default:""},postTitle:{type:"string",default:""},postLink:{type:"string",default:""},postType:{type:"string",default:""}},save:e=>{const{className:t,attributes:{index:a,locale:n,date:i,quarter:c,earning:o,expense:u,tax:b,reference:x,postLink:p}}=e;return(0,r.jsxs)("tr",{"data-date":i&&new Date(i).toISOString().substring(0,10),"data-quarter":c&&(0,l.sprintf)((0,l.__)("Q%s","billy"),c),"data-reference":x&&x,"data-earning":o>0?o:null,"data-expense":u>0?u:null,"data-tax":b>0?b:null,children:[(0,r.jsx)("th",{className:"index",scope:"row",children:a&&a}),(0,r.jsxs)("td",{className:"date","data-value":i&&new Date(i).toISOString().substring(0,10),children:[i&&new Date(i).toISOString().substring(0,10),(0,r.jsx)("sub",{children:c&&(0,l.sprintf)((0,l.__)("Q%s","billy"),c)})]}),(0,r.jsx)("td",{className:"description",children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("td",{className:"reference",children:[x&&!p&&x,x&&p&&(0,r.jsx)("a",{href:p,children:x})]}),(0,r.jsx)("td",{className:"amount earning","data-value":o>0?o:null,children:o&&o>0&&d(o,n)}),(0,r.jsx)("td",{className:"amount expense","data-value":u>0?u:null,children:u&&u>0&&d(u,n)}),b&&b>0&&(0,r.jsx)("td",{className:"amount tax","data-value":b,children:d(b,n)})]})}},{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},date:{type:"string",default:""},quarter:{type:"number",default:""},reference:{type:"string",default:""},earning:{type:"number",default:""},expense:{type:"number",default:""},tax:{type:"number",default:""},postUUID:{type:"string",default:""},postTitle:{type:"string",default:""},postLink:{type:"string",default:""},postType:{type:"string",default:""}},save:e=>{const{className:t,attributes:{index:a,locale:n,date:i,quarter:c,earning:o,expense:u,tax:b,reference:x,postLink:p}}=e;return(0,r.jsxs)("tr",{"data-date":i&&new Date(i).toISOString().substring(0,10),"data-quarter":c&&(0,l.sprintf)((0,l.__)("Q%s","billy"),c),"data-reference":x&&x,"data-earning":o>0?o:null,"data-expense":u>0?u:null,"data-tax":b>0?b:null,children:[(0,r.jsx)("th",{className:"index",scope:"row",children:a&&a}),(0,r.jsxs)("td",{className:"date","data-value":i&&new Date(i).toISOString().substring(0,10),children:[i&&new Date(i).toISOString().substring(0,10),(0,r.jsx)("sub",{children:c&&(0,l.sprintf)((0,l.__)("Q%s","billy"),c)})]}),(0,r.jsx)("td",{className:"description",children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("td",{className:"reference",children:[x&&!p&&x,x&&p&&(0,r.jsx)("a",{href:p,children:x})]}),(0,r.jsx)("td",{className:"amount earning","data-value":o>0?o:null,children:o&&o>0&&d(o,n)}),(0,r.jsx)("td",{className:"amount expense","data-value":u>0?u:null,children:u&&u>0&&d(u,n)}),(0,r.jsx)("td",{className:"amount tax","data-value":b>0?b:null,children:b&&b>0&&d(b,n)})]})}},{attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},date:{type:"string",default:""},quarter:{type:"number",default:""},reference:{type:"string",default:""},description:{type:"string",default:""},earning:{type:"number",default:""},expense:{type:"number",default:""},tax:{type:"number",default:""},postUUID:{type:"string",default:""},postTitle:{type:"string",default:""},postLink:{type:"string",default:""},postType:{type:"string",default:""}},save:e=>{const{className:t,attributes:{index:s,locale:a,date:n,quarter:i,description:c,earning:o,expense:u,tax:b,reference:x,postLink:p}}=e;return(0,r.jsxs)("tr",{"data-date":n&&new Date(n).toISOString().substring(0,10),"data-quarter":i&&(0,l.sprintf)((0,l.__)("Q%s","billy"),i),"data-reference":x&&x,"data-earning":o>0?o:null,"data-expense":u>0?u:null,"data-tax":b>0?b:null,children:[(0,r.jsx)("th",{className:"index",scope:"row",children:s&&s}),(0,r.jsxs)("td",{className:"date","data-value":n&&new Date(n).toISOString().substring(0,10),children:[n&&new Date(n).toISOString().substring(0,10),(0,r.jsx)("sub",{children:i&&(0,l.sprintf)((0,l.__)("Q%s","billy"),i)})]}),(0,r.jsx)("td",{className:"description",children:c&&c}),(0,r.jsxs)("td",{className:"reference",children:[x&&!p&&x,x&&p&&(0,r.jsx)("a",{href:p,children:x})]}),(0,r.jsx)("td",{className:"amount earning","data-value":o>0?o:null,children:o&&o>0&&d(o,a)}),(0,r.jsx)("td",{className:"amount expense","data-value":u>0?u:null,children:u&&u>0&&d(u,a)}),(0,r.jsx)("td",{className:"amount tax","data-value":b>0?b:null,children:b&&b>0&&d(b,a)})]})}}];let g;(0,t.registerBlockType)("billy-blocks/accounting-table",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Accounting","billy"),(0,l.__)("Table","billy")),icon:"menu-alt",category:"billy-blocks",attributes:{currency:{type:"string",default:""},locale:{type:"string",default:""},amountTotalEarnings:{type:"number",default:""},amountTotalExpenses:{type:"number",default:""},amountTaxEarnings:{type:"number",default:""},amountTaxExpenses:{type:"number",default:""}},supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)((e,{clientId:t})=>{const{getBlocksByClientId:l}=e("core/block-editor"),s=l(t)[0].innerBlocks;return s.sort((e,t)=>new Date(e.attributes.date)-new Date(t.attributes.date)),{childBlocks:s}})(e=>{const{className:t,childBlocks:n,attributes:{currency:i,locale:c,amountTotalEarnings:u,amountTotalExpenses:b,amountTaxEarnings:x,amountTaxExpenses:p},setAttributes:y}=e,h=(0,s.useBlockProps)({className:"accountingtable-block"+(t?" "+t:"")});return g=()=>{let e=0,t=0,l=0,s=0;y({currency:globalDataBilly.currency,locale:globalDataBilly.locale}),n&&n.length>0&&n.forEach(a=>{const n=Number(a.attributes.tax);e+=Number(a.attributes.earning),t+=Number(a.attributes.expense),a.attributes.earning&&(l+=n),a.attributes.expense&&(s+=n)}),y({amountTotalEarnings:e,amountTotalExpenses:t,amountTaxEarnings:l,amountTaxExpenses:s})},(0,o.useEffect)(()=>{g()},[n]),(0,r.jsxs)("div",{...h,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Actions","billy"),children:(0,r.jsx)("button",{id:"updatetotals",className:"components-button is-secondary is-button",onClick:g,children:(0,l.__)("Update Totals","billy")})})}),(0,r.jsx)(s.InnerBlocks,{templateLock:!1,template:[["billy-blocks/accounting-tablerow"]],allowedBlocks:["billy-blocks/accounting-tablerow"],renderAppender:()=>(0,r.jsx)(s.InnerBlocks.ButtonBlockAppender,{})}),(0,r.jsx)("table",{className:"totals",children:(0,r.jsxs)("tbody",{children:[u>0&&(0,r.jsxs)("tr",{className:"earnings",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.__)("Earnings","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(u,c))})]}),b>0&&(0,r.jsxs)("tr",{className:"expenses",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.__)("Expenses","billy")}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(b,c))})]}),(u>0||b>0)&&(0,r.jsxs)("tr",{className:"profit",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.__)("Profit","billy")}),(0,r.jsx)("td",{style:{borderTop:"2px solid"},children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(u-b,c))})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("tr",{className:"taxes-earnings",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.sprintf)((0,l.__)("Taxes (%s)","billy"),(0,l.__)("Earnings","billy"))}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(x,c))})]}),(0,r.jsxs)("tr",{className:"taxes-expenses",children:[(0,r.jsx)("th",{style:{width:"50%"},children:(0,l.sprintf)((0,l.__)("Taxes (%s)","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),i,d(p,c))})]})]})]})})]})}),save:e=>{const{className:t,attributes:{currency:a,locale:n,amountTotalEarnings:i,amountTotalExpenses:c,amountTaxEarnings:o,amountTaxExpenses:u}}=e,b=s.useBlockProps.save({className:"alignwide"+(t?" "+t:"")});return(0,r.jsx)("div",{...b,children:(0,r.jsxs)("table",{className:"table wp-block-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"index",children:(0,l.__)("#","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"date",children:(0,l.__)("Date","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"description",children:(0,l.__)("Description","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"reference",children:(0,l.__)("Reference","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort earnings","data-sort":"earning",children:(0,l.__)("Earnings","billy")}),(0,r.jsx)("th",{scope:"col",className:"sort expenses","data-sort":"expense",children:(0,l.__)("Expenses","billy")}),(o>0||u>0)&&(0,r.jsx)("th",{scope:"col",className:"sort","data-sort":"tax",children:(0,l.__)("Taxes","billy")})]})}),(0,r.jsx)("tbody",{className:"list",children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("tfoot",{children:[(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{colSpan:"4",children:(0,l.sprintf)((0,l.__)("%1$s / %2$s","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i,n))}),(0,r.jsx)("td",{className:"sum expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(c,n))})]}),(i>0||c>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{colSpan:"4",children:(0,l.__)("Profit","billy")}),(0,r.jsx)("td",{colSpan:"2",className:"profit",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(i-c,n))})]}),(o>0||u>0)&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{colSpan:"4",children:(0,l.sprintf)((0,l.__)("%1$s (%2$s / %3$s)","billy"),(0,l.__)("Taxes","billy"),(0,l.__)("Earnings","billy"),(0,l.__)("Expenses","billy"))}),(0,r.jsx)("td",{className:"sum tax-earnings",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(o,n))}),(0,r.jsx)("td",{className:"sum tax-expenses",children:(0,l.sprintf)((0,l.__)("%1$s %2$s","billy"),a,d(u,n))})]})]})]})})},deprecated:j}),(0,t.registerBlockType)("billy-blocks/accounting-tablerow",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Accounting","billy"),(0,l.__)("Table Row","billy")),icon:"menu-alt",category:"billy-blocks",parent:["billy-blocks/accounting-table"],attributes:{index:{type:"number",default:"0"},currency:{type:"string",default:""},locale:{type:"string",default:""},date:{type:"string",default:""},quarter:{type:"number",default:""},reference:{type:"string",default:""},earning:{type:"number",default:""},expense:{type:"number",default:""},tax:{type:"number",default:""},postUUID:{type:"string",default:""},postTitle:{type:"string",default:""},postLink:{type:"string",default:""},postType:{type:"string",default:""}},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)((e,{clientId:t})=>{const{getBlockRootClientId:l,getBlockIndex:s}=e("core/block-editor");return{clientId:t,rootClientId:l(t),i:s(t,l(t))+1}})(e=>{const{clientId:t,rootClientId:n,i,attributes:{index:d,currency:u,locale:x,description:p,date:y,quarter:h,earning:m,expense:_,tax:j,reference:f,postUUID:N,postTitle:$,postLink:k,postType:T},setAttributes:v}=e,w=(0,s.useBlockProps)();return(0,o.useEffect)(()=>{v({index:i,currency:globalDataBilly.currency,locale:globalDataBilly.locale}),""===y&&v({date:(new Date).toISOString().substring(0,10),quarter:b((new Date).toISOString().substring(0,10))})},[]),(0,r.jsxs)("div",{...w,children:[(0,r.jsxs)(s.InspectorControls,{children:[!N&&(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Date","billy"),children:(0,r.jsx)(a.DatePicker,{currentDate:y,onChange:e=>{v({date:e}),(e=>{v({quarter:Number(b(e))})})(e),(0,c.dispatch)("core/block-editor").moveBlockToPosition(t,n,n,i)}})}),N&&k&&(0,r.jsx)(a.PanelBody,{title:(0,l.sprintf)((0,l.__)("Reference: %s","billy"),T?T.charAt(0).toUpperCase()+T.substring(1):(0,l.__)("Post","billy")),children:(0,r.jsx)("p",{children:(0,r.jsx)("a",{href:k,children:$||k})})})]}),(0,r.jsx)("table",{children:(0,r.jsx)("tbody",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"index",children:d&&d}),(0,r.jsxs)("td",{className:"date",children:[y&&new Date(y).toISOString().substring(0,10),(0,r.jsx)("sub",{children:h&&(0,l.sprintf)((0,l.__)("Q%s","billy"),h)})]}),(0,r.jsx)("td",{className:"description",style:{minWidth:"200px"},children:(0,r.jsx)(s.InnerBlocks,{template:[["core/paragraph",{content:p||""}]],allowedBlocks:["core/block","core/heading","core/paragraph","core/list","core/html"]})}),(0,r.jsx)("td",{className:"reference",children:(0,r.jsx)(a.TextControl,{type:"text",label:(0,l.__)("Reference","billy"),placeholder:"",value:null!=f?f:"",onChange:e=>{v({reference:e})}})}),(0,r.jsx)("td",{className:"amount earning",children:(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Earning","billy"),u),placeholder:(0,l.__)("0","billy"),value:null!=m?m:"",onChange:e=>{v({expense:"",earning:e>0?Number(e):""}),g()}})}),(0,r.jsx)("td",{className:"amount expense",children:(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Expense","billy"),u),placeholder:(0,l.__)("0","billy"),value:null!=_?_:"",onChange:e=>{v({earning:"",expense:e>0?Number(e):""}),g()}})}),(0,r.jsx)("td",{className:"amount tax",children:(0,r.jsx)(a.TextControl,{type:"number",label:(0,l.sprintf)((0,l.__)("%1$s in %2$s","billy"),(0,l.__)("Tax","billy"),u),placeholder:(0,l.__)("0","billy"),value:null!=j?j:"",onChange:e=>{v({tax:e>0?Number(e):""}),g()}})})]})})})]})}),save:e=>{const{attributes:{index:t,locale:a,date:n,quarter:i,earning:c,expense:o,tax:u,reference:b,postLink:x}}=e;return(0,r.jsxs)("tr",{"data-date":n&&new Date(n).toISOString().substring(0,10),"data-quarter":i&&(0,l.sprintf)((0,l.__)("Q%s","billy"),i),"data-reference":b&&b,"data-earning":c>0?c:null,"data-expense":o>0?o:null,"data-tax":u>0?u:null,children:[(0,r.jsx)("th",{className:"index",scope:"row",children:t&&t}),(0,r.jsxs)("td",{className:"date","data-value":n&&new Date(n).toISOString().substring(0,10),children:[n&&new Date(n).toISOString().substring(0,10),(0,r.jsx)("sub",{children:i&&(0,l.sprintf)((0,l.__)("Q%s","billy"),i)})]}),(0,r.jsx)("td",{className:"description",children:(0,r.jsx)(s.InnerBlocks.Content,{})}),(0,r.jsxs)("td",{className:"reference",children:[b&&!x&&b,b&&x&&(0,r.jsx)("a",{href:x,children:b})]}),(0,r.jsx)("td",{className:"amount earning","data-value":c>0?c:null,children:c&&c>0&&d(c,a)}),(0,r.jsx)("td",{className:"amount expense","data-value":o>0?o:null,children:o&&o>0&&d(o,a)}),u&&u>0&&(0,r.jsx)("td",{className:"amount tax","data-value":u,children:d(u,a)})]})},deprecated:f}),(0,t.registerBlockType)("billy-blocks/accounting-actions",{apiVersion:2,title:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Accounting","billy"),(0,l.__)("Actions","billy")),icon:"menu-alt",category:"billy-blocks",supports:{inserter:!1,reusable:!1,html:!1},getEditWrapperProps:()=>({"data-align":"wide"}),edit:(0,c.withSelect)(e=>({postModifiedDate:e("core/editor").getEditedPostAttribute("modified")}))(e=>{const{postModifiedDate:t}=e,a=(0,s.useBlockProps)({className:"components-placeholder",style:{minHeight:"auto"}});return(0,r.jsx)("div",{...a,children:(0,r.jsx)("small",{children:(0,l.sprintf)((0,l.__)("%1$s: %2$s","billy"),(0,l.__)("Last modified","billy"),new Date(t).toLocaleString())})})}),save:()=>null});const N=window.wp.plugins,$=window.wp.editor;(0,N.registerPlugin)("billy-setup",{render:()=>(0,r.jsxs)($.PluginDocumentSettingPanel,{name:"billy-setup",title:(0,l.__)("Billy Setup","billy"),className:"my-document-setting-plugin",children:[(0,r.jsx)("p",{children:(0,r.jsx)("a",{href:globalDataBilly.wpAdmin+"customize.php?autofocus[panel]=billy_setup_panel",children:(0,l.__)("Settings (Theme Customizer)","billy")})}),(0,r.jsxs)("ul",{className:"ul code",children:[(0,r.jsx)("li",{title:(0,l.__)("Invoice number","billy"),children:(0,r.jsx)(i(),{block:"billy-blocks/invoice-number"})}),(0,r.jsx)("li",{title:(0,l.__)("Quote number","billy"),children:(0,r.jsx)(i(),{block:"billy-blocks/quote-number"})}),(0,r.jsx)("li",{title:(0,l.__)("Name","billy"),children:(0,r.jsx)(i(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"name"}})}),(0,r.jsx)("li",{title:(0,l.__)("Address","billy"),children:(0,r.jsx)(i(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"address"}})}),(0,r.jsx)("li",{title:(0,l.__)("VAT","billy"),children:(0,r.jsx)(i(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"vat"}})}),(0,r.jsx)("li",{title:(0,l.__)("Currency","billy"),children:(0,r.jsx)(i(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"currency"}})}),(0,r.jsx)("li",{title:(0,l.__)("Taxes","billy"),children:(0,r.jsx)(i(),{block:"billy-blocks/theme-mod",attributes:{themeMod:"taxrates"}})})]})]})}),(0,t.registerBlockType)("billy-blocks/theme-mod",{apiVersion:2,title:(0,l.__)("Theme Mod","billy"),icon:"admin-generic",category:"billy-blocks",attributes:{themeMod:{type:"string",default:""}},supports:{inserter:!1,reusable:!1,html:!1},edit:e=>{const{attributes:{themeMod:t},setAttributes:n}=e,c=(0,s.useBlockProps)();return(0,r.jsxs)("div",{...c,children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(a.PanelBody,{title:(0,l.__)("Theme Mod","billy"),children:(0,r.jsx)(a.SelectControl,{label:(0,l.__)("Setting","billy"),help:(0,l.__)("Modify the value in the Theme Customizer.","billy"),options:globalDataBilly.themeModOptions,value:null!=t?t:"",onChange:e=>{n({themeMod:e})}})})}),(0,r.jsx)(a.Disabled,{children:(0,r.jsx)(i(),{block:"billy-blocks/theme-mod",attributes:e.attributes})})]})},save:()=>null})})();
  • billy/trunk/inc/class-billy.php

    r3266011 r3355121  
    409409        $post_type = get_post_type();
    410410
    411         if ( is_singular() && in_array( get_post_type(), array( 'billy-invoice', 'billy-quote', 'billy-accounting' ), true ) ) {
    412             // [WORKAROUND] Replace translation labels in table output with gettext strings. [TODO] Refactor table block.
    413             $translation_placeholders       = array(
    414                 'data-label="title"></th>',
    415                 'data-label="description"></th>',
    416                 'data-label="amount"></th>',
    417                 'data-label="subtotal"></th>',
    418                 'data-label="total"></th>',
    419                 'data-label="tax"></th>',
    420             );
    421             $translation_placeholder_values = array(
    422                 '>' . __( '#', 'billy' ) . '</th>',
    423                 '>' . __( 'Description', 'billy' ) . '</th>',
    424                 '>' . __( 'Amount', 'billy' ) . '</th>',
    425                 '>' . __( 'Subtotal', 'billy' ) . '</th>',
    426                 '>' . __( 'Total', 'billy' ) . '</th>',
    427                 '>' . __( 'Tax', 'billy' ) . '</th>',
    428             );
    429             $content                        = str_replace( $translation_placeholders, $translation_placeholder_values, $content );
    430 
    431             if ( 'billy-accounting' === $post_type && ! defined( 'TABLE_EXPORT' ) ) {
    432                 define( 'TABLE_EXPORT', true ); // Include button in preheader to export table data as tab separated txt file.
    433             }
    434 
    435             return '<div id="' . esc_attr( $post_type ) . '" class="' . esc_attr( $post_type ) . '-wrapper' . ( ! in_array( $post_type, array( 'billy-contact' ), true ) ? ' alignwide' : '' ) . '">' . $this->preheader_render_callback() . $content . '</div>';
    436         }
    437 
    438         return $content;
     411        if ( ! str_starts_with( $post_type, 'billy-' ) ) {
     412            return $content;
     413        }
     414
     415        // [WORKAROUND] Replace translation labels in table output with gettext strings. [TODO] Refactor table block.
     416        $translation_placeholders       = array(
     417            'data-label="title"></th>',
     418            'data-label="description"></th>',
     419            'data-label="amount"></th>',
     420            'data-label="subtotal"></th>',
     421            'data-label="total"></th>',
     422            'data-label="tax"></th>',
     423        );
     424        $translation_placeholder_values = array(
     425            '>' . __( '#', 'billy' ) . '</th>',
     426            '>' . __( 'Description', 'billy' ) . '</th>',
     427            '>' . __( 'Amount', 'billy' ) . '</th>',
     428            '>' . __( 'Subtotal', 'billy' ) . '</th>',
     429            '>' . __( 'Total', 'billy' ) . '</th>',
     430            '>' . __( 'Tax', 'billy' ) . '</th>',
     431        );
     432        $content                        = str_replace( $translation_placeholders, $translation_placeholder_values, $content );
     433
     434        if ( 'billy-accounting' === $post_type && ! defined( 'TABLE_EXPORT' ) ) {
     435            define( 'TABLE_EXPORT', true ); // Include button in preheader to export table data as tab separated txt file.
     436        }
     437
     438        return '<div id="' . esc_attr( $post_type ) . '" class="' . esc_attr( $post_type ) . '-wrapper' . ( ! in_array( $post_type, array( 'billy-contact' ), true ) ? ' alignwide' : '' ) . '">' . $this->preheader_render_callback() . $content . '</div>';
    439439    }
    440440
     
    446446     */
    447447    public function cpt_block_template_content( $content, $post ) {
    448         if ( str_starts_with( $post->post_type, 'billy-' ) ) {
    449             $template = get_theme_file_path( 'templates/' . esc_attr( $post->post_type ) . '.html' );
    450 
    451             if ( is_readable( $template ) ) {
    452                 $template_content = file_get_contents( $template );
    453 
    454                 if ( 0 === strlen( $template_content ) ) {
    455                     return $content;
    456                 }
    457 
    458                 switch ( $post->post_type ) {
    459                     case 'billy-invoice':
    460                         return ( str_contains( $template_content, '<!-- wp:billy-blocks/invoice-actions /-->' ) ? '' : '<!-- wp:billy-blocks/invoice-actions /-->' ) . $template_content;
    461                     case 'billy-quote':
    462                         return ( str_contains( $template_content, '<!-- wp:billy-blocks/quote-actions /-->' ) ? '' : '<!-- wp:billy-blocks/quote-actions /-->' ) . $template_content;
    463                     case 'billy-accounting':
    464                         return ( str_contains( $template_content, '<!-- wp:billy-blocks/accounting-actions /-->' ) ? '' : '<!-- wp:billy-blocks/accounting-actions /-->' ) . $template_content;
    465                     default:
    466                         break;
    467                 }
     448        if ( ! str_starts_with( $post->post_type, 'billy-' ) ) {
     449            return $content;
     450        }
     451
     452        $template = get_theme_file_path( 'templates/' . esc_attr( $post->post_type ) . '.html' );
     453
     454        if ( is_readable( $template ) ) {
     455            $template_content = file_get_contents( $template );
     456
     457            if ( 0 === strlen( $template_content ) ) {
     458                return $content;
     459            }
     460
     461            switch ( $post->post_type ) {
     462                case 'billy-invoice':
     463                    return ( str_contains( $template_content, '<!-- wp:billy-blocks/invoice-actions /-->' ) ? '' : '<!-- wp:billy-blocks/invoice-actions /-->' ) . $template_content;
     464                case 'billy-quote':
     465                    return ( str_contains( $template_content, '<!-- wp:billy-blocks/quote-actions /-->' ) ? '' : '<!-- wp:billy-blocks/quote-actions /-->' ) . $template_content;
     466                case 'billy-accounting':
     467                    return ( str_contains( $template_content, '<!-- wp:billy-blocks/accounting-actions /-->' ) ? '' : '<!-- wp:billy-blocks/accounting-actions /-->' ) . $template_content;
     468                default:
     469                    break;
    468470            }
    469471        }
  • billy/trunk/inc/class-pdfexport.php

    r3266011 r3355121  
    189189        foreach ( $blocks as $block ) {
    190190            // Exclude reusable Footer blocks.
    191             if ( 'core/block' !== $block['blockName'] || ( 'core/block' === $block['blockName'] && ! in_array( $block['attrs']['ref'], $footer_ids, true ) ) ) {
     191            if ( 'core/block' !== $block['blockName'] || ! in_array( $block['attrs']['ref'], $footer_ids, true ) ) {
    192192                $content .= render_block( $block );
    193193            }
    194194        }
     195
     196        // --> Start Workaround: Add spacing in tbody content to each <p>/<ul>/<ol>.
     197        $spacer      = '<hr style="margin: 1.5pt 0; color: #FFF;">';
     198        $search_tags = array(
     199            '<p>',
     200            '</p>',
     201            '<ul>',
     202            '</ul>',
     203            '<ol>',
     204            '</ol>',
     205        );
     206
     207        $replace_tags = array(
     208            $spacer . '<p>',
     209            '</p>' . $spacer,
     210            $spacer . '<ul>',
     211            '</ul>' . $spacer,
     212            $spacer . '<ol>',
     213            '</ol>' . $spacer,
     214        );
     215
     216        // Modify <tbody> content.
     217        preg_match( '/<tbody>(.*?)<\/tbody>/s', $content, $match );
     218
     219        if ( $match && $match[0] ) {
     220            $tbody_content = str_replace( $search_tags, $replace_tags, $match[0] );
     221
     222            // Replace <tbody> with modified content.
     223            $content = preg_replace( '/<tbody>(.*?)<\/tbody>/s', $tbody_content, $content );
     224        }
     225        // <-- End Workaround.
    195226
    196227        // Remove line breaks from content.
  • billy/trunk/languages/billy.pot

    r3266011 r3355121  
    11# Copyright (C) 2025 them.es
    22# This file is distributed under the GPL-2.0+.
    3 #, fuzzy
    43msgid ""
    54msgstr ""
    6 "Project-Id-Version: Billy 1.10.5\n"
     5"Project-Id-Version: Billy 1.11.0\n"
    76"Report-Msgid-Bugs-To: https://github.com/them-es/billy/issues\n"
    87"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1110"Content-Type: text/plain; charset=UTF-8\n"
    1211"Content-Transfer-Encoding: 8bit\n"
    13 "POT-Creation-Date: 2025-03-20 14:13+0000\n"
     12"POT-Creation-Date: 2025-04-03T05:00:10+00:00\n"
    1413"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    15 "X-Generator: Loco https://localise.biz/\n"
     14"X-Generator: WP-CLI 2.11.0\n"
    1615"X-Domain: billy\n"
    17 "\n"
    18 "Language: \n"
    19 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;"
    20 
    21 #: inc/class-billy.php:422 inc/class-pdfexport.php:222
     16
     17#. Plugin Name of the plugin
     18#: billy.php
     19msgid "Billy"
     20msgstr ""
     21
     22#. Plugin URI of the plugin
     23#: billy.php
     24msgid "https://wordpress.org/plugins/billy"
     25msgstr ""
     26
     27#. Description of the plugin
     28#: billy.php
     29msgid "A business-oriented billing suite powered by WordPress."
     30msgstr ""
     31
     32#. Author of the plugin
     33#: billy.php
     34msgid "them.es"
     35msgstr ""
     36
     37#. Author URI of the plugin
     38#: billy.php
     39msgid "https://them.es/plugins/billy"
     40msgstr ""
     41
     42#: billy.php:36
     43msgid "<strong>Warning!</strong> %1$s requires PHP %2$s (or higher) to function properly. Please upgrade your PHP version."
     44msgstr ""
     45
     46#: billy.php:47
     47msgid "<strong>Warning!</strong> You are currently using an outdated WordPress version which is not compatible with %s. Please update WordPress to the latest version."
     48msgstr ""
     49
     50#: billy.php:58
     51msgid "<strong>Warning!</strong> %s is not compatible with the Classic Editor. Please deactivate the Classic Editor Plugin."
     52msgstr ""
     53
     54#: billy.php:69
     55msgid "The temp directory %s is not writable. Please change the read/write permissions."
     56msgstr ""
     57
     58#: inc/class-billy.php:169
     59#: inc/class-billy.php:322
     60#: inc/class-billy.php:343
     61#: blocks/build/index.js:1
     62#: blocks/src/accounting/table/deprecatedOuter.js:136
     63#: blocks/src/accounting/table/deprecatedOuter.js:146
     64#: blocks/src/accounting/table/deprecatedOuter.js:162
     65#: blocks/src/accounting/table/deprecatedOuter.js:186
     66#: blocks/src/accounting/table/deprecatedOuter.js:196
     67#: blocks/src/accounting/table/deprecatedOuter.js:328
     68#: blocks/src/accounting/table/deprecatedOuter.js:338
     69#: blocks/src/accounting/table/deprecatedOuter.js:356
     70#: blocks/src/accounting/table/deprecatedOuter.js:380
     71#: blocks/src/accounting/table/deprecatedOuter.js:390
     72#: blocks/src/accounting/table/deprecatedOuter.js:522
     73#: blocks/src/accounting/table/deprecatedOuter.js:532
     74#: blocks/src/accounting/table/deprecatedOuter.js:550
     75#: blocks/src/accounting/table/deprecatedOuter.js:574
     76#: blocks/src/accounting/table/deprecatedOuter.js:584
     77#: blocks/src/accounting/table/deprecatedOuter.js:716
     78#: blocks/src/accounting/table/deprecatedOuter.js:726
     79#: blocks/src/accounting/table/deprecatedOuter.js:744
     80#: blocks/src/accounting/table/deprecatedOuter.js:768
     81#: blocks/src/accounting/table/deprecatedOuter.js:778
     82#: blocks/src/accounting/table/index.js:188
     83#: blocks/src/accounting/table/index.js:205
     84#: blocks/src/accounting/table/index.js:223
     85#: blocks/src/accounting/table/index.js:244
     86#: blocks/src/accounting/table/index.js:259
     87#: blocks/src/accounting/table/index.js:355
     88#: blocks/src/accounting/table/index.js:365
     89#: blocks/src/accounting/table/index.js:381
     90#: blocks/src/accounting/table/index.js:404
     91#: blocks/src/accounting/table/index.js:411
     92#: blocks/src/invoice/table/deprecatedInner.js:79
     93#: blocks/src/invoice/table/deprecatedInner.js:149
     94#: blocks/src/invoice/table/deprecatedOuter.js:102
     95#: blocks/src/invoice/table/deprecatedOuter.js:169
     96#: blocks/src/invoice/table/deprecatedOuter.js:263
     97#: blocks/src/invoice/table/deprecatedOuter.js:334
     98#: blocks/src/invoice/table/deprecatedOuter.js:422
     99#: blocks/src/invoice/table/deprecatedOuter.js:481
     100#: blocks/src/invoice/table/index.js:212
     101#: blocks/src/invoice/table/index.js:271
     102#: blocks/src/invoice/table/index.js:333
     103#: blocks/src/invoice/table/index.js:398
     104#: blocks/src/invoice/table/index.js:673
     105#: blocks/src/quote/table/deprecatedInner.js:79
     106#: blocks/src/quote/table/deprecatedInner.js:149
     107#: blocks/src/quote/table/deprecatedOuter.js:102
     108#: blocks/src/quote/table/deprecatedOuter.js:169
     109#: blocks/src/quote/table/deprecatedOuter.js:263
     110#: blocks/src/quote/table/deprecatedOuter.js:334
     111#: blocks/src/quote/table/deprecatedOuter.js:422
     112#: blocks/src/quote/table/deprecatedOuter.js:481
     113#: blocks/src/quote/table/index.js:211
     114#: blocks/src/quote/table/index.js:270
     115#: blocks/src/quote/table/index.js:332
     116#: blocks/src/quote/table/index.js:397
     117#: blocks/src/quote/table/index.js:672
     118msgid "%1$s %2$s"
     119msgstr ""
     120
     121#: inc/class-billy.php:277
     122#: inc/class-billy.php:1283
     123#: inc/class-billy.php:1683
     124#: inc/class-blocks.php:291
     125#: blocks/build/index.js:1
     126#: blocks/src/invoice/actions/index.js:19
     127#: blocks/src/invoice/date/index.js:20
     128#: blocks/src/invoice/duedate/index.js:20
     129#: blocks/src/invoice/invoice-number/index.js:20
     130#: blocks/src/invoice/meta/index.js:20
     131#: blocks/src/invoice/paymentinformation/index.js:20
     132#: blocks/src/invoice/table/index.js:40
     133#: blocks/src/invoice/table/index.js:422
     134msgid "Invoice"
     135msgstr ""
     136
     137#: inc/class-billy.php:278
     138#: inc/class-billy.php:1439
     139#: inc/class-billy.php:1674
     140#: inc/class-blocks.php:313
     141#: blocks/build/index.js:1
     142#: blocks/src/quote/actions/index.js:19
     143#: blocks/src/quote/date/index.js:20
     144#: blocks/src/quote/information/index.js:20
     145#: blocks/src/quote/meta/index.js:20
     146#: blocks/src/quote/table/index.js:40
     147#: blocks/src/quote/table/index.js:421
     148#: blocks/src/quote/validuntildate/index.js:20
     149msgid "Quote"
     150msgstr ""
     151
     152#: inc/class-billy.php:279
     153#: inc/class-billy.php:1494
     154#: inc/class-billy.php:1495
     155#: blocks/build/index.js:1
     156#: blocks/src/accounting/actions/index.js:19
     157#: blocks/src/accounting/table/index.js:44
     158#: blocks/src/accounting/table/index.js:435
     159msgid "Accounting"
     160msgstr ""
     161
     162#: inc/class-billy.php:281
     163msgid "Contact"
     164msgstr ""
     165
     166#: inc/class-billy.php:282
     167msgid "To do"
     168msgstr ""
     169
     170#: inc/class-billy.php:283
     171msgid "Timetracking"
     172msgstr ""
     173
     174#: inc/class-billy.php:285
     175msgid "PDF Content"
     176msgstr ""
     177
     178#: inc/class-billy.php:286
     179msgid "PDF Footer"
     180msgstr ""
     181
     182#: inc/class-billy.php:291
     183msgid "✅ %s"
     184msgstr ""
     185
     186#: inc/class-billy.php:298
     187msgid "Locale"
     188msgstr ""
     189
     190#: inc/class-billy.php:302
     191#: inc/class-billy.php:1586
     192#: blocks/build/index.js:1
     193#: blocks/src/settings/panel/index.js:49
     194msgid "Currency"
     195msgstr ""
     196
     197#: inc/class-billy.php:306
     198#: blocks/build/index.js:1
     199#: blocks/src/accounting/table/deprecatedOuter.js:116
     200#: blocks/src/accounting/table/deprecatedOuter.js:179
     201#: blocks/src/accounting/table/deprecatedOuter.js:308
     202#: blocks/src/accounting/table/deprecatedOuter.js:373
     203#: blocks/src/accounting/table/deprecatedOuter.js:567
     204#: blocks/src/accounting/table/deprecatedOuter.js:761
     205#: blocks/src/accounting/table/index.js:334
     206#: blocks/src/accounting/table/index.js:397
     207#: blocks/src/settings/panel/index.js:55
     208msgid "Taxes"
     209msgstr ""
     210
     211#: inc/class-billy.php:311
     212msgid "Current invoice"
     213msgstr ""
     214
     215#: inc/class-billy.php:316
     216msgid "Current quote"
     217msgstr ""
     218
     219#: inc/class-billy.php:320
     220msgid "Problems have been solved!"
     221msgstr ""
     222
     223#: inc/class-billy.php:322
     224msgid "Edit"
     225msgstr ""
     226
     227#: inc/class-billy.php:327
     228msgid "Customized templates"
     229msgstr ""
     230
     231#: inc/class-billy.php:343
     232msgid "Thank you for purchasing %s!"
     233msgstr ""
     234
     235#: inc/class-billy.php:343
     236msgid "Get the <u>Pro</u> version"
     237msgstr ""
     238
     239#: inc/class-billy.php:343
     240msgid "Premium add-on with a project management suite, WooCommerce integration, Contacts, Address Book, QR code payments, Stats & Charts, Share links, and more."
     241msgstr ""
     242
     243#: inc/class-billy.php:343
     244msgid "Please rate this Plugin"
     245msgstr ""
     246
     247#: inc/class-billy.php:390
     248msgid "Download %s"
     249msgstr ""
     250
     251#: inc/class-billy.php:390
     252msgid "PDF"
     253msgstr ""
     254
     255#: inc/class-billy.php:394
     256msgid "Export %s"
     257msgstr ""
     258
     259#: inc/class-billy.php:394
     260msgid "TSV"
     261msgstr ""
     262
     263#: inc/class-billy.php:422
     264#: inc/class-pdfexport.php:218
     265#: blocks/build/index.js:1
     266#: blocks/src/accounting/table/deprecatedOuter.js:74
     267#: blocks/src/accounting/table/deprecatedOuter.js:266
     268#: blocks/src/accounting/table/deprecatedOuter.js:460
     269#: blocks/src/accounting/table/deprecatedOuter.js:654
     270#: blocks/src/accounting/table/index.js:294
     271#: blocks/src/invoice/table/deprecatedOuter.js:73
     272#: blocks/src/invoice/table/deprecatedOuter.js:234
     273#: blocks/src/invoice/table/deprecatedOuter.js:399
     274#: blocks/src/quote/table/deprecatedOuter.js:73
     275#: blocks/src/quote/table/deprecatedOuter.js:234
     276#: blocks/src/quote/table/deprecatedOuter.js:399
    22277msgid "#"
    23278msgstr ""
    24279
    25 #: inc/class-billy.php:169 inc/class-billy.php:322 inc/class-billy.php:343
    26 #: inc/class-billy.php:343
    27 #, php-format
    28 msgid "%1$s %2$s"
    29 msgstr ""
    30 
    31 #: inc/class-billy.php:692 inc/class-billy.php:761
    32 #, php-format
     280#: inc/class-billy.php:423
     281#: inc/class-pdfexport.php:219
     282#: blocks/build/index.js:1
     283#: blocks/src/accounting/table/deprecatedOuter.js:88
     284#: blocks/src/accounting/table/deprecatedOuter.js:280
     285#: blocks/src/accounting/table/deprecatedOuter.js:474
     286#: blocks/src/accounting/table/deprecatedOuter.js:668
     287#: blocks/src/accounting/table/index.js:304
     288#: blocks/src/invoice/table/deprecatedOuter.js:75
     289#: blocks/src/invoice/table/deprecatedOuter.js:236
     290#: blocks/src/invoice/table/deprecatedOuter.js:401
     291#: blocks/src/quote/table/deprecatedOuter.js:75
     292#: blocks/src/quote/table/deprecatedOuter.js:236
     293#: blocks/src/quote/table/deprecatedOuter.js:401
     294msgid "Description"
     295msgstr ""
     296
     297#: inc/class-billy.php:424
     298#: inc/class-pdfexport.php:220
     299#: blocks/build/index.js:1
     300#: blocks/src/invoice/table/deprecatedOuter.js:77
     301#: blocks/src/invoice/table/deprecatedOuter.js:238
     302#: blocks/src/invoice/table/deprecatedOuter.js:403
     303#: blocks/src/invoice/table/index.js:600
     304#: blocks/src/quote/table/deprecatedOuter.js:77
     305#: blocks/src/quote/table/deprecatedOuter.js:238
     306#: blocks/src/quote/table/deprecatedOuter.js:403
     307#: blocks/src/quote/table/index.js:599
     308msgid "Amount"
     309msgstr ""
     310
     311#: inc/class-billy.php:425
     312#: inc/class-pdfexport.php:221
     313#: blocks/build/index.js:1
     314#: blocks/src/invoice/table/deprecatedOuter.js:91
     315#: blocks/src/invoice/table/deprecatedOuter.js:252
     316#: blocks/src/invoice/table/deprecatedOuter.js:417
     317#: blocks/src/invoice/table/index.js:207
     318#: blocks/src/quote/table/deprecatedOuter.js:91
     319#: blocks/src/quote/table/deprecatedOuter.js:252
     320#: blocks/src/quote/table/deprecatedOuter.js:417
     321#: blocks/src/quote/table/index.js:206
     322msgid "Subtotal"
     323msgstr ""
     324
     325#: inc/class-billy.php:426
     326#: inc/class-pdfexport.php:222
     327#: blocks/build/index.js:1
     328#: blocks/src/invoice/table/deprecatedOuter.js:92
     329#: blocks/src/invoice/table/deprecatedOuter.js:160
     330#: blocks/src/invoice/table/deprecatedOuter.js:253
     331#: blocks/src/invoice/table/deprecatedOuter.js:324
     332#: blocks/src/invoice/table/deprecatedOuter.js:418
     333#: blocks/src/invoice/table/deprecatedOuter.js:477
     334#: blocks/src/invoice/table/index.js:208
     335#: blocks/src/invoice/table/index.js:267
     336#: blocks/src/quote/table/deprecatedOuter.js:92
     337#: blocks/src/quote/table/deprecatedOuter.js:160
     338#: blocks/src/quote/table/deprecatedOuter.js:253
     339#: blocks/src/quote/table/deprecatedOuter.js:324
     340#: blocks/src/quote/table/deprecatedOuter.js:418
     341#: blocks/src/quote/table/deprecatedOuter.js:477
     342#: blocks/src/quote/table/index.js:207
     343#: blocks/src/quote/table/index.js:266
     344msgid "Total"
     345msgstr ""
     346
     347#: inc/class-billy.php:427
     348#: inc/class-pdfexport.php:223
     349#: blocks/build/index.js:1
     350#: blocks/src/accounting/table/deprecatedOuter.js:502
     351#: blocks/src/accounting/table/deprecatedOuter.js:696
     352#: blocks/src/accounting/table/index.js:707
     353#: blocks/src/invoice/table/deprecatedOuter.js:79
     354#: blocks/src/invoice/table/deprecatedOuter.js:111
     355#: blocks/src/invoice/table/deprecatedOuter.js:240
     356#: blocks/src/invoice/table/deprecatedOuter.js:273
     357#: blocks/src/invoice/table/deprecatedOuter.js:405
     358#: blocks/src/invoice/table/deprecatedOuter.js:432
     359#: blocks/src/invoice/table/index.js:222
     360#: blocks/src/invoice/table/index.js:614
     361#: blocks/src/quote/table/deprecatedOuter.js:79
     362#: blocks/src/quote/table/deprecatedOuter.js:111
     363#: blocks/src/quote/table/deprecatedOuter.js:240
     364#: blocks/src/quote/table/deprecatedOuter.js:273
     365#: blocks/src/quote/table/deprecatedOuter.js:405
     366#: blocks/src/quote/table/deprecatedOuter.js:432
     367#: blocks/src/quote/table/index.js:221
     368#: blocks/src/quote/table/index.js:613
     369msgid "Tax"
     370msgstr ""
     371
     372#: inc/class-billy.php:555
     373msgid "Pending"
     374msgstr ""
     375
     376#: inc/class-billy.php:692
     377#: inc/class-billy.php:761
    33378msgid "%1$s%2$03s"
    34379msgstr ""
    35380
    36 #: inc/class-billy.php:1220 inc/class-billy.php:1226 inc/class-billy.php:1258
    37 #: inc/class-billy.php:1378 inc/class-billy.php:1384 inc/class-billy.php:1414
     381#: inc/class-billy.php:908
     382#: inc/class-billy.php:909
     383msgid "%s Header"
     384msgstr ""
     385
     386#: inc/class-billy.php:1164
     387#: inc/class-billy.php:1335
     388#: inc/class-billy.php:1583
     389#: inc/class-billy.php:1703
     390#: blocks/build/index.js:1
     391#: blocks/src/settings/panel/index.js:31
     392msgid "Name"
     393msgstr ""
     394
     395#: inc/class-billy.php:1164
     396#: inc/class-billy.php:1335
     397msgid "Company"
     398msgstr ""
     399
     400#: inc/class-billy.php:1164
     401#: inc/class-billy.php:1335
     402msgid "Address Field %s"
     403msgstr ""
     404
     405#: inc/class-billy.php:1164
     406#: inc/class-billy.php:1335
     407msgid "Country"
     408msgstr ""
     409
     410#: inc/class-billy.php:1193
     411msgid "Billing Period"
     412msgstr ""
     413
     414#: inc/class-billy.php:1201
     415#: inc/class-billy.php:1359
     416#: blocks/build/index.js:1
     417#: blocks/src/accounting/table/deprecatedOuter.js:95
     418#: blocks/src/accounting/table/deprecatedOuter.js:287
     419#: blocks/src/accounting/table/deprecatedOuter.js:481
     420#: blocks/src/accounting/table/deprecatedOuter.js:675
     421#: blocks/src/accounting/table/index.js:311
     422#: blocks/src/accounting/table/index.js:670
     423msgid "Reference"
     424msgstr ""
     425
     426#: inc/class-billy.php:1220
     427#: inc/class-billy.php:1226
     428#: inc/class-billy.php:1258
     429#: inc/class-billy.php:1378
     430#: inc/class-billy.php:1384
     431#: inc/class-billy.php:1414
    38432#: inc/class-billy.php:1484
    39 #, php-format
    40433msgid "%s (optional)"
    41434msgstr ""
    42435
    43 #: inc/class-billy.php:908 inc/class-billy.php:909
    44 #, php-format
    45 msgid "%s Header"
    46 msgstr ""
    47 
    48 #: inc/class-blocks.php:241
    49 #, php-format
    50 msgid "<div class=\"label\">%1$s</div> <div class=\"text\">%2$s</div>"
    51 msgstr ""
    52 
    53 #: inc/class-blocks.php:255
    54 #, php-format
    55 msgid "<strong>%1$s</strong> %2$s"
    56 msgstr ""
    57 
    58 #: billy.php:36
    59 #, php-format
    60 msgid ""
    61 "<strong>Warning!</strong> %1$s requires PHP %2$s (or higher) to function "
    62 "properly. Please upgrade your PHP version."
    63 msgstr ""
    64 
    65 #: billy.php:58
    66 #, php-format
    67 msgid ""
    68 "<strong>Warning!</strong> %s is not compatible with the Classic Editor. "
    69 "Please deactivate the Classic Editor Plugin."
    70 msgstr ""
    71 
    72 #: billy.php:47
    73 #, php-format
    74 msgid ""
    75 "<strong>Warning!</strong> You are currently using an outdated WordPress "
    76 "version which is not compatible with %s. Please update WordPress to the "
    77 "latest version."
    78 msgstr ""
    79 
    80 #. Description of the plugin
    81 msgid "A business-oriented billing suite powered by WordPress."
    82 msgstr ""
    83 
    84 #: inc/class-billy.php:279 inc/class-billy.php:1494 inc/class-billy.php:1495
    85 msgid "Accounting"
     436#: inc/class-billy.php:1220
     437#: inc/class-billy.php:1378
     438msgid "Subject"
     439msgstr ""
     440
     441#: inc/class-billy.php:1226
     442#: inc/class-billy.php:1384
     443msgid "Intro text"
     444msgstr ""
     445
     446#: inc/class-billy.php:1226
     447#: inc/class-billy.php:1384
     448msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Vitae turpis massa sed elementum tempus egestas."
     449msgstr ""
     450
     451#: inc/class-billy.php:1250
     452#: inc/class-billy.php:1251
     453#: inc/class-billy.php:1406
     454#: inc/class-billy.php:1407
     455#: blocks/build/index.js:1
     456#: blocks/src/quote/information/index.js:21
     457msgid "Information"
     458msgstr ""
     459
     460#: inc/class-billy.php:1258
     461#: inc/class-billy.php:1414
     462#: inc/class-billy.php:1484
     463msgid "Notes"
     464msgstr ""
     465
     466#: inc/class-billy.php:1282
     467msgid "Invoices"
     468msgstr ""
     469
     470#: inc/class-billy.php:1438
     471msgid "Quotes"
     472msgstr ""
     473
     474#: inc/class-billy.php:1471
     475msgid "Heading"
     476msgstr ""
     477
     478#: inc/class-billy.php:1567
     479#: blocks/build/index.js:1
     480#: blocks/src/accounting/table/deprecatedOuter.js:102
     481#: blocks/src/accounting/table/deprecatedOuter.js:130
     482#: blocks/src/accounting/table/deprecatedOuter.js:180
     483#: blocks/src/accounting/table/deprecatedOuter.js:294
     484#: blocks/src/accounting/table/deprecatedOuter.js:322
     485#: blocks/src/accounting/table/deprecatedOuter.js:374
     486#: blocks/src/accounting/table/deprecatedOuter.js:488
     487#: blocks/src/accounting/table/deprecatedOuter.js:516
     488#: blocks/src/accounting/table/deprecatedOuter.js:568
     489#: blocks/src/accounting/table/deprecatedOuter.js:710
     490#: blocks/src/accounting/table/deprecatedOuter.js:762
     491#: blocks/src/accounting/table/index.js:184
     492#: blocks/src/accounting/table/index.js:239
     493#: blocks/src/accounting/table/index.js:318
     494#: blocks/src/accounting/table/index.js:349
     495#: blocks/src/accounting/table/index.js:398
     496msgid "Earnings"
     497msgstr ""
     498
     499#: inc/class-billy.php:1568
     500#: blocks/build/index.js:1
     501#: blocks/src/accounting/table/deprecatedOuter.js:109
     502#: blocks/src/accounting/table/deprecatedOuter.js:131
     503#: blocks/src/accounting/table/deprecatedOuter.js:181
     504#: blocks/src/accounting/table/deprecatedOuter.js:301
     505#: blocks/src/accounting/table/deprecatedOuter.js:323
     506#: blocks/src/accounting/table/deprecatedOuter.js:375
     507#: blocks/src/accounting/table/deprecatedOuter.js:495
     508#: blocks/src/accounting/table/deprecatedOuter.js:517
     509#: blocks/src/accounting/table/deprecatedOuter.js:569
     510#: blocks/src/accounting/table/deprecatedOuter.js:711
     511#: blocks/src/accounting/table/deprecatedOuter.js:763
     512#: blocks/src/accounting/table/index.js:201
     513#: blocks/src/accounting/table/index.js:254
     514#: blocks/src/accounting/table/index.js:325
     515#: blocks/src/accounting/table/index.js:350
     516#: blocks/src/accounting/table/index.js:399
     517msgid "Expenses"
     518msgstr ""
     519
     520#: inc/class-billy.php:1584
     521#: inc/class-billy.php:1724
     522#: blocks/build/index.js:1
     523#: blocks/src/settings/panel/index.js:37
     524msgid "Address"
     525msgstr ""
     526
     527#: inc/class-billy.php:1585
     528#: inc/class-billy.php:1817
     529#: blocks/build/index.js:1
     530#: blocks/src/settings/panel/index.js:43
     531msgid "VAT"
     532msgstr ""
     533
     534#: inc/class-billy.php:1655
     535msgid "Plugin Setup"
     536msgstr ""
     537
     538#: inc/class-billy.php:1665
     539msgid "General"
     540msgstr ""
     541
     542#: inc/class-billy.php:1740
     543#: inc/class-billy.php:1758
     544msgid "Geocoding powered by %s"
     545msgstr ""
     546
     547#: inc/class-billy.php:1757
     548msgid "Address (geocoded)"
     549msgstr ""
     550
     551#: inc/class-billy.php:1779
     552msgid "Email"
     553msgstr ""
     554
     555#: inc/class-billy.php:1780
     556msgid "Enter your email"
     557msgstr ""
     558
     559#: inc/class-billy.php:1800
     560msgid "Phone"
     561msgstr ""
     562
     563#: inc/class-billy.php:1801
     564msgid "Enter your phone number"
     565msgstr ""
     566
     567#: inc/class-billy.php:1818
     568msgid "Enter your VAT identification number or Taxpayer ID"
     569msgstr ""
     570
     571#: inc/class-billy.php:1835
     572msgid "Currency Code"
     573msgstr ""
     574
     575#: inc/class-billy.php:1836
     576#: inc/class-billy.php:1858
     577msgid "Caution: Any changes made here may affect existing entries. Create a backup first!"
     578msgstr ""
     579
     580#: inc/class-billy.php:1853
     581msgid "Tax Rates"
     582msgstr ""
     583
     584#: inc/class-billy.php:1855
     585msgid "Enter the taxrates separated by newline: e.g. %s"
     586msgstr ""
     587
     588#: inc/class-billy.php:1874
     589msgid "Current invoice number"
     590msgstr ""
     591
     592#: inc/class-billy.php:1875
     593msgid "Upcoming invoice numbers will be autoincremented based on this value!"
     594msgstr ""
     595
     596#: inc/class-billy.php:1903
     597#: blocks/build/index.js:1
     598#: blocks/src/invoice/invoice-number/index.js:45
     599msgid "Invoice number: Prefix"
     600msgstr ""
     601
     602#: inc/class-billy.php:1904
     603#: inc/class-billy.php:2028
     604msgid "You can include placeholders like {YEAR}, {MONTH} and {DAY}."
     605msgstr ""
     606
     607#: inc/class-billy.php:1920
     608msgid "Payment due within # days"
     609msgstr ""
     610
     611#: inc/class-billy.php:1940
     612#: blocks/build/index.js:1
     613#: blocks/src/invoice/paymentinformation/index.js:21
     614#: blocks/src/invoice/paymentinformation/index.js:45
     615msgid "Payment Information"
    86616msgstr ""
    87617
     
    90620msgstr ""
    91621
    92 #: inc/class-billy.php:1584 inc/class-billy.php:1724
    93 msgid "Address"
    94 msgstr ""
    95 
    96 #: inc/class-billy.php:1757
    97 msgid "Address (geocoded)"
    98 msgstr ""
    99 
    100 #: inc/class-billy.php:1164 inc/class-billy.php:1335 inc/class-billy.php:1335
    101 #, php-format
    102 msgid "Address Field %s"
    103 msgstr ""
    104 
    105 #: inc/class-billy.php:424 inc/class-pdfexport.php:224
    106 msgid "Amount"
    107 msgstr ""
    108 
    109 #: inc/class-billy.php:1193
    110 msgid "Billing Period"
    111 msgstr ""
    112 
    113 #. Name of the plugin
    114 msgid "Billy"
     622#: inc/class-billy.php:1947
     623msgid "Thank you for your business!"
     624msgstr ""
     625
     626#: inc/class-billy.php:1961
     627#: blocks/build/index.js:1
     628#: blocks/src/quote/information/index.js:45
     629msgid "Quote Information"
     630msgstr ""
     631
     632#: inc/class-billy.php:1962
     633msgid "Inform your contacts about special terms, quote expiration clauses, etc."
     634msgstr ""
     635
     636#: inc/class-billy.php:1968
     637msgid "We will be happy to answer any questions you may have!"
     638msgstr ""
     639
     640#: inc/class-billy.php:1982
     641msgid "Current quote number"
     642msgstr ""
     643
     644#: inc/class-billy.php:1983
     645msgid "Upcoming quote numbers will be autoincremented based on this value!"
     646msgstr ""
     647
     648#: inc/class-billy.php:2010
     649msgid "Just use the current date (\"Ymd\") as quote number"
     650msgstr ""
     651
     652#: inc/class-billy.php:2027
     653msgid "Quote number: Prefix"
     654msgstr ""
     655
     656#: inc/class-billy.php:2044
     657msgid "Quote valid for # days"
     658msgstr ""
     659
     660#: inc/class-billy.php:2085
     661msgid "Geocode was not successful - please provide a valid address: %s"
     662msgstr ""
     663
     664#: inc/class-billy.php:2106
     665msgid "Please provide a valid currency format"
     666msgstr ""
     667
     668#: inc/class-billy.php:2132
     669msgid "Please separate the taxrates by newline and don't forget to append the \"%\" sign to each value."
    115670msgstr ""
    116671
     
    119674msgstr ""
    120675
    121 #: inc/class-billy.php:1836 inc/class-billy.php:1858
    122 msgid ""
    123 "Caution: Any changes made here may affect existing entries. Create a backup "
    124 "first!"
    125 msgstr ""
    126 
    127 #: inc/class-billy.php:1164 inc/class-billy.php:1335
    128 msgid "Company"
    129 msgstr ""
    130 
    131 #: inc/class-billy.php:281
    132 msgid "Contact"
    133 msgstr ""
    134 
    135 #: inc/class-billy.php:1164 inc/class-billy.php:1335
    136 msgid "Country"
    137 msgstr ""
    138 
    139 #: inc/class-billy.php:302 inc/class-billy.php:1586
    140 msgid "Currency"
    141 msgstr ""
    142 
    143 #: inc/class-billy.php:1835
    144 msgid "Currency Code"
    145 msgstr ""
    146 
    147 #: inc/class-blocks.php:291 inc/class-blocks.php:313
    148 #, php-format
     676#: inc/class-blocks.php:241
     677#: blocks/build/index.js:1
     678#: blocks/src/invoice/meta/index.js:84
     679#: blocks/src/invoice/meta/index.js:111
     680#: blocks/src/invoice/meta/index.js:149
     681#: blocks/src/quote/meta/index.js:84
     682#: blocks/src/quote/meta/index.js:111
     683#: blocks/src/quote/meta/index.js:148
     684msgid "<div class=\"label\">%1$s</div> <div class=\"text\">%2$s</div>"
     685msgstr ""
     686
     687#: inc/class-blocks.php:255
     688msgid "<strong>%1$s</strong> %2$s"
     689msgstr ""
     690
     691#: inc/class-blocks.php:255
     692#: blocks/build/index.js:1
     693#: blocks/src/invoice/meta/index.js:89
     694#: blocks/src/invoice/meta/index.js:116
     695#: blocks/src/invoice/meta/index.js:154
     696#: blocks/src/invoice/meta/index.js:194
     697#: blocks/src/quote/meta/index.js:89
     698#: blocks/src/quote/meta/index.js:116
     699#: blocks/src/quote/meta/index.js:153
     700#: blocks/src/quote/meta/index.js:192
     701msgid "N/A"
     702msgstr ""
     703
     704#: inc/class-blocks.php:268
     705#: blocks/build/index.js:1
     706#: blocks/src/accounting/table/deprecatedOuter.js:81
     707#: blocks/src/accounting/table/deprecatedOuter.js:273
     708#: blocks/src/accounting/table/deprecatedOuter.js:467
     709#: blocks/src/accounting/table/deprecatedOuter.js:661
     710#: blocks/src/accounting/table/index.js:297
     711#: blocks/src/accounting/table/index.js:603
     712#: blocks/src/invoice/date/index.js:21
     713#: blocks/src/invoice/date/index.js:45
     714#: blocks/src/quote/date/index.js:21
     715msgid "Date"
     716msgstr ""
     717
     718#: inc/class-blocks.php:291
     719#: inc/class-blocks.php:313
    149720msgid "Current %s"
    150 msgstr ""
    151 
    152 #: inc/class-billy.php:311
    153 msgid "Current invoice"
    154 msgstr ""
    155 
    156 #: inc/class-billy.php:1874
    157 msgid "Current invoice number"
    158 msgstr ""
    159 
    160 #: inc/class-billy.php:316
    161 msgid "Current quote"
    162 msgstr ""
    163 
    164 #: inc/class-billy.php:1982
    165 msgid "Current quote number"
    166 msgstr ""
    167 
    168 #: inc/class-billy.php:327
    169 msgid "Customized templates"
    170 msgstr ""
    171 
    172 #: inc/class-blocks.php:268
    173 msgid "Date"
    174 msgstr ""
    175 
    176 #: inc/class-billy.php:423 inc/class-pdfexport.php:223
    177 msgid "Description"
    178 msgstr ""
    179 
    180 #: inc/class-billy.php:390
    181 #, php-format
    182 msgid "Download %s"
    183 msgstr ""
    184 
    185 #: inc/class-pdfexport.php:168
    186 msgid "DRAFT"
    187721msgstr ""
    188722
     
    191725msgstr ""
    192726
    193 #: inc/class-billy.php:1567
    194 msgid "Earnings"
    195 msgstr ""
    196 
    197 #: inc/class-billy.php:322
    198 msgid "Edit"
    199 msgstr ""
    200 
    201 #: inc/class-billy.php:1779
    202 msgid "Email"
    203 msgstr ""
    204 
    205 #: inc/class-billy.php:1855
    206 #, php-format
    207 msgid "Enter the taxrates separated by newline: e.g. %s"
    208 msgstr ""
    209 
    210 #: inc/class-billy.php:1780
    211 msgid "Enter your email"
    212 msgstr ""
    213 
    214 #: inc/class-billy.php:1801
    215 msgid "Enter your phone number"
    216 msgstr ""
    217 
    218 #: inc/class-billy.php:1818
    219 msgid "Enter your VAT identification number or Taxpayer ID"
    220 msgstr ""
    221 
    222 #: inc/class-billy.php:1568
    223 msgid "Expenses"
    224 msgstr ""
    225 
    226 #: inc/class-billy.php:394
    227 #, php-format
    228 msgid "Export %s"
    229 msgstr ""
    230 
    231 #: inc/class-billy.php:1665
    232 msgid "General"
    233 msgstr ""
    234 
    235 #: inc/class-billy.php:2085
    236 #, php-format
    237 msgid "Geocode was not successful - please provide a valid address: %s"
    238 msgstr ""
    239 
    240 #: inc/class-billy.php:1740 inc/class-billy.php:1758
    241 #, php-format
    242 msgid "Geocoding powered by %s"
    243 msgstr ""
    244 
    245 #: inc/class-billy.php:343
    246 msgid "Get the <u>Pro</u> version"
    247 msgstr ""
    248 
    249 #: inc/class-billy.php:1471
    250 msgid "Heading"
    251 msgstr ""
    252 
    253 #. Author URI of the plugin
    254 msgid "https://them.es/plugins/billy"
    255 msgstr ""
    256 
    257 #. URI of the plugin
    258 msgid "https://wordpress.org/plugins/billy"
    259 msgstr ""
    260 
    261 #: inc/class-billy.php:1962
    262 msgid ""
    263 "Inform your contacts about special terms, quote expiration clauses, etc."
    264 msgstr ""
    265 
    266 #: inc/class-billy.php:1250 inc/class-billy.php:1251 inc/class-billy.php:1406
    267 #: inc/class-billy.php:1407
    268 msgid "Information"
    269 msgstr ""
    270 
    271 #: inc/class-billy.php:1226 inc/class-billy.php:1384
    272 msgid "Intro text"
    273 msgstr ""
    274 
    275 #: inc/class-billy.php:277 inc/class-billy.php:1283 inc/class-billy.php:1683
    276 #: inc/class-blocks.php:291
    277 msgid "Invoice"
    278 msgstr ""
    279 
    280 #: inc/class-billy.php:1903
    281 msgid "Invoice number: Prefix"
    282 msgstr ""
    283 
    284 #: inc/class-billy.php:1282
    285 msgid "Invoices"
    286 msgstr ""
    287 
    288 #: inc/class-billy.php:2010
    289 msgid "Just use the current date (\"Ymd\") as quote number"
    290 msgstr ""
    291 
    292 #: inc/class-billy.php:298
    293 msgid "Locale"
    294 msgstr ""
    295 
    296 #: inc/class-billy.php:1226 inc/class-billy.php:1384
    297 msgid ""
    298 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
    299 "tempor incididunt ut labore et dolore magna aliqua. Commodo quis imperdiet "
    300 "massa tincidunt nunc pulvinar sapien et. Vitae turpis massa sed elementum "
    301 "tempus egestas."
    302 msgstr ""
    303 
    304 #: inc/class-blocks.php:255
    305 msgid "N/A"
    306 msgstr ""
    307 
    308 #: inc/class-billy.php:1164 inc/class-billy.php:1335 inc/class-billy.php:1583
    309 #: inc/class-billy.php:1703
    310 msgid "Name"
    311 msgstr ""
    312 
    313 #: inc/class-billy.php:1258 inc/class-billy.php:1414 inc/class-billy.php:1484
    314 msgid "Notes"
    315 msgstr ""
    316 
    317 #: inc/class-billy.php:1920
    318 msgid "Payment due within # days"
    319 msgstr ""
    320 
    321 #: inc/class-billy.php:1940
    322 msgid "Payment Information"
    323 msgstr ""
    324 
    325 #: inc/class-billy.php:390
    326 msgid "PDF"
    327 msgstr ""
    328 
    329 #: inc/class-billy.php:285
    330 msgid "PDF Content"
    331 msgstr ""
    332 
    333 #: inc/class-billy.php:286
    334 msgid "PDF Footer"
    335 msgstr ""
    336 
    337 #: inc/class-billy.php:555
    338 msgid "Pending"
    339 msgstr ""
    340 
    341 #: inc/class-billy.php:1800
    342 msgid "Phone"
    343 msgstr ""
    344 
    345 #: inc/class-billy.php:2106
    346 msgid "Please provide a valid currency format"
    347 msgstr ""
    348 
    349 #: inc/class-billy.php:343
    350 msgid "Please rate this Plugin"
    351 msgstr ""
    352 
    353 #: inc/class-billy.php:2132
    354 msgid ""
    355 "Please separate the taxrates by newline and don't forget to append the \"%\" "
    356 "sign to each value."
    357 msgstr ""
    358 
    359 #: inc/class-billy.php:1655
    360 msgid "Plugin Setup"
    361 msgstr ""
    362 
    363 #: inc/class-billy.php:343
    364 msgid ""
    365 "Premium add-on with a project management suite, WooCommerce integration, "
    366 "Contacts, Address Book, QR code payments, Stats & Charts, Share links, and "
    367 "more."
    368 msgstr ""
    369 
    370 #: inc/class-billy.php:320
    371 msgid "Problems have been solved!"
    372 msgstr ""
    373 
    374 #: inc/class-billy.php:278 inc/class-billy.php:1439 inc/class-billy.php:1674
    375 #: inc/class-blocks.php:313
    376 msgid "Quote"
    377 msgstr ""
    378 
    379 #: inc/class-billy.php:1961
    380 msgid "Quote Information"
    381 msgstr ""
    382 
    383 #: inc/class-billy.php:2027
    384 msgid "Quote number: Prefix"
    385 msgstr ""
    386 
    387 #: inc/class-billy.php:2044
    388 msgid "Quote valid for # days"
    389 msgstr ""
    390 
    391 #: inc/class-billy.php:1438
    392 msgid "Quotes"
    393 msgstr ""
    394 
    395 #: inc/class-billy.php:1201 inc/class-billy.php:1359
    396 msgid "Reference"
    397 msgstr ""
    398 
    399 #: inc/class-billy.php:1220 inc/class-billy.php:1378
    400 msgid "Subject"
    401 msgstr ""
    402 
    403 #: inc/class-billy.php:425 inc/class-pdfexport.php:225
    404 msgid "Subtotal"
    405 msgstr ""
    406 
    407 #: inc/class-billy.php:427 inc/class-pdfexport.php:227
    408 msgid "Tax"
    409 msgstr ""
    410 
    411 #: inc/class-billy.php:1853
    412 msgid "Tax Rates"
    413 msgstr ""
    414 
    415 #: inc/class-billy.php:306
    416 msgid "Taxes"
    417 msgstr ""
    418 
    419 #: inc/class-billy.php:343
    420 #, php-format
    421 msgid "Thank you for purchasing %s!"
    422 msgstr ""
    423 
    424 #: inc/class-billy.php:1947
    425 msgid "Thank you for your business!"
    426 msgstr ""
    427 
    428 #: billy.php:69
    429 #, php-format
    430 msgid ""
    431 "The temp directory %s is not writable. Please change the read/write "
    432 "permissions."
    433 msgstr ""
    434 
    435 #. Author of the plugin
    436 msgid "them.es"
    437 msgstr ""
    438 
    439 #: inc/class-billy.php:283
    440 msgid "Timetracking"
    441 msgstr ""
    442 
    443 #: inc/class-billy.php:282
    444 msgid "To do"
    445 msgstr ""
    446 
    447 #: inc/class-billy.php:426 inc/class-pdfexport.php:226
    448 msgid "Total"
    449 msgstr ""
    450 
    451 #: inc/class-billy.php:394
    452 msgid "TSV"
    453 msgstr ""
    454 
    455 #: inc/class-billy.php:1875
    456 msgid "Upcoming invoice numbers will be autoincremented based on this value!"
    457 msgstr ""
    458 
    459 #: inc/class-billy.php:1983
    460 msgid "Upcoming quote numbers will be autoincremented based on this value!"
    461 msgstr ""
    462 
    463727#: inc/class-blocks.php:335
     728#: blocks/build/index.js:1
     729#: blocks/src/quote/validuntildate/index.js:21
    464730msgid "Valid Until"
    465 msgstr ""
    466 
    467 #: inc/class-billy.php:1585 inc/class-billy.php:1817
    468 msgid "VAT"
    469 msgstr ""
    470 
    471 #: inc/class-billy.php:1968
    472 msgid "We will be happy to answer any questions you may have!"
    473731msgstr ""
    474732
     
    477735msgstr ""
    478736
    479 #: inc/class-billy.php:1904 inc/class-billy.php:2028
    480 msgid "You can include placeholders like {YEAR}, {MONTH} and {DAY}."
    481 msgstr ""
    482 
    483 #: inc/class-billy.php:291
    484 #, php-format
    485 msgid "✅ %s"
    486 msgstr ""
     737#: inc/class-pdfexport.php:170
     738msgid "DRAFT"
     739msgstr ""
     740
     741#: blocks/build/index.js:1
     742#: blocks/src/_deprecated/header/index.js:24
     743#: blocks/src/_deprecated/header/index.js:46
     744#: blocks/src/_deprecated/header/index.js:54
     745msgid "Header"
     746msgstr ""
     747
     748#: blocks/build/index.js:1
     749#: blocks/src/invoice/date/index.js:37
     750#: blocks/src/invoice/duedate/index.js:37
     751#: blocks/src/invoice/invoice-number/index.js:37
     752#: blocks/src/invoice/paymentinformation/index.js:37
     753#: blocks/src/quote/information/index.js:37
     754#: blocks/src/_deprecated/header/index.js:41
     755msgid "Info"
     756msgstr ""
     757
     758#: blocks/build/index.js:1
     759#: blocks/src/_deprecated/header/index.js:46
     760msgid "Edit the %s layout"
     761msgstr ""
     762
     763#: blocks/build/index.js:1
     764#: blocks/src/invoice/duedate/index.js:41
     765#: blocks/src/invoice/invoice-number/index.js:41
     766#: blocks/src/invoice/paymentinformation/index.js:41
     767#: blocks/src/quote/information/index.js:41
     768#: blocks/src/_deprecated/header/index.js:54
     769msgid "The %s values can be modified in the Theme Customizer."
     770msgstr ""
     771
     772#: blocks/build/index.js:1
     773#: blocks/src/accounting/actions/index.js:18
     774#: blocks/src/accounting/actions/index.js:53
     775#: blocks/src/accounting/table/index.js:43
     776#: blocks/src/accounting/table/index.js:434
     777#: blocks/src/invoice/actions/index.js:18
     778#: blocks/src/invoice/actions/index.js:53
     779#: blocks/src/invoice/date/index.js:19
     780#: blocks/src/invoice/duedate/index.js:19
     781#: blocks/src/invoice/invoice-number/index.js:19
     782#: blocks/src/invoice/meta/index.js:19
     783#: blocks/src/invoice/paymentinformation/index.js:19
     784#: blocks/src/invoice/table/index.js:39
     785#: blocks/src/invoice/table/index.js:421
     786#: blocks/src/quote/actions/index.js:18
     787#: blocks/src/quote/actions/index.js:53
     788#: blocks/src/quote/date/index.js:19
     789#: blocks/src/quote/information/index.js:19
     790#: blocks/src/quote/meta/index.js:19
     791#: blocks/src/quote/table/index.js:39
     792#: blocks/src/quote/table/index.js:420
     793#: blocks/src/quote/validuntildate/index.js:19
     794msgid "%1$s: %2$s"
     795msgstr ""
     796
     797#: blocks/build/index.js:1
     798#: blocks/src/accounting/actions/index.js:20
     799#: blocks/src/accounting/table/index.js:161
     800#: blocks/src/invoice/actions/index.js:20
     801#: blocks/src/invoice/table/index.js:182
     802#: blocks/src/quote/actions/index.js:20
     803#: blocks/src/quote/table/index.js:181
     804msgid "Actions"
     805msgstr ""
     806
     807#: blocks/build/index.js:1
     808#: blocks/src/accounting/actions/index.js:54
     809#: blocks/src/invoice/actions/index.js:54
     810#: blocks/src/quote/actions/index.js:54
     811msgid "Last modified"
     812msgstr ""
     813
     814#: blocks/build/index.js:1
     815#: blocks/src/invoice/meta/index.js:21
     816#: blocks/src/quote/meta/index.js:21
     817msgid "Meta"
     818msgstr ""
     819
     820#: blocks/build/index.js:1
     821#: blocks/src/invoice/meta/index.js:64
     822#: blocks/src/quote/meta/index.js:64
     823msgid "Label"
     824msgstr ""
     825
     826#: blocks/build/index.js:1
     827#: blocks/src/invoice/meta/index.js:72
     828#: blocks/src/quote/meta/index.js:72
     829msgid "Text"
     830msgstr ""
     831
     832#: blocks/build/index.js:1
     833#: blocks/src/invoice/meta/index.js:188
     834#: blocks/src/quote/meta/index.js:186
     835msgid "<strong>%1$s</strong> <span>%2$s</span>"
     836msgstr ""
     837
     838#: blocks/build/index.js:1
     839#: blocks/src/invoice/date/index.js:41
     840#: blocks/src/invoice/invoice-number/index.js:52
     841msgid "Due to legal requirements in some countries, autogenerated data like %s can't be modified anymore after an invoice has been created in the system!"
     842msgstr ""
     843
     844#: blocks/build/index.js:1
     845#: blocks/src/invoice/duedate/index.js:21
     846msgid "Due Date"
     847msgstr ""
     848
     849#: blocks/build/index.js:1
     850#: blocks/src/invoice/duedate/index.js:45
     851msgid "Payment due days"
     852msgstr ""
     853
     854#: blocks/build/index.js:1
     855#: blocks/src/invoice/invoice-number/index.js:21
     856msgid "Number"
     857msgstr ""
     858
     859#: blocks/build/index.js:1
     860#: blocks/src/invoice/invoice-number/index.js:56
     861#: blocks/src/settings/panel/index.js:25
     862msgid "Invoice number"
     863msgstr ""
     864
     865#: blocks/build/index.js:1
     866#: blocks/src/invoice/table/deprecatedOuter.js:136
     867#: blocks/src/invoice/table/deprecatedOuter.js:299
     868#: blocks/src/invoice/table/deprecatedOuter.js:452
     869#: blocks/src/invoice/table/index.js:242
     870#: blocks/src/invoice/table/index.js:365
     871#: blocks/src/quote/table/deprecatedOuter.js:136
     872#: blocks/src/quote/table/deprecatedOuter.js:299
     873#: blocks/src/quote/table/deprecatedOuter.js:452
     874#: blocks/src/quote/table/index.js:241
     875#: blocks/src/quote/table/index.js:364
     876msgid "%1$s %2$s %3$s"
     877msgstr ""
     878
     879#: blocks/build/index.js:1
     880#: blocks/src/accounting/table/index.js:45
     881#: blocks/src/invoice/table/index.js:41
     882#: blocks/src/quote/table/index.js:41
     883msgid "Table"
     884msgstr ""
     885
     886#: blocks/build/index.js:1
     887#: blocks/src/accounting/table/index.js:167
     888#: blocks/src/invoice/table/index.js:188
     889#: blocks/src/quote/table/index.js:187
     890msgid "Update Totals"
     891msgstr ""
     892
     893#: blocks/build/index.js:1
     894#: blocks/src/accounting/table/index.js:436
     895#: blocks/src/invoice/table/index.js:423
     896#: blocks/src/quote/table/index.js:422
     897msgid "Table Row"
     898msgstr ""
     899
     900#: blocks/build/index.js:1
     901#: blocks/src/invoice/table/index.js:547
     902#: blocks/src/quote/table/index.js:546
     903msgid "Quantity/Rate Calculator"
     904msgstr ""
     905
     906#: blocks/build/index.js:1
     907#: blocks/src/invoice/table/index.js:550
     908#: blocks/src/quote/table/index.js:549
     909msgid "Quantity"
     910msgstr ""
     911
     912#: blocks/build/index.js:1
     913#: blocks/src/accounting/table/index.js:684
     914#: blocks/src/accounting/table/index.js:697
     915#: blocks/src/accounting/table/index.js:710
     916#: blocks/src/invoice/table/index.js:551
     917#: blocks/src/invoice/table/index.js:563
     918#: blocks/src/invoice/table/index.js:604
     919#: blocks/src/invoice/table/index.js:646
     920#: blocks/src/quote/table/index.js:550
     921#: blocks/src/quote/table/index.js:562
     922#: blocks/src/quote/table/index.js:603
     923#: blocks/src/quote/table/index.js:645
     924msgid "0"
     925msgstr ""
     926
     927#: blocks/build/index.js:1
     928#: blocks/src/accounting/table/index.js:680
     929#: blocks/src/accounting/table/index.js:693
     930#: blocks/src/accounting/table/index.js:706
     931#: blocks/src/invoice/table/index.js:559
     932#: blocks/src/invoice/table/index.js:599
     933#: blocks/src/invoice/table/index.js:613
     934#: blocks/src/quote/table/index.js:558
     935#: blocks/src/quote/table/index.js:598
     936#: blocks/src/quote/table/index.js:612
     937msgid "%1$s in %2$s"
     938msgstr ""
     939
     940#: blocks/build/index.js:1
     941#: blocks/src/invoice/table/index.js:560
     942#: blocks/src/quote/table/index.js:559
     943msgid "Rate"
     944msgstr ""
     945
     946#: blocks/build/index.js:1
     947#: blocks/src/accounting/table/deprecatedOuter.js:129
     948#: blocks/src/accounting/table/deprecatedOuter.js:321
     949#: blocks/src/accounting/table/deprecatedOuter.js:515
     950#: blocks/src/accounting/table/deprecatedOuter.js:709
     951#: blocks/src/accounting/table/index.js:348
     952msgid "%1$s / %2$s"
     953msgstr ""
     954
     955#: blocks/build/index.js:1
     956#: blocks/src/accounting/table/deprecatedOuter.js:159
     957#: blocks/src/accounting/table/deprecatedOuter.js:352
     958#: blocks/src/accounting/table/deprecatedOuter.js:546
     959#: blocks/src/accounting/table/deprecatedOuter.js:740
     960#: blocks/src/accounting/table/index.js:219
     961#: blocks/src/accounting/table/index.js:378
     962msgid "Profit"
     963msgstr ""
     964
     965#: blocks/build/index.js:1
     966#: blocks/src/accounting/table/deprecatedOuter.js:178
     967#: blocks/src/accounting/table/deprecatedOuter.js:372
     968#: blocks/src/accounting/table/deprecatedOuter.js:566
     969#: blocks/src/accounting/table/deprecatedOuter.js:760
     970#: blocks/src/accounting/table/index.js:396
     971msgid "%1$s (%2$s / %3$s)"
     972msgstr ""
     973
     974#: blocks/build/index.js:1
     975#: blocks/src/accounting/table/deprecatedOuter.js:682
     976#: blocks/src/accounting/table/index.js:681
     977msgid "Earning"
     978msgstr ""
     979
     980#: blocks/build/index.js:1
     981#: blocks/src/accounting/table/deprecatedOuter.js:689
     982#: blocks/src/accounting/table/index.js:694
     983msgid "Expense"
     984msgstr ""
     985
     986#: blocks/build/index.js:1
     987#: blocks/src/accounting/table/deprecatedInner.js:99
     988#: blocks/src/accounting/table/deprecatedInner.js:118
     989#: blocks/src/accounting/table/deprecatedInner.js:234
     990#: blocks/src/accounting/table/deprecatedInner.js:253
     991#: blocks/src/accounting/table/deprecatedInner.js:375
     992#: blocks/src/accounting/table/deprecatedInner.js:394
     993#: blocks/src/accounting/table/index.js:640
     994#: blocks/src/accounting/table/index.js:742
     995#: blocks/src/accounting/table/index.js:758
     996msgid "Q%s"
     997msgstr ""
     998
     999#: blocks/build/index.js:1
     1000#: blocks/src/accounting/table/index.js:238
     1001#: blocks/src/accounting/table/index.js:253
     1002msgid "Taxes (%s)"
     1003msgstr ""
     1004
     1005#: blocks/build/index.js:1
     1006#: blocks/src/accounting/table/index.js:613
     1007msgid "Reference: %s"
     1008msgstr ""
     1009
     1010#: blocks/build/index.js:1
     1011#: blocks/src/accounting/table/index.js:617
     1012msgid "Post"
     1013msgstr ""
     1014
     1015#: blocks/build/index.js:1
     1016#: blocks/src/settings/panel/index.js:11
     1017msgid "Billy Setup"
     1018msgstr ""
     1019
     1020#: blocks/build/index.js:1
     1021#: blocks/src/settings/panel/index.js:21
     1022msgid "Settings (Theme Customizer)"
     1023msgstr ""
     1024
     1025#: blocks/build/index.js:1
     1026#: blocks/src/settings/panel/index.js:28
     1027msgid "Quote number"
     1028msgstr ""
     1029
     1030#: blocks/build/index.js:1
     1031#: blocks/src/settings/theme-mod/index.js:18
     1032#: blocks/src/settings/theme-mod/index.js:48
     1033msgid "Theme Mod"
     1034msgstr ""
     1035
     1036#: blocks/build/index.js:1
     1037#: blocks/src/settings/theme-mod/index.js:50
     1038msgid "Setting"
     1039msgstr ""
     1040
     1041#: blocks/build/index.js:1
     1042#: blocks/src/settings/theme-mod/index.js:51
     1043msgid "Modify the value in the Theme Customizer."
     1044msgstr ""
  • billy/trunk/readme.txt

    r3266011 r3355121  
    55Requires at least: 6.0
    66Tested up to: 6.8
    7 Stable tag: 1.11.0
     7Stable tag: 1.11.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    151151== Changelog ==
    152152
     153= 1.11.1 =
     154* Re-implement workaround to improve formatting of line spacing in PDF content
     155* Update dependencies
     156
    153157= 1.11.0 =
    154158* Removed translation strings in table block and added custom placeholders that get replaced in the frontend to prevent potentially corrupted block warnings if the post language has been switched
  • billy/trunk/vendor-prefixed/mpdf/mpdf/src/Config/ConfigVariables.php

    r3251553 r3355121  
    153153            // Overrides warnings making changes when possible to force PDFA1-b compliance
    154154            'PDFAauto' => false,
     155            'PDFAversion' => '1-B',
    155156
    156157            // Colour profile OutputIntent
  • billy/trunk/vendor-prefixed/mpdf/mpdf/src/Config/FontVariables.php

    r3251553 r3355121  
    199199                ],
    200200                "eeyekunicode" => [/* Meetei Mayek */
    201                     'R' => "Eeyek.ttf",
     201                    'R' => "Eeyek-Regular.ttf",
    202202                ],
    203203                "lannaalif" => [/* Tai Tham */
  • billy/trunk/vendor-prefixed/mpdf/mpdf/src/Image/ImageProcessor.php

    r3251553 r3355121  
    471471            }
    472472
    473             imagedestroy($im);
     473            $this->destroyImage($im);
    474474        }
    475475        return $info;
     
    655655                }
    656656
    657                 imagedestroy($im);
     657                $this->destroyImage($im);
    658658                unlink($tempfile);
    659659
     
    892892            $h = imagesy($im);
    893893
    894             $tempfile =  $this->cache->tempFilename('_tempImgPNG' . md5($file) . random_int(1, 10000) . '.png');
     894            $tempfile = $this->cache->tempFilename('_tempImgPNG' . md5($file) . bin2hex(random_bytes(6)) . '.png');
    895895
    896896            // Alpha channel set (including using tRNS for Paletted images)
     
    991991                }
    992992
    993                 imagedestroy($imgalpha);
     993                $this->destroyImage($imgalpha);
    994994                // extract image without alpha channel
    995995                $imgplain = imagecreatetruecolor($w, $h);
     
    10031003                }
    10041004
    1005                 imagedestroy($imgplain);
     1005                $this->destroyImage($imgplain);
    10061006
    10071007                // embed mask image
     
    10901090            }
    10911091
    1092             imagedestroy($im);
     1092            $this->destroyImage($im);
    10931093            // $info = $this->getImage($tempfile, false);
    10941094            $data = file_get_contents($tempfile);
     
    12491249        @imagejpeg($im, $tempfile);
    12501250        $data = file_get_contents($tempfile);
    1251         imagedestroy($im);
     1251        $this->destroyImage($im);
    12521252        unlink($tempfile);
    12531253        unlink($checkfile);
     
    13131313                }
    13141314
    1315                 imagedestroy($im);
     1315                $this->destroyImage($im);
    13161316                unlink($tempfile);
    13171317
     
    14611461            $info = $this->processPng($data, $tempfile, false, $interpolation);
    14621462
    1463             imagedestroy($im);
     1463            $this->destroyImage($im);
    14641464            unlink($tempfile);
    14651465
     
    14791479    }
    14801480
     1481    private function destroyImage($im)
     1482    {
     1483        if (PHP_VERSION_ID < 80000) {
     1484            imagedestroy($im);
     1485        }
     1486    }
     1487
    14811488}
  • billy/trunk/vendor-prefixed/mpdf/mpdf/src/Image/Svg.php

    r3251553 r3355121  
    14801480                    for ($i = 0; $i < count($d); $i += 2) {
    14811481
    1482                         if ($d[$i] === 'none') {
     1482                        if ($d[$i] === '' || $d[$i] === 'none') {
    14831483                            continue;
    14841484                        }
    14851485
    1486                         $arr .= sprintf('%.3F %.3F ', $d[$i] * $this->kp, $d[$i + 1] * $this->kp);
     1486                        $arr .= sprintf('%.3F %.3F ', (float) $d[$i] * $this->kp, (float) $d[$i + 1] * $this->kp);
    14871487                    }
    14881488
  • billy/trunk/vendor-prefixed/mpdf/mpdf/src/Mpdf.php

    r3251553 r3355121  
    3333    use MpdfPsrLogAwareTrait;
    3434
    35     const VERSION = '8.2.5';
     35    const VERSION = '8.2.6';
    3636
    3737    const SCALE = 72 / 25.4;
     
    7777
    7878    var $PDFA;
    79     var $PDFAversion = '1-B';
     79    var $PDFAversion;
    8080    var $PDFAauto;
    8181    var $ICCProfile;
     
    39133913        } // mPDF 6
    39143914
     3915        $glyphIDtoUni = null;
    39153916        if (empty($font['name']) || $font['originalsize'] != $ttfstat['size'] || $regenerate) {
    39163917            $generator = new MetricsGenerator($this->fontCache, $this->fontDescriptor);
  • billy/trunk/vendor-prefixed/mpdf/mpdf/src/Writer/MetadataWriter.php

    r3251553 r3355121  
    6363        $m .= '  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' . "\n";
    6464        $m .= '   <rdf:Description rdf:about="uuid:' . $uuid . '" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">' . "\n";
    65         $m .= '    <pdf:Producer>' . $this->getProducerString() . '</pdf:Producer>' . "\n";
     65        $m .= '    <pdf:Producer>' . htmlspecialchars($this->getProducerString(), ENT_QUOTES | ENT_XML1) . '</pdf:Producer>' . "\n";
    6666        if (!empty($this->mpdf->keywords)) {
    67             $m .= '    <pdf:Keywords>' . $this->mpdf->keywords . '</pdf:Keywords>' . "\n";
     67            $m .= '    <pdf:Keywords>' . htmlspecialchars($this->mpdf->keywords, ENT_QUOTES | ENT_XML1) . '</pdf:Keywords>' . "\n";
    6868        }
    6969        $m .= '   </rdf:Description>' . "\n";
     
    7474        $m .= '    <xmp:MetadataDate>' . $CreationDate . '</xmp:MetadataDate>' . "\n";
    7575        if (!empty($this->mpdf->creator)) {
    76             $m .= '    <xmp:CreatorTool>' . $this->mpdf->creator . '</xmp:CreatorTool>' . "\n";
     76            $m .= '    <xmp:CreatorTool>' . htmlspecialchars($this->mpdf->creator, ENT_QUOTES | ENT_XML1) . '</xmp:CreatorTool>' . "\n";
    7777        }
    7878        $m .= '   </rdf:Description>' . "\n";
     
    8484            $m .= '    <dc:title>
    8585     <rdf:Alt>
    86       <rdf:li xml:lang="x-default">' . $this->mpdf->title . '</rdf:li>
     86      <rdf:li xml:lang="x-default">' . htmlspecialchars($this->mpdf->title, ENT_QUOTES | ENT_XML1) . '</rdf:li>
    8787     </rdf:Alt>
    8888    </dc:title>' . "\n";
     
    9191            $m .= '    <dc:subject>
    9292     <rdf:Bag>
    93       <rdf:li>' . $this->mpdf->keywords . '</rdf:li>
     93      <rdf:li>' . htmlspecialchars($this->mpdf->keywords, ENT_QUOTES | ENT_XML1) . '</rdf:li>
    9494     </rdf:Bag>
    9595    </dc:subject>' . "\n";
     
    9898            $m .= '    <dc:description>
    9999     <rdf:Alt>
    100       <rdf:li xml:lang="x-default">' . $this->mpdf->subject . '</rdf:li>
     100      <rdf:li xml:lang="x-default">' . htmlspecialchars($this->mpdf->subject, ENT_QUOTES | ENT_XML1) . '</rdf:li>
    101101     </rdf:Alt>
    102102    </dc:description>' . "\n";
     
    105105            $m .= '    <dc:creator>
    106106     <rdf:Seq>
    107       <rdf:li>' . $this->mpdf->author . '</rdf:li>
     107      <rdf:li>' . htmlspecialchars($this->mpdf->author, ENT_QUOTES | ENT_XML1) . '</rdf:li>
    108108     </rdf:Seq>
    109109    </dc:creator>' . "\n";
  • billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/DeepCopy.php

    r3251553 r3355121  
    8888     * Deep copies the given object.
    8989     *
    90      * @param mixed $object
    91      *
    92      * @return mixed
     90     * @template TObject
     91     *
     92     * @param TObject $object
     93     *
     94     * @return TObject
    9395     */
    9496    public function copy($object)
     
    266268        }
    267269
    268         $property->setAccessible(true);
     270        if (PHP_VERSION_ID < 80100) {
     271            $property->setAccessible(true);
     272        }
    269273
    270274        // Ignore uninitialized properties (for PHP >7.4)
  • billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php

    r3251553 r3355121  
    2020        $reflectionProperty = ReflectionHelper::getProperty($object, $property);
    2121
    22         $reflectionProperty->setAccessible(true);
     22        if (PHP_VERSION_ID < 80100) {
     23            $reflectionProperty->setAccessible(true);
     24        }
    2325        $oldCollection = $reflectionProperty->getValue($object);
    2426
  • billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php

    r3251553 r3355121  
    2222    {
    2323        $reflectionProperty = ReflectionHelper::getProperty($object, $property);
    24         $reflectionProperty->setAccessible(true);
     24        if (PHP_VERSION_ID < 80100) {
     25            $reflectionProperty->setAccessible(true);
     26        }
    2527
    2628        $reflectionProperty->setValue($object, new ArrayCollection());
  • billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php

    r3251553 r3355121  
    3131    {
    3232        $reflectionProperty = ReflectionHelper::getProperty($object, $property);
    33         $reflectionProperty->setAccessible(true);
     33        if (PHP_VERSION_ID < 80100) {
     34            $reflectionProperty->setAccessible(true);
     35        }
    3436
    3537        $value = call_user_func($this->callback, $reflectionProperty->getValue($object));
  • billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php

    r3251553 r3355121  
    1919        $reflectionProperty = ReflectionHelper::getProperty($object, $property);
    2020
    21         $reflectionProperty->setAccessible(true);
     21        if (PHP_VERSION_ID < 80100) {
     22            $reflectionProperty->setAccessible(true);
     23        }
    2224        $reflectionProperty->setValue($object, null);
    2325    }
  • billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php

    r3251553 r3355121  
    4040        }
    4141
    42         $reflectionProperty->setAccessible(true);
     42        if (PHP_VERSION_ID < 80100) {
     43            $reflectionProperty->setAccessible(true);
     44        }
    4345
    4446        // Uninitialized properties (for PHP >7.4)
  • billy/trunk/vendor-prefixed/setasign/fpdi/src/Fpdi.php

    r3251553 r3355121  
    3131     * @string
    3232     */
    33     const VERSION = '2.6.3';
     33    const VERSION = '2.6.4';
    3434}
  • billy/trunk/vendor-prefixed/setasign/fpdi/src/PdfParser/CrossReference/AbstractReader.php

    r3251553 r3355121  
    3636     * @param PdfParser $parser
    3737     * @throws CrossReferenceException
    38      * @throws PdfTypeException
    3938     */
    4039    public function __construct(PdfParser $parser)
     
    5857     *
    5958     * @throws CrossReferenceException
    60      * @throws PdfTypeException
    6159     */
    6260    protected function readTrailer()
  • billy/trunk/vendor-prefixed/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php

    r3251553 r3355121  
    7272                $this->reader->ensure($position, 20);
    7373                $line = $this->reader->readBytes(20);
    74                 if ($line[17] === 'f') {
     74                if ($line === false || $line[17] === 'f') {
    7575                    return false;
    7676                }
  • billy/trunk/vendor-prefixed/setasign/fpdi/src/PdfParser/Type/PdfType.php

    r3251553 r3355121  
    2828     * @param PdfParser $parser
    2929     * @param bool $stopAtIndirectObject
     30     * @param array $ensuredObjectsList A list of all ensured indirect objects to prevent recursion
    3031     * @return PdfType
    3132     * @throws CrossReferenceException
    3233     * @throws PdfParserException
    3334     */
    34     public static function resolve(PdfType $value, PdfParser $parser, $stopAtIndirectObject = false)
    35     {
     35    public static function resolve(
     36        PdfType $value,
     37        PdfParser $parser,
     38        $stopAtIndirectObject = false,
     39        array &$ensuredObjectsList = []
     40    ) {
     41        if ($value instanceof PdfIndirectObjectReference) {
     42            $value = $parser->getIndirectObject($value->value);
     43        }
     44
    3645        if ($value instanceof PdfIndirectObject) {
    3746            if ($stopAtIndirectObject === true) {
     
    3948            }
    4049
    41             return self::resolve($value->value, $parser, $stopAtIndirectObject);
    42         }
    43 
    44         if ($value instanceof PdfIndirectObjectReference) {
    45             return self::resolve($parser->getIndirectObject($value->value), $parser, $stopAtIndirectObject);
     50            if (\in_array($value->objectNumber, $ensuredObjectsList, true)) {
     51                throw new PdfParserException(
     52                    \sprintf('Indirect reference recursion detected (%s).', $value->objectNumber)
     53                );
     54            }
     55            $ensuredObjectsList[] = $value->objectNumber;
     56            return self::resolve($value->value, $parser, $stopAtIndirectObject, $ensuredObjectsList);
    4657        }
    4758
  • billy/trunk/vendor-prefixed/setasign/fpdi/src/PdfReader/PdfReader.php

    r3251553 r3355121  
    140140
    141141        if ($page instanceof PdfIndirectObjectReference) {
    142             $readPages = function ($kids) use (&$readPages) {
     142            $alreadyReadKids = [];
     143            $readPages = function ($kids) use (&$readPages, &$alreadyReadKids) {
    143144                $kids = PdfArray::ensure($kids);
    144145
     
    146147                foreach ($kids->value as $reference) {
    147148                    $reference = PdfIndirectObjectReference::ensure($reference);
     149
     150                    if (\in_array($reference->value, $alreadyReadKids, true)) {
     151                        throw new PdfReaderException('Recursive pages dictionary detected.');
     152                    }
     153                    $alreadyReadKids[] = $reference->value;
     154
    148155                    $object = $this->parser->getIndirectObject($reference->value);
    149156                    $type = PdfDictionary::get($object->value, 'Type');
     
    169176                $kids = PdfType::resolve(PdfDictionary::get($dict, 'Kids'), $this->parser);
    170177                try {
     178                    $alreadyReadKids[] = $page->objectNumber;
    171179                    $page = $this->pages[$pageNumber - 1] = $readPages($kids);
    172180                } catch (PdfReaderException $e) {
     
    204212
    205213        $expectedPageCount = $this->getPageCount();
    206         $readPages = function ($kids, $count) use (&$readPages, $readAll, $expectedPageCount) {
     214        $alreadyReadKids = [];
     215        $readPages = function ($kids, $count) use (&$readPages, &$alreadyReadKids, $readAll, $expectedPageCount) {
    207216            $kids = PdfArray::ensure($kids);
    208217            $isLeaf = ($count->value === \count($kids->value));
     
    215224                    continue;
    216225                }
     226
     227                if (\in_array($reference->value, $alreadyReadKids, true)) {
     228                    throw new PdfReaderException('Recursive pages dictionary detected.');
     229                }
     230                $alreadyReadKids[] = $reference->value;
    217231
    218232                $object = $this->parser->getIndirectObject($reference->value);
  • billy/trunk/vendor-prefixed/setasign/fpdi/src/Tcpdf/Fpdi.php

    r3251553 r3355121  
    4747     * @string
    4848     */
    49     const VERSION = '2.6.3';
     49    const VERSION = '2.6.4';
    5050
    5151    /**
  • billy/trunk/vendor-prefixed/setasign/fpdi/src/Tfpdf/Fpdi.php

    r3251553 r3355121  
    2929     * @string
    3030     */
    31     const VERSION = '2.6.3';
     31    const VERSION = '2.6.4';
    3232}
Note: See TracChangeset for help on using the changeset viewer.