fix: actualizar nombre del negocio y eliminar referencia a días de vigencia en cotizaciones y tickets
This commit is contained in:
parent
71ac03309d
commit
a5411a6318
@ -11,11 +11,10 @@ const quoteService = {
|
|||||||
*/
|
*/
|
||||||
getBusinessInfo() {
|
getBusinessInfo() {
|
||||||
return {
|
return {
|
||||||
name: import.meta.env.VITE_APP_NAME || 'GOLSCONTROL',
|
name: import.meta.env.VITE_APP_NAME || 'HIKVISION DISTRIBUIDOR',
|
||||||
city: import.meta.env.VITE_BUSINESS_CITY || 'Villahermosa',
|
city: import.meta.env.VITE_BUSINESS_CITY || 'Villahermosa',
|
||||||
state: import.meta.env.VITE_BUSINESS_STATE || 'Tabasco',
|
state: import.meta.env.VITE_BUSINESS_STATE || 'Tabasco',
|
||||||
country: import.meta.env.VITE_BUSINESS_COUNTRY || 'México',
|
country: import.meta.env.VITE_BUSINESS_COUNTRY || 'México',
|
||||||
phone: import.meta.env.VITE_BUSINESS_PHONE || 'Tel: (52) 0000-0000'
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -35,21 +34,17 @@ const quoteService = {
|
|||||||
* @param {Object} totals - { subtotal, tax, total }
|
* @param {Object} totals - { subtotal, tax, total }
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
* @param {string} options.businessName - Nombre del negocio (fallback a env)
|
* @param {string} options.businessName - Nombre del negocio (fallback a env)
|
||||||
* @param {number} options.validDays - Días de vigencia (default 30)
|
|
||||||
* @param {boolean} options.autoDownload - Descargar PDF automáticamente (default true)
|
* @param {boolean} options.autoDownload - Descargar PDF automáticamente (default true)
|
||||||
*/
|
*/
|
||||||
async generate(cartItems, totals, options = {}) {
|
async generate(cartItems, totals, options = {}) {
|
||||||
const business = this.getBusinessInfo();
|
const business = this.getBusinessInfo();
|
||||||
const {
|
const {
|
||||||
businessName = business.name,
|
businessName = business.name,
|
||||||
validDays = 30,
|
|
||||||
autoDownload = true
|
autoDownload = true
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
const folio = this.generateFolio();
|
const folio = this.generateFolio();
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const expiry = new Date(now);
|
|
||||||
expiry.setDate(expiry.getDate() + validDays);
|
|
||||||
|
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'portrait',
|
orientation: 'portrait',
|
||||||
@ -203,7 +198,6 @@ const quoteService = {
|
|||||||
doc.setTextColor(...LIGHT_GRAY);
|
doc.setTextColor(...LIGHT_GRAY);
|
||||||
doc.text('Esta cotización no constituye una venta.', center, y, { align: 'center' });
|
doc.text('Esta cotización no constituye una venta.', center, y, { align: 'center' });
|
||||||
y += 3;
|
y += 3;
|
||||||
doc.text(`Precios válidos por ${validDays} días a partir de la fecha de emisión.`, center, y, { align: 'center' });
|
|
||||||
|
|
||||||
if (autoDownload) {
|
if (autoDownload) {
|
||||||
doc.save(`${folio}.pdf`);
|
doc.save(`${folio}.pdf`);
|
||||||
|
|||||||
@ -17,7 +17,6 @@ const ticketService = {
|
|||||||
city: import.meta.env.VITE_BUSINESS_CITY || 'Villahermosa',
|
city: import.meta.env.VITE_BUSINESS_CITY || 'Villahermosa',
|
||||||
state: import.meta.env.VITE_BUSINESS_STATE || 'Tabasco',
|
state: import.meta.env.VITE_BUSINESS_STATE || 'Tabasco',
|
||||||
country: import.meta.env.VITE_BUSINESS_COUNTRY || 'México',
|
country: import.meta.env.VITE_BUSINESS_COUNTRY || 'México',
|
||||||
phone: import.meta.env.VITE_BUSINESS_PHONE || 'Tel: (52) 0000-0000'
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -161,7 +160,7 @@ const ticketService = {
|
|||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit'
|
minute: '2-digit'
|
||||||
});
|
});
|
||||||
doc.text(`Hora: ${formattedTime} p.m.`, leftMargin, yPosition);
|
doc.text(`Hora: ${formattedTime}`, leftMargin, yPosition);
|
||||||
yPosition += 4;
|
yPosition += 4;
|
||||||
|
|
||||||
// Cajero
|
// Cajero
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user