Changeset 3355121
- Timestamp:
- 09/03/2025 07:10:39 AM (7 months ago)
- Location:
- billy/trunk
- Files:
-
- 2 added
- 26 edited
-
billy.php (modified) (2 diffs)
-
blocks/build/index.asset.php (modified) (1 diff)
-
blocks/build/index.js (modified) (1 diff)
-
blocks/node_modules (WP6.5-) (added)
-
blocks/node_modules (WP6.6+) (added)
-
inc/class-billy.php (modified) (2 diffs)
-
inc/class-pdfexport.php (modified) (1 diff)
-
languages/billy.pot (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
-
vendor-prefixed/mpdf/mpdf/src/Config/ConfigVariables.php (modified) (1 diff)
-
vendor-prefixed/mpdf/mpdf/src/Config/FontVariables.php (modified) (1 diff)
-
vendor-prefixed/mpdf/mpdf/src/Image/ImageProcessor.php (modified) (10 diffs)
-
vendor-prefixed/mpdf/mpdf/src/Image/Svg.php (modified) (1 diff)
-
vendor-prefixed/mpdf/mpdf/src/Mpdf.php (modified) (3 diffs)
-
vendor-prefixed/mpdf/mpdf/src/Writer/MetadataWriter.php (modified) (6 diffs)
-
vendor-prefixed/myclabs/deep-copy/src/DeepCopy/DeepCopy.php (modified) (2 diffs)
-
vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php (modified) (1 diff)
-
vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php (modified) (1 diff)
-
vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php (modified) (1 diff)
-
vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php (modified) (1 diff)
-
vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php (modified) (1 diff)
-
vendor-prefixed/setasign/fpdi/src/Fpdi.php (modified) (1 diff)
-
vendor-prefixed/setasign/fpdi/src/PdfParser/CrossReference/AbstractReader.php (modified) (2 diffs)
-
vendor-prefixed/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php (modified) (1 diff)
-
vendor-prefixed/setasign/fpdi/src/PdfParser/Type/PdfType.php (modified) (2 diffs)
-
vendor-prefixed/setasign/fpdi/src/PdfReader/PdfReader.php (modified) (5 diffs)
-
vendor-prefixed/setasign/fpdi/src/Tcpdf/Fpdi.php (modified) (1 diff)
-
vendor-prefixed/setasign/fpdi/src/Tfpdf/Fpdi.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
billy/trunk/billy.php
r3266011 r3355121 4 4 * Plugin URI: https://wordpress.org/plugins/billy 5 5 * Description: A business-oriented billing suite powered by WordPress. 6 * Version: 1.11. 06 * Version: 1.11.1 7 7 * Author: them.es 8 8 * Author URI: https://them.es/plugins/billy … … 164 164 * 165 165 * @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. 168 168 */ 169 169 function 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 409 409 $post_type = get_post_type(); 410 410 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>'; 439 439 } 440 440 … … 446 446 */ 447 447 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; 468 470 } 469 471 } -
billy/trunk/inc/class-pdfexport.php
r3266011 r3355121 189 189 foreach ( $blocks as $block ) { 190 190 // 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 ) ) { 192 192 $content .= render_block( $block ); 193 193 } 194 194 } 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. 195 226 196 227 // Remove line breaks from content. -
billy/trunk/languages/billy.pot
r3266011 r3355121 1 1 # Copyright (C) 2025 them.es 2 2 # This file is distributed under the GPL-2.0+. 3 #, fuzzy4 3 msgid "" 5 4 msgstr "" 6 "Project-Id-Version: Billy 1.1 0.5\n"5 "Project-Id-Version: Billy 1.11.0\n" 7 6 "Report-Msgid-Bugs-To: https://github.com/them-es/billy/issues\n" 8 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 11 10 "Content-Type: text/plain; charset=UTF-8\n" 12 11 "Content-Transfer-Encoding: 8bit\n" 13 "POT-Creation-Date: 2025-0 3-20 14:13+0000\n"12 "POT-Creation-Date: 2025-04-03T05:00:10+00:00\n" 14 13 "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" 16 15 "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 19 msgid "Billy" 20 msgstr "" 21 22 #. Plugin URI of the plugin 23 #: billy.php 24 msgid "https://wordpress.org/plugins/billy" 25 msgstr "" 26 27 #. Description of the plugin 28 #: billy.php 29 msgid "A business-oriented billing suite powered by WordPress." 30 msgstr "" 31 32 #. Author of the plugin 33 #: billy.php 34 msgid "them.es" 35 msgstr "" 36 37 #. Author URI of the plugin 38 #: billy.php 39 msgid "https://them.es/plugins/billy" 40 msgstr "" 41 42 #: billy.php:36 43 msgid "<strong>Warning!</strong> %1$s requires PHP %2$s (or higher) to function properly. Please upgrade your PHP version." 44 msgstr "" 45 46 #: billy.php:47 47 msgid "<strong>Warning!</strong> You are currently using an outdated WordPress version which is not compatible with %s. Please update WordPress to the latest version." 48 msgstr "" 49 50 #: billy.php:58 51 msgid "<strong>Warning!</strong> %s is not compatible with the Classic Editor. Please deactivate the Classic Editor Plugin." 52 msgstr "" 53 54 #: billy.php:69 55 msgid "The temp directory %s is not writable. Please change the read/write permissions." 56 msgstr "" 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 118 msgid "%1$s %2$s" 119 msgstr "" 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 134 msgid "Invoice" 135 msgstr "" 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 149 msgid "Quote" 150 msgstr "" 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 159 msgid "Accounting" 160 msgstr "" 161 162 #: inc/class-billy.php:281 163 msgid "Contact" 164 msgstr "" 165 166 #: inc/class-billy.php:282 167 msgid "To do" 168 msgstr "" 169 170 #: inc/class-billy.php:283 171 msgid "Timetracking" 172 msgstr "" 173 174 #: inc/class-billy.php:285 175 msgid "PDF Content" 176 msgstr "" 177 178 #: inc/class-billy.php:286 179 msgid "PDF Footer" 180 msgstr "" 181 182 #: inc/class-billy.php:291 183 msgid "✅ %s" 184 msgstr "" 185 186 #: inc/class-billy.php:298 187 msgid "Locale" 188 msgstr "" 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 194 msgid "Currency" 195 msgstr "" 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 208 msgid "Taxes" 209 msgstr "" 210 211 #: inc/class-billy.php:311 212 msgid "Current invoice" 213 msgstr "" 214 215 #: inc/class-billy.php:316 216 msgid "Current quote" 217 msgstr "" 218 219 #: inc/class-billy.php:320 220 msgid "Problems have been solved!" 221 msgstr "" 222 223 #: inc/class-billy.php:322 224 msgid "Edit" 225 msgstr "" 226 227 #: inc/class-billy.php:327 228 msgid "Customized templates" 229 msgstr "" 230 231 #: inc/class-billy.php:343 232 msgid "Thank you for purchasing %s!" 233 msgstr "" 234 235 #: inc/class-billy.php:343 236 msgid "Get the <u>Pro</u> version" 237 msgstr "" 238 239 #: inc/class-billy.php:343 240 msgid "Premium add-on with a project management suite, WooCommerce integration, Contacts, Address Book, QR code payments, Stats & Charts, Share links, and more." 241 msgstr "" 242 243 #: inc/class-billy.php:343 244 msgid "Please rate this Plugin" 245 msgstr "" 246 247 #: inc/class-billy.php:390 248 msgid "Download %s" 249 msgstr "" 250 251 #: inc/class-billy.php:390 252 msgid "PDF" 253 msgstr "" 254 255 #: inc/class-billy.php:394 256 msgid "Export %s" 257 msgstr "" 258 259 #: inc/class-billy.php:394 260 msgid "TSV" 261 msgstr "" 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 22 277 msgid "#" 23 278 msgstr "" 24 279 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 294 msgid "Description" 295 msgstr "" 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 308 msgid "Amount" 309 msgstr "" 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 322 msgid "Subtotal" 323 msgstr "" 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 344 msgid "Total" 345 msgstr "" 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 369 msgid "Tax" 370 msgstr "" 371 372 #: inc/class-billy.php:555 373 msgid "Pending" 374 msgstr "" 375 376 #: inc/class-billy.php:692 377 #: inc/class-billy.php:761 33 378 msgid "%1$s%2$03s" 34 379 msgstr "" 35 380 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 383 msgid "%s Header" 384 msgstr "" 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 392 msgid "Name" 393 msgstr "" 394 395 #: inc/class-billy.php:1164 396 #: inc/class-billy.php:1335 397 msgid "Company" 398 msgstr "" 399 400 #: inc/class-billy.php:1164 401 #: inc/class-billy.php:1335 402 msgid "Address Field %s" 403 msgstr "" 404 405 #: inc/class-billy.php:1164 406 #: inc/class-billy.php:1335 407 msgid "Country" 408 msgstr "" 409 410 #: inc/class-billy.php:1193 411 msgid "Billing Period" 412 msgstr "" 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 423 msgid "Reference" 424 msgstr "" 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 38 432 #: inc/class-billy.php:1484 39 #, php-format40 433 msgid "%s (optional)" 41 434 msgstr "" 42 435 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 438 msgid "Subject" 439 msgstr "" 440 441 #: inc/class-billy.php:1226 442 #: inc/class-billy.php:1384 443 msgid "Intro text" 444 msgstr "" 445 446 #: inc/class-billy.php:1226 447 #: inc/class-billy.php:1384 448 msgid "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." 449 msgstr "" 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 457 msgid "Information" 458 msgstr "" 459 460 #: inc/class-billy.php:1258 461 #: inc/class-billy.php:1414 462 #: inc/class-billy.php:1484 463 msgid "Notes" 464 msgstr "" 465 466 #: inc/class-billy.php:1282 467 msgid "Invoices" 468 msgstr "" 469 470 #: inc/class-billy.php:1438 471 msgid "Quotes" 472 msgstr "" 473 474 #: inc/class-billy.php:1471 475 msgid "Heading" 476 msgstr "" 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 496 msgid "Earnings" 497 msgstr "" 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 517 msgid "Expenses" 518 msgstr "" 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 524 msgid "Address" 525 msgstr "" 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 531 msgid "VAT" 532 msgstr "" 533 534 #: inc/class-billy.php:1655 535 msgid "Plugin Setup" 536 msgstr "" 537 538 #: inc/class-billy.php:1665 539 msgid "General" 540 msgstr "" 541 542 #: inc/class-billy.php:1740 543 #: inc/class-billy.php:1758 544 msgid "Geocoding powered by %s" 545 msgstr "" 546 547 #: inc/class-billy.php:1757 548 msgid "Address (geocoded)" 549 msgstr "" 550 551 #: inc/class-billy.php:1779 552 msgid "Email" 553 msgstr "" 554 555 #: inc/class-billy.php:1780 556 msgid "Enter your email" 557 msgstr "" 558 559 #: inc/class-billy.php:1800 560 msgid "Phone" 561 msgstr "" 562 563 #: inc/class-billy.php:1801 564 msgid "Enter your phone number" 565 msgstr "" 566 567 #: inc/class-billy.php:1818 568 msgid "Enter your VAT identification number or Taxpayer ID" 569 msgstr "" 570 571 #: inc/class-billy.php:1835 572 msgid "Currency Code" 573 msgstr "" 574 575 #: inc/class-billy.php:1836 576 #: inc/class-billy.php:1858 577 msgid "Caution: Any changes made here may affect existing entries. Create a backup first!" 578 msgstr "" 579 580 #: inc/class-billy.php:1853 581 msgid "Tax Rates" 582 msgstr "" 583 584 #: inc/class-billy.php:1855 585 msgid "Enter the taxrates separated by newline: e.g. %s" 586 msgstr "" 587 588 #: inc/class-billy.php:1874 589 msgid "Current invoice number" 590 msgstr "" 591 592 #: inc/class-billy.php:1875 593 msgid "Upcoming invoice numbers will be autoincremented based on this value!" 594 msgstr "" 595 596 #: inc/class-billy.php:1903 597 #: blocks/build/index.js:1 598 #: blocks/src/invoice/invoice-number/index.js:45 599 msgid "Invoice number: Prefix" 600 msgstr "" 601 602 #: inc/class-billy.php:1904 603 #: inc/class-billy.php:2028 604 msgid "You can include placeholders like {YEAR}, {MONTH} and {DAY}." 605 msgstr "" 606 607 #: inc/class-billy.php:1920 608 msgid "Payment due within # days" 609 msgstr "" 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 615 msgid "Payment Information" 86 616 msgstr "" 87 617 … … 90 620 msgstr "" 91 621 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 623 msgid "Thank you for your business!" 624 msgstr "" 625 626 #: inc/class-billy.php:1961 627 #: blocks/build/index.js:1 628 #: blocks/src/quote/information/index.js:45 629 msgid "Quote Information" 630 msgstr "" 631 632 #: inc/class-billy.php:1962 633 msgid "Inform your contacts about special terms, quote expiration clauses, etc." 634 msgstr "" 635 636 #: inc/class-billy.php:1968 637 msgid "We will be happy to answer any questions you may have!" 638 msgstr "" 639 640 #: inc/class-billy.php:1982 641 msgid "Current quote number" 642 msgstr "" 643 644 #: inc/class-billy.php:1983 645 msgid "Upcoming quote numbers will be autoincremented based on this value!" 646 msgstr "" 647 648 #: inc/class-billy.php:2010 649 msgid "Just use the current date (\"Ymd\") as quote number" 650 msgstr "" 651 652 #: inc/class-billy.php:2027 653 msgid "Quote number: Prefix" 654 msgstr "" 655 656 #: inc/class-billy.php:2044 657 msgid "Quote valid for # days" 658 msgstr "" 659 660 #: inc/class-billy.php:2085 661 msgid "Geocode was not successful - please provide a valid address: %s" 662 msgstr "" 663 664 #: inc/class-billy.php:2106 665 msgid "Please provide a valid currency format" 666 msgstr "" 667 668 #: inc/class-billy.php:2132 669 msgid "Please separate the taxrates by newline and don't forget to append the \"%\" sign to each value." 115 670 msgstr "" 116 671 … … 119 674 msgstr "" 120 675 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 684 msgid "<div class=\"label\">%1$s</div> <div class=\"text\">%2$s</div>" 685 msgstr "" 686 687 #: inc/class-blocks.php:255 688 msgid "<strong>%1$s</strong> %2$s" 689 msgstr "" 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 701 msgid "N/A" 702 msgstr "" 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 715 msgid "Date" 716 msgstr "" 717 718 #: inc/class-blocks.php:291 719 #: inc/class-blocks.php:313 149 720 msgid "Current %s" 150 msgstr ""151 152 #: inc/class-billy.php:311153 msgid "Current invoice"154 msgstr ""155 156 #: inc/class-billy.php:1874157 msgid "Current invoice number"158 msgstr ""159 160 #: inc/class-billy.php:316161 msgid "Current quote"162 msgstr ""163 164 #: inc/class-billy.php:1982165 msgid "Current quote number"166 msgstr ""167 168 #: inc/class-billy.php:327169 msgid "Customized templates"170 msgstr ""171 172 #: inc/class-blocks.php:268173 msgid "Date"174 msgstr ""175 176 #: inc/class-billy.php:423 inc/class-pdfexport.php:223177 msgid "Description"178 msgstr ""179 180 #: inc/class-billy.php:390181 #, php-format182 msgid "Download %s"183 msgstr ""184 185 #: inc/class-pdfexport.php:168186 msgid "DRAFT"187 721 msgstr "" 188 722 … … 191 725 msgstr "" 192 726 193 #: inc/class-billy.php:1567194 msgid "Earnings"195 msgstr ""196 197 #: inc/class-billy.php:322198 msgid "Edit"199 msgstr ""200 201 #: inc/class-billy.php:1779202 msgid "Email"203 msgstr ""204 205 #: inc/class-billy.php:1855206 #, php-format207 msgid "Enter the taxrates separated by newline: e.g. %s"208 msgstr ""209 210 #: inc/class-billy.php:1780211 msgid "Enter your email"212 msgstr ""213 214 #: inc/class-billy.php:1801215 msgid "Enter your phone number"216 msgstr ""217 218 #: inc/class-billy.php:1818219 msgid "Enter your VAT identification number or Taxpayer ID"220 msgstr ""221 222 #: inc/class-billy.php:1568223 msgid "Expenses"224 msgstr ""225 226 #: inc/class-billy.php:394227 #, php-format228 msgid "Export %s"229 msgstr ""230 231 #: inc/class-billy.php:1665232 msgid "General"233 msgstr ""234 235 #: inc/class-billy.php:2085236 #, php-format237 msgid "Geocode was not successful - please provide a valid address: %s"238 msgstr ""239 240 #: inc/class-billy.php:1740 inc/class-billy.php:1758241 #, php-format242 msgid "Geocoding powered by %s"243 msgstr ""244 245 #: inc/class-billy.php:343246 msgid "Get the <u>Pro</u> version"247 msgstr ""248 249 #: inc/class-billy.php:1471250 msgid "Heading"251 msgstr ""252 253 #. Author URI of the plugin254 msgid "https://them.es/plugins/billy"255 msgstr ""256 257 #. URI of the plugin258 msgid "https://wordpress.org/plugins/billy"259 msgstr ""260 261 #: inc/class-billy.php:1962262 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:1406267 #: inc/class-billy.php:1407268 msgid "Information"269 msgstr ""270 271 #: inc/class-billy.php:1226 inc/class-billy.php:1384272 msgid "Intro text"273 msgstr ""274 275 #: inc/class-billy.php:277 inc/class-billy.php:1283 inc/class-billy.php:1683276 #: inc/class-blocks.php:291277 msgid "Invoice"278 msgstr ""279 280 #: inc/class-billy.php:1903281 msgid "Invoice number: Prefix"282 msgstr ""283 284 #: inc/class-billy.php:1282285 msgid "Invoices"286 msgstr ""287 288 #: inc/class-billy.php:2010289 msgid "Just use the current date (\"Ymd\") as quote number"290 msgstr ""291 292 #: inc/class-billy.php:298293 msgid "Locale"294 msgstr ""295 296 #: inc/class-billy.php:1226 inc/class-billy.php:1384297 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:255305 msgid "N/A"306 msgstr ""307 308 #: inc/class-billy.php:1164 inc/class-billy.php:1335 inc/class-billy.php:1583309 #: inc/class-billy.php:1703310 msgid "Name"311 msgstr ""312 313 #: inc/class-billy.php:1258 inc/class-billy.php:1414 inc/class-billy.php:1484314 msgid "Notes"315 msgstr ""316 317 #: inc/class-billy.php:1920318 msgid "Payment due within # days"319 msgstr ""320 321 #: inc/class-billy.php:1940322 msgid "Payment Information"323 msgstr ""324 325 #: inc/class-billy.php:390326 msgid "PDF"327 msgstr ""328 329 #: inc/class-billy.php:285330 msgid "PDF Content"331 msgstr ""332 333 #: inc/class-billy.php:286334 msgid "PDF Footer"335 msgstr ""336 337 #: inc/class-billy.php:555338 msgid "Pending"339 msgstr ""340 341 #: inc/class-billy.php:1800342 msgid "Phone"343 msgstr ""344 345 #: inc/class-billy.php:2106346 msgid "Please provide a valid currency format"347 msgstr ""348 349 #: inc/class-billy.php:343350 msgid "Please rate this Plugin"351 msgstr ""352 353 #: inc/class-billy.php:2132354 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:1655360 msgid "Plugin Setup"361 msgstr ""362 363 #: inc/class-billy.php:343364 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:320371 msgid "Problems have been solved!"372 msgstr ""373 374 #: inc/class-billy.php:278 inc/class-billy.php:1439 inc/class-billy.php:1674375 #: inc/class-blocks.php:313376 msgid "Quote"377 msgstr ""378 379 #: inc/class-billy.php:1961380 msgid "Quote Information"381 msgstr ""382 383 #: inc/class-billy.php:2027384 msgid "Quote number: Prefix"385 msgstr ""386 387 #: inc/class-billy.php:2044388 msgid "Quote valid for # days"389 msgstr ""390 391 #: inc/class-billy.php:1438392 msgid "Quotes"393 msgstr ""394 395 #: inc/class-billy.php:1201 inc/class-billy.php:1359396 msgid "Reference"397 msgstr ""398 399 #: inc/class-billy.php:1220 inc/class-billy.php:1378400 msgid "Subject"401 msgstr ""402 403 #: inc/class-billy.php:425 inc/class-pdfexport.php:225404 msgid "Subtotal"405 msgstr ""406 407 #: inc/class-billy.php:427 inc/class-pdfexport.php:227408 msgid "Tax"409 msgstr ""410 411 #: inc/class-billy.php:1853412 msgid "Tax Rates"413 msgstr ""414 415 #: inc/class-billy.php:306416 msgid "Taxes"417 msgstr ""418 419 #: inc/class-billy.php:343420 #, php-format421 msgid "Thank you for purchasing %s!"422 msgstr ""423 424 #: inc/class-billy.php:1947425 msgid "Thank you for your business!"426 msgstr ""427 428 #: billy.php:69429 #, php-format430 msgid ""431 "The temp directory %s is not writable. Please change the read/write "432 "permissions."433 msgstr ""434 435 #. Author of the plugin436 msgid "them.es"437 msgstr ""438 439 #: inc/class-billy.php:283440 msgid "Timetracking"441 msgstr ""442 443 #: inc/class-billy.php:282444 msgid "To do"445 msgstr ""446 447 #: inc/class-billy.php:426 inc/class-pdfexport.php:226448 msgid "Total"449 msgstr ""450 451 #: inc/class-billy.php:394452 msgid "TSV"453 msgstr ""454 455 #: inc/class-billy.php:1875456 msgid "Upcoming invoice numbers will be autoincremented based on this value!"457 msgstr ""458 459 #: inc/class-billy.php:1983460 msgid "Upcoming quote numbers will be autoincremented based on this value!"461 msgstr ""462 463 727 #: inc/class-blocks.php:335 728 #: blocks/build/index.js:1 729 #: blocks/src/quote/validuntildate/index.js:21 464 730 msgid "Valid Until" 465 msgstr ""466 467 #: inc/class-billy.php:1585 inc/class-billy.php:1817468 msgid "VAT"469 msgstr ""470 471 #: inc/class-billy.php:1968472 msgid "We will be happy to answer any questions you may have!"473 731 msgstr "" 474 732 … … 477 735 msgstr "" 478 736 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 738 msgid "DRAFT" 739 msgstr "" 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 745 msgid "Header" 746 msgstr "" 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 755 msgid "Info" 756 msgstr "" 757 758 #: blocks/build/index.js:1 759 #: blocks/src/_deprecated/header/index.js:46 760 msgid "Edit the %s layout" 761 msgstr "" 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 769 msgid "The %s values can be modified in the Theme Customizer." 770 msgstr "" 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 794 msgid "%1$s: %2$s" 795 msgstr "" 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 804 msgid "Actions" 805 msgstr "" 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 811 msgid "Last modified" 812 msgstr "" 813 814 #: blocks/build/index.js:1 815 #: blocks/src/invoice/meta/index.js:21 816 #: blocks/src/quote/meta/index.js:21 817 msgid "Meta" 818 msgstr "" 819 820 #: blocks/build/index.js:1 821 #: blocks/src/invoice/meta/index.js:64 822 #: blocks/src/quote/meta/index.js:64 823 msgid "Label" 824 msgstr "" 825 826 #: blocks/build/index.js:1 827 #: blocks/src/invoice/meta/index.js:72 828 #: blocks/src/quote/meta/index.js:72 829 msgid "Text" 830 msgstr "" 831 832 #: blocks/build/index.js:1 833 #: blocks/src/invoice/meta/index.js:188 834 #: blocks/src/quote/meta/index.js:186 835 msgid "<strong>%1$s</strong> <span>%2$s</span>" 836 msgstr "" 837 838 #: blocks/build/index.js:1 839 #: blocks/src/invoice/date/index.js:41 840 #: blocks/src/invoice/invoice-number/index.js:52 841 msgid "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!" 842 msgstr "" 843 844 #: blocks/build/index.js:1 845 #: blocks/src/invoice/duedate/index.js:21 846 msgid "Due Date" 847 msgstr "" 848 849 #: blocks/build/index.js:1 850 #: blocks/src/invoice/duedate/index.js:45 851 msgid "Payment due days" 852 msgstr "" 853 854 #: blocks/build/index.js:1 855 #: blocks/src/invoice/invoice-number/index.js:21 856 msgid "Number" 857 msgstr "" 858 859 #: blocks/build/index.js:1 860 #: blocks/src/invoice/invoice-number/index.js:56 861 #: blocks/src/settings/panel/index.js:25 862 msgid "Invoice number" 863 msgstr "" 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 876 msgid "%1$s %2$s %3$s" 877 msgstr "" 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 883 msgid "Table" 884 msgstr "" 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 890 msgid "Update Totals" 891 msgstr "" 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 897 msgid "Table Row" 898 msgstr "" 899 900 #: blocks/build/index.js:1 901 #: blocks/src/invoice/table/index.js:547 902 #: blocks/src/quote/table/index.js:546 903 msgid "Quantity/Rate Calculator" 904 msgstr "" 905 906 #: blocks/build/index.js:1 907 #: blocks/src/invoice/table/index.js:550 908 #: blocks/src/quote/table/index.js:549 909 msgid "Quantity" 910 msgstr "" 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 924 msgid "0" 925 msgstr "" 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 937 msgid "%1$s in %2$s" 938 msgstr "" 939 940 #: blocks/build/index.js:1 941 #: blocks/src/invoice/table/index.js:560 942 #: blocks/src/quote/table/index.js:559 943 msgid "Rate" 944 msgstr "" 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 952 msgid "%1$s / %2$s" 953 msgstr "" 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 962 msgid "Profit" 963 msgstr "" 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 971 msgid "%1$s (%2$s / %3$s)" 972 msgstr "" 973 974 #: blocks/build/index.js:1 975 #: blocks/src/accounting/table/deprecatedOuter.js:682 976 #: blocks/src/accounting/table/index.js:681 977 msgid "Earning" 978 msgstr "" 979 980 #: blocks/build/index.js:1 981 #: blocks/src/accounting/table/deprecatedOuter.js:689 982 #: blocks/src/accounting/table/index.js:694 983 msgid "Expense" 984 msgstr "" 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 996 msgid "Q%s" 997 msgstr "" 998 999 #: blocks/build/index.js:1 1000 #: blocks/src/accounting/table/index.js:238 1001 #: blocks/src/accounting/table/index.js:253 1002 msgid "Taxes (%s)" 1003 msgstr "" 1004 1005 #: blocks/build/index.js:1 1006 #: blocks/src/accounting/table/index.js:613 1007 msgid "Reference: %s" 1008 msgstr "" 1009 1010 #: blocks/build/index.js:1 1011 #: blocks/src/accounting/table/index.js:617 1012 msgid "Post" 1013 msgstr "" 1014 1015 #: blocks/build/index.js:1 1016 #: blocks/src/settings/panel/index.js:11 1017 msgid "Billy Setup" 1018 msgstr "" 1019 1020 #: blocks/build/index.js:1 1021 #: blocks/src/settings/panel/index.js:21 1022 msgid "Settings (Theme Customizer)" 1023 msgstr "" 1024 1025 #: blocks/build/index.js:1 1026 #: blocks/src/settings/panel/index.js:28 1027 msgid "Quote number" 1028 msgstr "" 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 1033 msgid "Theme Mod" 1034 msgstr "" 1035 1036 #: blocks/build/index.js:1 1037 #: blocks/src/settings/theme-mod/index.js:50 1038 msgid "Setting" 1039 msgstr "" 1040 1041 #: blocks/build/index.js:1 1042 #: blocks/src/settings/theme-mod/index.js:51 1043 msgid "Modify the value in the Theme Customizer." 1044 msgstr "" -
billy/trunk/readme.txt
r3266011 r3355121 5 5 Requires at least: 6.0 6 6 Tested up to: 6.8 7 Stable tag: 1.11. 07 Stable tag: 1.11.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 151 151 == Changelog == 152 152 153 = 1.11.1 = 154 * Re-implement workaround to improve formatting of line spacing in PDF content 155 * Update dependencies 156 153 157 = 1.11.0 = 154 158 * 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 153 153 // Overrides warnings making changes when possible to force PDFA1-b compliance 154 154 'PDFAauto' => false, 155 'PDFAversion' => '1-B', 155 156 156 157 // Colour profile OutputIntent -
billy/trunk/vendor-prefixed/mpdf/mpdf/src/Config/FontVariables.php
r3251553 r3355121 199 199 ], 200 200 "eeyekunicode" => [/* Meetei Mayek */ 201 'R' => "Eeyek .ttf",201 'R' => "Eeyek-Regular.ttf", 202 202 ], 203 203 "lannaalif" => [/* Tai Tham */ -
billy/trunk/vendor-prefixed/mpdf/mpdf/src/Image/ImageProcessor.php
r3251553 r3355121 471 471 } 472 472 473 imagedestroy($im);473 $this->destroyImage($im); 474 474 } 475 475 return $info; … … 655 655 } 656 656 657 imagedestroy($im);657 $this->destroyImage($im); 658 658 unlink($tempfile); 659 659 … … 892 892 $h = imagesy($im); 893 893 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'); 895 895 896 896 // Alpha channel set (including using tRNS for Paletted images) … … 991 991 } 992 992 993 imagedestroy($imgalpha);993 $this->destroyImage($imgalpha); 994 994 // extract image without alpha channel 995 995 $imgplain = imagecreatetruecolor($w, $h); … … 1003 1003 } 1004 1004 1005 imagedestroy($imgplain);1005 $this->destroyImage($imgplain); 1006 1006 1007 1007 // embed mask image … … 1090 1090 } 1091 1091 1092 imagedestroy($im);1092 $this->destroyImage($im); 1093 1093 // $info = $this->getImage($tempfile, false); 1094 1094 $data = file_get_contents($tempfile); … … 1249 1249 @imagejpeg($im, $tempfile); 1250 1250 $data = file_get_contents($tempfile); 1251 imagedestroy($im);1251 $this->destroyImage($im); 1252 1252 unlink($tempfile); 1253 1253 unlink($checkfile); … … 1313 1313 } 1314 1314 1315 imagedestroy($im);1315 $this->destroyImage($im); 1316 1316 unlink($tempfile); 1317 1317 … … 1461 1461 $info = $this->processPng($data, $tempfile, false, $interpolation); 1462 1462 1463 imagedestroy($im);1463 $this->destroyImage($im); 1464 1464 unlink($tempfile); 1465 1465 … … 1479 1479 } 1480 1480 1481 private function destroyImage($im) 1482 { 1483 if (PHP_VERSION_ID < 80000) { 1484 imagedestroy($im); 1485 } 1486 } 1487 1481 1488 } -
billy/trunk/vendor-prefixed/mpdf/mpdf/src/Image/Svg.php
r3251553 r3355121 1480 1480 for ($i = 0; $i < count($d); $i += 2) { 1481 1481 1482 if ($d[$i] === ' none') {1482 if ($d[$i] === '' || $d[$i] === 'none') { 1483 1483 continue; 1484 1484 } 1485 1485 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); 1487 1487 } 1488 1488 -
billy/trunk/vendor-prefixed/mpdf/mpdf/src/Mpdf.php
r3251553 r3355121 33 33 use MpdfPsrLogAwareTrait; 34 34 35 const VERSION = '8.2. 5';35 const VERSION = '8.2.6'; 36 36 37 37 const SCALE = 72 / 25.4; … … 77 77 78 78 var $PDFA; 79 var $PDFAversion = '1-B';79 var $PDFAversion; 80 80 var $PDFAauto; 81 81 var $ICCProfile; … … 3913 3913 } // mPDF 6 3914 3914 3915 $glyphIDtoUni = null; 3915 3916 if (empty($font['name']) || $font['originalsize'] != $ttfstat['size'] || $regenerate) { 3916 3917 $generator = new MetricsGenerator($this->fontCache, $this->fontDescriptor); -
billy/trunk/vendor-prefixed/mpdf/mpdf/src/Writer/MetadataWriter.php
r3251553 r3355121 63 63 $m .= ' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' . "\n"; 64 64 $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"; 66 66 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"; 68 68 } 69 69 $m .= ' </rdf:Description>' . "\n"; … … 74 74 $m .= ' <xmp:MetadataDate>' . $CreationDate . '</xmp:MetadataDate>' . "\n"; 75 75 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"; 77 77 } 78 78 $m .= ' </rdf:Description>' . "\n"; … … 84 84 $m .= ' <dc:title> 85 85 <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> 87 87 </rdf:Alt> 88 88 </dc:title>' . "\n"; … … 91 91 $m .= ' <dc:subject> 92 92 <rdf:Bag> 93 <rdf:li>' . $this->mpdf->keywords. '</rdf:li>93 <rdf:li>' . htmlspecialchars($this->mpdf->keywords, ENT_QUOTES | ENT_XML1) . '</rdf:li> 94 94 </rdf:Bag> 95 95 </dc:subject>' . "\n"; … … 98 98 $m .= ' <dc:description> 99 99 <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> 101 101 </rdf:Alt> 102 102 </dc:description>' . "\n"; … … 105 105 $m .= ' <dc:creator> 106 106 <rdf:Seq> 107 <rdf:li>' . $this->mpdf->author. '</rdf:li>107 <rdf:li>' . htmlspecialchars($this->mpdf->author, ENT_QUOTES | ENT_XML1) . '</rdf:li> 108 108 </rdf:Seq> 109 109 </dc:creator>' . "\n"; -
billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/DeepCopy.php
r3251553 r3355121 88 88 * Deep copies the given object. 89 89 * 90 * @param mixed $object 91 * 92 * @return mixed 90 * @template TObject 91 * 92 * @param TObject $object 93 * 94 * @return TObject 93 95 */ 94 96 public function copy($object) … … 266 268 } 267 269 268 $property->setAccessible(true); 270 if (PHP_VERSION_ID < 80100) { 271 $property->setAccessible(true); 272 } 269 273 270 274 // Ignore uninitialized properties (for PHP >7.4) -
billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php
r3251553 r3355121 20 20 $reflectionProperty = ReflectionHelper::getProperty($object, $property); 21 21 22 $reflectionProperty->setAccessible(true); 22 if (PHP_VERSION_ID < 80100) { 23 $reflectionProperty->setAccessible(true); 24 } 23 25 $oldCollection = $reflectionProperty->getValue($object); 24 26 -
billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php
r3251553 r3355121 22 22 { 23 23 $reflectionProperty = ReflectionHelper::getProperty($object, $property); 24 $reflectionProperty->setAccessible(true); 24 if (PHP_VERSION_ID < 80100) { 25 $reflectionProperty->setAccessible(true); 26 } 25 27 26 28 $reflectionProperty->setValue($object, new ArrayCollection()); -
billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php
r3251553 r3355121 31 31 { 32 32 $reflectionProperty = ReflectionHelper::getProperty($object, $property); 33 $reflectionProperty->setAccessible(true); 33 if (PHP_VERSION_ID < 80100) { 34 $reflectionProperty->setAccessible(true); 35 } 34 36 35 37 $value = call_user_func($this->callback, $reflectionProperty->getValue($object)); -
billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php
r3251553 r3355121 19 19 $reflectionProperty = ReflectionHelper::getProperty($object, $property); 20 20 21 $reflectionProperty->setAccessible(true); 21 if (PHP_VERSION_ID < 80100) { 22 $reflectionProperty->setAccessible(true); 23 } 22 24 $reflectionProperty->setValue($object, null); 23 25 } -
billy/trunk/vendor-prefixed/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php
r3251553 r3355121 40 40 } 41 41 42 $reflectionProperty->setAccessible(true); 42 if (PHP_VERSION_ID < 80100) { 43 $reflectionProperty->setAccessible(true); 44 } 43 45 44 46 // Uninitialized properties (for PHP >7.4) -
billy/trunk/vendor-prefixed/setasign/fpdi/src/Fpdi.php
r3251553 r3355121 31 31 * @string 32 32 */ 33 const VERSION = '2.6. 3';33 const VERSION = '2.6.4'; 34 34 } -
billy/trunk/vendor-prefixed/setasign/fpdi/src/PdfParser/CrossReference/AbstractReader.php
r3251553 r3355121 36 36 * @param PdfParser $parser 37 37 * @throws CrossReferenceException 38 * @throws PdfTypeException39 38 */ 40 39 public function __construct(PdfParser $parser) … … 58 57 * 59 58 * @throws CrossReferenceException 60 * @throws PdfTypeException61 59 */ 62 60 protected function readTrailer() -
billy/trunk/vendor-prefixed/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php
r3251553 r3355121 72 72 $this->reader->ensure($position, 20); 73 73 $line = $this->reader->readBytes(20); 74 if ($line [17] === 'f') {74 if ($line === false || $line[17] === 'f') { 75 75 return false; 76 76 } -
billy/trunk/vendor-prefixed/setasign/fpdi/src/PdfParser/Type/PdfType.php
r3251553 r3355121 28 28 * @param PdfParser $parser 29 29 * @param bool $stopAtIndirectObject 30 * @param array $ensuredObjectsList A list of all ensured indirect objects to prevent recursion 30 31 * @return PdfType 31 32 * @throws CrossReferenceException 32 33 * @throws PdfParserException 33 34 */ 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 36 45 if ($value instanceof PdfIndirectObject) { 37 46 if ($stopAtIndirectObject === true) { … … 39 48 } 40 49 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); 46 57 } 47 58 -
billy/trunk/vendor-prefixed/setasign/fpdi/src/PdfReader/PdfReader.php
r3251553 r3355121 140 140 141 141 if ($page instanceof PdfIndirectObjectReference) { 142 $readPages = function ($kids) use (&$readPages) { 142 $alreadyReadKids = []; 143 $readPages = function ($kids) use (&$readPages, &$alreadyReadKids) { 143 144 $kids = PdfArray::ensure($kids); 144 145 … … 146 147 foreach ($kids->value as $reference) { 147 148 $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 148 155 $object = $this->parser->getIndirectObject($reference->value); 149 156 $type = PdfDictionary::get($object->value, 'Type'); … … 169 176 $kids = PdfType::resolve(PdfDictionary::get($dict, 'Kids'), $this->parser); 170 177 try { 178 $alreadyReadKids[] = $page->objectNumber; 171 179 $page = $this->pages[$pageNumber - 1] = $readPages($kids); 172 180 } catch (PdfReaderException $e) { … … 204 212 205 213 $expectedPageCount = $this->getPageCount(); 206 $readPages = function ($kids, $count) use (&$readPages, $readAll, $expectedPageCount) { 214 $alreadyReadKids = []; 215 $readPages = function ($kids, $count) use (&$readPages, &$alreadyReadKids, $readAll, $expectedPageCount) { 207 216 $kids = PdfArray::ensure($kids); 208 217 $isLeaf = ($count->value === \count($kids->value)); … … 215 224 continue; 216 225 } 226 227 if (\in_array($reference->value, $alreadyReadKids, true)) { 228 throw new PdfReaderException('Recursive pages dictionary detected.'); 229 } 230 $alreadyReadKids[] = $reference->value; 217 231 218 232 $object = $this->parser->getIndirectObject($reference->value); -
billy/trunk/vendor-prefixed/setasign/fpdi/src/Tcpdf/Fpdi.php
r3251553 r3355121 47 47 * @string 48 48 */ 49 const VERSION = '2.6. 3';49 const VERSION = '2.6.4'; 50 50 51 51 /** -
billy/trunk/vendor-prefixed/setasign/fpdi/src/Tfpdf/Fpdi.php
r3251553 r3355121 29 29 * @string 30 30 */ 31 const VERSION = '2.6. 3';31 const VERSION = '2.6.4'; 32 32 }
Note: See TracChangeset
for help on using the changeset viewer.