diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..03c3358 --- /dev/null +++ b/.env.development @@ -0,0 +1,2 @@ +REACT_APP_ENVIRONMENT=development +REACT_APP_API=https://localhost:5001/api \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..2c5da53 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +REACT_APP_ENVIRONMENT=production +REACT_APP_API=https://www.gemcousa.mx/GEMCOBackend/api diff --git a/.env.qa b/.env.qa new file mode 100644 index 0000000..fbba01d --- /dev/null +++ b/.env.qa @@ -0,0 +1,2 @@ +REACT_APP_ENVIRONMENT=qa +REACT_APP_API=https://www.gemcousa.solutions/GEMCOBackend/api \ No newline at end of file diff --git a/package.json b/package.json index 3a861a9..7bd717d 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "bootstrap": "^5.1.3", "btoa": "^1.2.1", "custom-item-select": "^1.2.3", + "env-cmd": "^10.1.0", "file-saver": "^2.0.5", "formik": "^2.2.9", "jwt-decode": "^3.1.2", @@ -59,8 +60,11 @@ "yup": "^0.32.11" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", + "start-dev": "env-cmd -f .env.development react-scripts start", + "start-qa": "env-cmd -f .env.qa react-scripts start", + "start-prod": "env-cmd -f .env.production react-scripts start", + "build-qa": "env-cmd -f .env.qa react-scripts build", + "build-prod": "env-cmd -f .env.production react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, diff --git a/src/Components/Clientes/Amazon/DTO/DTO2096RptPayedOperations.ts b/src/Components/Clientes/Amazon/DTO/DTO2096RptPayedOperations.ts new file mode 100644 index 0000000..61f08be --- /dev/null +++ b/src/Components/Clientes/Amazon/DTO/DTO2096RptPayedOperations.ts @@ -0,0 +1,25 @@ +export default interface DTO2096RptPayedOperations { + id: number + referencia: string + commercialInvoiceDate: string + invoiceNumber: string + name: string + trailerNumber: string + trailerId: string + porOfLoading: string + portOfEntry: string + paymentsTerms: string + incoterms: string + hawb: string + totalInvoiceQuantityUnitOfMeasure: string + totalInvoiceQuantity: number + totalInvoiceWeightUnitOfMeasure: string + totalInvoiceWeight: string + totalInvoiceValueChargeOrAllowance: string + totalInvoiceValueCurrencyISOCode: string + totalInvoiceValueMonetaryAmount: string, + fPago: string, + patente: string, + aduana: string, + pedimento: string +} \ No newline at end of file diff --git a/src/Components/Clientes/Amazon/Reportes/Payed/RptAmazonPayedOperations.tsx b/src/Components/Clientes/Amazon/Reportes/Payed/RptAmazonPayedOperations.tsx index 58e24a3..37d2ff3 100644 --- a/src/Components/Clientes/Amazon/Reportes/Payed/RptAmazonPayedOperations.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Payed/RptAmazonPayedOperations.tsx @@ -27,6 +27,7 @@ import { BsChevronDown, BsChevronRight, BsFilePdfFill } from 'react-icons/bs' import { FaAmazon } from 'react-icons/fa' import loadingImg from '../../../../../images/ajaxloader.gif' import { MFileManager } from '../../../../Utils/MFileManager/MFileManager' +import DTO2096RptPayedOperations from '../../DTO/DTO2096RptPayedOperations' export interface IRptAmazonPayedOpereationsProps {} @@ -39,6 +40,9 @@ export default function RptAmazonPayedOpereations( ) const [header, setHeader] = useState('') const [Referencia, setReferencia] = useState('') + const [Inicio, setInicio] = useState(currentDate()) + const [Fin, setFin] = useState(currentDate()) + const [Data, setData] = useState([]) const [show, setShowMsg] = useState(false) const [ShowModal, setShowModal] = useState(false) const [WaitingDialog, setWaitingDialog] = useState(false) @@ -50,11 +54,21 @@ export default function RptAmazonPayedOpereations( const [Invoices, setInvoices] = useState([]) const msgColor = 'primary' + function currentDate(): string { + var today = new Date() + var dd = String(today.getDate()).padStart(2, '0') + var mm = String(today.getMonth() + 1).padStart(2, '0') //January is 0! + var yyyy = today.getFullYear() + return yyyy + '-' + mm + '-' + dd + } + const loadReport = () => { - DSAmazon.AmazonPayedOperationsGET() + DSAmazon.AmazonPayedOperationsGET(Inicio, Fin) .then((response) => { - dispatch(initializeInvoice([])) - dispatch(populateInvoices(response.data)) + console.log(response.data) + setData(response.data) + /* dispatch(initializeInvoice([])) + dispatch(populateInvoices(response.data)) */ }) .catch((e: Error) => { alert('Ocurrio un error' + e.message.toString()) @@ -129,7 +143,6 @@ export default function RptAmazonPayedOpereations( } const downloadNoPartes = (id: number, Factura: string) => { - // setWaitingDialog(true) DSAmazon.NoPartesAmazon2SIRGET(id) .then((response: any) => { if (response.status === 200) { @@ -170,8 +183,35 @@ export default function RptAmazonPayedOpereations( Operaciones Pagadas - + Desde + + setInicio(e.target.value)} + size="sm" + /> + + Hasta + + setFin(e.target.value)} + size="sm" + /> + + {loadReport()}}> @@ -200,21 +240,20 @@ export default function RptAmazonPayedOpereations( Tot Charge or allowance Tot currency ISO code Tot Monetary amount - Total de partidas + Fecha pago + Patente + Aduana + Pedimento - {mInvoices - ? mInvoices.map((MasterData) => { + {Data + ? Data.map((MasterData) => { return ( <> {MasterData.totalInvoiceValueMonetaryAmount} - - {mInvoices - .filter((value) => value.id === MasterData.id) - .map((row) => { - return row.detail.length - })} + + {MasterData.fPago.substring(0,10)} + + + {MasterData.patente} + + + {MasterData.aduana} + + + {MasterData.pedimento} diff --git a/src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx b/src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx index 840b926..477b1c8 100644 --- a/src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx +++ b/src/Components/Clientes/Amazon/Reportes/Traffic/Pending/RtpAmazonPendingTraficInvoice.tsx @@ -90,6 +90,13 @@ export default function RptAmazonPendingTraficInvoice( }) } + function getReceiver(Cadena: string, char1: string[1], char2: string[1]) { + return Cadena.slice( + Cadena.indexOf(char1) + 1, + Cadena.lastIndexOf(char2), + ); + } + return (
@@ -123,7 +130,7 @@ export default function RptAmazonPendingTraficInvoice( Commercial Invoice Date Invoice Number - Name + Receiver Incoterms Qty Unit of measure Tot Qty @@ -195,8 +202,12 @@ export default function RptAmazonPendingTraficInvoice( {MasterData.invoiceNumber} - - {MasterData.name} + + {mInvoices + .filter((value) => value.id === MasterData.id) + .map((row) => { + return getReceiver(row.detail[0].amazonShipmentReferenceId,'_','_') + })} {MasterData.incoterms} diff --git a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts index 0c33efb..2feddc5 100644 --- a/src/Components/Clientes/Amazon/Services/Amazon.Services.ts +++ b/src/Components/Clientes/Amazon/Services/Amazon.Services.ts @@ -16,6 +16,7 @@ import DTO2096NoParte from '../DTO/DTO2096NoParte' import I2096NoParteLog from '../Interfaces/I2096NoParteLog' import DTO2096TraficoFieldsUpdate from '../DTO/DTO2096TraficoFieldsUpdate' import DTO2096RELParteFactura from '../DTO/DTO2096RELParteFactura' +import DTO2096RptPayedOperations from '../DTO/DTO2096RptPayedOperations' class AmazonDataService { AmazonPendingClasificationInvoiceGET() { @@ -67,8 +68,8 @@ class AmazonDataService { } - AmazonPayedOperationsGET() { - return http.get(`/AmazonInvoice/AmazonPayedOperationsGET`) + AmazonPayedOperationsGET(Inicio: string, Fin: string) { + return http.get(`/AmazonInvoice/AmazonPayedOperationsGET?Inicio=${Inicio}&Fin=${Fin}`) } RELParteFacturasGET(id: number) { diff --git a/src/Constants/TargetURL.ts b/src/Constants/TargetURL.ts index 8157f3c..7765ec9 100644 --- a/src/Constants/TargetURL.ts +++ b/src/Constants/TargetURL.ts @@ -1,10 +1,11 @@ export class TargetURL { get() { - return !process.env.NODE_ENV || process.env.NODE_ENV === 'development' - ? //'https://gemcousa.solutions/GEMCOBackend/api' + /* return !process.env.NODE_ENV || process.env.NODE_ENV === 'development' + ? 'https://gemcousa.solutions/GEMCOBackend/api' 'https://localhost:5001/api' - : //: "http://reportes.gemcousa.com:5000/api"; - // 'https://www.gemcousa.mx/GEMCOBackend/api' - 'https://gemcousa.solutions/GEMCOBackend/api' + : "http://reportes.gemcousa.com:5000/api"; + 'https://www.gemcousa.mx/GEMCOBackend/api' + 'https://gemcousa.solutions/GEMCOBackend/api' */ + return process.env.REACT_APP_API } } diff --git a/src/css/development-home.css b/src/css/development-home.css new file mode 100644 index 0000000..666aac8 --- /dev/null +++ b/src/css/development-home.css @@ -0,0 +1,60 @@ +/*** FONDO PARA SITIO WEB ***/ +body { + background-image: linear-gradient(to right, #F7FFF1, #EFFFE2, #EFFFE2, white, white, white, #EFFFE2, #EFFFE2, #F7FFF1); +} + +/*** COLOR DE TEXTO PARA ETIQUETAS EN FORMS, ENCABEZADOS DE FORMS Y BOTON DE ACCORDIONS ***/ +#login-box h3, .navbar-nav a.dropdown-item:hover, .form-group .label, .form-group label { + color: #0a58ca !important; +} + +/*** DISEÑO PARA FORM DEL LOGIN ***/ +#login-box { + margin: 0 auto; + border-radius: 15px !important; + border: none; +} + +/*** ACOMODO SUPERIOR PARA LOS DIV.CONTAINER'S EN SITIO WEB ***/ +div.App > div.container { + margin-top: 30px !important; +} + +/*** ESTILOS PARA LA BARRA DEL MENU ***/ +.custom-theme { + background-image: linear-gradient(to bottom, #4a9d06,#5cb90f,#7fda35) !important; + color: white; +} +.navbar-brand, .navbar-nav .dropdown-toggle.nav-link, .navbar-collapse .btn-outline-success, #basic-navbar-nav a.nav-link, .navbar-toggler-icon { + color: white; +} + +/* .dropdown-toggle2 { + color: black !important; + background-color: #c8ced3 !important; +} */ +#secondlevel { + color: black !important; + padding: 0.25rem 1rem; + /* background-color: #c8ced3 !important; */ +} + +/* #secondlevel a:link { color: #000000 !important; } +#secondlevel a:visited { color: #000000 !important; } +#secondlevel a:hover { color: #000000 !important; } +#secondlevel a:active { color: #000000 !important; } */ + +/*** ESTILO DE LETRA PARA ELEMENTOS DE ACCORDION ***/ +.accordion-button.collapsed { + background-image: linear-gradient(to bottom, #c7c7c7, #c7c7c7, #e9e9e9, #f3f3f3) !important; +} +.accordion-button:not(.collapsed) { + background-image: linear-gradient(to bottom, #8fcafd, #bedaff, #e5eefb); + font-size: 13pt; +} + +@media all and (min-width: 480px) { + #login-box { + border: 3px outset #ddd !important; + } +} \ No newline at end of file diff --git a/src/css/home.css b/src/css/home.css index e6c8df8..1dcbefa 100644 --- a/src/css/home.css +++ b/src/css/home.css @@ -1,6 +1,6 @@ /*** FONDO PARA SITIO WEB ***/ body { - background-image: linear-gradient(to right, rgb(215,215,215), rgb(245,245,245), rgb(245,245,245), white, white, white, rgb(245,245,245), rgb(245,245,245), rgb(215,215,215)) !important; + background-image: linear-gradient(to right, rgb(215,215,215), rgb(245,245,245), rgb(245,245,245), white, white, white, rgb(245,245,245), rgb(245,245,245), rgb(215,215,215)); } /*** COLOR DE TEXTO PARA ETIQUETAS EN FORMS, ENCABEZADOS DE FORMS Y BOTON DE ACCORDIONS ***/ diff --git a/src/css/production-home.css b/src/css/production-home.css new file mode 100644 index 0000000..1dcbefa --- /dev/null +++ b/src/css/production-home.css @@ -0,0 +1,60 @@ +/*** FONDO PARA SITIO WEB ***/ +body { + background-image: linear-gradient(to right, rgb(215,215,215), rgb(245,245,245), rgb(245,245,245), white, white, white, rgb(245,245,245), rgb(245,245,245), rgb(215,215,215)); +} + +/*** COLOR DE TEXTO PARA ETIQUETAS EN FORMS, ENCABEZADOS DE FORMS Y BOTON DE ACCORDIONS ***/ +#login-box h3, .navbar-nav a.dropdown-item:hover, .form-group .label, .form-group label { + color: #0a58ca !important; +} + +/*** DISEÑO PARA FORM DEL LOGIN ***/ +#login-box { + margin: 0 auto; + border-radius: 15px !important; + border: none; +} + +/*** ACOMODO SUPERIOR PARA LOS DIV.CONTAINER'S EN SITIO WEB ***/ +div.App > div.container { + margin-top: 30px !important; +} + +/*** ESTILOS PARA LA BARRA DEL MENU ***/ +.custom-theme { + background-image: linear-gradient(to bottom, rgb(0, 75, 187),rgb(0, 113, 219),rgb(64, 150, 248)) !important; + color: white; +} +.navbar-brand, .navbar-nav .dropdown-toggle.nav-link, .navbar-collapse .btn-outline-success, #basic-navbar-nav a.nav-link, .navbar-toggler-icon { + color: white; +} + +/* .dropdown-toggle2 { + color: black !important; + background-color: #c8ced3 !important; +} */ +#secondlevel { + color: black !important; + padding: 0.25rem 1rem; + /* background-color: #c8ced3 !important; */ +} + +/* #secondlevel a:link { color: #000000 !important; } +#secondlevel a:visited { color: #000000 !important; } +#secondlevel a:hover { color: #000000 !important; } +#secondlevel a:active { color: #000000 !important; } */ + +/*** ESTILO DE LETRA PARA ELEMENTOS DE ACCORDION ***/ +.accordion-button.collapsed { + background-image: linear-gradient(to bottom, #c7c7c7, #c7c7c7, #e9e9e9, #f3f3f3) !important; +} +.accordion-button:not(.collapsed) { + background-image: linear-gradient(to bottom, #8fcafd, #bedaff, #e5eefb); + font-size: 13pt; +} + +@media all and (min-width: 480px) { + #login-box { + border: 3px outset #ddd !important; + } +} \ No newline at end of file diff --git a/src/css/qa-home.css b/src/css/qa-home.css new file mode 100644 index 0000000..2312969 --- /dev/null +++ b/src/css/qa-home.css @@ -0,0 +1,60 @@ +/*** FONDO PARA SITIO WEB ***/ +body { + background-image: url("../images/QA.png"), linear-gradient(to right, #FFFEE2, #FFFED5, #FFFED5, white, white, white, #FFFED5, #FFFED5, #FFFEE2); +} + +/*** COLOR DE TEXTO PARA ETIQUETAS EN FORMS, ENCABEZADOS DE FORMS Y BOTON DE ACCORDIONS ***/ +#login-box h3, .navbar-nav a.dropdown-item:hover, .form-group .label, .form-group label { + color: #0a58ca !important; +} + +/*** DISEÑO PARA FORM DEL LOGIN ***/ +#login-box { + margin: 0 auto; + border-radius: 15px !important; + border: none; +} + +/*** ACOMODO SUPERIOR PARA LOS DIV.CONTAINER'S EN SITIO WEB ***/ +div.App > div.container { + margin-top: 30px !important; +} + +/*** ESTILOS PARA LA BARRA DEL MENU ***/ +.custom-theme { + background-image: linear-gradient(to bottom, #da6907,#cf7d34,#f0a35f) !important; + color: white; +} +.navbar-brand, .navbar-nav .dropdown-toggle.nav-link, .navbar-collapse .btn-outline-success, #basic-navbar-nav a.nav-link, .navbar-toggler-icon { + color: white; +} + +/* .dropdown-toggle2 { + color: black !important; + background-color: #c8ced3 !important; +} */ +#secondlevel { + color: black !important; + padding: 0.25rem 1rem; + /* background-color: #c8ced3 !important; */ +} + +/* #secondlevel a:link { color: #000000 !important; } +#secondlevel a:visited { color: #000000 !important; } +#secondlevel a:hover { color: #000000 !important; } +#secondlevel a:active { color: #000000 !important; } */ + +/*** ESTILO DE LETRA PARA ELEMENTOS DE ACCORDION ***/ +.accordion-button.collapsed { + background-image: linear-gradient(to bottom, #c7c7c7, #c7c7c7, #e9e9e9, #f3f3f3) !important; +} +.accordion-button:not(.collapsed) { + background-image: linear-gradient(to bottom, #8fcafd, #bedaff, #e5eefb); + font-size: 13pt; +} + +@media all and (min-width: 480px) { + #login-box { + border: 3px outset #ddd !important; + } +} \ No newline at end of file diff --git a/src/images/QA.png b/src/images/QA.png new file mode 100644 index 0000000..418fdd1 Binary files /dev/null and b/src/images/QA.png differ diff --git a/src/index.tsx b/src/index.tsx index 88ea9f6..fbb0395 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,7 @@ -import React from 'react' +import React, { useEffect } from 'react' import ReactDOM from 'react-dom' -import './css/home.css' +/* import './css/home.css' */ +/* require (`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`) */ import 'bootstrap/dist/css/bootstrap.min.css' import App from './App' import reportWebVitals from './reportWebVitals' @@ -49,6 +50,7 @@ import RptOperaciones from './Components/Reportes/RptOperaciones' import RptRelacionMission from './Components/GEMCO/Facturacion/Anexo/RptRelacionMission' import RptRelacionAlen from './Components/GEMCO/Facturacion/Anexo/RptRelacionAlen' import RptCasaCuervoCOVEs from './Components/Clientes/CasaCuervo/Reportes/RptCasaCuervoCOVEs' +require (`./css/${process.env.REACT_APP_ENVIRONMENT}-home.css`) function PageNotFound() { return ( diff --git a/yarn.lock b/yarn.lock index ae2eb5a..11f3e2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4176,6 +4176,11 @@ commander@^2.20.0: resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== + commander@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" @@ -5066,6 +5071,14 @@ entities@^2.0.0: resolved "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== +env-cmd@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/env-cmd/-/env-cmd-10.1.0.tgz#c7f5d3b550c9519f137fdac4dd8fb6866a8c8c4b" + integrity sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA== + dependencies: + commander "^4.0.0" + cross-spawn "^7.0.0" + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz"