new style and fixed request
This commit is contained in:
@@ -14,10 +14,10 @@ interface CostOption {
|
||||
|
||||
interface ImpressionsProps {
|
||||
costs: CostOption[];
|
||||
numAccount: number | null;
|
||||
numAcount: number | null;
|
||||
}
|
||||
|
||||
function Impressions({ costs, numAccount }: ImpressionsProps) {
|
||||
function Impressions({ costs, numAcount }: ImpressionsProps) {
|
||||
const [pages, setPages] = useState("");
|
||||
const [cost, setCost] = useState("");
|
||||
|
||||
@@ -33,7 +33,7 @@ function Impressions({ costs, numAccount }: ImpressionsProps) {
|
||||
const handlePayment = async () => {
|
||||
setError("");
|
||||
|
||||
if (!numAccount) {
|
||||
if (!numAcount) {
|
||||
setError("Error busca denuevo al estudiante");
|
||||
return;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ function Impressions({ costs, numAccount }: ImpressionsProps) {
|
||||
}
|
||||
|
||||
const result = await PostImpressions({
|
||||
id_cuenta:numAccount,
|
||||
id_cuenta:numAcount,
|
||||
numero_hojas : parseInt(pages),
|
||||
monto: parseInt(cost) * parseInt(pages),
|
||||
});
|
||||
|
||||
@@ -7,10 +7,10 @@ import Cookies from "js-cookie";
|
||||
import "./Receipt.css";
|
||||
|
||||
interface ReceiptsProps {
|
||||
numAccount: number | null;
|
||||
numAcount: number | null;
|
||||
}
|
||||
|
||||
function Receipt({ numAccount }: ReceiptsProps) {
|
||||
function Receipt({ numAcount }: ReceiptsProps) {
|
||||
const [folio, setFolio] = useState("");
|
||||
const [amount, setAmount] = useState("");
|
||||
const [date, setDate] = useState("");
|
||||
@@ -29,7 +29,7 @@ function Receipt({ numAccount }: ReceiptsProps) {
|
||||
//restrict this month//
|
||||
|
||||
const handleSaveReceipt = () => {
|
||||
if (!numAccount) {
|
||||
if (!numAcount) {
|
||||
setError("Error busca denuevo al estudiante");
|
||||
return;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ function Receipt({ numAccount }: ReceiptsProps) {
|
||||
}
|
||||
|
||||
PostReceipt({
|
||||
id_cuenta: numAccount,
|
||||
id_cuenta: numAcount,
|
||||
folio_recibo: folio,
|
||||
monto: Number(amount),
|
||||
fecha_recibo: date,
|
||||
|
||||
@@ -8,14 +8,14 @@ interface urlProp{
|
||||
}
|
||||
|
||||
function SearchUser(url:urlProp) {
|
||||
const [numAccount, setNumAccount] = useState("");
|
||||
const [numAcount, setnumAcount] = useState("");
|
||||
const router = useRouter();
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (numAccount) {
|
||||
router.push(`/${url.urlBase}?numAccount=${numAccount}`);
|
||||
if (numAcount) {
|
||||
router.push(`/${url.urlBase}?numAcount=${numAcount}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,11 +27,11 @@ function SearchUser(url:urlProp) {
|
||||
<div className="groupInput">
|
||||
<input
|
||||
type="text"
|
||||
value={numAccount}
|
||||
value={numAcount}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (/^\d*$/.test(value) && value.length <= 9) {
|
||||
setNumAccount(value);
|
||||
setnumAcount(value);
|
||||
}
|
||||
}}
|
||||
placeholder="Coloca un número de cuenta..."
|
||||
|
||||
Reference in New Issue
Block a user