func (VS *Server) newPayment(c *gin.Context) {
	id := bson.NewObjectId()
	service, b := VS.getOurService(c, "h_records", "newPayment", "service, b := VS.getOurService")
	if !b {
		return
	}
	workerID, b := VS.getIDFromHTML(c, "workerID", "Payment")
	if !b {
		return
	}
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	worker := VS.getUserByID(c, workerID, "h_records", "newPayment", "worker := VS.getUserByID")
	photo, b := VS.getFileFromHTML(c, "photo", worker.Name+"_"+id.Hex(), basePath+"/local-resources/users/"+worker.Username+"/payments/")
	if !b {
		return
	}
	quantity, b := VS.getFloatFromHTML(c, "quantity", "Payment")
	if !b {
		return
	}
	payment := Payment{
		ID:        id,
		IDService: service.ID,
		IDWorker:  workerID,
		Quantity:  quantity,
		Photo:     photo,
		Date:      getTime(),
		IDManager: ManagerID,
	}
	VS.addElementToDatabaseWithRegister(c, payment, payment.ID, service.ID, "handlers_manager", "addPayment", "v.addPaymentToDatabase")
	VS.makePayment(c, payment)
	VS.goodFeedback(c, "records/see/payments/"+idservicetype.Hex())
}
// Stores the new Payment into the DataBase
Stores the new Payment into the DataBase
// Stores the new Payment into the DataBase
func (VS *Server) newPayment(c *gin.Context) {
	id := bson.NewObjectId()
	service, b := VS.getOurService(c, "h_records", "newPayment", "service, b := VS.getOurService")
	if !b {
		return
	}
	workerID, b := VS.getIDFromHTML(c, "workerID", "Payment")
	if !b {
		return
	}
	idservicetype, b := VS.getIDParamFromURL(c, "idservicetype")
	if !b {
		return
	}
	worker := VS.getUserByID(c, workerID, "h_records", "newPayment", "worker := VS.getUserByID")
	photo, b := VS.getFileFromHTML(c, "photo", worker.Name+"_"+id.Hex(), basePath+"/local-resources/users/"+worker.Username+"/payments/")
	if !b {
		return
	}
	quantity, b := VS.getFloatFromHTML(c, "quantity", "Payment")
	if !b {
		return
	}
	payment := Payment{
		ID:        id,
		IDService: service.ID,
		IDWorker:  workerID,
		Quantity:  quantity,
		Photo:     photo,
		Date:      getTime(),
		IDManager: ManagerID,
	}
	VS.addElementToDatabaseWithRegister(c, payment, payment.ID, service.ID, "handlers_manager", "addPayment", "v.addPaymentToDatabase")
	VS.makePayment(c, payment)
	VS.goodFeedback(c, "records/see/payments/"+idservicetype.Hex())
}
func ( VS * Server ) newPayment ( c * gin . Context ) { id := bson . NewObjectId ( ) service , b := VS . getOurService ( c , " " , " " , " " ) if ! b { return } workerID , b := VS . getIDFromHTML ( c , " " , " " ) if ! b { return } idservicetype , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } worker := VS . getUserByID ( c , workerID , " " , " " , " " ) photo , b := VS . getFileFromHTML ( c , " " , worker . Name + " " + id . Hex ( ) , basePath + " " + worker . Username + " " ) if ! b { return } quantity , b := VS . getFloatFromHTML ( c , " " , " " ) if ! b { return } payment := Payment { ID : id , IDService : service . ID , IDWorker : workerID , Quantity : quantity , Photo : photo , Date : getTime ( ) , IDManager : ManagerID , } VS . addElementToDatabaseWithRegister ( c , payment , payment . ID , service . ID , " " , " " , " " ) VS . makePayment ( c , payment ) VS . goodFeedback ( c , " " + idservicetype . Hex ( ) ) }
Stores the new Payment into the DataBase
Stores the new Payment into the DataBase