Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
Gestión de inventario en la hoja de google.

Inventario de existencias de hojas de Google

Hola a todos,

Me dirijo a usted porque no puedo hacer que mi código funcione en Google Sheets. El objetivo del programa es poder seguir la evolución del stock de las distintas referencias cotizadas. Para ello, tan pronto como se realice un cambio, se debe almacenar la fecha y el estado del stock en una casilla adicional (de ahí las referencias solas en la parte inferior de la hoja). Por el momento, el código hace esto: cuando ingresa 1 o -2, por ejemplo, en la columna "+/-", el stock y el consumo se actualizan, luego la columna "+/-" se restablece a cero. El código está comentado para que puedas entender mi enfoque. Gracias a cualquiera que pueda ayudarme, estoy luchando mucho para hacer el programa.

 function onEdit(){ if(SpreadsheetApp.getActiveRange().getColumn()==4){ ///things only happen if the "+/-" column is changed for (var i in 2,403){ var cellTest = SpreadsheetApp.getActive().range.getCell(i,4); /// we retrieve each box of the "+/-" column if( cellTest != 0){ //// we test if it change var k =408+i; /// hint for date display lines var l = 2; //// index for date display columns var cellDate = SpreadsheetApp.getActive().range.getCell(k,l); while (isEmpty(cellDate)==false){ ///the goal is to put the new date next to the previous one l=l+1; } const cellDateDef = SpreadsheetApp.getActive(); cellDateDef.getRange(k,l).setValue(Date) /// on affiche la date du changement de stock const cellStock = SpreadsheetApp.range.getCell(i,5); SpreadsheetApp.range.getCell(k+1,5) = cellStock; ///in the box under the date of the change the stock status is displayed } } var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.getRange('G2:G403').setValue('0'); ////we reset the "+/-" column to zero } }


Aquí están las imágenes para completar y entender mi pregunta: el final de la hoja de Google

Hay dos fórmulas en las columnas:

Acción: =D2+E2

Consumo: =SI(D2<0;-D2+G2;G2)

la hoja se hace en modo de cálculo iterativo

Gracias por tu ayuda

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!