PageSourceSearch

https://foodfinder.mx/chunk-WO237N3M.js

js foodfinder.mx collected 2026-10-02 16:15:23 UTC 6,133 bytes, 8 lines download raw bytes

1import{a as O}from"./chunk-3YJEOFPK.js";import{b as R,c as j,p as k}from"./chunk-Q5B3BLJC.js";import"./chunk-RJSAQQJR.js";import"./chunk-DJY7TLQR.js";import"./chunk-DCQ6K7MS.js";import"./chunk-6XIRPTFG.js";import"./chunk-CDN6YX5H.js";import"./chunk-HJ4QCVAO.js";import"./chunk-D3F2YJ7V.js";import"./chunk-TBB5A4RC.js";import"./chunk-2AGFAF2T.js";import"./chunk-7RHLFJDC.js";import{s as F}from"./chunk-QLVBULEA.js";import"./chunk-2VMYDSIC.js";import"./chunk-DNIVSGA6.js";import{a as L}from"./chunk-DMKEOHTA.js";import{h as D,k as z}from"./chunk-YCP52F36.js";import"./chunk-FHDYJKXC.js";import{$b as w,Ab as v,Ja as l,Ka as i,Kb as P,La as t,Ma as S,Ta as T,Va as p,Xa as f,_b as I,fb as n,ha as s,hb as c,ic as E,jc as M,mc as B,pa as d,r as y,s as _,ua as C,yb as b,za as h}from"./chunk-DBXDUEE4.js";import"./chunk-TAAAIZHL.js";import{e as A}from"./chunk-EQDQRRRY.js";var x=A(L());function H(o,g){o&1&&(i(0,"div",10),n(1," No hay mesas listas para facturar "),t())}function N(o,g){if(o&1){let e=T();i(0,"tr",18)(1,"td",19)(2,"span",20),n(3," \u{1F37D} "),t(),n(4),t(),i(5,"td",21),n(6),t(),i(7,"td",21),n(8),b(9,"date"),t(),i(10,"td",22),n(11),b(12,"number"),t(),i(13,"td",23)(14,"button",24),p("click",function(){let a=y(e).$implicit,m=f(2);return _(m.facturarMesa(a.tableId))}),n(15," Facturar \u2192 "),t()()()}if(o&2){let e=g.$implicit;s(4),c(" Mesa ",e.tableId," "),s(2),c(" ",e.ordersCount," "),s(2),c(" ",v(9,4,e.closedAt,"dd/MM/yyyy HH:mm")," "),s(3),c(" $",v(12,7,e.totalAmount,"1.2-2")," ")}}function $(o,g){if(o&1&&(i(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),n(5," Mesa "),t(),i(6,"th",14),n(7," \xD3rdenes "),t(),i(8,"th",14),n(9," Cerrada "),t(),i(10,"th",15),n(11," Total "),t(),i(12,"th",16),n(13," Acci\xF3n "),t()()(),i(14,"tbody"),h(15,N,16,10,"tr",17),t()()()),o&2){let e=f();s(15),l("ngForOf",e.tables)}}var ee=(()=>{class o{invoiceService;router;cdr;allTables=[];tables=[];isLoading=!1;currentPage=0;itemsPerPage=10;pageSizeOptions=[10,20,50,100];get totalTables(){return this.allTables.length}constructor(e,r,a){this.invoiceService=e,this.router=r,this.cdr=a}ngOnInit(){this.loadTables()}loadTables(){this.isLoading=!0,this.invoiceService.getTablesReadyToInvoice().subscribe({next:e=>{this.allTables=e.data||[],this.currentPage=0,this.updatePagination(),this.isLoading=!1,this.cdr.detectChanges()},error:()=>{this.isLoading=!1,this.allTables=[],this.tables=[],this.cdr.detectChanges()}})}updatePagination(){let e=this.currentPage*this.itemsPerPage;this.tables=this.allTables.slice(e,e+this.itemsPerPage)}goToPage(e){this.currentPage=e,this.updatePagination(),this.cdr.detectChanges()}onPageSizeChange(e){this.itemsPerPage=e,this.currentPage=0,this.updatePagination(),this.cdr.detectChanges()}goToInvoice(e){this.router.navigate(["/invoicecreate",e])}goToBuyInvoices(){x.default.fire({title:"Comprar timbres fiscales",html:`
2      <select id="invoiceQty" class="swal2-select">
3        <option value="100">100 timbres</option>
4        <option value="200">200 timbres</option>
5        <option value="500">500 timbres</option>
6        <option value="1000">1000 timbres</option>
7      </select>
8    `,confirmButtonText:"Continuar con PayPal",showCancelButton:!0,confirmButtonColor:"#16a34a",preConfirm:()=>{let e=document.getElementById("invoiceQty").value;return Number(e)}}).then(e=>{e.isConfirmed&&this.invoiceService.buyInvoices(e.value).subscribe(r=>{window.location.href=r.approvalUrl})})}facturarMesa(e){x.default.fire({title:`Facturar mesa ${e}`,text:"Se generar\xE1 una factura con todas las \xF3rdenes de la mesa",icon:"question",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",confirmButtonColor:"#16a34a"}).then(r=>{r.isConfirmed&&this.router.navigate(["/invoice-create-table",e])})}static \u0275fac=function(r){return new(r||o)(d(O),d(D),d(P))};static \u0275cmp=C({type:o,selectors:[["app-invoice-tables"]],decls:13,vars:6,consts:[[1,"px-6","py-8","max-w-7xl","mx-auto","space-y-6"],[1,"flex","items-center","justify-between"],[1,"text-2xl","font-semibold","text-gray-800"],[1,"text-sm","text-gray-500"],[1,"flex","items-center","justify-center"],[1,"bg-green-600","hover:bg-green-500","text-white","px-2","py-1","rounded-md",3,"click"],["src","/icons/carrito.png","alt","Comprar timbres",1,"w-8","h-8"],["class","bg-white rounded-xl shadow p-6 text-center text-gray-500",4,"ngIf"],["class","bg-white rounded-xl shadow overflow-hidden",4,"ngIf"],[3,"pageChange","pageSizeChange","total","currentPage","pageSize","pageSizeOptions"],[1,"bg-white","rounded-xl","shadow","p-6","text-center","text-gray-500"],[1,"bg-white","rounded-xl","shadow","overflow-hidden"],[1,"min-w-full","text-sm"],[1,"bg-gray-50","border-b"],[1,"px-4","py-3","text-left","font-semibold","text-gray-700"],[1,"px-4","py-3","text-right","font-semibold","text-gray-700"],[1,"px-4","py-3","text-center","font-semibold","text-gray-700"],["class","border-b hover:bg-gray-50 transition",4,"ngFor","ngForOf"],[1,"border-b","hover:bg-gray-50","transition"],[1,"px-4","py-3","font-semibold","text-gray-800","flex","items-center","gap-2"],[1,"inline-flex","items-center","justify-center","w-8","h-8","rounded-full","bg-green-100","text-green-700","font-bold"],[1,"px-4","py-3"],[1,"px-4","py-3","text-right","font-semibold"],[1,"px-4","py-3","text-center"],[1,"text-green-600","hover:text-green-800","font-semibold","text-sm",3,"click"]],template:function(r,a){r&1&&(i(0,"div",0)(1,"div",1)(2,"div")(3,"h1",2),n(4," Mesas listas para facturar "),t(),i(5,"p",3),n(6," Mesas cerradas del mes actual "),t()(),i(7,"div",4)(8,"button",5),p("click",function(){return a.goToBuyInvoices()}),S(9,"img",6),t()()(),h(10,H,2,0,"div",7)(11,$,16,1,"div",8),i(12,"app-paginator",9),p("pageChange",function(u){return a.goToPage(u)})("pageSizeChange",function(u){return a.onPageSizeChange(u)}),t()()),r&2&&(s(10),l("ngIf",!a.tables.length&&!a.isLoading),s(),l("ngIf",a.tables.length),s(),l("total",a.totalTables)("currentPage",a.currentPage)("pageSize",a.itemsPerPage)("pageSizeOptions",a.pageSizeOptions))},dependencies:[j,B,I,w,F,R,k,z,E,M],encapsulation:2})}return o}
8)();export{ee as InvoiceTablesComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.